Resource scheduling method and corresponding apparatus

WO2026174874A1PCT designated stage Publication Date: 2026-08-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/137315
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-02-24
Filing Date
2025-11-25
Publication Date
2026-08-27

Smart Images

  • Figure CN2025137315_27082026_PF_FP_ABST
    Figure CN2025137315_27082026_PF_FP_ABST
Patent Text Reader

Abstract

A resource scheduling method, applied to a cloud system and capable of scheduling virtual machines in batches for user tasks. The method comprises: a scheduling node in a cloud system can determine location information of a plurality of virtual machines on the basis of requirement information of a user for the virtual machines, wherein the location information of each subsequent virtual machine can be determined on the basis of the location information of the virtual machine previous thereto. In this way, it is not necessary to exhaustively search every physical machine among numerous physical machines in the cloud system when performing batch scheduling of virtual machines, thereby reducing the complexity of batch scheduling of virtual machines, increasing the speed of batch scheduling of virtual machines, and also reducing the response latency to user tasks.
Need to check novelty before this filing date? Find Prior Art

Description

A method and corresponding apparatus for resource scheduling

[0001] This application claims priority to Chinese Patent Application No. 202510213725.7, filed on February 24, 2025, entitled “A method and corresponding apparatus for resource scheduling”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of computer technology, specifically to a method and apparatus for resource scheduling. Background Technology

[0003] Virtualization is a resource management technology that abstracts the physical resources of a physical machine (such as processors, memory, and disk space) into multiple virtual machines (VMs). Cloud services provided to users by cloud systems are typically implemented by scheduling virtual machines.

[0004] For user tasks with low resource requirements, a single virtual machine is usually sufficient. However, with the rapid development of large-scale artificial intelligence (AI) model technology, a single virtual machine is often insufficient to meet the needs of user tasks. To complete the training of large models, it is usually necessary to schedule multiple virtual machines online.

[0005] Cloud systems typically contain tens of thousands of physical machines. Bulk scheduling of virtual machines from these numerous machines requires a full search of each machine, which is highly complex and results in significant response latency, failing to meet the demands for rapid online response. Therefore, how to quickly schedule multiple virtual machines to execute user tasks has become a pressing technical problem to be solved. Summary of the Invention

[0006] This application provides a resource scheduling method to reduce the complexity of virtual machine scheduling and reduce response latency. This application also provides corresponding apparatus, computer-readable storage media, and computer program products.

[0007] The first aspect of this application provides a resource scheduling method, which can be applied to a scheduling node in a cloud system. The scheduling node can be a physical machine or a virtual machine in the cloud system. The method includes: obtaining a first request, the first request including demand information for a virtual machine; determining the location information of a first virtual machine and a second virtual machine corresponding to the first request based on the demand information for the virtual machine and information of multiple physical machines in the cloud system; wherein the location information of the second virtual machine is determined based on the location information of the first virtual machine, and the first virtual machine and the second virtual machine are located in at least one of the multiple physical machines; scheduling the first virtual machine according to the location information of the first virtual machine, and scheduling the second virtual machine according to the location information of the second virtual machine.

[0008] In this application, the first request is a request corresponding to a user task, used to request resources in the cloud system for executing the user task. For example, if a user requests resources from the cloud system to train an AI model, then the first request is used to request resources for training the AI ​​model. Resources in the cloud system include computing resources, storage resources, or communication resources, etc. These resources are typically provided to the user in the form of virtual machines to execute the corresponding user task.

[0009] In this application, the requirement information for virtual machines refers to relevant information used to describe the specification requirements, quantity requirements, or location requirements for virtual machines.

[0010] In this application, the location information of the first virtual machine can be randomly selected, and the location information of the second virtual machine is obtained based on the location information of the first virtual machine.

[0011] In this application, the first request may correspond to multiple virtual machines, not limited to the first virtual machine and the second virtual machine. Regardless of the number of virtual machines, the location information of the next virtual machine can be determined according to the relationship between the first virtual machine and the second virtual machine and the location information of the previous virtual machine.

[0012] In this application, scheduling the first virtual machine based on its location information refers to sending instruction information to the corresponding physical machine based on the location information of the first virtual machine. The physical machine then initializes and runs the first virtual machine based on the instruction information. Similarly, the scheduling process of other virtual machines can be understood by referring to the scheduling process of the first virtual machine.

[0013] In the first aspect mentioned above, the scheduling node can determine the location information of each virtual machine among the multiple virtual machines to be scheduled for the first request. Moreover, except for the location information of the first virtual machine, which is randomly selected, the location information of the other virtual machines is determined based on the location information of the previous virtual machine. In this way, it is not necessary to search every physical machine in the cloud system for batch scheduling of virtual machines, which reduces the complexity of batch scheduling of virtual machines, improves the batch scheduling speed of virtual machines, and also reduces the response latency to user tasks.

[0014] In one possible implementation, the requirement information for virtual machines includes at least one of the following: specification information of a single virtual machine, first indication information, affinity information between virtual machines, or anti-affinity information; wherein the first indication information is used to indicate the number of virtual machines.

[0015] In this application, the specification information of a single virtual machine refers to the number of processors or processing cores of a single virtual machine and the amount of storage resources required, such as 8G of storage resources. Of course, it can also be other sizes of storage resources; this is just an example.

[0016] In this application, the first indication information can be the number of virtual machines, such as 100 virtual machines. The first indication information can also be the overall resource requirement information. Then, the number of virtual machines can be calculated by using the overall resource requirement information and the specification information of a single virtual machine.

[0017] In this application, affinity information refers to the requirement that the first virtual machine and the second virtual machine reside on the same physical machine, in the same rack, or at the same resource level. Anti-affinity information refers to the requirement that the first virtual machine and the second virtual machine cannot reside on the same physical machine, in the same rack, or at the same resource level.

[0018] In this possible implementation, the scheduling node can schedule virtual machines in batches based on the user-configured requirements for virtual machines. The batch-scheduled virtual machines will satisfy the affinity or anti-affinity relationships set by the user, which can ensure the scheduling constraints set by the user for the virtual machines and improve the accuracy of virtual machine scheduling.

[0019] In one possible implementation, the affinity information between virtual machines is represented by a first array, which indicates the affinity level of the virtual machine and the number of virtual machines at the corresponding affinity level. The affinity level is a resource level in the cloud system.

[0020] In this application, affinity level refers to the resource level that requires affinity. For example, physical machine-level affinity level means that the first virtual machine and the second virtual machine need to be in the same physical machine; rack-level affinity level means that the first virtual machine and the second virtual machine need to be in the same rack.

[0021] In this application, the dimension of the first array can be related to the number of resource levels. If there are 4 resource levels, namely L0, L1, L2 and L3, the first array can be represented as [x,y,m,n], where x represents the number of virtual machines that satisfy affinity at L0 level, y represents the number of L0 level resources that satisfy affinity at L1 level, such as the number of physical machines that satisfy affinity at the rack level, then the number of virtual machines that satisfy affinity at L1 level is y*x; m represents the number of L1 level resources that satisfy affinity at L2 level, then the number of virtual machines that satisfy affinity at L2 level is m*y*x; n represents the number of L2 level resources that satisfy affinity at L3 level, then the number of virtual machines that satisfy affinity at L3 level is n*m*y*x.

[0022] The values ​​x, y, m, and n mentioned above can all be natural numbers. If any of them is equal to 1, it can represent an affinity relationship that does not restrict the resource level.

[0023] In this possible implementation, using the form of a first array to indicate the affinity between virtual machines can simplify the way affinity is indicated and reduce the overhead of indicating affinity.

[0024] In one possible implementation, anti-affinity information between virtual machines is represented by a second array; wherein the second array is used to indicate the anti-affinity level of the virtual machine, and the anti-affinity level is the resource level in the cloud system.

[0025] In this application, anti-affinity level refers to a resource level that cannot have affinity. For example, physical machine-level anti-affinity level means that the first virtual machine and the second virtual machine cannot be in the same physical machine; rack-level anti-affinity level means that the first virtual machine and the second virtual machine cannot be in the same rack.

[0026] In this application, the second array can indicate the resource level at which anti-affinity is applied. For example, [Lq] can indicate anti-affinity at the corresponding resource level, such as [L0] indicating anti-affinity at the physical machine level, and [L1] indicating anti-affinity at the rack level. Of course, there can be multiple parameters in the second array, such as [L0, L1] indicating anti-affinity at both the physical machine level and the rack level.

[0027] In this possible implementation, using a second array to indicate the anti-affinity relationship between virtual machines can simplify the indication of the anti-affinity relationship and reduce the overhead of indicating the anti-affinity relationship.

[0028] In one possible implementation, determining the location information of the first virtual machine and the second virtual machine corresponding to the first request based on the virtual machine demand information and the information of multiple physical machines in the cloud system includes: converting the virtual machine demand information into a demand tree; wherein the demand tree is used to indicate the distribution of the multiple virtual machines corresponding to the first request in at least one resource level of the cloud system, the resource level of the cloud system corresponds to the resource tree of the cloud system, and the resource tree is obtained based on the multiple physical machines in the cloud system and the network topology of the multiple physical machines; and determining the location information of the second virtual machine based on the order of the multiple virtual machines on the demand tree and the location information of the first virtual machine, wherein the first virtual machine is ordered as an adjacent virtual machine before the second virtual machine.

[0029] In this application, the demand tree refers to scheduling multiple virtual machines from at least one resource level of the cloud system based on the affinity or anti-affinity relationship of the virtual machines, that is, determining the location information of multiple virtual machines at at least one resource level, and the location information of these virtual machines is distributed in a tree-structured resource level.

[0030] In this application, a resource tree refers to a tree-like resource structure with multiple resource levels constructed according to multiple physical machines and the network topology of the multiple physical machines in the cloud system.

[0031] In this application, the requirement tree has a root and branches. The order of multiple virtual machines corresponding to the first request can be determined based on the relationship between the branches, and then multiple virtual machines can be scheduled in sequence.

[0032] In this possible implementation, the scheduling node converts the virtual machine demand information into a demand tree, which can better correspond to the resource structure in the cloud system, thereby improving the scheduling speed of multiple virtual machines.

[0033] In one possible implementation, the location information of the second virtual machine is the optimal location information based on the comprehensive score obtained from the location information of the first virtual machine. The comprehensive score is obtained based on at least one of the location score of the first virtual machine, the resource constraint score, the affinity constraint score, or the virtual machine affinity score.

[0034] In this application, the comprehensive score refers to the score obtained based on at least one of the following: the score of the location information of the first virtual machine, the resource constraint score, the affinity constraint score, or the virtual machine affinity score.

[0035] In this possible implementation, determining the location information of the second virtual machine through comprehensive scoring can improve the accuracy of virtual machine scheduling.

[0036] In one possible implementation, the resource constraint score includes at least one of a physical machine reservation score or a cluster reservation score, where the cluster is a resource level higher than the physical machine; the physical machine reservation score is positively correlated with the resource occupancy on a single physical machine, and the cluster reservation score is positively correlated with the resource occupancy on a single cluster.

[0037] In this application, the physical machine reservation score is positively correlated with the resource usage on a single physical machine, meaning that the more resources are used on a single physical machine, the higher the physical machine reservation score. This allows virtual machines to be concentrated on occupied physical machines as much as possible, while reserving some less occupied physical machines to meet the needs of user tasks that require concentrated resources.

[0038] In this application, the cluster reservation score is positively correlated with the resource usage on a single cluster, meaning that the higher the resource usage on a single cluster, the higher the cluster reservation score. This allows virtual machines to be concentrated on already occupied clusters, reserving some less populated clusters to meet the needs of user tasks requiring concentrated resources.

[0039] In this possible implementation, scheduling virtual machines through resource constraint scoring is beneficial for reserving some relatively empty physical machines or clusters to meet the needs of user tasks that require concentrated resources.

[0040] In one possible implementation, the affinity constraint score is used to indicate the penalty score when the affinity constraint or anti-affinity constraint is not satisfied. The penalty score tends to infinity and is used to filter out location information that does not satisfy the affinity constraint or anti-affinity constraint.

[0041] In this application, the penalty score tending towards infinity can be positive infinity or negative infinity. If the penalty score is added to the comprehensive score, the penalty score can be negative infinity. If the penalty score is subtracted from the comprehensive score, the penalty score can be positive infinity.

[0042] In this possible implementation, the location information of virtual machines that do not meet affinity constraints or anti-affinity constraints can be filtered out by using penalty scores, thereby improving the accuracy of virtual machine scheduling.

[0043] In one possible implementation, the virtual machine associativity score is positively correlated with the degree of concentration of multiple virtual machines.

[0044] In this application, the virtual machine correlation score is positively correlated with the degree of concentration of multiple virtual machines. This means that the more compact the location information of the virtual machines, the higher the virtual machine correlation score.

[0045] In this possible implementation, the virtual machine affinity score can enable the scheduling node to schedule virtual machines as compactly as possible, so that virtual machines with the same user task are distributed as centrally as possible under the condition of satisfying affinity constraints or anti-affinity constraints, thereby improving the communication efficiency between virtual machines.

[0046] A second aspect of this application provides a resource scheduling method applicable to a terminal device. The method includes: responding to a first operation on a user interface to generate a first request; wherein the first operation is an operation to fill in or select virtual machine demand information; sending the first request to a cloud system, the first request including the virtual machine demand information; the virtual machine demand information being used by the cloud system to schedule the first virtual machine based on the location information of a first virtual machine, and to schedule the second virtual machine based on the location information of a second virtual machine, the location information of the second virtual machine being determined based on the location information of the first virtual machine.

[0047] In the second aspect, users can obtain a first request by filling in or selecting virtual machine requirements on the user interface. The scheduling nodes in the cloud system can then perform batch scheduling of virtual machines based on these requirements. This is because, except for the first virtual machine whose location is randomly selected, the locations of the other virtual machines are determined by the location of the preceding virtual machine. This eliminates the need for a full search of every physical machine in the cloud system for batch scheduling of virtual machines, reducing the complexity of batch scheduling, increasing its speed, and lowering the response latency to user tasks.

[0048] In one possible implementation, the requirement information for virtual machines includes at least one of the following: specification information of a single virtual machine, first indication information, affinity information between virtual machines, or anti-affinity information; wherein the first indication information is used to indicate the number of virtual machines.

[0049] In one possible implementation, the affinity information between virtual machines is represented by a first array, which indicates the affinity level of the virtual machine and the number of virtual machines at the corresponding affinity level. The affinity level is a resource level in the cloud system.

[0050] In one possible implementation, anti-affinity information between virtual machines is represented by a second array; wherein the second array is used to indicate the anti-affinity level of the virtual machine, and the anti-affinity level is the resource level in the cloud system.

[0051] In one possible implementation, the user interface includes fill fields for each affinity level in the first array, where the fill fields are used to fill in the number of virtual machines corresponding to the affinity level.

[0052] This possible implementation simplifies the user interface setup and improves the ease of user operation.

[0053] In one possible implementation, the user interface includes fill fields in a second array for filling in the virtual machine's anti-affinity level.

[0054] This possible implementation simplifies the user interface setup and improves the ease of user operation.

[0055] A third aspect of this application provides a resource scheduling device, which can be a scheduling node in a cloud system. The scheduling node can be a physical machine or a virtual machine in the cloud system. The resource scheduling device includes:

[0056] The acquisition unit is used to acquire a first request, which includes the demand information for the virtual machine.

[0057] The first processing unit is configured to determine the location information of the first virtual machine and the location information of the second virtual machine corresponding to the first request based on the virtual machine demand information and the information of multiple physical machines in the cloud system; wherein the location information of the second virtual machine is determined based on the location information of the first virtual machine, and the first virtual machine and the second virtual machine are located in at least one of the multiple physical machines.

[0058] The second processing unit is used to schedule the first virtual machine according to the location information of the first virtual machine, and to schedule the second virtual machine according to the location information of the second virtual machine.

[0059] In one possible implementation, the requirement information for virtual machines includes at least one of the following: specification information of a single virtual machine, first indication information, affinity information between virtual machines, or anti-affinity information; wherein the first indication information is used to indicate the number of virtual machines.

[0060] In one possible implementation, the affinity information between virtual machines is represented by a first array, which indicates the affinity level of the virtual machine and the number of virtual machines at the corresponding affinity level. The affinity level is a resource level in the cloud system.

[0061] In one possible implementation, anti-affinity information between virtual machines is represented by a second array; wherein the second array is used to indicate the anti-affinity level of the virtual machine, and the anti-affinity level is the resource level in the cloud system.

[0062] In one possible implementation, a first processing unit is used to convert the demand information for virtual machines into a demand tree; wherein the demand tree is used to indicate the distribution of multiple virtual machines corresponding to the first request in at least one resource level of the cloud system, the resource level of the cloud system corresponds to the resource tree of the cloud system, and the resource tree is obtained based on multiple physical machines in the cloud system and the network topology of the multiple physical machines; based on the order of multiple virtual machines on the demand tree, the location information of the second virtual machine is determined based on the location information of the first virtual machine, and the first virtual machine is ordered as an adjacent virtual machine before the second virtual machine.

[0063] In one possible implementation, the location information of the second virtual machine is the optimal location information based on the comprehensive score obtained from the location information of the first virtual machine. The comprehensive score is obtained based on at least one of the location score of the first virtual machine, the resource constraint score, the affinity constraint score, or the virtual machine affinity score.

[0064] In one possible implementation, the resource constraint score includes at least one of a physical machine reservation score or a cluster reservation score, where the cluster is a resource level higher than the physical machine; the physical machine reservation score is positively correlated with the resource occupancy on a single physical machine, and the cluster reservation score is positively correlated with the resource occupancy on a single cluster.

[0065] In one possible implementation, the affinity constraint score is used to indicate the penalty score when the affinity constraint or anti-affinity constraint is not satisfied. The penalty score tends to infinity and is used to filter out location information that does not satisfy the affinity constraint or anti-affinity constraint.

[0066] In one possible implementation, the virtual machine associativity score is positively correlated with the degree of concentration of multiple virtual machines.

[0067] A fourth aspect of this application provides a resource scheduling device, which can be a terminal device, and the resource scheduling device includes:

[0068] A processing unit is configured to respond to a first operation on the user interface to generate a first request; wherein the first operation is an operation to fill in or select information about the virtual machine's requirements.

[0069] The sending unit is used to send a first request to the cloud system. The first request includes a demand information for a virtual machine. The demand information for the virtual machine is used by the cloud system to schedule the first virtual machine according to its location information and to schedule the second virtual machine according to its location information. The location information of the second virtual machine is determined based on the location information of the first virtual machine.

[0070] In one possible implementation, the requirement information for virtual machines includes at least one of the following: specification information of a single virtual machine, first indication information, affinity information between virtual machines, or anti-affinity information; wherein the first indication information is used to indicate the number of virtual machines.

[0071] In one possible implementation, the affinity information between virtual machines is represented by a first array, which indicates the affinity level of the virtual machine and the number of virtual machines at the corresponding affinity level. The affinity level is a resource level in the cloud system.

[0072] In one possible implementation, anti-affinity information between virtual machines is represented by a second array; wherein the second array is used to indicate the anti-affinity level of the virtual machine, and the anti-affinity level is the resource level in the cloud system.

[0073] In one possible implementation, the user interface includes fill fields for each affinity level in the first array, where the fill fields are used to fill in the number of virtual machines corresponding to the affinity level.

[0074] In one possible implementation, the user interface includes fill fields in a second array for filling in the virtual machine's anti-affinity level.

[0075] A fifth aspect of this application provides a resource scheduling apparatus, which includes a processor. The processor is configured to call and execute a computer program stored in a memory, such that the processor implements the method described in the first aspect or any of the implementations in the first aspect.

[0076] Optionally, the resource scheduling device may further include an input / output (I / O) unit or a communication interface; the processor may also control the I / O unit or communication interface to send or receive data.

[0077] Optionally, the resource scheduling device includes a memory in which a computer program is stored.

[0078] The resource scheduling device mentioned in the fifth aspect can be a device or a chip (system) in the device.

[0079] A sixth aspect of this application provides a resource scheduling apparatus, which includes a processor. The processor is configured to call and execute a computer program stored in a memory, such that the processor implements the method described in the second aspect or any of the implementations in the second aspect.

[0080] Optionally, the resource scheduling device may further include an I / O unit or a communication interface; the processor may also control the I / O unit or communication interface to send or receive data.

[0081] Optionally, the resource scheduling device includes a memory in which a computer program is stored.

[0082] The resource scheduling device described in the sixth aspect above can be a device or a chip (system) in the device.

[0083] The seventh aspect of this application provides a resource scheduling device, which can be a scheduling node in a cloud system, or a module or unit (e.g., a chip, a chip system, or a circuit) in the scheduling node that performs the methods / operations / steps / actions described in the first aspect or any implementation of the first aspect.

[0084] The eighth aspect of this application provides a resource scheduling device, which can be a terminal device or a module or unit (e.g., a chip, a chip system, or a circuit) in the terminal device that corresponds one-to-one with the methods / operations / steps / actions described in the second aspect or any implementation of the second aspect.

[0085] The ninth aspect of this application provides a computer-readable storage medium including computer instructions that, when executed on a computer, cause the computer to perform an implementation as described in the first aspect or any of the first aspects.

[0086] The tenth aspect of this application provides a computer-readable storage medium including computer instructions that, when executed on a computer, cause the computer to perform an implementation as described in the second aspect or any of the second aspects.

[0087] The eleventh aspect of this application provides a computer program product including instructions that, when run on a computer, cause the computer to perform an implementation as described in the first aspect or any of the first aspects.

[0088] The twelfth aspect of this application provides a computer program product including instructions that, when run on a computer, cause the computer to perform an implementation as described in the second aspect or any of the second aspects.

[0089] The thirteenth aspect of this application provides a chip device including a processor for calling a program stored in a memory, such that the processor executes the first aspect or any implementation thereof.

[0090] Optionally, the memory may be located inside or outside the chip device.

[0091] The fourteenth aspect of this application provides a chip device including a processor for calling a program stored in a memory, such that the processor executes the second aspect or any implementation thereof described above.

[0092] Optionally, the memory may be located inside or outside the chip device.

[0093] The fifteenth aspect of this application provides a cloud system including a scheduling node and multiple physical machines. The scheduling node is used to execute the first aspect or any implementation thereof to schedule virtual machines in batches from the multiple physical machines.

[0094] The technical effects of the second, third, or fourth aspects, or any possible implementation of the second, third, or fourth aspects, and the fifth to fifteenth aspects, can be found in the first aspect or the technical effects of different possible implementations of the first aspect, and will not be repeated here. Attached Figure Description

[0095] Figure 1A is a schematic diagram of an example of virtualization provided in an embodiment of this application;

[0096] Figures 1B to 1D are schematic diagrams of the structures of several possible cloud systems provided in the embodiments of this application;

[0097] Figures 2A to 2C are schematic diagrams of the resource structure of the cloud system provided in the embodiments of this application;

[0098] Figure 3 is a schematic diagram of an embodiment of the resource scheduling method provided in this application;

[0099] Figure 4A is a schematic diagram of an example of virtual machine scheduling provided in an embodiment of this application;

[0100] Figure 4B is a schematic diagram of an example search virtual machine provided in an embodiment of this application;

[0101] Figure 5 is a schematic diagram of an embodiment of the resource scheduling method provided in this application;

[0102] Figure 6A is a structural schematic diagram of a requirement tree provided in an embodiment of this application;

[0103] Figure 6B is another example of virtual machine scheduling provided in an embodiment of this application;

[0104] Figures 7A and 7B are schematic diagrams illustrating examples of resource constraint scoring provided in embodiments of this application.

[0105] Figure 8 is a schematic diagram of an example of resource constraint scoring provided in an embodiment of this application;

[0106] Figures 9 to 11 are structural diagrams of the resource scheduling device provided in the embodiments of this application. Detailed Implementation

[0107] The embodiments of this application are described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. As those skilled in the art will understand, with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0108] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0109] This application provides a resource scheduling method to reduce the complexity of virtual machine scheduling. This application also provides corresponding apparatus, computer-readable storage media, and computer program products. These will be described in detail below.

[0110] To facilitate understanding, the technologies and background involved in the embodiments of this application will be explained below.

[0111] Virtualization is a resource management technology that abstracts and transforms various physical resources of a host computer, such as computing, network, and storage resources, breaking down the indivisible barriers between the host's physical structures. This allows users to utilize these resources in a better way than the original configuration. Resources used through virtualization are called virtualized resources, and virtualized resources are not limited by the existing physical resource deployment methods, geographical location, or physical configuration.

[0112] In simple terms, virtualization technology involves using software to create one or more virtual machines (VMs) on a single computer. Each VM runs like an independent computer. As shown in Figure 1A, virtualization technology can create three VMs on a single computer, each capable of operating like an independent computer. This allows different operating systems to run on the same computer, such as running Windows and Linux simultaneously, testing different software environments on the same computer, or executing user tasks for different users on the same computer.

[0113] A physical machine (PM) is the physical resource used to host virtualization technology. It is also called a physical server or physical host. Typically, a physical server is used to deploy virtual instances. A physical machine has multiple physical devices, such as processors and memory. Multiple virtual instances can be deployed on a single physical machine, sharing the machine's physical resources. Depending on the use case, a single physical machine can host virtual instances belonging to only one user or virtual instances belonging to multiple users.

[0114] A resource pool is a collection of various hardware and software resources involved in a cloud system. Typically, resources in a resource pool can be categorized by type into computing resources, storage resources, and network resources (communication resources).

[0115] A virtual instance runs on the host's operating system and has its own operating system. This operating system runs applications used to implement user business logic. Virtual instances can utilize the host's hardware resources, and different virtual instances are isolated from each other. Typically, a virtual instance can be a virtual machine or a container.

[0116] A virtual machine (VM) refers to a complete computer system with full hardware system functionality, simulated using virtualization technology and running in a completely isolated environment. A subset of the instructions in a virtual machine can be processed on the host machine, while other instructions can be executed in a simulated manner. A virtual machine is also called a virtual server.

[0117] A virtual machine can be viewed as a collection of virtual devices, which together form a complete computer system with full hardware functionality, running in a completely isolated environment. Virtual devices are created by virtualizing physical devices that can share resources. For example, a virtual processor, created by virtualizing a processor, is a virtual device. Similarly, a training card, created by virtualizing a field-programmable gate array (FPGA), is also a virtual device.

[0118] Containers provide a lightweight virtual runtime environment. Containers are created by packaging all the code, libraries, and dependencies of a user's application into an image. When the image is executed, it runs in a virtual runtime environment. At this point, the container is a runtime instance of the image, similar to a lightweight sandbox; it can be started, stopped, and deleted. This image does not share the host machine's memory, processor (such as the central processing unit, CPU), and disk resources with other images, achieving container isolation between the image and the host, and between the image and other images. This ensures that processes within a container cannot monitor any processes or resources outside the container. Container technologies include Docker, Kubernetes, CoreOS, and others.

[0119] The virtualization technologies introduced above are typically applied to cloud systems, which can be public clouds, private clouds, or hybrid clouds. For an understanding of cloud systems, please refer to Figure 1B.

[0120] As shown in Figure 1B, the cloud system structure provided in this embodiment may include: terminal device 01, scheduling node 02, worker node cluster 03, and worker node cluster 04. Communication connections can be established between client 01 and scheduling node 02, between scheduling node 02 and worker node cluster 03, between scheduling node 02 and worker node cluster 04, and between worker node cluster 03 and worker node cluster 04. For example, terminal device 01 and scheduling node 02 can establish a communication connection through a network. Optionally, this network can be a local area network (LAN), the Internet, or other networks. In a cloud computing scenario, this network can also be a virtual private cloud (VPC), but this embodiment does not limit the scope.

[0121] In this implementation environment, cloud system operations personnel can interact with scheduling node 02 via terminal device 01. For example, operations personnel can send instructions to scheduling node 02 via terminal device 01 to deploy the cloud system, instructing scheduling node 02 to deploy the cloud system based on scheduling node 02's resources, worker node cluster 03, and worker node cluster 04. This cloud system is used to manage the resources of worker node cluster 03 and worker node cluster 04, and to provide cloud services to tenants based on these resources.

[0122] Optionally, terminal equipment 01, also known as user equipment (UE), mobile station (MS), mobile terminal (MT), etc., is a device that includes wireless communication functions (providing voice / data connectivity to users), such as a handheld device with wireless connectivity. Currently, some examples of terminal devices include: mobile phones, tablets, laptops, PDAs, wireless routers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving cars, wireless terminals in vehicle-to-everything (V2X) communication, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, or wireless terminals in smart homes, etc.

[0123] Scheduling node 02 can be a cloud server or a cloud physical machine, a cloud server cluster or physical machine cluster consisting of several cloud servers, or a cloud computing service center. The functions of the scheduling node can be implemented through software or hardware.

[0124] As an example of a software functional unit, a scheduling node can include code running on a compute instance. A compute instance can include at least one of a physical host (compute device), a virtual machine, or a container. Furthermore, the aforementioned compute instance can be one or more. For example, a scheduling node can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code can be distributed within the same availability zone (AZ) or in different AZs, each AZ comprising one or more geographically proximate data centers. Typically, a region can include multiple AZs.

[0125] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a single region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0126] As an example of a hardware functional unit, a scheduling node can include at least one computing device, such as a server. Alternatively, a scheduling node can also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0127] The scheduling node comprises multiple computing devices that can be distributed in the same region or in different regions. Similarly, the scheduling node may be located within the same Availability Zone (AZ) or in different AZs. Likewise, the scheduling node may be located within the same Virtual Private Cloud (VPC) or multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0128] Worker node clusters 03 and 04 can be physical machine clusters consisting of several physical machines, or a cloud computing service center. The cloud computing service center deploys a large amount of basic resources owned by the cloud service provider, such as computing resources, storage resources, and network resources.

[0129] It should be noted that the scheduling node 02, worker node cluster 03 and worker node cluster 04 in this implementation environment can also be implemented through other resource platforms besides the cloud computing service center, and this application embodiment does not specifically limit them.

[0130] It should be understood that the above content is an exemplary description of the cloud system provided in the embodiments of this application, and does not constitute a limitation on the application scenario of the deployment method of the cloud resource management system. As those skilled in the art will know, the application scenario can be adjusted according to the application requirements as business needs change.

[0131] In this embodiment, the architecture of the cloud system can also be understood with reference to Figure 1C. As shown in Figure 1C, the cloud system includes a cloud platform and basic resources. The cloud platform includes a cloud platform manager, and the scheduling node described above can be the cloud platform manager in Figure 1C. The basic resources can include multiple servers, each of which can be a worker node, or each server can include multiple worker nodes.

[0132] The working node can be a computing device card or a virtual machine (VM). The computing device card can be at least one of a central processing unit (CPU), a graphics processing unit (GPU), and a network processing unit (NPU).

[0133] The cloud platform manager maintains or periodically collects information about each worker node in the basic resources, such as the resource usage status (resource utilization rate or resource idle rate) on each worker node. This information can serve as auxiliary decision-making information when allocating query requests.

[0134] The cloud platform manager can receive requests from users and then execute the corresponding tasks. The cloud platform manager can also assign these tasks to one or more worker nodes in the cloud system for execution. After the worker nodes complete the tasks, the cloud platform manager can return the results to the user. The process of assigning tasks to one or more worker nodes can be understood as a virtual machine scheduling process.

[0135] Furthermore, the cloud system in this embodiment can also be understood by referring to the structure of the data center shown in Figure 1D. As shown in Figure 1D, the data center includes a data center management platform, an internal data center network, and multiple physical machines. The data center management platform can connect to each physical machine through the internal data center network. The function of the data center management platform is similar to that of the scheduling node described earlier. Each physical machine can obtain multiple virtual machines through virtualization technology. For example, physical machine 1 can obtain virtual machine 1 and virtual machine 2 through virtualization technology, and physical machine 2 can obtain virtual machine 3 and virtual machine 4 through virtualization technology.

[0136] Virtual machines can also be called cloud servers (Elastic Compute Service, ECS) or elastic instances (different cloud service providers may use different names).

[0137] The data center management platform can provide access interfaces (such as user interfaces or application programming interfaces, APIs). Users can use client machines to remotely access these interfaces, register an account and password on the data center management platform, and log in. After successful account and password authentication, the data center management platform can send requests to the platform via the client. The platform can then assign user tasks corresponding to these requests, scheduling them to one or more virtual machines for execution. In other words, it can schedule multiple virtual machines to execute user tasks and return the processing results or task completion responses to the user.

[0138] In this embodiment, the cloud system may include multiple physical machines, which can be connected via a network topology. The connection relationships between the multiple physical machines can be understood with reference to Figure 2A. As shown in Figure 2A, the cloud system includes multiple racks, each of which may contain multiple physical machines. Physical machines in the same rack can be connected to the same access switch, which in turn connects to an aggregation switch, and the aggregation switch connects to a core switch. This enables communication between different physical machines. For example, physical machines in the same rack can communicate through the connected access switches. Physical machines in different racks can communicate through the connected access switches and the upper-level aggregation switch or core switch. The resource structure of the cloud system shown in Figure 2A can be abstracted as a four-layer resource tree. The core switch can be considered the root, with aggregation switches as the first-layer branches, access switches as the second-layer branches, and physical machines as the third-layer branches. The branches of the access switches are also equivalent to branches of the racks, belonging to the same resource layer. Because the resources used for processing tasks are all located on physical machines, physical machines can be considered as the L0 layer, racks as the L1 layer, aggregation switches as the L2 layer, and core switches as the L3 layer. Of course, this is just an example, and this application does not limit the definition of resource hierarchy.

[0139] In the resource structure of the cloud system shown in Figure 2A, physical machines are the basic units of physical resources. The computing power, storage capacity, or communication capabilities of each physical machine can be the same or different. Furthermore, physical machines in the cloud system can belong to different network domains through different communication lines. As shown in Figure 2B, the cloud system includes multiple racks, such as rack 1, rack 2, and rack 3. Each rack can contain multiple physical machines, such as: rack 1 includes physical machines 11, 12, 13, 14, ...; rack 2 includes physical machines 21, 22, 23, 24, ...; rack 3 includes physical machines 31, 32, 33, 34, ... It should be noted that Figure 2B only illustrates three racks as an example; in reality, the cloud system can include multiple racks.

[0140] The physical machines in the racks shown in Figure 2B can be connected via the first communication line, placing them within the same high-speed custom communication system (HCCS) network domain. Additionally, the physical machines in the racks shown in Figure 2B can also be connected via the second communication line to the top of rack (TOR) 1, and further connected to the spine switch (Spine 1), placing them within the remote direct memory access over converged Ethernet (RoCE) network domain. Furthermore, the physical machines in the racks shown in Figure 2B can also be connected via the third communication line to TOR2, and further connected to Spine 2, placing them within the virtual private cloud (VPC) network domain. Although Figure 2B illustrates multiple network domains, the physical machines in different network domains are identical. Therefore, the resource structure of the multiple network domains shown in Figure 2B can be abstracted and reduced to the resource tree structure shown in Figure 2C.

[0141] As shown in Figure 2C, the resource structure of a cloud system can be abstracted and reduced to four resource levels: L0, L1, L2, and L3. L0 is the physical machine level. Resource information at the physical machine level can include the total resources of each physical machine and the resources already used. For example, total resources can be represented as 64U, 256G, and 8GPUs. 64U represents 64 processing cores or processing units, 256G represents 256 gigabytes (GB) of storage capacity, and 8GPUs represent 8 image processing units. Of course, physical machines can have other resources, which are not all listed here. Used resources can be represented as 48U, 192G, and 6GPUs. 48U represents 48 processing cores or processing units that have been used or allocated to virtual machines, 192G represents the used storage capacity, and 6GPUs represent 6 image processing units that have been used. The L1 level can be the rack level, the L2 level can be the HCCS, TOR1 or TOR2 level in Figure 2B, and the L3 level can be the spine1 or spine2 level.

[0142] In this embodiment, the scheduling node can construct a resource tree as shown in Figure 2C based on the resource structure in the cloud system when the cloud system is enabled, and then periodically or in real time, it can statistically analyze the resource usage of each physical machine. If resources in the cloud system are increased or decreased, such as when a new physical machine is added or a physical machine is removed, the scheduling node can update the resource tree based on the changed physical machines and network topology.

[0143] The above describes several possible structures of cloud systems. The following section, in conjunction with the accompanying drawings, describes the resource scheduling method provided in the embodiments of this application.

[0144] As shown in Figure 3, the resource scheduling method provided in this embodiment includes:

[0145] S301. The scheduling node obtains the first request, which includes the request information for the virtual machine.

[0146] In this application, the first request is a request corresponding to a user task, used to request resources in the cloud system for executing the user task. For example, if a user requests resources from the cloud system to train an artificial intelligence (AI) model, then the first request is used to request resources for training the AI ​​model. Resources in the cloud system include computing resources, storage resources, or communication resources, which can be understood by referring to the descriptions in Figures 1A to 2C above. Resources in the cloud system are usually provided to users in the form of virtual machines to execute the corresponding user tasks. As shown in Figure 4A, the scheduling node can schedule VM111 and VM112 from physical machine 11 in rack 1, and schedule VM121 and VM122 from physical machine 12 to execute user tasks.

[0147] In this application, the requirement information for virtual machines refers to relevant information used to describe the specification requirements, quantity requirements, or location requirements for virtual machines.

[0148] S302. The scheduling node determines the location information of the first virtual machine and the location information of the second virtual machine corresponding to the first request based on the demand information of the virtual machine and the information of multiple physical machines in the cloud system; wherein, the location information of the second virtual machine is determined based on the location information of the first virtual machine, and the first virtual machine and the second virtual machine are located in at least one of the multiple physical machines.

[0149] In this application, the location information of the first virtual machine can be randomly selected, and the location information of the second virtual machine is obtained based on the location information of the first virtual machine.

[0150] In this application, the first request may correspond to multiple virtual machines, not limited to the first virtual machine and the second virtual machine. Regardless of the number of virtual machines, the location information of the next virtual machine can be determined according to the relationship between the first virtual machine and the second virtual machine and the location information of the previous virtual machine.

[0151] The relationship between the multiple virtual machines provided in this application can be understood by referring to Figure 4B. In the prior art, when scheduling virtual machines in batches for user tasks, a full search of resources in the cloud system is required until a virtual machine that meets the user task requirements is obtained. For example, according to the existing method, when scheduling each virtual machine, the scheduling node needs to search through each physical machine, and the complexity is basically geometrically proportional to the number of physical machines. If the solution provided in this application is used, the next virtual machine is determined based on the previous virtual machine, which greatly reduces the complexity of determining the virtual machine.

[0152] S303. The scheduling node schedules the first virtual machine based on the location information of the first virtual machine, and schedules the second virtual machine based on the location information of the second virtual machine.

[0153] In this application, scheduling the first virtual machine based on its location information refers to sending instruction information to the corresponding physical machine based on the location information of the first virtual machine. The physical machine then initializes and runs the first virtual machine based on the instruction information. Similarly, the scheduling process of other virtual machines can be understood by referring to the scheduling process of the first virtual machine.

[0154] In the solution provided in this application embodiment, the scheduling node can determine the location information of each virtual machine among the multiple virtual machines to be scheduled for the first request. Moreover, except for the location information of the first virtual machine, which is randomly selected, the location information of the other virtual machines is determined based on the location information of the previous virtual machine. In this way, it is not necessary to search every physical machine in the numerous physical machines of the cloud system for batch scheduling of virtual machines, which reduces the complexity of batch scheduling of virtual machines, improves the batch scheduling speed of virtual machines, and also reduces the response latency to user tasks.

[0155] The virtual machine requirement information in S301 above may include at least one of the following: specification information of a single virtual machine, first indication information, affinity information between virtual machines, or anti-affinity information; wherein, the first indication information is used to indicate the number of virtual machines.

[0156] The specifications of a single virtual machine refer to the number of processors or processing cores in the single virtual machine and the amount of storage resources required, such as 8G of storage resources. Of course, it can also be other sizes of storage resources; this is just an example.

[0157] The first indication information can be the number of virtual machines, such as 100 virtual machines. The first indication information can also be the overall resource requirement information. Then, the number of virtual machines can be calculated by using the overall resource requirement information and the specification information of a single virtual machine.

[0158] Affinity information refers to the requirement that the first and second virtual machines reside on the same physical machine, in the same rack, or at the same resource level. Anti-affinity information refers to the requirement that the first and second virtual machines cannot reside on the same physical machine, in the same rack, or at the same resource level.

[0159] In this application, affinity information can also be understood as affinity constraints set by the user. These affinity constraints refer to virtual machine scheduling constraints set by the user, which can constrain multiple virtual machines to be placed in the same resource level (e.g., the same physical machine, the same rack, or other resource levels). A typical application scenario is that the user wants multiple virtual machines to be in the same supernode (physical machine or rack) to improve model training efficiency and ensure communication speed between nodes.

[0160] In this application, anti-affinity information can also be understood as anti-affinity constraints. These constraints mean that multiple virtual machines cannot reside at a certain resource level, such as not being on the same physical machine, not being on the same rack, or not being on other resource levels. A typical scenario is that users do not want to place all virtual machines on the same physical machine or rack to prevent business disruptions in the event of a physical failure.

[0161] In this application, when scheduling virtual machines in batches, the scheduling node can schedule them according to the user-configured demand information for the virtual machines. The batch-scheduled virtual machines will satisfy the affinity or anti-affinity relationship set by the user, which can ensure the scheduling constraints set by the user for the virtual machines and improve the accuracy of virtual machine scheduling.

[0162] The first request in S301 above can be sent by the user to the cloud system through the terminal device. The user can perform the first operation on the user interface, and then the terminal device will respond to the first operation, generate the first request, and send the first request to the cloud system.

[0163] The user's first action on the user interface can be understood by referring to Figure 5. As shown in Figure 5, the user interface may contain fields related to generating the first request; of course, it can also be selection options. Figure 5 only illustrates the example of fields to be filled in. These fields can be located on the same screen or on different screens; Figure 5 only illustrates the example of fields located on the same screen.

[0164] The user interface shown in Figure 5 can include specifications for a single virtual machine, including fields for CPU, GPU, NPU, or Memory. Users can select one or more of these fields to fill in as needed. The user interface can also include the number of virtual machines; users can enter the required number, such as 100, indicating that 100 virtual machines of the corresponding specifications are needed. The user interface can also include affinity and / or anti-affinity information. Of course, the user interface can also include other fields or options; the content of the user interface can be configured according to actual needs.

[0165] The affinity information between virtual machines is represented by a first array, which indicates the affinity level of the virtual machine and the number of virtual machines at the corresponding affinity level. The affinity level is a resource level in the cloud system.

[0166] In this application, affinity level refers to the resource level that requires affinity. For example, physical machine-level affinity level means that the first virtual machine and the second virtual machine need to be in the same physical machine; rack-level affinity level means that the first virtual machine and the second virtual machine need to be in the same rack.

[0167] In this application, the dimension of the first array can be related to the number of resource levels. If there are 4 resource levels, namely L0, L1, L2 and L3, the first array can be represented as [x,y,m,n], where x represents the number of virtual machines that satisfy affinity at L0 level, y represents the number of L0 level resources that satisfy affinity at L1 level, such as the number of physical machines that satisfy affinity at the rack level, then the number of virtual machines that satisfy affinity at L1 level is y*x; m represents the number of L1 level resources that satisfy affinity at L2 level, then the number of virtual machines that satisfy affinity at L2 level is m*y*x; n represents the number of L2 level resources that satisfy affinity at L3 level, then the number of virtual machines that satisfy affinity at L3 level is n*m*y*x. For example, if the first array is [3,2,2,2], it can represent that every 3 virtual machines are associated at the physical machine level, every 3*2=6 virtual machines are associated at the rack level, every 3*2*2=12 virtual machines are associated at the L2 level, and every 3*2*2*2=24 virtual machines are associated at the L3 level.

[0168] In the above, x, y, m, and n can all be natural numbers. If any of them is equal to 1, it means that the affinity of that resource level is not restricted. Moreover, the dimension of the first array is related to the resource structure of the cloud system. Therefore, the four dimensions listed here are only for illustration. In fact, this application does not limit the dimension of the first array.

[0169] In this way, by using the first array to indicate the affinity between virtual machines, the way affinity is indicated can be simplified and the overhead of affinity indication can be reduced.

[0170] The anti-affinity information between virtual machines is represented by a second array; the second array is used to indicate the anti-affinity level of the virtual machine, which is the resource level in the cloud system.

[0171] In this application, anti-affinity level refers to a resource level that cannot have affinity. For example, physical machine-level anti-affinity level means that the first virtual machine and the second virtual machine cannot be in the same physical machine; rack-level anti-affinity level means that the first virtual machine and the second virtual machine cannot be in the same rack.

[0172] In this application, the second array can indicate the resource level at which anti-affinity is applied. For example, [Lq] can indicate anti-affinity at the corresponding resource level, such as [L0] indicating anti-affinity at the physical machine level, and [L1] indicating anti-affinity at the rack level. Of course, there can be multiple parameters in the second array, such as [L0, L1] indicating anti-affinity at both the physical machine level and the rack level.

[0173] In this way, by using a second array to indicate the anti-affinity relationship between virtual machines, the indication method of the anti-affinity relationship can be simplified and the indication overhead of the anti-affinity relationship can be reduced.

[0174] After filling in the required information on the user interface, users can click the "Send" option, and the terminal device will then generate and send the first request. Of course, the "Send" option in Figure 5 is just an example; other functional items can replace it.

[0175] Upon receiving the first request, the scheduling node can parse it to extract the virtual machine requirement information described above. The scheduling node can then convert this requirement information into a requirement tree. This requirement tree indicates the distribution of multiple virtual machines corresponding to the first request across at least one resource level in the cloud system. The resource levels of the cloud system correspond to the resource tree, which is based on multiple physical machines and their network topology within the cloud system.

[0176] In this application, a demand tree refers to scheduling multiple virtual machines (VMs) from at least one resource level in a cloud system based on affinity or anti-affinity relationships with VMs. This involves determining the location information of multiple VMs at at least one resource level, distributed across a tree-like resource hierarchy. The demand tree has a root and branches, and the order of the VMs corresponding to the first request can be determined based on the relationships between the branches, allowing for the sequential scheduling of multiple VMs. In this way, the scheduling node transforms the VM demand information into a demand tree, which better corresponds to the resource structure in the cloud system, thereby improving the scheduling speed of multiple VMs.

[0177] In this application, the resource tree can be understood by referring to the introduction in Figures 2A to 2C above. Taking a requirement of 4 virtual machines as an example, the first array of affinity relationships that these 4 virtual machines need to satisfy is [2,1,2,1], and the second array is [L1]. This means that these 4 virtual machines satisfy affinity at the physical machine level for every 2 virtual machines, affinity at the rack level for every 2*1=2 virtual machines, affinity at the L2 level for every 2*1*2=4 virtual machines, and affinity at the L3 level for every 2*1*2*4=8 virtual machines. The second array [L1] indicates anti-affinity at the rack level, that is, the two physical machines containing two virtual machines cannot be located in the same rack.

[0178] Based on the above requirements for virtual machines, the requirement tree shown in Figure 6A can be obtained. For example, according to the affinity constraints, every two virtual machines need to reside on the same physical machine; that is, these four virtual machines need to reside on two separate physical machines. According to the second set of anti-affinity constraints, these two physical machines cannot reside in the same rack; that is, these two physical machines need to reside in separate racks. Then, according to the affinity constraints, these two racks are located under the same node at the L2 level and also under the same node at the L3 level. The L2 level can be HCCS, TOR1, or TOR2 as shown in Figure 2B, and the L3 level can be spine1 or spine2.

[0179] It should be noted that during the generation of the demand tree, the scheduling node may only generate the general location of the virtual machines based on the demand information, without yet determining the specific physical machine or rack to which the virtual machine should belong. Regarding the correspondence between virtual machines, the scheduling node can flatten the demand tree and resource tree into physical machine sequences and virtual machine sequences respectively, abstracting the scheduling task of the virtual machine into a subsequence embedding problem, that is, abstracting the virtual machine scheduling problem into the problem of embedding the virtual machine sequence into the physical machine sequence. This process can be understood with reference to Figure 6B. As shown in Figure 6B, the virtual machine sequence includes 4 virtual machines, such as VM1, VM2, VM3, and VM4; the physical machine sequence can have multiple physical machines, possibly tens of thousands of physical machines. Figure 6B uses 10 physical machines as an example for illustration, which can be represented as physical machine 1, physical machine 2, physical machine 3, physical machine 4, physical machine 5, ..., physical machine 10. The process of scheduling VM1, VM2, VM3, and VM4 to two of the ten physical machines in the virtual machine sequence not only considers the aforementioned affinity and anti-affinity constraints, but also calculates a comprehensive score for the virtual machine's location. The location of the first virtual machine can be determined randomly or based on certain requirements, such as prioritizing physical machines with higher or lower resource usage. Specific requirements can be set according to needs.

[0180] In this application, the location information of the second virtual machine is the optimal location information obtained based on the location information of the first virtual machine. The comprehensive score is obtained based on at least one of the location score of the first virtual machine, the resource constraint score, the affinity constraint score, or the virtual machine affinity score.

[0181] In this application, the comprehensive score refers to the score obtained based on at least one of the following: a score for the location information of the first virtual machine, a resource constraint score, an affinity constraint score, or a virtual machine affinity score. These scores are described below:

[0182] 1. Resource constraint scoring;

[0183] In this application, the resource constraint score includes at least one of physical machine reservation score or cluster reservation score, where the cluster is a resource level higher than the physical machine; the physical machine reservation score can be positively correlated with the resource occupancy on a single physical machine, and the cluster reservation score can be positively correlated with the resource occupancy on a single cluster.

[0184] The physical machine reservation score is positively correlated with the resource usage on a single physical machine; that is, the more resources are used on a single physical machine, the higher the physical machine reservation score. This allows virtual machines to be concentrated on occupied physical machines as much as possible, while reserving some less occupied physical machines to meet the needs of user tasks that require concentrated resources.

[0185] The cluster reservation score is positively correlated with the resource usage on a single cluster; that is, the higher the resource usage on a single cluster, the higher the cluster reservation score. This allows virtual machines to be concentrated on already occupied clusters, reserving some less populated clusters to meet the needs of user tasks that require concentrated resources.

[0186] If we use a relational expression to represent resource constraint scores, this expression can be represented as: SCORE = S1 + S2, where S1 represents the physical machine reservation score and S2 represents the cluster reservation score; S1 and S2 can be respectively: S1 = scheduleScore[j][x] - scheduleScore[j][x-1]

[0187] Where ScheduleScore[j][x] represents the score of a single virtual machine scheduling corresponding to placing x virtual machines in this batch on the j-th physical machine, and scheduleScore[j][x-1] represents the score of a single virtual machine scheduling corresponding to placing x-1 virtual machines in this batch on the j-th physical machine.

[0188] Where L represents the maximum value of the resource level. For example, in the previous example, there were 4 resource levels: L0, L1, L2, and L3, so L = 3. Indicates the number of physical machines that have been allocated virtual machines in the l resource tier, weight l This represents the weight at the corresponding resource level. The value of l ranges from 0 to L.

[0189] For an understanding of the magnitude of the S1 score, please refer to Figure 7A or Figure 7B.

[0190] As shown in Figure 7A, the total resource capacity of physical machine 1 and physical machine 2 is 76U each. Of this, 44U of physical machine 1 is used, leaving 32U idle. 8U of physical machine 2 is used, leaving 64U idle. According to the physical machine reservation scoring principle of S1, the S1 score for physical machine 1 will be higher than that for physical machine 2. This allows for the reservation of some less busy physical machines to meet the needs of user tasks requiring concentrated resources.

[0191] As shown in Figure 7B, physical machine 1 has a total resource capacity of 78U, of which 6U has been used. Physical machine 2 has a total resource capacity of 62U, of which 8U has been used. If 8U of virtual machines are to be allocated, after allocating 8U to physical machine 1, 64U will remain. After allocating 8U to physical machine 2, 46U will remain. This is not conducive to subsequent exponential resource allocation based on a factor of 2. Therefore, the S1 score of physical machine 1 will be higher than that of physical machine 2.

[0192] The magnitude of the S2 score can be understood by referring to Figure 8.

[0193] As shown in Figure 8, rack 1 is relatively full, while rack 2 is still empty. When allocating virtual machines, according to the S2 scoring principle mentioned above, the S2 score of rack 1 is higher than that of rack 2. This allows for reserving some relatively empty clusters to meet the needs of user tasks that require concentrated resources.

[0194] 2. Affinity constraint score;

[0195] In this application, the affinity constraint score is used to indicate the penalty score when the affinity constraint or anti-affinity constraint is not satisfied. The penalty score tends to infinity and is used to filter out position information that does not satisfy the affinity constraint or anti-affinity constraint.

[0196] In this application, the penalty score tending towards infinity can be positive infinity or negative infinity. If the penalty score is added to the overall score, the penalty score can be negative infinity; if the penalty score is subtracted from the overall score, the penalty score can be positive infinity. In this way, the location information of virtual machines that do not satisfy affinity constraints or anti-affinity constraints can be filtered out through the penalty score, thereby improving the accuracy of virtual machine scheduling.

[0197] 3. Virtual machine correlation score;

[0198] In this application, the virtual machine correlation score is positively correlated with the concentration of multiple virtual machines. The virtual machine correlation score can be expressed as: AWARD = 10 L-l×α. Here, AWARD represents the virtual machine affinity score, used to encourage compact placement of virtual machines; represents the maximum value of the resource level; l represents the affinity level of adjacent virtual machines; for example, if adjacent virtual machines are placed on the same physical machine, l = 0; if adjacent virtual machines are placed in the same rack, l = 1; if the affinity level of adjacent virtual machines is L2, l = 2; if the affinity level of adjacent virtual machines is L3, l = 3; and α represents a coefficient. This formula indicates that the closer the adjacent virtual machines are, the lower the affinity level and the higher the affinity score.

[0199] In this application, the virtual machine affinity score is positively correlated with the concentration of multiple virtual machines; that is, the more compact the virtual machine location information, the higher the virtual machine affinity score. Thus, this virtual machine affinity score allows scheduling nodes to schedule virtual machines as compactly as possible, ensuring that virtual machines with the same user task are distributed as centrally as possible while satisfying affinity or anti-affinity constraints. If two physical machines or racks have similar usage, multiple virtual machines will be preferentially scheduled to one of those physical machines or racks, thereby improving the communication efficiency between virtual machines.

[0200] In this embodiment of the application, there may be multiple comprehensive scores for the location information of the second virtual machine, and the one with the best comprehensive score can be selected to determine the location information of the second virtual machine.

[0201] The comprehensive score regarding the location information of the second virtual machine can be represented by an equation, which can be:

[0202] Where dp[i][j][x] represents the optimal score when the first i VMs are placed on the first j physical machines, and the j-th physical machine simultaneously hosts x VMs of this batch. dp[i-1][j][x-1] represents the optimal score when the first i-1 VMs are placed on the first j physical machines, and the j-th physical machine simultaneously hosts x-1 VMs of this batch. x′ represents the number of VMs of this batch hosted on physical machine j′, x m This indicates the maximum number of virtual machines in this batch that can be placed on an empty physical machine.

[0203] Where score[j][x] represents the resource constraint score, penalty(i,i-1,j,j) represents the affinity constraint score, and award[j][j] represents the virtual machine affinity score.

[0204] In this embodiment of the application, after the scheduling node determines the location information of multiple virtual machines according to the above process, it can send information to the physical machine where the virtual machine is located to instruct the physical machine to initialize the corresponding virtual machine and run the virtual machine to perform the corresponding user task.

[0205] In addition, in this embodiment of the application, the scheduling node can also return the scheduling result of the virtual machine to the terminal device for the user to confirm whether the scheduling constraints of the virtual machine are met.

[0206] In summary, the above resource scheduling scheme can be summarized as follows: the scheduling node can first use a reduction modeling device to model the batch scheduling problem as a subsequence embedding problem, use a scoring and weighting device to design a heuristic strategy to improve the resource pool allocation quality of physical machines and ensure the placement constraints set by the user, and finally use the dynamic programming algorithm in the batch scheduling device to give the placement location of the batch virtual machines.

[0207] The reduction modeling device can include four sub-parts: a physical machine resource pool reduction device that mathematically abstracts the resource pool to obtain the resource tree described earlier; a batch request reduction device that mathematically abstracts the user-side batch requests (first request) to obtain the demand tree described earlier; a problem reduction device that abstracts the batch scheduling problem of virtual machines into a subsequence embedding problem, as shown in Figure 6B, which embeds virtual machine sequences into physical machine sequences; and a placement constraint reduction device that simplifies complex virtual machine placement constraints.

[0208] In the solution provided in this application embodiment, a first array can be used to indicate affinity relationships, and a second array can be used to indicate anti-affinity relationships. The representation method is simple and clear, reducing the complexity of representing pairwise affinity between virtual machines from O(N) to O(N) 2 The complexity is reduced to O(M), where N is the number of physical machines in a single batch and M is the number of resource levels, with N typically in the hundreds and M typically in the single digits. This significantly reduces the complexity.

[0209] The heuristic strategy provided in this application, designed to ensure distribution quality and topological constraints between requests, exhibits a placement bias. It tends to place batches of virtual machines on relatively full physical machines or clusters, and also tends to place them within the same supernode. This frees up more idle resources to meet diverse user needs. Of course, the relatively full virtual machine placement method described in this application is merely an example of a heuristic strategy. In practice, different heuristic strategies can be set to place virtual machines according to different needs. For example, a load balancing heuristic strategy would prioritize placing virtual machines on physical machines or clusters with abundant idle resources.

[0210] The solution provided in this application has low complexity and can quickly schedule a batch of virtual machines to execute user tasks based on the user's requirements for virtual machines, thereby improving the response speed to user tasks. Furthermore, in the solution provided in this application, the user can also configure affinity information and / or anti-affinity information, making the solution complete, improving the user affinity requirement satisfaction rate, increasing model training efficiency, and ultimately enhancing the user experience.

[0211] The above describes the resource scheduling method. The following describes the resource scheduling device provided in the embodiments of this application with reference to the accompanying drawings.

[0212] As shown in Figure 9, the resource scheduling device 90 provided in this embodiment can be a scheduling node in a cloud system. The scheduling node can be a physical machine or a virtual machine in the cloud system. The resource scheduling device 90 includes:

[0213] Acquisition unit 901 is used to acquire a first request, the first request including demand information for the virtual machine;

[0214] The first processing unit 902 is used to determine the location information of the first virtual machine and the location information of the second virtual machine corresponding to the first request based on the virtual machine demand information and the information of multiple physical machines in the cloud system; wherein the location information of the second virtual machine is determined based on the location information of the first virtual machine, and the first virtual machine and the second virtual machine are located in at least one of the multiple physical machines.

[0215] The second processing unit 903 is used to schedule the first virtual machine according to the location information of the first virtual machine, and to schedule the second virtual machine according to the location information of the second virtual machine.

[0216] The resource scheduling apparatus provided in this application can determine the location information of each virtual machine among multiple virtual machines to be scheduled for a first request. Moreover, except for the location information of the first virtual machine, which is randomly selected, the location information of the other virtual machines is determined based on the location information of the previous virtual machine. This eliminates the need to perform a full search of every physical machine in the cloud system for batch scheduling of virtual machines, reducing the complexity of batch scheduling, increasing the speed of batch scheduling, and reducing the response latency to user tasks.

[0217] Optionally, the requirement information for virtual machines includes at least one of the following: specification information of a single virtual machine, first indication information, affinity information between virtual machines, or anti-affinity information; wherein the first indication information is used to indicate the number of virtual machines.

[0218] Optionally, the affinity information between virtual machines is represented by a first array, which indicates the affinity level of the virtual machine and the number of virtual machines at the corresponding affinity level. The affinity level is a resource level in the cloud system.

[0219] Optionally, anti-affinity information between virtual machines is represented by a second array; wherein the second array is used to indicate the anti-affinity level of the virtual machine, and the anti-affinity level is the resource level in the cloud system.

[0220] Optionally, the first processing unit 902 is used to convert the demand information for virtual machines into a demand tree; wherein the demand tree is used to indicate the distribution of multiple virtual machines corresponding to the first request in at least one resource level of the cloud system, the resource level of the cloud system corresponds to the resource tree of the cloud system, and the resource tree is obtained based on multiple physical machines in the cloud system and the network topology of the multiple physical machines; based on the order of multiple virtual machines on the demand tree, the location information of the second virtual machine is determined based on the location information of the first virtual machine, and the first virtual machine is ordered as an adjacent virtual machine before the second virtual machine.

[0221] Optionally, the location information of the second virtual machine is the optimal location information based on the comprehensive score obtained from the location information of the first virtual machine. The comprehensive score is obtained based on at least one of the location score of the first virtual machine, the resource constraint score, the affinity constraint score, or the virtual machine affinity score.

[0222] Optionally, the resource constraint score includes at least one of a physical machine reservation score or a cluster reservation score, where the cluster is a resource level higher than the physical machine; the physical machine reservation score is positively correlated with the resource occupancy on a single physical machine, and the cluster reservation score is positively correlated with the resource occupancy on a single cluster.

[0223] Optionally, the affinity constraint score is used to indicate the penalty score when the affinity constraint or anti-affinity constraint is not satisfied. The penalty score tends to infinity and is used to filter out location information that does not satisfy the affinity constraint or anti-affinity constraint.

[0224] Optionally, the virtual machine correlation score is positively correlated with the degree of concentration of multiple virtual machines.

[0225] The relevant units of the resource scheduling device 90 can be understood by referring to the steps performed by the scheduling node described above, and will not be repeated here.

[0226] As shown in Figure 10, the resource scheduling device 100 provided in this embodiment can be a terminal device, and the resource scheduling device 100 includes:

[0227] The processing unit 1001 is configured to respond to a first operation on the user interface to generate a first request; wherein the first operation is an operation to fill in or select information about the virtual machine's requirements.

[0228] The sending unit 1002 is used to send a first request to the cloud system. The first request includes demand information for virtual machines. The demand information for virtual machines is used by the cloud system to schedule the first virtual machine according to the location information of the first virtual machine, and to schedule the second virtual machine according to the location information of the second virtual machine. The location information of the second virtual machine is determined based on the location information of the first virtual machine.

[0229] Optionally, the user interface includes a field for each affinity level in the first array, where the field is used to specify the number of virtual machines corresponding to the affinity level.

[0230] Optionally, the user interface includes fill fields for a second array, which are used to fill in the anti-affinity level of the virtual machine.

[0231] The relevant units of the resource scheduling device 100 described above can be understood by referring to the steps performed by the terminal device introduced earlier, and will not be repeated here.

[0232] Figure 11 is a schematic diagram of a possible logical structure of the resource scheduling device provided in an embodiment of this application. This resource scheduling device can be the scheduling node in the above embodiments, or it can be a terminal device. As shown in Figure 11, the resource scheduling device 110 provided in this embodiment includes: a processor 1101, a communication interface 1102, a memory 1103, and a bus 1104. The processor 1101, the communication interface 1102, and the memory 1103 are interconnected via the bus 1104.

[0233] In the embodiments of this application, the processor 1101 is used to control and manage the operations of the resource scheduling device 110. For example, the processor 1101 is used to determine the location information of the first virtual machine and the location information of the second virtual machine corresponding to the first request based on the virtual machine demand information and the information of multiple physical machines in the cloud system. The communication interface 1102 is used to support the resource scheduling device 110 in communication. For example, the communication interface 1102 can execute the process of sending encrypted data. The memory 1103 is used to store the program code and data of the resource scheduling device 110.

[0234] The processor 1101 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, etc. The bus 1104 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one thick line is used in Figure 11, but this does not indicate that there is only one bus or one type of bus.

[0235] The computer device provided in this application embodiment can also be understood as the resource scheduling device described in FIG11 above.

[0236] In another embodiment of this application, a computer-readable storage medium is also provided, which stores computer-executable instructions. When the processor of the resource scheduling device executes the computer-executable instructions, the resource scheduling device performs the steps performed by the scheduling node or terminal device in Figures 3 to 8.

[0237] In another embodiment of this application, a computer program product is also provided, which includes computer program code. When the computer program code is executed on a computer, the computer device performs the steps performed by the scheduling node or terminal device in Figures 3 to 8.

[0238] In another embodiment of this application, a chip system is also provided, comprising one or more interface circuits and one or more processors; the interface circuits and processors are interconnected via lines; the interface circuits are used to receive signals from the memory of a resource scheduling device and send signals to the processors, the signals including computer instructions stored in the memory; when the processor executes the computer instructions, the resource scheduling device performs the steps performed by the scheduling nodes or terminal devices in Figures 3 to 8 above. In one possible design, the chip system may further include a memory for storing necessary program instructions and data of the resource scheduling device. This chip system may be composed of chips or may include chips and other discrete devices.

[0239] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

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

[0241] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented wholly or partially through software, hardware, firmware, or any combination thereof.

[0242] When the integrated unit is implemented using software, it can be implemented in whole or in part as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0243] In this application, the terms "system" and "network" are used interchangeably. "Multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, "at least one of A, B, and C" includes A, B, C, AB, AC, BC, or ABC. And, unless otherwise specified, the ordinal numbers such as "first" and "second" mentioned in this application are used to distinguish multiple objects and are not used to limit the order, sequence, priority, or importance of multiple objects.

[0244] In the embodiments of this application, "send" and "receive" indicate the direction of signal transmission. For example, "send information to XX" can be understood as the destination of the information being XX, which may include direct transmission via the air interface or indirect transmission via the air interface by other units or modules. "Receive information from YY" can be understood as the source of the information being YY, which may include direct reception from YY via the air interface or indirect reception from YY via the air interface by other units or modules. "Send" can also be understood as the "output" of the chip interface, and "receive" can also be understood as the "input" of the chip interface.

[0245] In other words, sending and receiving can occur between devices, such as between network devices and terminal devices, or within a device, such as between components, modules, chips, software modules, or hardware modules within the device via buses, wiring, or interfaces.

[0246] It is understandable that information may undergo necessary processing, such as encoding and modulation, between the source and destination, but the destination can understand the valid information from the source. Similar statements in this application can be interpreted in a similar way and will not be elaborated further.

[0247] In the embodiments of this application, "instruction" can include direct and indirect instructions, as well as explicit and implicit instructions. The information indicated by a certain piece of information (hereinafter referred to as instruction information) is called the information to be instructed. In specific implementation, there are many ways to indicate the information to be instructed, such as, but not limited to, directly indicating the information to be instructed, such as the information to be instructed itself or its index. It can also indirectly indicate the information to be instructed by indicating other information, where there is an association between the other information and the information to be instructed; or it can indicate only a part of the information to be instructed, while the other parts are known or pre-agreed upon. For example, the instruction can be implemented by using a pre-agreed (e.g., protocol predefined) arrangement of various information, thereby reducing the instruction overhead to a certain extent. This application does not limit the specific method of instruction. It is understood that for the sender of the instruction information, the instruction information can be used to indicate the information to be instructed; for the receiver of the instruction information, the instruction information can be used to determine the information to be instructed.

[0248] In this application, unless otherwise specified, the same or similar parts between the various embodiments can be referred to each other. In the various embodiments of this application, and the various methods / designs / implementations within each embodiment, unless otherwise specified or logically conflicting, the terminology and / or descriptions between different embodiments and between the various methods / designs / implementations within each embodiment are consistent and can be mutually referenced. The technical features in different embodiments and the various methods / designs / implementations within each embodiment can be combined to form new embodiments, methods, or implementations based on their inherent logical relationships. The following descriptions of the embodiments of this application do not constitute a limitation on the scope of protection of this application.

Claims

1. A method of resource scheduling, the method comprising: include: Obtain a first request, which includes information about the virtual machine's requirements; Based on the virtual machine demand information and the information of multiple physical machines in the cloud system, the location information of the first virtual machine and the location information of the second virtual machine corresponding to the first request are determined; wherein, the location information of the second virtual machine is determined based on the location information of the first virtual machine, and the first virtual machine and the second virtual machine are located in at least one of the multiple physical machines; The first virtual machine is scheduled based on its location information, and the second virtual machine is scheduled based on its location information.

2. The method of claim 1, wherein, The virtual machine requirement information includes at least one of the following: specification information of a single virtual machine, first indication information, affinity information between virtual machines, or anti-affinity information; wherein, the first indication information is used to indicate the number of virtual machines.

3. The method according to claim 2, characterized in that, The affinity information between the virtual machines is represented by a first array, wherein the first array is used to indicate the affinity level of the virtual machine and the number of virtual machines at the corresponding affinity level, and the affinity level is a resource level in the cloud system.

4. The method according to claim 2 or 3, characterized in that, The anti-affinity information between the virtual machines is represented by a second array; wherein the second array is used to indicate the anti-affinity level of the virtual machine, and the anti-affinity level is the resource level in the cloud system.

5. The method according to claim 2 or 3, characterized in that, The step of determining the location information of the first virtual machine and the location information of the second virtual machine corresponding to the first request based on the virtual machine demand information and the information of multiple physical machines in the cloud system includes: The virtual machine demand information is converted into a demand tree; wherein, the demand tree is used to indicate the distribution of multiple virtual machines corresponding to the first request at at least one resource level in the cloud system, the resource level of the cloud system corresponds to the resource tree of the cloud system, and the resource tree is obtained based on multiple physical machines in the cloud system and the network topology of the multiple physical machines; Based on the order of the multiple virtual machines on the demand tree, the position information of the second virtual machine is determined based on the position information of the first virtual machine, and the first virtual machine is the adjacent virtual machine that precedes the second virtual machine.

6. The method according to claim 5, characterized in that, The location information of the second virtual machine is the optimal location information based on the comprehensive score obtained from the location information of the first virtual machine. The comprehensive score is obtained based on at least one of the location score, resource constraint score, affinity constraint score, or virtual machine affinity score of the first virtual machine.

7. The method according to claim 6, characterized in that, The resource constraint score includes at least one of a physical machine reservation score or a cluster reservation score, wherein the cluster is a resource level higher than the physical machine; the physical machine reservation score is positively correlated with the resource occupancy level on the individual physical machine, and the cluster reservation score is positively correlated with the resource occupancy level on the individual cluster.

8. The method according to claim 6 or 7, characterized in that, The affinity constraint score is used to indicate the penalty score when the affinity constraint or anti-affinity constraint is not satisfied. The penalty score tends to infinity and is used to filter out position information that does not satisfy the affinity constraint or the anti-affinity constraint.

9. The method according to any one of claims 6-8, characterized in that, The virtual machine correlation score is positively correlated with the degree of concentration of the multiple virtual machines.

10. A method for resource scheduling, characterized in that, include: A first request is generated in response to a first operation on the user interface; wherein the first operation is an operation to fill in or select information about the virtual machine's requirements. The cloud system sends the first request, which includes the virtual machine demand information. The virtual machine demand information is used by the cloud system to schedule the first virtual machine based on the location information of the first virtual machine, and to schedule the second virtual machine based on the location information of the second virtual machine, wherein the location information of the second virtual machine is determined based on the location information of the first virtual machine.

11. The method according to claim 10, characterized in that, The virtual machine requirement information includes at least one of the following: specification information of a single virtual machine, first indication information, affinity information between virtual machines, or anti-affinity information; wherein, the first indication information is used to indicate the number of virtual machines.

12. The method according to claim 11, characterized in that, The affinity information between the virtual machines is represented by a first array, wherein the first array is used to indicate the affinity level of the virtual machine and the number of virtual machines at the corresponding affinity level, and the affinity level is a resource level in the cloud system.

13. The method according to claim 11 or 12, characterized in that, The anti-affinity information between the virtual machines is represented by a second array; wherein the second array is used to indicate the anti-affinity level of the virtual machine, and the anti-affinity level is the resource level in the cloud system.

14. The method according to claim 12 or 13, characterized in that, The user interface includes a field for each affinity level in the first array, whereby the field is used to fill in the number of virtual machines corresponding to the affinity level.

15. The method according to claim 13, characterized in that, The user interface includes fill fields for the second array, which are used to fill in the anti-affinity level of the virtual machine.

16. A resource scheduling device, characterized in that, include: An acquisition unit is used to acquire a first request, wherein the first request includes demand information for a virtual machine; The first processing unit is configured to determine the location information of a first virtual machine and a second virtual machine corresponding to the first request based on the virtual machine demand information and the information of multiple physical machines in the cloud system; wherein the location information of the second virtual machine is determined based on the location information of the first virtual machine, and the first virtual machine and the second virtual machine are located in at least one of the multiple physical machines; The second processing unit is configured to schedule the first virtual machine based on the location information of the first virtual machine, and to schedule the second virtual machine based on the location information of the second virtual machine.

17. A resource scheduling device, characterized in that, include: A processing unit is configured to respond to a first operation on the user interface to generate a first request; wherein the first operation is an operation to fill in or select information about the virtual machine's requirements. The sending unit is configured to send the first request to the cloud system, the first request including the virtual machine demand information; the virtual machine demand information is used by the cloud system to schedule the first virtual machine according to the location information of the first virtual machine, and to schedule the second virtual machine according to the location information of the second virtual machine, the location information of the second virtual machine being determined based on the location information of the first virtual machine.

18. A resource scheduling device, characterized in that, Includes a processor and a computer-readable storage medium storing a computer program; The processor is coupled to the computer-readable storage medium, and when the computer program is executed by the processor, it implements the method as described in any one of claims 1 to 9, or the method as described in any one of claims 10 to 15.

19. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 9, or the method as described in any one of claims 10 to 15.

20. A computer program product, characterized in that, The computer program product includes computer program code that, when run on a computer device, implements the method as described in any one of claims 1 to 9, or implements the method as described in any one of claims 10 to 15.