Instance scheduling methods, apparatus, electronic devices, and computer-readable storage media

By calculating the supply and demand complementarity relationship through machine profiles of instances and host machines, and optimizing instance scheduling using cluster analysis, the problem of low resource utilization in existing technologies is solved, and efficient utilization of host machine resources is achieved.

CN116820664BActive Publication Date: 2026-11-17CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210687880.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-16
Publication Date
2026-11-17
Estimated Expiration
2042-06-16

AI Technical Summary

Technical Problem

Existing virtual machine and container instance scheduling mechanisms are only triggered when there is a load imbalance within the host cluster, which is inefficient and cannot effectively improve resource utilization.

Method used

By calculating the supply and demand complementarity relationship through machine profiles of instances and host machines, and using cluster analysis with the host machine as the cluster center, the instance scheduling is optimized in a reasonable way to improve resource utilization.

Benefits of technology

This achieves a high degree of matching between the resource needs and supply of instances and host machines, improving the resource utilization of host machines and enhancing the performance of computer systems and enterprise efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116820664B_ABST
    Figure CN116820664B_ABST
Patent Text Reader

Abstract

This application provides an instance scheduling method, apparatus, electronic device, and computer-readable storage medium. The instance scheduling method includes: obtaining a first instance set and a first host set; obtaining a machine profile for each instance in the first instance set and each host in the first host set; calculating the supply-demand complementarity relationship between each instance and each host based on the machine profile of each instance and the machine profile of each host; classifying each instance in the first instance set based on the supply-demand complementarity relationship between each instance in the first instance set and each host in the first host set, using each host in the first host set as a cluster center; and outputting a scheduling result for each instance in the first instance set based on the classification result of each instance in the first instance set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer applications, and more particularly to an instance scheduling method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] In the data information age, considering factors such as data security, building their own data centers has become an inevitable path for most large and medium-sized enterprises in their IT transformation. However, building their own data centers also brings huge hardware costs to enterprises. How to effectively improve the resource utilization of the host machine and save costs has become a key factor affecting enterprise efficiency.

[0003] As a critical part of data center architecture, optimizing the scheduling of virtual machines, containers, and other instances is the most convenient and effective way to improve the resource utilization of the host machine. However, existing virtual machines, containers, and other instances only trigger the instance scheduling mechanism when there is a load imbalance within the host machine cluster. This instance scheduling mechanism is inefficient and cannot effectively improve resource utilization. Summary of the Invention

[0004] To address the aforementioned technical problems, embodiments of this application provide an instance scheduling method, apparatus, electronic device, and computer-readable storage medium, which can calculate the supply and demand complementarity between instances and the host machine based on the machine profiles of instances and the host machine, rationally optimize instance scheduling, and effectively improve the resource utilization rate of the host machine.

[0005] This application provides an instance scheduling method, including:

[0006] Obtain the first set of instances and the first set of host machines;

[0007] Obtain the machine profile of each instance in the first instance set, and the machine profile of each host in the first host set;

[0008] Based on the machine profile of each instance in the first instance set and the machine profile of each host in the first host set, the supply and demand complementarity relationship between each instance and each host is calculated. The supply and demand complementarity relationship refers to the relationship between the resources required by the instance and the resources supplied by the host. The resources required by the instance and the resources supplied by the host are represented by the machine profile of the instance and the machine profile of the host, respectively.

[0009] Using each host in the first host set as a cluster center, and based on the supply and demand complementarity between each instance in the first instance set and each host in the first host set, each instance in the first instance set is classified.

[0010] Based on the classification results of each instance in the first instance set, the scheduling results of each instance in the first instance set are output.

[0011] This application also provides an instance scheduling device, including:

[0012] The target set acquisition unit is used to acquire the first instance set and the first host set;

[0013] The machine profile acquisition unit is used to acquire the machine profile of each instance in the first instance set and the machine profile of each host in the first host set.

[0014] The supply and demand complementarity calculation unit is used to calculate the supply and demand complementarity relationship between each instance and each host based on the machine profile of each instance in the first instance set and the machine profile of each host in the first host set. The supply and demand complementarity relationship refers to the relationship between the resources required by the instance and the resources supplied by the host. The resources required by the instance and the resources supplied by the host are represented by the machine profile of the instance and the machine profile of the host, respectively.

[0015] A clustering unit is used to classify each instance in the first instance set based on the supply and demand complementarity between each instance in the first instance set and each host in the first host set, with all host machines in the first host set as cluster centers;

[0016] The output unit is used to output the scheduling result of each instance in the first instance set based on the classification result of each instance in the first instance set.

[0017] This application also provides an electronic device, including a processor and a memory, the memory for storing computer programs, and the processor for calling and running the computer programs stored in the memory to execute the instance scheduling method provided in this application.

[0018] This application also provides a computer-readable storage medium storing executable instructions, characterized in that, when the executable instructions are executed by a processor, they implement the instance scheduling method provided in this application.

[0019] This application provides an instance scheduling method, apparatus, electronic device, and computer-readable storage medium. The instance scheduling method includes: acquiring a first instance set and a first host set; acquiring a machine profile of each instance in the first instance set and a machine profile of each host in the first host set; calculating the supply-demand complementarity relationship between each instance and each host based on the machine profiles of each instance and each host in the first host set, wherein the supply-demand complementarity relationship refers to the relationship between the resources required by the instance and the resources supplied by the host, and the resources required by the instance and the resources supplied by the host are represented by the machine profiles of the instance and the host, respectively; classifying each instance in the first instance set based on the supply-demand complementarity relationship between each instance and each host in the first host set, using each host in the first host set as a cluster center; and outputting the scheduling result of each instance in the first instance set based on the classification result of each instance in the first instance set.

[0020] In this embodiment of the application, by obtaining the machine profile of each instance in the first instance set and the machine profile of each host in the first host set, the supply and demand complementarity relationship between each instance and each host is calculated; and based on the supply and demand complementarity relationship, the instance scheduling is reasonably optimized, which can effectively improve the resource utilization rate of the host. Attached Figure Description

[0021] Figure 1 A flowchart illustrating the machine profiling method provided in this application embodiment;

[0022] Figure 2 This is a schematic diagram of the structure of the machine portrait device provided in the embodiments of this application;

[0023] Figure 3 A flowchart illustrating the instance scheduling method provided in this application embodiment;

[0024] Figure 4 A schematic diagram of the structure of the instance scheduling device provided in the embodiments of this application;

[0025] Figure 5 A flowchart illustrating the instance scheduling method provided in the application embodiments of this application;

[0026] Figure 6 A flowchart illustrating the method for obtaining a machine profile of a host machine provided in an application embodiment of this application;

[0027] Figure 7 A flowchart illustrating a method for predicting future resource utilization characteristics of host machine resources, provided in an application embodiment of this application.

[0028] Figure 8 A flowchart illustrating a method for classifying each instance in the first instance set, provided for an application embodiment of this application;

[0029] Figure 9 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0031] It should be noted that, in the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, in the embodiments of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0032] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.

[0033] To facilitate understanding of the technical solutions of the embodiments of this application, the relevant technologies of the embodiments of this application are described below. The following relevant technologies are optional solutions and can be combined with the technical solutions of the embodiments of this application in any way, and they all fall within the protection scope of the embodiments of this application.

[0034] In the data information age, considering data security and other factors, building their own data centers has become an inevitable path for most large and medium-sized enterprises in their IT transformation. However, building their own data centers also brings huge hardware costs to enterprises. How to effectively improve the resource utilization of the host machine and save costs has become a key factor affecting enterprise efficiency. As a key part of the data center architecture, optimizing the scheduling of virtual machines, containers, and other instances is the most convenient and effective way to improve the resource utilization of the host machine.

[0035] The following introduces several instance scheduling solutions:

[0036] Solution A: This solution trains a pre-defined Extreme Learning Machine (ELM) model using valid historical data from the resource pool, resulting in multiple trained ELM models. Based on the prediction duration and prediction reference error of each trained ELM model, an optimal ELM model is selected. Valid historical data and estimated business data volume are then input into the optimal ELM model, and the prediction result is output. This solution improves the efficiency and accuracy of resource pool utilization prediction by training a pre-defined ELM model with historical data, obtaining multiple trained ELM models, and then selecting an optimal ELM model to predict resource pool utilization.

[0037] Solution B: This solution provides a resource scheduling system, including monitoring components, cross-cloud management components, global scheduling components, and user management components. These can be deployed on different host machines or virtual machines, or simultaneously on the same host machine or virtual machine. It also provides a resource scheduling method, including monitoring information collection, lifecycle management, and dynamic scheduling for each sub-cloud environment. This solution provides unified resource management across cloud environments, balancing the utilization of each resource pool; unified user permission management across cloud environments, prioritizing the use of important resources; automatic collection of all resource information across cloud environments, dynamically scheduling resources as business changes occur, achieving reasonable resource reallocation; support for cross-cloud scheduling and dynamic optimization; support for Service-Level Agreements (SLAs) for more reasonable resource allocation; and persistent data through monitoring and statistics, providing a visual interface.

[0038] Option C: In this option, the management entity host classifies the server entity hosts into redundant entity hosts and live entity hosts. The management entity host determines the migration path from the virtual hosts running on the redundant entity hosts to the live entity hosts. Based on the migration path, the management entity host determines the parallel migration sequence of the virtual hosts running on the redundant entity hosts. According to the parallel migration sequence, the management entity host migrates the virtual hosts running on the redundant entity hosts to the live entity hosts in parallel.

[0039] Based on the above description, the proposed solution has the following drawbacks:

[0040] For Option A: Although it improves the efficiency and accuracy of resource pool utilization prediction, it does not improve resource utilization.

[0041] For Option B: Although the resource pool utilization rate was balanced through multi-objective optimized resource scheduling, and the reasonable redistribution of resources was achieved, it still does not fall under the category of improving resource utilization.

[0042] For Option C: By managing physical hosts, virtual machines can be migrated from redundant physical hosts to live physical hosts. The purpose is to maximize the number of redundant physical hosts that can be shut down. Although the number of physical hosts is reduced, this option does not consider the supply and demand relationship between virtual machines and hosts for physical host clusters, and there is still considerable room for improvement in its resource utilization.

[0043] To address at least some of the aforementioned deficiencies, the following technical solutions based on embodiments of this application are proposed.

[0044] To provide a more detailed understanding of the features and technical content of this application, the implementation of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit this application. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] This application provides a machine profiling method, such as... Figure 1 As shown, Figure 1 This is a flowchart illustrating the machine profiling method provided in an embodiment of this application. The machine profiling method includes:

[0046] Step 101: Based on the resource utilization characteristics of at least one resource of the target device, construct the feature space of the target device, wherein the resource utilization characteristics include multiple resource utilization characteristics corresponding to the resource in multiple usage periods;

[0047] Step 102: Based on the feature space of the target device, calculate the weight of each resource utilization feature of each resource of the target device;

[0048] Step 103: Construct a machine profile of the target device based on the weights of the resource utilization features of each resource of the target device.

[0049] The multiple usage periods refer to multiple time periods within the sampling period.

[0050] In the above embodiments, a feature space for the target device is constructed using the resource utilization characteristics of at least one resource of the target device. This considers not only the resource utilization rates of different categories of resources in the target device but also the temporal characteristics of the resource utilization rates of each resource. This yields the weight of each resource utilization characteristic for each resource of the target device, and a multi-dimensional machine profile of the target device is constructed based on these weights. This allows for the acquisition of a more refined machine profile, providing a more reliable foundation for observing the resource utilization characteristics of the target device's resources.

[0051] In order to more comprehensively and accurately observe the resource utilization characteristics of the target equipment, practical applications should consider not only the historical resource utilization characteristics of the target equipment, but also its future resource utilization characteristics. Only by integrating the historical and future resource utilization characteristics of the target equipment can a comprehensive machine profile be described.

[0052] Based on this, in one embodiment, the machine profiling method further includes:

[0053] Based on the historical resource utilization characteristics of at least one resource of the target equipment, predict the future resource utilization characteristics of at least one resource of the target equipment.

[0054] By fusing the historical resource utilization rate characteristics of at least one resource of the target device with its corresponding future resource utilization rate characteristics, the resource utilization rate characteristics of at least one resource of the target device are obtained.

[0055] In practical applications, since the resource utilization characteristics of the resource include multiple resource utilization characteristics corresponding to multiple usage periods, the multiple resource utilization characteristics of each resource of the target device corresponding to multiple usage periods together constitute a time series based on its corresponding multiple periods. If it is necessary to predict the future resource utilization characteristics corresponding to each resource of the target device, time series analysis methods can preferably be used. That is, the future resource utilization characteristics corresponding to each resource of the target device can be predicted through a time series model.

[0056] Based on this, in one embodiment, predicting the future resource utilization characteristics of at least one resource of the target device based on the historical resource utilization characteristics of at least one resource of the target device includes:

[0057] Based on the historical resource utilization characteristics of at least one resource of the target device, the future resource utilization characteristics of at least one resource of the target device are predicted through a time series model.

[0058] Among them, the Autoregression Moving Average (ARIMA) model is currently the most commonly used time series model. Its model structure is simple, and when using the ARIMA model for prediction, only endogenous variables are needed, without the need for other exogenous variables.

[0059] Therefore, in one embodiment, the time series model adopts the ARIMA model.

[0060] Furthermore, the resource utilization rate of the target device's hardware resources is a bottleneck restricting the performance improvement of the computer system and a key factor affecting enterprise efficiency. In practical applications, the hardware resources of the target device refer to the hardware resources of the computer system, typically including processors, memory, and disks. In this embodiment, since bandwidth and the number of Transmission Control Protocol (TCP) connections can also reflect the performance and resource utilization rate of the computer system, bandwidth and TCP connections are also included in the resource categories considered. The resource utilization rate of the TCP connections refers to the ratio of the current number of TCP connections of the computer system to the maximum number of TCP connections it can handle.

[0061] Accordingly, in one embodiment, the resources include at least one of the following: processor, memory, disk, bandwidth, and TCP connection.

[0062] The resource utilization of the target device, such as processor, memory, disk, bandwidth, and TCP connections, exhibits different characteristics at different times of day, such as weekdays versus weekends and daytime versus nighttime. Therefore, to comprehensively observe the resource utilization characteristics of the target device, the temporal aspect of resource utilization should also be considered.

[0063] Based on this, in one embodiment, the resource utilization characteristic of the resource includes at least one of the following characteristics:

[0064] Within the sampling period, the resource utilization characteristics on weekdays and on non-working days;

[0065] Within the sampling period, the resource has multiple resource utilization characteristics corresponding to multiple time periods on the same day.

[0066] Furthermore, in this embodiment, the feature space of the target device, since it represents multiple resource utilization features of at least one resource of the target device, is expressed as a high-dimensional matrix. To more intuitively observe each resource utilization feature of each resource of the target device, in this embodiment, a machine profile of the target device is constructed using the weights of each resource utilization feature of each resource of the target device.

[0067] The method for calculating the weight of each resource utilization feature of each resource of the target device can employ the Singular Value Decomposition (SVD) algorithm. The SVD algorithm can reduce the dimensionality of multidimensional data. When performing singular value decomposition using the SVD algorithm, the original matrix can be reconstructed using the non-zero singular values ​​obtained from its calculation. In the embodiments of this application, the non-zero singular values ​​obtained represent the weight of each resource utilization feature of each resource of the target device.

[0068] Based on this, in one embodiment, calculating the weight of each resource utilization feature of each resource of the target device based on the feature space of the target device includes:

[0069] Based on the feature space of the target device, the weight of each resource utilization feature of each resource of the target device is calculated using the SVD algorithm.

[0070] This application provides a machine profiling method, comprising: constructing a feature space of a target device based on the resource utilization characteristics of at least one resource of the target device, wherein the resource utilization characteristics of the resource include multiple resource utilization characteristics corresponding to the resource in multiple usage periods; calculating the weight of each resource utilization characteristic of each resource of the target device based on the feature space of the target device; and constructing a machine profile of the target device based on the weight of each resource utilization characteristic of each resource of the target device.

[0071] In this embodiment, a feature space for the target device is constructed based on the resource utilization characteristics of at least one resource of the target device. This comprehensively considers the resource category and temporal characteristics of resource utilization, thereby obtaining the weight of each resource utilization characteristic for each resource of the target device. A multi-dimensional machine profile of the target device is then constructed based on these weights. Furthermore, the machine profile method described above can be used to construct machine profiles for both instances and the host machine. The supply-demand complementarity between instances and the host machine can be calculated using these machine profiles, allowing for rational instance scheduling and effectively improving the resource utilization of the host machine.

[0072] To implement the machine profiling method provided in this application embodiment, this application embodiment also provides a machine profiling device, which is installed on an electronic device. Figure 2 This is a schematic diagram of the structure of the machine imaging device provided in the embodiments of this application, as shown below. Figure 2 As shown, the machine portrait device 200 includes:

[0073] The feature space construction unit 201 is used to construct the feature space of the target device based on the resource utilization characteristics of at least one resource of the target device, wherein the resource utilization characteristics of the resource include multiple resource utilization characteristics corresponding to the resource in multiple usage periods.

[0074] The feature weight calculation unit 202 is used to calculate the weight of each resource utilization feature of each resource of the target device based on the feature space of the target device;

[0075] Machine profiling unit 203 is used to construct a machine profile of the target device based on the weights of each resource utilization feature of each resource of the target device.

[0076] In one embodiment, the machine portrait device 200 further includes:

[0077] The prediction unit is used to predict the future resource utilization characteristics of at least one resource of the target device based on the historical resource utilization characteristics of at least one resource of the target device.

[0078] The acquisition unit is used to fuse the historical resource utilization rate characteristics of at least one resource of the target device with its corresponding future resource utilization rate characteristics to obtain the resource utilization rate characteristics of at least one resource of the target device.

[0079] Specifically, the prediction unit is used for:

[0080] Based on the historical resource utilization characteristics of at least one resource of the target equipment, the future resource utilization characteristics of at least one resource of the target equipment are predicted using a time series model. The time series model adopted is the ARIMA model.

[0081] In one embodiment, the resources include at least one of the following: processor, memory, disk, bandwidth, and TCP connection. The resource utilization characteristics of the resources include at least one of the following characteristics:

[0082] Within the sampling period, the resource utilization characteristics on weekdays and on non-working days;

[0083] Within the sampling period, the resource has multiple resource utilization characteristics corresponding to multiple time periods on the same day.

[0084] The feature weight calculation unit 202 is specifically used for:

[0085] Based on the feature space of the target device, the weight of each resource utilization feature of each resource of the target device is calculated using the SVD algorithm.

[0086] Those skilled in the art should understand that Figure 2 The functions of each unit in the machine portrait device 200 shown can be understood by referring to the relevant description of the machine portrait method described above. Figure 2The functions of each unit in the machine image device 200 shown can be implemented by a program running on a processor or by specific logic circuits.

[0087] It should be noted that the machine profiling device 200 provided in the above embodiments is only illustrated by the division of the above-described program units. In practical applications, the above processing can be assigned to different program units as needed, that is, the internal structure of the system can be divided into different program units to complete all or part of the processing described above. In addition, the machine profiling device 200 provided in the above embodiments and the machine profiling method embodiments belong to the same concept, and its specific implementation process can be found in the method embodiments, which will not be repeated here.

[0088] The machine profile of the target device obtained by the machine profiling method provided in this application embodiment can comprehensively and accurately observe the resource utilization characteristics of each resource of the target device.

[0089] In the data information era, to effectively improve the performance of computer systems and the efficiency of enterprises, the machine profiling method provided in this application can be used to profile instances and host machines, which are the target devices, and observe the resource utilization characteristics of each resource of the instance and the host machine respectively. The instance can be a virtual machine, container, etc., configured on the host machine, and consumes the host machine's resources during runtime. Through instance scheduling, a high degree of matching between the resource requirements of the instance and the resource supply of the host machine is achieved, aggregating instances to some host machines, increasing the number of idle host machines, releasing idle resources, improving resource utilization, and thus effectively improving the performance of the computer system and the efficiency of the enterprise.

[0090] Based on this, embodiments of this application also provide an instance scheduling method, such as... Figure 3 As shown. Figure 3 This is a flowchart illustrating the instance scheduling method provided in an embodiment of this application. The instance scheduling method includes:

[0091] Step 301: Obtain the first instance set and the first host set;

[0092] Step 302: Obtain the machine profile of each instance in the first instance set and the machine profile of each host in the first host set;

[0093] Step 303: Based on the machine profile of each instance in the first instance set and the machine profile of each host in the first host set, calculate the supply and demand complementarity relationship between each instance and each host. The supply and demand complementarity relationship refers to the relationship between the resources required by the instance and the resources supplied by the host. The resources required by the instance and the resources supplied by the host are represented by the machine profile of the instance and the machine profile of the host, respectively.

[0094] Step 304: Using each host in the first host set as a cluster center, classify each instance in the first instance set based on the supply and demand complementarity between each instance in the first instance set and each host in the first host set;

[0095] Step 305: Based on the classification result of each instance in the first instance set, output the scheduling result of each instance in the first instance set.

[0096] In step 302, the machine profile of each instance in the first instance set and the machine profile of each host in the first host set are obtained by the machine profiling method; the machine profiling method adopts the machine profiling method provided in the embodiments of this application.

[0097] Here, the supply-demand complementarity refers to the relationship between the resources required by an instance and the resources supplied by the host machine. Therefore, in the first instance set, if the machine profile of a first instance indicates low resource utilization, it means that the first instance requires relatively few resources. Conversely, in the first host machine set, if the machine profile of a first host machine indicates high resource utilization, it means that the first host machine supplies relatively few resources. In other words, the supply-demand complementarity between the first instance and the first host machine is significant. Therefore, when scheduling instances, it is preferable to schedule the first instance onto the first host machine to achieve a high degree of matching between the instance's resource requirements and the host machine's resource supply, thereby improving resource utilization and effectively enhancing the performance of the computer system and the enterprise's efficiency.

[0098] Based on this, in this embodiment of the application, the idea of ​​cluster analysis is introduced. Each host in the first host set is used as the cluster center. The instances in the first instance set that have the greatest supply and demand complementarity with the same host in the first host set are divided into one category, thereby optimizing instance scheduling and improving the resource utilization of the host.

[0099] In this embodiment, the purpose of optimizing instance scheduling is to improve the resource utilization of the host machine. Therefore, the better classification effect of clustering analysis is reflected in this application by classifying as many instances as possible into the same category, that is, increasing the number of idle host machines to release idle resources. In clustering analysis, in order to achieve better classification results, the commonly used method is to introduce a clustering iteration process.

[0100] Therefore, in one embodiment, before outputting the scheduling result based on the classification result of each instance in the first instance set, the method further includes:

[0101] Perform the following clustering iteration process:

[0102] Determine whether the host machines in the first host machine set meet the clustering iteration termination condition;

[0103] If so, the clustering iteration terminates;

[0104] If not, the first host set is updated based on the preset update rules, and a new round of clustering iteration is performed until the clustering iteration termination condition is met.

[0105] Since host machine resources are limited and cannot support an unlimited number of instances, it is necessary to confirm whether there are any host machines in the first set that meet the exit supply conditions before executing the clustering iteration process. If so, since the instances in its corresponding category have the greatest supply-demand complementarity relationship with it, the classification result of the instances in its corresponding category can be fixed, and the clustering iteration process will not be executed again for the aforementioned host machines and the instances in their corresponding categories.

[0106] Based on this, in one embodiment, before performing the clustering iteration process, the method further includes:

[0107] Determine whether there exists a host in the first host set that meets the exit supply conditions; if so, then:

[0108] Remove the host machines that meet the exit conditions from the first host machine set; and

[0109] Remove instances from the first instance set corresponding to the category of the host machine that meets the exit conditions, and record the classification result of the instances removed from the first instance set; and

[0110] The first host set is reconstructed using the remaining host machines in the first host set, and the first instance set is reconstructed using the remaining instances in the first instance set.

[0111] Furthermore, in order to obtain better classification results, classify as many instances as possible into the same category, and increase the number of idle host machines, in this embodiment of the application, the update rule for updating the first host machine set can be set to remove the host machines located in the load sorting interval from the first host machine set during each clustering iteration.

[0112] Based on this, in one embodiment, the update rule is:

[0113] Based on all instances contained in the category corresponding to each host in the first host set, each host in the first host set is sorted by load.

[0114] Based on a preset load sorting interval, host machines located within the load sorting interval in the first host machine set are removed from the host machine set.

[0115] In one embodiment, the load sorting interval can be set to the lower end of the load sorting interval, preferably the bottom 10%. In practical applications, a better classification effect can also be obtained by setting a smaller load sorting interval and performing more clustering iterations.

[0116] Obviously, for the host machines that are removed from the first host machine set due to the update rules, the instances in their corresponding categories need to be put back into the first instance set for reclassification.

[0117] According to the clustering analysis concept, the clustering results converge and the classification results are better when the number of clustering iterations reaches a threshold. However, in this embodiment, since the number of host machines cannot support an unlimited number of instances, if each host machine in the first host machine set meets the exit condition before the number of clustering iterations reaches the threshold, that is, each host machine has no surplus resources, then the clustering iteration process should also be terminated.

[0118] Accordingly, in one embodiment, the clustering iteration termination condition includes at least one of the following conditions:

[0119] The number of clustering iterations reaches the threshold.

[0120] Each host in the first host set meets the exit conditions.

[0121] In one embodiment, the threshold number of times is preferably 5 times, meaning the number of idle host machines is 50% of the total number of host machines. In practical applications, the threshold number of times can be adaptively modified according to actual needs.

[0122] Furthermore, in one embodiment, the withdrawal supply conditions include at least one of the following conditions:

[0123] The average value of all resource utilization characteristics of all resources in the first resource set is greater than the first threshold value;

[0124] In the first resource set, there exists at least one resource whose maximum resource utilization rate characteristic is greater than the second threshold value;

[0125] The first resource set includes the resources of all instances contained in the category corresponding to the host machine.

[0126] To describe the exit supply condition more intuitively, the exit supply condition is expressed mathematically as follows:

[0127]

[0128] in, Let γ1 represent the utilization rate characteristic of the i-th resource in the first resource set, γ2 represent the first threshold value, and γ2 represent the second threshold value.

[0129] In this embodiment, since instance scheduling is based on clustering analysis, and the similarity between different samples is typically represented by the distance between a sample and its cluster center, in one embodiment, the supply-demand complementarity relationship can also be represented using the distance space between the host machine and the instance. Furthermore, to better distinguish the impact of each resource utilization rate on the supply-demand complementarity relationship, the distance space should also incorporate the weighting factor corresponding to each resource utilization rate.

[0130] Based on this, in one embodiment, the method for calculating the supply-demand complementarity relationship is as follows:

[0131] Based on the feature space of the host machine and the feature space of the instance, a distance space between the host machine and the instance is obtained. The distance space is constructed based on the following distance: the distance between each resource utilization feature of each resource in the feature space of the host machine and each resource utilization feature of each resource in the feature space of the corresponding instance.

[0132] Based on the distance space and the weights of each resource utilization feature of each resource, the supply and demand complementarity relationship between the host machine and the instance is calculated.

[0133] To more intuitively describe the complementary supply and demand relationship, in this embodiment of the application, the complementary supply and demand relationship is expressed by a mathematical expression as follows:

[0134]

[0135] Among them, D ab This represents the complementary supply and demand relationship between host machine a and instance b. A represents the feature space of host machine a, B represents the feature space of instance b, and W...m*n This represents the weight of each resource utilization feature for each resource. Since the weights of each resource utilization feature for each resource on both the host machine and the instance indicate the influence factors of resource utilization features of different types of resources at different times, and are unrelated to whether the resource user is the host machine or the instance, in this embodiment, the weights of each resource utilization feature for each resource can be the weights of each resource utilization feature for each resource on the host machine, or the weights of each resource utilization feature for each resource on the instance.

[0136] To implement the instance scheduling method provided in the embodiments of this application, the embodiments of this application also provide an instance scheduling device, which is installed on an electronic device. Figure 4 This is a schematic diagram of the structure of the instance scheduling device provided in the embodiments of this application, as shown below. Figure 4 As shown, the instance scheduling device 400 includes:

[0137] The target set acquisition unit 401 is used to acquire the first instance set and the first host set;

[0138] The machine profile acquisition unit 402 is used to acquire the machine profile of each instance in the first instance set and the machine profile of each host in the first host set.

[0139] The supply and demand complementarity calculation unit 403 is used to calculate the supply and demand complementarity relationship between each instance and each host based on the machine profile of each instance in the first instance set and the machine profile of each host in the first host set. The supply and demand complementarity relationship refers to the relationship between the resources required by the instance and the resources supplied by the host. The resources required by the instance and the resources supplied by the host are represented by the machine profile of the instance and the machine profile of the host, respectively.

[0140] Clustering unit 404 is used to classify each instance in the first instance set based on the supply and demand complementarity between each instance in the first instance set and each host in the first host set, with all host machines in the first host set as cluster centers;

[0141] The output unit 405 is used to output the scheduling result of each instance in the first instance set based on the classification result of each instance in the first instance set.

[0142] The calculation method for the supply-demand complementarity relationship is as follows:

[0143] Based on the feature space of the host machine and the feature space of the instance, a distance space between the host machine and the instance is obtained. The distance space is constructed based on the following distance: the distance between each resource utilization feature of each resource in the feature space of the host machine and each resource utilization feature of each resource in the feature space of the corresponding instance.

[0144] Based on the distance space and the weights of each resource utilization feature of each resource, the supply and demand complementarity relationship between the host machine and the instance is calculated.

[0145] In one embodiment, the instance scheduling device 400 further includes:

[0146] An iterative unit is used to perform clustering iterations; the iterative unit includes:

[0147] The first judgment unit is used to determine whether the host machines in the host machine set meet the clustering iteration termination condition;

[0148] The first execution unit is used for

[0149] If the judgment result of the first judgment unit is yes, then the clustering iteration is terminated;

[0150] If the judgment result of the first judgment unit is negative, the host set is updated based on the preset update rule, and a new round of clustering iteration is performed until the judgment result of the first judgment unit is positive.

[0151] The clustering iteration termination condition includes at least one of the following conditions:

[0152] The number of clustering iterations reaches the threshold.

[0153] Each host in the first host set meets the exit conditions.

[0154] The update rule is as follows:

[0155] Based on all instances contained in the category corresponding to each host in the first host set, each host in the first host set is sorted by load.

[0156] Based on a preset load sorting interval, host machines located within the load sorting interval in the first host machine set are removed from the host machine set.

[0157] In one embodiment, the instance scheduling device 400 further includes:

[0158] The second judgment unit is used to determine whether there is a host in the first host set that meets the exit supply conditions;

[0159] The second execution unit is configured to, if the judgment result of the second judgment unit is yes,

[0160] Then, the host machine that meets the exit conditions will be removed from the first host machine set; and

[0161] Remove instances from the first instance set corresponding to the category of the host machine that meets the exit conditions, and record the classification result of the instances removed from the first instance set; and

[0162] The first host set is reconstructed using the remaining host machines in the first host set, and the first instance set is reconstructed using the remaining instances in the first instance set.

[0163] The conditions for withdrawing from supply include at least one of the following:

[0164] The average value of all resource utilization characteristics of all resources in the first resource set is greater than the first threshold value;

[0165] In the first resource set, there exists at least one resource whose maximum resource utilization rate characteristic is greater than the second threshold value;

[0166] The first resource set includes the resources of all instances contained in the category corresponding to the host machine.

[0167] Those skilled in the art should understand that Figure 4 The functions of each unit in the instance scheduling device 400 shown can be understood by referring to the relevant description of the aforementioned instance scheduling method. Figure 4 The functions of each unit in the instance scheduling device 400 shown can be implemented by a program running on a processor or by specific logic circuits.

[0168] It should be noted that the instance scheduling device 400 provided in the above embodiments is only illustrated by the division of the above-described program units when performing instance scheduling. In actual applications, the above processing can be assigned to different program units as needed, that is, the internal structure of the system can be divided into different program units to complete all or part of the processing described above. In addition, the instance scheduling device 400 provided in the above embodiments and the instance scheduling method embodiments belong to the same concept, and its specific implementation process can be found in the method embodiments, which will not be repeated here.

[0169] Based on the architecture of the above-described instance scheduling device 400, the present application will be further described below in conjunction with application embodiments.

[0170] like Figure 5 As shown, Figure 5 A flowchart illustrating the instance scheduling method provided in the application embodiments of this application, the instance scheduling method comprising:

[0171] Step 501: Obtain the first instance set and the first host set; the instance refers to all instances that the host needs to host and schedule, including virtual machines, containers, etc.

[0172] Step 502: Obtain the machine profile of each instance in the first instance set and the machine profile of each host machine in the first host machine set using the machine profiling method; wherein, since the method for obtaining the machine profile of the instance is the same as the method for obtaining the machine profile of the host machine, the method for obtaining the machine profile of the host machine will be used as an example for further explanation in this application embodiment.

[0173] Specifically, such as Figure 6 As shown, Figure 6 This is a flowchart illustrating a method for obtaining a host machine profile according to an application embodiment of this application. The method for obtaining a host machine profile according to an application embodiment of this application includes the following steps:

[0174] Step 601: Obtain the resource utilization characteristics of at least one resource of the host machine;

[0175] Specifically, it includes the following steps:

[0176] The resource utilization characteristics of at least one resource of the host machine are identified spatially and temporally.

[0177] The space represents the resource category of the host machine. In this embodiment, the resource category of the host machine includes processor, memory, disk, bandwidth, and TCP connection.

[0178] The time period represents the resource utilization characteristics of different types of resources on the host machine at different times. In this embodiment, the resource utilization characteristics of different types of resources on the host machine at different times are obtained on a weekly basis. Specifically, this includes resource utilization characteristics for weekdays (Monday-Friday), weekends (Saturday-Sunday), daytime (8:00-20:00), and nighttime (20:00-8:00). It also includes resource utilization characteristics on a daily basis: 00:00-04:00, 04:00-08:00, 08:00-12:00, 12:00-16:00, 16:00-20:00, and 20:00-24:00.

[0179] Table 1 is constructed using the resource utilization characteristics of the host machine's processor at different time periods as an example. Table 1 shows the resource utilization characteristics of the host machine's processor at different time periods:

[0180]

[0181]

[0182] Table 1. Resource utilization characteristics of the host machine's processor at different time periods.

[0183] As shown in Table 1, since the host machine selects 5 resource categories in the application embodiment of this application, the host machine obtains a total of 50 spatiotemporal fusion resource utilization characteristics based on the above 10 time identifiers.

[0184] The resource utilization rate characteristic value mentioned in Table 1 can be calculated using the average historical resource utilization rate over a 30-day period. Taking the resource utilization rate characteristic from 0:00 to 4:00 as an example, the average historical resource utilization rate over a 30-day period can be calculated and used as the historical resource utilization rate characteristic value from 0:00 to 4:00.

[0185] To more comprehensively and accurately observe the resource utilization characteristics of a host machine, practical applications should consider not only its historical resource utilization characteristics but also its future resource utilization characteristics. Only by integrating both historical and future resource utilization characteristics can a complete machine profile of the host machine be described.

[0186] In the application embodiments of this application, the future resource utilization characteristics of the host machine's resources are predicted using the ARIMA time series model.

[0187] like Figure 7 As shown, Figure 7 A flowchart illustrating a method for predicting future resource utilization characteristics of a host machine's resources, provided in an application embodiment of this application; including the following steps:

[0188] Step 701: Obtain the observation sequence, which refers to the sequence composed of 50 spatiotemporally fused resource utilization characteristics of the host machine;

[0189] Step 702: Determine whether the observed value sequence is stationary;

[0190] If not, proceed to step 703;

[0191] If so, proceed to step 704;

[0192] Step 703: Perform stationary operation on the non-stationary observation sequence through difference operation until the observation sequence is stationary;

[0193] Step 704: Use the autocorrelation ACF or partial autocorrelation PACF plot to determine the order of the ARIMA model and identify the optimal parameters of the ARIMA model;

[0194] Step 705: Based on the optimal parameters of the ARIMA model, perform parameter evaluation on the parameters of the ARIMA model to obtain the optimal ARIMA model;

[0195] Step 706: Perform white noise detection on the optimal ARIMA model to determine whether the residuals of the optimal ARIMA model are white noise;

[0196] If so, proceed to step 704;

[0197] If not, proceed to step 707;

[0198] Step 707: Use the optimal ARIMA model to obtain the prediction results; the prediction results refer to the future resource utilization characteristics corresponding to the host machine's resources;

[0199] In practical applications, after step 707, the prediction results can be verified by error analysis using the actual values. If the error is large, it is necessary to re-enter step 704.

[0200] In this application embodiment, the predicted future resource utilization characteristics of the host machine's resources can be the average value over 7 days. Table 2 is constructed based on the historical resource utilization characteristics of the host machine's resources and their corresponding future resource utilization characteristics.

[0201] Table 2 shows the historical-future fusion characteristics of the host machine's resources.

[0202]

[0203] Table 2 Historical-Fusion Characteristics of Host Machine Resources

[0204] As shown in Table 2, the historical-future fusion characteristics of the host machine's resources are represented by the resource utilization characteristics of at least one resource of the host machine.

[0205] Step 602: Construct the feature space of the host machine based on the resource utilization characteristics of at least one resource of the host machine;

[0206] Specifically, in the application embodiments of this application, the feature space of the host machine is represented by matrix A, wherein,

[0207]

[0208] Where m represents the type of resources on the host machine, and in this embodiment, m = 5; n represents the total number of time periods, and in this embodiment, n = 10.

[0209] Step 603: Based on the host machine's feature space, calculate the weight of each resource utilization feature of each resource on the host machine using the SVD algorithm;

[0210] Specifically, it includes the following steps:

[0211] Using the SVD algorithm, matrix A can be approximately represented as:

[0212] A≈U*∑*V T ;

[0213] Where U is an m*m square matrix, and ∑ is an m*2n matrix, with all elements of ∑ except for the diagonal elements being 0. The elements on the diagonal are called singular values ​​σ. m Where m = 1, 2, ..., m; V T It is a 2n*2n matrix.

[0214] Among them, singular value σ m These can be viewed as factors influencing the resource utilization characteristics of different resource categories on the host machine. Therefore, normalizing the m singular values ​​yields the weights w of different resource categories on the host machine. m The normalization process can be expressed mathematically as follows:

[0215]

[0216] Furthermore, after transposing matrix A, the SVD algorithm is used to calculate the weight w' of the utilization rate of each resource of the same type on the host machine at different time periods. n ;

[0217] Weights w based on different resource categories of the host machine m And the weight w' of the utilization rate of each resource of the same type on the host machine at different time periods. n The weight w of each resource utilization feature of each resource on the host machine is obtained. m*n , where w m*n =w m *w' n .

[0218] Step 604: Weight w based on the resource utilization feature of each resource on the host machine. m*n Constructing a machine profile of the host machine W m*n Specifically, the host machine's machine profile W m*n This can be expressed mathematically as:

[0219]

[0220] Step 503: Based on the machine profile of each instance in the first instance set and the machine profile of each host in the first host set, calculate the supply and demand complementarity relationship between each instance and each host.

[0221] Specifically, it includes the following steps:

[0222] Based on the feature space of the host machine and the feature space of the instance, a distance space between the host machine and the instance is obtained. The distance space is constructed based on the following distance: the distance between each resource utilization feature of each resource in the feature space of the host machine and each resource utilization feature of each resource in the feature space of the corresponding instance.

[0223] Based on the distance space and the weights of each resource utilization feature of each resource, the supply and demand complementarity relationship between the host machine and the instance is calculated.

[0224] To more intuitively describe the complementary supply and demand relationship, in this embodiment of the application, the complementary supply and demand relationship is expressed by a mathematical expression as follows:

[0225]

[0226] Among them, D ab This represents the complementary supply and demand relationship between host machine a and instance b. A represents the feature space of host machine a, B represents the feature space of instance b, and W... m*n This represents the weight of each resource utilization feature for each resource. Since the weights of each resource utilization feature for each resource on both the host machine and the instance indicate the influence factors of resource utilization features of different types of resources at different times, and are unrelated to whether the resource user is the host machine or the instance, in this embodiment, the weights of each resource utilization feature for each resource can be the weights of each resource utilization feature for each resource on the host machine, or the weights of each resource utilization feature for each resource on the instance.

[0227] Step 504: Using each host in the first host set as a cluster center, classify each instance in the first instance set based on the supply and demand complementarity between each instance in the first instance set and each host in the first host set;

[0228] Specifically, such as Figure 8 As shown, Figure 8 A flowchart illustrating a method for classifying each instance in the first instance set, provided for an application embodiment of this application, includes the following steps:

[0229] Step 801: Using each host in the first host set as a cluster center, classify each instance in the first instance set based on the supply and demand complementarity between each instance in the first instance set and each host in the first host set;

[0230] Step 802: Determine whether there is a host in the first host set that meets the exit supply conditions; if so, then:

[0231] Remove the host machines that meet the exit conditions from the first host machine set; and

[0232] Remove instances from the first instance set corresponding to the category of the host machine that meets the exit conditions, and record the classification result of the instances removed from the first instance set; and

[0233] The first host set is reconstructed using the remaining host machines in the first host set, and the first instance set is reconstructed using the remaining instances in the first instance set;

[0234] The conditions for withdrawing from supply include at least one of the following:

[0235] The average value of all resource utilization characteristics of all resources in the first resource set is greater than the first threshold value;

[0236] In the first resource set, there exists at least one resource whose maximum resource utilization rate characteristic is greater than the second threshold value;

[0237] The first resource set includes the resources of all instances contained in the category corresponding to the host machine.

[0238] To describe the exit supply condition more intuitively, the exit supply condition is expressed mathematically as follows:

[0239]

[0240] in, Let γ1 represent the utilization rate characteristic of the i-th resource in the first resource set, and let γ2 represent the first threshold value and γ2 represent the second threshold value.

[0241] Step 803: Perform the following clustering iteration process:

[0242] Determine whether the host machines in the first host machine set meet the clustering iteration termination condition;

[0243] If so, the clustering iteration terminates;

[0244] If not, the first host set is updated based on the preset update rules, and a new round of clustering iteration is performed until the clustering iteration termination condition is met.

[0245] The update rule is as follows:

[0246] Based on all instances contained in the category corresponding to each host in the first host set, each host in the first host set is sorted by load.

[0247] Based on a preset load sorting interval, host machines located within the load sorting interval in the first host machine set are removed from the host machine set.

[0248] In this application embodiment, the load sorting interval can be set to the interval at the end of the load sorting, preferably the bottom 10%. In practical applications, a better classification effect can also be obtained by setting a smaller load sorting interval and performing more clustering iterations.

[0249] The clustering iteration termination condition includes at least one of the following conditions:

[0250] The number of clustering iterations reaches the threshold.

[0251] Each host in the first host set meets the exit conditions.

[0252] In this application embodiment, the threshold number of times is preferably 5 times, that is, the number of idle host machines is 50% of the total number of host machines. In practical applications, the threshold number of times can be appropriately changed according to actual needs.

[0253] Step 505: Based on the classification result of each instance in the first instance set, output the scheduling result of each instance in the first instance set.

[0254] The instance scheduling method provided in this application's embodiments schedules instances based on the complementary supply and demand relationship between host machines and instances. A pre-defined exit condition for a single host machine is established. Once a single host machine meets the exit condition, the remaining instances in the first instance set continue to cluster towards the remaining host machines in the first host machine set. When the clustering iteration process reaches the termination condition, the host-instance relationship will maximize the utilization of host machine resources. While meeting business needs, it maximizes the release of host machine resources, effectively improving host machine resource utilization and enterprise efficiency.

[0255] Furthermore, in scenarios where host virtualization provides resource services, existing instance scheduling methods often result in significant resource idleness and waste due to arbitrary or coarse-grained allocation of host resources, or failures due to unbalanced hardware load. Based on the instance scheduling method provided in this application embodiment, by combining the instance scheduling results with virtualization hot migration technology, instances can be quickly migrated to other host hardware platforms according to the scheduling results, achieving a smooth migration of instance states while maintaining user experience. Therefore, using the instance scheduling method provided in this application embodiment for instance and host reorganization is low-difficulty to implement, has minimal impact on user usage and service delivery, and is highly feasible.

[0256] Meanwhile, in actual business scenarios, machine maintenance personnel often find themselves embroiled in complex incident handling due to host machine alarms or resource waste. By utilizing the instance scheduling method provided in the application embodiments of this application, such problems can be fundamentally solved without affecting business operations, achieving resource load balancing, increasing the host machine over-division ratio, greatly improving the host machine's resource utilization, thereby improving enterprise efficiency, and demonstrating significant application value.

[0257] Furthermore, based on the hardware implementation of the program units in the machine profiling device and instance scheduling device provided in the embodiments of this application, and in order to implement the machine profiling method and instance scheduling method provided in the embodiments of this application, the embodiments of this application also provide an electronic device 900. For example... Figure 9 As shown, Figure 9 This is a schematic diagram of the composition of an electronic device provided in an embodiment of this application; the electronic device 900 includes:

[0258] The processor 901 and the memory 902 are used to store computer programs. The processor 901 is used to call and run the computer programs stored in the memory 902 to implement the machine profiling method or instance scheduling method provided in the embodiments of this application.

[0259] In practical applications, such as Figure 9 As shown, the various components in the electronic device 900 are coupled together via a bus module 903. It is understood that the bus module 903 is used to implement communication between these components. In addition to a data bus, the bus module 903 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 9 The general labeled all buses as bus module 903.

[0260] This application also provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the machine profiling method or instance scheduling method provided in this application.

[0261] In some embodiments, the computer-readable storage medium may be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; or it may be a device that includes one or any combination of the above-mentioned memories.

[0262] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0263] As an example, executable instructions may, but do not necessarily, correspond to files in the file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0264] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0265] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0266] The technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0267] In the several embodiments provided in this application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0268] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0269] In addition, each functional unit in the various embodiments of this application can be integrated into a second processing unit, or each unit can be a separate unit, or two or more units can be integrated into a unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0270] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. An instance scheduling method, characterized in that, include: Obtain the first set of instances and the first set of host machines; Each instance in the first instance set and each host in the first host set are taken as target devices. Based on the resource utilization characteristics of at least one resource of the target device, a feature space of the target device is constructed. The resource utilization characteristics of the resource include multiple resource utilization characteristics corresponding to the resource in multiple usage periods. Based on the feature space of the target device, calculate the weight of each resource utilization feature of each resource of the target device; A machine profile of the target device is constructed using the weights of each resource utilization feature of each resource of the target device; Based on the feature space of the host machine and the feature space of the instance, a distance space between the host machine and the instance is obtained. The distance space is constructed based on the following distances: the distance between each resource utilization feature of each resource in the feature space of the host machine and each resource utilization feature of each resource in the feature space of the corresponding instance. Based on the distance space and the weight of each resource utilization feature of each resource, the supply and demand complementarity relationship between the host machine and the instance is calculated. The supply and demand complementarity relationship refers to the relationship between the resources required by the instance and the resources supplied by the host machine. The resources required by the instance and the resources supplied by the host machine are represented by the machine profile of the instance and the machine profile of the host machine, respectively. Using each host in the first host set as a cluster center, and based on the supply and demand complementarity between each instance in the first instance set and each host in the first host set, the instances in the first instance set with the largest supply and demand complementarity with the same host in the first host set are classified into one category; Based on the classification results of each instance in the first instance set, the scheduling results of each instance in the first instance set are output.

2. The method according to claim 1, characterized in that, Before outputting the scheduling result for each instance in the first instance set based on the classification result of each instance in the first instance set, the method further includes: Perform the following clustering iteration process: Determine whether the host machines in the first host machine set meet the clustering iteration termination condition; If so, the clustering iteration terminates; If not, the first host set is updated based on the preset update rules, and a new round of clustering iteration is performed until the clustering iteration termination condition is met.

3. The method according to claim 2, characterized in that, Before performing the following clustering iteration process, the process also includes: Determine whether there exists a host in the first host set that meets the exit supply conditions; if so, then: Remove the host machine that meets the exit supply conditions from the first host machine set; and Remove the instances in the category corresponding to the host machine that meets the exit supply conditions from the first instance set, and record the classification result of the instances removed from the first instance set; and The first host set is reconstructed using the remaining host machines in the first host set, and the first instance set is reconstructed using the remaining instances in the first instance set.

4. The method according to claim 2, characterized in that, The update rule is as follows: Based on all instances contained in the category corresponding to each host in the first host set, each host in the first host set is sorted by load. Based on a preset load sorting interval, host machines located within the load sorting interval in the first host machine set are removed from the first host machine set.

5. The method according to claim 2, characterized in that, The clustering iteration termination condition includes at least one of the following conditions: The number of clustering iterations reaches the threshold. Each host in the first set of hosts meets the conditions for exiting the supply.

6. The method according to claim 3, characterized in that, The conditions for exiting supply include at least one of the following: The average value of all resource utilization characteristics of all resources in the first resource set is greater than the first threshold value; In the first resource set, there exists at least one resource whose maximum value of resource utilization rate characteristic is greater than the second threshold value; The first resource set includes the resources of all instances contained in the category corresponding to the host machine.

7. The method according to any one of claims 1-6, characterized in that, Also includes: Based on the historical resource utilization characteristics of at least one resource of the target device, predict the future resource utilization characteristics of at least one resource of the target device. By fusing the historical resource utilization rate characteristics of at least one resource of the target device with its corresponding future resource utilization rate characteristics, the resource utilization rate characteristics of at least one resource of the target device are obtained.

8. An instance scheduling device, characterized in that, include: The target set acquisition unit is used to acquire the first instance set and the first host set; Each instance in the first instance set and each host in the first host set are taken as target devices. Based on the resource utilization characteristics of at least one resource of the target device, a feature space of the target device is constructed. The resource utilization characteristics of the resource include multiple resource utilization characteristics corresponding to the resource in multiple usage periods. Based on the feature space of the target device, calculate the weight of each resource utilization feature of each resource of the target device; A machine profile of the target device is constructed using the weights of each resource utilization feature of each resource of the target device; Based on the feature space of the host machine and the feature space of the instance, a distance space between the host machine and the instance is obtained. The distance space is constructed based on the following distances: the distance between each resource utilization feature of each resource in the feature space of the host machine and each resource utilization feature of each resource in the feature space of the corresponding instance. Based on the distance space and the weight of each resource utilization feature of each resource, the supply and demand complementarity relationship between the host machine and the instance is calculated. The supply and demand complementarity relationship refers to the relationship between the resources required by the instance and the resources supplied by the host machine. The resources required by the instance and the resources supplied by the host machine are represented by the machine profile of the instance and the machine profile of the host machine, respectively. The clustering unit is used to divide the instances in the first instance set that have the largest supply-demand complementarity with the same host in the first host set into one class, based on the supply-demand complementarity between each instance in the first instance set and each host in the first host set, with each host in the first host set as the cluster center; The output unit is used to output the scheduling result of each instance in the first instance set based on the classification result of each instance in the first instance set.

9. An electronic device, characterized in that, It includes a processor and a memory for storing computer programs, the processor for calling and running the computer programs stored in the memory to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium storing executable instructions, characterized in that, When the executable instructions are executed by the processor, they implement the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method for migration scheduling of multiple virtual machines

    CN102968344A

  • Resource allocation method, device and system

    CN108322404A

  • A method and device for scheduling database instances

    CN109324896A