CN106936874A - Physical source distributing method, apparatus and system - Google Patents
Physical source distributing method, apparatus and system Download PDFInfo
- Publication number
- CN106936874A CN106936874A CN201511026242.9A CN201511026242A CN106936874A CN 106936874 A CN106936874 A CN 106936874A CN 201511026242 A CN201511026242 A CN 201511026242A CN 106936874 A CN106936874 A CN 106936874A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- hard disk
- memory capacity
- capacity
- request
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000008859 change Effects 0.000 claims abstract description 43
- 238000012508 change request Methods 0.000 claims abstract description 29
- 238000013468 resource allocation Methods 0.000 claims abstract description 28
- 230000014759 maintenance of location Effects 0.000 claims 4
- 238000010187 selection method Methods 0.000 description 23
- 230000008901 benefit Effects 0.000 description 7
- 239000002699 waste material Substances 0.000 description 5
- 238000010586 diagram Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/30—Profiles
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例提供了一种物理资源分配方法、装置及系统。该方法中,接收用户通过终端发出的虚拟机请求,判断虚拟机请求所携带的硬盘容量与内存容量的目标比值是否超过预定比值;如果超过,按照虚拟机请求所携带的硬盘容量和内存容量,基于所关联的物理机为用户分配云端虚拟机;如果未超过,向终端反馈关于按照预定比值更改硬盘容量与内存容量的通知信息;在接收变更请求时,判断变更后硬盘容量与变更后内存容量的变更后比值是否超过该预定比值,如果是,按照变更后硬盘容量和变更后内存容量,基于所关联的物理机为用户分配云端虚拟机。本方案提供了更优化的物理资源的配置,可提高云端服务器所关联的物理机的硬盘资源和内存资源的利用率。
Embodiments of the present invention provide a physical resource allocation method, device and system. In this method, a virtual machine request sent by a user through a terminal is received, and it is judged whether the target ratio of the hard disk capacity carried by the virtual machine request to the memory capacity exceeds a predetermined ratio; if so, according to the hard disk capacity and memory capacity carried by the virtual machine request, Allocate cloud virtual machines to users based on the associated physical machine; if not exceeded, feed back notification information to the terminal about changing the hard disk capacity and memory capacity according to the predetermined ratio; when receiving a change request, judge the changed hard disk capacity and memory capacity after change Whether the changed ratio exceeds the predetermined ratio, and if so, according to the changed hard disk capacity and changed memory capacity, the cloud virtual machine is allocated to the user based on the associated physical machine. This solution provides a more optimized configuration of physical resources, which can improve the utilization rate of hard disk resources and memory resources of the physical machines associated with the cloud server.
Description
技术领域technical field
本发明涉及资源分配技术领域,特别是涉及计算机硬件物理资源分配方法、装置及系统。The invention relates to the technical field of resource allocation, in particular to a computer hardware physical resource allocation method, device and system.
背景技术Background technique
如今,用户可以不购买物理机,而通过向云端服务器请求购买云端虚拟机的方式来获得计算机资源,其中,用户所请求的云端虚拟机为:云端服务器为用户所分配的云端的物理机中的物理资源,即:云端的物理机为用户所请求云端虚拟机的物理资源提供者。Nowadays, instead of purchasing a physical machine, a user can obtain computer resources by requesting a cloud server to purchase a cloud virtual machine. Physical resources, namely: the physical machine in the cloud is the physical resource provider of the cloud virtual machine requested by the user.
现有技术中,云端服务器在接收到用户通过终端发送的虚拟机请求后,根据虚拟机请求所携带的硬盘容量和内存容量为用户分配虚拟机,而由于虚拟机请求所携带的硬盘容量和内存容量多种多样,且用户对用于保证运行速度的内存容量的需求较为高,这样会带来如下问题:物理机的内存已经被分配完毕,但是,硬盘还剩余较多的容量,而由于该物理机的物理资源独立于其他物理资源被使用,这无疑使得该物理机的较多的硬盘资源被浪费了。举例而言:物理机A的硬盘容量为500G,内存容量为8G,假设用户a所请求的云端虚拟机为:硬盘容量为50G、内存容量为2G,用户b所请求的云端虚拟机为:硬盘容量为100G、内存容量为2G,用户c所请求的云端虚拟机为:硬盘容量为200G、内存容量为4G,此时,该物理机A的内存被全部分配,但是,还剩余150G的硬盘,使得该物理机无法作为其他用户所请求云端虚拟机的物理资源提供者。In the prior art, after receiving the virtual machine request sent by the user through the terminal, the cloud server allocates a virtual machine to the user according to the hard disk capacity and memory capacity carried in the virtual machine request, and because the hard disk capacity and memory capacity carried in the virtual machine request There are various capacities, and users have relatively high demands on the memory capacity used to ensure the running speed, which will cause the following problems: the memory of the physical machine has been allocated, but there is still a lot of capacity left on the hard disk, and due to the The physical resources of the physical machine are used independently of other physical resources, which undoubtedly wastes more hard disk resources of the physical machine. For example: the hard disk capacity of physical machine A is 500G, and the memory capacity is 8G. Assume that the cloud virtual machine requested by user a is: the hard disk capacity is 50G, and the memory capacity is 2G. The cloud virtual machine requested by user b is: hard disk The capacity is 100G, the memory capacity is 2G, and the cloud virtual machine requested by user c is: the hard disk capacity is 200G, and the memory capacity is 4G. At this time, the memory of the physical machine A is fully allocated, but there is still 150G hard disk left. This makes the physical machine unable to serve as a physical resource provider for cloud virtual machines requested by other users.
可见,现有技术中,作为云端虚拟机的物理资源提供者的物理机得不到有效利用,存在资源浪费现象,这样导致了物理机的收益受到严重影响。It can be seen that in the prior art, the physical machine serving as the physical resource provider of the cloud virtual machine cannot be effectively utilized, and there is a waste of resources, which seriously affects the revenue of the physical machine.
发明内容Contents of the invention
本发明实施例的目的在于提供一种物理资源分配方法、装置及系统,提供更优化的物理资源的配置,以提高云端服务器所关联的物理机的硬盘资源和内存资源的利用率,从而保证云端服务器所关联的物理机达到最大收益。具体技术方案如下:The purpose of the embodiments of the present invention is to provide a physical resource allocation method, device, and system to provide a more optimized configuration of physical resources to improve the utilization rate of hard disk resources and memory resources of the physical machine associated with the cloud server, thereby ensuring that the cloud The physical machine associated with the server achieves the maximum benefit. The specific technical scheme is as follows:
第一方面,本发明实施例提供了一种物理资源分配方法,应用于云端服务器,所述方法包括:In the first aspect, an embodiment of the present invention provides a method for allocating physical resources, which is applied to a cloud server, and the method includes:
接收用户通过终端发出的虚拟机请求,其中,所述虚拟机请求携带有所要请求云端虚拟机的硬盘容量与内存容量的信息;receiving a virtual machine request sent by a user through a terminal, wherein the virtual machine request carries information about the hard disk capacity and memory capacity of the cloud virtual machine to be requested;
判断所述硬盘容量与所述内存容量的目标比值是否超过预定比值;judging whether the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio;
如果超过,则按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为所述用户分配云端虚拟机;If it exceeds, according to the hard disk capacity and the memory capacity carried in the virtual machine request, allocate a cloud virtual machine to the user based on the associated physical machine;
如果未超过,向所述终端反馈关于按照所述预定比值更改所述硬盘容量与所述内存容量的通知信息,以使得所述终端在接收到所述通知信息后,输出与所述通知信息对应的变更提示信息;If not, feed back notification information to the terminal about changing the hard disk capacity and the internal memory capacity according to the predetermined ratio, so that the terminal outputs information corresponding to the notification information after receiving the notification information. change prompt information;
在接收到所述用户通过所述终端发送的携带有所请求云端虚拟机的变更后硬盘容量与变更后内存容量的变更请求时,判断所述变更后硬盘容量与所述变更后内存容量的变更后比值是否超过所述预定比值,如果是,按照所述变更后硬盘容量和所述变更后内存容量,基于所关联的物理机为所述用户分配云端虚拟机,其中,所述变更请求为用户基于所述终端所输出的变更提示信息所发出的。When receiving the change request carrying the changed hard disk capacity and changed memory capacity of the requested cloud virtual machine sent by the user through the terminal, determining the change of the changed hard disk capacity and the changed memory capacity Whether the ratio after the change exceeds the predetermined ratio, if so, according to the hard disk capacity after the change and the memory capacity after the change, allocate a cloud virtual machine to the user based on the associated physical machine, wherein the change request is the user Based on the change prompt information output by the terminal.
可选的,本发明实施例所提供的一种物理资源分配方法还包括:Optionally, a physical resource allocation method provided in an embodiment of the present invention further includes:
在接收到所述用户通过所述终端发送的虚拟机保留请求时,按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为用户分配云端虚拟机,并且,按照预定计价策略,调高所请求云端虚拟机所对应的计价,其中,所述虚拟机保留请求为用户基于所述终端输出的变更提示信息所发出的。When receiving the virtual machine reservation request sent by the user through the terminal, according to the hard disk capacity and the memory capacity carried in the virtual machine request, allocate a cloud virtual machine to the user based on the associated physical machine, And, according to a predetermined pricing policy, the pricing corresponding to the requested cloud virtual machine is increased, wherein the virtual machine reservation request is sent by the user based on the change prompt information output by the terminal.
可选的,所述按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为所述用户分配云端虚拟机,包括:Optionally, according to the hard disk capacity and the memory capacity carried in the virtual machine request, allocating the cloud virtual machine to the user based on the associated physical machine includes:
从剩余硬盘容量满足所述虚拟机请求所携带的所述硬盘容量且剩余内存容量满足所述虚拟机请求所携带的所述内存容量的至少一台物理机中,确定为所述用户分配云端虚拟机的目标物理机;From at least one physical machine whose remaining hard disk capacity satisfies the hard disk capacity carried by the virtual machine request and whose remaining memory capacity satisfies the memory capacity carried by the virtual machine request, determine to allocate cloud virtualization to the user. The target physical machine of the machine;
基于所述目标物理机为所述用户分配云端虚拟机。Allocating a cloud virtual machine to the user based on the target physical machine.
可选的,所述确定为所述用户分配云端虚拟机的目标物理机,包括:Optionally, the determining the target physical machine for allocating the cloud virtual machine to the user includes:
通过随机选择方式或预定选择方式,确定为所述用户分配云端虚拟机的目标物理机,其中,所述预定选择方式为基于剩余物理资源大小所确定的方式。The target physical machine for allocating the cloud virtual machine to the user is determined by a random selection method or a predetermined selection method, wherein the predetermined selection method is determined based on the size of remaining physical resources.
可选的,所述通知信息还包括硬盘容量与内存容量的各个比值所对应计价。Optionally, the notification information also includes pricing corresponding to each ratio of hard disk capacity to memory capacity.
可选的,所述预定比值为:31:1。Optionally, the predetermined ratio is: 31:1.
第二方面,本发明实施例提供了一种物理资源分配装置,应用于云端服务器,所述装置包括:虚拟机请求接收模块、比值判断模块、资源分配模块、通知信息发送模块和变更请求处理模块;其中,In the second aspect, the embodiment of the present invention provides a physical resource allocation device, which is applied to a cloud server, and the device includes: a virtual machine request receiving module, a ratio judgment module, a resource allocation module, a notification information sending module, and a change request processing module ;in,
所述虚拟机请求接收模块,用于接收用户通过终端发出的虚拟机请求,其中,所述虚拟机请求携带有所要请求云端虚拟机的硬盘容量与内存容量的信息;The virtual machine request receiving module is configured to receive a virtual machine request sent by a user through a terminal, wherein the virtual machine request carries information about the hard disk capacity and memory capacity of the cloud virtual machine to be requested;
所述比值判断模块,用于判断所述硬盘容量与所述内存容量的目标比值是否超过预定比值,如果超过,触发资源分配模块,如果未超过,触发通知信息发送模块;The ratio judging module is used to judge whether the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio, if so, trigger the resource allocation module, and if not, trigger the notification information sending module;
资源分配模块,用于按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为所述用户分配云端虚拟机;A resource allocation module, configured to allocate a cloud virtual machine to the user based on the associated physical machine according to the hard disk capacity and the memory capacity carried in the virtual machine request;
所述通知信息发送模块,用于向所述终端反馈关于按照所述预定比值更改所述硬盘容量与所述内存容量的通知信息,以使得所述终端在接收到所述通知信息后,输出与所述通知信息对应的变更提示信息;The notification information sending module is configured to feed back to the terminal notification information about changing the hard disk capacity and the memory capacity according to the predetermined ratio, so that the terminal outputs the same information as the notification information after receiving the notification information. Change prompt information corresponding to the notification information;
所述变更请求处理模块,用于在接收到所述用户通过所述终端发送的携带有所要请求云端虚拟机的变更后硬盘容量与变更后内存容量的信息的变更请求时,判断所述变更后硬盘容量与所述变更后内存容量的变更后比值是否超过所述预定比值,如果是,按照所述变更后硬盘容量和所述变更后内存容量,基于所关联的物理机为所述用户分配云端虚拟机,其中,所述变更请求为用户基于所述终端所输出的变更提示信息所发出的。The change request processing module is configured to, when receiving the change request sent by the user through the terminal and carrying the information of the changed hard disk capacity and the changed memory capacity of the requested cloud virtual machine, to determine whether the changed Whether the changed ratio of the hard disk capacity to the changed memory capacity exceeds the predetermined ratio, and if so, according to the changed hard disk capacity and the changed memory capacity, the user is assigned a cloud based on the associated physical machine A virtual machine, wherein the change request is sent by the user based on the change prompt information output by the terminal.
可选的,本发明实施例所提供的一种物理资源分配装置还包括:保留请求处理模块;Optionally, the device for allocating physical resources provided by the embodiment of the present invention further includes: a reservation request processing module;
所述保留请求处理模块,用于在接收到所述用户通过所述终端发送的虚拟机保留请求时,按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为用户分配云端虚拟机,并且,按照预定计价策略,调高所请求云端虚拟机所对应的计价,其中,所述虚拟机保留请求为用户基于所述终端输出的变更提示信息所发出的。The reservation request processing module is configured to, when receiving the virtual machine reservation request sent by the user through the terminal, according to the hard disk capacity and the memory capacity carried in the virtual machine request, based on the associated The physical machine allocates a cloud virtual machine to the user, and, according to a predetermined pricing strategy, increases the pricing corresponding to the requested cloud virtual machine, wherein the virtual machine reservation request is issued by the user based on the change prompt information output by the terminal .
可选的,所述资源分配模块,包括:Optionally, the resource allocation module includes:
目标物理机确定单元,用于从剩余硬盘容量满足所述虚拟机请求所携带的所述硬盘容量且剩余内存容量满足所述虚拟机请求所携带的所述内存容量的至少一台物理机中,确定为所述用户分配云端虚拟机的目标物理机;A target physical machine determining unit, configured to select from at least one physical machine whose remaining hard disk capacity satisfies the hard disk capacity carried by the virtual machine request and whose remaining memory capacity satisfies the memory capacity carried by the virtual machine request, Determine the target physical machine for allocating the cloud virtual machine to the user;
虚拟机分配单元,用于基于所述目标物理机为所述用户分配云端虚拟机。A virtual machine allocation unit, configured to allocate a cloud virtual machine to the user based on the target physical machine.
可选的,所述目标物理机确定单元具体用于通过随机选择方式或预定选择方式,确定为所述用户分配云端虚拟机的目标物理机,其中,所述预定选择方式为基于剩余物理资源大小所确定的方式。Optionally, the target physical machine determining unit is specifically configured to determine the target physical machine for allocating the cloud virtual machine to the user through a random selection method or a predetermined selection method, wherein the predetermined selection method is based on the size of the remaining physical resources determined manner.
可选的,所述通知信息还包括硬盘容量与内存容量的各个比值所对应计价。Optionally, the notification information also includes pricing corresponding to each ratio of hard disk capacity to memory capacity.
可选的,所述预定比值为:31:1。Optionally, the predetermined ratio is: 31:1.
第三方面,本发明实施例提供了一种物理资源分配系统,包括:In a third aspect, an embodiment of the present invention provides a physical resource allocation system, including:
云端服务器以及与所述云端服务器关联的至少一台物理机;A cloud server and at least one physical machine associated with the cloud server;
其中,所述云端服务器用于:Wherein, the cloud server is used for:
接收用户通过终端发出的虚拟机请求,其中,所述虚拟机请求携带有所要请求云端虚拟机的硬盘容量与内存容量的信息;receiving a virtual machine request sent by a user through a terminal, wherein the virtual machine request carries information about the hard disk capacity and memory capacity of the cloud virtual machine to be requested;
判断所述硬盘容量与所述内存容量的目标比值是否超过预定比值;judging whether the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio;
如果超过,则按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为所述用户分配云端虚拟机;If it exceeds, according to the hard disk capacity and the memory capacity carried in the virtual machine request, allocate a cloud virtual machine to the user based on the associated physical machine;
如果未超过,向所述终端反馈关于按照所述预定比值更改所述硬盘容量与所述内存容量的通知信息,以使得所述终端在接收到所述通知信息后,输出与所述通知信息对应的变更提示信息;If not, feed back notification information to the terminal about changing the hard disk capacity and the internal memory capacity according to the predetermined ratio, so that the terminal outputs information corresponding to the notification information after receiving the notification information. change prompt information;
在接收到所述用户通过所述终端发送的携带有所要请求云端虚拟机的变更后硬盘容量与变更后内存容量的信息的变更请求时,判断所述变更后硬盘容量与所述变更后内存容量的变更后比值是否超过所述预定比值,如果是,按照所述变更后硬盘容量和所述变更后内存容量,基于所关联的物理机为所述用户分配云端虚拟机,其中,所述变更请求为用户基于所述终端所输出的变更提示信息所发出的。When receiving the change request sent by the user through the terminal and carrying information about the changed hard disk capacity and the changed memory capacity of the requested cloud virtual machine, determine the changed hard disk capacity and the changed memory capacity Whether the changed ratio exceeds the predetermined ratio, and if so, according to the changed hard disk capacity and the changed memory capacity, the cloud virtual machine is allocated to the user based on the associated physical machine, wherein the change request It is issued by the user based on the change prompt information output by the terminal.
可选的,所述云端服务器还用于:Optionally, the cloud server is also used for:
在接收到所述用户通过所述终端发送的虚拟机保留请求时,按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为用户分配云端虚拟机,并且,按照预定计价策略,调高所请求云端虚拟机所对应的计价,其中,所述虚拟机保留请求为用户基于所述终端输出的变更提示信息所发出的。When receiving the virtual machine reservation request sent by the user through the terminal, according to the hard disk capacity and the memory capacity carried in the virtual machine request, allocate a cloud virtual machine to the user based on the associated physical machine, And, according to a predetermined pricing policy, the pricing corresponding to the requested cloud virtual machine is increased, wherein the virtual machine reservation request is sent by the user based on the change prompt information output by the terminal.
可选的,所述云端服务器具体用于:Optionally, the cloud server is specifically used for:
从剩余硬盘容量满足所述虚拟机请求所携带的所述硬盘容量且剩余内存容量满足所述虚拟机请求所携带的所述内存容量的至少一台物理机中,确定为所述用户分配云端虚拟机的目标物理机;From at least one physical machine whose remaining hard disk capacity satisfies the hard disk capacity carried by the virtual machine request and whose remaining memory capacity satisfies the memory capacity carried by the virtual machine request, determine to allocate cloud virtualization to the user. The target physical machine of the machine;
基于所述目标物理机为所述用户分配云端虚拟机。Allocating a cloud virtual machine to the user based on the target physical machine.
可选的,所述云端服务器具体用于:通过随机选择方式或预定选择方式,确定为所述用户分配云端虚拟机的目标物理机,其中,所述预定选择方式为基于剩余物理资源大小所确定的方式。Optionally, the cloud server is specifically configured to: determine the target physical machine for allocating the cloud virtual machine to the user through a random selection method or a predetermined selection method, wherein the predetermined selection method is determined based on the size of the remaining physical resources The way.
可选的,所述通知信息还包括硬盘容量与内存容量的各个比值所对应计价。Optionally, the notification information also includes pricing corresponding to each ratio of hard disk capacity to memory capacity.
可选的,所述预定比值为:31:1。Optionally, the predetermined ratio is: 31:1.
与现有技术相比,本发明实施例中,云端服务器在接收到用户通过终端发出的虚拟机请求时,并不是直接按照该虚拟机请求的信息为用户分配云端虚拟机,而是,判断虚拟机请求所携带的硬盘容量与该内存容量的目标比值是否超过预定比值,并根据不同的判断结果执行不同的操作,提供了更优化的物理资源的配置,因此,通过本方案提高了云端服务器所关联物理机的硬盘资源和内存资源的利用率,进而保证云端服务器所关联的物理机达到最大收益。Compared with the prior art, in the embodiment of the present invention, when the cloud server receives a virtual machine request sent by the user through the terminal, it does not directly assign the cloud virtual machine to the user according to the information requested by the virtual machine, but judges the virtual machine. Whether the target ratio of the hard disk capacity carried by the machine request to the memory capacity exceeds the predetermined ratio, and perform different operations according to different judgment results, providing a more optimized configuration of physical resources. Therefore, this solution improves the cloud server. The utilization rate of the hard disk resource and memory resource of the associated physical machine can ensure the maximum benefit of the physical machine associated with the cloud server.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例所提供的一种物理资源分配方法的流程图;FIG. 1 is a flow chart of a method for allocating physical resources provided by an embodiment of the present invention;
图2为本发明实施例所提供的一种物理资源分配方法的另一流程图;FIG. 2 is another flowchart of a method for allocating physical resources provided by an embodiment of the present invention;
图3为本发明实施例所提供的一种物理资源分配装置的结构示意图;FIG. 3 is a schematic structural diagram of a physical resource allocation device provided by an embodiment of the present invention;
图4为本发明实施例所提供的一种物理资源分配装置的另一结构示意图;FIG. 4 is another schematic structural diagram of a physical resource allocation device provided by an embodiment of the present invention;
图5为本发明实施例所提供的一种物理资源分配系统的结构示意图。FIG. 5 is a schematic structural diagram of a physical resource allocation system provided by an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
为了解决现有技术问题,本发明实施例提供了一种物理资源分配方法及装置。In order to solve the problems in the prior art, embodiments of the present invention provide a physical resource allocation method and device.
下面首先对本发明实施例所提供的一种物理资源分配方法进行介绍。A method for allocating physical resources provided by an embodiment of the present invention is firstly introduced below.
需要说明的是,本发明实施例所提供的一种物理资源分配方法应用于云端服务器,该云端服务器为用户侧分配云端虚拟机;并且,云端服务器关联有多台物理机,所关联的物理机作为用户所请求云端虚拟机的物理资源提供者,同时,为用户侧所分配的每一云端虚拟机对应唯一的一台物理机,即为用户侧所分配云端虚拟机所基于的多台物理机的物理资源独立被利用。It should be noted that a method for allocating physical resources provided by an embodiment of the present invention is applied to a cloud server, and the cloud server allocates a cloud virtual machine for the user side; moreover, the cloud server is associated with multiple physical machines, and the associated physical machines As the physical resource provider of the cloud virtual machine requested by the user, at the same time, each cloud virtual machine allocated on the user side corresponds to a unique physical machine, that is, multiple physical machines on which the cloud virtual machine allocated on the user side is based The physical resources are utilized independently.
如图1所示,本发明实施例所提供的一种物理资源分配方法,可以包括如下步骤:As shown in Figure 1, a method for allocating physical resources provided by an embodiment of the present invention may include the following steps:
S101,接收用户通过终端发出的虚拟机请求,其中,该虚拟机请求携带有所要请求云端虚拟机的硬盘容量与内存容量的信息;S101. Receive a virtual machine request sent by a user through a terminal, where the virtual machine request carries information about the hard disk capacity and memory capacity of the cloud virtual machine to be requested;
其中,云端服务器可以接收用户通过终端发出的虚拟机请求,并根据所接收到的虚拟机请求执行后续的操作。Wherein, the cloud server can receive the virtual machine request sent by the user through the terminal, and perform subsequent operations according to the received virtual machine request.
可以理解的是,用户可以通过终端访问云端服务器所对应的网络站点,进而在该网络站点所提供的虚拟机请求界面中输入所需的硬盘容量与内存容量,从而形成携带有所要请求云端虚拟机的硬盘容量与内存容量的信息的虚拟机请求。当然,用户通过终端发出虚拟机请求的方式还可以采用其他现有技术实现,在此不做限定。It can be understood that the user can access the network site corresponding to the cloud server through the terminal, and then input the required hard disk capacity and memory capacity in the virtual machine request interface provided by the network site, so as to form a cloud virtual machine carrying the required request. The virtual machine requests information about the hard disk capacity and memory capacity. Of course, the manner in which the user sends the virtual machine request through the terminal can also be implemented by using other existing technologies, which is not limited here.
S102,判断该硬盘容量与该内存容量的目标比值是否超过预定比值,如果超过,执行S103;否则,执行S104;S102, judging whether the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio, if so, execute S103; otherwise, execute S104;
其中,申请人通过统计分析确定出该预定比值,也就是说,预定比值为预先确定出经验值。具体的,当所请求云端虚拟机的硬盘容量和内容容量的比值超过该预定比值时,如果按照该虚拟机请求来分配云端虚拟机,表明硬盘资源的请求量大于内存资源预定程度,此时,会减少硬盘资源的浪费率;而当所请求云端虚拟机的硬盘容量和内容容量的比值不超过该预定比值时,如果按照该虚拟机请求来分配云端虚拟机,表明硬盘资源的请求量未大于内存资源预定程度,后续会导致硬盘资源存在浪费。具体的,该预定比值可以为:31:1,当然并不局限于此。Wherein, the applicant determines the predetermined ratio through statistical analysis, that is to say, the predetermined ratio is a predetermined empirical value. Specifically, when the ratio of the hard disk capacity and content capacity of the requested cloud virtual machine exceeds the predetermined ratio, if the cloud virtual machine is allocated according to the virtual machine request, it indicates that the requested amount of hard disk resources is greater than the predetermined level of memory resources. At this time, the Reduce the waste rate of hard disk resources; and when the ratio of the hard disk capacity and content capacity of the requested cloud virtual machine does not exceed the predetermined ratio, if the cloud virtual machine is allocated according to the virtual machine request, it indicates that the requested amount of hard disk resources is not greater than the memory resource The predetermined level will cause a waste of hard disk resources in the future. Specifically, the predetermined ratio may be: 31:1, but of course it is not limited thereto.
因此,云端服务器在接收到虚拟机请求后,为了提高云端服务器所关联的物理机的硬盘资源和内存资源的利用率,并不是直接按照所接收到的虚拟机请求为用户分配虚拟机,而是首先判断该硬盘容量与该内存容量的目标比值是否超过预定比值,并根据不同的判断结果执行不同的操作。具体的,当判断出该硬盘容量与该内存容量的目标比值超过预定比值时,表明按照该目标比值来分配云端虚拟机时硬盘资源和内存资源能够得到有效利用,此时,可以执行S103;而当判断出该硬盘容量与该内存容量的目标比值未超过预定比值时,表明按照该目标比值来分配云端虚拟机时后续会导致硬盘资源被浪费,此时,可以执行S104。Therefore, after the cloud server receives the virtual machine request, in order to improve the utilization rate of the hard disk resources and memory resources of the physical machine associated with the cloud server, it does not directly allocate the virtual machine to the user according to the received virtual machine request, but Firstly, it is judged whether the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio, and different operations are performed according to different judgment results. Specifically, when it is determined that the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio, it indicates that the hard disk resources and memory resources can be effectively used when the cloud virtual machine is allocated according to the target ratio, and at this time, S103 can be executed; and When it is judged that the target ratio of the hard disk capacity to the memory capacity does not exceed the predetermined ratio, it indicates that allocating cloud virtual machines according to the target ratio will result in waste of hard disk resources. At this time, S104 may be executed.
S103,按照该虚拟机请求所携带的该硬盘容量和该内存容量,基于所关联的物理机为该用户分配云端虚拟机;S103, according to the hard disk capacity and the memory capacity carried in the virtual machine request, allocate a cloud virtual machine to the user based on the associated physical machine;
其中,在判断出该硬盘容量与该内存容量的目标比值超过预定比值时,云端服务器可以按照该虚拟机请求所携带的该硬盘容量和该内存容量,基于所关联的物理机为该用户分配云端虚拟机。可以理解的是,由于云端服务器关联有多台物理机,因此,在分配云端虚拟机时,云端服务器可以从剩余硬盘容量和剩余内存容量均满足该虚拟机请求的至少一台物理机中,选择一台物理机来为该用户分配云端虚拟机。Wherein, when it is judged that the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio, the cloud server may assign the cloud server to the user based on the associated physical machine according to the hard disk capacity and the memory capacity carried in the virtual machine request. virtual machine. It can be understood that since the cloud server is associated with multiple physical machines, when allocating a cloud virtual machine, the cloud server can select from at least one physical machine whose remaining hard disk capacity and remaining memory capacity can meet the request of the virtual machine. A physical machine is used to allocate cloud virtual machines to the user.
基于上述原理,具体的,所述按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为所述用户分配云端虚拟机,可以包括:Based on the above principles, specifically, assigning a cloud virtual machine to the user based on the associated physical machine based on the hard disk capacity and the memory capacity carried in the virtual machine request may include:
从剩余硬盘容量满足该虚拟机请求所携带的所述硬盘容量且剩余内存容量满足该虚拟机请求所携带的该内存容量的至少一台物理机中,确定为该用户分配云端虚拟机的目标物理机;From at least one physical machine whose remaining hard disk capacity satisfies the hard disk capacity carried by the virtual machine request and whose remaining memory capacity satisfies the memory capacity carried by the virtual machine request, determine the target physical machine for allocating the cloud virtual machine to the user. machine;
基于该目标物理机为该用户分配云端虚拟机。A cloud virtual machine is allocated to the user based on the target physical machine.
进一步的,可以通过随机选择方式或预定选择方式,确定为该用户分配云端虚拟机的目标物理机,当然并不局限于此,其中,该预定选择方式为基于剩余物理资源大小所确定的方式。举例而言,该预定选择方式可以为:优先选择剩余物理资源最少的方式,或者,优先选择剩余物理资源最多的方式,等等。Further, the target physical machine for allocating the cloud virtual machine to the user may be determined by a random selection method or a predetermined selection method, which is of course not limited thereto, wherein the predetermined selection method is determined based on the size of the remaining physical resources. For example, the predetermined selection method may be: preferentially select a method with the least remaining physical resources, or preferentially select a method with the most remaining physical resources, and so on.
需要强调的是,上述的按照该虚拟机请求所携带的该硬盘容量和该内存容量,基于所关联的物理机为该用户分配云端虚拟机的具体实现方式,仅仅作为示例,并不应该构成对本发明实施例的限定;另外,基于该目标物理机为该用户分配云端虚拟机的具体实现方式可以采用现有技术来实现,在此不做限定。It should be emphasized that the above-mentioned specific implementation method of allocating the cloud virtual machine to the user based on the associated physical machine based on the hard disk capacity and the memory capacity carried in the virtual machine request is only an example and should not constitute a Restrictions of the embodiments of the invention; in addition, the specific implementation manner of allocating the cloud virtual machine to the user based on the target physical machine can be realized by using existing technologies, and is not limited here.
S104,向该终端反馈关于按照该预定比值更改该硬盘容量与该内存容量的通知信息,以使得该终端在接收到该通知信息后,输出与该通知信息对应的变更提示信息;S104, feeding back notification information to the terminal about changing the hard disk capacity and the memory capacity according to the predetermined ratio, so that the terminal outputs change prompt information corresponding to the notification information after receiving the notification information;
其中,在判断出该硬盘容量与该内存容量的目标比值未超过预定比值时,为了提高物理机的硬盘资源和内存资源的利用率,云端服务器可以向该终端反馈关于按照该预定比值更改该硬盘容量与该内存容量的通知信息,以使得该终端在接收到该通知信息后,输出与该通知信息对应的变更提示信息,进而,用户可以基于该变更提示信息作出相应选择。需要强调的是,变更提示信息可以为用户提供硬盘容量和内存容量的修改入口以及保存并上传的入口。Wherein, when it is judged that the target ratio of the hard disk capacity to the memory capacity does not exceed a predetermined ratio, in order to improve the utilization rate of the hard disk resources and memory resources of the physical machine, the cloud server may feed back to the terminal about changing the hard disk according to the predetermined ratio. Capacity and the notification information of the memory capacity, so that after receiving the notification information, the terminal outputs change prompt information corresponding to the notification information, and furthermore, the user can make a corresponding choice based on the change prompt information. It should be emphasized that the change prompt information can provide the user with an entry for modifying the hard disk capacity and memory capacity, as well as an entry for saving and uploading.
可以理解的是,通知信息所携带内容和变更提示信息所携带内容可以相同或不同,这都是合理的;并且,变更提示信息的具体展示形式可以弹窗形式或web界面形式,等等,这都是合理的。举例而言:该变更提示信息的信息内容可以包括:“请更改所请求硬盘容量和内存容量,保证硬盘容量和内存容量的比值大于预定比值”;或者,“请按照硬盘容量/内存容量大于目标比值,来更改所请求的硬盘容量和内存容量”。It is understandable that the content carried in the notification information and the content carried in the change prompt information may be the same or different, which is reasonable; and the specific display form of the change prompt information may be in the form of a pop-up window or a web interface, etc. All reasonable. For example: the information content of the change prompt message may include: "Please change the requested hard disk capacity and memory capacity to ensure that the ratio of hard disk capacity to memory capacity is greater than the predetermined ratio"; Ratio, to change the requested hard disk capacity and memory capacity".
更进一步的,为了保证用户的使用体验,该通知信息还可以包括硬盘容量与内存容量的各个比值所对应计价;相应的,该变更提示信息的信息内容还包括:硬盘容量与内存容量的各个比值所对应计价,以使得用户根据计价信息来确定所请求云端虚拟机的资源信息。Furthermore, in order to ensure user experience, the notification information may also include pricing corresponding to each ratio of hard disk capacity to memory capacity; correspondingly, the information content of the change prompt information may also include: each ratio of hard disk capacity to memory capacity The corresponding pricing enables the user to determine the resource information of the requested cloud virtual machine according to the pricing information.
S105,在接收到该用户通过该终端发送的变更请求时,判断该变更后硬盘容量与该变更后内存容量的变更后比值是否超过该预定比值,如果是,执行S106;S105, when receiving the change request sent by the user through the terminal, determine whether the changed ratio of the changed hard disk capacity to the changed memory capacity exceeds the predetermined ratio, and if so, execute S106;
该变更请求携带有所要请求云端虚拟机的变更后硬盘容量与变更后内存容量的信息;其中,该变更请求为用户基于该终端所输出的变更提示信息所发出的。The change request carries information about the changed hard disk capacity and the changed memory capacity of the requested cloud virtual machine; wherein, the change request is sent by the user based on the change prompt information output by the terminal.
其中,云端服务器在接收到该用户通过该终端发送的变更请求时,可以判断该变更后硬盘容量与该变更后内存容量的变更后比值是否超过该预定比值,并在确定超过时,继续执行S106。Wherein, when the cloud server receives the change request sent by the user through the terminal, it can judge whether the changed ratio of the changed hard disk capacity to the changed internal memory capacity exceeds the predetermined ratio, and when it is determined to exceed, continue to execute S106 .
S106,按照该变更后硬盘容量和该变更后内存容量,基于所关联的物理机为该用户分配云端虚拟机。S106. According to the changed hard disk capacity and the changed memory capacity, allocate a cloud virtual machine to the user based on the associated physical machine.
其中,在判断出该变更后硬盘容量与该变更后内存容量的变更后比值超过该预定比值时,可以按照该变更后硬盘容量和该变更后内存容量,基于所关联的物理机为该用户分配云端虚拟机,以提高物理机的硬盘资源和内存资源的利用率。可以理解的是,由于云端服务器关联有多台物理机,因此,在分配云端虚拟机时,云端服务器可以从剩余硬盘容量和剩余内存容量均满足该变更请求的至少一台物理机中,选择一台物理机来为该用户分配云端虚拟机。Wherein, when it is judged that the changed ratio of the changed hard disk capacity to the changed memory capacity exceeds the predetermined ratio, the user may be assigned based on the associated physical machine according to the changed hard disk capacity and the changed memory capacity. Cloud virtual machines to improve the utilization of hard disk resources and memory resources of physical machines. It can be understood that since the cloud server is associated with multiple physical machines, when allocating cloud virtual machines, the cloud server can select a physical machine from at least one physical machine whose remaining hard disk capacity and remaining memory capacity meet the change request. A physical machine is used to allocate a cloud virtual machine to the user.
基于上述原理,具体的,所述按照该变更后硬盘容量和该变更后内存容量,基于所关联的物理机为该用户分配云端虚拟机,可以包括:Based on the above principles, specifically, according to the changed hard disk capacity and the changed memory capacity, allocating the cloud virtual machine to the user based on the associated physical machine may include:
从剩余硬盘容量满足该变更请求所携带的变更后硬盘容量且剩余内存容量满足该变更请求所携带的变更后内存容量的至少一台物理机中,确定为该用户分配云端虚拟机的目标物理机;From at least one physical machine whose remaining hard disk capacity satisfies the changed hard disk capacity carried by the change request and whose remaining memory capacity satisfies the changed memory capacity carried by the change request, determine the target physical machine for assigning the cloud virtual machine to the user ;
基于该目标物理机为该用户分配云端虚拟机。A cloud virtual machine is allocated to the user based on the target physical machine.
进一步的,可以通过随机选择方式或预定选择方式,确定为该用户分配云端虚拟机的目标物理机,当然并不局限于此,其中,该预定选择方式为基于剩余物理资源大小所确定的方式。举例而言,该预定选择方式可以为:优先选择剩余物理资源最少的方式,或者,优先选择剩余物理资源最多的方式,等等。Further, the target physical machine for allocating the cloud virtual machine to the user may be determined by a random selection method or a predetermined selection method, which is of course not limited thereto, wherein the predetermined selection method is determined based on the size of the remaining physical resources. For example, the predetermined selection method may be: preferentially select a method with the least remaining physical resources, or preferentially select a method with the most remaining physical resources, and so on.
可以理解的是,在判断出该变更后硬盘容量与该变更后内存容量的变更后比值未超过该预定比值时,可以依照S104提示用户修改所请求资源;或者,也可以按照该变更后硬盘容量和该变更后内存容量,基于所关联的物理机为该用户分配云端虚拟机,并且,而为了保证物理机达到最大收益,可以按照预定计价策略,调高所请求云端虚拟机所对应的计价。It can be understood that when it is determined that the changed ratio of the changed hard disk capacity to the changed memory capacity does not exceed the predetermined ratio, the user may be prompted to modify the requested resource according to S104; Based on the associated physical machine and the changed memory capacity, the cloud virtual machine is allocated to the user, and in order to ensure the maximum benefit of the physical machine, the pricing corresponding to the requested cloud virtual machine can be increased according to the predetermined pricing strategy.
与现有技术相比,本发明实施例中,云端服务器在接收到用户通过终端发出的虚拟机请求时,并不是直接按照该虚拟机请求的信息为用户分配云端虚拟机,而是,判断虚拟机请求所携带的硬盘容量与该内存容量的目标比值是否超过预定比值,并根据不同的判断结果执行不同的操作,提供了更优化的物理资源的配置,因此,通过本方案提高了云端服务器所关联物理机的硬盘资源和内存资源的利用率,进而保证云端服务器所关联的物理机达到最大收益。Compared with the prior art, in the embodiment of the present invention, when the cloud server receives a virtual machine request sent by the user through the terminal, it does not directly assign the cloud virtual machine to the user according to the information requested by the virtual machine, but judges the virtual machine. Whether the target ratio of the hard disk capacity carried by the machine request to the memory capacity exceeds the predetermined ratio, and perform different operations according to different judgment results, providing a more optimized configuration of physical resources. Therefore, this solution improves the cloud server. The utilization rate of the hard disk resource and memory resource of the associated physical machine can ensure the maximum benefit of the physical machine associated with the cloud server.
更进一步的,基于上述实施例所提供的S101-S106,本发明实施例所提供的一种物理资源分配方法还可以包括如下步骤:Furthermore, based on S101-S106 provided in the above embodiments, a method for allocating physical resources provided in the embodiments of the present invention may further include the following steps:
S107,在接收到该用户通过该终端发送的虚拟机保留请求时,按照该虚拟机请求所携带的该硬盘容量和该内存容量,基于所关联的物理机为用户分配云端虚拟机,并且,按照预定计价策略,调高所请求云端虚拟机所对应的计价。S107, when receiving the virtual machine reservation request sent by the user through the terminal, allocate a cloud virtual machine to the user based on the associated physical machine according to the hard disk capacity and the memory capacity carried in the virtual machine request, and, according to Predetermine the pricing strategy and increase the pricing corresponding to the requested cloud virtual machine.
其中,该虚拟机保留请求为用户基于该终端输出的变更提示信息所发出的。Wherein, the virtual machine reservation request is sent by the user based on the change prompt information output by the terminal.
可以理解的是,当用户决定不更改硬盘容量和内存容量的比值时,该用户可以基于该终端输出的变更提示信息发出虚拟机保留请求,相应的,云端服务器可以在接收到该用户基于该终端发送的虚拟机保留请求时,按照该虚拟机请求所携带的该硬盘容量和该内存容量,基于所关联的物理机为用户分配云端虚拟机,而为了保证所关联物理机达到最大收益,可以按照预定计价策略,调高所请求云端虚拟机所对应的计价。It can be understood that when the user decides not to change the ratio of hard disk capacity to memory capacity, the user can send a virtual machine reservation request based on the change prompt information output by the terminal. When sending a virtual machine reservation request, according to the hard disk capacity and memory capacity carried in the virtual machine request, the cloud virtual machine is allocated to the user based on the associated physical machine, and in order to ensure the maximum benefit of the associated physical machine, you can follow the Predetermine the pricing strategy and increase the pricing corresponding to the requested cloud virtual machine.
相应于上述方法实施例,本发明实施例还提供了一种物理资源分配装置,应用于云端服务器,如图3所示,所述装置可以包括:Corresponding to the above method embodiment, the embodiment of the present invention also provides a physical resource allocation device, which is applied to a cloud server. As shown in FIG. 3, the device may include:
虚拟机请求接收模块310、比值判断模块320、资源分配模块330、通知信息发送模块340和变更请求处理模块350;Virtual machine request receiving module 310, ratio judgment module 320, resource allocation module 330, notification information sending module 340 and change request processing module 350;
所述虚拟机请求接收模块310,用于接收用户通过终端发出的虚拟机请求,其中,所述虚拟机请求携带有所要请求云端虚拟机的硬盘容量与内存容量的信息;The virtual machine request receiving module 310 is configured to receive a virtual machine request sent by a user through a terminal, wherein the virtual machine request carries information about the hard disk capacity and memory capacity of the cloud virtual machine to be requested;
所述比值判断模块320,用于判断所述硬盘容量与所述内存容量的目标比值是否超过预定比值,如果超过,触发资源分配模块330,如果未超过,触发通知信息发送模块340;The ratio judging module 320 is used to judge whether the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio, if so, trigger the resource allocation module 330, and if not, trigger the notification information sending module 340;
所述资源分配模块330,用于按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为所述用户分配云端虚拟机;The resource allocation module 330 is configured to allocate a cloud virtual machine to the user based on the associated physical machine according to the hard disk capacity and the memory capacity carried in the virtual machine request;
所述通知信息发送模块340,用于向所述终端反馈关于按照所述预定比值更改所述硬盘容量与所述内存容量的通知信息,以使得所述终端在接收到所述通知信息后,输出与所述通知信息对应的变更提示信息;The notification information sending module 340 is configured to feed back notification information about changing the hard disk capacity and the memory capacity according to the predetermined ratio to the terminal, so that the terminal outputs the notification information after receiving the notification information. Change prompt information corresponding to the notification information;
变更请求处理模块350,用于在接收到所述用户通过所述终端发送的携带有所要请求云端虚拟机的变更后硬盘容量与变更后内存容量的信息的变更请求时,判断所述变更后硬盘容量与所述变更后内存容量的变更后比值是否超过所述预定比值,如果是,按照所述变更后硬盘容量和所述变更后内存容量,基于所关联的物理机为所述用户分配云端虚拟机,其中,所述变更请求为用户基于所述终端所输出的变更提示信息所发出的。The change request processing module 350 is configured to, when receiving the change request sent by the user through the terminal and carrying information about the changed hard disk capacity and the changed memory capacity of the requested cloud virtual machine, to determine whether the changed hard disk is Whether the changed ratio of the capacity to the changed memory capacity exceeds the predetermined ratio, and if so, according to the changed hard disk capacity and the changed memory capacity, assign the cloud virtual machine to the user based on the associated physical machine machine, wherein the change request is sent by the user based on the change prompt information output by the terminal.
与现有技术相比,本发明实施例中,云端服务器在接收到用户通过终端发出的虚拟机请求时,并不是直接按照该虚拟机请求的信息为用户分配云端虚拟机,而是,判断虚拟机请求所携带的硬盘容量与该内存容量的目标比值是否超过预定比值,并根据不同的判断结果执行不同的操作,提供了更优化的物理资源的配置,因此,通过本方案提高了云端服务器所关联物理机的硬盘资源和内存资源的利用率,进而保证云端服务器所关联的物理机达到最大收益。Compared with the prior art, in the embodiment of the present invention, when the cloud server receives a virtual machine request sent by the user through the terminal, it does not directly assign the cloud virtual machine to the user according to the information requested by the virtual machine, but judges the virtual machine. Whether the target ratio of the hard disk capacity carried by the machine request to the memory capacity exceeds the predetermined ratio, and perform different operations according to different judgment results, providing a more optimized configuration of physical resources. Therefore, this solution improves the cloud server. The utilization rate of the hard disk resource and memory resource of the associated physical machine can ensure the maximum benefit of the physical machine associated with the cloud server.
更进一步的,本发明实施例所提供的一种物理资源分配装置,如图4所示,还可以包括:保留请求处理模块360;Furthermore, a device for allocating physical resources provided by an embodiment of the present invention, as shown in FIG. 4 , may further include: a reservation request processing module 360;
其中,所述保留请求处理模块360,用于在接收到所述用户通过所述终端发送的虚拟机保留请求时,按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机为用户分配云端虚拟机,并且,按照预定计价策略,调高所请求云端虚拟机所对应的计价,其中,所述虚拟机保留请求为用户基于所述终端输出的变更提示信息所发出的。Wherein, the reservation request processing module 360 is configured to, when receiving the virtual machine reservation request sent by the user through the terminal, according to the hard disk capacity and the memory capacity carried in the virtual machine request, based on The associated physical machine allocates a cloud virtual machine to the user, and, according to a predetermined pricing strategy, increases the pricing corresponding to the requested cloud virtual machine, wherein the virtual machine reservation request is the change prompt information output by the user based on the terminal issued by.
更进一步的,所述资源分配模块330,可以包括:Furthermore, the resource allocation module 330 may include:
目标物理机确定单元,用于从剩余硬盘容量满足所述虚拟机请求所携带的所述硬盘容量且剩余内存容量满足所述虚拟机请求所携带的所述内存容量的至少一台物理机中,确定为所述用户分配云端虚拟机的目标物理机;A target physical machine determining unit, configured to select from at least one physical machine whose remaining hard disk capacity satisfies the hard disk capacity carried by the virtual machine request and whose remaining memory capacity satisfies the memory capacity carried by the virtual machine request, Determine the target physical machine for allocating the cloud virtual machine to the user;
虚拟机分配单元,用于基于所述目标物理机为所述用户分配云端虚拟机。A virtual machine allocation unit, configured to allocate a cloud virtual machine to the user based on the target physical machine.
更进一步的,所述目标物理机确定单元具体用于通过随机选择方式或预定选择方式,确定为所述用户分配云端虚拟机的目标物理机,其中,所述预定选择方式为基于剩余物理资源大小所确定的方式。更进一步的,所述通知信息还包括硬盘容量与内存容量的各个比值所对应计价。Furthermore, the target physical machine determining unit is specifically configured to determine the target physical machine for allocating the cloud virtual machine to the user through a random selection method or a predetermined selection method, wherein the predetermined selection method is based on the size of the remaining physical resources determined manner. Furthermore, the notification information also includes pricing corresponding to each ratio of hard disk capacity to memory capacity.
具体的,所述预定比值为:31:1。Specifically, the predetermined ratio is: 31:1.
相应于上述方法实施例,本发明实施例还提供了一种物理资源分配系统,如图5所述,该系统可以包括:Corresponding to the above method embodiment, the embodiment of the present invention also provides a physical resource allocation system, as shown in Figure 5, the system may include:
云端服务器510以及与所述云端服务器关联的至少一台物理机520;A cloud server 510 and at least one physical machine 520 associated with the cloud server;
其中,所述云端服务器510用于:Wherein, the cloud server 510 is used for:
接收用户通过终端发出的虚拟机请求,其中,所述虚拟机请求携带有所要请求云端虚拟机的硬盘容量与内存容量的信息;receiving a virtual machine request sent by a user through a terminal, wherein the virtual machine request carries information about the hard disk capacity and memory capacity of the cloud virtual machine to be requested;
判断所述硬盘容量与所述内存容量的目标比值是否超过预定比值;judging whether the target ratio of the hard disk capacity to the memory capacity exceeds a predetermined ratio;
如果超过,则按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机520为所述用户分配云端虚拟机;If it exceeds, according to the hard disk capacity and the memory capacity carried in the virtual machine request, allocate a cloud virtual machine to the user based on the associated physical machine 520;
如果未超过,向所述终端反馈关于按照所述预定比值更改所述硬盘容量与所述内存容量的通知信息,以使得所述终端在接收到所述通知信息后,输出与所述通知信息对应的变更提示信息;If not, feed back notification information to the terminal about changing the hard disk capacity and the internal memory capacity according to the predetermined ratio, so that the terminal outputs information corresponding to the notification information after receiving the notification information. change prompt information;
在接收到所述用户通过所述终端发送的携带有所要请求云端虚拟机的变更后硬盘容量与变更后内存容量的信息的变更请求时,判断所述变更后硬盘容量与所述变更后内存容量的变更后比值是否超过所述预定比值,如果是,按照所述变更后硬盘容量和所述变更后内存容量,基于所关联的物理机520为所述用户分配云端虚拟机,其中,所述变更请求为用户基于所述终端所输出的变更提示信息所发出的。When receiving the change request sent by the user through the terminal and carrying information about the changed hard disk capacity and the changed memory capacity of the requested cloud virtual machine, determine the changed hard disk capacity and the changed memory capacity Whether the changed ratio exceeds the predetermined ratio, and if so, allocate a cloud virtual machine to the user based on the associated physical machine 520 according to the changed hard disk capacity and the changed memory capacity, wherein the changed The request is sent by the user based on the change prompt information output by the terminal.
与现有技术相比,本发明实施例中,云端服务器在接收到用户通过终端发出的虚拟机请求时,并不是直接按照该虚拟机请求的信息为用户分配云端虚拟机,而是,判断虚拟机请求所携带的硬盘容量与该内存容量的目标比值是否超过预定比值,并根据不同的判断结果执行不同的操作,提供了更优化的物理资源的配置,因此,通过本方案提高了云端服务器所关联物理机的硬盘资源和内存资源的利用率,进而保证云端服务器所关联的物理机达到最大收益。Compared with the prior art, in the embodiment of the present invention, when the cloud server receives a virtual machine request sent by the user through the terminal, it does not directly assign the cloud virtual machine to the user according to the information requested by the virtual machine, but judges the virtual machine. Whether the target ratio of the hard disk capacity carried by the machine request to the memory capacity exceeds the predetermined ratio, and perform different operations according to different judgment results, providing a more optimized configuration of physical resources. Therefore, this solution improves the cloud server. The utilization rate of the hard disk resources and memory resources of the associated physical machine can ensure the maximum benefit of the physical machine associated with the cloud server.
更进一步的,本发明实施例所提供的所述云端服务器510还用于:Furthermore, the cloud server 510 provided by the embodiment of the present invention is also used for:
在接收到所述用户通过所述终端发送的虚拟机保留请求时,按照所述虚拟机请求所携带的所述硬盘容量和所述内存容量,基于所关联的物理机520为用户分配云端虚拟机,并且,按照预定计价策略,调高所请求云端虚拟机所对应的计价,其中,所述虚拟机保留请求为用户基于所述终端输出的变更提示信息所发出的。When receiving the virtual machine reservation request sent by the user through the terminal, according to the hard disk capacity and the memory capacity carried in the virtual machine request, the cloud virtual machine is allocated to the user based on the associated physical machine 520 , and according to a predetermined pricing strategy, increase the pricing corresponding to the requested cloud virtual machine, wherein the virtual machine reservation request is sent by the user based on the change prompt information output by the terminal.
更进一步的,所述云端服务器具体用于:Furthermore, the cloud server is specifically used for:
从剩余硬盘容量满足所述虚拟机请求所携带的所述硬盘容量且剩余内存容量满足所述虚拟机请求所携带的所述内存容量的至少一台物理机中,确定为所述用户分配云端虚拟机的目标物理机;From at least one physical machine whose remaining hard disk capacity satisfies the hard disk capacity carried by the virtual machine request and whose remaining memory capacity satisfies the memory capacity carried by the virtual machine request, determine to allocate cloud virtualization to the user. The target physical machine of the machine;
基于所述目标物理机为所述用户分配云端虚拟机。Allocating a cloud virtual machine to the user based on the target physical machine.
更进一步的,所述云端服务器具体用于:通过随机选择方式或预定选择方式,确定为所述用户分配云端虚拟机的目标物理机,其中,所述预定选择方式为基于剩余物理资源大小所确定的方式。更进一步的,所述通知信息还包括硬盘容量与内存容量的各个比值所对应计价。Furthermore, the cloud server is specifically configured to: determine the target physical machine for allocating the cloud virtual machine to the user through a random selection method or a predetermined selection method, wherein the predetermined selection method is determined based on the size of the remaining physical resources The way. Furthermore, the notification information also includes pricing corresponding to each ratio of hard disk capacity to memory capacity.
更进一步的,所述预定比值为:31:1。Furthermore, the predetermined ratio is: 31:1.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or order between them. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiment.
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.
Claims (18)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511026242.9A CN106936874B (en) | 2015-12-31 | 2015-12-31 | Physical source distributing method, apparatus and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511026242.9A CN106936874B (en) | 2015-12-31 | 2015-12-31 | Physical source distributing method, apparatus and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106936874A true CN106936874A (en) | 2017-07-07 |
CN106936874B CN106936874B (en) | 2019-05-31 |
Family
ID=59441262
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201511026242.9A Active CN106936874B (en) | 2015-12-31 | 2015-12-31 | Physical source distributing method, apparatus and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106936874B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108388468A (en) * | 2018-01-26 | 2018-08-10 | 杨立群 | A kind of Flase File System dispatching method and device |
CN108632354A (en) * | 2018-04-02 | 2018-10-09 | 新华三云计算技术有限公司 | Physical machine receives pipe method, apparatus and cloud desktop management platform |
CN110851529A (en) * | 2019-11-01 | 2020-02-28 | 腾讯科技(深圳)有限公司 | Computing power scheduling method and related equipment |
CN113032107A (en) * | 2021-05-24 | 2021-06-25 | 北京金山云网络技术有限公司 | Resource management method, device and system of cloud database |
CN113709241A (en) * | 2021-08-26 | 2021-11-26 | 上海德拓信息技术股份有限公司 | Scheduling distribution combination method and system of physical resources in cloud scene |
WO2022242342A1 (en) * | 2021-05-17 | 2022-11-24 | 中国移动通信有限公司研究院 | Resource request method and apparatus, computing power network element node, and terminal device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631633A (en) * | 2012-08-20 | 2014-03-12 | 中国电信股份有限公司 | Virtual machine total-system online migration method, device and system |
CN103677960A (en) * | 2013-12-19 | 2014-03-26 | 安徽师范大学 | Game resetting method for virtual machines capable of controlling energy consumption |
CN104050008A (en) * | 2013-03-15 | 2014-09-17 | 中兴通讯股份有限公司 | Excessive distribution management system and method for memory |
-
2015
- 2015-12-31 CN CN201511026242.9A patent/CN106936874B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103631633A (en) * | 2012-08-20 | 2014-03-12 | 中国电信股份有限公司 | Virtual machine total-system online migration method, device and system |
CN104050008A (en) * | 2013-03-15 | 2014-09-17 | 中兴通讯股份有限公司 | Excessive distribution management system and method for memory |
CN103677960A (en) * | 2013-12-19 | 2014-03-26 | 安徽师范大学 | Game resetting method for virtual machines capable of controlling energy consumption |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108388468A (en) * | 2018-01-26 | 2018-08-10 | 杨立群 | A kind of Flase File System dispatching method and device |
CN108388468B (en) * | 2018-01-26 | 2022-02-22 | 杨立群 | Fast file system scheduling method and device |
CN108632354A (en) * | 2018-04-02 | 2018-10-09 | 新华三云计算技术有限公司 | Physical machine receives pipe method, apparatus and cloud desktop management platform |
CN110851529A (en) * | 2019-11-01 | 2020-02-28 | 腾讯科技(深圳)有限公司 | Computing power scheduling method and related equipment |
CN110851529B (en) * | 2019-11-01 | 2024-05-28 | 腾讯科技(深圳)有限公司 | Computing power scheduling method and related equipment |
WO2022242342A1 (en) * | 2021-05-17 | 2022-11-24 | 中国移动通信有限公司研究院 | Resource request method and apparatus, computing power network element node, and terminal device |
CN113032107A (en) * | 2021-05-24 | 2021-06-25 | 北京金山云网络技术有限公司 | Resource management method, device and system of cloud database |
CN113709241A (en) * | 2021-08-26 | 2021-11-26 | 上海德拓信息技术股份有限公司 | Scheduling distribution combination method and system of physical resources in cloud scene |
CN113709241B (en) * | 2021-08-26 | 2024-01-23 | 上海德拓信息技术股份有限公司 | Scheduling and distributing combination method and system for physical resources in cloud scene |
Also Published As
Publication number | Publication date |
---|---|
CN106936874B (en) | 2019-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106936874B (en) | Physical source distributing method, apparatus and system | |
WO2018149221A1 (en) | Device management method and network management system | |
CN106412040B (en) | Method and device for allocating cache resources | |
CN100377113C (en) | Method and apparatus for processing cache allocation requests based on priority | |
WO2017080172A1 (en) | Network scheduling method and system | |
TW201447763A (en) | System and method for controlling virtual machine | |
CN101119317B (en) | Method, device and system for assigning licenses | |
CN108399101A (en) | The methods, devices and systems of scheduling of resource | |
CN105791254B (en) | Network request processing method and device and terminal | |
CN110096318A (en) | A task offloading method and device based on mobile edge computing | |
CN109462831B (en) | Method, distribution server and system for accessing network by application program in mobile terminal | |
CN110633900A (en) | Virtual resource allocation method and device and electronic equipment | |
CN110290399A (en) | A data distribution method, system, device and computer-readable storage medium | |
CN101291254A (en) | Method, device and system for resource management | |
CN103841200B (en) | A kind of control method and device of software license | |
CN111858035A (en) | A kind of FPGA device allocation method, device, device and storage medium | |
CN105824919B (en) | A kind of dynamic adjusting method and device of data query operation price | |
CN115665251A (en) | Edge cloud resource allocation method and system | |
CN105592333A (en) | Information processing method and information processing device | |
CN113645288B (en) | Data downloading method and device, computer equipment and storage medium | |
CN118170549B (en) | Resource allocation method, device and electronic equipment | |
CN104468758B (en) | Method and device for realizing data transmission service quality assurance | |
CN109428733B (en) | Method and device for directional flow charging | |
CN104954493B (en) | A kind of method, proxy server and system accessing game server | |
CN104980958B (en) | A kind of method and mobile terminal carrying out network login |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |