Method and device for determining idle computing resources and product

By determining the computing resource usage range of virtual machines and physical machines through interval modeling, the problem of insufficient efficiency and accuracy of resource allocation in cloud computing resource scheduling systems is solved, and more efficient resource management is achieved.

CN122019095APending Publication Date: 2026-05-12BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2026-01-30
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing cloud computing resource scheduling systems suffer from inflexible modeling methods when determining available computing resources, resulting in insufficient efficiency and accuracy in resource allocation.

Method used

By determining the virtual machine occupancy range of the effective computing resources currently occupied by the virtual machine, and combining it with the occupancy range of each virtual machine in the physical machine, the effective computing resources already occupied in the physical machine are determined by the range modeling method, and then the idle computing resources are calculated.

Benefits of technology

It improves the adaptability of resource modeling methods across various computing resources, enhances the efficiency and accuracy of identifying idle resources, and simplifies the resource allocation decision-making process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019095A_ABST
    Figure CN122019095A_ABST
Patent Text Reader

Abstract

The invention provides an idle computing resource determination method and device, electronic equipment, a storage medium and a computer program product, relates to the technical field of computers, in particular to the technical fields of cloud computing, virtualization and the like, and can be applied to a cloud computing resource scheduling scene. According to the specific implementation scheme, according to a resource request and a resource use type of a virtual machine, a virtual machine occupancy interval representing effective computing resources currently occupied by the virtual machine is determined; determining a physical machine occupancy interval representing occupied effective computing resources in the physical machine in combination with the virtual machine occupancy interval of each virtual machine in the physical machine; and determining idle computing resources according to the total interval representing the total computing resources of the physical machine and the physical machine occupation interval. According to the resource request and the resource use type of the virtual machine, the effective computing resource currently occupied by the virtual machine is modeled as the virtual machine occupation interval, so that the adaptation range of the modeling mode and the determination efficiency and accuracy of the idle resource are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, specifically to the fields of cloud computing and virtualization, and in particular to a method, apparatus, electronic device, storage medium, and computer program product for determining idle computing resources, which can be applied to cloud computing resource scheduling scenarios. Background Technology

[0002] Cloud computing resource scheduling systems require modeling physical machine resources such as CPUs, memory, disks, and networks to calculate resource availability. Existing scheduling systems typically employ resource modeling methods such as quantity calculation models and resource-bound models. Quantity calculation models use linear models that aggregate quantities, while resource-bound models use Boolean occupancy models that accumulate judgments based on resource number and status. Summary of the Invention

[0003] This disclosure provides a method, apparatus, electronic device, storage medium, and computer program product for determining idle computing resources.

[0004] According to the first aspect, a method for determining idle computing resources is provided, comprising: determining a virtual machine occupancy range representing the effective computing resources currently occupied by a virtual machine based on resource requests and the resource usage type of the virtual machine; determining a physical machine occupancy range representing the effective computing resources already occupied in the physical machine by combining the virtual machine occupancy ranges of each virtual machine in the physical machine; and determining idle computing resources based on the total range representing the total computing resources of the physical machine and the physical machine occupancy range.

[0005] According to a second aspect, an apparatus for determining idle computing resources is provided, comprising: a first determining unit configured to determine a virtual machine occupancy interval representing the effective computing resources currently occupied by a virtual machine based on resource requests and the resource usage type of the virtual machine; a second determining unit configured to determine a physical machine occupancy interval representing the effective computing resources already occupied in the physical machine by combining the virtual machine occupancy intervals of each virtual machine in the physical machine; and a third determining unit configured to determine idle computing resources based on the total interval representing the total computing resources of the physical machine and the physical machine occupancy interval.

[0006] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in any implementation of the first aspect.

[0007] According to a fourth aspect, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to perform the method described in any implementation of the first aspect.

[0008] According to a fifth aspect, a computer program product is provided, comprising: a computer program that, when executed by a processor, implements the method as described in any implementation of the first aspect.

[0009] According to the technology disclosed herein, a method and apparatus for determining idle computing resources are provided. This involves determining a virtual machine occupancy interval (VM occupancy interval) representing the effective computing resources currently occupied by a virtual machine, based on resource requests and the resource usage type of the virtual machine; combining this with the VM occupancy intervals of each virtual machine in the physical machine, determining a physical machine occupancy interval representing the effective computing resources already occupied in the physical machine; and determining idle computing resources based on the total interval representing the total computing resources of the physical machine and the physical machine occupancy interval. This provides a novel computing resource modeling approach. By modeling the effective computing resources currently occupied by a virtual machine as a VM occupancy interval based on resource requests and the resource usage type of the virtual machine, the adaptability of the modeling method to various computing resources is improved. Finally, the idle computing resources in the physical machine are determined based on the VM occupancy intervals, improving the efficiency and accuracy of idle resource determination.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0011] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is an exemplary system architecture diagram that can be applied to an embodiment of this disclosure; Figure 2 This is a flowchart of one embodiment of the method for determining idle computing resources according to the present disclosure; Figure 3 This is a schematic diagram of the union operation of the virtual machine's occupied interval according to this embodiment; Figure 4 This is a schematic diagram of the interval difference operation according to this embodiment; Figure 5 This is a schematic diagram illustrating an application scenario of the method for determining idle computing resources according to this embodiment; Figure 6 This is a flowchart of yet another embodiment of the method for determining idle computing resources according to the present disclosure; Figure 7 This is a structural diagram of one embodiment of the device for determining idle computing resources according to the present disclosure; Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing the embodiments of the present disclosure. Detailed Implementation

[0012] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0013] The technical solutions disclosed herein involve the collection, storage, use, processing, transmission, provision, and disclosure of various types of information, such as user personal information, in accordance with relevant laws and regulations and do not violate public order and good morals.

[0014] Figure 1 An exemplary architecture 100 is shown that can be applied to the method and apparatus for determining idle computing resources disclosed herein.

[0015] like Figure 1 As shown, the system architecture 100 may include virtual machine servers 101, 102, and 103, a network 104, and a resource server 105. The communication connections between virtual machine servers 101, 102, and 103 form a network topology. Network 104 serves as the medium for providing communication links between virtual machine servers 101, 102, and 103 and the resource scheduling server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0016] Virtual machine servers 101, 102, and 103 can be servers that support virtualization technology and deploy virtual machines. For example, they can support KVM (Kernel-based Virtual Machine) virtualization technology. Through the KVM kernel module, physical hardware resources (such as CPU (Central Processing Unit), memory, storage, and network) are abstracted into dynamically allocable virtual resource pools, and multiple independent virtual machines are deployed and run on this basis. At the hardware level, it supports CPU virtualization extension technology, providing hardware-level virtualization capabilities for KVM, improving the operating efficiency and isolation of virtual machines. At the software level, it integrates the Linux operating system and user-space tools such as QEMU (Quick Emulator), managing the lifecycle of virtual machines (creation, destruction, pause, and resumption), vCPU (Virtual Central Processing Unit) scheduling, and resource allocation through the KVM core module. Multiple virtual machines with different operating systems (such as Linux and Windows) can run simultaneously on a single physical server. Each virtual machine shares the hardware resources of the physical server, but through KVM's isolation mechanism, they run independently without interference.

[0017] Resource scheduling server 105 can be a server that provides virtual machine resource scheduling services. For example, in response to resource requests from virtual machine servers 101, 102, and 103, it uses a resource range modeling approach to determine the background processing server for idle computing resources in the physical machine. As an example, server 105 can be a cloud server.

[0018] It should be noted that virtual machine servers and resource scheduling servers can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules (such as software programs or software modules used to provide distributed services), or as a single software program or software module. No specific limitations are made here.

[0019] The resource scheduling server can be deployed in two ways: one is integrated, which is a built-in functional module of the virtual machine server, sharing physical resources and coordinating virtualization components through internal communication, adapting to small-scale scenarios; the other is standalone, which is a dedicated server that communicates with the virtual machine server via the network, centrally handling the scheduling of resources across the entire cluster and the calculation of interval models, adapting to medium-to-large-scale cloud computing scenarios.

[0020] It should also be noted that the method for determining idle computing resources provided in the embodiments of this disclosure is generally executed by a resource scheduling server, but it is not excluded that it may be executed by a virtual machine server, or by a combination of a virtual machine server and a resource scheduling server. Accordingly, the various parts (e.g., various units) included in the device for determining idle computing resources can all be set in the resource scheduling server, all in the virtual machine server, or separately in the resource scheduling server and the virtual machine server.

[0021] It should be understood that Figure 1 The number of networks and servers shown is merely illustrative. Any number of networks and servers can be included depending on implementation needs. When the electronic devices on which the method for determining idle computing resources runs do not require data transfer with other electronic devices, the system architecture may consist only of the electronic devices (e.g., servers) on which the method for determining idle computing resources runs.

[0022] Please refer to Figure 2 , Figure 2 A flowchart illustrating a method for determining idle computing resources provided in this embodiment of the disclosure. Flowchart 200 includes the following steps: Step 201: Based on the resource request and the virtual machine's resource usage type, determine the virtual machine occupancy range that represents the effective computing resources currently occupied by the virtual machine.

[0023] In this embodiment, the execution entity of the method for determining idle computing resources (e.g., Figure 1 The resource scheduling server determines the virtual machine occupancy range, which represents the effective computing resources currently occupied by the virtual machine, based on the resource request and the virtual machine's resource usage type.

[0024] Resource requests refer to instructions used in cloud computing resource scheduling systems to request the allocation or use of physical machine computing resources. They include the resource requirements for creating virtual machines (such as the number of CPU (Central Processing Unit) cores, memory capacity, DPU (Data Processing Unit) number range, etc.) and related attribute information, and are the core input basis for determining the virtual machine's occupied range and executing resource scheduling decisions.

[0025] As an example, virtual machines are classified into multiple resource usage types based on whether the computing resources currently occupied by deployed virtual machines can be occupied by virtual machines to be created. For each resource usage type, the other resource usage types to which virtual machines that can occupy the computing resources under that resource usage type belong are identified, thus obtaining the corresponding relationship.

[0026] In response to receiving a resource request representing the resource requirements of a virtual machine to be created, the resource usage type of the virtual machine to be created is determined. For each virtual machine in the physical machine, based on the correspondence, it is determined whether the virtual machine to be created can occupy the computing resources currently occupied by that virtual machine. In response to determining that it can, the computing resources currently occupied by that virtual machine are treated as invalid computing resources, and the virtual machine occupancy range of that virtual machine is determined to be an empty range. In response that it cannot, the computing resources currently occupied by that virtual machine are treated as valid computing resources, and the virtual machine occupancy range representing the valid computing resources of that virtual machine is determined. The virtual machine occupancy range of a virtual machine can be a continuous resource range or multiple spaced resource ranges.

[0027] For each type of computing resource unit in the physical machine, a unique serial number is assigned to it. In order to improve the computational efficiency and accuracy of the interval-based modeling method, adjacent computing resource unit serial numbers are used in a contiguous manner.

[0028] For example, a physical machine may contain 100 CPU cores, numbered sequentially from 1 to 100. The CPU resources currently occupied by virtual machines in the physical machine can be CPUs with consecutive serial numbers, such as the interval [1, 10), or non-consecutive CPUs, such as the intervals [1, 5) and [11, 15).

[0029] Taking the CPU resource range [1, 10) currently occupied by the virtual machine as an example, when it is a valid computing resource (i.e., the virtual machine to be created cannot occupy it), the virtual machine occupies the range [1, 10); when it is an invalid computing resource (i.e., the virtual machine to be created can occupy it), the virtual machine occupies the empty range.

[0030] As another example, the priority of virtual machines is determined based on the importance of the services deployed in them, with the importance of the services being positively correlated with the priority. Different priority types are determined based on the priority as the basis for classifying resource usage types, where higher-priority virtual machines can occupy the computing resources of lower-priority virtual machines.

[0031] In response to receiving a resource request representing the resource requirements of a virtual machine to be created, the priority of the virtual machine to be created is determined. For each virtual machine in the physical machine, based on the priority of the virtual machine to be created represented by the resource request and the priority of the virtual machine itself, it is determined whether the virtual machine to be created can occupy the computing resources currently occupied by the virtual machine. In response to determining that it can, the computing resources currently occupied by the virtual machine are treated as invalid computing resources, and the virtual machine occupancy range of the virtual machine is determined to be an empty range. In response that it cannot, the computing resources currently occupied by the virtual machine are treated as valid computing resources, and the virtual machine occupancy range of the virtual machine representing valid computing resources is determined.

[0032] In this embodiment, for each type of computing resource occupied by the virtual machine or each type of computing resource involved in the resource request, the virtual machine occupancy range representing the effective computing resource currently occupied by the virtual machine is determined based on the resource request and the resource usage type of the virtual machine.

[0033] In some optional implementations of this embodiment, the resource usage type of the virtual machine is used to define the rules for determining whether the computing resources of the virtual machine can be reclaimed and reallocated when responding to a resource request. "Responding to a resource request" refers to the process by which the cloud computing resource scheduling system initiates a resource allocation decision after receiving a resource request (such as creating or adjusting the computing resource requirements of a virtual machine). The core is to combine the judgment rules corresponding to the virtual machine type to determine whether the computing resources of the existing virtual machine can be reclaimed and reallocated to adapt to the needs of the resource request. This is the triggering premise for dynamically determining the resource occupancy range.

[0034] For example, for a received resource request, the virtual machine's resource usage type includes a first type where the virtual machine's computing resources can be reclaimed and reallocated when responding to the resource request, and a second type where the virtual machine's computing resources cannot be reclaimed and reallocated.

[0035] In this implementation, the execution entity can perform step 201 as follows: For virtual machines under each resource usage type in the physical machine, determine the virtual machine occupancy range of the virtual machine according to the judgment rules corresponding to the resource request and resource usage type.

[0036] Continuing with the first and second types mentioned above as examples, for each virtual machine under the first type in the physical machine, the computing resources currently occupied by the virtual machine are taken as invalid computing resources, and the virtual machine occupancy range is determined to be an empty range; for each virtual machine under the second type in the physical machine, the computing resources currently occupied by the virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing valid computing resources is determined.

[0037] In this implementation, the virtual machine resource usage type is divided according to whether the resource scheduling system can reclaim and reallocate the virtual machine's computing resources when responding to resource requests. This clarifies the virtual machine occupancy range for each virtual machine in response to resource requests, further improving the accuracy and reliability of the virtual machine occupancy range.

[0038] In some optional implementations of this embodiment, the resource usage type of the virtual machine includes a condition matching type, and the judgment rule corresponding to the condition matching type includes the matching condition of whether the virtual machine to be created corresponding to the resource request can occupy the computing resources currently occupied by the first virtual machine under the condition matching type.

[0039] Conditional matching types include, for example, reserved instance vouchers. Reserved instance vouchers are a type of resource usage in cloud computing resource scheduling systems that possesses a "pre-allocation authorization attribute." Essentially, they are used to pre-determine resource allocation for virtual machines that meet preset conditions, creating reserved physical machine computing resources to meet the deterministic resource requirements of specific business scenarios. Their core features and design logic are as follows: Resource pre-allocation and targeted authorization: Reserved instance vouchers need to be configured before resource scheduling to explicitly lock a specific range of computing resources in the physical machine (such as the CPU core range [8,16] and the DPU number range [100,200)). This resource quota is only open to resource requests that meet the matching conditions to avoid being occupied by unauthorized requests and to ensure the resource availability of the target business.

[0040] The core constraint of the matching conditions: The right to use the reserved instance voucher is defined by the preset matching conditions. The matching conditions usually include key attributes such as tenant identifier, resource specifications (such as memory capacity range, bound resource type), and business scenario tags. Only when the resource request contains a matching item that fully matches these conditions can it be qualified to occupy the reserved resource, which reflects the core logic of "condition matching".

[0041] Stability and decoupling of resource occupancy: The computing resources corresponding to the reserved instance vouchers have relative stability. When not matched, they remain in the "available reserved" state. Their occupancy status is achieved through interval marking, without intruding on the underlying resource management logic (such as without modifying the core computing module of the physical machine resource view). This decouples the business authorization logic from the underlying resource modeling and reduces system maintenance costs.

[0042] In this implementation, the aforementioned execution entity can determine the virtual machine's occupied range in the following way: for virtual machines in physical machines under the condition matching type, the virtual machine's occupied range is determined based on the matching result between the items to be matched and the matching conditions in the resource request.

[0043] As an example, firstly, the resource scheduling system receives a resource request, which includes items to be matched, such as tenant ID “T-202405”, target resource specification “8 CPU cores (specification code C3-8)”, and bound resource type “DPU”. Simultaneously, the resource scheduling system obtains the configuration information of the first virtual machine under all matching conditions in the physical machine, clarifying the matching conditions for each first virtual machine (e.g., the matching conditions for virtual machine A are tenant ID “T-202405” + CPU specification “C3-8” + DPU resources, and the matching conditions for virtual machine B are tenant ID “T-202406” + CPU specification “C3-8” + DPU resources). Furthermore, the computing resources currently occupied by each first virtual machine are recorded in intervals (e.g., the CPU usage interval for virtual machine A is [8,16], and the DPU usage interval is [100,108]).

[0044] Subsequently, for the first virtual machine of each matching condition type, a consistency check is performed between the item to be matched and the matching condition: taking virtual machine A as an example, the tenant ID "T-202405" of the resource request is completely consistent with the tenant ID of the matching condition, the target CPU specification "C3-8" is compatible with the CPU specification of the matching condition, and the request includes DPU resource requirements, so the matching result is determined to be "complete match"; taking virtual machine B as an example, the tenant ID "T-202405" of the resource request is inconsistent with the tenant ID "T-202406" of the matching condition, so the matching result is determined to be "no match".

[0045] Finally, based on the specific matching results (match or no match), the virtual machine occupancy range representing the effective computing resources currently occupied by the first virtual machine is determined.

[0046] This implementation provides a resource interval modeling method under the condition matching type, which can decouple the business logic of the condition matching type from the underlying resource management logic, ensure the accuracy of targeted resource allocation, adapt to the unified modeling of intervals, reduce redundant calculations, and help improve the stability of the scheduling system and the efficiency of resource allocation.

[0047] In some optional implementations of this embodiment, the execution entity can determine the virtual machine occupancy range of the first virtual machine under the condition matching type in the following way: in response to the mismatch between the item to be matched and the matching condition in the resource request represented by the matching result, the computing resources currently occupied by the first virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing the valid computing resources is determined.

[0048] For each first virtual machine under the condition matching type in the physical machine, if the matching result between the item to be matched in the resource request and the matching condition of the virtual machine indicates that the two do not match, it can be determined that the virtual machine to be created represented by the resource request cannot occupy the computing resources currently occupied by the first virtual machine. The computing resources currently occupied by the first virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing valid computing resources is determined.

[0049] Continuing with reference to virtual machine B in the above example, for virtual machine B that fails to match, its current computing resources are still valid computing resources. Its original CPU usage range [16,24) and DPU usage range [108,116) are kept as the final virtual machine usage range. This range will be used for the subsequent merging calculation of the total usage range of physical machines.

[0050] This implementation clarifies the interval determination method for each virtual machine under the condition matching type in the case of mismatch, thereby improving the accuracy and efficiency of the interval determination results.

[0051] In some optional implementations of this embodiment, the execution entity can determine the virtual machine occupancy range of the first virtual machine under the condition matching type in the following way: in response to the matching result representing the matching item and matching condition in the resource request, the computing resources currently occupied by the first virtual machine are regarded as invalid computing resources, and the virtual machine occupancy range is determined to be an empty range.

[0052] For each first virtual machine under the condition matching type in the physical machine, in response to the matching result between the item to be matched in the resource request and the matching condition of the virtual machine, it can be determined that the virtual machine to be created represented by the resource request needs to occupy the computing resources currently occupied by the first virtual machine. The computing resources currently occupied by the first virtual machine are regarded as invalid computing resources, and the virtual machine occupancy interval of the first virtual machine is determined to be an empty interval.

[0053] Continuing with virtual machine A in the example above, for virtual machine A that is successfully matched, the computing resources it currently occupies need to be authorized for use by the virtual machine to be created. Therefore, its virtual machine occupancy range is determined to be an empty range (i.e., [0,0), indicating that the resources are invalid).

[0054] In the specific implementation, the actual computing resources currently occupied by a first virtual machine are represented as a set of intervals. ,in, This represents the number of resource intervals in the interval set. Indicates the first A resource range. The resource usage range of the first virtual machine of a condition-matching type is... When the computing resources of the first virtual machine are used, Empty, otherwise for The complete series.

[0055] This implementation clarifies the interval determination method for each virtual machine under the condition matching type in the matching case, thereby improving the accuracy and efficiency of the interval determination results.

[0056] In some optional implementations of this embodiment, the execution entity may also perform the following operations: taking the computing resources currently occupied by other virtual machines besides the target virtual machine as effective computing resources, and determining the virtual machine occupancy range that represents the effective computing resources of other virtual machines.

[0057] The target virtual machine is any first virtual machine whose matching conditions match the items to be matched in the resource request under the conditional matching type.

[0058] In response to the matching result indicating that the matching item in the resource request matches the matching condition of the first virtual machine, the resource request must use the resource range currently occupied by the matched first virtual machine. Therefore, the computing resources currently occupied by other virtual machines besides the matched first virtual machine cannot be occupied by the virtual machine to be created corresponding to the resource request. Therefore, the computing resources currently occupied by other virtual machines are taken as valid computing resources, and the virtual machine occupancy range representing the valid computing resources of each other virtual machine is determined.

[0059] This implementation provides a method for determining the effective resource range of other virtual machines when a matching first virtual machine exists. This adapts to actual resource scheduling scenarios and improves the accuracy and efficiency of determining the range occupied by virtual machines.

[0060] In some optional implementations of this embodiment, the resource usage type of the virtual machine includes a priority determination type. Virtual machines with a priority higher than the priority determination type under other resource usage types are allowed to preempt the computing resources of the second virtual machine under the priority determination type.

[0061] Priority determination types include preemptive instances. Preemptive instances are a type of virtual machine in cloud computing resource scheduling systems that has "elastic resource release attributes." Essentially, it is a priority-adaptive resource usage mode designed to improve the utilization of physical machine resources. Its core characteristics and technical logic are as follows: Priority-based positioning: In the resource scheduling priority system, preemptive instances have the lowest priority, which is clearly lower than the priority of reserved instance vouchers and ordinary virtual machines. This setting provides a rule basis for the preemption behavior of high-priority resource requests.

[0062] Resource elastic release mechanism: The physical machine computing resources (including quantity computing resources such as memory and bound resources such as DPU) occupied by preemptive instances are not exclusive. When a higher priority resource request (such as a reserved instance voucher matching request or a regular virtual machine creation request) is initiated, some or all of the occupied resources need to be released according to the priority rules to ensure the supply of resources for high priority needs.

[0063] Logical decoupling feature: Compared with the problem that preemptive instances in traditional models need to record the state and intrude into the underlying computing logic, this type achieves resource management through dynamic determination of interval validity. The scheduling system only needs to adjust the interval state based on the priority comparison results, without modifying the underlying resource modeling logic, thus reducing the coupling between business and underlying implementation.

[0064] Core application value: Its design aims to efficiently utilize idle or low-priority physical machine resources, providing support for business scenarios that are sensitive to resource costs and can accept the elastic release of resources. At the same time, through the lightweight characteristics of the interval model, it avoids problems such as order volume expansion and computational redundancy in traditional models.

[0065] In this implementation, the aforementioned execution entity can determine the virtual machine occupancy range in the following way: For the second virtual machine under the priority determination type in the physical machine, the virtual machine occupancy range of the second virtual machine is determined according to the priority of the resource usage type corresponding to the resource request and the priority of the priority determination type.

[0066] As an example, firstly, a resource request initiated by the virtual machine server is received. This request includes the resource requirements of the virtual machine to be created (such as the number of CPU cores and the range of DPU numbers) and a priority identifier (in this embodiment, the priority corresponding to the request is the level occupied by a normal virtual machine). Subsequently, information on all preemptible instances currently deployed on the physical machine is obtained, including the range of computing resources currently occupied by each instance (recorded in the form of intervals, such as CPU usage interval [20, 28], DPU usage interval [300, 350]) and its own priority attribute (preemptible instance level).

[0067] Finally, for each preemptive instance, a comparison operation is performed between the resource request priority and the instance priority, and the virtual machine occupancy range representing the effective computing resources currently occupied by the preemptive instance is determined based on the comparison result.

[0068] This implementation provides a resource interval modeling method under the priority determination type, which can be adapted to the unified interval modeling, simplifies the resource determination logic under the priority determination type, and helps to improve resource allocation efficiency and maintainability.

[0069] In some optional implementations of this embodiment, the execution entity can determine the virtual machine occupancy range of the virtual machine under the priority determination type in the following way: In response to the fact that the target virtual machine is not included in the physical machine, for the second virtual machine under the priority determination type in the physical machine, the virtual machine occupancy range of the second virtual machine is determined according to the priority of the resource usage type corresponding to the resource request and the priority of the priority determination type.

[0070] The target virtual machine is the first virtual machine whose matching conditions match the items to be matched in the resource request under the conditional matching type. The judgment rules corresponding to the conditional matching type include the matching condition that the virtual machine to be created corresponding to the resource request can occupy the computing resources currently occupied by the first virtual machine.

[0071] As described above, in response to the inclusion of the target virtual machine in the physical machine, the resource request must use the resource range currently occupied by the matched first virtual machine (target virtual machine). Therefore, the computing resources currently occupied by other virtual machines besides the matched first virtual machine cannot be occupied by the virtual machine to be created corresponding to the resource request. Thus, the computing resources currently occupied by other virtual machines are taken as valid computing resources.

[0072] When the target virtual machine is not included in the physical machine, it is necessary to determine the virtual machine occupancy range for the second virtual machine under the priority determination type in the physical machine.

[0073] In this implementation, when the target virtual machine is not included in the physical machine, the virtual machine occupancy range of the second virtual machine under the priority determination type in the physical machine is determined, which improves the adaptability of the range determination process to the actual resource scheduling situation, and further improves the accuracy and effectiveness of the virtual machine occupancy range.

[0074] In some optional implementations of this embodiment, the execution entity can determine the virtual machine occupancy range of the second virtual machine under the priority determination type in the following way: in response to the priority of the resource usage type corresponding to the resource request being higher than the priority of the priority determination type, the computing resources currently occupied by the second virtual machine are regarded as invalid computing resources, and the virtual machine occupancy range of the second virtual machine is determined to be an empty range.

[0075] For each second virtual machine under the priority determination type in the physical machine, if the priority of the virtual machine to be created represented by the resource request is higher than the priority of the priority determination type, it can be determined that the virtual machine to be created represented by the resource request can occupy the computing resources currently occupied by the second virtual machine. The computing resources currently occupied by the second virtual machine are regarded as invalid computing resources, and the virtual machine occupancy range of the second virtual machine is determined to be an empty range.

[0076] Continuing with the example of the regular virtual machine above, since the priority of the regular virtual machine corresponding to the request is higher than that of the preemptive instance, the computing resources currently occupied by the preemptive instance are considered invalid resources and are no longer included in the valid allocation range. Based on this determination, the virtual machine allocation range of the preemptive instance is determined to be an empty range, indicating that its resources can be reclaimed and reallocated.

[0077] This implementation clarifies a range determination method for each virtual machine under the priority determination type, thereby improving the accuracy and efficiency of the range determination results.

[0078] In some optional implementations of this embodiment, the execution entity can determine the virtual machine occupancy range of the second virtual machine under the priority determination type in the following way: in response to the priority of the resource usage type corresponding to the resource request being lower than or equal to the priority of the priority determination type, the computing resources currently occupied by the second virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing the valid computing resources is determined.

[0079] For each second virtual machine under the priority determination type in the physical machine, if the priority of the virtual machine to be created represented by the resource request is lower than or equal to the priority of the priority determination type, it can be determined that the virtual machine to be created represented by the resource request cannot occupy the computing resources currently occupied by the second virtual machine. The computing resources currently occupied by the second virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing valid computing resources is determined.

[0080] For example, if the priority of a subsequently received resource request is lower than or equal to that of a preemptive instance (or equal to if there is no lower priority scenario), then the computing resources currently occupied by that instance are determined to be valid resources. The range of resources currently occupied is directly used as the virtual machine's occupied range in the form of a left-closed, right-open interval (e.g., [20,28)) to ensure the accurate representation of resource occupancy status and the consistency of scheduling logic.

[0081] In the specific implementation process, the actual computing resources currently occupied by a second virtual machine are represented as a set of intervals. ,in, This represents the number of resource intervals in the interval set. Indicates the first A resource range. The resource usage range of a preemptive instance type virtual machine is... When the computing resources of the second virtual machine are available, Empty, otherwise for The complete series.

[0082] This implementation clarifies another method for determining the interval for each virtual machine under the priority determination type, which improves the accuracy and efficiency of the interval determination results.

[0083] In some optional implementations of this embodiment, the resource usage type includes the basic resource type, under which the third virtual machine has exclusive access to the computing resources it occupies.

[0084] Basic resource types include, for example, ordinary virtual machines (on-demand instances). The computing resources occupied by an ordinary virtual machine (including CPU, memory, disk, DPU, and other bound resources) are strictly exclusive. Once allocated to a virtual machine through scheduling, during the virtual machine's lifecycle (unless actively released or forcibly reclaimed), the scope of its occupied resources will be locked as "available only to this virtual machine." Other resource requests (except for higher-priority reserved instance voucher matching requests) cannot preempt or reuse these resources. This exclusivity ensures the stability of virtual machine operation, avoids business interruptions caused by dynamic resource adjustments, and is suitable for most general business scenarios with basic requirements for resource stability.

[0085] In the resource scheduling priority hierarchy, the priority of ordinary virtual machines is higher than that of preemptive instances, but lower than that of reserved instance vouchers.

[0086] In this implementation, the aforementioned execution entity can determine the virtual machine occupancy range of the virtual machine in the following way: For the third virtual machine under the basic resource type in the physical machine, the computing resources currently occupied by the third virtual machine are taken as the effective computing resources, and the virtual machine occupancy range representing the effective computing resources is determined.

[0087] For each third virtual machine under the basic resource type in the physical machine, since the virtual machine has exclusive access to the computing resources it currently occupies, other virtual machines cannot occupy its computing resources. The computing resources currently occupied by the third virtual machine are taken as the effective computing resources, and the virtual machine occupancy range representing the effective computing resources is determined.

[0088] This implementation provides a resource range modeling method under basic resource types, which improves the accuracy and efficiency of virtual machine occupancy range determination based on the exclusivity corresponding to the basic resource types.

[0089] In some optional implementations of this embodiment, the execution entity can determine the virtual machine occupancy range in the following way: for virtual machines under each resource usage type in the physical machine, calculate the virtual machine occupancy range of each virtual machine under each existing resource occupancy state according to resource requests and judgment rules.

[0090] Resource occupancy status includes three types: virtual machine in normal occupancy, occupancy by order but virtual machine not yet actually created, and virtual machine migration pending cleanup. The computing resources in the virtual machine in normal occupancy status refer to the actual physical machine computing resources occupied when the virtual machine has been successfully created and is running; the resources are in a "currently in use" state.

[0091] The computing resources occupied by the order but not yet created by the virtual machine refer to the resource scheduling order that has been submitted and taken effect, but the target virtual machine has not yet completed the deployment and startup process. The physical machine has reserved the corresponding resources for the order to avoid them being occupied by other requests, and the resources are in the "reserved for use" state.

[0092] Computing resources in a pending cleanup state after virtual machine migration refer to resources that were previously allocated to the virtual machine on the original physical machine but have not been released immediately. These resources need to be cleaned up by the system to be restored to idle resources.

[0093] For example, in a physical machine, the CPU core numbers are 0-63 (total interval T=[0,64)); the same virtual machine (VM-001) requests 8 consecutive CPU cores (resource requirement: 8 consecutively numbered cores); the scheduling system allocates core numbers 10-17 to it (corresponding interval [10,18)). For virtual machine VM-001, the timing logic of the above three resource occupancy states is generally as follows: 1. The order is in use, but the virtual machine has not yet been created. The creation order for VM-001 has been submitted. In order to prevent other virtual machines from occupying these 8 CPU cores, the resource scheduling system first marks this resource range as "order occupied"; however, the virtual machine has not yet completed initialization and has not started running.

[0094] The resource range u_1=[10,18) at this time indicates that CPU cores 10-17 have been reserved by the order for VM-001.

[0095] 2. The virtual machine is using the device normally.

[0096] VM-001 has been created and started running, and CPU cores 10-17 are being used by its business (such as running database services).

[0097] At this point, the resource range u_2=[10,18) indicates that CPU cores 10-17 have been actually occupied by VM-001.

[0098] 3. Virtual machines to be cleaned up after migration

[0099] Due to physical machine load optimization, VM-001 has been migrated to another physical machine (the new physical machine has allocated cores 30-37, corresponding to the range [30,38)), but the original physical machine's cores 10-17 have not yet been cleaned up (e.g., residual configuration files, resource lock flags).

[0100] At this point, the resource range u_3=[10,18) indicates that CPU cores 10-17 were previously occupied by VM-001 and are currently in a state of pending cleanup.

[0101] In this implementation, the computing resources currently occupied by the virtual machine are taken as the effective computing resources, and the resource range is determined as the virtual machine's occupied range. This can accurately adapt to the multiple resource occupancy states of the virtual machine, ensure the accuracy of calculation through unified range operation, reduce state adaptation redundancy, avoid scheduling errors, and improve the reliability and efficiency of resource management and scheduling.

[0102] Step 202: Combine the virtual machine occupancy range of each virtual machine in the physical machine to determine the physical machine occupancy range that represents the effective computing resources that have been occupied in the physical machine.

[0103] In this embodiment, the aforementioned execution entity can combine the virtual machine occupancy range of each virtual machine in the physical machine to determine the physical machine occupancy range that represents the effective computing resources that have been occupied in the physical machine.

[0104] A physical machine is a hardware device with independent physical computing resources such as CPU, memory, disk, and DPU. It can directly handle resource allocation, support the deployment and operation of virtual machines, and provide underlying resource support for cloud computing or data centers. As the core entity carrying physical resources in a resource scheduling system, it can abstract physical resources into an allocable resource pool through appropriate technologies. Typical examples include dedicated servers that support KVM virtualization technology and can deploy multiple independent virtual machines.

[0105] A physical machine typically includes multiple virtual machines. These virtual machines can be virtual machines with the same resource usage type or virtual machines with different resource usage types.

[0106] First, by combining the virtual machine occupancy intervals of each virtual machine in the physical machine, a set of intervals is obtained. Then, virtual machine occupancy intervals that intersect within the interval set are merged to determine the physical machine occupancy interval, which represents the effective computing resources already occupied in the physical machine. Generally, the physical machine occupancy interval includes multiple discontinuous resource intervals.

[0107] For each type of computing resource occupied by a virtual machine or each type of computing resource involved in a resource request, the physical machine occupancy range representing the effective computing resources of that resource type that have been occupied in the physical machine is determined by combining the virtual machine occupancy range of each virtual machine in the physical machine under that resource type.

[0108] In some optional implementations of this embodiment, the virtual machine occupies a left-closed, right-open interval.

[0109] In this implementation, the aforementioned execution entity can perform step 202 as follows: First, sort the virtual machine-occupied intervals of each virtual machine in ascending order of their starting values ​​to obtain an interval sequence.

[0110] By combining the virtual machine occupancy intervals of each virtual machine in the physical machine, a set of intervals is obtained; the intervals in the set are sorted in ascending order of their starting values ​​to obtain an interval sequence.

[0111] For example, the initial intervals in the interval set are: [1,3), [2,6), [8,10), [15,18), [17,20), [4,7), [12,16); the sorted interval sequence is: [1,3), [2,6), [4,7), [8,10), [12,16), [15,18), [17,20).

[0112] Then, a union operation is performed on the virtual machine-occupied intervals that intersect in the interval sequence to obtain the physical machine-occupied space.

[0113] Continue to refer to Figure 3 The diagram illustrates the union operation of the virtual machine's occupied intervals. Continuing with the above interval sequence, the merged physical machine's occupied space is [1,7), [8,10), [12,20).

[0114] In this implementation, the efficiency and accuracy of determining the physical machine's space usage are further improved by using interval sorting and intersection operations.

[0115] Step 203: Determine the idle computing resources based on the total range representing the total computing resources of the physical machine and the range occupied by the physical machine.

[0116] In this embodiment, the execution entity determines the idle computing resources based on the total range representing the total computing resources of the physical machine and the range occupied by the physical machine.

[0117] First, based on the total range representing the total computing resources of the physical machine and the occupied range of the physical machine, the idle range of the physical machine is determined; based on the serial number of the computing resources in the idle range of the physical machine, the idle computing resources in the physical machine are determined.

[0118] For each type of computing resource occupied by a virtual machine or each type of computing resource involved in a resource request, the idle computing resources of the physical machine under that computing resource type are determined based on the total range of the physical machine under that computing resource type and the range occupied by the physical machine under that computing resource type.

[0119] In some optional implementations of this embodiment, the execution entity can perform step 203 as follows: perform a difference operation on the total interval and the physical machine occupied interval to determine the idle computing resources.

[0120] Continue to refer to Figure 4The diagram illustrates the interval difference operation. The total interval of the physical machine is [1, 21), and the interval occupied by the physical machine is [1, 7), [8, 10), [12, 20). After performing the difference operation on the total interval and the interval occupied by the physical machine, the free resource interval is obtained as [7, 8), [10, 12), [20, 21). Therefore, the free computing resources are determined to be the computing resources corresponding to serial numbers 7, 10-11, and 20.

[0121] In this implementation, idle computing resources are determined based on interval difference operations, which further improves the efficiency and accuracy of determining idle computing resources.

[0122] When the physical machine targeted by the resource request is clearly defined, the available computing resources of that physical machine are determined using the method described above. When the physical machine targeted by the resource request is not clearly defined, the available computing resources of each physical machine in the physical machine cluster (e.g., a server cluster) are determined using the method described above. After determining the available computing resources, resources can be allocated to the resource request.

[0123] See also Figure 5 , Figure 5 This is a schematic diagram of an application scenario 500 of the virtual machine monitoring method according to this embodiment. Multiple virtual machines 5011 are deployed in server 501 of the server cluster. In response to receiving a resource request 502, for each virtual machine, the resource scheduling system determines a virtual machine occupancy interval 504 representing the effective computing resources currently occupied by the virtual machine, based on the resource request and the virtual machine's resource usage type 503; combining the virtual machine occupancy intervals of each virtual machine in the server (physical machine), it determines a physical machine occupancy interval 505 representing the effective computing resources already occupied in the physical machine; based on the total interval 506 representing the total computing resources of the physical machine and the physical machine occupancy interval 505, it determines the idle computing resources.

[0124] To further clarify the process of determining the above-mentioned idle computing resources, the following exemplary description is provided: Three virtual machines are deployed on the existing physical host: Virtual Machine 1 (a regular virtual machine, basic resource type, dedicated resources), Virtual Machine 2 (a preemptive virtual machine, priority determination type, lowest priority), and Virtual Machine 3 (a virtual machine with reserved instance vouchers, condition matching type). When a new virtual machine order initiates a creation request (resource request), the validity of the resource occupancy range of each virtual machine must first be determined, then the valid ranges are merged to obtain the set of resource occupancy ranges for the physical host, and finally the available resource range is calculated. Detailed descriptions of the four scenarios are as follows: Scenario 1: New order virtual machines can preempt bidding instances, but there are no matching reserved instance vouchers. The new order has the right to preempt a preemptible virtual machine (VM2), and its pending matching items do not match the reserved instance voucher matching conditions of VM3. VM2's resources are deemed invalid due to preemption, and the corresponding range is not included in the occupied set; VM3's resources remain valid because they are not matched, and the corresponding range must be included in the occupied set; VM1, as a regular virtual machine, has exclusive and always valid resources. Therefore, the set of resource occupied ranges for the physical machine is the union of the resource ranges of VM1 and VM3.

[0125] Scenario 2: New order virtual machines can preempt bidding instances and match reserved instance vouchers.

[0126] The new order has the privileges to preempt virtual machine 2, and its pending matching items perfectly match the reserved instance voucher matching conditions of virtual machine 3. Since the resources of virtual machine 3 are successfully matched, they must be authorized to the new order, and the corresponding range of virtual machine 3 is determined to be invalid; the resources of virtual machine 2 are determined to be valid because they cannot be preempted; the resources of virtual machine 1 remain valid. Therefore, the set of physical machine resource occupancy ranges is the union of the resource ranges of virtual machine 1 and virtual machine 2.

[0127] Scenario 3: New order virtual machines cannot preempt spot instances and there are no matching reserved instance vouchers.

[0128] The new order does not have the permission to preempt virtual machine 2, and its pending matching items do not match the matching conditions of the reserved instance voucher for virtual machine 3. The resources of all three virtual machines are determined to be valid: virtual machine 1's resources are exclusively valid, virtual machine 2 is valid because it cannot be preempted, and virtual machine 3 is valid because it is not matched. Therefore, the set of occupied resource ranges of the physical machines is the union of the resource ranges of virtual machine 1, virtual machine 2, and virtual machine 3.

[0129] Scenario 4: New order virtual machines cannot preempt spot instances and are matched with reserved instance vouchers.

[0130] The new order does not have the permission to preempt virtual machine 2, but the matching conditions for the reserved instance voucher of virtual machine 3 are completely consistent. The resources of virtual machine 3 are deemed invalid due to the successful matching; the resources of virtual machine 1 are valid exclusively, and virtual machine 2 is valid because it cannot be preempted. Therefore, the set of occupied resource ranges of the physical machine is the union of the resource ranges of virtual machine 1 and virtual machine 2.

[0131] Continue to refer to Figure 6 The illustration shows a schematic flow 600 of yet another embodiment of the method for determining idle computing resources according to the present disclosure. Flow 600 includes the following steps: Step 601, for the first virtual machine in the physical machine under the condition matching type: Step 6011: Determine the matching result between the item to be matched in the resource request and the matching condition of the first virtual machine.

[0132] Step 6012: In response to the mismatch between the unmatched item and the matching condition in the resource request represented by the matching result, the computing resources currently occupied by the first virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing the valid computing resources is determined.

[0133] Step 6013: In response to the matching result indicating that the items to be matched in the resource request match the matching conditions, the computing resources currently occupied by the first virtual machine are regarded as invalid computing resources, and the virtual machine occupancy interval is determined to be an empty interval.

[0134] The judgment rules corresponding to the condition matching type include the matching condition of whether the virtual machine to be created corresponding to the resource request can occupy the computing resources currently occupied by the first virtual machine.

[0135] Step 602, for the second virtual machine under the priority determination type in the physical machine: Step 6021: Determine the priority of the resource usage type and the priority of the priority determination type corresponding to the resource request.

[0136] Step 6022: In response to the fact that the priority of the resource usage type corresponding to the resource request is higher than the priority determination type, the computing resources currently occupied by the second virtual machine are regarded as invalid computing resources, and the virtual machine occupancy range of the second virtual machine is determined to be an empty range.

[0137] Step 6023: In response to the priority of the resource usage type corresponding to the resource request being lower than or equal to the priority of the priority determination type, the computing resources currently occupied by the second virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing the valid computing resources is determined.

[0138] A second virtual machine under a resource usage type with a higher priority than the priority determination type is allowed to preempt the computing resources of the virtual machine under the priority determination type.

[0139] Step 603: For the third virtual machine under the basic resource type in the physical machine, the computing resources currently occupied by the third virtual machine are taken as effective computing resources, and the virtual machine occupancy range representing the effective computing resources is determined.

[0140] Virtual machines under the basic resource type have exclusive access to the computing resources they occupy.

[0141] Step 604: Sort the virtual machine-occupied intervals of each virtual machine in ascending order of the interval starting value to obtain the interval sequence.

[0142] Step 605: Perform a union operation on the virtual machine-occupied intervals that have intersections in the interval sequence to obtain the physical machine-occupied space.

[0143] Step 606: Perform a difference operation on the total interval representing the total computing resources of the physical machine and the interval occupied by the physical machine to determine the idle computing resources.

[0144] The process 600 of the method for determining idle computing resources in this embodiment, compared with the above process 200, specifically describes the process of determining the virtual machine occupancy range, the physical machine occupancy space, and the idle computing resources under each resource usage type. Based on the interval modeling method, the adaptability of the modeling method to various computing resources is improved; the idle computing resources in the physical machine are finally determined based on the virtual machine occupancy range, which improves the efficiency and accuracy of determining idle resources.

[0145] Continue to refer to Figure 7 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a device for determining idle computing resources. This system embodiment is similar to... Figure 2 Corresponding to the method embodiments shown, the system can be specifically applied to various electronic devices.

[0146] like Figure 7 As shown, the idle computing resource determination device 700 includes: a first determination unit 701, configured to determine a virtual machine occupancy range representing the effective computing resources currently occupied by a virtual machine based on resource requests and the resource usage type of the virtual machine; a second determination unit 702, configured to determine a physical machine occupancy range representing the effective computing resources already occupied in the physical machine by combining the virtual machine occupancy ranges of each virtual machine in the physical machine; and a third determination unit 703, configured to determine idle computing resources based on the total range representing the total computing resources of the physical machine and the physical machine occupancy range.

[0147] In some optional implementations of this embodiment, the type is used to define the determination rule for whether the computing resources of the virtual machine can be reclaimed and reallocated when responding to a resource request, and the first determining unit 701 is further configured to: determine the virtual machine occupancy range of the virtual machine according to the determination rule corresponding to the resource request and the resource usage type for each virtual machine under each resource usage type in the physical machine.

[0148] In some optional implementations of this embodiment, the type includes a condition matching type. The determination rule corresponding to the condition matching type includes the matching condition that the virtual machine to be created corresponding to the resource request can occupy the computing resources currently occupied by the first virtual machine under the condition matching type. The first determining unit 701 is further configured to: for the first virtual machine under the condition matching type in the physical machine, determine the virtual machine occupancy range of the first virtual machine according to the matching result between the item to be matched and the matching condition in the resource request.

[0149] In some optional implementations of this embodiment, the first determining unit 701 is further configured to: in response to a mismatch between the item to be matched and the matching condition in the resource request represented by the matching result, determine the virtual machine occupancy range representing the valid computing resources by taking the computing resources currently occupied by the first virtual machine as valid computing resources.

[0150] In some optional implementations of this embodiment, the first determining unit 701 is further configured to: in response to the matching result indicating that the matching item and the matching condition in the resource request are matched, determine the computing resources currently occupied by the first virtual machine as invalid computing resources and determine that the virtual machine occupancy interval is an empty interval.

[0151] In some optional implementations of this embodiment, the first determining unit 701 is further configured to: take the computing resources currently occupied by other virtual machines besides the target virtual machine as valid computing resources, and determine the virtual machine occupancy range representing the valid computing resources of other virtual machines, wherein the target virtual machine is the first virtual machine whose matching condition matches the item to be matched in the resource request under the condition matching type.

[0152] In some optional implementations of this embodiment, the type includes a priority determination type, where virtual machines with a priority higher than the priority determination type under other resource usage types are allowed to preempt the computing resources of the second virtual machine under the priority determination type, and the first determining unit 701 is further configured to: for the second virtual machine under the priority determination type in the physical machine, determine the virtual machine occupancy range of the second virtual machine according to the priority of the resource usage type corresponding to the resource request and the priority determination type.

[0153] In some optional implementations of this embodiment, the first determining unit 701 is further configured to: in response to the physical machine not including the target virtual machine, for the second virtual machine under the priority determination type in the physical machine, determine the virtual machine occupancy range 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, wherein the target virtual machine is the first virtual machine under the condition matching type whose matching condition matches the item to be matched in the resource request, and the determination rule corresponding to the condition matching type includes the matching condition of whether the virtual machine to be created corresponding to the resource request can occupy the computing resources currently occupied by the first virtual machine.

[0154] In some optional implementations of this embodiment, the first determining unit 701 is further configured to: in response to the priority of the resource usage type corresponding to the resource request being higher than the priority of the priority determination type, to determine the computing resources currently occupied by the second virtual machine as invalid computing resources, and to determine that the virtual machine occupancy range of the second virtual machine is an empty range.

[0155] In some optional implementations of this embodiment, the first determining unit 701 is further configured to: in response to the priority of the resource usage type corresponding to the resource request being lower than or equal to the priority of the priority determination type, take the computing resources currently occupied by the second virtual machine as valid computing resources, and determine the virtual machine occupancy range representing the valid computing resources.

[0156] In some optional implementations of this embodiment, the type includes a basic resource type, where the third virtual machine under the basic resource type has exclusive access to the computing resources it occupies, and the first determining unit 701 is further configured to: for the third virtual machine under the basic resource type in the physical machine, take the computing resources currently occupied by the third virtual machine as effective computing resources, and determine the virtual machine occupancy range representing the effective computing resources.

[0157] In some optional implementations of this embodiment, the first determining unit 701 is further configured to: for virtual machines under each resource usage type in the physical machine, calculate the virtual machine occupancy range of each virtual machine under each existing resource occupancy state according to resource requests and determination rules.

[0158] In some optional implementations of this embodiment, the virtual machine occupancy interval is a left-closed and right-open interval, and the second determining unit 702 is further configured to: sort the virtual machine occupancy intervals of each virtual machine in ascending order of the interval starting value to obtain an interval sequence; Perform a union operation on the virtual machine-occupied intervals that intersect in the interval sequence to obtain the physical machine-occupied space.

[0159] In some optional implementations of this embodiment, the third determining unit 703 is further configured to: perform a difference operation on the total interval and the physical machine occupied interval to determine the idle computing resources.

[0160] This embodiment provides a device for determining idle computing resources. A first determining unit in this device determines a virtual machine occupancy interval, representing the effective computing resources currently occupied by a virtual machine, based on resource requests and the virtual machine's resource usage type. A second determining unit, combining the virtual machine occupancy intervals of each virtual machine in the physical machine, determines a physical machine occupancy interval, representing the effective computing resources already occupied in the physical machine. A third determining unit determines idle computing resources based on the total interval representing the total computing resources of the physical machine and the physical machine occupancy interval. This provides a new computing resource modeling method. By modeling the effective computing resources currently occupied by a virtual machine as a virtual machine occupancy interval based on resource requests and the virtual machine's resource usage type, the adaptability of the modeling method to various computing resources is improved. Finally, the idle computing resources in the physical machine are determined based on the virtual machine occupancy interval, improving the efficiency and accuracy of idle resource determination.

[0161] According to embodiments of this disclosure, this disclosure also provides an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to implement the method for determining idle computing resources described in any of the above embodiments when executed.

[0162] According to embodiments of this disclosure, this disclosure also provides a readable storage medium storing computer instructions that enable a computer to implement the method for determining idle computing resources described in any of the above embodiments when executed.

[0163] This disclosure provides a computer program product that, when executed by a processor, can implement the method for determining idle computing resources described in any of the above embodiments.

[0164] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0165] like Figure 8 As shown, device 800 includes a processor 801, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.

[0166] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0167] Processor 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 801 performs the various methods and processes described above, such as the method for determining idle computing resources. For example, in some embodiments, the method for determining idle computing resources may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by processor 801, one or more steps of the method for determining idle computing resources described above may be performed. Alternatively, in other embodiments, processor 801 may be configured to perform the method for determining idle computing resources by any other suitable means (e.g., by means of firmware).

[0168] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0169] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to the processor or controller of a determined device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0170] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0171] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0172] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0173] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are hosting products within the cloud computing service system to address the management difficulties and weak business scalability inherent in traditional physical hosts and Virtual Private Servers (VPS) services; they can also be servers for distributed systems or servers incorporating blockchain technology.

[0174] According to the technical solution of the embodiments of this disclosure, a method and apparatus for determining idle computing resources are provided. By determining the virtual machine occupancy range, representing the effective computing resources currently occupied by the virtual machine, based on resource requests and the resource usage type of the virtual machine; combining the virtual machine occupancy ranges of each virtual machine in the physical machine, a physical machine occupancy range, representing the effective computing resources already occupied in the physical machine, is determined; and based on the total range representing the total computing resources of the physical machine and the physical machine occupancy range, idle computing resources are determined. This provides a new computing resource modeling method. By modeling the effective computing resources currently occupied by the virtual machine as virtual machine occupancy ranges based on resource requests and the resource usage type of the virtual machine, the adaptability of the modeling method to various computing resources is improved. Finally, the idle computing resources in the physical machine are determined based on the virtual machine occupancy ranges, improving the efficiency and accuracy of idle resource determination.

[0175] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.

[0176] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for determining idle computing resources, comprising: Based on the resource request and the virtual machine's resource usage type, determine the virtual machine occupancy range, which represents the effective computing resources currently occupied by the virtual machine; By combining the virtual machine occupancy ranges of each virtual machine in the physical machine, the physical machine occupancy range representing the effective computing resources already occupied in the physical machine is determined. Idle computing resources are determined based on the total range representing the total computing resources of the physical machine and the occupied range of the physical machine.

2. The method according to claim 1, wherein, The resource usage type is used to define the rules for determining whether the computing resources of the virtual machine can be reclaimed and reallocated when responding to the resource request, and The step of determining the virtual machine occupancy range, which characterizes the effective computing resources currently occupied by the virtual machine, based on resource requests and the virtual machine's resource usage type, includes: For virtual machines under each resource usage type in the physical machine, the virtual machine occupancy range of the virtual machine is determined according to the determination rules corresponding to the resource request and the resource usage type.

3. The method according to claim 2, wherein, The resource usage type includes a conditional matching type, and the judgment rule corresponding to the conditional matching type includes a matching condition for whether the virtual machine to be created corresponding to the resource request can occupy the computing resources currently occupied by the first virtual machine under the conditional matching type, and For virtual machines under each resource usage type in the physical machine, the virtual machine occupancy range of the virtual machine is determined according to the determination rules corresponding to the resource request and the resource usage type, including: For the first virtual machine under the condition matching type in the physical machine, the virtual machine occupancy range of the first virtual machine is determined according to the matching result between the item to be matched in the resource request and the matching condition.

4. The method according to claim 3, wherein, The step of determining the virtual machine occupancy range of the first virtual machine based on the matching result between the items to be matched in the resource request and the matching conditions includes: In response to the matching result indicating a mismatch between the item to be matched in the resource request and the matching condition, the computing resources currently occupied by the first virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing the valid computing resources is determined.

5. The method according to claim 3, wherein, The step of determining the virtual machine occupancy range of the first virtual machine based on the matching result between the items to be matched in the resource request and the matching conditions includes: In response to the matching result indicating that the item to be matched in the resource request matches the matching condition, the computing resources currently occupied by the first virtual machine are regarded as invalid computing resources, and the virtual machine occupancy interval is determined to be an empty interval.

6. The method according to claim 3, wherein, Also includes: The computing resources currently occupied by other virtual machines besides the target virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing the valid computing resources of the other virtual machines is determined. The target virtual machine is the first virtual machine whose matching condition under the condition matching type matches the item to be matched in the resource request.

7. The method according to claim 2, wherein, The resource usage types include priority determination types. Virtual machines with higher priorities under other resource usage types are allowed to preempt the computing resources of a second virtual machine under the same priority determination type. For virtual machines under each resource usage type in the physical machine, the virtual machine occupancy range of the virtual machine is determined according to the determination rules corresponding to the resource request and the resource usage type, including: For the second virtual machine under the priority determination type in the physical machine, the virtual machine occupancy range of the second virtual machine is determined according to the priority of the resource usage type corresponding to the resource request and the priority determination type.

8. The method according to claim 7, wherein, For the second virtual machine under the priority determination type in the physical machine, determining the virtual machine occupancy range of the second virtual machine based on the priority of the resource usage type corresponding to the resource request and the priority determination type includes: In response to the absence of a target virtual machine in the physical machine, for the second virtual machine under the priority determination type in the physical machine, the virtual machine occupancy range of the second virtual machine is determined according to the priority of the resource usage type corresponding to the resource request and the priority determination type. The target virtual machine is the first virtual machine under the condition matching type whose matching condition matches the item to be matched in the resource request. The determination rule corresponding to the condition matching type includes the matching condition of whether the virtual machine to be created corresponding to the resource request can occupy the computing resources currently occupied by the first virtual machine.

9. The method according to claim 7 or 8, wherein, The step of determining the virtual machine occupancy range of the second virtual machine based on the priority of the resource usage type corresponding to the resource request and the priority determination type includes: In response to the fact that the priority of the resource usage type corresponding to the resource request is higher than the priority determination type, the computing resources currently occupied by the virtual machine are regarded as invalid computing resources, and the virtual machine occupancy range of the virtual machine is determined to be an empty range.

10. The method according to claim 7 or 8, wherein, The step of determining the virtual machine occupancy range of the second virtual machine based on the priority of the resource usage type corresponding to the resource request and the priority determination type includes: In response to the priority of the resource usage type corresponding to the resource request being lower than or equal to the priority of the priority determination type, the computing resources currently occupied by the virtual machine are taken as valid computing resources, and the virtual machine occupancy range representing the valid computing resources is determined.

11. The method according to claim 2, wherein, The resource usage types include basic resource types, under which a third virtual machine has exclusive access to the computing resources it occupies, and For virtual machines under each resource usage type in the physical machine, the virtual machine occupancy range of the virtual machine is determined according to the determination rules corresponding to the resource request and the resource usage type, including: For the third virtual machine under the basic resource type in the physical machine, the computing resources currently occupied by the third virtual machine are taken as effective computing resources, and the virtual machine occupancy range representing the effective computing resources is determined.

12. The method according to any one of claims 2-10, wherein, For virtual machines under each resource usage type in the physical machine, the virtual machine occupancy range of the virtual machine is determined according to the determination rules corresponding to the resource request and the resource usage type, including: For virtual machines under each resource usage type in the physical machine, the virtual machine occupancy range under each current resource occupancy state is calculated according to the resource request and the determination rule.

13. The method according to any one of claims 1-12, wherein, The virtual machine occupies a left-closed, right-open interval, and The process of determining the physical machine occupancy range, which characterizes the effective computing resources already occupied in the physical machine, by combining the virtual machine occupancy ranges of each virtual machine in the physical machine, includes: The virtual machine-occupied intervals of each virtual machine are sorted in ascending order of their starting values ​​to obtain an interval sequence. Perform a union operation on the virtual machine-occupied intervals that intersect in the interval sequence to obtain the physical machine-occupied space.

14. The method according to any one of claims 1-12, wherein, The step of determining idle computing resources based on the total range representing the total computing resources of the physical machine and the occupied range of the physical machine includes: Perform a difference operation on the total interval and the physical machine occupied interval to determine the idle computing resources.

15. A device for determining idle computing resources, comprising: The first determining unit is configured to determine, based on the resource request and the virtual machine's resource usage type, a virtual machine occupancy range representing the effective computing resources currently occupied by the virtual machine; The second determining unit is configured to combine the virtual machine occupancy intervals of each of the virtual machines in the physical machine to determine the physical machine occupancy interval, which represents the effective computing resources that have been occupied in the physical machine. The third determining unit is configured to determine the idle computing resources based on the total range representing the total computing resources of the physical machine and the occupied range of the physical machine.

16. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed 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. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-14.

18. A computer program product comprising: A computer program that, when executed by a processor, implements the method according to any one of claims 1-14.