Resource allocation method and apparatus of examples

By dividing the resource pool into resource zones of varying durations and isolating and scheduling computing resources, the problems of resource fragmentation and high idle rates in cloud computing are solved, thereby improving resource utilization.

CN115550283BActive Publication Date: 2026-03-17ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-20
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In the current cloud computing resource allocation, the uncertain duration of instance usage leads to a significant increase in the overall resource utilization, fragmentation rate, and idle rate in the cloud.

Method used

By setting up isolated first and second resource zones in the resource pool, long-cycle and short-cycle resource request requests are handled respectively, and computing resources are scheduled in isolation according to the different cycles of the instances.

Benefits of technology

It effectively solves the problem of increased resource fragmentation caused by frequent calls to the local optimal scheduling strategy by short-cycle instances, greatly improving the utilization rate of the resource pool and reducing the fragmentation rate and idle rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115550283B_ABST
    Figure CN115550283B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a resource allocation method and device for an instance, comprising: obtaining a resource application request initiated for a resource pool, the resource application request comprising instance configuration information; in response to the resource application request, determining a period type corresponding to the instance configuration information; in a case where the period type is a first period type, allocating computing resources for the instance configuration information from a first resource area in the resource pool to establish a first instance; in a case where the period type is a second period type, allocating computing resources for the instance configuration information from a second resource area in the resource pool to establish a second instance. The present application processes resource application requests of different period types in mutually isolated resource areas, thereby solving the problem of increased resource fragmentation caused by frequent invocation of a local optimal scheduling strategy for short-period instances, and reducing the fragmentation rate and idle rate of the resource pool.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an example of a resource allocation method, apparatus, electronic device, and machine-readable medium. Background Technology

[0002] In the field of cloud computing, users can purchase cloud computing resources to realize related services according to their actual needs.

[0003] In related technologies, the cloud can adopt a real-time optimal scheduling strategy to allocate corresponding cloud computing resources to establish instances based on user creation requests. The real-time optimal scheduling strategy refers to allocating cloud computing resources at the current moment according to the strategy of minimizing resource fragmentation after allocation.

[0004] However, the inventors discovered through research that in the current solution, due to the uncertain duration of instance usage, adopting the above-mentioned real-time optimal scheduling strategy still leads to a significant increase in the overall resource utilization, fragmentation rate, and idle rate in the cloud. Summary of the Invention

[0005] This application provides a resource allocation method for an instance to solve the problem of significantly improving the overall resource utilization, fragmentation rate, and idle rate in the cloud in related technologies.

[0006] Accordingly, embodiments of this application also provide an example of a resource allocation device, an electronic device, and a storage medium to ensure the implementation and application of the above method.

[0007] To address the aforementioned problems, this application discloses a resource allocation method for an instance, the method comprising:

[0008] Obtain a resource request initiated for the resource pool, the resource request including instance configuration information; the resource pool is configured with a first resource zone and a second resource zone;

[0009] In response to the resource request, determine the period type corresponding to the instance configuration information;

[0010] When the cycle type is the first cycle type, computing resources are allocated from the first resource area in the resource pool according to the instance configuration information to establish the first instance;

[0011] When the cycle type is the second cycle type, computing resources are allocated from the second resource area within the resource pool according to the instance configuration information to establish the second instance.

[0012] This application discloses an example of a resource allocation device, the device comprising:

[0013] The acquisition module is used to acquire resource request requests initiated for the resource pool, the resource request including instance configuration information; the resource pool is configured with a first resource zone and a second resource zone;

[0014] A type determination module is used to determine the period type corresponding to the instance configuration information in response to the resource request request;

[0015] The first allocation module is used to allocate computing resources from the first resource area in the resource pool according to the instance configuration information when the period type is the first period type, so as to establish the first instance;

[0016] The second allocation module is used to allocate computing resources from the second resource area within the resource pool based on the instance configuration information when the period type is the second period type, so as to establish a second instance.

[0017] This application also discloses an electronic device, including: a processor; and a memory storing executable code thereon, which, when executed, causes the processor to perform one or more methods as described in this application.

[0018] This application also discloses one or more machine-readable media storing executable code thereon, which, when executed, causes a processor to perform one or more methods as described in this application.

[0019] Compared with related technologies, the embodiments of this application have the following advantages:

[0020] In this embodiment, resource request requests of different cycle types are processed separately by mutually isolated resource areas, thereby performing isolated scheduling of computing resources according to the different cycles of instance creation. This enables effective filling of resource fragments of computing resources of different cycle types during the allocation of computing resources, thereby solving the problem of increased resource fragmentation caused by frequent calls to the local optimal scheduling strategy by short-cycle instances. This greatly improves the utilization rate of the resource pool and reduces the fragmentation rate and idle rate of the resource pool. Attached Figure Description

[0021] Figure 1 This is a system architecture diagram of an embodiment of this application;

[0022] Figure 2 This is a schematic diagram illustrating the instance creation process of related technologies;

[0023] Figure 3 This is a schematic diagram of an instance creation process according to an embodiment of this application;

[0024] Figure 4This is a schematic diagram of a cloud computing process in a logistics scenario according to an embodiment of this application;

[0025] Figure 5 This is a schematic diagram of a high-performance cloud computing scenario according to an embodiment of this application;

[0026] Figure 6 This is a flowchart illustrating the steps of a resource allocation method according to an embodiment of this application.

[0027] Figure 7 This is a flowchart illustrating the specific steps of a resource allocation method according to an embodiment of this application.

[0028] Figure 8 This is a resource scheduling diagram according to an embodiment of this application;

[0029] Figure 9 This is another resource scheduling diagram according to an embodiment of this application;

[0030] Figure 10 This is another resource scheduling diagram according to an embodiment of this application;

[0031] Figure 11 This is another resource scheduling diagram according to an embodiment of this application;

[0032] Figure 12 This is a block diagram of a resource allocation device according to an embodiment of this application;

[0033] Figure 13 This is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation

[0034] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0035] To enable those skilled in the art to better understand this application, the concepts involved in this application are explained below:

[0036] Resource pool: This refers to a platform used to allocate resources for client use, such as cloud computing platforms, cloud service platforms, etc. A resource pool contains allocable computing resources. In response to client requests, the resource pool can allocate computing resources to clients to create instances for executing client computing tasks.

[0037] Computing resources are the hardware and software resources that enable computing. They can be implemented as host devices, which can allocate their own hardware and software resources to clients to create instances.

[0038] Resource request: A request initiated by a user on the client to obtain computing resources from the resource pool to build an instance, so that the instance can meet its own computing needs.

[0039] Instance: In cloud computing scenarios, an instance is a carrier reflecting a user's computing power. Users can apply to build and use instances of corresponding specifications to meet their computing needs. Instance creation is based on an instance, which includes the specifications of basic computing components such as the virtual central processing unit (vCPU), memory, operating system, network, and disk. This instance is used to create virtual machines.

[0040] Instance configuration information: also known as instance specifications, reflects the specifications of the instance requested by the user by showing the instance's resource requirements for hardware and software resources. Different instance specifications result in different job processing efficiencies.

[0041] Resource Zone: In this application, a zone containing local computing resources is set within the resource pool. This application can distinguish user resource request requests into long-term requests and short-term requests, thereby setting up a first resource zone in the resource pool that matches long-term requests and a second resource zone that matches short-term requests.

[0042] Lifecycle type: The type obtained by dividing instances according to their lifecycle. This application divides the instances requested by users into long lifecycle type (first lifecycle type) and short lifecycle type (second lifecycle type), so that the resource request for instance resources can be of long lifecycle type or short lifecycle type. Long lifecycle type means that the lifecycle of the requested instance is longer, and short lifecycle type means that the lifecycle of the requested instance is shorter.

[0043] Resource fragments: refer to computing resources in the resource pool that cannot be allocated or used. Specifically, they can refer to computing resources that are too small to establish a complete instance at the current moment.

[0044] The first abnormal instance is an instance that is actually a short-period type but is misidentified as a long-period type.

[0045] The second abnormal instance is an instance that is actually a long-period type but is misidentified as a short-period type.

[0046] User profile: A data model built on a series of real data (marketing data, usability data). It understands users through characteristic analysis and research, classifies users into different types according to their characteristics, and then extracts typical features from each type and assigns some label elements to form a user profile.

[0047] User equipment refers to the user equipment used by users of the resource platform. User equipment in the resource platform can be user equipment that has been registered on the resource platform and has obtained resource platform certification.

[0048] The resource allocation method described in this application can be applied to cloud service scenarios. For example, one scenario could be a logistics service scenario that differentiates the cloud computing needs of long-cycle and short-cycle customers, and another scenario could be an e-commerce service scenario that differentiates the cloud computing needs of long-cycle and short-cycle customers. This application can differentiate the cloud computing needs of long-cycle and short-cycle customers, and process resource requests from different types of customers separately through isolated resource zones. This allows for isolated scheduling of computing resources based on the short or long cycle of instance creation, thus solving the problem of increased resource fragmentation caused by frequent calls to locally optimal scheduling strategies by short-cycle instances, and greatly improving the utilization rate of the resource pool. Of course, the applicable fields for these scenarios include, but are not limited to, logistics and e-commerce. It is understood that the above application scenarios are merely examples, and this application does not limit the specific application scenarios.

[0049] Reference Figure 1 The diagram illustrates a system architecture provided in an embodiment of this application, including: user equipment, servers, and a resource pool. The computing resources of the resource pool include: at least two host devices.

[0050] User equipment can initiate resource request requests to the server based on actual cloud computing needs, requesting the creation of instances of corresponding specifications to achieve cloud computing. The server can then respond to the user equipment's resource request requests and allocate computing resources from the resource pool to create the instances. The resource request requests may include instance configuration information, which reflects the size and specifications of the instance. For example, instance configuration information may include: 4 processor units and 8 gigabytes of memory, meaning that the instance requested by the user equipment is implemented based on hardware resources of 4 processor units and 8 gigabytes of memory.

[0051] This application embodiment can classify resource request requests initiated by user equipment into two different categories: a first cycle type and a second cycle type, and divide the computing resources of the resource pool into a first resource area for processing resource request requests of the first cycle type and a second resource area for processing resource request requests of the second cycle type. For this resource allocation method, refer to... Figure 1 As can be seen, the first resource area in the resource pool can include host machine 1, host machine 2, ..., host machine n; the second resource area can include host machine n+1, host machine n+2, ..., host machine n+m. The host machine is the specific embodiment of the computing resources in the resource pool. The instance can be established based on the hardware and software resources of the host machine. In this embodiment, preferably, the computing resources required by an instance will not exceed the computing resources that a host machine can provide.

[0052] Specifically, the classification of resource request requests in this application embodiment is based on the duration of the instance corresponding to the request during operation. Specifically, it can be divided into long-cycle type (first cycle type) and short-cycle type (second cycle type). Long-cycle type indicates that the life cycle of the requested instance is relatively long, which can meet long-term computing needs, such as annual or monthly subscription, or continuous use of an instance for more than a preset duration (such as 7 days). Short-cycle type indicates that the life cycle of the requested instance is relatively short, which can meet short-term computing needs, such as continuous use of an instance for less than a preset duration (such as 7 days).

[0053] After implementing the above-mentioned division of resource request period types and the division of the first and second resource areas in the resource pool, the server can, for the resource request sent by the user device, first determine the period type of the resource request, and if the period type is the first period type, allocate computing resources from the first resource area in the resource pool according to the instance configuration information to establish the first instance (long-period instances a, b, c, d); if the period type is the second period type, allocate computing resources from the second resource area in the resource pool according to the instance configuration information to establish the second instance (short-period instances e, f, g, h).

[0054] Furthermore, through comparison with related technologies and the solution of this application, this application specifically illustrates how the embodiments of this application handle resource request requests from different types of customers separately by isolating resource areas, thereby solving the problem of increased resource fragmentation caused by frequent calls to locally optimal scheduling strategies by short-cycle instances in related technologies.

[0055] Reference Figure 2The diagram illustrates the instance creation process of the related technology. At time T1, for the creation requests of instances 1, 2, and 3, the server can create instances 1 and 2 on host device 01 in the resource pool, and create instance 3 on host device 02. At time T2, instance 2 finishes running and releases its resources. At this time, for the creation requests of new instances 4, 5, and 6, the server can create instances 4 and 5 on host device 01 using the resources released by instance 2, and create instance 6 on host device 02. At time T3, instance 5 finishes running and releases its resources. At this time, for the creation requests of new instances 7 and 8, the server can create instance 7 on host device 01 using the resources released by instance 5 and the remaining resources. At this time, the remaining resources on host device 02 are insufficient to create instance 8, so instance 8 is created on the new host device 03. The entire process is executed according to the real-time scheduling optimal strategy. This strategy aims to allocate computing resources in the resource pool according to the dimension of small resource fragmentation at the current moment. However, after scheduling according to local optimality at the current moment, as short-cycle instances (instances 2 and 5) are released, a large number of resource fragments will be released in the host devices. This makes it necessary for newly created instances to fill resource fragments. However, the new instances still have long-cycle and short-cycle types, which leads to the continuous aggravation of fragmentation. For example, when creating instance 8 at time T3, there are many resource fragments in the resource pool (represented by regions x, y, and z respectively), and it occupies 3 host devices.

[0056] Reference Figure 3 This diagram illustrates the instance creation process according to an embodiment of this application. The embodiment divides the resource pool into host devices 11 corresponding to long-cycle types and host devices 12 corresponding to short-cycle types, and distinguishes between long and short-cycle instances. Specifically, at time T1, for creation requests of long-cycle instance 1 and short-cycle instance 12, the server can create instance 1 on host device 11 and instance 2 on host device 12. At time T2, instance 2 finishes running and its resources are released. At this time, for creation requests of new long-cycle instances 3 and 4, and short-cycle instances 5 and 6, the server can create instances 3 and 4 on host device 11 and instances 5 and 6 on host device 12. At time T3, instance 5 finishes running and its resources are released. At this time, for creation requests of new long-cycle instance 7 and short-cycle instance 8, the server can create instance 7 on host device 11 and instance 8 on host device 12.

[0057] As can be seen, the embodiments of this application realize the isolation scheduling of instances according to the distinction of cycle type. According to the above creation order, the resource fragments in long cycle type computing resources (host device 11) can be effectively filled. Especially at time T3, the scheduling requirements of three host devices required by related technologies can be met by two host devices, and the resource fragments are minimized and the overall utilization rate is improved.

[0058] In summary, the embodiments of this application process resource request requests of different cycle types through mutually isolated resource zones, thereby isolating and scheduling computing resources according to the short or long cycle of instance creation. This allows for effective filling of resource fragments for long-cycle computing resources during the allocation process, thus solving the problem of increased resource fragmentation caused by frequent calls to the local optimal scheduling strategy by short-cycle instances. This greatly improves the utilization rate of the resource pool and reduces the fragmentation rate and idle rate of the resource pool.

[0059] It should be noted that the resource allocation method provided in the embodiments of this application can be used in several specific scenarios, as follows:

[0060] In one implementation, refer to Figure 4 This illustration shows a cloud computing process in a logistics scenario provided by an embodiment of this application. In this scenario, there are short-cycle customers who need to calculate package information for a single logistics link (such as sorting, outbound processing, etc.). Assume a parcel sequentially undergoes collection, sorting, transportation, and delivery services. These four services can be implemented by a collection server, a sorting server, a transportation server, and a delivery server, respectively. The collection link is used for centralized storage of parcels; the sorting link is used to transport parcels to a distribution center, and calculates and arranges loading and transportation plans according to the destination and transportation routes of the receiving end, and then implements them; the transportation link is used to realize joint (relay) transportation between different or the same transportation modes; and the delivery link is used to deliver parcels to the receiving end. Each of these four services has its own dedicated operations and maintenance (O&M) team, which has cloud computing requirements for its own service. In addition, there is a headquarters O&M team, which manages the entire logistics lifecycle of express parcels through the headquarters server. Therefore, the headquarters O&M team has overall cloud computing requirements for the four services. It can be seen that the O&M team for each service only needs cloud computing for its own specific service. Since the duration of a single service is relatively short, the cloud computing requirements of the O&M team for each service can be short-term requirements. However, the entire logistics lifecycle of express parcels is relatively long, so the cloud computing requirements of the headquarters O&M team can be long-term requirements.

[0061] In this embodiment, the cloud computing server can classify resource request requests initiated by the headquarters operations team as a first-cycle type (long-cycle type) and resource request requests initiated by single-stage operations teams as a second-cycle type (short-cycle type). It also divides the computing resources of the resource pool into a first resource area for processing first-cycle type requests and a second resource area for processing second-cycle type requests. Upon receiving a resource request from the headquarters operations team, the cloud computing server can allocate computing resources from the first resource area within the resource pool based on instance configuration information to establish a first instance for the headquarters operations team. Similarly, upon receiving a resource request from a single-stage operations team, the cloud computing server can allocate computing resources from the second resource area within the resource pool based on instance configuration information to establish a second instance for the single-stage operations team. This isolation scheduling of computing resources based on the long and short cycles of instance creation reduces fragmentation in the resource pool during logistics scenarios and improves the utilization rate of computing resources.

[0062] In another implementation, refer to Figure 5 This illustration shows a schematic diagram of a high-performance cloud computing scenario provided by an embodiment of this application. Users can purchase computing resources of different specifications according to their actual needs. This embodiment of the application can classify users into those with long-term needs and those with short-term needs based on user profiles. Then, when the cloud computing server receives a resource request initiated by a user with long-term needs, it allocates computing resources from the first resource area within the resource pool according to the instance configuration information to create a first instance for the user with long-term needs. When the cloud computing server receives a resource request initiated by a user with short-term needs, it allocates computing resources from the second resource area within the resource pool according to the instance configuration information to create a second instance for the user with short-term needs. By isolating and scheduling computing resources based on the long and short lifecycles of instance creation, the fragmentation rate in the resource pool under the cloud computing scenario can be reduced, and the utilization rate of computing resources can be improved.

[0063] It should be noted that the process of obtaining resource application requests, instance configuration information, user profile tags, resource purchase types, domain tags, total resource demand, and other information, signals, or data used in this application embodiment is carried out in compliance with the relevant data protection laws and regulations of the country where the location is located, and with the authorization granted by the owner of the corresponding device.

[0064] Reference Figure 6 It illustrates a flowchart of the steps of a resource allocation method provided in an embodiment of this application, including:

[0065] Step 101: Obtain the resource request initiated for the resource pool. The resource request includes instance configuration information; the resource pool has at least two resource zones.

[0066] In this embodiment of the application, at least two resource zones may be set in the resource pool.

[0067] For example, in this embodiment of the application, the computing resources of the resource pool can be divided into a first resource area for processing resource request requests of the first cycle type and a second resource area for processing resource request requests of the second cycle type. This allows for subsequent isolated scheduling of computing resources based on the short or long cycle of instance creation. Furthermore, the resource request sent by the user equipment obtained in this embodiment of the application may include instance configuration information, which reflects the size and specifications of the instance.

[0068] Specifically, regarding the allocation of computing resources in the resource pool, this application embodiment can have multiple allocation methods. For example, in one case, computing resources can be divided into a first resource region and a second resource region according to a preset fixed ratio; in another case, based on historical data and a prediction model, the total first resource demand for instances of the first cycle type and the total second resource demand for instances of the second cycle type can be predicted at future times, and the ratio of the total first resource demand to the total second resource demand can be determined as the ratio of the first resource region to the second resource region. This application embodiment can, through flexible allocation methods, simultaneously ensure that the first resource region has sufficient computing resources to handle resource request requests of the first cycle type, and that the second resource region has sufficient computing resources to handle resource request requests of the second cycle type.

[0069] Of course, you can also set up three or more resource zones, with different resource zones corresponding to different cycle types.

[0070] Step 102: In response to the resource request, determine the cycle type corresponding to the instance configuration information.

[0071] In this embodiment, since most resource fragmentation in the resource pool is caused by frequent release and creation of short-cycle instances in practical applications, this embodiment can divide resource request requests initiated by user equipment into two different categories: a first-cycle type (long-cycle type) and a second-cycle type (short-cycle type). Then, based on the first resource area in the resource pool used to process resource request requests of the first-cycle type and the second resource area used to process resource request requests of the second-cycle type, isolated scheduling of computing resources can be achieved according to the long and short cycles of instance creation, thereby improving the problem of excessive resource fragmentation.

[0072] Step 103: Based on the cycle type, allocate computing resources in the resource pool corresponding to the cycle type for the instance configuration information.

[0073] In this embodiment, since different cycle types correspond to different resource segments, after determining the cycle type, computing resources can be allocated for the instance configuration information within the resource segment corresponding to that cycle type in the resource pool. When the resource request is for creating an instance, the corresponding resources can be allocated to create the instance.

[0074] Optionally, step 103 includes:

[0075] Step 1031: If the cycle type is the first cycle type, allocate computing resources from the first resource area in the resource pool according to the instance configuration information to establish the first instance.

[0076] In this embodiment, when the resource request sent by the user equipment is of the first cycle type (long cycle type), the current user can be considered a user with long cycle demand. The server can allocate computing resources from the first resource area within the resource pool based on the instance configuration information in the resource request to establish a first instance for the user with long cycle demand. By introducing long cycle type resource request into a separate first resource area for processing, the first resource area can handle only long cycle type resource request, reducing the fragmentation interference caused by the frequent release and scheduling of short cycle type instances to the first resource area. In this way, resource fragmentation filling of the first resource area can be quickly achieved through the creation of long cycle instances, reducing the fragmentation rate in the first resource area and improving the resource utilization of the first resource area.

[0077] Step 1032: If the cycle type is the second cycle type, allocate computing resources from the second resource area in the resource pool according to the instance configuration information to establish the second instance.

[0078] In this embodiment, when the resource request sent by the user equipment is of the second cycle type (short cycle type), the current user can be considered a user with short cycle demand. The server can allocate computing resources from the second resource area within the resource pool based on the instance configuration information in the resource request to establish a second instance for the user with short cycle demand. By introducing short cycle type resource request into a separate second resource area for processing, the second resource area can handle only short cycle type resource request. The release speed of short cycle instances deployed in the second resource area is faster, so the new short cycle instances fill the released resource fragments faster, and the fragmentation rate of the second resource area also decreases. This solves the problem of excessive resource fragmentation caused by the mixed creation and release of long and short cycle type instances, reduces the fragmentation rate of the entire resource pool, and improves the resource utilization of the entire resource pool.

[0079] It should be noted that when allocating computing resources in the resource pool, information such as the processor pin identifier and memory physical address of the computing resources can be sent to the user device, so that the user device can access the instance built based on resources such as processor and memory.

[0080] In summary, in this embodiment, resource request requests of different cycle types are processed separately by mutually isolated resource areas, thereby performing isolated scheduling of computing resources according to the different cycles of instance creation. This enables effective filling of resource fragments of computing resources of different cycle types during the allocation of computing resources, thereby solving the problem of increased resource fragmentation caused by frequent calls to the local optimal scheduling strategy by short-cycle instances. This greatly improves the utilization rate of the resource pool and reduces the fragmentation rate and idle rate of the resource pool.

[0081] Reference Figure 7 It illustrates a flowchart of the specific steps of a resource allocation method provided in an embodiment of this application, including:

[0082] Step 201: Obtain the resource request initiated for the resource pool. The resource request includes instance configuration information. The resource pool is configured with a first resource zone and a second resource zone.

[0083] This step can be referred to as step 101 above, and will not be repeated here.

[0084] Optionally, the computing resources in the resource pool include multiple host devices; the first resource area and the second resource area each contain at least some host devices; the host devices in the first resource area and the host devices in the second resource area are different.

[0085] In the embodiments of this application, reference is made to Figure 1A resource pool can consist of multiple host devices, and instances can be established on a host device. Therefore, the division of the first resource area and the second resource area in the resource pool can be achieved by setting the first resource area and the second resource area to each contain at least some host devices, and the host devices of the first resource area (host 1 to host n) and the host devices of the second resource area (host n+1 to host n+m) are different.

[0086] Step 202: In response to the resource request, determine the cycle type corresponding to the instance configuration information.

[0087] This step can be referred to as step 102 above, and will not be repeated here.

[0088] Optionally, in one implementation, the period type corresponds to a user profile tag, and the resource request further includes: a user profile tag corresponding to the period type; step 202 may specifically include:

[0089] Sub-step 2021: Determine the cycle type corresponding to the instance configuration information based on the user profile tags included in the resource request.

[0090] In this embodiment, at least two cycle types can be defined, and users using instances of different cycle types can be categorized and tagged with corresponding user profile labels. Upon receiving a resource request, the user profile labels can be extracted, and the cycle type corresponding to that user profile label can be found to determine the cycle type corresponding to the instance configuration information.

[0091] Optionally, in one implementation, the resource request further includes: a first user profile tag corresponding to the first period type, or a second user profile tag corresponding to the second period type; sub-step 2021 may specifically include:

[0092] Sub-step 20211: If the resource request includes the first user profile tag, determine the first cycle type corresponding to the instance configuration information.

[0093] Sub-step 20212: If the resource request includes the second user profile tag, determine the second cycle type corresponding to the instance configuration information.

[0094] In this embodiment of the application, for sub-steps 20211-20212, refer to Figure 8This illustration shows a resource scheduling diagram provided by an embodiment of this application. During operation, the cloud platform can statistically analyze customer resource profiles with a large number of users based on historical operation records, enabling users to establish corresponding user profile tags. These user profile tags can reflect user characteristics. Resource request requests initiated by user devices can include user profile tags, allowing the cloud computing server to understand the characteristics of the currently accessing user. Furthermore, this embodiment of the application classifies users into long-cycle customers and short-cycle customers through statistical analysis of users' historical computing needs. A first user profile tag corresponding to the first cycle type is added for users with long-cycle needs, and a second user profile tag corresponding to the second cycle type is added for users with short-cycle needs. In this way, the cloud platform server can determine that the instance configuration information corresponds to the first cycle type when the received resource request includes the first user profile tag, and determine that the instance configuration information corresponds to the second cycle type when the received resource request includes the second user profile tag. Thus, the cycle type of the resource request is determined through the user profile tags in the resource request. Subsequently, the server can allocate resource request requests of the first cycle type to the first resource area X for processing, and allocate resource request requests of the second cycle type to the second resource area Y for processing.

[0095] Optionally, the period type corresponds to the instance's maintenance time; step 202 may specifically include:

[0096] Sub-step 2023: Obtain the resource purchase type corresponding to the resource application request;

[0097] Sub-step 2024: Determine the cycle type corresponding to the instance configuration information based on the maintenance time corresponding to the resource purchase type.

[0098] In this embodiment, the period types can be categorized based on the instance's maintenance time, with different maintenance times corresponding to different period types. Similarly, the resource purchase type also corresponds to a maintenance duration. For example, a resource purchase type of purchasing resource 1 for one month is classified as period type A; a resource purchase type of purchasing resource 1 for one year is classified as period type B; and a resource purchase type of purchasing resource 1 for one week is classified as period type C. Therefore, upon receiving a resource request, the corresponding resource purchase type can be determined based on the request, followed by the corresponding maintenance time. Finally, the period type corresponding to the instance configuration information can be determined based on the maintenance time.

[0099] Optionally, in another implementation, the first period type is a long period type where the instance's maintenance time is greater than or equal to a preset duration, and the second period type is a short period type where the instance's maintenance time is less than the preset duration. Sub-step 2024 may specifically include:

[0100] Sub-step 20241: If the resource purchase type is long-term, determine the instance configuration information as the first-term type.

[0101] Sub-step 20242: If the resource purchase type is short-cycle type, determine the instance configuration information to be second-cycle type.

[0102] In this embodiment, regarding sub-steps 20241-20242, in a cloud computing scenario, users can purchase instances with specifications that meet their actual computing needs according to different resource purchase types. Resource purchase types are categorized into long-term and short-term types. Long-term instances can be used continuously without change within a long period, while short-term instances only remain unchanged within a short period. The preset duration for determining the long / short-term type can be set according to actual needs; preferably, the preset duration is 7 days. The resource purchase type can be recorded in the user-initiated resource request. The cloud platform server can determine the instance configuration information corresponding to the first period type if the received resource request has a long-term purchase type, and determine the instance configuration information corresponding to the second period type if the received resource request has a short-term purchase type. Thus, the period type of the resource request is determined by the resource purchase type corresponding to the resource request.

[0103] Specifically, refer to Figure 9 This illustrates another resource scheduling diagram provided by the embodiments of this application, which further subdivides the resource purchase type into long-term types such as annual / monthly subscription, long-term pay-as-you-go, and short-term pay-as-you-go. Annual / monthly subscription and pay-as-you-go are two different instance usage modes. The annual / monthly subscription mode refers to the mode in which the user pays the full amount of the annual / monthly subscription in advance before using the instance. Pay-as-you-go is the mode in which the user uses the instance without paying, and after the use is completed, a bill is generated and payment is made based on the specifications and duration of the instance used. Therefore, when a user's resource purchase type is a long-term annual / monthly subscription or a long-term pay-as-you-go plan, the user can be considered a long-term customer. When a user's resource purchase type is a short-term pay-as-you-go plan, the user can be considered a short-term customer. Thus, in this embodiment, resource application requests initiated by user devices are distinguished by resource purchase type. Based on the first resource zone X and the second resource zone Y that have been divided in the resource pool, resource application requests with the long-term annual / monthly subscription or long-term pay-as-you-go plan are allocated to the first resource zone X for processing, while resource application requests with the short-term pay-as-you-go plan are allocated to the second resource zone Y for processing.

[0104] Alternatively, in another implementation, the period type corresponds to the domain type; step 202 may specifically include:

[0105] Sub-step 2026: Obtain the domain tag from the resource request;

[0106] Sub-step 2027: Determine the cycle type corresponding to the instance configuration information based on the domain label.

[0107] In this embodiment, the cycle types can be categorized based on users from different domains, with different domain tags corresponding to different cycle types, since users from different domains generally have similar usage habits for instances. Therefore, upon receiving a resource request, the domain tag can be determined based on the resource request, and then the cycle type corresponding to the instance configuration information can be determined based on the domain tag.

[0108] Alternatively, in another implementation, the first periodic type corresponds to the first domain type, and the second periodic type corresponds to the second domain type. Sub-step 2027 may specifically include:

[0109] Sub-step 20271: If the domain label belongs to the first domain type, determine that the instance configuration information is the first cycle type.

[0110] Sub-step 20272: If the domain label belongs to the second domain type, determine that the instance configuration information is the second cycle type.

[0111] In this embodiment, when dealing with new customers, since historical information analysis of these new customers is lacking, this embodiment can extract the user's domain tag. This domain tag records the user's domain (logistics, e-commerce, etc.) and categorizes the domain tags into a first domain type (long-cycle type) and a second domain type (short-cycle type) based on the domain's long-term and short-term characteristics. For example, the food delivery domain has a large amount of computational demand during peak meal times, but little or no computational demand at other times; map navigation has a large amount of computational demand during morning and evening rush hours, but little or no computational demand at other times; while the express delivery domain has stable computational demand over a long period due to the 24 / 7 transportation of express parcels. Therefore, the food delivery domain and map navigation domain can be identified as the first domain type, and the express delivery domain as the second domain type.

[0112] Thus, if the domain tag in the resource request belongs to the first domain type, the cloud platform's server can determine that the instance configuration information is of the first cycle type. If the domain tag in the resource request belongs to the second domain type, the cloud platform's server can determine that the instance configuration information is of the second cycle type.

[0113] Step 203: If the cycle type is the first cycle type, select a host machine with the first cycle type tag to establish the first instance based on the instance configuration information.

[0114] Among them, the host equipment in the first resource zone has the first cycle type label.

[0115] Step 204: If the cycle type is the second cycle type, select a host machine with the second cycle type tag to establish a second instance based on the instance configuration information.

[0116] Among them, the host equipment in the second resource zone has a second cycle type label.

[0117] In this embodiment of the application, for steps 203-204, refer to Figure 1 Based on the characteristic that a resource pool consists of multiple host devices, to distinguish between host devices in the first resource zone and those in the second resource zone, a first periodicity type tag can be added to host devices in the first resource zone, and a second periodicity type tag can be added to host devices in the second resource zone. Thus, when the periodicity type of a resource request is the first periodicity type, this embodiment, specifically based on instance configuration information, can select a host device with the first periodicity type tag to establish a first instance. When the periodicity type of a resource request is the second periodicity type, this embodiment, specifically based on instance configuration information, can select a host device with the second periodicity type tag to establish a second instance.

[0118] It should be noted that after determining the cycle type of the resource request, a first cycle type tag can be added to the resource request of the first cycle type, and a second cycle type tag can be added to the resource request of the second cycle type. In this way, when allocating resources, resource allocation can be achieved by matching the cycle type tags of the resource request and the host machine.

[0119] Optionally, the first period type is a long-period type where the instance's maintenance time is greater than or equal to a preset duration, and the second period type is a short-period type where the instance's maintenance time is less than the preset duration. The method may also include:

[0120] Step 205: Obtain the first abnormal instance in the first resource area. The first abnormal instance is an instance that is actually of the second cycle type but was mistakenly identified as the first cycle type.

[0121] Step 206: If the amount of allocable computing resources in the second resource area is less than or equal to a preset threshold, determine the target computing resources allocated to the first abnormal instance in the first resource area.

[0122] Step 207: Migrate the first instance running in the target computing resource (excluding the first abnormal instance) to other computing resources in the first resource area (excluding the target computing resource).

[0123] Step 208: After the migration is completed, the target computing resources will be allocated to the second resource zone.

[0124] In this embodiment of the application, for steps 205-208, refer to Figure 10 This illustration shows another resource scheduling diagram provided by an embodiment of this application. Due to the limited accuracy of predicting the short and long cycles of user needs, in a few cases, instances that are actually of the short-cycle type may be misclassified as long-cycle types. Additionally, changes in a user's actual computing needs may cause a change in the cycle type of the instance requested by the user. When this change first occurs, historical predictions cannot immediately detect it on the cloud platform's servers. For example, if a user previously had long-cycle computing needs, and a new short-cycle service is launched at a certain time, the original method of identifying the request cycle type based on user profile tags cannot detect this change. The cloud platform needs to provide cloud services to the user for a period of time before it will detect it. In this situation, instances that are actually of the short-cycle type may also be misclassified as long-cycle types.

[0125] This application embodiment can identify a first abnormal instance from a first resource region. The first abnormal instance is an instance that is actually a short-cycle type but is misjudged as a long-cycle type. For the first abnormal instance, the local region X1 in the first resource region X is determined. Then, if the amount of computing resources that can be allocated in the second resource region Y is less than or equal to a preset threshold, the normal first instance running in the local region X1 is first migrated to other computing resources in the first resource region other than the local region X1. Then, the local region X1 is divided into the second resource region Y to realize the resource expansion of the second resource region Y. In situations where the computing resources of the second resource region Y are insufficient and there are many misclassified short-cycle type instances in the first resource region X, this approach, through the hot migration of normal first instances running in local region X1, not only ensures the normal operation of normal first instances in local region X1, but also further expands the resources of the second resource region Y, making up for the insufficient computing resources in the second resource region Y. In addition, it also classifies the misclassified short-cycle type instances in the first resource region X into the correct resource regions for operation, further improving the resource utilization rate of the second resource region Y.

[0126] It should be noted that the first abnormal instance in the local area X1 to be merged into the second resource area Y can be limited by a threshold. For example, by using a quantity threshold, the number of the first abnormal instances in the local area X1 to be merged into the second resource area Y can be limited to be greater than or equal to a preset quantity threshold; by using a total resource usage threshold, the total resource usage of the first abnormal instance in the local area X1 to be merged into the second resource area Y can be limited to be greater than or equal to a preset total resource usage threshold.

[0127] Specifically, step 205 may include:

[0128] Sub-step 2051: Obtain the runtime of the first instance running in the first resource area.

[0129] Sub-step 2052: Mark the first instance whose running time is less than the preset duration as the first abnormal instance.

[0130] In this embodiment of the application, for sub-steps 2051-2052, since the first instance is a long-cycle type instance, the cloud platform server can determine whether the first instance is the first abnormal instance based on the preset duration and the real-time determined running time of the first instance. Specifically, the first instance with a running time less than the preset duration (such as 7 days) is marked as the first abnormal instance (its original long-cycle type label is changed to a short-cycle type label). Since the host devices in the first resource area can have long-cycle type labels, by labeling the first abnormal instance, the server can compare the label consistency between the first instance and the deployed host devices through an inspection task. If the two labels are inconsistent, the first instance is quickly identified as the first abnormal instance.

[0131] Optionally, the method may also include:

[0132] Step 209: If the amount of allocable computing resources in the second resource area is less than or equal to a preset threshold, determine the idle computing resources in the first resource area. Idle computing resources are computing resources that are not running the first instance, or computing resources whose total resource usage of the running first instance is less than the preset resource threshold.

[0133] Step 210: Allocate at least a portion of the idle computing resources in the first resource zone to the second resource zone.

[0134] In this embodiment, regarding steps 209-210, if the amount of allocable computing resources in the second resource region is less than or equal to a preset threshold, it can be considered that the number of allocable computing resources in the second resource region is extremely small, and the second resource region faces the problem of excessive load. To solve the above problem, this embodiment can schedule some idle computing resources from the first resource region and allocate them to the second resource region to expand the second resource region and reduce its load. Furthermore, if the allocable computing resources in both the first and second resource regions are insufficient, then computing resources in both regions need to be replenished as soon as possible.

[0135] It should be noted that when the idle computing resources are host devices that are not running the first instance, these host devices can be directly assigned to the second resource area; when the idle computing resources are host devices whose total resource usage of the running first instance is less than the preset resource threshold, the first instance in these host devices can be migrated to other computing resources in the first resource area other than the idle computing resources, and then these host devices can be assigned to the second resource area.

[0136] Optionally, the first period type is a long-period type where the instance's maintenance time is greater than or equal to a preset duration, and the second period type is a short-period type where the instance's maintenance time is less than the preset duration. The method may also include:

[0137] Step 211: Obtain the second abnormal instance in the second resource area. The second abnormal instance is an instance that is actually of the first cycle type but was mistakenly identified as the second cycle type.

[0138] Step 212: Allocate the computing resources in the second resource zone that were allocated to the second abnormal instance to the first resource zone.

[0139] In this embodiment of the application, for steps 211-212, refer to Figure 11 This illustration shows another resource scheduling diagram provided by an embodiment of this application. Due to the limited accuracy of predicting the long and short cycles based on user needs, in a few cases, instances that are actually of the long cycle type may be misclassified as short cycle type. Additionally, changes in the user's actual computing needs may also cause instances that are actually of the long cycle type to be misclassified as short cycle type.

[0140] This application embodiment can identify a second abnormal instance from the second resource area. The second abnormal instance is an instance that is actually a long-cycle type but is misjudged as a short-cycle type. The existence of the second abnormal instance will cause a lot of resource fragmentation in the local area Y1 where the second abnormal instance is located in the second resource area Y due to the frequent creation and release of subsequent short-cycle instances. Therefore, this application embodiment can directly divide the local area Y1 where the second abnormal instance is located in the second resource area Y into the first resource area X. After the division, the second abnormal instance (short-cycle instance) originally in the local area Y1 will be quickly released due to its short-cycle characteristics, and a long-cycle instance will be scheduled into the local area Y1. This allows the local area Y1 to quickly fill the resource fragmentation through the long-cycle instance, so as to quickly allocate the computing resources of the local area Y1 to the optimal state. In addition, the new short-cycle instance will also be correctly scheduled to the second resource area, which will not cause too much resource fragmentation, thereby realizing the resource pool and pool.

[0141] It should be noted that thresholds can be used to limit the number of second abnormal instances in the local area Y1 to be merged into the first resource area X. For example, a quantity threshold can be used to limit the number of second abnormal instances in the local area Y1 to be merged into the first resource area X to be greater than or equal to a preset quantity threshold; a total resource usage threshold can be used to limit the total resource usage of the second abnormal instances in the local area Y1 to be greater than or equal to a preset total resource usage threshold. Furthermore, since the resource pool consists of multiple host devices, and the host devices are distinguished by long and short period tags, the allocation of local area Y1 to the first resource area X can be achieved by changing the tags of the host devices in local area Y1 from short period tags to long period tags. Similarly, the allocation of local area X1 to the second resource area Y can be achieved by changing the tags of the host devices in local area X1 from long period tags to short period tags.

[0142] Specifically, step 211 may include:

[0143] Sub-step 2111: Obtain the running time of the second instance running in the second resource area.

[0144] Sub-step 2112: Mark the second instance whose running time is greater than or equal to the preset duration as the second abnormal instance.

[0145] In this embodiment of the application, for sub-steps 2111-2112, since the second instance is a short-cycle type instance, the cloud platform server can determine whether the second instance is a second abnormal instance based on the preset duration and the real-time determined running time of the second instance. Specifically, the second instance with a running time greater than or equal to the preset duration (such as 7 days) is marked as a second abnormal instance (its original short-cycle type label is changed to a long-cycle type label). Since the host devices in the second resource area can have short-cycle type labels, by tagging the second abnormal instance, the server can compare the label consistency between the second instance and the deployed host device through an inspection task. If the two labels are inconsistent, the second instance is quickly identified as a second abnormal instance.

[0146] Optionally, the method may also include:

[0147] Step 213: Obtain the total resource requirements of historical instance configuration information of period type at a historical time.

[0148] Step 214: Based on historical time, total resource demand, and prediction model, obtain the predicted total resource amount of the periodic type instance configuration information at future time.

[0149] Step 215: Based on the total predicted resource amount for each cycle type, divide the resource pool into resource zones corresponding to each cycle type.

[0150] In this embodiment of the application, historical usage data under different cycle types can be used to predict the total predicted resources for different cycle types, and then the resource pool can be divided according to the total predicted resources for each cycle type.

[0151] Optionally, step 213 includes: sub-step 2131, obtaining the first total resource requirement of the historical instance configuration information of the first period type at the historical moment, and the second total resource requirement of the historical instance configuration information of the second period type.

[0152] Step 214 includes: Sub-step 2141, based on historical time, first total resource demand, second total resource demand and prediction model, obtaining the first predicted total resource amount of instance configuration information of the first period type and the second predicted total resource amount of instance configuration information of the second period type at future time.

[0153] Step 215 includes: Sub-step 2151, dividing the resource pool into a first resource zone and a second resource zone based on the first predicted total resource amount and the second predicted total resource amount.

[0154] Optionally, step 2151 can be implemented by dividing the resource pool into a first resource zone and a second resource zone according to a first ratio of the first predicted total resource amount and the second predicted total resource amount, such that a second ratio of the resource amount in the first resource zone and the resource amount in the second resource zone is equal to the first ratio.

[0155] In this embodiment of the application, for steps 2131-2151, refer to Figure 8 This application provides a method for dividing a first resource zone and a second resource zone. Specifically, a prediction model can be trained based on the total first resource demand of historical instance configuration information for a first-period type and the total second resource demand of historical instance configuration information for a second-period type at a historical time. This allows the prediction model to learn the correlation between historical instance configuration information for different period types and different times. After training, the prediction model can predict the total first resource demand (long-term demand A) and the total second resource demand (short-term demand B) of instance configuration information for a first-period type at a future time based on the total first and second resource demands at a historical time. The ratio of the total first resource demand to the total second resource demand (long-term demand A / short-term demand B) is then determined as the ratio of the first resource zone X to the second resource zone Y. This application embodiment can ensure, through a flexible division method, that both the first resource zone has sufficient computing resources to process resource request requests for the first-period type, and the second resource zone has sufficient computing resources to process resource request requests for the second-period type.

[0156] In summary, this application embodiment processes resource request requests of different cycle types separately by using mutually isolated resource areas, thereby performing isolated scheduling of computing resources according to the long and short cycle of instance creation. This allows for effective filling of resource fragments for long-cycle computing resources during the allocation process, thus solving the problem of increased resource fragmentation caused by frequent calls to the local optimal scheduling strategy by short-cycle instances. This greatly improves the utilization rate of the resource pool and reduces the fragmentation rate and idle rate of the resource pool.

[0157] Reference Figure 12 It shows a block diagram of a resource allocation apparatus according to an embodiment of this application, including:

[0158] The acquisition module 301 is used to acquire resource request requests initiated for the resource pool. The resource request requests include instance configuration information. The resource pool is configured with a first resource zone and a second resource zone.

[0159] The type determination module 302 is used to determine the cycle type corresponding to the instance configuration information in response to the resource request request;

[0160] The resource allocation module 303 is used to allocate computing resources in the resource pool corresponding to the period type based on the instance configuration information, according to the period type.

[0161] Resource allocation module 303 includes:

[0162] The first allocation module is used to allocate computing resources from the first resource area in the resource pool according to the instance configuration information when the period type is the first period type, so as to establish the first instance;

[0163] The second allocation module is used to allocate computing resources from the second resource area within the resource pool based on the instance configuration information, in the case of the second period type, to establish a second instance.

[0164] Optionally, the first cycle type is a long cycle type where the instance's maintenance time is greater than or equal to a preset duration, and the second cycle type is a short cycle type where the instance's maintenance time is less than the preset duration. The device further includes:

[0165] The first anomaly identification module is used to obtain the first anomaly instance in the first resource area. The first anomaly instance is an instance that is actually of the second cycle type but was mistakenly identified as the first cycle type.

[0166] The first judgment module is used to determine the target computing resources allocated to the first abnormal instance in the first resource area when the amount of allocable computing resources in the second resource area is less than or equal to a preset threshold.

[0167] The first migration module is used to migrate the first instance (excluding the first abnormal instance) running in the target computing resource to other computing resources in the first resource area (excluding the target computing resource);

[0168] The first reassignment module is used to allocate the target computing resources to the second resource zone after the migration is completed.

[0169] Optionally, the device further includes:

[0170] The second judgment module is used to determine the idle computing resources in the first resource area when the amount of allocable computing resources in the second resource area is less than or equal to a preset threshold. Idle computing resources are computing resources that are not running the first instance, or computing resources whose total resource usage of the running first instance is less than the preset resource threshold.

[0171] The second allocation module is used to allocate at least a portion of the idle computing resources in the first resource zone to the second resource zone.

[0172] Optionally, the first anomaly detection module includes:

[0173] The first acquisition submodule is used to acquire the runtime of the first instance running in the first resource area;

[0174] The first determination submodule is used to mark the first instance whose running time is less than a preset duration as the first abnormal instance.

[0175] Optionally, the first cycle type is a long cycle type where the instance's maintenance time is greater than or equal to a preset duration, and the second cycle type is a short cycle type where the instance's maintenance time is less than the preset duration. The device further includes:

[0176] The second anomaly identification module is used to obtain the second anomaly instance in the second resource area. The second anomaly instance is an instance that is actually of the first cycle type but was mistakenly identified as the second cycle type.

[0177] The third allocation module is used to allocate the computing resources allocated to the second abnormal instance in the second resource zone to the first resource zone.

[0178] Optionally, the second anomaly detection module includes:

[0179] The second acquisition submodule is used to acquire the running time of the second instance running in the second resource area;

[0180] The second determination submodule is used to mark a second instance whose running time is greater than or equal to a preset duration as a second abnormal instance.

[0181] Optionally, the computing resources in the resource pool include multiple host devices; the first resource area and the second resource area each contain at least some host devices; the host devices in the first resource area and the host devices in the second resource area are different.

[0182] Optionally, the host devices in the first resource zone have a first periodicity type label; the host devices in the second resource zone have a second periodicity type label.

[0183] The first allocation module includes:

[0184] The first allocation submodule is used to select a host machine with a first cycle type tag to establish the first instance based on the instance configuration information;

[0185] The second allocation module includes:

[0186] The second allocation submodule is used to select a host machine with a second cycle type tag to establish a second instance based on the instance configuration information.

[0187] Optionally, the period type corresponds to the user profile tag, and the resource request also includes: the user profile tag corresponding to the period type;

[0188] The type determination module 302 is also used to determine the period type corresponding to the instance configuration information based on the user profile tags included in the resource request.

[0189] Optionally, the resource request may also include: a first user profile tag corresponding to the first period type, or a second user profile tag corresponding to the second period type;

[0190] Type determination module 302 includes:

[0191] The third determination submodule is used to determine the first cycle type corresponding to the instance configuration information when the resource request includes the first user profile tag;

[0192] The fourth determination submodule is used to determine the second cycle type corresponding to the instance configuration information when the resource request includes the second user profile tag.

[0193] Optionally, the period type corresponds to the instance's maintenance time; the type determination module 302 is also used to: obtain the resource purchase type corresponding to the resource application request; and determine the period type corresponding to the instance configuration information based on the maintenance time corresponding to the resource purchase type.

[0194] Optionally, the first cycle type is a long-cycle type where the instance's maintenance time is greater than or equal to a preset duration, and the second cycle type is a short-cycle type where the instance's maintenance time is less than a preset duration. The type determination module 302 includes:

[0195] The purchase type submodule is used to obtain the resource purchase type corresponding to the resource application request;

[0196] The fifth determination submodule is used to determine the instance configuration information as the first cycle type when the resource purchase type is long cycle type;

[0197] The sixth determination submodule is used to determine the instance configuration information as the second cycle type when the resource purchase type is short cycle type.

[0198] Optionally, the period type corresponds to the instance's duration;

[0199] The type determination module 302 is also used to obtain the resource purchase type corresponding to the resource application request; and to determine the period type corresponding to the instance configuration information based on the maintenance time corresponding to the resource purchase type.

[0200] Optionally, the first periodic type corresponds to the first domain type, and the second periodic type corresponds to the second domain type. The type determination module 302 includes:

[0201] The domain tagging submodule is used to retrieve domain tags from resource request requests;

[0202] The seventh determination submodule is used to determine the instance configuration information as the first cycle type when the domain label belongs to the first domain type;

[0203] The eighth determination submodule is used to determine the instance configuration information as the second cycle type when the domain label belongs to the second domain type.

[0204] Optionally, the device further includes:

[0205] The historical information module is used to obtain the total resource requirements of historical instance configuration information of period type at a historical moment;

[0206] The prediction module is used to obtain the predicted total resource amount of the periodic type instance configuration information at the future time based on historical time, total resource demand and prediction model;

[0207] The partitioning module is used to divide the resource pool into resource zones corresponding to each cycle type based on the total predicted resource volume for each cycle type.

[0208] Optionally, the historical information module is also used to obtain the first total resource requirement of the historical instance configuration information of the first period type at a historical moment, and the second total resource requirement of the historical instance configuration information of the second period type.

[0209] The prediction module is also used to obtain the first predicted total resource amount of the first period type instance configuration information and the second predicted total resource amount of the second period type instance configuration information based on historical time, first total resource demand, second total resource demand and prediction model at future time.

[0210] The partitioning module is also used to divide the resource pool into a first resource zone and a second resource zone based on the first and second resource prediction totals.

[0211] Optionally, the modules are divided, including:

[0212] The ratio module is used to divide the resource pool into a first resource zone and a second resource zone based on a first ratio of the first predicted total resource amount and the second predicted total resource amount, such that a second ratio of the resource amount in the first resource zone and the resource amount in the second resource zone is equal to the first ratio.

[0213] In summary, this application embodiment processes resource request requests of different cycle types separately by using mutually isolated resource regions, thereby performing isolated scheduling of computing resources according to the short or long cycle of instance creation. This allows for effective filling of resource fragments for long-cycle computing resources during the allocation process, thus solving the problem of increased resource fragmentation caused by frequent calls to the local optimal scheduling strategy by short-cycle instances. This greatly improves the utilization rate of the resource pool and reduces the fragmentation rate and idle rate of the resource pool.

[0214] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions for the method steps in this application.

[0215] This application provides one or more machine-readable media storing instructions that, when executed by one or more processors, cause an electronic device to perform one or more of the methods described in the above embodiments. In this application, the electronic device includes various types of devices such as terminal devices and servers (clusters).

[0216] The embodiments of this disclosure can be implemented as an apparatus configured as desired using any suitable hardware, firmware, software, or any combination thereof, including electronic devices such as terminal devices, servers (clusters), etc. Figure 13 An exemplary apparatus 1000 is schematically shown that can be used to implement the various embodiments described in the embodiments of this application.

[0217] In one embodiment, Figure 13 An exemplary device 1000 is shown, which includes one or more processors 1002, a control module (chipset) 1004 coupled to at least one of the processors 1002, a memory 1006 coupled to the control module 1004, a non-volatile memory (NVM) / storage device 1008 coupled to the control module 1004, one or more input / output devices 1010 coupled to the control module 1004, and a network interface 1012 coupled to the control module 1004.

[0218] Processor 1002 may include one or more single-core or multi-core processors, and processor 1002 may include any combination of general-purpose processors or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, device 1000 can serve as a terminal device, server (cluster), or other device as described in the embodiments of this application.

[0219] In some embodiments, apparatus 1000 may include one or more computer-readable media (e.g., memory 1006 or NVM / storage device 1008) having instructions 1014 and one or more processors 1002 that are combined with the one or more computer-readable media and configured to execute instructions 1014 to implement modules and thereby perform the actions described in this disclosure.

[0220] In one embodiment, the control module 1004 may include any suitable interface controller to provide any suitable interface to at least one of the processors 1002 and / or any suitable device or component communicating with the control module 1004.

[0221] The control module 1004 may include a memory controller module to provide an interface to the memory 1006. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0222] Memory 1006 may be used, for example, to load and store data and / or instructions 1014 for device 1000. In one embodiment, memory 1006 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, memory 1006 may include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).

[0223] In one embodiment, the control module 1004 may include one or more input / output controllers to provide interfaces to the NVM / storage device 1008 and (one or more) input / output devices 1010.

[0224] For example, NVM / storage device 1008 may be used to store data and / or instructions 1014. NVM / storage device 1008 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable (one or more) non-volatile storage devices (e.g., one or more hard disk drives (HDDs), one or more optical disc drives (CDs), and / or one or more digital universal optical disc (DVD) drives).

[0225] NVM / storage device 1008 may include storage resources that are physically part of a device on which device 1000 is mounted, or that are accessible to the device but do not necessarily have to be part of the device. For example, NVM / storage device 1008 may be accessed via a network via one or more input / output devices 1010.

[0226] One or more input / output devices 1010 may provide an interface for device 1000 to communicate with any other suitable device. Input / output devices 1010 may include communication components, audio components, sensor components, etc. Network interface 1012 may provide an interface for device 1000 to communicate via one or more networks. Device 1000 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, such as accessing wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, etc., or combinations thereof.

[0227] In one embodiment, at least one of the processors 1002 may be logically packaged with one or more controllers (e.g., memory controller modules) of the control module 1004. In one embodiment, at least one of the processors 1002 may be logically packaged with one or more controllers of the control module 1004 to form a system-in-package (SiP). In one embodiment, at least one of the processors 1002 may be integrated with the logic of one or more controllers of the control module 1004 on the same die. In one embodiment, at least one of the processors 1002 may be integrated with the logic of one or more controllers of the control module 1004 on the same die to form a system-on-a-chip (SoC).

[0228] In various embodiments, device 1000 may be, but is not limited to, a terminal device such as a server, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet computer, netbook, etc.). In various embodiments, device 1000 may have more or fewer components and / or different architectures. For example, in some embodiments, device 1000 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0229] The detection device can use a main control chip as a processor or control module, and sensor data, position information, etc. can be stored in a memory or NVM / storage device. The sensor group can be used as an input / output device, and the communication interface can include a network interface.

[0230] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0231] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0232] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0233] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more blocks of a block diagram.

[0234] These computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable terminal equipment, provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of a block diagram.

[0235] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0236] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0237] The resource allocation method, apparatus, electronic device, and machine-readable medium of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A resource allocation method of an example, characterized by, The method comprises: obtaining a resource application request initiated for a resource pool, the resource application request comprising instance configuration information; the resource pool is provided with at least two resource areas, the resource area is a local computing resource area provided in the resource pool; wherein the resource pool is provided with a first resource area and a second resource area; in response to the resource application request, determining the period type corresponding to the instance configuration information; according to the period type, allocating computing resources in the resource area corresponding to the period type in the resource pool for the instance configuration information; obtaining a first abnormal instance in the first resource area, the first abnormal instance is an instance that is actually of the second period type but is misjudged as the first period type; in the case where the resource amount of the allocable computing resources in the second resource area is less than or equal to a preset threshold, determining the target computing resources allocated to the first abnormal instance in the first resource area; migrating the first instance running in the target computing resources except the first abnormal instance to other computing resources except the target computing resources in the first resource area; after completing the migration, dividing the target computing resources to the second resource area; wherein the first period type is a long period type with a maintenance time of the instance being greater than or equal to a preset time length, and the second period type is a short period type with a maintenance time of the instance being less than the preset time length.

2. The method of claim 1, wherein, The method further comprises: in the case where the resource amount of the allocable computing resources in the second resource area is less than or equal to a preset threshold, determining the idle computing resources in the first resource area, the idle computing resources being computing resources without running first instances or computing resources with a total resource occupation amount of the running first instances being less than a preset resource amount threshold; dividing at least part of the idle computing resources in the first resource area to the second resource area.

3. The method of claim 2, wherein, The method further comprises: obtaining the running time of the first instance running in the first resource area; marking the first instance with a running time less than the preset time length as the first abnormal instance.

4. The method of claim 1, wherein, The first period type is a long period type with a maintenance time of the instance being greater than or equal to a preset time length, and the second period type is a short period type with a maintenance time of the instance being less than the preset time length, the method further comprises: obtaining a second abnormal instance in the second resource area, the second abnormal instance being an instance that is actually of the first period type but is misjudged as the second period type; ​ 5. The method of claim 2, wherein, ​ ​ The computing resource allocated to the second abnormal instance in the second resource slice is divided into the first resource slice.

6. The method of claim 5, wherein, The obtaining of the second abnormal instance in the second resource slice comprises: obtaining a running time of a running second instance in the second resource slice; marking a second instance with a running time greater than or equal to the preset time length as the second abnormal instance.

7. The method of claim 2, wherein, The computing resources in the resource pool comprise a plurality of host devices; the resource slices each comprise at least part of the host devices; and the host devices in each resource slice are different.

8. The method of claim 7, wherein, The host devices in the first resource slice have a first periodic type label; and the host devices in the second resource slice have a second periodic type label. The allocating of the computing resource in the first resource slice in the resource pool for the instance configuration information to establish the first instance comprises: selecting a host device with the first periodic type label for the instance configuration information to establish the first instance; The allocating of the computing resource in the second resource slice in the resource pool for the instance configuration information to establish the second instance comprises: selecting a host device with the second periodic type label for the instance configuration information to establish the second instance.

9. The method according to any one of claims 1-8, characterized in that, The periodic type corresponds to a user portrait label; and the resource application request further comprises a user portrait label corresponding to the periodic type. The determining of the periodic type corresponding to the instance configuration information in response to the resource application request comprises: determining the periodic type corresponding to the instance configuration information according to the user portrait label included in the resource application request.

10. The method according to any one of claims 2-8, characterized in that, The periodic type corresponds to a maintenance time of an instance. The determining of the periodic type corresponding to the instance configuration information in response to the resource application request comprises: obtaining a resource purchase type corresponding to the resource application request; determining the periodic type corresponding to the instance configuration information according to a maintenance time corresponding to the resource purchase type.

11. An apparatus for resource allocation of an example, comprising: The method comprises: obtaining a resource application request initiated for a resource pool, the resource application request comprising instance configuration information; the resource pool being provided with a first resource slice and a second resource slice, the resource slice being a slice provided in the resource pool and comprising local computing resources; determining a periodic type corresponding to the instance configuration information in response to the resource application request; allocating computing resources in a resource slice corresponding to the periodic type in the resource pool for the instance configuration information according to the periodic type; The apparatus further comprises: a first abnormality identification module configured to obtain a first abnormal instance in the first resource slice, the first abnormal instance being an instance actually of a second periodic type but misjudged as a first periodic type; a first judgment module configured to determine target computing resources allocated to the first abnormal instance in the first resource slice when the resource amount of the allocable computing resources in the second resource slice is less than or equal to a preset threshold. a first migration module, configured to migrate first instances running in the target computing resource except the first abnormal instance to other computing resources in the first resource slice except the target computing resource; a first reallocation module, configured to divide the target computing resource to the second resource slice after the migration is completed; wherein the first periodic type is a long periodic type with a maintenance time of an instance being greater than or equal to a preset time length, and the second periodic type is a short periodic type with a maintenance time of an instance being less than the preset time length.

12. An electronic device, comprising: comprising: a processor; a memory having executable code stored thereon, which, when executed, causes the processor to perform the method of any one of claims 1 to 10.

13. A machine readable medium having executable code stored thereon, which, when executed, causes a processor to perform the method of any one of claims 1 to 10.

Citation Information

Patent Citations

  • Resource configuration method and device, electronic equipment and computer readable storage medium

    CN113419846A

  • Resource control method and device for function calculation, equipment and medium

    CN114579305A