WO2022247287A1 - Resource scheduling method and apparatus - Google Patents

Resource scheduling method and apparatus Download PDF

Info

Publication number
WO2022247287A1
WO2022247287A1 PCT/CN2021/143561 CN2021143561W WO2022247287A1 WO 2022247287 A1 WO2022247287 A1 WO 2022247287A1 CN 2021143561 W CN2021143561 W CN 2021143561W WO 2022247287 A1 WO2022247287 A1 WO 2022247287A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
resources
capability
allocatable
server
Prior art date
Application number
PCT/CN2021/143561
Other languages
French (fr)
Chinese (zh)
Inventor
周文礼
苏利
赵鹏翔
杨纳川
Original Assignee
华为云计算技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2022247287A1 publication Critical patent/WO2022247287A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)

Abstract

Disclosed are a resource scheduling method and apparatus. The method is as follows: receiving a first virtual machine (VM) request, wherein the first VM request is used for requesting to allocate a resource of a specified specification to a target VM; selecting a target server from within a first candidate server set, wherein the resource issuance capability variation amount of of the target server is not greater than the resource issuance capability variation amount of any candidate server in the first candidate server set except for the target server; and allocating the resource of the specified specification among allocatable resources of the target server to the target VM, wherein the target server is one server having the smallest reduction in the ability to allocate resources of various specifications before and after allocating the resource of the specified specification. Therefore, when the allocatable resources of other servers remain unchanged, the ability to allocate the resources of various specifications may be retained to the maximum extent for the entire first candidate server set.

Description

一种资源调度方法及装置A resource scheduling method and device
相关申请的交叉引用Cross References to Related Applications
本申请要求在2021年05月27日提交中国专利局、申请号为202110586962.X、申请名称为“一种资源调度方法及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中;本申请要求在2021年07月31日提交中国专利局、申请号为202110876658.9、申请名称为“一种资源调度方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110586962.X and the application title "A Resource Scheduling Method and System" submitted to the China Patent Office on May 27, 2021, the entire contents of which are incorporated herein by reference In the process of application; this application claims the priority of the Chinese patent application submitted to the China Patent Office on July 31, 2021, the application number is 202110876658.9, and the application name is "A Resource Scheduling Method and Device", the entire content of which is incorporated by reference in In this application.
技术领域technical field
本申请涉及云计算领域,尤其涉及一种资源调度方法及装置。The present application relates to the field of cloud computing, and in particular to a resource scheduling method and device.
背景技术Background technique
云计算领域中,数据中心的资源管理系统需要对数据中心中服务器的资源进行有效管理。其中,资源调度是数据中心的资源管理的一个重要组成部分。其中,虚拟机(Virtual Machine,VM)的资源调度指,当用户需要向数据中心请求VM时,资源管理系统会收到VM请求,资源管理系统需要为这个VM请求分配相应集群及服务器上的资源,以供用户的VM。In the field of cloud computing, the resource management system of the data center needs to effectively manage the resources of the server in the data center. Among them, resource scheduling is an important part of resource management in a data center. Among them, virtual machine (Virtual Machine, VM) resource scheduling means that when a user needs to request a VM from the data center, the resource management system will receive the VM request, and the resource management system needs to allocate resources on the corresponding cluster and server for the VM request , for the user's VM.
目前的VM调度方法中,可能会收到请求各种规格资源的VM请求,然而这可能导致一些较大规格的资源难以被分配,这是一个亟待解决的问题。In the current VM scheduling method, VM requests for resources of various specifications may be received, but this may cause some resources of larger specifications to be difficult to be allocated, which is an urgent problem to be solved.
发明内容Contents of the invention
本申请提供一种资源调度方法及装置,用于提升较大规格的资源被分配的能力。The present application provides a resource scheduling method and device, which are used to improve the ability to allocate resources with larger specifications.
第一方面,本申请提供一种资源调度方法,该方法可以由本申请提供的资源调度装置执行,该资源调度装置可以为本申请提供的电子设备,该方法包括:接收第一虚拟机VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;从第一候选服务器集合中选取目标服务器,将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。In the first aspect, the present application provides a resource scheduling method, which can be executed by the resource scheduling device provided in the present application, and the resource scheduling device can be the electronic device provided in the present application, and the method includes: receiving a first virtual machine VM request, The first VM request is used to request allocation of resources of a specified specification for the target VM; selecting a target server from the first set of candidate servers, and allocating resources of the specified specification among the allocatable resources of the target server to the target VM.
其中,所述目标服务器的资源发放能力变化量不大于所述第一候选服务器集合中除所述目标服务器之外的任一候选服务器的资源发放能力变化量,所述任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力。Wherein, the change amount of the resource granting capability of the target server is not greater than the change amount of the resource granting capacity of any candidate server in the first candidate server set except the target server, and the resource granting capacity of any candidate server is The capability variation is the variation between the first resource issuance capability and the second resource issuance capability of the candidate server, the first resource issuance capability of any candidate server indicates the first allocable resource of the candidate server, and the The first allocatable resource is the allocatable resource before the candidate server is pre-allocated the resource of the specified specification, the second resource issuance capability of any candidate server indicates the second allocatable resource of the candidate server, and the first The second allocatable resource is the allocatable resource after the candidate server is pre-allocated the resource of the specified specification, and the resource issuance capability is used to represent the ability of the allocatable resource to allocate resources of various specifications.
上述方法中,接收第一虚拟机VM请求后,可以从至少两个服务器中选取目标服务器,由于所述目标服务器的资源发放能力变化量不大于所述第一候选服务器集合中除所述目标服务器之外的任一候选服务器的资源发放能力变化量,因此,目标服务器是在分配指定 规格的资源前后对各种规格的资源进行分配的能力降低程度最小的服务器之一,从而在其他服务器的可分配资源不变的情况下,对于整体的第一候选服务器集合而言,可以最大化保留对各种规格的资源进行分配的能力,因此,将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM,可以使得后续较大规格的资源更容易被分配。In the above method, after receiving the request from the first virtual machine VM, a target server may be selected from at least two servers, since the change in the resource provisioning capability of the target server is not greater than that of the first candidate server set except for the target server Therefore, the target server is one of the servers whose ability to allocate resources of various specifications decreases the least before and after allocating resources of a specified specification. Under the condition that the allocated resources remain unchanged, for the overall set of first candidate servers, the ability to allocate resources of various specifications can be reserved to the maximum extent. Therefore, the specified specifications in the allocated resources of the target server The resources allocated to the target VM can make it easier to allocate subsequent resources with larger specifications.
可选的,所述第一资源发放能力,可以按照以下方式得到:Optionally, the first resource issuance capability may be obtained in the following manner:
分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源对各种规格的资源进行分配的综合资源发放能力;Determining the ability of the first allocable resource to allocate resources of each specification in a single specification, and according to the ability of the first allocable resource to allocate resources of each specification in a single specification, determine the The first resource distribution capability of the first allocable resource, the first resource distribution capability represents the comprehensive resource distribution capability of the first allocable resource for allocating resources of various specifications;
以及所述第二资源发放能力,可以按照以下方式得到:And the second resource distribution capability can be obtained in the following manner:
分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源对各种规格的资源进行分配的综合资源发放能力。Determining the single-standard resource issuance capability of the second allocatable resources for allocating resources of each specification respectively, and determining the The second resource allocation capability of the second allocable resource, where the second resource allocation capability represents the comprehensive resource allocation capability of the second allocable resource for allocating resources of various specifications.
上述方式下,无论是第一资源发放能力和第二资源发放能力,都是基于可分配资源对每种规格的资源进行分配的单一规格资源发放能力来确定,从而能表征对各种规格的资源进行分配的综合资源发放能力,因此能更全面、准确地表征可分配资源的资源发放能力。In the above method, both the first resource distribution capability and the second resource distribution capability are determined based on the resource distribution capability of a single specification that can be allocated to resources of each specification, so that resources of various specifications can be represented The comprehensive resource issuance capability for allocation, so it can more comprehensively and accurately characterize the resource issuance capability of allocatable resources.
可选的,所述根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,包括:Optionally, the determining the first resource issuance capability of the first allocable resource according to the resource issuance capability of a single specification allocated to resources of each specification by the first allocable resource includes:
对所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第一可分配资源的第一资源发放能力;Accumulate or average the resource issuance capabilities of a single specification allocated by the first allocable resources to resources of each specification to obtain the first resource issuance capabilities of the first allocable resources;
所述根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,包括:The determining the second resource issuance capability of the second allocatable resource according to the resource distribution capability of a single specification for allocating resources of each specification according to the second allocable resource includes:
对所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第二可分配资源的第二资源发放能力。The second resource issuance capability of the second allocable resource is obtained by accumulating or averaging the resource issuance capabilities of a single specification allocated by the second allocatable resources to resources of each specification.
上述方式下,通过可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,可以对各种规格的单一规格资源发放能力的差异进行综合考虑及量化,从而能更全面、准确地表征可分配资源的资源发放能力。In the above method, by accumulating or averaging the distribution capabilities of single-specification resources assigned to resources of each specification through allocatable resources, the differences in the distribution capabilities of single-specification resources of various specifications can be comprehensively considered and quantified, so as to be more comprehensive. , Accurately characterize the resource issuance capability of the allocatable resources.
可选的所述第一VM请求所请求的所述指定规格的资源包括至少两种类型资源;Optionally, the resource of the specified specification requested by the first VM request includes at least two types of resources;
所述分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,包括:The separately determining the ability of the first allocatable resource to allocate resources of each specification with a single specification resource, according to the first allocable resource's resource allocation capability of a single specification to allocate resources of each specification, determine The first resource issuance capability of the first allocable resource includes:
分别确定所述第一可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力;Respectively determine the comprehensive resource distribution capability of each type of resource in the at least two types of resources in the first allocable resources to allocate the same type of resources of various specifications; The comprehensive resource allocation capability for the allocation of the same type of resources determines the first resource allocation capability of the first allocable resource, and the first resource allocation capability represents the pair of at least two types of resources in the first allocable resource Comprehensive resource distribution capabilities for allocating resources of various specifications;
所述分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,包括:The separately determining the single-standard resource distribution capability of the second allocable resources for allocating resources of each specification is determined according to the single-standard resource distribution capability of the second allocable resources for allocating resources of each specification. The second resource issuance capability of the second allocatable resource includes:
分别确定所述第二可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力。Respectively determine the comprehensive resource issuance capability of each type of resource in the at least two types of resources in the second allocatable resources to allocate the same type of resources of various specifications; A comprehensive resource allocation capability for the allocation of the same type of resources, determining a second resource allocation capability of the second allocatable resource, the second resource allocation capability characterizes the pair of at least two types of resources in the second allocatable resource Comprehensive resource distribution capabilities for allocating resources of various specifications.
上述方式下,当所述第一VM请求所请求的所述指定规格的资源包括至少两种类型资源时,通过每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定可分配资源综合的资源发放能力,从而全面考虑至少两种类型资源每种类型的综合资源发放能力,可以更全面、准确地表征可分配资源的资源发放能力。In the above manner, when the resource of the specified specification requested by the first VM request includes at least two types of resources, it is determined by the comprehensive resource allocation capability of each type of resource to allocate resources of the same type of various specifications. The comprehensive resource issuance capability of the allocatable resources, so as to comprehensively consider the comprehensive resource issuance capabilities of each type of at least two types of resources, and can more comprehensively and accurately characterize the resource issuance capabilities of the allocatable resources.
可选的,所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,包括:所述第一可分配资源对任一规格的资源进行分配的最大次数,或者所述第一可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积;所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,包括:所述第二可分配资源对任一规格的资源进行分配的最大次数,或者所述第二可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积。Optionally, the ability of the first allocatable resource to allocate resources of each specification for a single specification of resources includes: the maximum number of times the first allocatable resource allocates resources of any specification, or the The product of the maximum number of times the first allocatable resource allocates resources of any specification and the distribution capacity coefficient corresponding to the specification; the second allocatable resource allocates resources of each specification in a single specification resource issuance Capabilities, including: the maximum number of times the second allocatable resource allocates resources of any specification, or the maximum number of times the second allocatable resource allocates resources of any specification corresponds to any specification The product of the release capacity coefficients.
上述方式下,由于可分配资源对任一规格的资源进行分配的最大次数可以直观地体现出还能够分配该规格资源的能力,且任一规格有对应的发放能力系数,从而能够反映出不同规格的差异,通过资源进行分配的最大次数与对应的发放能力系数的乘积,将不同规格资源的发放能力的差异体现出来,从而得到更为准确、量化的资源发放能力结果。In the above method, since the maximum number of allocations that can be allocated to resources of any specification can intuitively reflect the ability to allocate resources of this specification, and any specification has a corresponding distribution capacity coefficient, which can reflect different specifications. By multiplying the maximum number of resource allocation times and the corresponding distribution capacity coefficient, the difference in the distribution capabilities of resources with different specifications is reflected, so as to obtain more accurate and quantitative results of resource distribution capabilities.
可选的,所述发放能力系数是预先设置的,或者,所述发放能力系数是根据至少一个第二VM请求调整得到的,所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。Optionally, the provisioning capability coefficient is preset, or the provisioning capability coefficient is adjusted according to at least one second VM request, and the at least one second VM request includes a VM request for which resource allocation has been completed and /or VM requests that have completed resource reclamation.
上述方式下,由于所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求,从而可以参照VM请求的资源分配情形设置,使得发放能力系数的设置更加合理,并且通过预先设置或至少一个第二VM请求调整得到发放能力系数,从而可以通过不同方式表现不同规格的重要程度,增加发放能力系数设置的灵活性。In the above manner, since the at least one second VM request includes a VM request that has completed resource allocation and/or a VM request that has completed resource recovery, it can be set with reference to the resource allocation situation of the VM request, so that the setting of the issuance capacity coefficient is more accurate. It is reasonable, and the delivery capability coefficient is obtained through preset setting or at least one second VM request adjustment, so that the importance of different specifications can be expressed in different ways, and the flexibility of setting the delivery capability coefficient can be increased.
可选的,所述方法还包括:Optionally, the method also includes:
获取所述至少一个第二VM请求;根据所述至少一个第二VM请求所请求分配和/或请求回收的资源的规格,确定根据所述至少一个第二VM请求所分配的各规格的资源占比;根据所述各规格的资源占比,调整各规格对应的发放能力系数,其中,调整后的任一规格对应的发放能力系数与根据所述至少一个第二VM请求所分配的该规格的资源占比呈正相关。Obtaining the at least one second VM request; according to the specifications of the resources requested to be allocated and/or requested to be reclaimed according to the at least one second VM request, determining the resource occupation of each specification allocated according to the at least one second VM request Ratio; according to the ratio of resources of each specification, adjust the distribution capability coefficient corresponding to each specification, wherein, the distribution capability coefficient corresponding to any specification after adjustment is the same as that allocated according to the at least one second VM request. The proportion of resources is positively correlated.
上述方式下,由于各规格的资源占比可以反映用户请求资源分配的需求,从而可以根据资源分配的需求设置各规格对应的发放能力系数,使得发放能力系数的设置更贴合用户资源分配的需求。In the above method, since the resource ratio of each specification can reflect the user's request for resource allocation, the distribution capacity coefficient corresponding to each specification can be set according to the resource allocation requirement, so that the setting of the distribution capacity coefficient is more suitable for the user's resource allocation needs .
可选的,所述根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,包括:Optionally, the determining the first resource issuance capability of the first allocable resource according to the resource issuance capability of a single specification allocated to resources of each specification by the first allocable resource includes:
根据所述任一候选服务器的第一可分配资源,查询资源发放能力评估表,得到所述第一可分配资源的第一资源发放能力;According to the first allocatable resource of any candidate server, query the resource distribution capability evaluation table to obtain the first resource distribution capability of the first allocatable resource;
所述根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力, 确定所述第二可分配资源的第二资源发放能力,包括:The determining the second resource issuance capability of the second allocable resource according to the resource distribution capability of a single specification for allocating resources of each specification according to the second allocable resource includes:
根据所述任一候选服务器的第二可分配资源,查询所述资源发放能力评估表,得到所述第二可分配资源的第二资源发放能力;According to the second allocatable resource of any candidate server, query the resource allocation capability evaluation table to obtain the second resource allocation capability of the second allocatable resource;
其中,所述资源发放能力评估表中的任一表项包括可分配资源和该可分配资源的资源发放能力,该可分配资源的资源发放能力是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力得到的,或者是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力以及该规格对应的资源发放能力系数得到的。Wherein, any item in the evaluation table of resource distribution capability includes allocatable resources and resource distribution capabilities of the allocatable resources. It can be obtained by assigning a single-specification resource issuance capability, or by assigning a single-specification resource issuance capability for resources of each specification based on the allocatable resource and the resource issuance capability coefficient corresponding to the specification.
上述方式下,所述资源发放能力评估表中的任一表项包括可分配资源和该可分配资源的资源发放能力,且该可分配资源的资源发放能力是根据单一规格资源发放能力,或者根据单一规格资源发放能力以及该规格对应的资源发放能力系数得到的,从而基于资源发放能力评估表预先计算完毕的表项,以及实时的可分配资源,直接查询资源发放能力评估表,即可得到相应的资源发放能力,从而在可分配资源获取后,省去了计算过程,提升了资源发放能力的获取效率。In the above manner, any item in the evaluation table of resource issuance capability includes allocatable resources and resource issuance capabilities of the allocatable resources, and the resource issuance capabilities of the allocatable resources are resource issuance capabilities based on a single specification, or according to The resource distribution capability of a single specification and the resource distribution capability coefficient corresponding to the specification are obtained. Based on the pre-calculated table items of the resource distribution capability evaluation table and real-time allocable resources, directly query the resource distribution capability evaluation table to obtain the corresponding The ability to issue resources, so that after the allocation of resources is obtained, the calculation process is omitted, and the acquisition efficiency of the ability to issue resources is improved.
可选的,所述任一候选服务器中包括至少一个资源集合,每个所述资源集合包括至少两个资源子集合;所述将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM,包括:Optionally, any of the candidate servers includes at least one resource set, and each of the resource sets includes at least two resource subsets; the allocation of resources of the specified specification among the allocatable resources of the target server For the target VM, include:
若所述目标服务器中存在第一资源子集合,则将所述第一资源子集合中的资源分配给所述目标VM;所述第一资源子集合的规格与所述指定规格相同,且资源未被分配;If there is a first subset of resources in the target server, allocate resources in the first subset of resources to the target VM; the specification of the first subset of resources is the same as the specified specification, and the resource not assigned;
若所述目标服务器中不存在所述第一资源子集合且存在第二资源子集合,则将所述第二资源子集合的剩余资源中所述指定规格的资源分配给所述目标VM;所述第二资源子集合为规格大于所述指定规格的资源子集合中最小规格的资源子集合,且所述第二资源子集合的资源被占用且剩余资源的规格不小于所述指定规格;If the first resource subset does not exist in the target server and there is a second resource subset, allocating the resources of the specified specification among the remaining resources of the second resource subset to the target VM; The second resource subset is a resource subset whose size is larger than the smallest size among the resource subsets of the specified size, and the resources of the second resource subset are occupied and the size of the remaining resources is not smaller than the specified size;
若所述目标服务器中不存在所述第一资源子集合且不存在所述第二资源子集合,且存在第三资源子集合,则将所述第三资源子集合中所述指定规格的资源分配给所述目标VM;所述第三资源子集合的规格与所述第二资源子集合的规格相同,且所述第三资源子集合的资源未被占用。If the first resource subset does not exist and the second resource subset does not exist in the target server, and there is a third resource subset, then the resources of the specified specification in the third resource subset allocated to the target VM; the specification of the third resource subset is the same as that of the second resource subset, and the resources of the third resource subset are not occupied.
上述方式下,对所述目标服务器的可分配资源进行分配时,按照第一资源子集合、第二资源子集合和第三资源子集合的优先次序查找,是否有满足条件的资源子集合,从而即便没有规格恰好匹配的第一资源子集合,也优先查找规格仅大于指定规格的第二资源子集合或第三资源子集合,而且优先查找已被破坏最大发放能力的第二资源子集合,从而尽可能保留大于指定规格的资源子集合的资源发放能力。In the above manner, when allocating the allocatable resources of the target server, it is searched according to the priority order of the first resource subset, the second resource subset and the third resource subset to see if there is a resource subset that meets the conditions, so that Even if there is no first resource subset whose specification exactly matches, the second resource subset or the third resource subset whose specification is only larger than the specified specification is preferentially searched, and the second resource subset whose maximum distribution capacity has been destroyed is preferentially searched, so that As far as possible, reserve the resource distribution capability of resource subsets larger than the specified specification.
可选的,所述方法还包括:Optionally, the method also includes:
若所述指定规格的资源大于预设规格阈值,且所述目标服务器中不存在所述第一资源子集合、所述第二资源子集合和所述第三资源子集合,则将所述目标服务器中至少两个第四资源子集合的资源分配给所述目标VM,所述至少两个第四资源子集合的剩余资源之和为所述指定规格的资源。If the resource of the specified specification is greater than the preset specification threshold, and the first resource subset, the second resource subset, and the third resource subset do not exist in the target server, the target The resources of at least two fourth resource subsets in the server are allocated to the target VM, and the sum of the remaining resources of the at least two fourth resource subsets is the resource of the specified specification.
上述方式下,若所述指定规格的资源大于预设规格阈值,即便按照第一资源子集合、第二资源子集合和第三资源子集合的优先次序查找,均不存在时,还可以将所述目标服务器中至少两个第四资源子集合的资源分配给所述目标VM,由于所述至少两个第四资源子集合的资源之和为所述指定规格的资源,所以通过至少两个第四资源子集合也是充分利用 了资源子集合。In the above method, if the resource of the specified specification is greater than the preset specification threshold, even if it is searched according to the priority order of the first resource subset, the second resource subset, and the third resource subset, none of them exist, the resources can also be The resources of at least two fourth resource subsets in the target server are allocated to the target VM. Since the sum of the resources of the at least two fourth resource subsets is the resource of the specified specification, through at least two fourth resource subsets The four resource subsets also make full use of the resource subsets.
可选的,所述方法还包括:Optionally, the method also includes:
根据至少一个第二VM请求的资源的规格和任一所述资源集合的规格,划分该资源集合的至少两个资源子集合的规格;所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。According to the specification of the resource requested by at least one second VM and the specification of any one of the resource sets, divide the specifications of at least two resource subsets of the resource set; the at least one second VM request includes VMs that have completed resource allocation VM requests that request and/or have completed resource reclamation.
上述方式下,可以使得至少两个资源子集合的规格设置与至少一个第二VM请求的资源分配需求更贴合。In the manner described above, the specification setting of at least two resource subsets can be made more consistent with the resource allocation requirement requested by at least one second VM.
可选的,所述从第一候选服务器集合中选取目标服务器之前,还包括:Optionally, before selecting the target server from the first set of candidate servers, it also includes:
根据所述第一VM请求所请求的所述指定规格的资源,以及第二候选服务器集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度;According to the resource of the specified specification requested by the first VM request, and the second allocatable resources of each candidate server in the second candidate server set, respectively determine the resource consumption of each candidate server in the second candidate server set Consistency index; wherein, the resource consumption consistency index of any candidate server in the second set of candidate servers characterizes the consumption ratio of at least two types of resources among the second allocatable resources of the candidate server and the consumption ratio of the candidate server the closeness of the proportions of at least two types of resources in the resource specification;
按照资源消耗一致性指数从高到低的顺序选取至少两个候选服务器,所述至少两个候选服务器形成所述第一候选服务器集合。At least two candidate servers are selected in descending order of the resource consumption consistency index, and the at least two candidate servers form the first candidate server set.
上述方式下,通过资源消耗一致性指数首先选取至少两个候选服务器,再从中选取目标服务器,从而使得目标服务器的选取不会受资源消耗一致性或资源发放能力中某一种因素的决定性影响,更合理地选取出目标服务器。In the above method, at least two candidate servers are first selected through the resource consumption consistency index, and then the target server is selected from them, so that the selection of the target server will not be decisively affected by a certain factor in resource consumption consistency or resource distribution capability. Select the target server more reasonably.
第二方面,本申请提供另一种资源调度方法,该方法可以由本申请提供的资源调度装置执行,该资源调度装置可以为本申请提供的电子设备,该方法包括:In the second aspect, the present application provides another resource scheduling method, which can be executed by the resource scheduling device provided in the present application, and the resource scheduling device can be the electronic device provided in the present application, and the method includes:
接收第一VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;确定第一候选服务器集合中各候选服务器的资源发放能力变化量;按照资源发放能力变化量从低到高的顺序选取至少两个候选服务器,所述至少两个候选服务器形成第二候选服务器集合;根据所述第一VM请求所请求的所述指定规格的资源,以及所述第二候选服务器集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;将资源消耗一致性指数最高的候选服务器作为目标服务器;将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。Receiving a first VM request, the first VM request is used to request allocation of resources of a specified specification for the target VM; determining the resource distribution capability variation of each candidate server in the first candidate server set; according to the resource distribution capability variation from low to Selecting at least two candidate servers in a high order, the at least two candidate servers form a second candidate server set; according to the resource of the specified specification requested by the first VM request, and the second candidate server set For the second allocatable resources of each candidate server, respectively determine the resource consumption consistency index of each candidate server in the second candidate server set; use the candidate server with the highest resource consumption consistency index as the target server; Resources of the specified specification in the allocatable resources are allocated to the target VM.
所述第一候选服务器集合中任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度。The resource issue capability variation of any candidate server in the first candidate server set is the variation between the first resource issue capability and the second resource issue capability of the candidate server, and the first resource issue of any candidate server The issuance capability indicates the first allocable resource of the candidate server, the first allocable resource is the allocatable resource before the candidate server is pre-allocated the resource of the specified specification, and the second resource of any candidate server is issued The capability indicates the second allocatable resource of the candidate server, the second allocatable resource is the allocatable resource after the candidate server is pre-allocated the resource of the specified specification, and the resource issuance capability is used to characterize the pair of allocatable resources The ability to allocate resources of various specifications; wherein, the resource consumption consistency index of any candidate server in the second candidate server set represents the consumption of at least two types of resources in the second allocatable resources of the candidate server How close the ratio is to the ratio of at least two types of resources in the candidate server's resource specification.
上述方式下,通过资源发放能力变化量首先选取至少两个候选服务器,再从中根据资源消耗一致性指数选取目标服务器,从而使得目标服务器的选取不会受资源消耗一致性指数或资源发放能力中某一种因素的决定性影响,更合理地选取出目标服务器。In the above method, at least two candidate servers are first selected based on the resource distribution capability variation, and then the target server is selected according to the resource consumption consistency index, so that the selection of the target server will not be affected by the resource consumption consistency index or the resource distribution capability. The decisive influence of one factor makes it more reasonable to select the target server.
需要说明的是,上述资源调度方法中,确定第一候选服务器集合中各候选服务器的资 源发放能力变化量的具体方式,可以参考第一方面提出的资源调度方法中的确定方式,在此不再赘述。It should be noted that, in the above resource scheduling method, the specific way of determining the variation of the resource issuance capability of each candidate server in the first candidate server set can refer to the determination method in the resource scheduling method proposed in the first aspect, and will not be repeated here. repeat.
第三方面,本申请提供一种资源调度装置,包括:In a third aspect, the present application provides a resource scheduling device, including:
接收模块,用于接收第一虚拟机VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;A receiving module, configured to receive a first virtual machine VM request, where the first VM request is used to request allocation of resources of a specified specification for the target VM;
处理模块,用于从第一候选服务器集合中选取目标服务器,所述目标服务器的资源发放能力变化量不大于所述第一候选服务器集合中除所述目标服务器之外的任一候选服务器的资源发放能力变化量,所述任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;A processing module, configured to select a target server from the first set of candidate servers, the amount of change in the resource issuance capability of the target server is not greater than the resources of any candidate server in the first set of candidate servers except the target server The amount of change in the resource issuance capability of any candidate server is the variation between the first resource issuance capability and the second resource issuance capability of the candidate server, and the first resource issuance capability of any candidate server is Capability indicates the first allocatable resource of the candidate server, the first allocatable resource is the allocatable resource before the candidate server is pre-allocated the resource of the specified specification, and the second resource issuance capability of any candidate server Indicates the second allocatable resource of the candidate server, where the second allocatable resource is the allocatable resource after the candidate server is pre-allocated the resource of the specified specification, and the resource issuance capability is used to represent the impact of the allocatable resource on each The ability to allocate resources of various sizes;
分配模块,用于将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。An allocating module, configured to allocate resources of the specified specification among the allocatable resources of the target server to the target VM.
可选的,所述处理模块具体用于:Optionally, the processing module is specifically used for:
按照以下方式得到所述第一资源发放能力:The first resource issuance capability is obtained in the following manner:
分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源对各种规格的资源进行分配的综合资源发放能力;Determining the ability of the first allocable resource to allocate resources of each specification in a single specification, and according to the ability of the first allocable resource to allocate resources of each specification in a single specification, determine the The first resource distribution capability of the first allocable resource, the first resource distribution capability represents the comprehensive resource distribution capability of the first allocable resource for allocating resources of various specifications;
按照以下方式得到所述第二资源发放能力:The second resource issuance capability is obtained in the following manner:
分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源对各种规格的资源进行分配的综合资源发放能力。Determining the single-standard resource issuance capability of the second allocatable resources for allocating resources of each specification respectively, and determining the The second resource allocation capability of the second allocable resource, where the second resource allocation capability represents the comprehensive resource allocation capability of the second allocable resource for allocating resources of various specifications.
可选的,所述处理模块具体用于:Optionally, the processing module is specifically used for:
按照以下方式确定所述第一可分配资源的第一资源发放能力:The first resource issuance capability of the first allocable resource is determined in the following manner:
对所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第一可分配资源的第一资源发放能力;Accumulate or average the resource issuance capabilities of a single specification allocated by the first allocable resources to resources of each specification to obtain the first resource issuance capabilities of the first allocable resources;
按照以下方式确定所述第二可分配资源的第二资源发放能力:The second resource issuance capability of the second allocatable resource is determined in the following manner:
对所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第二可分配资源的第二资源发放能力。The second resource issuance capability of the second allocable resource is obtained by accumulating or averaging the resource issuance capabilities of a single specification allocated by the second allocatable resources to resources of each specification.
可选的,所述第一VM请求所请求的所述指定规格的资源包括至少两种类型资源;所述处理模块具体用于:Optionally, the resource of the specified specification requested by the first VM request includes at least two types of resources; the processing module is specifically configured to:
按照以下方式确定所述第一可分配资源的第一资源发放能力:The first resource issuance capability of the first allocable resource is determined in the following manner:
分别确定所述第一可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;Respectively determining the comprehensive resource issuance capability of each type of resource of the at least two types of resources in the first allocable resources for allocating resources of the same type with various specifications;
根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确 定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力;According to the comprehensive resource distribution capability of each type of resource for allocating resources of the same type with various specifications, the first resource distribution capability of the first allocatable resource is determined, and the first resource distribution capability represents the first The ability to allocate comprehensive resources to resources of various specifications for at least two types of resources mentioned in the allocatable resources;
按照以下方式确定所述第二可分配资源的第二资源发放能力:The second resource issuance capability of the second allocatable resource is determined in the following manner:
分别确定所述第二可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;Respectively determining the comprehensive resource distribution capability of each type of resource in the at least two types of resources in the second allocable resources for allocating resources of the same type with various specifications;
根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力。According to the comprehensive resource distribution capability of each type of resource for allocating resources of the same type with various specifications, the second resource distribution capability of the second allocatable resource is determined, and the second resource distribution capability represents the second The at least two types of resources in the allocatable resources are capable of allocating resources of various specifications.
可选的,所述处理模块具体用于:Optionally, the processing module is specifically used for:
按照以下方式确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力:The resource issuance capability of a single specification for allocating resources of each specification by the first allocable resource is determined in the following manner:
所述第一可分配资源对任一规格的资源进行分配的最大次数,或者所述第一可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积;The maximum number of times that the first allocable resource allocates resources of any specification, or the maximum number of times that the first allocatable resource allocates resources of any specification is equal to the distribution capability coefficient corresponding to the specification product;
按照以下方式确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力:The resource issuance capability of a single specification for the second allocatable resource to allocate resources of each specification is determined in the following manner:
所述第二可分配资源对任一规格的资源进行分配的最大次数,或者所述第二可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积。The maximum number of times the second allocatable resources are allocated to resources of any specification, or the maximum number of times the second allocatable resources are allocated to resources of any specification is the ratio of the distribution capacity coefficient corresponding to any specification product.
可选的,所述发放能力系数是预先设置的,或者,所述发放能力系数是根据至少一个第二VM请求调整得到的,所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。Optionally, the provisioning capability coefficient is preset, or the provisioning capability coefficient is adjusted according to at least one second VM request, and the at least one second VM request includes a VM request for which resource allocation has been completed and /or VM requests that have completed resource reclamation.
可选的,所述处理模块还用于:Optionally, the processing module is also used for:
获取所述至少一个第二VM请求;obtain the at least one second VM request;
根据所述至少一个第二VM请求所请求分配和/或请求回收的资源的规格,确定根据所述至少一个第二VM请求所分配的各规格的资源占比;According to the specifications of the resources requested to be allocated and/or reclaimed according to the at least one second VM request, determine the proportion of resources of each specification allocated according to the at least one second VM request;
根据所述各规格的资源占比,调整各规格对应的发放能力系数,其中,调整后的任一规格对应的发放能力系数与根据所述至少一个第二VM请求所分配的该规格的资源占比呈正相关。According to the resource proportion of each specification, adjust the distribution capability coefficient corresponding to each specification, wherein, the distribution capability coefficient corresponding to any specification after adjustment is different from the resource ratio of the specification allocated according to the at least one second VM request. The ratio is positively correlated.
可选的,所述处理模块具体用于:Optionally, the processing module is specifically used for:
按照以下方式确定所述第一可分配资源的第一资源发放能力:The first resource issuance capability of the first allocable resource is determined in the following manner:
根据所述任一候选服务器的第一可分配资源,查询资源发放能力评估表,得到所述第一可分配资源的第一资源发放能力;According to the first allocatable resource of any candidate server, query the resource distribution capability evaluation table to obtain the first resource distribution capability of the first allocatable resource;
按照以下方式确定所述第二可分配资源的第二资源发放能力:The second resource issuance capability of the second allocatable resource is determined in the following manner:
根据所述任一候选服务器的第二可分配资源,查询所述资源发放能力评估表,得到所述第二可分配资源的第二资源发放能力;According to the second allocatable resource of any candidate server, query the resource allocation capability evaluation table to obtain the second resource allocation capability of the second allocatable resource;
其中,所述资源发放能力评估表中的任一表项包括可分配资源和该可分配资源的资源发放能力,该可分配资源的资源发放能力是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力得到的,或者是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力以及该规格对应的资源发放能力系数得到的。Wherein, any item in the evaluation table of resource distribution capability includes allocatable resources and resource distribution capabilities of the allocatable resources. It can be obtained by assigning a single-specification resource issuance capability, or by assigning a single-specification resource issuance capability for resources of each specification based on the allocatable resource and the resource issuance capability coefficient corresponding to the specification.
可选的,所述任一候选服务器中包括至少一个资源集合,每个所述资源集合包括至少两个资源子集合;所述分配模块具体用于:Optionally, any of the candidate servers includes at least one resource set, and each of the resource sets includes at least two resource subsets; the allocation module is specifically configured to:
若所述目标服务器中存在第一资源子集合,则将所述第一资源子集合中的资源分配给所述目标VM;所述第一资源子集合的规格与所述指定规格相同,且资源未被分配;If there is a first subset of resources in the target server, allocate resources in the first subset of resources to the target VM; the specification of the first subset of resources is the same as the specified specification, and the resource not assigned;
若所述目标服务器中不存在所述第一资源子集合且存在第二资源子集合,则将所述第二资源子集合的剩余资源中所述指定规格的资源分配给所述目标VM;所述第二资源子集合为规格大于所述指定规格的资源子集合中最小规格的资源子集合,且所述第二资源子集合的资源被占用且剩余资源的规格不小于所述指定规格;If the first resource subset does not exist in the target server and there is a second resource subset, allocating the resources of the specified specification among the remaining resources of the second resource subset to the target VM; The second resource subset is a resource subset whose size is larger than the smallest size among the resource subsets of the specified size, and the resources of the second resource subset are occupied and the size of the remaining resources is not smaller than the specified size;
若所述目标服务器中不存在所述第一资源子集合且不存在所述第二资源子集合,且存在第三资源子集合,则将所述第三资源子集合中所述指定规格的资源分配给所述目标VM;所述第三资源子集合的规格与所述第二资源子集合的规格相同,且所述第三资源子集合的资源未被占用。If the first resource subset does not exist and the second resource subset does not exist in the target server, and there is a third resource subset, then the resources of the specified specification in the third resource subset allocated to the target VM; the specification of the third resource subset is the same as that of the second resource subset, and the resources of the third resource subset are not occupied.
可选的,所述分配模块还用于:Optionally, the allocation module is also used for:
若所述指定规格的资源大于预设规格阈值,且所述目标服务器中不存在所述第一资源子集合、所述第二资源子集合和所述第三资源子集合,则将所述目标服务器中至少两个第四资源子集合的资源分配给所述目标VM,所述至少两个第四资源子集合的剩余资源之和为所述指定规格的资源。If the resource of the specified specification is greater than the preset specification threshold, and the first resource subset, the second resource subset, and the third resource subset do not exist in the target server, the target The resources of at least two fourth resource subsets in the server are allocated to the target VM, and the sum of the remaining resources of the at least two fourth resource subsets is the resource of the specified specification.
可选的,所述分配模块还用于:Optionally, the allocation module is also used for:
根据至少一个第二VM请求的资源的规格和任一所述资源集合的规格,划分该资源集合的至少两个资源子集合的规格;所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。According to the specification of the resource requested by at least one second VM and the specification of any one of the resource sets, divide the specifications of at least two resource subsets of the resource set; the at least one second VM request includes VMs that have completed resource allocation VM requests that request and/or have completed resource reclamation.
可选的,从第一候选服务器集合中选取目标服务器之前,所述处理模块还用于:Optionally, before selecting a target server from the first set of candidate servers, the processing module is further configured to:
根据所述第一VM请求所请求的所述指定规格的资源,以及第二候选服务器集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度;According to the resource of the specified specification requested by the first VM request, and the second allocatable resources of each candidate server in the second candidate server set, respectively determine the resource consumption of each candidate server in the second candidate server set Consistency index; wherein, the resource consumption consistency index of any candidate server in the second set of candidate servers characterizes the consumption ratio of at least two types of resources among the second allocatable resources of the candidate server and the consumption ratio of the candidate server the closeness of the proportions of at least two types of resources in the resource specification;
按照资源消耗一致性指数从高到低的顺序选取至少两个候选服务器,所述至少两个候选服务器形成所述第一候选服务器集合。At least two candidate servers are selected in descending order of the resource consumption consistency index, and the at least two candidate servers form the first candidate server set.
第四方面,本申请提供另一种资源调度装置,包括:接收模块,用于接收第一VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;In a fourth aspect, the present application provides another resource scheduling device, including: a receiving module, configured to receive a first VM request, and the first VM request is used to request allocation of resources of a specified specification for a target VM;
处理模块,用于确定第一候选服务器集合中各候选服务器的资源发放能力变化量;所述第一候选服务器集合中任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;以及A processing module, configured to determine the variation in resource issuance capability of each candidate server in the first candidate server set; the variation in resource issuance capability of any candidate server in the first candidate server set is the first resource issuance capability of the candidate server and the second resource issuance capability, the first resource issuance capability of any candidate server indicates the first allocable resource of the candidate server, and the first allocatable resource is pre-allocated by the candidate server Allocatable resources before the resource of the specified specification, the second resource issuance capability of any candidate server indicates the second allocatable resource of the candidate server, and the second allocatable resource is the candidate server that is pre-allocated by the Allocatable resources after resources of specified specifications, the resource issuance capability is used to represent the ability of allocatable resources to allocate resources of various specifications; and
用于按照资源发放能力变化量从低到高的顺序选取至少两个候选服务器,所述至少两个候选服务器形成第二候选服务器集合;以及Selecting at least two candidate servers according to the order of resource issue capability variation from low to high, and the at least two candidate servers form a second set of candidate servers; and
用于根据所述第一VM请求所请求的所述指定规格的资源,以及所述第二候选服务器 集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度;It is used to determine each candidate in the second candidate server set according to the resource of the specified specification requested by the first VM request and the second allocatable resources of each candidate server in the second candidate server set. The resource consumption consistency index of the server; wherein, the resource consumption consistency index of any candidate server in the second candidate server set characterizes the consumption ratio of at least two types of resources among the second allocatable resources of the candidate server and The closeness of the proportions of at least two types of resources in the resource specification of the candidate server;
还用于将资源消耗一致性指数最高的候选服务器作为目标服务器;It is also used to use the candidate server with the highest resource consumption consistency index as the target server;
分配模块,用于将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。An allocating module, configured to allocate resources of the specified specification among the allocatable resources of the target server to the target VM.
可选的,所述处理模块具体用于:Optionally, the processing module is specifically used for:
按照以下方式得到所述第一资源发放能力:The first resource issuance capability is obtained in the following manner:
分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源对各种规格的资源进行分配的综合资源发放能力;Determining the ability of the first allocable resource to allocate resources of each specification in a single specification, and according to the ability of the first allocable resource to allocate resources of each specification in a single specification, determine the The first resource distribution capability of the first allocable resource, the first resource distribution capability represents the comprehensive resource distribution capability of the first allocable resource for allocating resources of various specifications;
按照以下方式得到所述第二资源发放能力:The second resource issuance capability is obtained in the following manner:
分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源对各种规格的资源进行分配的综合资源发放能力。Determining the single-standard resource issuance capability of the second allocatable resources for allocating resources of each specification respectively, and determining the The second resource allocation capability of the second allocable resource, where the second resource allocation capability represents the comprehensive resource allocation capability of the second allocable resource for allocating resources of various specifications.
可选的,所述处理模块还用于:Optionally, the processing module is also used for:
获取所述至少一个第二VM请求;obtain the at least one second VM request;
根据所述至少一个第二VM请求所请求分配和/或请求回收的资源的规格,确定根据所述至少一个第二VM请求所分配的各规格的资源占比;According to the specifications of the resources requested to be allocated and/or reclaimed according to the at least one second VM request, determine the proportion of resources of each specification allocated according to the at least one second VM request;
根据所述各规格的资源占比,调整各规格对应的发放能力系数,其中,调整后的任一规格对应的发放能力系数与根据所述至少一个第二VM请求所分配的该规格的资源占比呈正相关。According to the resource proportion of each specification, adjust the distribution capability coefficient corresponding to each specification, wherein, the distribution capability coefficient corresponding to any specification after adjustment is different from the resource ratio of the specification allocated according to the at least one second VM request. The ratio is positively correlated.
可选的,所述处理模块具体用于:Optionally, the processing module is specifically used for:
按照以下方式确定所述第一可分配资源的第一资源发放能力:The first resource issuance capability of the first allocable resource is determined in the following manner:
根据所述任一候选服务器的第一可分配资源,查询资源发放能力评估表,得到所述第一可分配资源的第一资源发放能力;According to the first allocatable resource of any candidate server, query the resource distribution capability evaluation table to obtain the first resource distribution capability of the first allocatable resource;
按照以下方式确定所述第二可分配资源的第二资源发放能力:The second resource issuance capability of the second allocatable resource is determined in the following manner:
根据所述任一候选服务器的第二可分配资源,查询所述资源发放能力评估表,得到所述第二可分配资源的第二资源发放能力;According to the second allocatable resource of any candidate server, query the resource allocation capability evaluation table to obtain the second resource allocation capability of the second allocatable resource;
其中,所述资源发放能力评估表中的任一表项包括可分配资源和该可分配资源的资源发放能力,该可分配资源的资源发放能力是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力得到的,或者是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力以及该规格对应的资源发放能力系数得到的。Wherein, any item in the evaluation table of resource distribution capability includes allocatable resources and resource distribution capabilities of the allocatable resources. It can be obtained by assigning a single-specification resource issuance capability, or by assigning a single-specification resource issuance capability for resources of each specification based on the allocatable resource and the resource issuance capability coefficient corresponding to the specification.
可选的,所述任一候选服务器中包括至少一个资源集合,每个所述资源集合包括至少两个资源子集合;所述分配模块具体用于:Optionally, any of the candidate servers includes at least one resource set, and each of the resource sets includes at least two resource subsets; the allocation module is specifically configured to:
若所述目标服务器中存在第一资源子集合,则将所述第一资源子集合中的资源分配给所述目标VM;所述第一资源子集合的规格与所述指定规格相同,且资源未被分配;If there is a first subset of resources in the target server, allocate resources in the first subset of resources to the target VM; the specification of the first subset of resources is the same as the specified specification, and the resource not assigned;
若所述目标服务器中不存在所述第一资源子集合且存在第二资源子集合,则将所述第二资源子集合的剩余资源中所述指定规格的资源分配给所述目标VM;所述第二资源子集合为规格大于所述指定规格的资源子集合中最小规格的资源子集合,且所述第二资源子集合的资源被占用且剩余资源的规格不小于所述指定规格;If the first resource subset does not exist in the target server and there is a second resource subset, allocating the resources of the specified specification among the remaining resources of the second resource subset to the target VM; The second resource subset is a resource subset whose size is larger than the smallest size among the resource subsets of the specified size, and the resources of the second resource subset are occupied and the size of the remaining resources is not smaller than the specified size;
若所述目标服务器中不存在所述第一资源子集合且不存在所述第二资源子集合,且存在第三资源子集合,则将所述第三资源子集合中所述指定规格的资源分配给所述目标VM;所述第三资源子集合的规格与所述第二资源子集合的规格相同,且所述第三资源子集合的资源未被占用。If the first resource subset does not exist and the second resource subset does not exist in the target server, and there is a third resource subset, then the resources of the specified specification in the third resource subset allocated to the target VM; the specification of the third resource subset is the same as that of the second resource subset, and the resources of the third resource subset are not occupied.
第五方面,本申请提供另一种电子设备,所述电子设备包括:一个或多个处理器;一个或多个存储器;其中,所述一个或多个存储器存储有一个或多个计算机指令,当所述一个或多个计算机指令被所述一个或多个处理器执行时,使得所述电子设备执行如上述第一方面或第二方面中任一项所述的方法。In a fifth aspect, the present application provides another electronic device, which includes: one or more processors; one or more memories; wherein, the one or more memories store one or more computer instructions, When the one or more computer instructions are executed by the one or more processors, the electronic device is made to execute the method as described in any one of the first aspect or the second aspect above.
第六方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质包括计算机指令,当所述计算机指令在计算机上运行时,使得所述计算机执行如上述第一方面或第二方面中任一项所述的方法。In a sixth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium includes computer instructions, and when the computer instructions are run on a computer, the computer executes the above-mentioned first or second aspect. The method of any one of the aspects.
以上第二方面到第六方面的有益效果,请参见第一方面的有益效果,不重复赘述。For the beneficial effects of the above second aspect to the sixth aspect, please refer to the beneficial effects of the first aspect, and will not be repeated.
附图说明Description of drawings
图1为本申请实施例提供的一种资源调度方法的流程示意图;FIG. 1 is a schematic flowchart of a resource scheduling method provided in an embodiment of the present application;
图2为本申请实施例提供的一种资源调度方法中资源集合以及资源子集合的划分示意图;FIG. 2 is a schematic diagram of division of resource sets and resource sub-sets in a resource scheduling method provided by an embodiment of the present application;
图3为本申请实施例提供的一种资源调度方法中资源发放能力评估表生成过程的示意图;FIG. 3 is a schematic diagram of a resource allocation capability evaluation table generation process in a resource scheduling method provided by an embodiment of the present application;
图4为本申请实施例提供的一种资源调度装置的结构示意图;FIG. 4 is a schematic structural diagram of a resource scheduling device provided in an embodiment of the present application;
图5为本申请实施例提供的一种电子设备结构示意图。FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请实施例中,“一个或多个”是指一个或两个以上(包含两个);“和/或”,描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The terms used in the following examples are for the purpose of describing particular examples only, and are not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also Expressions such as "one or more" are included unless the context clearly dictates otherwise. It should also be understood that in the embodiments of the present application, "one or more" refers to one or more than two (including two); "and/or" describes the association relationship of associated objects, indicating that there may be three relationships; For example, A and/or B may mean: A exists alone, A and B exist simultaneously, and B exists alone, wherein A and B may be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在 另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in this specification means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
本申请实施例中的术语多个”是指两个或两个以上,鉴于此,本申请实施例中也可以将“多个”理解为“至少两个”。“至少一个”,可理解为一个或多个,例如理解为一个、两个或更多个。例如,包括至少一个,是指包括一个、两个或更多个,而且不限制包括的是哪几个。例如,包括A、B和C中的至少一个,那么包括的可以是A、B、C,A和B,A和C,B和C,或A和B和C。同理,对于“至少一种”等描述的理解,也是类似的。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。The term "multiple" in the embodiments of the present application refers to two or more than two. In view of this, "multiple" can also be understood as "at least two" in the embodiments of the present application. "At least one" can be understood as One or more, such as being understood as one, two or more. For example, including at least one means including one, two or more, and does not limit which several are included. For example, including A, At least one of B and C, then it may include A, B, C, A and B, A and C, B and C, or A and B and C. Similarly, for "at least one" and other descriptions Understanding is also similar. "And/or" describes the relationship between associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone These three situations. In addition, the character "/", unless otherwise specified, generally indicates that the contextual objects are an "or" relationship.
除非有相反的说明,本申请实施例提及“第一”、“第二”等序数词用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。Unless otherwise specified, ordinal numerals such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects.
如图1所示,本发明实施例提供一种资源调度方法。As shown in FIG. 1 , an embodiment of the present invention provides a resource scheduling method.
步骤101:接收第一VM请求。Step 101: Receive a first VM request.
步骤102:从第一候选服务器集合中选取目标服务器。Step 102: Select a target server from the first set of candidate servers.
步骤103:将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。Step 103: Allocate resources of the specified specification among the allocatable resources of the target server to the target VM.
步骤101中的所述第一VM请求用于请求为目标VM分配指定规格的资源。The first VM request in step 101 is used to request allocation of resources of a specified specification for the target VM.
需要说明的是,本申请实施例中出现的资源(如目标服务器的可分配资源、指定规格的资源)指物理资源,如中央处理器(Central Processing Unit,CPU)的处理核、内存和带宽,资源可以为单一类型的,也可以是多种类型的组合。本申请实施例出现的规格(如指定规格)用于描述资源的数量,举例来说,指定规格的资源可以为2U(即表示2个处理核)、4U(即表示4个处理核)的处理核,也可以为100G的内存,为10M带宽等;指定规格的资源也可以是多种类型资源的组合,如指定规格的资源为2U、50G和5M。It should be noted that the resources (such as the allocatable resources of the target server and the resources of specified specifications) appearing in the embodiments of the present application refer to physical resources, such as the processing core, memory and bandwidth of a central processing unit (Central Processing Unit, CPU), A resource can be of a single type or a combination of multiple types. The specifications (such as specified specifications) appearing in the embodiment of this application are used to describe the quantity of resources. For example, the resources of specified specifications can be 2U (that is, 2 processing cores), 4U (that is, 4 processing cores) processing The core can also be 100G memory, 10M bandwidth, etc.; the resources with specified specifications can also be a combination of multiple types of resources, such as 2U, 50G, and 5M resources with specified specifications.
需要说明的是,任一候选服务器的资源可以划分资源集合,从而更利于对候选服务器资源分配的规划。具体来说,所述任一候选服务器中包括至少一个资源集合,每个所述资源集合包括至少两个资源子集合,可以规定指定规格的资源的分配限制为:将多个资源子集合的全部资源分配指定规格的资源,或者只将一个资源子集合的全部或部分资源分配给指定规格的资源。并且,还可以设置指定规格以及至少两个资源子集合的规格都可以是预先规定的一种规格,举例来说,预先只规定了2U、4U、8U、16U和32U的规格,那么指定规格只能是2U、4U、8U、16U和32U中的一种,如指定规格为2U,至少两个资源子集合的规格只能是2U、4U、8U、16U和32U中的至少两种,如至少两个资源子集合的规格为2U、4U、8U、16U。It should be noted that the resources of any candidate server can be divided into resource sets, which is more conducive to the planning of candidate server resource allocation. Specifically, any of the candidate servers includes at least one resource set, and each of the resource sets includes at least two resource subsets, and it can be stipulated that the allocation of resources with a specified specification is limited to: all of the multiple resource subsets Resources allocate resources of a specified specification, or allocate all or part of resources of a resource subset to resources of a specified specification. Moreover, it is also possible to set the specified specification and the specification of at least two resource subsets can be a predetermined specification. For example, only the specifications of 2U, 4U, 8U, 16U, and 32U are specified in advance, then the specified specification only It can be one of 2U, 4U, 8U, 16U, and 32U. If the specified specification is 2U, the specifications of at least two resource subsets can only be at least two of 2U, 4U, 8U, 16U, and 32U. If at least The specifications of the two resource subsets are 2U, 4U, 8U, and 16U.
需要说明的是,至少两个资源子集合的规格设置方式可以有多种,如预设两个资源子集合的规格,还可以按照如下方式设置:It should be noted that there are many ways to set the specifications of at least two resource sub-collections. For example, the specifications of the two resource sub-collections can be preset as follows:
根据至少一个第二VM请求的资源的规格和任一所述资源集合的规格,划分该资源集合的至少两个资源子集合的规格。According to the specification of the resource requested by at least one second VM and the specification of any resource set, divide the specifications of at least two resource subsets of the resource set.
所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。The at least one second VM request includes a VM request that has completed resource allocation and/or a VM request that has completed resource reclamation.
举例来说,可以按照至少一个第二VM请求的资源的规格的对应比例和任一所述资源集合的规格,确定该资源集合的至少两个资源子集合的规格;如至少一个第二VM请求为10000条,任一所述资源集合的规格为50U,且至少一个第二VM请求的资源的规格中,16U、8U、4U以及2U的比例为1:2:3:3,所以可以设置相应的资源子集合的比例也为1:2:3:3,即在50U的资源集合中,设置1个16U的资源子集合、2个8U的资源子集合、3个4U的资源子集合、3个2U的资源子集合。For example, the specifications of at least two resource subsets of the resource collection may be determined according to the corresponding ratio of the specification of the resource requested by at least one second VM and the specification of any one of the resource collections; for example, at least one second VM requests 10,000, the specification of any resource set is 50U, and the ratio of 16U, 8U, 4U, and 2U among the resource specifications requested by at least one second VM is 1:2:3:3, so you can set the corresponding The ratio of the resource subsets is also 1:2:3:3, that is, in the 50U resource set, set one 16U resource subset, two 8U resource subsets, three 4U resource subsets, 3 A 2U resource subset.
一个候选服务器中具体的资源集合以及资源子集合的划分,可以如图2所示,图2所示的候选服务器中包括两个资源集合,每个资源集合包括1个2U的资源子集合、1个4U的资源子集合、1个8U的资源子集合和2个16U的资源子集合。The division of specific resource sets and resource subsets in a candidate server can be shown in Figure 2. The candidate server shown in Figure 2 includes two resource sets, and each resource set includes a 2U resource subset, 1 There are one 4U resource subset, one 8U resource subset and two 16U resource subsets.
步骤102中的所述目标服务器的资源发放能力变化量不大于所述第一候选服务器集合中除所述目标服务器之外的任一候选服务器的资源发放能力变化量,所述任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,也就是第二资源发放能力减去第一资源发放能力的差值。In step 102, the change amount of resource issuance capability of the target server is not greater than the change amount of resource issuance capability of any candidate server in the first candidate server set except the target server, and the change amount of any candidate server The variation in resource distribution capability is the variation between the first resource distribution capability and the second resource distribution capability of the candidate server, that is, the difference between the second resource distribution capability minus the first resource distribution capability.
所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力。The first resource issuing capability of any candidate server indicates the first allocatable resource of the candidate server, and the first allocatable resource is the allocatable resource before the candidate server is pre-allocated resources of the specified specification, so The second resource issuing capability of any of the candidate servers indicates the second allocatable resources of the candidate server, and the second allocatable resources are allocatable resources after the candidate server is pre-allocated resources of the specified specification, and the Resource provisioning capability is used to represent the ability of allocatable resources to allocate resources of various specifications.
其中,各种规格可以为任一候选服务器预先定义的可发放的所有规格,也可以是预先定义的可发放的所有规格中的一部分规格,另外,如候选服务器预先定义的可发放的所有规格包括2U、4U、8U和16U。Among them, various specifications can be all specifications that can be distributed in advance defined by any candidate server, or can be some specifications in all specifications that can be distributed in advance. In addition, all specifications that can be distributed in advance defined by candidate servers include 2U, 4U, 8U and 16U.
需要说明的是,第一资源发放能力指示第一可分配资源或第二资源发放能力指示第二可分配资源的指示方式,可以有多种,以第一资源发放能力为例,第一资源发放能力可以为第一可分配资源,也可以为根据第一可分配资源计算得到的数据,如第一可分配资源基于任一规格的资源可进行分配的最大次数。It should be noted that there may be multiple indication modes for the first resource allocation capability to indicate the first allocable resource or the second resource allocation capability to indicate the second allocable resource. Taking the first resource allocation capability as an example, the first resource allocation The capability may be the first allocable resource, or may be data calculated based on the first allocable resource, such as the maximum number of times the first allocable resource can be allocated based on a resource of any specification.
举例来说,针对于任一候选服务器,第一可分配资源为该候选服务器被预分配所述指定规格的资源前可分配的处理核数,为40U,40U对应的资源发放能力即为第一资源发放能力,指定规格的资源为4U,那么第二可分配资源为36U,36U对应的资源发放能力即为第二资源发放能力,具体来说,资源发放能力可以通过多种方式表征,如通过对某一规格的资源进行分配的最大次数,第一资源发放能力为5次,第二资源发放能力为4次。For example, for any candidate server, the first allocable resource is the number of processing cores that can be allocated before the candidate server is pre-allocated with resources of the specified specification, which is 40U, and the resource issuance capability corresponding to 40U is the first Resource distribution capability, if the resource of the specified specification is 4U, then the second allocable resource is 36U, and the resource distribution capability corresponding to 36U is the second resource distribution capability. Specifically, the resource distribution capability can be characterized in various ways, such as through The maximum number of allocations for a resource of a certain specification, the first resource distribution capacity is 5 times, and the second resource distribution capacity is 4 times.
当候选服务器的资源划分了资源集合以及资源子集合时,资源发放能力还需要考虑资源子集合的因素,如规定指定规格的资源的分配可以限制为:将多个资源子集合的全部资源分配指定规格的资源,或者只将一个资源子集合的全部或部分资源分配给指定规格的资源,那么对各种规格的资源进行分配的能力还需要受到资源子集合的影响,具体情形将在后面详细描述。When the resources of the candidate server are divided into resource collections and resource sub-collections, resource distribution capabilities also need to consider the factors of resource sub-collections. For example, the allocation of resources with specified specifications can be limited to: allocate all resources of multiple resource sub-collections to specified Specification resources, or only allocate all or part of resources of a resource subset to resources of a specified specification, then the ability to allocate resources of various specifications needs to be affected by resource subsets, the specific situation will be described in detail later .
另外,被预分配所述指定规格的资源并不是指已经分配了所述指定规格的资源,只是提前确定了指定规格的资源的分配方案,即,如果在第一可分配资源的基础上分配所述指定规格的资源,那么分配后剩余的资源便是第二可分配资源。另外,第一可分配资源和第二可分配资源既可以同时为同一种类型的资源,也可以同时为多种类型的资源,如第一可 分配资源和第二可分配资源可以均为处理核,第一可分配资源和第二可分配资源也可以均为处理核和内存的组合等。In addition, being pre-allocated the resource of the specified specification does not mean that the resource of the specified specification has been allocated, but the allocation scheme of the resource of the specified specification is determined in advance, that is, if the resource allocated on the basis of the first allocable resource resources with the specified specifications above, then the remaining resources after allocation are the second allocatable resources. In addition, the first allocatable resource and the second allocatable resource can be the same type of resource at the same time, and can also be multiple types of resources at the same time. For example, the first allocatable resource and the second allocatable resource can both be processing cores. , the first allocatable resource and the second allocatable resource may also be a combination of a processing core and a memory, or the like.
步骤102中的第一候选服务器集合可以是数据中心的全部服务器,也可以是在数据中心中的一部分服务器,举例来说,可以为资源满足预设要求(如内存大于100G)的服务器,也可以为按照预设规则筛选出的服务器。The first set of candidate servers in step 102 may be all servers in the data center, or a part of servers in the data center. Servers filtered out according to preset rules.
举例来说,步骤102中的第一候选服务器集合可以按照如下方式确定:For example, the first set of candidate servers in step 102 may be determined in the following manner:
根据所述第一VM请求所请求的所述指定规格的资源,以及第二候选服务器集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;按照资源消耗一致性指数从高到低的顺序选取至少两个候选服务器,所述至少两个候选服务器形成所述第一候选服务器集合。According to the resource of the specified specification requested by the first VM request, and the second allocatable resources of each candidate server in the second candidate server set, respectively determine the resource consumption of each candidate server in the second candidate server set Consistency index: select at least two candidate servers in descending order of resource consumption consistency index, and the at least two candidate servers form the first set of candidate servers.
其中,所述第一服务器集合中的服务器可以是数据中心的全部服务器,也可以是在数据中心中的一部分服务器,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度。按照资源消耗一致性指数从高到低的顺序选取至少两个候选服务器指,按资源消耗一致性指数从高到低排列的前N个候选服务器作为至少两个候选服务器,N为大于1的正整数。Wherein, the servers in the first server set may be all servers in the data center, or some servers in the data center, and the resource consumption consistency index of any candidate server in the second candidate server set represents How close is the consumed ratio of the at least two types of resources in the second allocatable resources of the candidate server to the ratio of the at least two types of resources in the resource specification of the candidate server. Select at least two candidate servers according to the order of resource consumption consistency index from high to low, and the top N candidate servers arranged according to resource consumption consistency index from high to low are at least two candidate servers, and N is a positive value greater than 1. integer.
举例来说,任一服务器的资源消耗一致性指数可以为该服务器的第一资源向量和第二资源向量的夹角的余弦值,第一资源向量为该服务器的资源总量中至少两种类型资源的比例对应的向量,第二资源向量为该服务器的第二可分配资源中至少两种类型资源的已消耗比例对应的向量。显然,第一资源向量和第二资源向量的夹角的余弦值越大,说明该夹角越小,说明服务器的第二可分配资源中至少两种类型资源的已消耗比例与该服务器的资源总量中至少两种类型资源的比例越接近。For example, the resource consumption consistency index of any server can be the cosine value of the angle between the first resource vector and the second resource vector of the server, and the first resource vector is at least two types of the total resources of the server A vector corresponding to the proportion of the resource, and the second resource vector is a vector corresponding to the consumed proportion of at least two types of resources among the second allocatable resources of the server. Obviously, the larger the cosine value of the angle between the first resource vector and the second resource vector, the smaller the angle is, and the consumed ratio of at least two types of resources in the second allocatable resource of the server is different from the resources of the server. The closer the proportion of at least two types of resources in the total is.
上述方式下,通过资源消耗一致性指数首先选取至少两个候选服务器,再从中选取目标服务器,从而使得目标服务器的选取不会受资源消耗一致性或资源发放能力中某一种因素的决定性影响,更合理地选取出目标服务器。In the above method, at least two candidate servers are first selected through the resource consumption consistency index, and then the target server is selected from them, so that the selection of the target server will not be decisively affected by a certain factor in resource consumption consistency or resource distribution capability. Select the target server more reasonably.
相应地,同样为了目标服务器的选取不受资源消耗一致性或资源发放能力中某一种因素的决定性影响,还可以通过如下方式选取出目标服务器:Correspondingly, in order that the selection of the target server will not be decisively affected by a certain factor in resource consumption consistency or resource distribution capability, the target server can also be selected in the following way:
确定第一候选服务器集合中各候选服务器的资源发放能力变化量;按照资源发放能力变化量从低到高的顺序选取至少两个候选服务器,所述至少两个候选服务器形成第二候选服务器集合;根据所述第一VM请求所请求的所述指定规格的资源,以及所述第二候选服务器集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;将资源消耗一致性指数最高的候选服务器作为目标服务器。Determining the variation of resource issuance capability of each candidate server in the first candidate server set; selecting at least two candidate servers according to the order of resource issuance capability variation from low to high, and the at least two candidate servers form a second candidate server set; According to the resource of the specified specification requested by the first VM request, and the second allocatable resources of each candidate server in the second candidate server set, respectively determine the resources of each candidate server in the second candidate server set Resource consumption consistency index; the candidate server with the highest resource consumption consistency index is used as the target server.
其中,按照资源发放能力变化量从低到高的顺序选取至少两个候选服务器指,按资源发放能力变化量从低到高排列的前M个候选服务器作为至少两个候选服务器,M为大于1的正整数。Among them, selecting at least two candidate servers according to the order of resource distribution capability change from low to high refers to the top M candidate servers arranged according to resource distribution capability change from low to high as at least two candidate servers, and M is greater than 1 positive integer of .
第一资源发放能力和第二资源发放能力可以有多种获得方式:There are multiple ways to obtain the first resource distribution ability and the second resource distribution ability:
第一资源发放能力和第二资源发放能力的第一种获得方式可以为:The first way to obtain the first resource distribution ability and the second resource distribution ability can be:
将所述第一可分配资源对第一规格的资源发放能力,作为所述第一可分配资源的第一 资源发放能力;将所述第二可分配资源对第一规格的资源发放能力,作为所述第二可分配资源的第二资源发放能力。其中,第一规格为大于指定规格。Taking the resource issuance capability of the first allocable resource for the first specification as the first resource issuance capability of the first allocable resource; taking the resource issuance capability of the second allocable resource for the first specification as A second resource issuance capability of the second allocatable resource. Wherein, the first specification is greater than the specified specification.
举例来说,指定规格为4U,第一规格为8U,且第一可分配资源为50U,第二可分配资源为46U,若用第一规格的资源可发放的最大次数表示第一规格的资源发放能力,那么第一资源发放能力为6次,第二资源发放能力为5次。For example, if the specified specification is 4U, the first specification is 8U, the first allocable resource is 50U, and the second allocable resource is 46U, if the resource of the first specification is represented by the maximum number of times that the resource of the first specification can be issued distribution ability, then the distribution ability of the first resource is 6 times, and the distribution ability of the second resource is 5 times.
第一资源发放能力和第二资源发放能力的第二种获得方式可以为:The second method of obtaining the first resource distribution ability and the second resource distribution ability can be:
所述第一资源发放能力,按照以下方式得到:The first resource distribution capability is obtained in the following manner:
分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源对各种规格的资源进行分配的综合资源发放能力;Determining the ability of the first allocable resource to allocate resources of each specification in a single specification, and according to the ability of the first allocable resource to allocate resources of each specification in a single specification, determine the The first resource distribution capability of the first allocable resource, the first resource distribution capability represents the comprehensive resource distribution capability of the first allocable resource for allocating resources of various specifications;
所述第二资源发放能力,按照以下方式得到:The second resource distribution capability is obtained in the following manner:
分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源对各种规格的资源进行分配的综合资源发放能力。Determining the single-standard resource issuance capability of the second allocatable resources for allocating resources of each specification respectively, and determining the The second resource allocation capability of the second allocable resource, where the second resource allocation capability represents the comprehensive resource allocation capability of the second allocable resource for allocating resources of various specifications.
由此可见,上述第一资源发放能力和第二资源发放能力综合考虑了对每种规格的资源进行分配的单一规格资源发放能力,从而更加全面、准确地反映了对各种规格的资源进行分配的综合资源发放能力。It can be seen that the above-mentioned first resource distribution capability and second resource distribution capability comprehensively consider the resource distribution capability of a single specification that allocates resources of each specification, thereby more comprehensively and accurately reflecting the allocation of resources of various specifications. comprehensive resource distribution capabilities.
第二种获得方式中,根据第一可分配资源或第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,获得第一资源发放能力或第二资源发放能力的具体计算方式可以有多种:In the second acquisition method, the specific calculation method for obtaining the first resource distribution capability or the second resource distribution capability is based on the resource distribution capability of a single specification that allocates resources of each specification according to the first allocable resource or the second allocatable resource. There can be many kinds:
第一种计算方式:The first calculation method:
对所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第一可分配资源的第一资源发放能力;对所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第二可分配资源的第二资源发放能力。Accumulate or average the resource issuance capabilities of a single specification allocated by the first allocable resources to resources of each specification to obtain the first resource issuance capabilities of the first allocable resources; The resource issuance capabilities of a single specification assigned to resources of each specification are accumulated or averaged to obtain the second resource issuance capabilities of the second allocatable resources.
需要说明的是,可分配资源对每种规格的资源进行分配的单一规格资源发放能力的确定方式也可以有多种:It should be noted that there are also multiple ways to determine the ability to issue resources of a single specification for allocating resources to allocate resources of each specification:
第一种单一规格资源发放能力的确定方式:The first way to determine the ability to issue resources with a single specification:
所述第一可分配资源对任一规格的资源发放能力为:所述第一可分配资源对任一规格的资源进行分配的最大次数,或者所述第一可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积;The ability of the first allocable resource to issue resources of any specification is: the maximum number of times the first allocable resource allocates resources of any specification, or the first allocable resource allocates resources of any specification The product of the maximum number of distributions and the distribution capacity coefficient corresponding to any specification;
所述第二可分配资源对任一规格的资源发放能力为:所述第二可分配资源对任一规格的资源进行分配的最大次数,或者所述第二可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积。The ability of the second allocatable resource to issue resources of any specification is: the maximum number of times the second allocatable resource allocates resources of any specification, or the second allocatable resource allocates resources of any specification The product of the maximum number of distributions and the distribution capacity coefficient corresponding to any specification.
举例来说,当确定方式为所述第一可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积时,指定规格为2U,第一可分配资源为46U,第二可分配资源为44U,各种规格为2U、4U、8U和16U,第一可分配资源对2U对应的 资源进行分配的最大次数为23,4U对应的资源进行分配的最大次数为11,8U对应的资源进行分配的最大次数为5,16U对应的资源进行分配的最大次数为2,且2U对应的发放能力系数为2,4U对应的发放能力系数为5,8U对应的发放能力系数为12,16U对应的发放能力系数为30,那么所述第一可分配资源对各种规格的资源发放能力如下:2U对应的资源发放能力为46,4U对应的资源发放能力为55,8U对应的资源发放能力为60,16U对应的资源发放能力为60。For example, when the determination method is the product of the maximum number of times the first allocatable resource allocates resources of any specification and the distribution capability coefficient corresponding to any specification, the specified specification is 2U, and the first allocatable resource The resource is 46U, the second allocable resource is 44U, and the various specifications are 2U, 4U, 8U, and 16U. The maximum number of times the first allocable resource allocates resources corresponding to 2U is 23, and the maximum number of resources corresponding to 4U is allocated The number of times is 11, the maximum number of allocations for resources corresponding to 8U is 5, the maximum number of allocations for resources corresponding to 16U is 2, and the distribution capacity coefficient corresponding to 2U is 2, the distribution capacity coefficient corresponding to 4U is 5, and the distribution capacity coefficient corresponding to 8U The distribution capability coefficient is 12, and the distribution capability coefficient corresponding to 16U is 30, then the resource distribution capabilities of the first allocable resource for various specifications are as follows: the resource distribution capability corresponding to 2U is 46, and the resource distribution capability corresponding to 4U is 55 , the resource distribution capability corresponding to 8U is 60, and the resource distribution capability corresponding to 16U is 60.
相应地,第一种计算方式中采用第一种单一规格资源发放能力的确定方式,且采用对所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加的方式时,第一资源发放能力为:Correspondingly, the first calculation method adopts the first method of determining the resource issuance capacity of a single specification, and adopts the method of accumulating the resource issuance capabilities of a single specification allocated by the first allocable resource to resources of each specification When , the first resource distribution capability is:
2*23+11*5+5*12+2*30=221。2*23+11*5+5*12+2*30=221.
同理可得,第二可分配资源对各种规格的资源发放能力如下:2U对应的资源发放能力为44,4U对应的资源发放能力为55,8U对应的资源发放能力为60,16U对应的资源发放能力为60;第二资源发放能力为:In the same way, the resource distribution capabilities of the second allocatable resource for various specifications are as follows: 2U corresponds to 44 resource distribution capabilities, 4U corresponds to 55 resource distribution capabilities, 8U corresponds to 60 resource distribution capabilities, and 16U corresponds to 60 resource distribution capabilities. The resource distribution ability is 60; the second resource distribution ability is:
2*22+11*5+5*12+2*30=219。2*22+11*5+5*12+2*30=219.
需要说明的是,当候选服务器的资源划分资源集合及资源子集合时,对于相同的可分配资源,可能会因为资源分配策略的不同,导致第一可分配资源、第二可分配资源对任一规格的资源进行分配的最大次数的不同,进而导致第一资源发放能力和第二资源发放能力的不同。It should be noted that when the resources of the candidate server are divided into resource sets and resource sub-sets, for the same allocatable resource, due to different resource allocation strategies, the first allocatable resource and the second allocatable resource may The difference in the maximum number of resource allocations according to the specification results in the difference between the first resource distribution capability and the second resource distribution capability.
举例来说,第一可分配资源为46U,均在1个资源集合中,这个资源集合包括1个2U的资源子集合、1个4U的资源子集合、1个8U的资源子集合、2个16U的资源子集合,指定规格的资源为2U,且规定指定规格的资源只能占用一个资源子集合的部分或全部资源,如占用1个完整的2U的资源子集合,或占用4U的资源子集合中2U的资源,但不能在2U的资源子集合中占用1U并在4U的资源子集合中占用1U。那么,当候选服务器的资源划分资源集合及资源子集合时,如何进行资源分配会影响第二可分配资源对任一规格的资源进行分配的最大次数,进而影响第二资源发放能力,如将2U的资源子集合的完整资源预分配为指定规格的资源时,第二资源发放能力为219,将4U的资源子集合中2U的资源预分配为指定规格的资源时,第二资源发放能力为214,其余资源分配的情形可依次类推。For example, the first allocable resource is 46U, all in one resource set, this resource set includes a 2U resource subset, a 4U resource subset, a 8U resource subset, 2 For a 16U resource subset, the resources of the specified specification are 2U, and it is stipulated that the resources of the specified specification can only occupy part or all of the resources of a resource subset, such as occupying a complete 2U resource subset, or occupying a 4U resource subset 2U of resources in a collection, but cannot occupy 1U in a 2U resource subset and occupy 1U in a 4U resource subset. Then, when the resources of the candidate server are divided into resource sets and resource sub-sets, how to allocate resources will affect the maximum number of times the second allocatable resource can be allocated to resources of any specification, which in turn will affect the ability to issue the second resource. For example, the 2U When pre-allocating the complete resources of the resource sub-set as resources of a specified specification, the second resource issuance capability is 219; when pre-allocating 2U resources in the 4U resource subset as resources of a specified specification, the second resource issuance capability is 214 , and the rest of resource allocation can be deduced in turn.
需要说明的是,第一种单一规格资源发放能力的确定方式具体实现可以有多种方式,具体如下:It should be noted that there are many ways to implement the first method of determining the ability to issue resources with a single specification, as follows:
第一种实现方式:The first implementation method:
根据所述任一候选服务器的第一可分配资源,查询资源发放能力评估表,得到所述第一可分配资源的第一资源发放能力;根据所述任一候选服务器的第二可分配资源,查询所述资源发放能力评估表,得到所述第二可分配资源的第二资源发放能力。According to the first allocatable resource of any candidate server, query the resource distribution capability evaluation table to obtain the first resource distribution capability of the first allocable resource; according to the second allocatable resource of any candidate server, Query the resource issuance capability evaluation table to obtain the second resource issuance capability of the second allocatable resource.
其中,所述资源发放能力评估表中的任一表项包括可分配资源和该可分配资源的资源发放能力,该可分配资源的资源发放能力是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力得到的,或者是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力以及该规格对应的资源发放能力系数得到的。Wherein, any item in the evaluation table of resource distribution capability includes allocatable resources and resource distribution capabilities of the allocatable resources. It can be obtained by assigning a single-specification resource issuance capability, or by assigning a single-specification resource issuance capability for resources of each specification based on the allocatable resource and the resource issuance capability coefficient corresponding to the specification.
也就是说,第一种实现方式是将每种可能的可分配资源和该可分配资源的资源发放能力预先计算好,并穷举出来,用资源发放能力评估表记录,举例来说,表项为(46U,221),(44U,219)等。显然这样可以得到直接查表得到第一资源发放能力和第二资源发放能力, 省去了计算过程,资源发放能力评估表具体可以如表1所示。That is to say, the first implementation method is to pre-calculate each possible allocable resource and the resource issuance capability of the allocatable resource, and enumerate them exhaustively, and use the resource issuance capability evaluation table to record, for example, table item For (46U, 221), (44U, 219) and so on. Obviously, in this way, the first resource distribution capability and the second resource distribution capability can be directly obtained by looking up the table, and the calculation process is omitted. The resource distribution capability evaluation table can be specifically shown in Table 1.
表1资源发放能力评估表Table 1 Evaluation Form of Resource Distribution Capability
可分配资源Allocatable resources 资源发放能力Resource distribution capability
……...  the
44U44U 219219
46U46U 221221
……... ……...
另外,当涉及到资源集合和资源子集合时,表项还可以包括资源子集合的参数,如用二进制数表示每个资源子集合的选取,每一位数表示对应的资源子集合中的资源预分配或不预分配,如1表示预分配,0表示不预分配;举例来说,资源子集合中,2U的资源子集合对应第1位二进制数,4U的资源子集合对应第2位二进制数,8U的资源子集合对应第3位二进制数,第1个16U的资源子集合对应第4位二进制数,第2个16U的资源子集合对应第5位二进制数,如01000表示预分配4U的资源子集合中的资源,10000表示预分配2U的资源子集合中的资源,那么表项可以为(44U,10000,219),(44U,01000,214)。当涉及到资源集合和资源子集合时,资源发放能力评估表具体可以如表2所示。In addition, when it comes to resource collections and resource sub-collections, the entry can also include parameters of resource sub-collections, such as using binary numbers to represent the selection of each resource sub-collection, and each digit represents the resource in the corresponding resource sub-collection Pre-allocation or no pre-allocation, such as 1 means pre-allocation, 0 means no pre-allocation; for example, in the resource subset, the resource subset of 2U corresponds to the first binary number, and the resource subset of 4U corresponds to the second binary number The 8U resource subset corresponds to the third binary number, the first 16U resource subset corresponds to the fourth binary number, and the second 16U resource subset corresponds to the fifth binary number, such as 01000 means pre-allocated 4U 10000 represents resources in the pre-allocated resource subset of 2U, then the entry can be (44U, 10000, 219), (44U, 01000, 214). When it comes to resource sets and resource sub-sets, the resource distribution capability evaluation form can be specifically shown in Table 2.
表2资源发放能力评估表Table 2 Evaluation Form of Resource Distribution Ability
可分配资源Allocatable resources 资源子集合的选取情形Selection of resource sub-collections 资源发放能力Resource distribution capability
……...  the  the
44U44U 0100001000 214214
44U44U 1000010000 219219
……...  the ……...
需要说明的是,资源集合和资源子集合的划分可以根据服务器的可分配的资源总量、预设的VM请求的规格集合(即用户允许请求资源规格的集合)、至少一条第二VM请求得到。因此,资源发放能力评估表生成过程可以如图3所示。It should be noted that the division of resource sets and resource sub-sets can be obtained according to the total amount of resources that can be allocated by the server, the preset set of specifications requested by the VM (that is, the set of resource specifications that the user allows to request), and at least one second VM request. . Therefore, the process of generating the evaluation form of resource distribution capability can be shown in FIG. 3 .
由服务器的可分配的资源总量、预设的VM请求的规格集合、至少一条第二VM请求得到确定资源子集合的划分,以及由至少一条第二VM请求确定各种规格对应的资源发放能力系数,进一步计算得到资源发放能力评估表。The division of resource subsets is determined by the total amount of resources that can be allocated by the server, the preset specification set of VM requests, and at least one second VM request, and the resource allocation capabilities corresponding to various specifications are determined by at least one second VM request The coefficient is further calculated to obtain the resource distribution capacity evaluation table.
第二种实现方式:The second implementation method:
存储每种规格对应的发放能力系数,当需要获得第一资源发放能力和第二资源发放能力时,按照第一种计算方式,根据实时的第一可分配资源、第二可分配资源以及每种规格对应的发放能力系数,实时计算第一资源发放能力和第二资源发放能力。Store the distribution capacity coefficient corresponding to each specification. When it is necessary to obtain the first resource distribution capacity and the second resource distribution capacity, according to the first calculation method, according to the real-time first allocable resource, the second allocable resource and each The distribution capacity coefficient corresponding to the specification calculates the distribution capacity of the first resource and the distribution capacity of the second resource in real time.
第一种单一规格资源发放能力的确定方式中发放能力系数的设置方式可以有多种,具体如下:There are many ways to set the distribution capacity coefficient in the first method of determining the distribution capacity of single-standard resources, as follows:
第一种设置方式:发放能力系数是预先设置的。The first setting method: the distribution capacity coefficient is preset.
举例来说,可以规定规格的重要程度,按照规格的重要程度设置发放能力系数,如规定规格的重要程度与规格的大小呈正相关。For example, the importance of specifications can be stipulated, and the distribution capacity coefficient can be set according to the importance of specifications. For example, it is stipulated that the importance of specifications is positively correlated with the size of specifications.
第二种设置方式:根据至少一个第二VM请求调整得到所述发放能力系数。The second setting manner: the issuance capacity coefficient is obtained through adjustment according to at least one second VM request.
所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回 收的VM请求。The at least one second VM request includes a VM request that has completed resource allocation and/or a VM request that has completed resource recovery.
第二种设置方式中,具体过程可以如下:In the second setting method, the specific process can be as follows:
获取所述至少一个第二VM请求;根据所述至少一个第二VM请求所请求分配和/或请求回收的资源的规格,确定根据所述至少一个第二VM请求所分配的各规格的资源占比;根据所述各规格的资源占比,调整各规格对应的发放能力系数。Obtaining the at least one second VM request; according to the specifications of the resources requested to be allocated and/or requested to be reclaimed according to the at least one second VM request, determining the resource occupation of each specification allocated according to the at least one second VM request ratio; according to the resource ratio of each specification, adjust the distribution capacity coefficient corresponding to each specification.
其中,调整后的任一规格对应的发放能力系数与根据所述至少一个第二VM请求所分配的该规格的资源占比呈正相关。Wherein, the adjusted delivery capacity coefficient corresponding to any specification is positively correlated with the resource ratio of the specification allocated according to the at least one second VM request.
举例来说,至少一个第二VM请求为10000条,16U、8U、4U以及2U的第二VM请求数量的比例为2:2:3:3(各规格的资源占比),可以根据各规格的资源占比,调整各规格对应的发放能力系数,如根据各规格的资源占比以及各规格的基准系数,调整各规格对应的发放能力系数,如16U、8U、4U以及2U的基准系数依次为8、4、2、1,则16U、8U、4U以及2U对应的发放能力系数为16、8、6、3。For example, at least one second VM request is 10,000, and the ratio of the number of second VM requests for 16U, 8U, 4U, and 2U is 2:2:3:3 (resource ratio of each specification), which can be determined according to each specification According to the resource ratio of each specification, adjust the distribution capacity coefficient corresponding to each specification. For example, adjust the distribution capacity coefficient corresponding to each specification according to the resource ratio of each specification and the benchmark coefficient of each specification. For example, the benchmark coefficients of 16U, 8U, 4U, and 2U are in order 8, 4, 2, 1, then the distribution capacity coefficients corresponding to 16U, 8U, 4U, and 2U are 16, 8, 6, and 3.
上述第二种设置方式还可以有多种方式,如获取所述至少一个第二VM请求中请求数量最多的规格,增加该规格对应的发放能力系数。The above-mentioned second setting method may also have multiple methods, such as obtaining the specification with the largest number of requests in the at least one second VM request, and increasing the delivery capability coefficient corresponding to the specification.
第二种单一规格资源发放能力的确定方式:The second way to determine the ability to issue resources with a single specification:
根据单一规格资源发放能力的最大可占用的资源总量表示该规格的资源发放能力。The maximum amount of resources that can be occupied according to the resource distribution capability of a single specification indicates the resource distribution capability of this specification.
举例来说,第一可分配资源为50U,指定规格的资源为4U,第二可分配资源为46U。那么单一规格资源发放能力的最大可占用的资源总量可以为:如2U,那么50U的第一可分配资源均可以都分配2U规格的资源,2U对应的资源发放能力便是50U,4U对应的资源发放能力为48U。那么第一可分配资源对各种规格的资源进行分配的单一规格资源发放能力为:2U对应的资源发放能力为50U、4U对应的资源发放能力为48U、8U对应的资源发放能力为48U、12U对应的资源发放能力为48U、16U对应的资源发放能力为48U;相应地,第二可分配资源对各种规格的资源进行分配的单一规格资源发放能力为:2U对应的资源发放能力为46U、4U对应的资源发放能力为44U、8U对应的资源发放能力为40U、12U对应的资源发放能力为36U、16U对应的资源发放能力为32U。For example, the first allocable resource is 50U, the resource of a specified specification is 4U, and the second allocable resource is 46U. Then the maximum amount of resources that can be occupied by a single-standard resource distribution capability can be: for example, 2U, then the first allocable resource of 50U can be allocated resources of 2U specification, and the resource distribution capability corresponding to 2U is 50U, and the resource distribution capability corresponding to 4U The resource provisioning capacity is 48U. Then the first allocatable resource allocates resources of various specifications. The resource distribution capability of a single specification is: the resource distribution capability corresponding to 2U is 50U, the resource distribution capability corresponding to 4U is 48U, and the resource distribution capability corresponding to 8U is 48U and 12U. The corresponding resource distribution capability is 48U, and the resource distribution capability corresponding to 16U is 48U; correspondingly, the resource distribution capability of a single specification for the allocation of resources of various specifications by the second allocable resource is: the resource distribution capability corresponding to 2U is 46U, The resource distribution capability corresponding to 4U is 44U, the resource distribution capability corresponding to 8U is 40U, the resource distribution capability corresponding to 12U is 36U, and the resource distribution capability corresponding to 16U is 32U.
第一种计算方式中采用第二种单一规格资源发放能力的确定方式,且采用对所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加的方式时,所以第一资源发放能力为242U,相应地,第二资源发放能力为198U。When the first calculation method adopts the second method of determining the resource issuance capacity of a single specification, and adopts the method of accumulating the resource issuance capabilities of a single specification allocated by the first allocable resource to resources of each specification, so The first resource distribution capability is 242U, and correspondingly, the second resource distribution capability is 198U.
需要说明的是,针对第二种单一规格资源发放能力的确定方式,当候选服务器的资源划分资源集合及资源子集合时,对于相同的可分配资源,仍然可能会因为资源分配策略的不同,导致第二可分配资源对任一规格的资源发放能力的不同,进而导致第一资源发放能力和第二资源发放能力的不同,具体例子可参照上述第一种单一规格资源发放能力的确定方式,在此不再赘述。It should be noted that, for the second method of determining the ability to issue resources with a single specification, when the resources of the candidate server are divided into resource sets and resource sub-sets, for the same allocatable resources, it may still be caused by different resource allocation strategies. The difference between the second allocatable resource's ability to issue resources of any specification will lead to the difference between the first resource's ability to issue and the second resource's ability to issue. For a specific example, refer to the above-mentioned method for determining the ability to issue resources of a single specification. This will not be repeated here.
第二种计算方式:The second calculation method:
将第一可分配资源对各种规格的资源进行分配的单一规格资源发放能力中预设次序的资源发放能力,作为第一资源发放能力;将第二可分配资源对各种规格的资源进行分配的单一规格资源发放能力中预设次序的资源发放能力,作为第二资源发放能力。Use the resource distribution capability of the preset order in the resource distribution capability of a single specification that allocates resources of various specifications by the first allocable resource as the first resource distribution capability; allocate the second allocable resource to resources of various specifications The resource distribution capabilities of the preset sequence in the resource distribution capabilities of a single specification are used as the second resource distribution capabilities.
第二种计算方式中针对单一规格资源发放能力的计算,既可以采用第一种单一规格资 源发放能力的确定方式,也可以采用第二种单一规格资源发放能力的确定方式。In the second calculation method, the calculation of the ability to issue resources of a single specification can either use the first method for determining the ability to issue resources with a single specification, or the method for determining the ability to issue resources with a single specification.
举例来说,预设次序的资源发放能力为可分配资源对各种规格的资源进行分配的单一规格资源发放能力按从大到小顺序排列的中位数。当第一可分配资源为50U,采用第二种单一规格资源发放能力的确定方式时,第一资源发放能力为48U,第二资源发放能力为40U。For example, the resource distribution capability in the preset order is the median of the resource distribution capabilities of a single specification that can be allocated to resources of various specifications in descending order. When the first allocable resource is 50U and the second method for determining the resource distribution capability of a single specification is adopted, the first resource distribution capability is 48U, and the second resource distribution capability is 40U.
第二种计算方式中,当候选服务器的资源划分资源集合及资源子集合时,对于相同的可分配资源,仍然可能会因为资源分配策略的不同,导致第一资源发放能力和第二资源发放能力不同,具体例子可参照第一种计算方式的描述,在此不再赘述。In the second calculation method, when the resources of the candidate server are divided into resource sets and resource sub-sets, for the same allocatable resource, the first resource allocation ability and the second resource allocation ability may still be caused by different resource allocation strategies. Different, for specific examples, refer to the description of the first calculation method, which will not be repeated here.
需要说明的是,上述第二种获得方式中,指定规格的资源既可以是一种类型资源,也可能涉及多种类型资源,当所述第一VM请求所请求的所述指定规格的资源包括至少两种类型资源时,第一资源发放能力和第二资源发放能力的获得方式具体可以如下:It should be noted that, in the above-mentioned second obtaining method, the resource of a specified specification may be one type of resource, or may involve multiple types of resources. When the resource of the specified specification requested by the first VM request includes When there are at least two types of resources, the specific ways to obtain the first resource distribution ability and the second resource distribution ability can be as follows:
第一资源发放能力的获得方式为:The way to obtain the first resource distribution ability is:
分别确定所述第一可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第一可分配资源的第一资源发放能力。Respectively determine the comprehensive resource distribution capability of each type of resource in the at least two types of resources in the first allocable resources to allocate the same type of resources of various specifications; The comprehensive resource allocation capability of resources of the same type is determined to determine the first resource allocation capability of the first allocatable resource.
所述第一资源发放能力表征所述第一可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力。The first resource allocation capability represents the comprehensive resource allocation capability of the at least two types of resources among the first allocatable resources for allocating resources of various specifications.
第二资源发放能力的获得方式为:The way to obtain the second resource distribution ability is:
分别确定所述第二可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第二可分配资源的第二资源发放能力。Respectively determine the comprehensive resource issuance capability of each type of resource in the at least two types of resources in the second allocatable resources to allocate the same type of resources of various specifications; The comprehensive resource allocation capability of resources of the same type is determined to determine the second resource allocation capability of the second allocatable resource.
所述第二资源发放能力表征所述第二可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力。The second resource allocation capability represents the comprehensive resource allocation capability of the at least two types of resources among the second allocatable resources for allocating resources of various specifications.
对于至少两种资源类型的情况,针对每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,都可以按照上述第二获得方式中任一种资源发放能力的计算方式获得,再根据每种类型资源的综合资源发放能力,确定第一资源发放能力或第二资源发放能力,不同类型资源的综合资源发放能力的计算方式既可以相同,也可以不同。另外,可以通过对不同类型资源的综合资源发放能力进行加权平均或累加或选取其中最大的综合资源发放能力等方式,获得第一资源发放能力或第二资源发放能力。举例来说,至少两种类型资源为CPU的处理核、内存和带宽,CPU的处理核和内存的综合资源发放能力采用第一种计算方式获得,带宽可采用第二种计算方式获得,可以设置CPU的处理核的权重值较高,如4,设置内存和带宽的权重值较低,如2,对CPU的处理核、内存以及带宽的综合资源发放能力进行加权平均,获得第一资源发放能力或第二资源发放能力。For the case of at least two types of resources, the comprehensive resource distribution capability of allocating resources of the same type with various specifications for each type of resource can be obtained according to the calculation method of any resource distribution capability in the second acquisition method above, Then, according to the comprehensive resource distribution capability of each type of resource, the first resource distribution capability or the second resource distribution capability is determined. The calculation methods of the comprehensive resource distribution capabilities of different types of resources may be the same or different. In addition, the first resource distribution capability or the second resource distribution capability can be obtained by weighting the average or accumulation of the comprehensive resource distribution capabilities of different types of resources, or selecting the largest comprehensive resource distribution capability among them. For example, at least two types of resources are CPU processing cores, memory, and bandwidth. The comprehensive resource distribution capability of CPU processing cores and memory is obtained by the first calculation method, and the bandwidth can be obtained by the second calculation method. You can set The weight value of the processing core of the CPU is relatively high, such as 4, and the weight value of memory and bandwidth is set to be low, such as 2, and the comprehensive resource distribution capabilities of the processing core, memory and bandwidth of the CPU are weighted and averaged to obtain the first resource distribution capability Or the ability to issue secondary resources.
当服务器中的资源划分了资源集合以及资源子集合时,步骤103具体可以如下:When the resources in the server are divided into resource sets and resource sub-sets, step 103 can be specifically as follows:
步骤1031:若所述目标服务器中存在第一资源子集合,则将所述第一资源子集合中的资源分配给所述目标VM。Step 1031: If there is a first resource subset in the target server, allocate resources in the first resource subset to the target VM.
所述第一资源子集合的规格与所述指定规格相同,且资源未被分配。The size of the first subset of resources is the same as the specified size, and the resources are not allocated.
步骤1032:若所述目标服务器中不存在所述第一资源子集合且存在第二资源子集合,则将所述第二资源子集合的剩余资源中所述指定规格的资源分配给所述目标VM。Step 1032: If the first resource subset does not exist and the second resource subset exists in the target server, allocate resources of the specified specification in the remaining resources of the second resource subset to the target VM.
所述第二资源子集合为规格大于所述指定规格的资源子集合中最小规格的资源子集合,且所述第二资源子集合的资源被占用且剩余资源的规格不小于所述指定规格。The second resource subset is a resource subset whose size is larger than the minimum size of the resource subsets of the specified size, and the resources of the second resource subset are occupied and the size of the remaining resources is not smaller than the specified size.
步骤1033:若所述目标服务器中不存在所述第一资源子集合且不存在所述第二资源子集合,且存在第三资源子集合,则将所述第三资源子集合中所述指定规格的资源分配给所述目标VM。Step 1033: If the first resource subset does not exist and the second resource subset does not exist in the target server, and there is a third resource subset, set the specified Specifications of resources are allocated to the target VM.
所述第三资源子集合的规格与所述第二资源子集合的规格相同,且所述第三资源子集合的资源未被占用。The specification of the third resource subset is the same as that of the second resource subset, and the resources of the third resource subset are not occupied.
举例来说,所述指定规格的资源为2U,若目标服务器中存在2U的资源子集合(第一资源子集合),则直接将2U的资源子集合(第一资源子集合)中的资源(2U的资源)分配给目标VM,若目标服务器中不存在2U的资源子集合,但是存在4U且已被占用了2U的资源子集合(第二资源子集合),则将4U且已被占用了2U的资源子集合(第二资源子集合)中指定规格的资源(2U的资源)分配给目标VM,若所述第一资源子集合和所述第二资源子集合均不存在,但存在4U且资源未被占用的资源子集合(第三资源子集合),则将4U的资源子集合中指定规格的资源(2U)分配给目标VM,当然,也可能是4U的资源子集合全部被占用的情形,第三资源子集合为8U且资源未被占用的资源子集合,那么便将8U中2U的资源分配给目标VM。For example, the resource of the specified specification is 2U. If there is a 2U resource subset (the first resource subset) in the target server, the resources in the 2U resource subset (the first resource subset) ( 2U resource) to the target VM, if there is no 2U resource subset in the target server, but there is a 4U resource subset (the second resource subset) that has been occupied by 4U, then the 4U resource subset that has been occupied will be allocated Resources of specified specifications (2U resources) in the 2U resource subset (second resource subset) are allocated to the target VM, if neither the first resource subset nor the second resource subset exists, but 4U And for the resource subset (the third resource subset) that is not occupied, allocate the resources (2U) of the specified specification in the 4U resource subset to the target VM. Of course, it is also possible that all the 4U resource subsets are occupied. In the case where the third resource subset is 8U and the resources are not occupied, then the resources of 2U in the 8U are allocated to the target VM.
若所述指定规格的资源大于预设规格阈值,且所述目标服务器中不存在所述第一资源子集合、所述第二资源子集合和第三资源子集合,则将所述目标服务器中至少两个第四资源子集合的资源分配给所述目标VM,所述至少两个第四资源子集合的资源之和为所述指定规格的资源。If the resource of the specified specification is greater than the preset specification threshold, and the first subset of resources, the second subset of resources, and the third subset of resources do not exist in the target server, the target server will The resources of at least two fourth resource subsets are allocated to the target VM, and the sum of the resources of the at least two fourth resource subsets is the resource of the specified specification.
举例来说,所述指定规格的资源为16U,目标服务器中存在第一资源集合和第二资源集合,但是第一资源集合和第二资源集合中均不存在所述第一资源子集合、所述第二资源子集合和第三资源子集合,不过第一资源集合中存在一个8U且资源未被占用的资源子集合,第二资源集合中也存在一个8U且资源未被占用的资源子集合,那么这两个8U且资源未被占用的资源子集合便是至少两个第四资源子集合;再如,第一资源集合中存在一个8U且资源未被占用的资源子集合、2个2U且资源未被占用的资源子集合,第二资源集合中存在一个4U且资源未被占用的资源子集合,那么第一资源集合中1个8U、2个2U的资源未被占用的资源子集合以及第二资源集合中4U且资源未被占用的资源子集合便是至少两个第四资源子集合。For example, the resource of the specified specification is 16U, and the first resource set and the second resource set exist in the target server, but neither the first resource subset nor the second resource set exists in the first resource set or the second resource set. The second resource subset and the third resource subset are described above, but there is an 8U resource subset with unoccupied resources in the first resource set, and there is also an 8U resource subset with unoccupied resources in the second resource set , then the two 8U resource subsets with unoccupied resources are at least two fourth resource subsets; for another example, there is one 8U resource subset with unoccupied resources in the first resource set, and two 2U resource subsets And the resources are not occupied by the resource subset, there is a 4U resource subset in the second resource set and the resource is not occupied, then there are 1 8U and 2 2U resource subsets in the first resource set that are not occupied And the 4U and unoccupied resource subsets in the second resource set are at least two fourth resource subsets.
需要说明的是,现有技术中,由于拥有较大可分配资源的候选服务器在更多的情形下分配了较小规格的资源,并没有适当预留可分配资源,从而影响了较大规格的资源发放能力,降低了第一候选服务器集合整体对较大规格的资源发放能力,若按照本申请实施例中步骤101~步骤103的执行方式,可以对资源进行适当预留,由于目标服务器是在分配指定规格的资源前后对各种规格的资源进行分配的能力降低程度最小的服务器之一,从而在其他服务器的可分配资源不变的情况下,对于整体的第一候选服务器集合而言,可以最大化保留对各种规格的资源进行分配的能力。It should be noted that in the prior art, since the candidate server with larger allocatable resources allocates resources of smaller size in more situations, it does not properly reserve allocatable resources, thus affecting the The ability to distribute resources reduces the ability of the first candidate server set to distribute large-scale resources as a whole. According to the execution method of steps 101 to 103 in the embodiment of this application, resources can be properly reserved. Since the target server is in One of the servers whose ability to allocate resources of various specifications decreases the least before and after allocating resources of a specified specification, so that when the allocatable resources of other servers remain unchanged, for the overall set of first candidate servers, it can Maximize reserved capacity to allocate resources of various sizes.
参见图4,为本申请实施例提供的一资源调度装置的结构示意图。本申请实施例提供的上述资源调度装置,能够实现上述资源调度方法的实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行 具体赘述。Referring to FIG. 4 , it is a schematic structural diagram of a resource scheduling device provided by an embodiment of the present application. The above-mentioned resource scheduling device provided by the embodiment of the present application can realize all the method steps realized by the above-mentioned embodiment of the resource scheduling method, and can achieve the same technical effect, and the same part as the method embodiment in this embodiment will not be discussed here. and beneficial effects are described in detail.
本申请提供一种资源调度装置,包括:This application provides a resource scheduling device, including:
接收模块401,用于接收第一虚拟机VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;The receiving module 401 is configured to receive a first virtual machine VM request, and the first VM request is used to request allocation of resources of a specified specification for the target VM;
处理模块402,用于从第一候选服务器集合中选取目标服务器,所述目标服务器的资源发放能力变化量不大于所述第一候选服务器集合中除所述目标服务器之外的任一候选服务器的资源发放能力变化量,所述任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;A processing module 402, configured to select a target server from the first set of candidate servers, the amount of change in the resource issuance capability of the target server is not greater than that of any candidate server in the first set of candidate servers except the target server The amount of change in the resource issuance capability of any candidate server is the variation between the first resource issuance capability and the second resource issuance capability of the candidate server, and the first resource of any candidate server The issuance capability indicates the first allocable resource of the candidate server, the first allocable resource is the allocatable resource before the candidate server is pre-allocated the resource of the specified specification, and the second resource of any candidate server is issued The capability indicates the second allocatable resource of the candidate server, the second allocatable resource is the allocatable resource after the candidate server is pre-allocated the resource of the specified specification, and the resource issuance capability is used to characterize the pair of allocatable resources The ability to allocate resources of various sizes;
分配模块403,用于将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。An allocating module 403, configured to allocate resources of the specified specification among the allocatable resources of the target server to the target VM.
可选的,所述处理模块402具体用于:Optionally, the processing module 402 is specifically configured to:
按照以下方式得到所述第一资源发放能力:The first resource issuance capability is obtained in the following manner:
分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源对各种规格的资源进行分配的综合资源发放能力;Determining the ability of the first allocable resource to allocate resources of each specification in a single specification, and according to the ability of the first allocable resource to allocate resources of each specification in a single specification, determine the The first resource distribution capability of the first allocable resource, the first resource distribution capability represents the comprehensive resource distribution capability of the first allocable resource for allocating resources of various specifications;
按照以下方式得到所述第二资源发放能力:The second resource issuance capability is obtained in the following manner:
分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源对各种规格的资源进行分配的综合资源发放能力。Determining the single-standard resource issuance capability of the second allocatable resources for allocating resources of each specification respectively, and determining the The second resource allocation capability of the second allocable resource, where the second resource allocation capability represents the comprehensive resource allocation capability of the second allocable resource for allocating resources of various specifications.
可选的,所述处理模块402具体用于:Optionally, the processing module 402 is specifically configured to:
按照以下方式确定所述第一可分配资源的第一资源发放能力:The first resource issuance capability of the first allocable resource is determined in the following manner:
对所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第一可分配资源的第一资源发放能力;Accumulate or average the resource issuance capabilities of a single specification allocated by the first allocable resources to resources of each specification to obtain the first resource issuance capabilities of the first allocable resources;
按照以下方式确定所述第二可分配资源的第二资源发放能力:The second resource issuance capability of the second allocatable resource is determined in the following manner:
对所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第二可分配资源的第二资源发放能力。The second resource issuance capability of the second allocable resource is obtained by accumulating or averaging the resource issuance capabilities of a single specification allocated by the second allocatable resources to resources of each specification.
可选的,所述第一VM请求所请求的所述指定规格的资源包括至少两种类型资源;所述处理模块402具体用于:Optionally, the resource of the specified specification requested by the first VM request includes at least two types of resources; the processing module 402 is specifically configured to:
按照以下方式确定所述第一可分配资源的第一资源发放能力:The first resource issuance capability of the first allocable resource is determined in the following manner:
分别确定所述第一可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;Respectively determining the comprehensive resource issuance capability of each type of resource of the at least two types of resources in the first allocable resources for allocating resources of the same type with various specifications;
根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配 资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力;According to the comprehensive resource distribution capability of each type of resource for allocating resources of the same type with various specifications, the first resource distribution capability of the first allocatable resource is determined, and the first resource distribution capability represents the first The ability to allocate comprehensive resources to resources of various specifications for at least two types of resources mentioned in the allocatable resources;
按照以下方式确定所述第二可分配资源的第二资源发放能力:The second resource issuance capability of the second allocatable resource is determined in the following manner:
分别确定所述第二可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;Respectively determining the comprehensive resource distribution capability of each type of resource in the at least two types of resources in the second allocable resources for allocating resources of the same type with various specifications;
根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力。According to the comprehensive resource distribution capability of each type of resource for allocating resources of the same type with various specifications, the second resource distribution capability of the second allocatable resource is determined, and the second resource distribution capability represents the second The at least two types of resources in the allocatable resources are capable of allocating resources of various specifications.
可选的,所述处理模块402具体用于:Optionally, the processing module 402 is specifically configured to:
按照以下方式确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力:The resource issuance capability of a single specification for allocating resources of each specification by the first allocable resource is determined in the following manner:
所述第一可分配资源对任一规格的资源进行分配的最大次数,或者所述第一可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积;The maximum number of times that the first allocable resource allocates resources of any specification, or the maximum number of times that the first allocatable resource allocates resources of any specification is equal to the distribution capability coefficient corresponding to the specification product;
按照以下方式确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力:The resource issuance capability of a single specification for the second allocatable resource to allocate resources of each specification is determined in the following manner:
所述第二可分配资源对任一规格的资源进行分配的最大次数,或者所述第二可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积。The maximum number of times the second allocatable resources are allocated to resources of any specification, or the maximum number of times the second allocatable resources are allocated to resources of any specification is the ratio of the distribution capacity coefficient corresponding to any specification product.
可选的,所述发放能力系数是预先设置的,或者,所述发放能力系数是根据至少一个第二VM请求调整得到的,所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。Optionally, the provisioning capability coefficient is preset, or the provisioning capability coefficient is adjusted according to at least one second VM request, and the at least one second VM request includes a VM request for which resource allocation has been completed and /or VM requests that have completed resource reclamation.
可选的,所述处理模块402还用于:Optionally, the processing module 402 is also used for:
获取所述至少一个第二VM请求;obtain the at least one second VM request;
根据所述至少一个第二VM请求所请求分配和/或请求回收的资源的规格,确定根据所述至少一个第二VM请求所分配的各规格的资源占比;According to the specifications of the resources requested to be allocated and/or reclaimed according to the at least one second VM request, determine the proportion of resources of each specification allocated according to the at least one second VM request;
根据所述各规格的资源占比,调整各规格对应的发放能力系数,其中,调整后的任一规格对应的发放能力系数与根据所述至少一个第二VM请求所分配的该规格的资源占比呈正相关。According to the resource proportion of each specification, adjust the distribution capability coefficient corresponding to each specification, wherein, the distribution capability coefficient corresponding to any specification after adjustment is different from the resource ratio of the specification allocated according to the at least one second VM request. The ratio is positively correlated.
可选的,所述处理模块402具体用于:Optionally, the processing module 402 is specifically configured to:
按照以下方式确定所述第一可分配资源的第一资源发放能力:The first resource issuance capability of the first allocable resource is determined in the following manner:
根据所述任一候选服务器的第一可分配资源,查询资源发放能力评估表,得到所述第一可分配资源的第一资源发放能力;According to the first allocatable resource of any candidate server, query the resource distribution capability evaluation table to obtain the first resource distribution capability of the first allocatable resource;
按照以下方式确定所述第二可分配资源的第二资源发放能力:The second resource issuance capability of the second allocatable resource is determined in the following manner:
根据所述任一候选服务器的第二可分配资源,查询所述资源发放能力评估表,得到所述第二可分配资源的第二资源发放能力;According to the second allocatable resource of any candidate server, query the resource allocation capability evaluation table to obtain the second resource allocation capability of the second allocatable resource;
其中,所述资源发放能力评估表中的任一表项包括可分配资源和该可分配资源的资源发放能力,该可分配资源的资源发放能力是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力得到的,或者是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力以及该规格对应的资源发放能力系数得到的。Wherein, any item in the evaluation table of resource distribution capability includes allocatable resources and resource distribution capabilities of the allocatable resources. It can be obtained by assigning a single-specification resource issuance capability, or by assigning a single-specification resource issuance capability for resources of each specification based on the allocatable resource and the resource issuance capability coefficient corresponding to the specification.
可选的,所述任一候选服务器中包括至少一个资源集合,每个所述资源集合包括至少两个资源子集合;所述分配模块403具体用于:Optionally, any of the candidate servers includes at least one resource set, and each resource set includes at least two resource subsets; the allocation module 403 is specifically configured to:
若所述目标服务器中存在第一资源子集合,则将所述第一资源子集合中的资源分配给 所述目标VM;所述第一资源子集合的规格与所述指定规格相同,且资源未被分配;If there is a first subset of resources in the target server, allocate resources in the first subset of resources to the target VM; the specification of the first subset of resources is the same as the specified specification, and the resource not assigned;
若所述目标服务器中不存在所述第一资源子集合且存在第二资源子集合,则将所述第二资源子集合的剩余资源中所述指定规格的资源分配给所述目标VM;所述第二资源子集合为规格大于所述指定规格的资源子集合中最小规格的资源子集合,且所述第二资源子集合的资源被占用且剩余资源的规格不小于所述指定规格;If the first resource subset does not exist in the target server and there is a second resource subset, allocating the resources of the specified specification among the remaining resources of the second resource subset to the target VM; The second resource subset is a resource subset whose size is larger than the smallest size among the resource subsets of the specified size, and the resources of the second resource subset are occupied and the size of the remaining resources is not smaller than the specified size;
若所述目标服务器中不存在所述第一资源子集合且不存在所述第二资源子集合,且存在第三资源子集合,则将所述第三资源子集合中所述指定规格的资源分配给所述目标VM;所述第三资源子集合的规格与所述第二资源子集合的规格相同,且所述第三资源子集合的资源未被占用。If the first resource subset does not exist and the second resource subset does not exist in the target server, and there is a third resource subset, then the resources of the specified specification in the third resource subset allocated to the target VM; the specification of the third resource subset is the same as that of the second resource subset, and the resources of the third resource subset are not occupied.
可选的,所述分配模块403还用于:Optionally, the allocation module 403 is also used for:
若所述指定规格的资源大于预设规格阈值,且所述目标服务器中不存在所述第一资源子集合、所述第二资源子集合和所述第三资源子集合,则将所述目标服务器中至少两个第四资源子集合的资源分配给所述目标VM,所述至少两个第四资源子集合的剩余资源之和为所述指定规格的资源。If the resource of the specified specification is greater than the preset specification threshold, and the first resource subset, the second resource subset, and the third resource subset do not exist in the target server, the target The resources of at least two fourth resource subsets in the server are allocated to the target VM, and the sum of the remaining resources of the at least two fourth resource subsets is the resource of the specified specification.
可选的,所述分配模块403还用于:Optionally, the allocation module 403 is also used for:
根据至少一个第二VM请求的资源的规格和任一所述资源集合的规格,划分该资源集合的至少两个资源子集合的规格;所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。According to the specification of the resource requested by at least one second VM and the specification of any one of the resource sets, divide the specifications of at least two resource subsets of the resource set; the at least one second VM request includes VMs that have completed resource allocation VM requests that request and/or have completed resource reclamation.
可选的,从第一候选服务器集合中选取目标服务器之前,所述处理模块402还用于:Optionally, before selecting a target server from the first set of candidate servers, the processing module 402 is further configured to:
根据所述第一VM请求所请求的所述指定规格的资源,以及第二候选服务器集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度;According to the resource of the specified specification requested by the first VM request, and the second allocatable resources of each candidate server in the second candidate server set, respectively determine the resource consumption of each candidate server in the second candidate server set Consistency index; wherein, the resource consumption consistency index of any candidate server in the second set of candidate servers characterizes the consumption ratio of at least two types of resources among the second allocatable resources of the candidate server and the consumption ratio of the candidate server the closeness of the proportions of at least two types of resources in the resource specification;
按照资源消耗一致性指数从高到低的顺序选取至少两个候选服务器,所述至少两个候选服务器形成所述第一候选服务器集合。At least two candidate servers are selected in descending order of the resource consumption consistency index, and the at least two candidate servers form the first candidate server set.
本申请提供另一种资源调度装置,其具体结构也可以如图4所示,该装置具体包括:The present application provides another resource scheduling device, and its specific structure may also be shown in Figure 4. The device specifically includes:
接收模块401,用于接收第一VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;The receiving module 401 is configured to receive a first VM request, and the first VM request is used to request allocation of resources of a specified specification for the target VM;
处理模块402,用于确定第一候选服务器集合中各候选服务器的资源发放能力变化量;所述第一候选服务器集合中任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;以及The processing module 402 is configured to determine the variation in resource issuance capability of each candidate server in the first candidate server set; the resource issuance capability variation of any candidate server in the first candidate server set is the first resource issuance capability of the candidate server The variation between the capability and the second resource issuance capability, the first resource issuance capability of any candidate server indicates the first allocatable resource of the candidate server, and the first allocatable resource is pre-allocated for the candidate server Allocatable resources before the resource of the specified specification, the second resource issuance capability of any candidate server indicates the second allocatable resource of the candidate server, and the second allocatable resource is pre-allocated by the candidate server Allocatable resources after resources of the specified specification, the resource issuance capability is used to represent the ability of the allocatable resources to allocate resources of various specifications; and
用于按照资源发放能力变化量从低到高的顺序选取至少两个候选服务器,所述至少两个候选服务器形成第二候选服务器集合;以及Selecting at least two candidate servers according to the order of resource issue capability variation from low to high, and the at least two candidate servers form a second set of candidate servers; and
用于根据所述第一VM请求所请求的所述指定规格的资源,以及所述第二候选服务器 集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度;It is used to determine each candidate in the second candidate server set according to the resource of the specified specification requested by the first VM request and the second allocatable resources of each candidate server in the second candidate server set. The resource consumption consistency index of the server; wherein, the resource consumption consistency index of any candidate server in the second candidate server set characterizes the consumption ratio of at least two types of resources among the second allocatable resources of the candidate server and The closeness of the proportions of at least two types of resources in the resource specification of the candidate server;
还用于将资源消耗一致性指数最高的候选服务器作为目标服务器;It is also used to use the candidate server with the highest resource consumption consistency index as the target server;
分配模块403,用于将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。An allocating module 403, configured to allocate resources of the specified specification among the allocatable resources of the target server to the target VM.
可选的,所述处理模块402具体用于:Optionally, the processing module 402 is specifically configured to:
按照以下方式得到所述第一资源发放能力:The first resource issuance capability is obtained in the following manner:
分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源对各种规格的资源进行分配的综合资源发放能力;Determining the ability of the first allocable resource to allocate resources of each specification in a single specification, and according to the ability of the first allocable resource to allocate resources of each specification in a single specification, determine the The first resource distribution capability of the first allocable resource, the first resource distribution capability represents the comprehensive resource distribution capability of the first allocable resource for allocating resources of various specifications;
按照以下方式得到所述第二资源发放能力:The second resource issuance capability is obtained in the following manner:
分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源对各种规格的资源进行分配的综合资源发放能力。Determining the single-standard resource issuance capability of the second allocatable resources for allocating resources of each specification respectively, and determining the The second resource allocation capability of the second allocable resource, where the second resource allocation capability represents the comprehensive resource allocation capability of the second allocable resource for allocating resources of various specifications.
可选的,所述处理模块402还用于:Optionally, the processing module 402 is also used for:
获取所述至少一个第二VM请求;obtain the at least one second VM request;
根据所述至少一个第二VM请求所请求分配和/或请求回收的资源的规格,确定根据所述至少一个第二VM请求所分配的各规格的资源占比;According to the specifications of the resources requested to be allocated and/or reclaimed according to the at least one second VM request, determine the proportion of resources of each specification allocated according to the at least one second VM request;
根据所述各规格的资源占比,调整各规格对应的发放能力系数,其中,调整后的任一规格对应的发放能力系数与根据所述至少一个第二VM请求所分配的该规格的资源占比呈正相关。According to the resource proportion of each specification, adjust the distribution capability coefficient corresponding to each specification, wherein, the distribution capability coefficient corresponding to any specification after adjustment is different from the resource ratio of the specification allocated according to the at least one second VM request. The ratio is positively correlated.
可选的,所述处理模块402具体用于:Optionally, the processing module 402 is specifically configured to:
按照以下方式确定所述第一可分配资源的第一资源发放能力:The first resource issuance capability of the first allocable resource is determined in the following manner:
根据所述任一候选服务器的第一可分配资源,查询资源发放能力评估表,得到所述第一可分配资源的第一资源发放能力;According to the first allocatable resource of any candidate server, query the resource distribution capability evaluation table to obtain the first resource distribution capability of the first allocatable resource;
按照以下方式确定所述第二可分配资源的第二资源发放能力:The second resource issuance capability of the second allocatable resource is determined in the following manner:
根据所述任一候选服务器的第二可分配资源,查询所述资源发放能力评估表,得到所述第二可分配资源的第二资源发放能力;According to the second allocatable resource of any candidate server, query the resource allocation capability evaluation table to obtain the second resource allocation capability of the second allocatable resource;
其中,所述资源发放能力评估表中的任一表项包括可分配资源和该可分配资源的资源发放能力,该可分配资源的资源发放能力是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力得到的,或者是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力以及该规格对应的资源发放能力系数得到的。Wherein, any item in the evaluation table of resource distribution capability includes allocatable resources and resource distribution capabilities of the allocatable resources. It can be obtained by assigning a single-specification resource issuance capability, or by assigning a single-specification resource issuance capability for resources of each specification based on the allocatable resource and the resource issuance capability coefficient corresponding to the specification.
可选的,所述任一候选服务器中包括至少一个资源集合,每个所述资源集合包括至少两个资源子集合;所述分配模块403具体用于:Optionally, any of the candidate servers includes at least one resource set, and each resource set includes at least two resource subsets; the allocation module 403 is specifically configured to:
若所述目标服务器中存在第一资源子集合,则将所述第一资源子集合中的资源分配给所述目标VM;所述第一资源子集合的规格与所述指定规格相同,且资源未被分配;If there is a first subset of resources in the target server, allocate resources in the first subset of resources to the target VM; the specification of the first subset of resources is the same as the specified specification, and the resource not assigned;
若所述目标服务器中不存在所述第一资源子集合且存在第二资源子集合,则将所述第二资源子集合的剩余资源中所述指定规格的资源分配给所述目标VM;所述第二资源子集合为规格大于所述指定规格的资源子集合中最小规格的资源子集合,且所述第二资源子集合的资源被占用且剩余资源的规格不小于所述指定规格;If the first resource subset does not exist in the target server and there is a second resource subset, allocating the resources of the specified specification among the remaining resources of the second resource subset to the target VM; The second resource subset is a resource subset whose size is larger than the smallest size among the resource subsets of the specified size, and the resources of the second resource subset are occupied and the size of the remaining resources is not smaller than the specified size;
若所述目标服务器中不存在所述第一资源子集合且不存在所述第二资源子集合,且存在第三资源子集合,则将所述第三资源子集合中所述指定规格的资源分配给所述目标VM;所述第三资源子集合的规格与所述第二资源子集合的规格相同,且所述第三资源子集合的资源未被占用。If the first resource subset does not exist and the second resource subset does not exist in the target server, and there is a third resource subset, then the resources of the specified specification in the third resource subset allocated to the target VM; the specification of the third resource subset is the same as that of the second resource subset, and the resources of the third resource subset are not occupied.
本申请实施例还提供一种电子设备,该电子设备可以具有如图5所示的结构,该电子设备可以是计算机设备,也可以是能够支持计算机设备实现上述方法的芯片或芯片系统。The embodiment of the present application also provides an electronic device. The electronic device may have the structure shown in FIG. 5 . The electronic device may be a computer device, or may be a chip or a chip system capable of supporting the computer device to implement the above method.
如图5所示的电子设备可以包括至少一个处理器501,所述至少一个处理器501用于与存储器耦合,读取并执行所述存储器中的指令以实现本申请实施例提供的资源调度方法的步骤。可选的,该电子设备还可以包括通信接口502,用于支持该电子设备进行信令或者数据的接收或发送。电子设备中的通信接口502,可用于实现与其他电子设备的进行交互。处理器501可用于实现电子设备执行如图1所示的方法中的步骤。可选的,该电子设备通还可以包括存储器503,其中存储有计算机指令,存储器503可以与处理器501和/或通信接口502耦合,用于支持处理器501调用存储器503中的计算机指令以实现如图1示意图所示的方法中的步骤;另外,存储器503还可以用于存储本申请方法实施例所涉及的数据,例如,用于存储支持通信接口502实现交互所必须的数据、指令,和/或,用于存储电子设备执行本申请实施例所述方法所必须的配置信息。The electronic device shown in FIG. 5 may include at least one processor 501, and the at least one processor 501 is configured to be coupled with a memory, and read and execute instructions in the memory to implement the resource scheduling method provided by the embodiment of the present application. A step of. Optionally, the electronic device may further include a communication interface 502, configured to support the electronic device in receiving or sending signaling or data. The communication interface 502 in the electronic device can be used to realize interaction with other electronic devices. The processor 501 may be configured to enable the electronic device to execute the steps in the method shown in FIG. 1 . Optionally, the electronic device may also include a memory 503, in which computer instructions are stored, and the memory 503 may be coupled with the processor 501 and/or the communication interface 502, and is used to support the processor 501 to call the computer instructions in the memory 503 to implement Steps in the method as shown in the schematic diagram of FIG. 1; in addition, the memory 503 can also be used to store the data involved in the method embodiment of the present application, for example, to store data and instructions necessary to support the communication interface 502 to realize interaction, and /or, used to store configuration information necessary for the electronic device to execute the method described in the embodiment of the present application.
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机指令,这些计算机指令被计算机调用执行时,可以使得计算机完成上述方法实施例、方法实施例的任意一种可能的设计中所涉及的方法。本申请实施例中,对计算机可读存储介质不做限定,例如,可以是RAM(random-access memory,随机存取存储器)、ROM(read-only memory,只读存储器)等。The embodiment of the present application also provides a computer-readable storage medium. Computer instructions are stored on the computer-readable storage medium. When these computer instructions are called and executed by a computer, the computer can complete any one of the above-mentioned method embodiments and method embodiments. methods involved in a possible design. In the embodiment of the present application, the computer-readable storage medium is not limited, for example, it may be RAM (random-access memory, random access memory), ROM (read-only memory, read-only memory), etc.
本申请还提供一种芯片,该芯片可以包括处理器以及接口电路,用于完成上述方法实施例、方法实施例的任意一种可能的实现方式中所涉及的方法,其中,“耦合”是指两个部件彼此直接或间接地结合,这种结合可以是固定的或可移动性的。The present application also provides a chip, which may include a processor and an interface circuit, for completing the methods involved in any of the above method embodiments and any possible implementation of the method embodiments, wherein "coupling" means Two parts are coupled to each other directly or indirectly, and this coupling can be fixed or movable.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机指令的形式实现。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设 备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of computer instructions. When the computer instructions are loaded and executed on the computer, the procedures or functions according to the embodiments of the present invention will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber) or wireless (eg, infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device including a server, a data center, and the like integrated with one or more available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)), etc.
本申请实施例中所描述的方法或算法的步骤可以直接嵌入硬件、处理器执行的软件单元、或者这两者的结合。软件单元可以存储于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、可移动磁盘、CD-ROM或本领域中其它任意形式的存储媒介中。示例性地,存储媒介可以与处理器连接,以使得处理器可以从存储媒介中读取信息,并可以向存储媒介存写信息。可选地,存储媒介还可以集成到处理器中。处理器和存储媒介可以设置于ASIC中,ASIC可以设置于终端设备中。可选地,处理器和存储媒介也可以设置于终端设备中的不同的部件中。The steps of the method or algorithm described in the embodiments of the present application may be directly embedded in hardware, a software unit executed by a processor, or a combination of both. The software unit may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM or any other storage medium in the art. Exemplarily, the storage medium can be connected to the processor, so that the processor can read information from the storage medium, and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be set in the ASIC, and the ASIC can be set in the terminal device. Optionally, the processor and the storage medium may also be disposed in different components in the terminal device.
这些计算机指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device Steps are provided for implementing the functions specified in the flow chart or flow charts and/or block diagram block or blocks.
尽管结合具体特征及其实施例对本发明进行了描述,显而易见的,在不脱离本发明的范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本发明的示例性说明,且视为已覆盖本发明范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Although the invention has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations can be made thereto without departing from the scope of the invention. Accordingly, the specification and drawings are merely illustrative of the invention as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the invention. Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (17)

  1. 一种资源调度方法,其特征在于,包括:A resource scheduling method, characterized in that, comprising:
    接收第一虚拟机VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;receiving a first virtual machine VM request, where the first VM request is used to request allocation of resources of a specified specification for the target VM;
    从第一候选服务器集合中选取目标服务器,所述目标服务器的资源发放能力变化量不大于所述第一候选服务器集合中除所述目标服务器之外的任一候选服务器的资源发放能力变化量,所述任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;Selecting a target server from the first set of candidate servers, the amount of change in the resource issuance capability of the target server is not greater than the change amount of resource issuance capability of any candidate server in the first set of candidate servers except the target server, The resource issue capability variation of any candidate server is the variation between the first resource issue capability and the second resource issue capability of the candidate server, and the first resource issue capability of any candidate server indicates that the candidate server The first allocatable resource is the allocatable resource before the candidate server is pre-allocated the resource of the specified specification, and the second resource issuance capability of any candidate server indicates the candidate server’s The second allocatable resource, the second allocatable resource is the allocatable resource after the candidate server is pre-allocated the resource of the specified specification, and the resource issuance capability is used to represent the performance of the allocatable resource on resources of various specifications the ability to distribute;
    将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。Allocating the resources of the specified specification among the allocatable resources of the target server to the target VM.
  2. 如权利要求1所述的方法,其特征在于:The method of claim 1, characterized in that:
    所述第一资源发放能力,按照以下方式得到:The first resource distribution capability is obtained in the following manner:
    分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源对各种规格的资源进行分配的综合资源发放能力;Determining the ability of the first allocable resource to allocate resources of each specification in a single specification, and according to the ability of the first allocable resource to allocate resources of each specification in a single specification, determine the The first resource distribution capability of the first allocable resource, the first resource distribution capability represents the comprehensive resource distribution capability of the first allocable resource for allocating resources of various specifications;
    所述第二资源发放能力,按照以下方式得到:The second resource distribution capability is obtained in the following manner:
    分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源对各种规格的资源进行分配的综合资源发放能力。Determining the single-standard resource issuance capability of the second allocatable resources for allocating resources of each specification respectively, and determining the The second resource allocation capability of the second allocable resource, where the second resource allocation capability represents the comprehensive resource allocation capability of the second allocable resource for allocating resources of various specifications.
  3. 如权利要求2所述的方法,其特征在于:The method of claim 2, characterized in that:
    所述根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,包括:The determining the first resource allocation capability of the first allocable resource according to the single-standard resource issuance capability of allocating resources of each specification according to the first allocable resource includes:
    对所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第一可分配资源的第一资源发放能力;Accumulate or average the resource issuance capabilities of a single specification allocated by the first allocable resources to resources of each specification to obtain the first resource issuance capabilities of the first allocable resources;
    所述根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,包括:The determining the second resource issuance capability of the second allocatable resource according to the resource distribution capability of a single specification for allocating resources of each specification according to the second allocable resource includes:
    对所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力进行累加或平均,得到所述第二可分配资源的第二资源发放能力。The second resource issuance capability of the second allocable resource is obtained by accumulating or averaging the resource issuance capabilities of a single specification allocated by the second allocatable resources to resources of each specification.
  4. 如权利要求2或3所述的方法,其特征在于,所述第一VM请求所请求的所述指定规格的资源包括至少两种类型资源;The method according to claim 2 or 3, wherein the resources of the specified specification requested by the first VM request include at least two types of resources;
    所述分别确定所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,包括:The separately determining the ability of the first allocatable resource to allocate resources of each specification with a single specification resource, according to the first allocable resource's resource allocation capability of a single specification to allocate resources of each specification, determine The first resource issuance capability of the first allocable resource includes:
    分别确定所述第一可分配资源中所述至少两种类型资源中每种类型资源对各种规格 的相同类型资源进行分配的综合资源发放能力;Respectively determining the comprehensive resource distribution capability of each type of resource in the at least two types of resources in the first allocable resource for allocating resources of the same type with various specifications;
    根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第一可分配资源的第一资源发放能力,所述第一资源发放能力表征所述第一可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力;According to the comprehensive resource distribution capability of each type of resource for allocating resources of the same type with various specifications, the first resource distribution capability of the first allocatable resource is determined, and the first resource distribution capability represents the first The ability to allocate comprehensive resources to resources of various specifications for at least two types of resources mentioned in the allocatable resources;
    所述分别确定所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,包括:The separately determining the single-standard resource distribution capability of the second allocable resources for allocating resources of each specification is determined according to the single-standard resource distribution capability of the second allocable resources for allocating resources of each specification. The second resource issuance capability of the second allocatable resource includes:
    分别确定所述第二可分配资源中所述至少两种类型资源中每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力;Respectively determining the comprehensive resource distribution capability of each type of resource in the at least two types of resources in the second allocable resources for allocating resources of the same type with various specifications;
    根据所述每种类型资源对各种规格的相同类型资源进行分配的综合资源发放能力,确定所述第二可分配资源的第二资源发放能力,所述第二资源发放能力表征所述第二可分配资源中所述至少两种类型资源对各种规格的资源进行分配的综合资源发放能力。According to the comprehensive resource distribution capability of each type of resource for allocating resources of the same type with various specifications, the second resource distribution capability of the second allocatable resource is determined, and the second resource distribution capability represents the second The at least two types of resources in the allocatable resources are capable of allocating resources of various specifications.
  5. 如权利要求2-4任一项所述的方法,其特征在于:The method according to any one of claims 2-4, characterized in that:
    所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,包括:The ability of the first allocatable resource to allocate resources of each specification in a single specification includes:
    所述第一可分配资源对任一规格的资源进行分配的最大次数,或者所述第一可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积;The maximum number of times that the first allocable resource allocates resources of any specification, or the maximum number of times that the first allocatable resource allocates resources of any specification is equal to the distribution capability coefficient corresponding to the specification product;
    所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,包括:The resource issuance capability of a single specification for the second allocatable resource to allocate resources of each specification includes:
    所述第二可分配资源对任一规格的资源进行分配的最大次数,或者所述第二可分配资源对任一规格的资源进行分配的最大次数与所述任一规格对应的发放能力系数的乘积。The maximum number of times the second allocatable resources are allocated to resources of any specification, or the maximum number of times the second allocatable resources are allocated to resources of any specification is the ratio of the distribution capacity coefficient corresponding to any specification product.
  6. 如权利要求5所述的方法,其特征在于,所述发放能力系数是预先设置的,或者,所述发放能力系数是根据至少一个第二VM请求调整得到的,所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。The method according to claim 5, wherein the distribution capacity coefficient is preset, or the distribution capacity coefficient is adjusted according to at least one second VM request, and the at least one second VM request Including VM requests that have completed resource allocation and/or VM requests that have completed resource reclamation.
  7. 如权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6, further comprising:
    获取所述至少一个第二VM请求;obtain the at least one second VM request;
    根据所述至少一个第二VM请求所请求分配和/或请求回收的资源的规格,确定根据所述至少一个第二VM请求所分配的各规格的资源占比;According to the specifications of the resources requested to be allocated and/or reclaimed according to the at least one second VM request, determine the proportion of resources of each specification allocated according to the at least one second VM request;
    根据所述各规格的资源占比,调整各规格对应的发放能力系数,其中,调整后的任一规格对应的发放能力系数与根据所述至少一个第二VM请求所分配的该规格的资源占比呈正相关。According to the resource proportion of each specification, adjust the distribution capability coefficient corresponding to each specification, wherein, the distribution capability coefficient corresponding to any specification after adjustment is different from the resource ratio of the specification allocated according to the at least one second VM request. The ratio is positively correlated.
  8. 如权利要求5-7任一项所述的方法,其特征在于:The method according to any one of claims 5-7, characterized in that:
    所述根据所述第一可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第一可分配资源的第一资源发放能力,包括:The determining the first resource allocation capability of the first allocable resource according to the single-standard resource issuance capability of allocating resources of each specification according to the first allocable resource includes:
    根据所述任一候选服务器的第一可分配资源,查询资源发放能力评估表,得到所述第一可分配资源的第一资源发放能力;According to the first allocatable resource of any candidate server, query the resource distribution capability evaluation table to obtain the first resource distribution capability of the first allocatable resource;
    所述根据所述第二可分配资源对每种规格的资源进行分配的单一规格资源发放能力,确定所述第二可分配资源的第二资源发放能力,包括:The determining the second resource issuance capability of the second allocatable resource according to the resource distribution capability of a single specification for allocating resources of each specification according to the second allocable resource includes:
    根据所述任一候选服务器的第二可分配资源,查询所述资源发放能力评估表,得到所述第二可分配资源的第二资源发放能力;According to the second allocatable resource of any candidate server, query the resource allocation capability evaluation table to obtain the second resource allocation capability of the second allocatable resource;
    其中,所述资源发放能力评估表中的任一表项包括可分配资源和该可分配资源的资源发放能力,该可分配资源的资源发放能力是根据该可分配资源对每种规格的资源进行分配 的单一规格资源发放能力得到的,或者是根据该可分配资源对每种规格的资源进行分配的单一规格资源发放能力以及该规格对应的资源发放能力系数得到的。Wherein, any item in the evaluation table of resource distribution capability includes allocatable resources and resource distribution capabilities of the allocatable resources. It can be obtained by assigning a single-specification resource issuance capability, or by assigning a single-specification resource issuance capability for resources of each specification based on the allocatable resource and the resource issuance capability coefficient corresponding to the specification.
  9. 如权利要求1-8任一项所述的方法,其特征在于,所述任一候选服务器中包括至少一个资源集合,每个所述资源集合包括至少两个资源子集合;The method according to any one of claims 1-8, wherein any of the candidate servers includes at least one resource set, and each of the resource sets includes at least two resource subsets;
    所述将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM,包括:The allocating resources of the specified specifications in the allocatable resources of the target server to the target VM includes:
    若所述目标服务器中存在第一资源子集合,则将所述第一资源子集合中的资源分配给所述目标VM;所述第一资源子集合的规格与所述指定规格相同,且资源未被分配;If there is a first subset of resources in the target server, allocate resources in the first subset of resources to the target VM; the specification of the first subset of resources is the same as the specified specification, and the resource not assigned;
    若所述目标服务器中不存在所述第一资源子集合且存在第二资源子集合,则将所述第二资源子集合的剩余资源中所述指定规格的资源分配给所述目标VM;所述第二资源子集合为规格大于所述指定规格的资源子集合中最小规格的资源子集合,且所述第二资源子集合的资源被占用且剩余资源的规格不小于所述指定规格;If the first resource subset does not exist in the target server and there is a second resource subset, allocating the resources of the specified specification among the remaining resources of the second resource subset to the target VM; The second resource subset is a resource subset whose size is larger than the smallest size among the resource subsets of the specified size, and the resources of the second resource subset are occupied and the size of the remaining resources is not smaller than the specified size;
    若所述目标服务器中不存在所述第一资源子集合且不存在所述第二资源子集合,且存在第三资源子集合,则将所述第三资源子集合中所述指定规格的资源分配给所述目标VM;所述第三资源子集合的规格与所述第二资源子集合的规格相同,且所述第三资源子集合的资源未被占用。If the first resource subset does not exist and the second resource subset does not exist in the target server, and there is a third resource subset, then the resources of the specified specification in the third resource subset allocated to the target VM; the specification of the third resource subset is the same as that of the second resource subset, and the resources of the third resource subset are not occupied.
  10. 如权利要求9所述的方法,其特征在于,所述方法还包括:The method of claim 9, further comprising:
    若所述指定规格的资源大于预设规格阈值,且所述目标服务器中不存在所述第一资源子集合、所述第二资源子集合和所述第三资源子集合,则将所述目标服务器中至少两个第四资源子集合的资源分配给所述目标VM,所述至少两个第四资源子集合的剩余资源之和为所述指定规格的资源。If the resource of the specified specification is greater than the preset specification threshold, and the first resource subset, the second resource subset, and the third resource subset do not exist in the target server, the target The resources of at least two fourth resource subsets in the server are allocated to the target VM, and the sum of the remaining resources of the at least two fourth resource subsets is the resource of the specified specification.
  11. 如权利要求9或10所述的方法,其特征在于,所述方法还包括:The method according to claim 9 or 10, further comprising:
    根据至少一个第二VM请求的资源的规格和任一所述资源集合的规格,划分该资源集合的至少两个资源子集合的规格;所述至少一个第二VM请求包括已经完成资源分配的VM请求和/或已经完成资源回收的VM请求。According to the specification of the resource requested by at least one second VM and the specification of any one of the resource sets, divide the specifications of at least two resource subsets of the resource set; the at least one second VM request includes VMs that have completed resource allocation VM requests that request and/or have completed resource reclamation.
  12. 如权利要求1-11任一项所述的方法,其特征在于,所述从第一候选服务器集合中选取目标服务器之前,还包括:The method according to any one of claims 1-11, wherein before selecting the target server from the first candidate server set, further comprising:
    根据所述第一VM请求所请求的所述指定规格的资源,以及第二候选服务器集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度;According to the resource of the specified specification requested by the first VM request, and the second allocatable resources of each candidate server in the second candidate server set, respectively determine the resource consumption of each candidate server in the second candidate server set Consistency index; wherein, the resource consumption consistency index of any candidate server in the second set of candidate servers characterizes the consumption ratio of at least two types of resources among the second allocatable resources of the candidate server and the consumption ratio of the candidate server the closeness of the proportions of at least two types of resources in the resource specification;
    按照资源消耗一致性指数从高到低的顺序选取至少两个候选服务器,所述至少两个候选服务器形成所述第一候选服务器集合。At least two candidate servers are selected in descending order of the resource consumption consistency index, and the at least two candidate servers form the first candidate server set.
  13. 一种资源调度方法,其特征在于,包括:A resource scheduling method, characterized in that, comprising:
    接收第一VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;receiving a first VM request, where the first VM request is used to request allocation of resources of a specified specification for the target VM;
    确定第一候选服务器集合中各候选服务器的资源发放能力变化量;所述第一候选服务器集合中任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资 源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;Determining the variation in resource distribution capability of each candidate server in the first candidate server set; the resource distribution capability variation of any candidate server in the first candidate server set is the first resource distribution capability and the second resource distribution capability of the candidate server. The amount of change between the capabilities, the first resource issuance capability of any candidate server indicates the first allocable resource of the candidate server, and the first allocatable resource is that the candidate server is pre-allocated resources of the specified specification The previous allocatable resources, the second resource issuance capability of any candidate server indicates the second allocatable resource of the candidate server, and the second allocatable resource is after the candidate server is pre-allocated resources of the specified specification Allocatable resources, the resource issuance capability is used to represent the ability of allocatable resources to allocate resources of various specifications;
    按照资源发放能力变化量从低到高的顺序选取至少两个候选服务器,所述至少两个候选服务器形成第二候选服务器集合;Selecting at least two candidate servers according to the order of resource issue capability variation from low to high, and the at least two candidate servers form a second set of candidate servers;
    根据所述第一VM请求所请求的所述指定规格的资源,以及所述第二候选服务器集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度;According to the resource of the specified specification requested by the first VM request, and the second allocatable resources of each candidate server in the second candidate server set, respectively determine the resources of each candidate server in the second candidate server set A resource consumption consistency index; wherein, the resource consumption consistency index of any candidate server in the second set of candidate servers represents the ratio of the consumed ratio of at least two types of resources among the second allocatable resources of the candidate server to the candidate server. The closeness of the ratio of at least two types of resources in the resource specification of the server;
    将资源消耗一致性指数最高的候选服务器作为目标服务器;Use the candidate server with the highest resource consumption consistency index as the target server;
    将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。Allocating the resources of the specified specification among the allocatable resources of the target server to the target VM.
  14. 一种资源调度装置,其特征在于,包括:A resource scheduling device, characterized by comprising:
    接收模块,用于接收第一虚拟机VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;A receiving module, configured to receive a first virtual machine VM request, where the first VM request is used to request allocation of resources of a specified specification for the target VM;
    处理模块,用于从第一候选服务器集合中选取目标服务器,所述目标服务器的资源发放能力变化量不大于所述第一候选服务器集合中除所述目标服务器之外的任一候选服务器的资源发放能力变化量,所述任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;A processing module, configured to select a target server from the first set of candidate servers, the amount of change in the resource issuance capability of the target server is not greater than the resources of any candidate server in the first set of candidate servers except the target server The amount of change in the resource issuance capability of any candidate server is the variation between the first resource issuance capability and the second resource issuance capability of the candidate server, and the first resource issuance capability of any candidate server is Capability indicates the first allocatable resource of the candidate server, the first allocatable resource is the allocatable resource before the candidate server is pre-allocated the resource of the specified specification, and the second resource issuance capability of any candidate server Indicates the second allocatable resource of the candidate server, where the second allocatable resource is the allocatable resource after the candidate server is pre-allocated the resource of the specified specification, and the resource issuance capability is used to represent the impact of the allocatable resource on each The ability to allocate resources of various sizes;
    分配模块,用于将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。An allocating module, configured to allocate resources of the specified specification among the allocatable resources of the target server to the target VM.
  15. 一种资源调度装置,其特征在于,包括:A resource scheduling device, characterized by comprising:
    接收模块,用于接收第一VM请求,所述第一VM请求用于请求为目标VM分配指定规格的资源;A receiving module, configured to receive a first VM request, where the first VM request is used to request allocation of resources of a specified specification for the target VM;
    处理模块,用于确定第一候选服务器集合中各候选服务器的资源发放能力变化量;所述第一候选服务器集合中任一候选服务器的资源发放能力变化量是该候选服务器的第一资源发放能力和第二资源发放能力之间的变化量,所述任一候选服务器的第一资源发放能力指示该候选服务器的第一可分配资源,所述第一可分配资源为该候选服务器被预分配所述指定规格的资源前的可分配资源,所述任一候选服务器的第二资源发放能力指示该候选服务器的第二可分配资源,所述第二可分配资源为该候选服务器被预分配所述指定规格的资源后的可分配资源,所述资源发放能力用于表征可分配资源对各种规格的资源进行分配的能力;以及A processing module, configured to determine the variation in resource issuance capability of each candidate server in the first candidate server set; the variation in resource issuance capability of any candidate server in the first candidate server set is the first resource issuance capability of the candidate server and the second resource issuance capability, the first resource issuance capability of any candidate server indicates the first allocable resource of the candidate server, and the first allocatable resource is pre-allocated by the candidate server Allocatable resources before the resource of the specified specification, the second resource issuance capability of any candidate server indicates the second allocatable resource of the candidate server, and the second allocatable resource is the candidate server that is pre-allocated by the Allocatable resources after resources of specified specifications, the resource issuance capability is used to represent the ability of allocatable resources to allocate resources of various specifications; and
    用于按照资源发放能力变化量从低到高的顺序选取至少两个候选服务器,所述至少两个候选服务器形成第二候选服务器集合;以及Selecting at least two candidate servers according to the order of resource issue capability variation from low to high, and the at least two candidate servers form a second set of candidate servers; and
    用于根据所述第一VM请求所请求的所述指定规格的资源,以及所述第二候选服务器 集合中各候选服务器的第二可分配资源,分别确定所述第二候选服务器集合中各候选服务器的资源消耗一致性指数;其中,所述第二候选服务器集合中任一候选服务器的资源消耗一致性指数表征了该候选服务器的第二可分配资源中至少两种类型资源的已消耗比例与该候选服务器的资源规格中至少两种类型资源的比例的接近程度;It is used to determine each candidate in the second candidate server set according to the resource of the specified specification requested by the first VM request and the second allocatable resources of each candidate server in the second candidate server set. The resource consumption consistency index of the server; wherein, the resource consumption consistency index of any candidate server in the second candidate server set characterizes the consumption ratio of at least two types of resources among the second allocatable resources of the candidate server and The closeness of the proportions of at least two types of resources in the resource specification of the candidate server;
    还用于将资源消耗一致性指数最高的候选服务器作为目标服务器;It is also used to use the candidate server with the highest resource consumption consistency index as the target server;
    分配模块,用于将所述目标服务器的可分配资源中所述指定规格的资源分配给所述目标VM。An allocating module, configured to allocate resources of the specified specification among the allocatable resources of the target server to the target VM.
  16. 一种电子设备,其特征在于,所述电子设备包括:一个或多个处理器;一个或多个存储器;其中,所述一个或多个存储器存储有一个或多个计算机指令,当所述一个或多个计算机指令被所述一个或多个处理器执行时,使得所述电子设备执行如权利要求1-12或13任一项所述的方法。An electronic device, characterized in that the electronic device includes: one or more processors; one or more memories; wherein the one or more memories store one or more computer instructions, when the one or more When one or more computer instructions are executed by the one or more processors, the electronic device is made to execute the method according to any one of claims 1-12 or 13.
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机指令,当所述计算机指令在计算机上运行时,使得所述计算机执行如权利要求1-12或13任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium includes computer instructions, and when the computer instructions are run on a computer, the computer is made to perform any one of claims 1-12 or 13. the method described.
PCT/CN2021/143561 2021-05-27 2021-12-31 Resource scheduling method and apparatus WO2022247287A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110586962.X 2021-05-27
CN202110586962 2021-05-27
CN202110876658.9 2021-07-31
CN202110876658.9A CN115408098A (en) 2021-05-27 2021-07-31 Resource scheduling method and device

Publications (1)

Publication Number Publication Date
WO2022247287A1 true WO2022247287A1 (en) 2022-12-01

Family

ID=84155609

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/143561 WO2022247287A1 (en) 2021-05-27 2021-12-31 Resource scheduling method and apparatus

Country Status (2)

Country Link
CN (1) CN115408098A (en)
WO (1) WO2022247287A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070016907A1 (en) * 2005-07-12 2007-01-18 Fabio Benedetti Method, system and computer program for automatic provisioning of resources to scheduled jobs
CN102801809A (en) * 2012-08-20 2012-11-28 深圳市佳创视讯技术股份有限公司 Resource scheduling system
CN103763346A (en) * 2013-12-31 2014-04-30 华为技术有限公司 Distributed resource scheduling method and device
US10176550B1 (en) * 2017-03-20 2019-01-08 Nutanix, Inc. GPU resource usage display and dynamic GPU resource allocation in a networked virtualization system
CN110287003A (en) * 2019-06-28 2019-09-27 北京九章云极科技有限公司 The management method and management system of resource
CN110858161A (en) * 2018-08-24 2020-03-03 阿里巴巴集团控股有限公司 Resource allocation method, device, system, equipment and medium
CN112019453A (en) * 2019-05-29 2020-12-01 潘仲光 Resource reallocation method, equipment and storage medium
CN112685153A (en) * 2020-12-25 2021-04-20 广州奇盾信息技术有限公司 Micro-service scheduling method and device and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070016907A1 (en) * 2005-07-12 2007-01-18 Fabio Benedetti Method, system and computer program for automatic provisioning of resources to scheduled jobs
CN102801809A (en) * 2012-08-20 2012-11-28 深圳市佳创视讯技术股份有限公司 Resource scheduling system
CN103763346A (en) * 2013-12-31 2014-04-30 华为技术有限公司 Distributed resource scheduling method and device
US10176550B1 (en) * 2017-03-20 2019-01-08 Nutanix, Inc. GPU resource usage display and dynamic GPU resource allocation in a networked virtualization system
CN110858161A (en) * 2018-08-24 2020-03-03 阿里巴巴集团控股有限公司 Resource allocation method, device, system, equipment and medium
CN112019453A (en) * 2019-05-29 2020-12-01 潘仲光 Resource reallocation method, equipment and storage medium
CN110287003A (en) * 2019-06-28 2019-09-27 北京九章云极科技有限公司 The management method and management system of resource
CN112685153A (en) * 2020-12-25 2021-04-20 广州奇盾信息技术有限公司 Micro-service scheduling method and device and electronic equipment

Also Published As

Publication number Publication date
CN115408098A (en) 2022-11-29

Similar Documents

Publication Publication Date Title
US11048442B2 (en) Scalable in-memory object storage system using hybrid memory devices
US8285961B2 (en) Dynamic performance virtualization for disk access
US9652150B2 (en) Global memory sharing method and apparatus, and communications system
US8060610B1 (en) Multiple server workload management using instant capacity processors
CN107430529B (en) Load balancing device for large-scale memory database
US20130055279A1 (en) Resource allocation tree
CN106469018B (en) Load monitoring method and device for distributed storage system
US9069623B2 (en) Management apparatus, method, and privileged and confidential medium storing program to migrate a virtual machine when a resource shortage or booting occurs
CN107533435B (en) Storage space allocation method and storage equipment
CN110287127A (en) A kind of Nonvolatile memory management method and system that more granularity multicores are expansible
US20220407817A1 (en) Resource allocation using distributed segment processing credits
CN109150759B (en) Progressive non-blocking opportunity resource reservation method and system
CN110750498B (en) Object access method, device and storage medium
WO2022247287A1 (en) Resource scheduling method and apparatus
CN110308965B (en) Rule-based heuristic virtual machine distribution method and system for cloud data center
US9697048B2 (en) Non-uniform memory access (NUMA) database management system
CN110178119B (en) Method, device and storage system for processing service request
CN108616583B (en) Storage space allocation method based on computer cloud
CN112805684A (en) Resource allocation using recovery borrowing
CN112783803B (en) Computer CPU-GPU shared cache control method and system
CN113157605B (en) Resource allocation method, system, storage medium and computing device for two-level cache
CN114860449A (en) Data processing method, device, equipment and storage medium
CN108520053B (en) Big data query method based on data distribution
CN113364648A (en) Flow control method, system, device, service equipment and storage medium
CN113010453A (en) Memory management method, system, equipment and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21942850

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE