Cluster resource scheduling method and device, storage medium and electronic equipment

By dynamically adjusting the cluster resource scheduling threshold and determining the host to be scheduled based on the current resource usage, the problem of low resource utilization in the existing technology is solved and the resource utilization efficiency and stability are improved.

CN118733252APending Publication Date: 2024-10-01JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410706194.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing cluster resource scheduling methods cannot adjust thresholds in real time based on the actual usage of cluster resources, resulting in low resource utilization, frequent triggering or failure to trigger scheduling for a long time, resulting in resource waste.

Method used

By obtaining the cluster resource usage in the current cycle, determine the current resource scheduling threshold corresponding to the resource scheduling threshold range, compare the host resource usage and the scheduling threshold to determine the target host to be scheduled, and perform scheduling operations to dynamically adjust the resource threshold to adapt to the resource Usage.

Benefits of technology

It improves cluster resource utilization, reduces resource loss, avoids insufficient hosts and waste of resources due to excessive scheduling, and enhances resource stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733252A_ABST
    Figure CN118733252A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a cluster resource scheduling method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining a cluster resource utilization rate of a cluster in a current period, and obtaining a current cluster resource utilization rate; based on the current cluster resource utilization rate and the resource scheduling threshold range, a current resource scheduling threshold corresponding to the current cluster resource utilization rate is determined, and the cluster resource utilization rate of the cluster is in negative correlation with the resource scheduling threshold used for resource scheduling of the cluster; and determining a to-be-scheduled target host in the group of hosts by comparing the resource utilization rates of the hosts in the group of hosts with the current resource scheduling threshold, and executing a scheduling operation on the target host. Through the cluster resource scheduling method and device, the problem that the cluster resource utilization rate is low in a cluster resource scheduling method in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of cloud computing technology, and in particular to a cluster resource scheduling method and device, a storage medium, and an electronic device. Background Art

[0002] To improve cluster resource utilization, the virtualization cluster will migrate virtual machines from some hosts and shut down the hosts when cluster resource utilization is low. When cluster resource utilization is high, it will power on the shut down hosts and allocate virtual machines appropriately.

[0003] The cluster resource scheduling method in the related art usually sets a cluster resource threshold, compares the cluster resource usage rate with the cluster resource threshold to determine the cluster resource usage, and adaptively schedules the cluster resources to achieve the effect of improving the cluster resource utilization rate.

[0004] After being set, the above cluster resource threshold cannot change in real time according to the actual usage of cluster resources. If the cluster resource threshold is set too high, cluster resource scheduling will be triggered frequently. If the cluster resource threshold is set too low, cluster resource scheduling will not be triggered for a long time. Therefore, the cluster resource scheduling method in the related art has the problem of low cluster resource utilization. Summary of the invention

[0005] The embodiments of the present application provide a cluster resource scheduling method and device, a storage medium, and an electronic device to at least solve the problem of low cluster resource utilization in the cluster resource scheduling method in the related art.

[0006] According to one aspect of an embodiment of the present application, a cluster resource scheduling method is provided, comprising: obtaining a cluster resource usage rate of a cluster in a current period to obtain a current cluster resource usage rate, wherein the cluster includes a group of hosts, and the cluster resource usage rate of the cluster is determined according to the resource usage rate of the hosts in the group of hosts in the current period, and the resource usage rate of the hosts in the group of hosts is used to characterize the workload of the hosts in the group of hosts; based on the current cluster resource usage rate and a resource scheduling threshold range, determining a current resource scheduling threshold corresponding to the current cluster resource usage rate, wherein the resource scheduling threshold range is a range of resource scheduling thresholds used for resource scheduling of the cluster, the resource scheduling threshold used for resource scheduling of the cluster is a threshold of the resource usage rate of the hosts in the group of hosts, the resource scheduling threshold used for resource scheduling of the cluster is used to determine a host to be scheduled in the group of hosts, and the cluster resource usage rate of the cluster is negatively correlated with the resource scheduling threshold used for resource scheduling of the cluster; by comparing the resource usage rate of the hosts in the group of hosts with the current resource scheduling threshold, determining a target host to be scheduled in the group of hosts, and performing a scheduling operation on the target host.

[0007] According to another aspect of an embodiment of the present application, a cluster resource scheduling device is provided, comprising: an acquisition unit, configured to acquire a cluster resource usage rate of a cluster in a current period to obtain a current cluster resource usage rate, wherein the cluster includes a group of hosts, and the cluster resource usage rate of the cluster is determined according to the resource usage rates of the hosts in the group of hosts in the current period, and the resource usage rates of the hosts in the group of hosts are used to characterize the workload of the hosts in the group of hosts; a determination unit, configured to determine a current resource scheduling threshold corresponding to the current cluster resource usage rate based on the current cluster resource usage rate and a resource scheduling threshold range, wherein the resource scheduling threshold range is a range of resource scheduling thresholds used for resource scheduling of the cluster, the resource scheduling threshold used for resource scheduling of the cluster is a threshold of the resource usage rate of the hosts in the group of hosts, the resource scheduling threshold used for resource scheduling of the cluster is used to determine a host to be scheduled in the group of hosts, and the cluster resource usage rate of the cluster is negatively correlated with the resource scheduling threshold used for resource scheduling of the cluster; a first execution unit, configured to determine a target host to be scheduled in the group of hosts by comparing the resource usage rates of the hosts in the group of hosts with the current resource scheduling threshold, and perform a scheduling operation on the target host.

[0008] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0009] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0010] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0011] Through the present application, the cluster resource utilization rate of the cluster in the current period is obtained to obtain the current cluster resource utilization rate, wherein the cluster includes a group of hosts, and the cluster resource utilization rate of the cluster is determined according to the resource utilization rate of the hosts in the group of hosts in the current period, and the resource utilization rate of the hosts in a group of hosts is used to characterize the workload of the hosts in a group of hosts; based on the current cluster resource utilization rate and the resource scheduling threshold range, the current resource scheduling threshold corresponding to the current cluster resource utilization rate is determined, wherein the resource scheduling threshold range is the range of the resource scheduling threshold used for resource scheduling of the cluster, the resource scheduling threshold used for resource scheduling of the cluster is the threshold of the resource utilization rate of the hosts in a group of hosts, and the resource scheduling threshold used for resource scheduling of the cluster is used to determine the resource utilization rate of the hosts in a group of hosts For hosts to be scheduled, the cluster resource utilization rate of the cluster is negatively correlated with the resource scheduling threshold used for resource scheduling of the cluster; by comparing the resource utilization rate of hosts in a group of hosts and the current resource scheduling threshold, the target host to be scheduled in a group of hosts is determined, and the scheduling operation is performed on the target host. The cluster resource utilization rate is negatively correlated with the resource scheduling threshold. When the cluster resource utilization rate is high, the resource scheduling threshold is relatively low, which can reduce the number of target hosts to be scheduled and provide sufficient host resources. When the cluster resource utilization rate is low, the resource scheduling threshold is relatively high, which can increase the number of target hosts to be scheduled, improve the resource utilization rate of the remaining working hosts, and reduce the loss of cluster resources, thereby solving the problem of low cluster resource utilization in the cluster resource scheduling method in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 is a hardware environment schematic diagram of an optional cluster resource scheduling method according to an embodiment of the present application;

[0013] Figure 2 is a flow chart of an optional cluster resource scheduling method according to an embodiment of the present application;

[0014] Figure 3 is a schematic diagram of an optional cluster resource scheduling method according to an embodiment of the present application;

[0015] Figure 4 is a schematic diagram of another optional cluster resource scheduling method according to an embodiment of the present application;

[0016] Figure 5 is a schematic diagram of another optional cluster resource scheduling method according to an embodiment of the present application;

[0017] Figure 6 is a schematic diagram of another optional cluster resource scheduling method according to an embodiment of the present application;

[0018] Figure 7 is a structural block diagram of an optional cluster resource scheduling device according to an embodiment of the present application;

[0019] Figure 8 It is a structural block diagram of a computer system of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] The method embodiments provided in the embodiments of the present application can be executed in a server, a mobile terminal, a computer terminal or a similar computing device. Taking running on a server as an example, Figure 1FIG. 1 is a schematic diagram of a hardware environment of a cluster resource scheduling method according to an embodiment of the present application. Figure 1 As shown, the server may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server may also include a transmission device 106 and an input / output device 108 for communication functions. A person skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the cluster resource scheduling method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0024] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0025] Optionally, the cluster resource scheduling method in this embodiment may be executed by a server, where the server refers to the server as a whole, including relevant components and processors in the server that need to execute the cluster resource scheduling method; the cluster resource scheduling method in this embodiment may also be executed by the processor 102. In some examples of this embodiment, the cluster resource scheduling method is described by taking the execution of the server as an example.

[0026] The cluster resource scheduling method in this embodiment can be applied to the scenario of providing suggestions for cluster resource scheduling. In the process of using cloud computing or virtualization platform, in order to improve cluster resource utilization and optimize cluster and data center resource consumption, most virtualization clusters will provide a DRS (Distributed Resource Scheduler) strategy, which can migrate virtual machines on the host and shut down the host when the cluster resource utilization is low, and turn on the host power and reasonably allocate virtual machines when the cluster resource utilization is high; DPM (Dynamic Power, Management) is generally used in conjunction with the distributed resource scheduling strategy to provide scheduling suggestions for resource scheduling.

[0027] The DPM strategy in the related technology usually determines the usage of cluster resources by setting a cluster resource threshold, comparing the cluster resource usage rate with the cluster resource threshold, and adaptively scheduling cluster resources to achieve the effect of improving cluster resource utilization; however, the cluster resource threshold in the related technology cannot change in real time according to the actual usage of the cluster resources after being set. If the cluster resource threshold is set too high, it will cause cluster resource scheduling to be triggered frequently. If the cluster resource threshold is set too low, it will cause the cluster resource scheduling to fail to be triggered for a long time, resulting in a waste of cluster resources and low cluster resource utilization.

[0028] In this embodiment, taking the above situation into consideration, the cluster resource threshold changes in real time according to the actual usage of cluster resources during cluster resource scheduling, so as to solve the problem of low cluster resource utilization in cluster resource scheduling methods in related technologies. Figure 2 , Figure 2 is a flow chart of an optional cluster resource scheduling method according to an embodiment of the present application, such as Figure 2 As shown, the above method comprises the following steps:

[0029] Step S202, obtaining the cluster resource utilization rate of the cluster in the current cycle, and obtaining the current cluster resource utilization rate, wherein the cluster includes a group of hosts, and the cluster resource utilization rate of the cluster is determined based on the resource utilization rate of the hosts in the group of hosts in the current cycle, and the resource utilization rate of the hosts in the group of hosts is used to characterize the workload of the hosts in the group of hosts.

[0030] A cluster refers to a network or collection composed of multiple computers or servers. In this embodiment, the cluster includes a group of hosts. The cluster resource utilization rate of the cluster is determined based on the resource utilization rates of the hosts in the group of hosts in the current cycle. Here, the cluster resource utilization rate of the cluster can be obtained by calculating the average resource utilization rate of the hosts in the group of hosts in the current cycle. The resource utilization rate of the hosts in a group of hosts is used to characterize the workload of the hosts in the group of hosts. The resource utilization rate of the host may include but is not limited to the host's memory utilization rate, CPU (Central Processing Unit, central processing unit) utilization rate, disk utilization rate, IO (Input, Output, referring to the flow of data between the computer's memory or other devices) utilization rate, etc.

[0031] See also Figure 3 , Figure 3 The schematic diagram of an optional cluster resource scheduling method is shown. The cluster resource scheduling method of this embodiment is executed at the current time point, which is a time point after the current cycle, and the current cycle is the complete time cycle that has passed closest to the current time point.

[0032] It can be understood that by obtaining the cluster resource utilization rate of the cluster in the current cycle, the actual resource utilization rate of a group of hosts in the cluster in the current cycle can be determined, thereby improving the accuracy of subsequent cluster resource scheduling methods.

[0033] Step S204, based on the current cluster resource utilization and the resource scheduling threshold range, determine the current resource scheduling threshold corresponding to the current cluster resource utilization, wherein the resource scheduling threshold range is the range of the resource scheduling threshold used for resource scheduling of the cluster, the resource scheduling threshold used for resource scheduling of the cluster is the threshold of the resource utilization of the host in a group of hosts, the resource scheduling threshold used for resource scheduling of the cluster is used to determine the host to be scheduled in a group of hosts, and the cluster resource utilization of the cluster is negatively correlated with the resource scheduling threshold used for resource scheduling of the cluster.

[0034] The resource scheduling threshold range is the range of the resource scheduling threshold used for cluster resource scheduling, that is, based on the current cluster resource utilization and the resource scheduling threshold range, the current resource scheduling threshold determined should fall within the resource scheduling threshold range; the resource scheduling threshold used for cluster resource scheduling is the threshold of the resource utilization of a host in a group of hosts, and the resource scheduling threshold used for cluster resource scheduling is used to determine a host to be scheduled in a group of hosts, that is, when performing resource scheduling on a host in a group of hosts, it is determined whether a scheduling operation needs to be performed on a host in a group of hosts based on the resource scheduling threshold used for cluster resource scheduling.

[0035] Based on the current cluster resource utilization and the resource scheduling threshold range, determine the current resource scheduling threshold corresponding to the current cluster resource utilization. Here, the current cluster resource utilization and the current resource scheduling threshold may be linearly negatively correlated. For example, the current resource scheduling threshold = ab*current cluster resource utilization. Here, a and b are both constants, and a and b are both positive numbers. The current resource scheduling threshold may also be determined by judging the interval in which the current cluster resource utilization is located. There are intervals x, y, and z. The maximum value of interval x is the minimum value of interval y, and the maximum value of interval y is the minimum value of interval z. When the current cluster resource utilization is respectively in interval x, interval y, and interval z, the value of the current resource scheduling threshold decreases in sequence.

[0036] Step S206, by comparing the resource usage rates of the hosts in the group of hosts with the current resource scheduling threshold, a target host to be scheduled in the group of hosts is determined, and a scheduling operation is performed on the target host.

[0037] The target host refers to a host in a group of hosts whose resource usage is less than the current resource scheduling threshold; the scheduling operation refers to adjusting the target host to the standby state, that is, disconnecting the target host from the cluster and scheduling the virtual machine running on the target host to a non-target host in the group of hosts.

[0038] It can be understood that the cluster resource utilization rate is negatively correlated with the resource scheduling threshold. When the cluster resource utilization rate is high, the resource scheduling threshold is relatively low, which can reduce the number of target hosts to be scheduled, ensure sufficient host resources in the cluster, and avoid the situation where the number of cluster hosts is insufficient and the cluster load exceeds the standard due to too many hosts being scheduled. When the cluster resource utilization rate is low, the resource scheduling threshold is relatively high, which can increase the number of target hosts to be scheduled, improve the resource utilization rate of the remaining non-target hosts, and reduce the loss of cluster resources.

[0039] Through the embodiments provided by the present application, the cluster resource utilization rate of the cluster in the current cycle is obtained to obtain the current cluster resource utilization rate, wherein the cluster includes a group of hosts, the cluster resource utilization rate of the cluster is determined according to the resource utilization rate of the hosts in the group of hosts in the current cycle, and the resource utilization rate of the hosts in the group of hosts is used to characterize the workload of the hosts in the group of hosts; based on the current cluster resource utilization rate and the resource scheduling threshold range, the current resource scheduling threshold corresponding to the current cluster resource utilization rate is determined, wherein the resource scheduling threshold range is the range of the resource scheduling threshold used for resource scheduling of the cluster, the resource scheduling threshold used for resource scheduling of the cluster is the threshold of the resource utilization rate of the hosts in the group of hosts, the resource scheduling threshold used for resource scheduling of the cluster is used to determine the hosts to be scheduled in the group of hosts, and the cluster resource utilization rate of the cluster is negatively correlated with the resource scheduling threshold used for resource scheduling of the cluster; by comparing the resource utilization rate of the hosts in the group of hosts with the current resource scheduling threshold, determining the target host to be scheduled in the group of hosts, and performing the scheduling operation on the target host, the problem of low cluster resource utilization rate in the cluster resource scheduling method in the related art is solved, and the cluster resource utilization rate is improved.

[0040] As an optional solution, based on the current cluster resource usage and the resource scheduling threshold range, a current resource scheduling threshold corresponding to the current cluster resource usage is determined, including:

[0041] S11, when the current cluster resource usage is less than the first resource usage threshold, determining the maximum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage;

[0042] S12, when the current cluster resource usage is greater than the second resource usage threshold, determining the minimum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage;

[0043] S13, when the current cluster resource usage is greater than or equal to the first resource usage threshold and less than or equal to the second resource usage threshold, determine the current resource scheduling threshold from the resource scheduling threshold range based on a relative relationship between the current cluster resource usage, the first resource usage threshold and the second resource usage threshold;

[0044] The first resource usage rate threshold is smaller than the second resource usage rate threshold.

[0045] In this embodiment, an optional implementation method for determining a current resource scheduling threshold corresponding to the current cluster resource usage rate based on the current cluster resource usage rate and the resource scheduling threshold range is provided. Figure 4 , Figure 4It is a schematic diagram of another optional cluster resource scheduling method.

[0046] When the current cluster resource utilization rate is less than the first resource utilization rate threshold, the maximum value of the resource scheduling threshold range is determined as the current resource scheduling threshold corresponding to the current cluster resource utilization rate; when the current cluster resource utilization rate is greater than the second resource utilization rate threshold, the minimum value of the resource scheduling threshold range is determined as the current resource scheduling threshold corresponding to the current cluster resource utilization rate; when the current cluster resource utilization rate is greater than or equal to the first resource utilization rate threshold and less than or equal to the second resource utilization rate threshold, based on the relative relationship between the current cluster resource utilization rate, the first resource utilization rate threshold and the second resource utilization rate threshold, the current resource scheduling threshold is determined from the resource scheduling threshold range, where the current resource scheduling threshold is negatively correlated with the current cluster resource utilization rate.

[0047] It can be understood that by setting a resource scheduling threshold range for the resource scheduling threshold, it is possible to avoid the resource scheduling threshold being extremely large or extremely small in extreme cases, which in turn affects the stability of cluster resources. For example, when the resource scheduling threshold is too small, the scheduling operation may not be triggered for a long time; when the resource scheduling threshold is too large, the scheduling operation may be triggered frequently; the above two situations will affect the stability of cluster resources.

[0048] Through the embodiments provided in the present application, based on the current cluster resource usage and the resource scheduling threshold range, the current resource scheduling threshold corresponding to the current cluster resource usage is determined, which can improve the rationality of determining the current resource scheduling threshold.

[0049] As an optional solution, based on the relative relationship between the current cluster resource usage, the first resource usage threshold and the second resource usage threshold, the current resource scheduling threshold is determined from the resource scheduling threshold range, including:

[0050] S21, multiply the difference between the current cluster resource utilization and the first resource utilization threshold by a specified ratio to obtain a target value, and determine the value obtained by subtracting the target value from the maximum value of the resource scheduling threshold range as the current resource scheduling threshold, wherein the specified ratio is the ratio between the difference obtained by subtracting the minimum value of the resource scheduling threshold range from the maximum value of the resource scheduling threshold range and the difference obtained by subtracting the first resource utilization threshold from the second resource utilization threshold.

[0051] In order to make the cluster resource utilization of the cluster negatively correlated with the resource scheduling threshold used for resource scheduling of the cluster, in this embodiment, an optional embodiment is provided to determine the current resource scheduling threshold from the resource scheduling threshold range based on the relative relationship between the current cluster resource utilization, the first resource utilization threshold and the second resource utilization threshold.

[0052] Specifically, the ratio of the difference obtained by subtracting the minimum value of the resource scheduling threshold range from the maximum value of the resource scheduling threshold range and the difference obtained by subtracting the first resource utilization threshold from the second resource utilization threshold is determined as the specified ratio, the difference between the current cluster resource utilization and the first resource utilization threshold is multiplied by the specified ratio to obtain the target value, and the value obtained by subtracting the target value from the maximum value of the resource scheduling threshold range is determined as the current resource scheduling threshold. The current resource scheduling threshold obtained through the steps of this embodiment is negatively correlated with the current cluster resource utilization.

[0053] Through the embodiments provided in the present application, a method for obtaining a current resource scheduling threshold is provided, thereby improving the accuracy of the obtained current resource scheduling threshold.

[0054] As an optional solution, obtain the cluster resource usage of the cluster in the current period to obtain the current cluster resource usage, including:

[0055] S31, obtaining a group of historical cluster resource usages of the cluster in the current period, and determining the average value of the group of historical cluster resource usages as the average value of the historical cluster resource usages, wherein each historical cluster resource usage in the group of historical cluster resource usages is the cluster resource usage of the cluster at a historical time point in the current period, the cluster resource usage of the cluster at a historical time point is the average value of resource usages of hosts in a group of hosts at a historical time point, and the current cluster resource usage includes the average value of the historical cluster resource usages;

[0056] S32, predicting the cluster resource usage of the next cycle of the current cycle based on a set of historical cluster resource usages to obtain a set of predicted cluster resource usages, and determining the average value of the set of predicted cluster resource usages as the predicted cluster resource usage mean, wherein each predicted cluster resource usage in the set of predicted cluster resource usages is a predicted cluster resource usage of the cluster at a future time point in the next cycle, and the current cluster resource usage includes the predicted cluster resource usage.

[0057] See also Figure 3, the steps of this embodiment are executed at the current time point; the cluster resource utilization rate of the cluster in the current period is the average value of a group of historical cluster resource utilization rates, that is, the current period includes a group of historical time points, and the historical cluster resource utilization rate average can be obtained by obtaining the historical cluster resource utilization rate of each time point in a group of historical time points and calculating the average value thereof.

[0058] Based on a set of historical cluster resource utilization rates, the cluster resource utilization rate of the next cycle of the current cycle is predicted to obtain a set of predicted cluster resource utilization rates. Here, the next cycle corresponds to Figure 3 It should be noted that the prediction algorithm can be used to predict the cluster resource utilization rate of the next cycle.

[0059] Optionally, the prediction algorithm may use a quadratic exponential smoothing algorithm; to improve the accuracy of quadratic exponential prediction, the stability of a set of historical cluster resource usage rates in the current cycle may be determined, and unstable data may be removed and not used as a basis for prediction, thereby avoiding illogical predictions caused by sudden changes in data.

[0060] Specifically, the data corresponding to each historical time point in a group of historical time points in the current cycle can be judged, and a group of historical time points can be divided into sudden change points and steady-state points. According to the reverse chronological traversal, a group of steady-state points closest to the current time point can be used as prediction data.

[0061] Optionally, the sudden change point judgment standard is: the change range of the current time point relative to the previous time point exceeds a specified value (such as 5%), and this standard can be determined according to actual conditions.

[0062] Optionally, the steady-state point judgment standard is: the change range of the current time point relative to the previous time point is lower than a specified value (such as 5%), and this standard can be determined according to actual conditions.

[0063] It should be noted that the determination of the weighting parameters of the quadratic exponential smoothing algorithm may include the following steps: for a valid data set (i.e., the predicted data consisting of a set of steady-state points in the above embodiment), assuming that the variance of the complete data set (the data set containing all data) is a, and the variance of the truncated data set (the data set with extreme values ​​removed) is b, when a / b-1>0.05, in order to make the predicted value better connect with the current value, the weighting parameter is taken as 0.8; otherwise, the weighting parameter is taken as 0.05. The values ​​of these two weighting parameters may also be modified according to actual conditions.

[0064] Through the embodiments provided in the present application, the predicted cluster resource usage is obtained based on the historical cluster resource usage prediction, and the current cluster resource usage is obtained based on the two, so that the accuracy of the current cluster resource usage can be improved.

[0065] As an optional scheme, when the current cluster resource utilization rate is less than the first resource utilization rate threshold, the maximum value of the resource scheduling threshold range is determined as the current resource scheduling threshold corresponding to the current cluster resource utilization rate, including: when at least one of the historical cluster resource utilization rate average and the predicted cluster resource utilization rate is less than the first resource utilization rate threshold, the maximum value of the resource scheduling threshold range is determined as the current resource scheduling threshold corresponding to the current cluster resource utilization rate.

[0066] When the current cluster resource usage is greater than the second resource usage threshold, the minimum value of the resource scheduling threshold range is determined as the current resource scheduling threshold corresponding to the current cluster resource usage, including: when at least one of the historical cluster resource usage average and the predicted cluster resource usage is greater than the second resource usage threshold, the minimum value of the resource scheduling threshold range is determined as the current resource scheduling threshold corresponding to the current cluster resource usage.

[0067] When the current cluster resource usage is greater than or equal to the first resource usage threshold and less than or equal to the second resource usage threshold, the current resource scheduling threshold is determined from the resource scheduling threshold range based on the relative relationship between the current cluster resource usage, the first resource usage threshold and the second resource usage threshold, including: when the historical cluster resource usage average and the predicted cluster resource usage are both greater than or equal to the first resource usage threshold and less than or equal to the second resource usage threshold, the current resource scheduling threshold is determined from the resource scheduling threshold range based on the relative relationship between the historical cluster resource usage average, the first resource usage threshold and the second resource usage threshold.

[0068] In this embodiment, the specific step of comprehensively determining the current resource scheduling threshold based on the historical cluster resource usage average and the predicted cluster resource usage can improve the accuracy of the determined current resource scheduling threshold; optionally, the current resource scheduling threshold can be determined only based on the historical cluster resource usage average, and the specific steps include:

[0069] When the historical cluster resource usage average is less than the first resource usage threshold, the maximum value of the resource scheduling threshold range is determined as the current resource scheduling threshold corresponding to the current cluster resource usage.

[0070] When the historical cluster resource usage average is greater than the second resource usage threshold, the minimum value of the resource scheduling threshold range is determined as the current resource scheduling threshold corresponding to the current cluster resource usage.

[0071] When the historical cluster resource usage average is greater than or equal to the first resource usage threshold and less than or equal to the second resource usage threshold, the current resource scheduling threshold is determined from the resource scheduling threshold range based on the relative relationship between the historical cluster resource usage average, the first resource usage threshold and the second resource usage threshold. Here, for the specific calculation method, the step of determining the current resource scheduling threshold from the resource scheduling threshold range based on the relative relationship between the current cluster resource usage, the first resource usage threshold and the second resource usage threshold in the above embodiment can be adopted.

[0072] Through the embodiments provided in the present application, the current resource scheduling threshold is comprehensively determined based on the historical cluster resource usage average and the predicted cluster resource usage, which can improve the accuracy of the determined current resource scheduling threshold.

[0073] As an optional solution, after obtaining the cluster resource usage rate of the cluster in the current period and obtaining the current cluster resource usage rate, the method further includes:

[0074] S61, when the current cluster resource usage rate is greater than a second resource usage rate threshold, restore the connection between at least part of the hosts in a group of hosts that are on standby and the cluster;

[0075] S62, scheduling some virtual machines running on a group of hosts to at least some hosts whose connections are restored, wherein at least one virtual machine is running on a host in a connected state among the group of hosts;

[0076] The scheduling operation on the target host refers to scheduling the virtual machine running on the target host to a host in the cluster that is in a connected state, and setting the target host to a standby state.

[0077] Optionally, when the current cluster resource utilization is greater than the second resource utilization threshold and the previous cluster resource utilization is greater than the resource utilization extreme value, all hosts in the cluster are restored to the cluster connection and it is prohibited to add new tasks to the cluster. Here, the resource utilization extreme value is greater than the second resource utilization threshold.

[0078] Through the embodiments provided by the present application, when the current cluster resource usage is too high, the stability of the cluster can be improved by restoring the connection between at least part of the hosts in a group of hosts that are on standby and the cluster.

[0079] As an optional solution, the cluster resource usage of the cluster includes the computing resource usage of the cluster and the memory usage of the cluster, the current cluster resource usage includes the current computing resource usage and the current memory usage, and the resource scheduling threshold range includes a first scheduling threshold range corresponding to the computing resource usage of the cluster and a second scheduling threshold range corresponding to the memory usage of the cluster;

[0080] Based on the current cluster resource usage and the resource scheduling threshold range, determining the current resource scheduling threshold corresponding to the current cluster resource usage, including: based on the current computing resource usage and the first scheduling threshold range, determining the current computing resource scheduling threshold corresponding to the current computing resource usage; based on the current memory usage and the second scheduling threshold range, determining the current memory scheduling threshold corresponding to the current memory usage;

[0081] Determining a target host to be scheduled in a group of hosts by comparing the resource utilization of a host in a group of hosts with a current resource scheduling threshold, including: determining a target host to be scheduled in a group of hosts by comparing the computing resource utilization of a host in a group of hosts with a current computing resource scheduling threshold, and comparing the memory utilization of a host in a group of hosts with a current memory scheduling threshold, wherein the target host satisfies at least one of the following conditions: the computing resource utilization of the target host is less than the current computing resource scheduling threshold, and the memory utilization of the target host is less than the current memory scheduling threshold.

[0082] In this embodiment, an optional solution is provided, in which the cluster resource utilization of the cluster includes the computing resource utilization of the cluster and the memory utilization of the cluster. Here, the computing resource utilization of the cluster may be the CPU utilization of the cluster, the current cluster resource utilization includes the current computing resource utilization and the current memory utilization, and the resource scheduling threshold range includes a first scheduling threshold range corresponding to the computing resource utilization of the cluster and a second scheduling threshold range corresponding to the memory utilization of the cluster.

[0083] Through the embodiments provided in the present application, the cluster resource utilization rate includes the computing resource utilization rate of the cluster and the memory utilization rate of the cluster, which can increase the reliability of the cluster resource scheduling method.

[0084] The cluster resource scheduling method in this application is explained below with optional examples. Figure 5 and Figure 6 .

[0085] The cluster resource scheduling method in this embodiment can be implemented by a threshold configuration management module, a DPM scheduling module, and a cluster resource monitoring and prediction module.

[0086] Threshold Management Module (For examples of actual threshold values, see Figure 5 ):

[0087] 1. Set the CPU usage threshold CPULow to set a more aggressive DPM scheduling threshold when the cluster CPU resource utilization is lower than this value; set the CPU usage threshold CPUHigh to set a more conservative DPM scheduling threshold when the cluster CPU resource utilization is higher than this value.

[0088] 2. Set the memory usage threshold MEMLow to set a more aggressive DPM scheduling threshold when the cluster memory resource utilization is lower than this value; set the memory usage threshold MEMHigh to set a more conservative DPM scheduling threshold when the cluster memory resource utilization is higher than this value.

[0089] 3. Set the CPU and memory usage extremes CPULimit and MEMLimit. When the host usage in the cluster reaches this value, the host shut down by DPM will be restored to supplement cluster resources.

[0090] 4. Set the DPM scheduling range thresholds CPUrange and MEMrange to execute DPM scheduling when the host CPU and memory resource utilization are lower than this value. These two values ​​are range values. The system sets the scheduling thresholds automatically based on cluster resource usage and prediction.

[0091] Cluster resource monitoring and prediction module:

[0092] 1. Cluster resource usage monitoring module, which can be monitored using various common cluster resource monitoring systems or methods.

[0093] 2. Cluster resource utilization prediction module, which uses quadratic exponential smoothing algorithm to predict cluster resource utilization in the future, and is used to set different scheduling thresholds.

[0094] Here, the specific steps of the DPM scheduling model are combined Figure 6 Provide explanation.

[0095] DPM scheduling module:

[0096] 1. The DPM scheduling module first obtains the various set thresholds CPULow, MEMLow, CPUHigh, MEMHigh, CPULimit, MEMLimit, CPUrange, and MEMrange.

[0097] 2. The scheduling module has a built-in scheduling cycle (current cycle). The cluster resource usage monitoring module obtains the cluster CPU and memory resource usage CPUcurrent and MEMcurrent within the cycle, and obtains the predicted values ​​CPUtrend and MEMtrend within a future cycle based on the cluster resource prediction module.

[0098] 3. CPU threshold setting in DPM scheduling:

[0099] 1) If one of the CPUcurrent average and the CPUtrend average is less than CPULow, set the DPM scheduling threshold to CPUrange(max); if one of the CPUcurrent average and the CPUtrend average is greater than CPUHigh, set the DPM scheduling threshold to CPUrange(min).

[0100] 2) If the CPUcurrent average and the CPUtrend average are both between CPULow and CPUHigh, the DPM scheduling threshold is set to CPUrange(mid)=CPUrange(max)-(CPUrange(max)-CPUrange(min))*(CPUcurrent-CPULow) / (CPUHigh-CPULow).

[0101] Memory threshold setting in DPM scheduling:

[0102] 1) If one of the MEMcurrent mean and the MEMtrend mean is less than MEMLow, the DPM scheduling threshold is set to MEMrange(max); if one of the MEMcurrent mean and the MEMtrend mean is greater than MEMHigh, the DPM scheduling threshold is set to MEMrange(min).

[0103] 2) If the mean value of MEMcurrent and the mean value of MEMtrend are both between MEMLow and MEMHigh, the DPM scheduling threshold is set to MEMrange(mid)=MEMrange(max)-(MEMrange(max)-MEMrange(min))*(MEMcurrent-MEMLow) / (MEMHigh-MEMLow).

[0104] 4. According to the DPM thresholds set in the third and fourth steps, determine the hosts that can perform DPM scheduling in the current cycle. If the CPU and memory usage of the host are both lower than the set DPM scheduling thresholds, migrate all virtual machines on this host to other hosts in the cluster, and put this host in standby mode (directly shut down in the background), and resume use when cluster resources are insufficient, or resume use after the DPM scheduling policy is turned off; if one of them is not lower than the set DPM scheduling threshold, or there are powered-on virtual machines on the host that cannot be migrated, or other restrictions that do not meet the DPM scheduling rules (such conditions can be customized), this host will not trigger DPM standby. Then continue scheduling for the next cycle.

[0105] 5. When either CPUcurrent or MEMcurrent is greater than the corresponding extreme value CPULimit or MEMLimit, the hosts in the cluster that are on standby through DPM scheduling are restored to increase the available resources of the cluster.

[0106] 6. Then continue from the first step to perform the next cycle scheduling logic and judgment.

[0107] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0109] According to another aspect of the embodiments of the present application, a cluster resource scheduling device is also provided, which is used to implement the cluster resource scheduling method provided in the above embodiments, and the description has been made no further. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0110] Figure 7 is a structural block diagram of a cluster resource scheduling device according to an embodiment of the present application, such as Figure 7 As shown, the device comprises:

[0111] The acquisition unit 702 is used to acquire image semantic features corresponding to the image to be recognized when the image to be recognized does not contain a human-shaped object with a face, wherein the image to be recognized is a visual image to be subjected to emotion category recognition;

[0112] The first extraction unit 704 is used to extract visual aesthetic features of the image to be identified, and obtain image visual aesthetic features corresponding to the image to be identified, wherein the visual aesthetic features are used to characterize the image aesthetics of the image to be identified;

[0113] The first execution unit 706 is used to perform feature fusion on the image semantic features and the image visual aesthetic features to obtain a first fusion feature, and perform emotion category recognition based on the obtained first fusion feature to obtain a first recognition result of the image to be recognized.

[0114] It should be noted that the acquisition unit 702 in this embodiment can be used to execute the above step S202, the first extraction unit 704 in this embodiment can be used to execute the above step S204, and the first execution unit 706 in this embodiment can be used to execute the above step S206.

[0115] Through the embodiments provided by the present application, the cluster resource utilization rate of the cluster in the current cycle is obtained to obtain the current cluster resource utilization rate, wherein the cluster includes a group of hosts, the cluster resource utilization rate of the cluster is determined according to the resource utilization rate of the hosts in the group of hosts in the current cycle, and the resource utilization rate of the hosts in the group of hosts is used to characterize the workload of the hosts in the group of hosts; based on the current cluster resource utilization rate and the resource scheduling threshold range, the current resource scheduling threshold corresponding to the current cluster resource utilization rate is determined, wherein the resource scheduling threshold range is the range of the resource scheduling threshold used for resource scheduling of the cluster, the resource scheduling threshold used for resource scheduling of the cluster is the threshold of the resource utilization rate of the hosts in the group of hosts, the resource scheduling threshold used for resource scheduling of the cluster is used to determine the hosts to be scheduled in the group of hosts, and the cluster resource utilization rate of the cluster is negatively correlated with the resource scheduling threshold used for resource scheduling of the cluster; by comparing the resource utilization rate of the hosts in the group of hosts with the current resource scheduling threshold, determining the target host to be scheduled in the group of hosts, and performing the scheduling operation on the target host, the problem of low cluster resource utilization rate in the cluster resource scheduling method in the related art is solved, and the cluster resource utilization rate is improved.

[0116] Optionally, the determining unit includes:

[0117] A first determination module is used to determine the maximum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage when the current cluster resource usage is less than the first resource usage threshold;

[0118] a second determination module, configured to determine, when the current cluster resource usage is greater than a second resource usage threshold, a minimum value of the resource scheduling threshold range as a current resource scheduling threshold corresponding to the current cluster resource usage;

[0119] A third determination module is used to determine the current resource scheduling threshold from the resource scheduling threshold range based on the relative relationship between the current cluster resource usage, the first resource usage threshold and the second resource usage threshold when the current cluster resource usage is greater than or equal to the first resource usage threshold and less than or equal to the second resource usage threshold;

[0120] The first resource usage rate threshold is smaller than the second resource usage rate threshold.

[0121] Optionally, the third determination module includes:

[0122] The first determination submodule is used to multiply the difference between the current cluster resource utilization and the first resource utilization threshold by a specified ratio to obtain a target value, and determine the value obtained by subtracting the target value from the maximum value of the resource scheduling threshold range as the current resource scheduling threshold, wherein the specified ratio is the ratio between the difference obtained by subtracting the minimum value of the resource scheduling threshold range from the maximum value of the resource scheduling threshold range and the difference obtained by subtracting the first resource utilization threshold from the second resource utilization threshold.

[0123] Optionally, the acquisition unit includes:

[0124] a fourth determination module, configured to obtain a group of historical cluster resource usages of the cluster in the current period, and determine an average value of the group of historical cluster resource usages as the historical cluster resource usage average value, wherein each historical cluster resource usage in the group of historical cluster resource usages is the cluster resource usage of the cluster at a historical time point in the current period, the cluster resource usage of the cluster at a historical time point is the average value of resource usages of hosts in a group of hosts at a historical time point, and the current cluster resource usage includes the historical cluster resource usage average value;

[0125] The first execution module is used to predict the cluster resource utilization of the next cycle of the current cycle based on a group of historical cluster resource utilizations to obtain a group of predicted cluster resource utilizations, and determine the average value of the group of predicted cluster resource utilizations as the predicted cluster resource utilization mean, wherein each predicted cluster resource utilization in the group of predicted cluster resource utilizations is a predicted cluster resource utilization of the cluster at a future time point in the next cycle, and the current cluster resource utilization includes the predicted cluster resource utilization.

[0126] Optionally, the first determination module includes: a second determination submodule, configured to determine a maximum value of the resource scheduling threshold range as a current resource scheduling threshold corresponding to the current cluster resource usage when at least one of the historical cluster resource usage average and the predicted cluster resource usage is less than the first resource usage threshold;

[0127] The second determination module includes: a third determination submodule, configured to determine the minimum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage rate when at least one of the historical cluster resource usage rate mean value and the predicted cluster resource usage rate is greater than the second resource usage rate threshold value;

[0128] The third determination module includes: a fourth determination sub-module, which is used to determine the current resource scheduling threshold from the resource scheduling threshold range based on the relative relationship between the historical cluster resource utilization average, the first resource utilization threshold and the second resource utilization threshold when the historical cluster resource utilization average and the predicted cluster resource utilization are both greater than or equal to the first resource utilization threshold and less than or equal to the second resource utilization threshold.

[0129] Optionally, the above device further includes:

[0130] A second execution unit is used to obtain the cluster resource usage rate of the cluster in the current cycle, and after obtaining the current cluster resource usage rate, if the current cluster resource usage rate is greater than a second resource usage rate threshold, restore the connection between at least part of the hosts in a group of hosts that have been in standby mode and the cluster;

[0131] A second execution unit is used to schedule some virtual machines running on a group of hosts to at least some hosts that have restored connections, wherein at least one virtual machine is running on a host in a connected state among the group of hosts;

[0132] The scheduling operation on the target host refers to scheduling the virtual machine running on the target host to a host in the cluster that is in a connected state, and setting the target host to a standby state.

[0133] Optionally, the cluster resource usage of the cluster includes the computing resource usage of the cluster and the memory usage of the cluster, the current cluster resource usage includes the current computing resource usage and the current memory usage, and the resource scheduling threshold range includes a first scheduling threshold range corresponding to the computing resource usage of the cluster and a second scheduling threshold range corresponding to the memory usage of the cluster;

[0134] The determination unit includes: a first execution module, configured to determine a current computing resource scheduling threshold corresponding to the current computing resource usage rate based on the current computing resource usage rate and the first scheduling threshold range; and determine a current memory scheduling threshold corresponding to the current memory usage rate based on the current memory usage rate and the second scheduling threshold range;

[0135] The first execution unit includes: a second execution module, which is used to determine a target host to be scheduled in a group of hosts by comparing the computing resource utilization of a host in the group of hosts with a current computing resource scheduling threshold, and comparing the memory utilization of a host in the group of hosts with a current memory scheduling threshold, wherein the target host satisfies at least one of the following conditions: the computing resource utilization of the target host is less than the current computing resource scheduling threshold, and the memory utilization of the target host is less than the current memory scheduling threshold.

[0136] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored program, wherein the program executes the steps of any of the above method embodiments when it is run.

[0137] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0138] According to another aspect of the embodiments of the present application, there is further provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the steps in any of the above method embodiments through the computer program.

[0139] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0140] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0141] According to another aspect of the embodiment of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flowchart. Figure 8 The computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processor 801, various functions provided by the embodiments of the present application are executed. The serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0142] refer to Figure 8 , Figure 8It is a structural block diagram of a computer system of an optional electronic device according to an embodiment of the present application.

[0143] Figure 8 The computer system structure block diagram of the electronic device used to implement the embodiment of the present application is schematically shown. Figure 8 As shown, the computer system 800 includes a central processing unit 801 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 802 (ROM) or the program loaded from the storage part 808 to the random access memory 803 (RAM). Various programs and data required for system operation are also stored in the random access memory 803. The central processing unit 801, the read-only memory 802 and the random access memory 803 are connected to each other through a bus 804. The input / output interface 805 (Input / Output interface, i.e., I / O interface) is also connected to the bus 804.

[0144] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a local area network card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.

[0145] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processor 801, various functions defined in the system of the present application are executed.

[0146] It should be noted that Figure 8The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0147] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0148] The above are only preferred embodiments of the present application and are not intended to limit the embodiments of the present application. For those skilled in the art, the embodiments of the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the embodiments of the present application shall be included in the protection scope of the embodiments of the present application.

Claims

1. A cluster resource scheduling method, characterized in that: include: Obtaining a cluster resource usage rate of a cluster in a current cycle to obtain a current cluster resource usage rate, wherein the cluster includes a group of hosts, and the cluster resource usage rate of the cluster is determined according to the resource usage rates of the hosts in the group of hosts in the current cycle, and the resource usage rates of the hosts in the group of hosts are used to characterize the workload conditions of the hosts in the group of hosts; Based on the current cluster resource usage and the resource scheduling threshold range, determine a current resource scheduling threshold corresponding to the current cluster resource usage, wherein the resource scheduling threshold range is a range of resource scheduling thresholds used for resource scheduling of the cluster, the resource scheduling threshold used for resource scheduling of the cluster is a threshold of resource usage of a host in the group of hosts, the resource scheduling threshold used for resource scheduling of the cluster is used to determine a host to be scheduled in the group of hosts, and the cluster resource usage of the cluster is negatively correlated with the resource scheduling threshold used for resource scheduling of the cluster; By comparing the resource usage rates of the hosts in the group of hosts with the current resource scheduling threshold, a target host to be scheduled in the group of hosts is determined, and a scheduling operation is performed on the target host.

2. The method according to claim 1, characterized in that The determining, based on the current cluster resource usage and the resource scheduling threshold range, a current resource scheduling threshold corresponding to the current cluster resource usage includes: When the current cluster resource usage is less than the first resource usage threshold, determining the maximum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage; When the current cluster resource usage is greater than the second resource usage threshold, determining the minimum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage; When the current cluster resource usage is greater than or equal to the first resource usage threshold and less than or equal to the second resource usage threshold, the current resource scheduling threshold is determined from the resource scheduling threshold range based on a relative relationship between the current cluster resource usage, the first resource usage threshold and the second resource usage threshold; The first resource usage rate threshold is smaller than the second resource usage rate threshold.

3. The method according to claim 2, characterized in that The determining the current resource scheduling threshold from the resource scheduling threshold range based on the relative relationship between the current cluster resource usage, the first resource usage threshold, and the second resource usage threshold includes: The difference between the current cluster resource utilization and the first resource utilization threshold is multiplied by a specified ratio to obtain a target value, and the value obtained by subtracting the target value from the maximum value of the resource scheduling threshold range is determined as the current resource scheduling threshold, wherein the specified ratio is the ratio between the difference obtained by subtracting the minimum value of the resource scheduling threshold range from the maximum value of the resource scheduling threshold range and the difference obtained by subtracting the first resource utilization threshold from the second resource utilization threshold.

4. The method according to claim 2, characterized in that: The obtaining of the cluster resource usage rate of the cluster in the current period to obtain the current cluster resource usage rate includes: Obtain a group of historical cluster resource usages of the cluster in the current period, and determine the average value of the group of historical cluster resource usages as the historical cluster resource usage average value, wherein each historical cluster resource usage in the group of historical cluster resource usages is the cluster resource usage of the cluster at a historical time point in the current period, the cluster resource usage of the cluster at a historical time point is the average value of resource usages of the hosts in the group of hosts at the historical time point, and the current cluster resource usage includes the historical cluster resource usage average value; The cluster resource usage of the next cycle of the current cycle is predicted based on the set of historical cluster resource usages to obtain a set of predicted cluster resource usages, and the average value of the set of predicted cluster resource usages is determined as the predicted cluster resource usage mean, wherein each predicted cluster resource usage in the set of predicted cluster resource usages is a predicted cluster resource usage of the cluster at a future time point in the next cycle, and the current cluster resource usage includes the predicted cluster resource usage.

5. The method according to claim 4, characterized in that The determining, when the current cluster resource usage is less than the first resource usage threshold, the maximum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage, comprises: when at least one of the historical cluster resource usage average and the predicted cluster resource usage is less than the first resource usage threshold, determining the maximum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage; The step of determining, when the current cluster resource usage is greater than the second resource usage threshold, the minimum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage, comprises: when at least one of the historical cluster resource usage average and the predicted cluster resource usage is greater than the second resource usage threshold, determining the minimum value of the resource scheduling threshold range as the current resource scheduling threshold corresponding to the current cluster resource usage; The determining the current resource scheduling threshold from the resource scheduling threshold range based on the relative relationship between the current cluster resource usage, the first resource usage threshold, and the second resource usage threshold when the current cluster resource usage is greater than or equal to the first resource usage threshold and less than or equal to the second resource usage threshold, including: determining the current resource scheduling threshold from the resource scheduling threshold range based on the relative relationship between the historical cluster resource usage average, the first resource usage threshold, and the second resource usage threshold when both the historical cluster resource usage average and the predicted cluster resource usage are greater than or equal to the first resource usage threshold and less than or equal to the second resource usage threshold.

6. The method according to claim 2, characterized in that After obtaining the cluster resource utilization rate of the cluster in the current period and obtaining the current cluster resource utilization rate, the method further includes: When the current cluster resource usage rate is greater than the second resource usage rate threshold, restoring the connection between at least part of the hosts in the group of hosts that are on standby and the cluster; Scheduling some virtual machines running on the group of hosts to at least some of the hosts that have restored connections, wherein at least one virtual machine is running on a host in a connected state among the group of hosts; The performing of the scheduling operation on the target host refers to scheduling the virtual machine running on the target host to a host in the cluster that is in a connected state, and setting the target host to a standby state.

7. The method according to any one of claims 1 to 6, characterized in that The cluster resource usage of the cluster includes the computing resource usage of the cluster and the memory usage of the cluster, the current cluster resource usage includes the current computing resource usage and the current memory usage, and the resource scheduling threshold range includes a first scheduling threshold range corresponding to the computing resource usage of the cluster and a second scheduling threshold range corresponding to the memory usage of the cluster; The determining, based on the current cluster resource usage and the resource scheduling threshold range, a current resource scheduling threshold corresponding to the current cluster resource usage includes: determining, based on the current computing resource usage and the first scheduling threshold range, a current computing resource scheduling threshold corresponding to the current computing resource usage; determining, based on the current memory usage and the second scheduling threshold range, a current memory scheduling threshold corresponding to the current memory usage; The method of determining a target host to be scheduled in the group of hosts by comparing the resource usage of the hosts in the group of hosts with the current resource scheduling threshold comprises: determining the target host to be scheduled in the group of hosts by comparing the computing resource usage of the hosts in the group of hosts with the current computing resource scheduling threshold, and comparing the memory usage of the hosts in the group of hosts with the current memory scheduling threshold, wherein the target host satisfies at least one of the following conditions: the computing resource usage of the target host is less than the current computing resource scheduling threshold, and the memory usage of the target host is less than the current memory scheduling threshold.

8. A cluster resource scheduling device, characterized in that: include: an acquisition unit, configured to acquire a cluster resource usage rate of a cluster in a current cycle, and obtain a current cluster resource usage rate, wherein the cluster includes a group of hosts, and the cluster resource usage rate of the cluster is determined according to the resource usage rate of the hosts in the group of hosts in the current cycle, and the resource usage rate of the hosts in the group of hosts is used to characterize the workload of the hosts in the group of hosts; a determining unit, configured to determine a current resource scheduling threshold value corresponding to the current cluster resource usage rate based on the current cluster resource usage rate and a resource scheduling threshold range, wherein the resource scheduling threshold range is a range of resource scheduling threshold values ​​used for resource scheduling of the cluster, the resource scheduling threshold value used for resource scheduling of the cluster is a threshold value of resource usage rate of a host in the group of hosts, the resource scheduling threshold value used for resource scheduling of the cluster is used to determine a host to be scheduled in the group of hosts, and the cluster resource usage rate of the cluster is negatively correlated with the resource scheduling threshold value used for resource scheduling of the cluster; The first execution unit is used to determine a target host to be scheduled in the group of hosts by comparing the resource usage rate of the host in the group of hosts with the current resource scheduling threshold, and perform a scheduling operation on the target host.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of any one of the methods of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.