Search

CN-122019095-A - Method, device and product for determining idle computing resources

CN122019095ACN 122019095 ACN122019095 ACN 122019095ACN-122019095-A

Abstract

The disclosure provides a method, a device, electronic equipment, a storage medium and a computer program product for determining idle computing resources, relates to the technical field of computers, and in particular relates to the technical fields of cloud computing, virtualization, and the like, and can be applied to a cloud computing resource scheduling scene. The method comprises the steps of determining virtual machine occupation regions of effective computing resources currently occupied by virtual machines according to resource requests and resource use types of the virtual machines, determining physical machine occupation regions of occupied effective computing resources in the physical machines by combining the virtual machine occupation regions of the virtual machines in the physical machines, and determining idle computing resources according to total regions of total computing resources and physical machine occupation regions of the physical machines. According to the method and the device, the effective computing resources currently occupied by the virtual machine are modeled as the virtual machine occupation interval according to the resource request and the resource use type of the virtual machine, so that the adaptation range of the modeling mode and the determination efficiency and accuracy of the idle resources are improved.

Inventors

  • Wu Kangzhao
  • Yu Fengjiu

Assignees

  • 北京百度网讯科技有限公司

Dates

Publication Date
20260512
Application Date
20260130

Claims (18)

  1. 1. A method of determining idle computing resources, comprising: determining a virtual machine occupation interval representing effective computing resources currently occupied by the virtual machine according to the resource request and the resource use type of the virtual machine; Combining virtual machine occupation intervals of all the virtual machines in the physical machine, and determining a physical machine occupation interval representing occupied effective computing resources in the physical machine; And determining idle computing resources according to the total interval of the total computing resources of the characterization physical machine and the occupied interval of the physical machine.
  2. 2. The method of claim 1, wherein the resource usage type is used to define a decision rule of whether computing resources of the virtual machine can be reclaimed and reallocated in response to the resource request, and The determining, according to the resource request and the resource usage type of the virtual machine, a virtual machine occupation interval representing an effective computing resource currently occupied by the virtual machine includes: And for the virtual machines under each resource use type in the physical machine, determining a virtual machine occupation interval of the virtual machine according to the resource request and a judging rule corresponding to the resource use type.
  3. 3. The method of claim 2, wherein the resource usage type includes a conditional match type, the determination rule corresponding to the conditional match type includes a match condition of whether the virtual machine to be created corresponding to the resource request can occupy a computing resource currently occupied by the first virtual machine in the conditional match type, and For the virtual machine under each resource usage type in the physical machine, determining a virtual machine occupation interval of the virtual machine according to the resource request and a determination rule corresponding to the resource usage type, including: And for the first virtual machine under the condition matching type in the physical machine, determining a virtual machine occupation interval of the first virtual machine according to a matching result between the item to be matched in the resource request and the matching condition.
  4. 4. The method of claim 3, wherein the determining the virtual machine occupation space of the first virtual machine according to the matching result between the item to be matched in the resource request and the matching condition includes: and responding to the matching result to represent mismatching between the item to be matched in the resource request and the matching condition, taking the currently occupied computing resource of the first virtual machine as an effective computing resource, and determining a virtual machine occupation interval representing the effective computing resource.
  5. 5. The method of claim 3, wherein the determining the virtual machine occupation space of the first virtual machine according to the matching result between the item to be matched in the resource request and the matching condition includes: and responding to the matching result to represent that the item to be matched in the resource request is matched with the matching condition, taking the computing resource currently occupied by the first virtual machine as invalid computing resource, and determining that the virtual machine occupied interval is an empty interval.
  6. 6. A method according to claim 3, further comprising: And taking the currently occupied computing resources of other virtual machines except the target virtual machine as effective computing resources, and determining virtual machine occupied intervals of the effective computing resources of the other virtual machines, wherein the target virtual machine is a first virtual machine with matching conditions matched with items to be matched in the resource request under the condition matching type.
  7. 7. The method of claim 2, wherein the resource usage types include a priority determination type, virtual machines under other resource usage types having a priority higher than the priority determination type are allowed to preempt computing resources of a second virtual machine under the priority determination type, and For the virtual machine under each resource usage type in the physical machine, determining a virtual machine occupation interval of the virtual machine according to the resource request and a determination rule corresponding to the resource usage type, including: And for the second virtual machine in the priority judging type in the physical machine, determining a virtual machine occupation interval of the second virtual machine according to the priority of the resource using type corresponding to the resource request and the priority of the priority judging type.
  8. 8. The method of claim 7, wherein the determining, for the second virtual machine under the priority determination type in the physical machine, the virtual machine occupation interval of the second virtual machine according to the priority of the resource usage type corresponding to the resource request and the priority of the priority determination type includes: And determining a virtual machine occupation interval of a second virtual machine according to the priority of the resource use type corresponding to the resource request and the priority of the priority judgment type for the second virtual machine under the priority judgment type in the physical machine in response to the fact that the target virtual machine is not included in the physical machine, wherein the target virtual machine is a first virtual machine with a matching condition matched with a to-be-matched item in the resource request under the condition matching type, and the judging rule corresponding to the condition matching type comprises a matching condition of whether the to-be-created virtual machine corresponding to the resource request can occupy the computing resource currently occupied by the first virtual machine.
  9. 9. The method according to claim 7 or 8, wherein the determining the virtual machine occupation space of the second virtual machine according to the priority of the resource usage type corresponding to the resource request and the priority of the priority determination type includes: And responding to the priority of the resource use type corresponding to the resource request is higher than the priority of the priority judgment type, taking the currently occupied computing resource of the virtual machine as an invalid computing resource, and determining that the virtual machine occupation interval of the virtual machine is an empty interval.
  10. 10. The method according to claim 7 or 8, wherein the determining the virtual machine occupation space of the second virtual machine according to the priority of the resource usage type corresponding to the resource request and the priority of the priority determination type includes: And responding to the fact that the priority of the resource use type corresponding to the resource request is lower than or equal to the priority of the priority judgment type, taking the currently occupied computing resource of the virtual machine as an effective computing resource, and determining a virtual machine occupation interval representing the effective computing resource.
  11. 11. The method of claim 2, wherein the resource usage type comprises a base resource type, a third virtual machine under the base resource type having exclusivity for computing resources it occupies, and For the virtual machine under each resource usage type in the physical machine, determining a virtual machine occupation interval of the virtual machine according to the resource request and a determination rule corresponding to the resource usage type, including: And for a third virtual machine in the physical machine under the basic resource type, taking the currently occupied computing resource of the third virtual machine as an effective computing resource, and determining a virtual machine occupation interval representing the effective computing resource.
  12. 12. The method according to any one of claims 2-10, wherein the determining, for the virtual machine under each resource usage type in the physical machine, a virtual machine occupation interval of the virtual machine according to the resource request and the determination rule corresponding to the resource usage type includes: and for the virtual machines under the use types of the resources in the physical machine, respectively calculating the occupation interval of the virtual machines under the current existing occupation states of the resources according to the resource request and the judgment rule.
  13. 13. The method of any of claims 1-12, wherein the virtual machine occupancy zone is a left-closed right-open zone, and The determining, in combination with the virtual machine occupation space of each virtual machine in the physical machines, a physical machine occupation space representing occupied effective computing resources in the physical machines includes: sequencing the virtual machine occupation intervals of each virtual machine according to the sequence from the small interval starting value to the large interval starting value to obtain an interval sequence; And executing union operation on virtual machine occupied intervals with intersections in the interval sequence to obtain the physical machine occupied space.
  14. 14. The method of any of claims 1-12, wherein the determining free computing resources from the total interval characterizing total computing resources of the physical machine and the physical machine occupancy interval comprises: And performing difference set operation on the total interval and the physical machine occupied interval to determine the idle computing resource.
  15. 15. An apparatus for determining idle computing resources, comprising: The first determining unit is configured to determine a virtual machine occupation interval of effective computing resources currently occupied by the virtual machine according to the resource request and the resource use type of the virtual machine; A second determining unit configured to determine a physical machine occupation interval characterizing an occupied effective computing resource in a physical machine in combination with a virtual machine occupation interval of each of the virtual machines in the physical machine; And a third determining unit configured to determine an idle computing resource according to a total interval of total computing resources of the physical machine and the physical machine occupation interval.
  16. 16. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-14.
  17. 17. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-14.
  18. 18. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-14.

Description

Method, device and product for determining idle computing resources Technical Field The disclosure relates to the technical field of computers, in particular to the technical fields of cloud computing, virtualization and the like, and particularly relates to a method and a device for determining idle computing resources, electronic equipment, a storage medium and a computer program product, which can be applied to a cloud computing resource scheduling scene. Background The cloud computing resource scheduling system needs to model physical machine resources such as a central processing unit, a memory, a disk, a network and the like so as to calculate the resource allowance. The existing scheduling system generally adopts a resource modeling mode such as a quantity calculation model and a binding resource model, the quantity calculation model adopts a quantity aggregation linear model, and the binding resource model adopts a Boolean occupation model which is judged in a number-by-number and resource-by-resource state accumulation mode. Disclosure of Invention The present disclosure provides a method, apparatus, electronic device, storage medium, and computer program product for determining idle computing resources. According to a first aspect, a method for determining idle computing resources is provided, which comprises the steps of determining virtual machine occupation regions of effective computing resources currently occupied by virtual machines according to resource requests and resource usage types of the virtual machines, determining physical machine occupation regions of occupied effective computing resources in physical machines according to virtual machine occupation regions of virtual machines in the physical machines, and determining idle computing resources according to total regions of total computing resources and physical machine occupation regions of the physical machines. According to a second aspect, there is provided a determination apparatus of idle computing resources, including a first determination unit configured to determine a virtual machine occupation interval representing effective computing resources currently occupied by a virtual machine according to a resource request and a resource usage type of the virtual machine, a second determination unit configured to determine a physical machine occupation interval representing effective computing resources already occupied in a physical machine in combination with a virtual machine occupation interval of each of the virtual machines, and a third determination unit configured to determine idle computing resources according to a total interval representing total computing resources and a physical machine occupation interval representing the physical machine. According to a third aspect there is provided an electronic device comprising at least one processor and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method as described in any one of the implementations of the first aspect. According to a fourth aspect, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform a method as described in any implementation of the first aspect. According to a fifth aspect, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method as described in any of the implementations of the first aspect. According to the technology of the disclosure, a method and a device for determining idle computing resources are provided, virtual machine occupation regions of effective computing resources currently occupied by a virtual machine are determined according to resource requests and resource use types of the virtual machines, virtual machine occupation regions of occupied effective computing resources in the physical machines are combined, physical machine occupation regions of occupied effective computing resources in the physical machines are determined, idle computing resources are determined according to total regions of total computing resources and physical machine occupation regions of the physical machines, a new computing resource modeling mode is provided, the effective computing resources currently occupied by the virtual machines are modeled as virtual machine occupation regions according to the resource requests and the resource use types of the virtual machines, the adaptation range of the modeling mode in various computing resources is improved, idle computing resources in the physical machines are finally determined based on the virtual machine occupation regions of the virtual machines, and the determination efficiency and accuracy of the idle resources are improved. It should be understood that the description in this section is not intended to identify ke