CN115766336A - Resource allocation method, device, equipment and storage medium - Google Patents

Resource allocation method, device, equipment and storage medium Download PDF

Info

Publication number
CN115766336A
CN115766336A CN202211182840.5A CN202211182840A CN115766336A CN 115766336 A CN115766336 A CN 115766336A CN 202211182840 A CN202211182840 A CN 202211182840A CN 115766336 A CN115766336 A CN 115766336A
Authority
CN
China
Prior art keywords
target
initial
index
service
bandwidth
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.)
Pending
Application number
CN202211182840.5A
Other languages
Chinese (zh)
Inventor
李胜光
许�鹏
耿子元
姬文钊
张桂玉
赵岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
China Information Technology Designing and Consulting Institute Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
China Information Technology Designing and Consulting Institute Co Ltd
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 China United Network Communications Group Co Ltd, China Information Technology Designing and Consulting Institute Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202211182840.5A priority Critical patent/CN115766336A/en
Publication of CN115766336A publication Critical patent/CN115766336A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application relates to the technical field of computers, in particular to a resource allocation method, a resource allocation device, a resource allocation equipment and a storage medium, and aims to improve the accuracy of resource allocation for virtual services. The method comprises the following steps: deploying virtual services in a server, and determining initial service capacity corresponding to initial resource information of the virtual services; the initial resource information comprises an initial processor index for reflecting the performance of the processor, an initial memory index for reflecting the performance of the memory, and an initial network card index for reflecting the performance of the network card; the initial service capacity comprises an initial user number and an initial bandwidth; acquiring the service capacity requirement of a target service; the target service is a service of virtual service to be used, and the service capacity requirement comprises the number of target users and the target bandwidth; adjusting the initial resource information based on the service capacity requirement and the initial service capacity to obtain target resource information; and allocating resources for the virtual service based on the target resource information.

Description

Resource allocation method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for resource allocation.
Background
With the maturity of Network Function Virtualization (NFV) technology, traditional hardware-specific devices can be virtualized into software to be deployed in a general server, so that flexible scheduling of a network architecture and deployment of virtual services on demand (for example, a virtual routing function, a virtual switching function, etc.) are achieved. Specifically, deploying virtual services in a virtual machine requires allocating certain virtual resources to the virtual services to provide virtual services for different services.
However, in the above related art, the virtual resources are allocated to the virtual service, which is usually performed based on a fixed template. Because the fixed template comprises a fixed virtual resource allocation mode, for different services, resource waste can be caused or service requirements cannot be met, and thus resource allocation is unreasonable.
Disclosure of Invention
The application provides a resource allocation method, device, equipment and storage medium, so as to at least solve the problem that the resource allocation of the NFV virtual service is unreasonable in the related art. The technical scheme of the application is as follows:
according to a first aspect of the present application, there is provided a resource allocation method, including: deploying virtual services in a server, and determining initial service capacity corresponding to initial resource information of the virtual services; the initial resource information comprises an initial processor index for reflecting the performance of the processor, an initial memory index for reflecting the performance of the memory, and an initial network card index for reflecting the performance of the network card; the initial service capacity comprises an initial user number and an initial bandwidth; acquiring the service capacity requirement of a target service; the target service is a service of virtual service to be used, and the service capacity requirement comprises the number of target users and the target bandwidth; adjusting the initial resource information based on the service capacity requirement and the initial service capacity to obtain target resource information; and allocating resources for the virtual service based on the target resource information.
Optionally, the adjusting the initial resource information based on the service capability requirement and the initial service capability to obtain the target resource information includes: determining a target memory index of the target service based on the target user number, the initial user number and the initial memory index; determining a target processor index of the target service based on the target bandwidth, the initial bandwidth and the initial processor index; determining a target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index; and determining the target memory index, the target processor index and the target network card index as target resource information.
Optionally, the initial resource information further includes an initial disk index for reflecting disk performance, and the service capability requirement further includes a service type; based on the service capability requirement and the initial service capability, adjusting the initial resource information to obtain target resource information, comprising: determining a target memory index of the target service based on the target user number, the initial user number and the initial memory index; determining a target processor index of the target service based on the target bandwidth, the initial bandwidth and the initial processor index; determining a target network card index of a target service based on the target bandwidth, the initial bandwidth and the initial network card index; and determining target resource information according to the target memory index, the target processor index, the target network card index, the initial disk index and the service type.
Optionally, the determining target resource information according to the target memory index, the target processor index, the target network card index, the initial disk index, and the service type includes: under the condition that the service type is a learning type, amplifying a target memory index by a first preset multiple, and determining a target processor index, a target network card index, an initial disk index and the amplified target memory index as target resource information; under the condition that the service type is a game type, amplifying a target processor index and a target network card index by a second preset multiple, and determining a target memory index, an initial disk index, an amplified target processor index and an amplified target network card index as target resource information; and under the condition that the service type is a commercial type, amplifying the initial disk index by a third preset multiple, and determining a target processor index, a target network card index, a target memory index and the amplified initial disk index as target resource information.
Optionally, the determining a target memory index of the target service based on the number of target users, the number of initial users, and the initial memory index includes: under the condition that the number of the target users is larger than the number of the initial users, determining a first target amplification factor based on the number of the target users and the number of the initial users, and amplifying the initial memory index based on the first target amplification factor to obtain a target memory index; the first target amplification factor is larger than 1, and the first target amplification factor is positively correlated with the difference between the target user number and the initial user number; and determining the initial memory index as the target memory index under the condition that the target user number is less than or equal to the initial user number.
Optionally, the determining the target processor index of the target service based on the target bandwidth, the initial bandwidth, and the initial processor index includes: under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial processor index based on the second target amplification factor to obtain a target processor index; the second target amplification factor is greater than 1 and is positively correlated with the difference between the target bandwidth and the initial bandwidth; in the event that the target bandwidth is less than or equal to the initial bandwidth, the initial processor metric is determined to be the target processor metric.
Optionally, the determining a target network card index of the target service based on the target bandwidth, the initial bandwidth, and the initial network card index includes: under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial network card index based on the second target amplification factor to obtain a target network card index; the second target amplification factor is greater than 1 and is positively correlated with the difference between the target bandwidth and the initial bandwidth; and determining the initial network card index as the target network card index under the condition that the target bandwidth is less than or equal to the initial bandwidth.
Optionally, the allocating resources for the virtual service based on the target resource information includes: acquiring hardware resource occupancy rate of a server and virtual resource average occupancy rate of virtual service; the virtual resource average occupancy rate is an average value of the virtual resource occupancy rates of a plurality of preset services in the virtual service, and the types of the plurality of preset services are the same as the type of the target service; under the condition that the utilization rate of the hardware resources is smaller than or equal to a first threshold value and the average occupancy rate of the virtual resources is smaller than or equal to a second threshold value, amplifying the target resource information based on a fourth preset multiple, and distributing the target resource information amplified based on the fourth preset multiple to the virtual service; the fourth preset multiple is more than 1; under the condition that the utilization rate of the hardware resources is greater than a first threshold value, distributing target resource information for the virtual service; under the condition that the hardware resource utilization rate is less than or equal to a first threshold value and the virtual resource average occupancy rate is greater than a second threshold value, amplifying the target resource information based on a fifth preset multiple, and distributing the target resource information amplified based on the fifth preset multiple for the virtual service; the fifth preset multiple is greater than the fourth preset multiple.
According to a second aspect of the present application, there is provided a resource allocation apparatus, including an allocation unit, a determination unit, an acquisition unit, and an adjustment unit; an allocation unit for deploying a virtual service in a server; the determining unit is used for determining the initial service capacity corresponding to the initial resource information of the virtual service; the initial resource information comprises an initial processor index for reflecting the performance of the processor, an initial memory index for reflecting the performance of the memory, and an initial network card index for reflecting the performance of the network card; the initial service capacity comprises an initial user number and an initial bandwidth; the acquisition unit is used for acquiring the service capacity requirement of the target service; the target service is a service of virtual service to be used, and the service capacity requirement comprises the number of target users and the target bandwidth; the adjusting unit is used for adjusting the initial resource information based on the service capacity requirement and the initial service capacity to obtain target resource information; and the allocation unit is also used for allocating resources for the virtual service based on the target resource information.
Optionally, the adjusting unit is specifically configured to: determining a target memory index of the target service based on the target user number, the initial user number and the initial memory index; determining a target processor index of the target service based on the target bandwidth, the initial bandwidth and the initial processor index; determining a target network card index of a target service based on the target bandwidth, the initial bandwidth and the initial network card index; and determining the target memory index, the target processor index and the target network card index as target resource information.
Optionally, the initial resource information further includes an initial disk index for reflecting disk performance, and the service capability requirement further includes a service type; the adjusting unit is specifically configured to: determining a target memory index of the target service based on the target user number, the initial user number and the initial memory index; determining a target processor index of the target service based on the target bandwidth, the initial bandwidth and the initial processor index; determining a target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index; and determining target resource information according to the target memory index, the target processor index, the target network card index, the initial disk index and the service type.
Optionally, the adjusting unit is specifically configured to: under the condition that the service type is a learning type, amplifying a target memory index by a first preset multiple, and determining a target processor index, a target network card index, an initial disk index and the amplified target memory index as target resource information; under the condition that the service type is a game type, amplifying a target processor index and a target network card index by a second preset multiple, and determining a target memory index, an initial disk index, an amplified target processor index and an amplified target network card index as target resource information; and under the condition that the service type is a commercial type, amplifying the initial disk index by a third preset multiple, and determining a target processor index, a target network card index, a target memory index and the amplified initial disk index as target resource information.
Optionally, the determining unit is specifically configured to: under the condition that the number of the target users is larger than the number of the initial users, determining a first target amplification factor based on the number of the target users and the number of the initial users, and amplifying the initial memory index based on the first target amplification factor to obtain a target memory index; the first target amplification factor is larger than 1, and the first target amplification factor is positively correlated with the difference between the target user number and the initial user number; and determining the initial memory index as the target memory index under the condition that the target user number is less than or equal to the initial user number.
Optionally, the determining unit is specifically configured to: under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial processor index based on the second target amplification factor to obtain a target processor index; the second target amplification factor is greater than 1 and is positively correlated with the difference between the target bandwidth and the initial bandwidth; in the event that the target bandwidth is less than or equal to the initial bandwidth, the initial processor metric is determined to be the target processor metric.
Optionally, the determining unit is specifically configured to: under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial network card index based on the second target amplification factor to obtain a target network card index; the second target amplification factor is greater than 1 and is positively correlated with the difference between the target bandwidth and the initial bandwidth; and determining the initial network card index as the target network card index under the condition that the target bandwidth is less than or equal to the initial bandwidth.
Optionally, the distribution unit is specifically configured to: acquiring hardware resource occupancy rate of a server and virtual resource average occupancy rate of virtual service; the virtual resource average occupancy rate is an average value of the virtual resource occupancy rates of a plurality of preset services based on the virtual service, and the types of the plurality of preset services are the same as the type of the target service; under the condition that the utilization rate of the hardware resources is smaller than or equal to a first threshold value and the average occupancy rate of the virtual resources is smaller than or equal to a second threshold value, amplifying the target resource information based on a fourth preset multiple, and distributing the target resource information amplified based on the fourth preset multiple to the virtual service; the fourth preset multiple is more than 1; under the condition that the utilization rate of the hardware resources is greater than a first threshold value, distributing target resource information for the virtual service; under the condition that the hardware resource utilization rate is less than or equal to a first threshold value and the virtual resource average occupancy rate is greater than a second threshold value, amplifying the target resource information based on a fifth preset multiple, and distributing the target resource information amplified based on the fifth preset multiple for the virtual service; the fifth preset multiple is greater than the fourth preset multiple.
According to a third aspect of the present application, there is provided an electronic apparatus comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of the first aspect and any of its possible embodiments described above.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium, in which instructions, which, when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of the above-mentioned first aspects and any one of its possible embodiments.
According to a fifth aspect of the present application, there is provided a computer program product comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of the first aspect and any of its possible embodiments described above.
The technical solution of the first aspect provided by the present application brings at least the following beneficial effects: the initial resource information of the virtual service is associated with the initial service capacity, so that after the service capacity requirement of the target service is obtained, the initial processor index, the initial memory index and the initial network card index in the initial resource information can be adjusted according to the target user number and the target bandwidth in the service capacity requirement and the initial user number and the initial bandwidth in the initial resource information, and the target resource information capable of meeting the service capacity requirement is obtained. Furthermore, the virtual service is subjected to resource allocation based on the target resource information, so that the virtual service after resource allocation can meet the service capacity requirement and avoid resource waste.
It should be noted that, for technical effects brought by any implementation manner in the second aspect to the fifth aspect, reference may be made to technical effects brought by a corresponding implementation manner in the first aspect, and details are not described here.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application and are not to be construed as limiting the application.
FIG. 1 is a block diagram illustrating a resource allocation system in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of resource allocation in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating yet another method of resource allocation in accordance with an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating yet another resource allocation method in accordance with an example embodiment;
FIG. 5 is a flow diagram illustrating yet another method of resource allocation in accordance with an illustrative embodiment;
FIG. 6 is a block diagram illustrating a resource allocation apparatus in accordance with an example embodiment;
FIG. 7 is a block diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present application better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
Before describing the resource allocation method provided by the present application in detail, the implementation environment (implementation architecture) related to the present application will be briefly described.
The resource allocation method provided by the embodiment of the invention can be suitable for a resource allocation system. Fig. 1 shows a schematic structural diagram of the resource allocation system. As shown in fig. 1, the resource allocation system 10 includes a resource allocation apparatus 11 and an electronic device 12. The resource allocation apparatus 11 is connected to the electronic device 12, and the resource allocation apparatus 11 and the electronic device 12 may be connected in a wired manner or in a wireless manner.
The resource allocation apparatus 11 may be configured to perform data interaction with the electronic device 12, for example, obtain initial resource information of the virtual service and service capability requirements of the target service from the electronic device 12, and send target resource information allocated for the virtual service to the electronic device.
Meanwhile, the resource allocation device 11 may be further configured to determine an initial service capability corresponding to the initial resource information, and adjust the initial service capability according to the service capability requirement of the target service and the initial service capability, so as to obtain the target resource information.
The electronic device 12 may be configured to perform data interaction with the resource allocation apparatus 11, for example, to send the initial resource information of the virtual service and the service capability requirement of the target service to the resource allocation apparatus 11.
The electronic device may be further configured to, after receiving the target resource information sent by the resource allocation apparatus 11, allocate resources for the virtual service according to the target resource information.
Optionally, the electronic device may be a physical machine, for example: desktop computers are also called desktop computers (desktop computers), mobile phones, tablet computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal Digital Assistants (PDAs), and other terminal devices. The electronic device may also be a server or a network device in which a virtual machine is deployed, or may also be a management server that manages a plurality of servers or network devices in which virtual machines are deployed. In this case, the electronic device may specifically be a management device of the NFV management system.
Optionally, the resource allocation apparatus may also implement the function to be implemented by a Virtual Machine (VM) deployed on a physical machine.
It should be noted that the resource allocation apparatus 11 and the electronic device 12 may be independent devices or may be integrated in the same device, and this disclosure is not limited thereto.
When the resource allocation apparatus 11 and the electronic device 12 are integrated in the same device, the communication mode between the resource allocation apparatus 11 and the electronic device 12 is communication between internal modules of the device. In this case, the communication flow between the two is the same as the "communication flow between the resource allocation apparatus 11 and the electronic device 12 when they are independent of each other".
In the following embodiments provided in the present disclosure, the present application takes the resource allocation apparatus 11 and the electronic device 12 as an example and the same device.
For the sake of understanding, the resource allocation method provided in the present application is specifically described below with reference to the accompanying drawings.
Fig. 2 is a flowchart illustrating a resource allocation method according to an exemplary embodiment, where the method may be applied to an electronic device, and may also be applied to a resource allocation apparatus connected to the electronic device. Meanwhile, the method can also be applied to electronic equipment or equipment similar to the resource allocation device. In the following, the method is described by taking the method as an example, and as shown in fig. 2, the resource allocation method includes the following steps:
s201, deploying virtual services in the server.
As a possible implementation manner, in an initialization stage of a server, an electronic device deploys a virtual service in the server and acquires initial resource information of the virtual service.
The virtual service may be a routing function, a switching function, or a security function, as some examples.
Specifically, the electronic device may acquire the resource information of the server through an internet protocol multimedia subsystem private user identity (IMPI) protocol, a secure shell protocol (SSH), and other protocols. The resource information of the server includes management information of the server, central Processing Unit (CPU) information, memory information, disk information, and network card information.
The server management information includes a server identifier and an operating system version. The CPU information comprises the number of the CPU slots, the type of the CPU, the CPU dominant frequency, the number of the CPU cores and the number of the CPU threads. The memory information comprises the number of memory slots, the memory capacity and the memory working frequency. The disk information includes the number of disk slots and the disk capacity. The network card information includes the number of slot of the network card, the model of the network card, the number of port of the network card, and the address (MAC) of the port of the network card.
It should be noted that the resource information of the server may also be set by the operation and maintenance staff in advance in the electronic device by a manual entry method.
In one case, the resource information of the server may be stored in the electronic device in the following form:
server management information: { server ID, operating system version }.
CPU information: { CPU slot number, CPU model, CPU master frequency, CPU core number, CPU thread number }.
Memory information: { number of memory slots, memory capacity, memory operating frequency }.
Disk information: { number of disk slots, disk capacity }.
Network card information: { number of slot of network card, model of network card, number of port of network card, MAC of port of network card }.
Further, the electronic device virtualizes the CPU and the physical network card of the server, for example, virtualizes the CPU core of the server to be used by multiple virtual machine CPU (vCPU) cores, and virtualizes the physical network card port of the server to be used by multiple virtual network card ports.
It should be noted that, the physical network card port and the virtual network card port both have port MACs.
Subsequently, the electronic device completes the deployment of the virtual service in the server based on the virtualization technology through an automatic deployment mode or a manual setting mode by operation and maintenance personnel, and specifically includes server operations such as starting SR-IOV (single root I/virtualization) in a linux kernel, configuring a large-page memory of memory information, configuring vCPU core isolation and the like.
It should be noted that the virtualization technologies include keyboard, video, or mouse (KVM) virtualization, application container engine (Docker) virtualization, XEN virtualization, and the like.
In an implementation manner, taking a virtual service as a routing function as an example, in order to describe performance of the virtual service, in the embodiment of the present application, resource information of a server and resource information of the virtual service are in one-to-one correspondence, for example, CPU information of the server and CPU information of the virtual service are corresponding, memory information of the server and memory information of the virtual service are corresponding, and network card information of the server and memory information of the virtual service are corresponding.
Meanwhile, in the embodiment of the application, when the virtual service is a routing function, the resource information of the virtual service is also corresponding to the performance index of the virtual service. The performance indexes of the virtual service include bandwidth forwarding performance (BP), routing Performance (RP), and log storage performance (LP). The CPU information and the network card information of the virtual service correspond to bandwidth forwarding performance, the memory information of the virtual service corresponds to routing and session performance, and the disk information of the virtual service corresponds to log storage performance.
As can be understood, the electronic device may store the correspondence between the resource information of the server and the performance index of the virtual service in the electronic device based on the correspondence between the resource information and the performance index.
For example, in the CPU information of the server, { CPU slot number, CPU model, CPU master frequency, CPU core number, CPU thread number } may be marked as a bandwidth forwarding performance CBP of the virtual service CPU class: { CBP1, CBP2, CBP3, CBP4, CBP5}. In the network card information of the server, { network card slot number, network card model, network card port number, and network card port MAC } may be marked as a bandwidth forwarding performance resource NBP of the virtual service network card class: { NBP1, NBP2, NBP3, NBP4, NBP5}. In the memory information of the server, { memory slot number, memory capacity, memory operating frequency } may be marked as a routing and session performance resource RP: { RP, RP2, RP3}. In the disk information of the server, { disk slot number, disk capacity } may be marked as a log storage performance resource LP: { LP1, LP2}.
S202, determining initial service capability corresponding to initial resource information of the virtual service.
The initial resource information comprises an initial processor index for reflecting the performance of the processor, an initial memory index for reflecting the performance of the memory, and an initial network card index for reflecting the performance of the network card. The initial service capability includes an initial number of users and an initial bandwidth.
As a possible implementation manner, after the server deploys the virtual service, the electronic device may obtain initial resource information of the virtual service and determine an initial service capability corresponding to the initial resource information.
It should be noted that the initial processor index in the initial resource information may be manually entered in the electronic device by an operation and maintenance person in advance, or may be obtained by the electronic device based on the resource information of the server. For example, the electronic device may determine initial resource information of the virtual service as { RPmin, CBPmin, NBPmin } based on the resource information of the server. And RPmin is an initial memory index and comprises the minimum value of the memory capacity RP2 and the minimum value of the memory working frequency RP3 in the memory information of the server. CBPmin is an initial processor index and comprises the minimum value of a CPU core number CBP4 and the minimum value of a CPU thread number CBP5 in the CPU information of the server. NBPmin is an initial network card index and comprises the minimum value of the number NBP3 of network card ports in the network card information of the server.
It can be understood that, when the electronic device determines the initial resource information of the virtual service as the minimum value in the resource information of the server, it may be determined that the basic requirement of the user is satisfied.
Further, the electronic device determines, based on the initial resource information, a maximum number of users and a maximum bandwidth that the virtual service can bear in the case of the configuration of the initial resource information, determines the maximum number of users as an initial number of users, and determines the maximum bandwidth as an initial bandwidth.
S203, acquiring the service capability requirement of the target service.
The target service is a service to be used for virtual service, and the service capacity requirement comprises the number of target users and the target bandwidth.
As a possible implementation manner, when the user equipment of the user sends a request message of the virtual service to the electronic equipment for the target service, the electronic equipment receives the request message and acquires the service capability requirement of the user for the target service from the request message.
S204, adjusting the initial resource information based on the service capacity requirement and the initial service capacity to obtain target resource information.
As a possible implementation manner, the electronic device compares the initial user number in the initial service capability with the target user number in the service capability requirement, and adjusts the initial memory index in the initial resource information according to the comparison result to obtain the adjusted target memory index.
And the electronic equipment also compares the initial bandwidth in the initial service capacity with the target bandwidth in the service capacity requirement, and adjusts the initial network card index and the initial processor index in the initial resource information according to the comparison result to obtain the adjusted target network card index and the adjusted target processor index.
Further, the electronic device determines target resource information according to the target memory index, the target network card index and the target processor index. The target resource information comprises a target memory index, a target network card index and a target processor index.
The specific implementation manner of this step may refer to the subsequent description of the embodiment of the present application, and is not described herein again.
And S205, distributing resources for the virtual service based on the target resource information.
As a possible implementation manner, the electronic device controls the server to perform resource adjustment on the virtual service in the server based on the target resource information.
Based on the technical scheme provided by the embodiment of the application, the initial resource information of the virtual service is associated with the initial service capacity, so that after the service capacity requirement of the target service is obtained, the initial processor index, the initial memory index and the initial network card index in the initial resource information can be adjusted according to the target user number and the target bandwidth in the service capacity requirement and the initial user number and the initial bandwidth in the initial resource information, and the target resource information capable of meeting the service capacity requirement is obtained. Furthermore, the virtual service is subjected to resource allocation based on the target resource information, so that the virtual service after resource allocation can meet the service capacity requirement and avoid resource waste.
In some embodiments, in order to obtain the target resource information, as shown in fig. 3, S204 provided in the embodiments of the present application specifically includes the following steps:
s2041, determining a target memory index of the target service based on the number of the target users, the number of the initial users and the initial memory index.
As a possible implementation manner, the electronic device determines the target user number and the initial user number, and determines a target memory index according to the determination result and the initial memory index.
Specifically, when the number of target users is greater than the number of initial users, a first target amplification factor is determined based on the number of target users and the number of initial users, and the initial memory index is amplified based on the first target amplification factor to obtain a target memory index.
The first target amplification factor is greater than 1 and the first target amplification factor is positively correlated with the difference between the number of target users and the number of initial users.
And determining the initial memory index as a target memory index under the condition that the target user number is less than or equal to the initial user number.
In some cases, the target memory indicator satisfies the following formula one:
Figure BDA0003867528080000111
wherein, RP s Is the target memory index, X is the target user number, X is the initial user number, round is the upward rounding,
Figure BDA0003867528080000112
is a first target magnification factor, P min Is the initial memory index.
It can be understood that the larger the number of users, the larger the number of users assigned to the virtual server, and the larger the number of sessions, which are routes triggered by the virtual service.
S2042, determining target processor indexes of the target service based on the target bandwidth, the initial bandwidth and the initial processor indexes.
As a possible implementation manner, the electronic device determines the sizes of the target bandwidth and the initial bandwidth, and determines a target processor index according to the determination result and the initial processor index.
Specifically, when the target bandwidth is larger than the initial bandwidth, a second target amplification factor is determined based on the target bandwidth and the initial bandwidth, and the initial processor index is amplified based on the second target amplification factor to obtain the target processor index.
The second target amplification factor is greater than 1 and the second target amplification factor is positively correlated with the difference between the target bandwidth and the initial bandwidth.
In the event that the target bandwidth is less than or equal to the initial bandwidth, the initial processor metric is determined to be the target processor metric.
In some cases, the target processor metric satisfies the following equation two:
Figure BDA0003867528080000113
wherein, CBP s Is the target processor index, Z is the target bandwidth, Z is the initial bandwidth, round is the rounding-up,
Figure BDA0003867528080000114
as a second target amplification factor, CBP min Is the initial processor target.
It can be understood that the larger the bandwidth requirement of the user is, the larger the bandwidth forwarding rate allocated to the virtual service is, and the more CPU resources are required by the virtual service.
S2043, determining a target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index.
As a possible implementation manner, the electronic device determines the sizes of the target bandwidth and the initial bandwidth, and determines a target processor index according to the determination result and the initial processor index.
Specifically, under the condition that the target bandwidth is larger than the initial bandwidth, a second target amplification factor is determined based on the target bandwidth and the initial bandwidth, and the initial network card index is amplified based on the second target amplification factor to obtain the target network card index.
The second target amplification factor is greater than 1 and the second target amplification factor is positively correlated with the difference between the target bandwidth and the initial bandwidth.
And determining the initial network card index as the target network card index under the condition that the target bandwidth is less than or equal to the initial bandwidth.
In some cases, the target processor metric satisfies the following formula three:
Figure BDA0003867528080000121
wherein NBP s Is the target network card index, Z is the target bandwidth, Z degree is the initial bandwidth, round is the upward rounding,
Figure BDA0003867528080000122
for a second target amplification factor, NBP min Is an index of an initial network card.
It can be understood that, the greater the bandwidth requirement of the user, the greater the bandwidth forwarding rate allocated to the virtual service is, and the more network card resources are required by the virtual service.
In addition, in the embodiment of the present application, the execution sequence of the above S2041, S2042, and S2043 is not limited.
S2044, determining the target memory index, the target processor index and the target network card index as target resource information.
As a possible implementation manner, the electronic device determines a target memory index, a target processor index, and a target network card index as target resource information.
It can be understood that the target resource information includes, in addition to the target memory index, the target processor index and the target network card index, other information in the initial resource information besides the initial memory index, the initial processor index and the initial network card index. The electronic device adjusts RPmin, CBPmin, NBPmin in the resource information of the virtual service to obtain RPs, CBPs, NBPs, respectively, and the other resource information such as CPU slot number, CPU model, CPU master frequency, network card slot number, network card model, memory slot number, memory operating frequency, disk slot number, etc. is not changed.
In some embodiments, the initial resource information of the virtual service may further include an initial disk index for reflecting disk performance, and the service capability requirement further includes a service type. The initial disk index may be LPmin, which includes a minimum value of a disk capacity LP2 in the disk information of the server, that is, the initial resource information of the virtual service is { RPmin, CBPmin, NBPmin, LPmin }. The types of business of the service capability requirement may specifically include a learning type, a game type, and a business type.
In this case, as shown in fig. 4, S204 provided in the foregoing embodiment of the present application may further include the following steps:
s2045, determining the target memory index of the target service based on the target user number, the initial user number and the initial memory index.
For a specific implementation manner of this step, reference may be made to the above-mentioned S2041 of the present application, which is not described herein again.
S2046, determining target processor indexes of the target service based on the target bandwidth, the initial bandwidth and the initial processor indexes.
The specific implementation manner of this step may refer to S2042 described above in this application, and is not described here again.
S2047, determining a target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index.
The specific implementation manner of this step may refer to S2043 described above in this application, and is not described here again.
S2048, determining target resource information according to the target memory index, the target processor index, the target network card index, the initial disk index and the service type.
As a possible implementation manner, under the condition that the service type is the learning type, the target memory index is amplified by a first preset multiple, and the target processor index, the target network card index, the initial disk index and the amplified target memory index are determined as the target resource information.
And under the condition that the service type is the game type, amplifying the target processor index and the target network card index by a second preset multiple, and determining the target memory index, the initial disk index, the amplified target processor index and the amplified target network card index as target resource information.
And under the condition that the service type is a commercial type, amplifying the initial disk index by a third preset multiple, and determining a target processor index, a target network card index, a target memory index and the amplified initial disk index as target resource information.
In some examples, the target resource information satisfies the following formula four:
Figure BDA0003867528080000131
wherein vmx (t)' is target resource information of the virtual service, a is a first preset multiple, and RP s As a target memory index, CBP s For target processor target, NBP s Is the target network card index, LP min The method comprises the steps of taking an initial disk index, y as a service type, stud as a learning type, b as a second preset multiple, game as a game type, c as a third preset multiple, test as a commercial type, and a, b and c being positive integers larger than 1.
In some embodiments, in order to enable more accurate resource allocation for allocating resources to a virtual service, as shown in fig. 5, S205 provided in this embodiment of the present application may specifically include the following steps:
s2051, acquiring the hardware resource occupancy rate of the server and the virtual resource average occupancy rate of the virtual service.
The virtual resource average occupancy rate is an average value of virtual resource occupancy rates of a plurality of preset services in the virtual service, and the types of the plurality of preset services are the same as the type of the target service.
As a possible implementation manner, the electronic device obtains hardware resources occupied by the server and total hardware resources of the server, and determines a ratio of the occupied hardware resources to the total hardware resources as the hardware resource occupancy rate of the server.
The electronic equipment acquires the type of the pre-target service, determines all the preset services of the same type in the virtual service, and obtains a plurality of preset services. Further, the electronic device obtains the resource occupancy rate of each preset service in the virtual service in the plurality of preset services, and determines the average value of the resource occupancy rates of the plurality of preset services as the virtual resource average occupancy rate of the virtual service.
And S2052, judging whether the utilization rate of the hardware resources is less than or equal to a first threshold value.
Note that the first threshold is a value greater than 0 and less than 1. Illustratively, the first threshold may be 0.8.
And S2053, distributing target resource information to the virtual service under the condition that the utilization rate of the hardware resources is greater than the first threshold value.
And S2054, judging whether the average occupancy rate of the virtual resources is less than or equal to a second threshold value or not under the condition that the utilization rate of the hardware resources is less than or equal to the first threshold value.
The second threshold is a value greater than 0 and less than 1, and the second threshold may be 0.6.
And S2055, under the condition that the utilization rate of the hardware resources is less than or equal to the first threshold value and the average occupancy rate of the virtual resources is less than or equal to the second threshold value, amplifying the target resource information based on a fourth preset multiple.
Wherein the fourth preset multiple is greater than 1.
As a possible implementation manner, the electronic device may perform method processing on all indexes in the target resource information based on a fourth preset multiple under the condition that the hardware resource utilization rate is less than or equal to the first threshold and the virtual resource average occupancy rate is less than or equal to the second threshold, so as to obtain the target resource information amplified based on the fourth preset multiple.
The fourth predetermined multiple is a value greater than 1, and may be, for example, 1.2.
And S2056, the target resource information amplified based on the fourth preset multiple is distributed to the virtual service.
And S2057, under the condition that the utilization rate of the hardware resources is less than or equal to the first threshold value and the average occupancy rate of the virtual resources is greater than the second threshold value, amplifying the target resource information based on a fifth preset multiple.
And the fifth preset multiple is greater than the fourth preset multiple.
As a possible implementation manner, the electronic device may perform method processing on all indexes in the target resource information based on a fifth preset multiple under the condition that the hardware resource utilization rate is less than or equal to the first threshold and the average virtual resource occupancy rate is greater than the second threshold, so as to obtain the target resource information amplified based on the fifth preset multiple.
It should be noted that the fifth preset multiple is a value greater than the fourth preset multiple, and for example, may be specifically 1.4.
And S2058, the target resource information amplified based on the fifth preset multiple is distributed to the virtual service.
Based on the technical scheme provided by the embodiment of the application, the initial resource information of the virtual service is associated with the initial service capacity, so that after the service capacity requirement of the target service is obtained, the initial processor index, the initial memory index and the initial network card index in the initial resource information can be adjusted according to the target user number and the target bandwidth in the service capacity requirement and the initial user number and the initial bandwidth in the initial resource information, and the target resource information capable of meeting the service capacity requirement is obtained. Furthermore, the resources of the virtual service are allocated based on the target resource information, so that the virtual service after the resources are allocated can meet the requirements of service capacity, and meanwhile, the resource waste is avoided.
The scheme provided by the embodiment of the application is mainly introduced from the perspective of a method. In order to implement the above functions, the resource allocation apparatus or the electronic device includes a hardware structure and/or a software module for performing each function. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, according to the method, the resource allocation apparatus or the electronic device is exemplarily divided into the functional modules, for example, the resource allocation apparatus or the electronic device may include the functional modules corresponding to the respective functional divisions, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
For example, the embodiment of the present application further provides a resource allocation apparatus.
Fig. 6 is a block diagram illustrating a resource allocation apparatus according to an example embodiment. Referring to fig. 7, the resource allocation apparatus 300 includes an allocation unit 301, a determination unit 302, an acquisition unit 303, and an adjustment unit 304.
An assigning unit 301 for deploying virtual services in the server.
A determining unit 302, configured to determine an initial service capability corresponding to the initial resource information of the virtual service. The initial resource information comprises an initial processor index for reflecting the performance of the processor, an initial memory index for reflecting the performance of the memory, and an initial network card index for reflecting the performance of the network card. The initial service capability includes an initial number of users and an initial bandwidth.
An obtaining unit 303, configured to obtain a service capability requirement of the target service. The target service is a service to be used by the virtual service, and the service capacity requirement comprises the number of target users and the target bandwidth.
An adjusting unit 304, configured to adjust the initial resource information based on the service capability requirement and the initial service capability, so as to obtain target resource information.
The allocating unit 301 is further configured to allocate resources for the virtual service based on the target resource information.
Optionally, as shown in fig. 6, the adjusting unit 304 provided in the embodiment of the present application is specifically configured to:
and determining the target memory index of the target service based on the target user number, the initial user number and the initial memory index.
A target processor metric for the target traffic is determined based on the target bandwidth, the initial bandwidth, and the initial processor metric.
And determining the target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index.
And determining the target memory index, the target processor index and the target network card index as target resource information.
Optionally, as shown in fig. 6, the initial resource information provided in the embodiment of the present application further includes an initial disk index used for reflecting disk performance, and the service capability requirement further includes a service type. The adjusting unit 304 is specifically configured to:
and determining the target memory index of the target service based on the target user number, the initial user number and the initial memory index.
A target processor metric for the target traffic is determined based on the target bandwidth, the initial bandwidth, and the initial processor metric.
And determining the target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index.
And determining target resource information according to the target memory index, the target processor index, the target network card index, the initial disk index and the service type.
Optionally, as shown in fig. 6, the adjusting unit 304 provided in the embodiment of the present application is specifically configured to:
and under the condition that the service type is the learning type, amplifying the target memory index by a first preset multiple, and determining the target processor index, the target network card index, the initial disk index and the amplified target memory index as target resource information.
And under the condition that the service type is the game type, amplifying the target processor index and the target network card index by a second preset multiple, and determining the target memory index, the initial disk index, the amplified target processor index and the amplified target network card index as target resource information.
And under the condition that the service type is a commercial type, amplifying the initial disk index by a third preset multiple, and determining a target processor index, a target network card index, a target memory index and the amplified initial disk index as target resource information.
Optionally, as shown in fig. 6, the determining unit 302 provided in the embodiment of the present application is specifically configured to:
and under the condition that the number of the target users is larger than the number of the initial users, determining a first target amplification factor based on the number of the target users and the number of the initial users, and amplifying the initial memory index based on the first target amplification factor to obtain a target memory index. The first target amplification factor is greater than 1 and the first target amplification factor is positively correlated with the difference between the number of target users and the number of initial users.
And determining the initial memory index as a target memory index under the condition that the target user number is less than or equal to the initial user number.
Optionally, as shown in fig. 7, the determining unit 302 provided in the embodiment of the present application is specifically configured to:
and under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial processor index based on the second target amplification factor to obtain the target processor index. The second target amplification factor is greater than 1 and the second target amplification factor is positively correlated with the difference between the target bandwidth and the initial bandwidth.
In the event that the target bandwidth is less than or equal to the initial bandwidth, the initial processor metric is determined to be the target processor metric.
Optionally, as shown in fig. 6, the determining unit 302 provided in the embodiment of the present application is specifically configured to:
and under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial network card index based on the second target amplification factor to obtain the target network card index. The second target amplification factor is greater than 1 and the second target amplification factor is positively correlated with the difference between the target bandwidth and the initial bandwidth.
And determining the initial network card index as the target network card index under the condition that the target bandwidth is less than or equal to the initial bandwidth.
Optionally, as shown in fig. 6, the allocating unit 301 provided in the embodiment of the present application is specifically configured to:
and acquiring the hardware resource occupancy rate of the server and the virtual resource average occupancy rate of the virtual service. The virtual resource average occupancy rate is an average value of virtual resource occupancy rates of a plurality of preset services in the virtual service, and the types of the plurality of preset services are the same as the type of the target service.
And under the condition that the utilization rate of the hardware resources is less than or equal to the first threshold and the average occupancy rate of the virtual resources is less than or equal to the second threshold, amplifying the target resource information based on a fourth preset multiple, and distributing the target resource information amplified based on the fourth preset multiple to the virtual service. The fourth preset multiple is greater than 1.
And under the condition that the utilization rate of the hardware resources is greater than a first threshold value, allocating target resource information for the virtual service.
And under the condition that the utilization rate of the hardware resources is less than or equal to the first threshold and the average occupancy rate of the virtual resources is greater than the second threshold, amplifying the target resource information based on a fifth preset multiple, and distributing the target resource information amplified based on the fifth preset multiple to the virtual service. The fifth preset multiple is greater than the fourth preset multiple.
FIG. 7 is a block diagram of an electronic device shown in accordance with an example embodiment. As shown in fig. 7, electronic device 400 includes, but is not limited to: a processor 401 and a memory 402.
The memory 402 is used for storing the executable instructions of the processor 401. It will be appreciated that the processor 401 is configured to execute instructions to implement the resource allocation method in the above embodiment.
It should be noted that the electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown in fig. 7, or combine some components, or arrange different components, as will be understood by those skilled in the art.
The processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Processor 401 may include one or more processing units. Optionally, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs as well as various data. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program (such as a determination unit, a processing unit, etc.) required by at least one functional module, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
In an exemplary embodiment, there is also provided a computer readable storage medium comprising instructions, such as a memory 402 comprising instructions, executable by a processor 401 of an electronic device 400 to implement the resource allocation method in the above embodiments.
In practical implementation, the functions of the allocating unit 301, the determining unit 302, the obtaining unit 303 and the adjusting unit 304 in fig. 6 can be implemented by the processor 401 in fig. 7 calling the computer program stored in the memory 402. The specific implementation process may refer to the description of the resource allocation method in the above embodiment, and is not described herein again.
Alternatively, the computer-readable storage medium may be a non-transitory computer-readable storage medium, which may be, for example, a Read-Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, the present application further provides a computer program product including one or more instructions, which can be executed by the processor 401 of the electronic device to complete the resource allocation method in the foregoing embodiment.
It should be noted that, when the instruction in the computer-readable storage medium or one or more instructions in the computer program product are executed by a processor of the electronic device, the processes of the embodiment of the resource allocation method are implemented, and the same technical effect as the resource allocation method can be achieved, and in order to avoid repetition, details are not repeated here.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, only the division of the above functional modules is used for illustration, and in practical applications, the above function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete the above-described whole classification part or part of the functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is only one type of logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. The purpose of the scheme of the embodiment can be realized by selecting a part of or a whole classification part unit according to actual needs.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, or portions thereof that substantially contribute to the prior art, or the whole classification part or portions thereof, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute the whole classification part or some steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various media capable of storing program codes.
The above is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

1. A method for resource allocation, the method comprising:
deploying virtual services in a server, and determining initial service capacity corresponding to initial resource information of the virtual services; the initial resource information comprises an initial processor index for reflecting the performance of a processor, an initial memory index for reflecting the performance of a memory, and an initial network card index for reflecting the performance of a network card; the initial service capacity comprises an initial user number and an initial bandwidth;
acquiring the service capacity requirement of a target service; the target service is a service to use the virtual service, and the service capacity requirement comprises the number of target users and a target bandwidth;
based on the service capacity requirement and the initial service capacity, adjusting the initial resource information to obtain target resource information;
and allocating resources for the virtual service based on the target resource information.
2. The method of claim 1, wherein the adjusting the initial resource information based on the service capability requirement and the initial service capability to obtain target resource information comprises:
determining a target memory index of the target service based on the target user number, the initial user number and the initial memory index;
determining a target processor metric for the target traffic based on the target bandwidth, the initial bandwidth, and the initial processor metric;
determining a target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index;
and determining the target memory index, the target processor index and the target network card index as the target resource information.
3. The method according to claim 1, wherein the initial resource information further includes an initial disk index for reflecting disk performance, and the service capability requirement further includes a service type; the adjusting the initial resource information based on the service capability requirement and the initial service capability to obtain target resource information comprises:
determining a target memory index of the target service based on the target user number, the initial user number and the initial memory index;
determining a target processor metric for the target traffic based on the target bandwidth, the initial bandwidth, and the initial processor metric;
determining a target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index;
and determining the target resource information according to the target memory index, the target processor index, the target network card index, the initial disk index and the service type.
4. The method according to claim 3, wherein the determining the target resource information according to the target memory index, the target processor index, the target network card index, the initial disk index, and the service type includes:
under the condition that the service type is a learning type, amplifying the target memory index by a first preset multiple, and determining the target processor index, the target network card index, the initial disk index and the amplified target memory index as the target resource information;
under the condition that the service type is a game type, amplifying the target processor index and the target network card index by a second preset multiple, and determining the target memory index, the initial disk index, the amplified target processor index and the amplified target network card index as the target resource information;
and under the condition that the service type is a commercial type, amplifying the initial disk index by a third preset multiple, and determining the target processor index, the target network card index, the target memory index and the amplified initial disk index as the target resource information.
5. The method according to any one of claims 2 to 4, wherein the determining a target memory index of the target service based on the target user number, the initial user number, and the initial memory index comprises:
determining a first target amplification factor based on the target user number and the initial user number under the condition that the target user number is larger than the initial user number, and performing amplification processing on the initial memory index based on the first target amplification factor to obtain the target memory index; the first target amplification factor is larger than 1, and the first target amplification factor is positively correlated with the difference between the target user number and the initial user number;
and determining the initial memory index as the target memory index under the condition that the target user number is less than or equal to the initial user number.
6. The method of any of claims 2-4, wherein the determining a target processor metric for the target traffic based on the target bandwidth, the initial bandwidth, and the initial processor metric comprises:
under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial processor index based on the second target amplification factor to obtain the target processor index; the second target amplification factor is greater than 1 and the second target amplification factor is positively correlated with the difference between the target bandwidth and the initial bandwidth;
determining the initial processor metric as the target processor metric if the target bandwidth is less than or equal to the initial bandwidth.
7. The method according to any one of claims 2 to 4, wherein the determining a target network card indicator of the target service based on the target bandwidth, the initial bandwidth, and the initial network card indicator comprises:
under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial network card index based on the second target amplification factor to obtain the target network card index; the second target amplification factor is greater than 1 and the second target amplification factor is positively correlated with the difference between the target bandwidth and the initial bandwidth;
and determining the initial network card index as the target network card index under the condition that the target bandwidth is less than or equal to the initial bandwidth.
8. The method according to any of claims 1-4, wherein the allocating resources for the virtual service based on the target resource information comprises:
acquiring the hardware resource occupancy rate of the server and the virtual resource average occupancy rate of the virtual service; the virtual resource average occupancy rate is an average value of virtual resource occupancy rates of a plurality of preset services in the virtual service, and the types of the preset services are the same as the type of the target service;
under the condition that the utilization rate of the hardware resources is smaller than or equal to a first threshold value and the average occupancy rate of the virtual resources is smaller than or equal to a second threshold value, amplifying the target resource information based on a fourth preset multiple, and distributing the target resource information amplified based on the fourth preset multiple to the virtual service; the fourth preset multiple is greater than 1;
under the condition that the hardware resource utilization rate is larger than the first threshold value, distributing the target resource information for the virtual service;
under the condition that the hardware resource utilization rate is smaller than or equal to the first threshold and the virtual resource average occupancy rate is larger than the second threshold, amplifying the target resource information based on a fifth preset multiple, and distributing the target resource information amplified based on the fifth preset multiple to the virtual service; the fifth preset multiple is greater than the fourth preset multiple.
9. A resource allocation device is characterized by comprising an allocation unit, a determination unit, an acquisition unit and an adjustment unit;
the distribution unit is used for deploying virtual services in the server;
the determining unit is configured to determine an initial service capability corresponding to initial resource information of the virtual service; the initial resource information comprises an initial processor index for reflecting the performance of the processor, an initial memory index for reflecting the performance of the memory, and an initial network card index for reflecting the performance of the network card; the initial service capacity comprises an initial user number and an initial bandwidth;
the acquisition unit is used for acquiring the service capacity requirement of the target service; the target service is a service to use the virtual service, and the service capacity requirement comprises the number of target users and a target bandwidth;
the adjusting unit is used for adjusting the initial resource information based on the service capability requirement and the initial service capability to obtain target resource information;
the allocation unit is further configured to allocate resources for the virtual service based on the target resource information.
10. The apparatus according to claim 9, wherein the adjusting unit is specifically configured to:
determining a target memory index of the target service based on the target user number, the initial user number and the initial memory index;
determining a target processor metric for the target traffic based on the target bandwidth, the initial bandwidth, and the initial processor metric;
determining a target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index;
and determining the target memory index, the target processor index and the target network card index as the target resource information.
11. The apparatus according to claim 9, wherein the initial resource information further includes an initial disk index for reflecting disk performance, and the service capability requirement further includes a service type; the adjusting unit is specifically configured to:
determining a target memory index of the target service based on the target user number, the initial user number and the initial memory index;
determining a target processor metric for the target traffic based on the target bandwidth, the initial bandwidth, and the initial processor metric;
determining a target network card index of the target service based on the target bandwidth, the initial bandwidth and the initial network card index;
and determining the target resource information according to the target memory index, the target processor index, the target network card index, the initial disk index and the service type.
12. The resource allocation apparatus according to claim 11, wherein the adjusting unit is specifically configured to:
under the condition that the service type is a learning type, amplifying the target memory index by a first preset multiple, and determining the target processor index, the target network card index, the initial disk index and the amplified target memory index as the target resource information;
under the condition that the service type is a game type, amplifying the target processor index and the target network card index by a second preset multiple, and determining the target memory index, the initial disk index, the amplified target processor index and the amplified target network card index as the target resource information;
and under the condition that the service type is a commercial type, amplifying the initial disk index by a third preset multiple, and determining the target processor index, the target network card index, the target memory index and the amplified initial disk index as the target resource information.
13. The resource allocation apparatus according to any one of claims 10 to 12, wherein the determining unit is specifically configured to:
determining a first target amplification factor based on the number of the target users and the number of the initial users under the condition that the number of the target users is larger than the number of the initial users, and amplifying the initial memory index based on the first target amplification factor to obtain the target memory index; the first target amplification factor is greater than 1 and the first target amplification factor is positively correlated with the difference between the target number of users and the initial number of users;
and determining the initial memory index as the target memory index under the condition that the target user number is less than or equal to the initial user number.
14. The resource allocation apparatus according to any of claims 10-12, wherein the determining unit is specifically configured to:
under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial processor index based on the second target amplification factor to obtain the target processor index; the second target amplification factor is greater than 1 and the second target amplification factor is positively correlated with the difference between the target bandwidth and the initial bandwidth;
determining the initial processor metric as the target processor metric if the target bandwidth is less than or equal to the initial bandwidth.
15. The resource allocation apparatus according to any one of claims 10 to 12, wherein the determining unit is specifically configured to:
under the condition that the target bandwidth is larger than the initial bandwidth, determining a second target amplification factor based on the target bandwidth and the initial bandwidth, and amplifying the initial network card index based on the second target amplification factor to obtain the target network card index; the second target amplification factor is greater than 1 and the second target amplification factor is positively correlated with the difference between the target bandwidth and the initial bandwidth;
and determining the initial network card index as the target network card index when the target bandwidth is less than or equal to the initial bandwidth.
16. The resource allocation apparatus according to any of claims 9-12, wherein the allocation unit is specifically configured to:
acquiring the hardware resource occupancy rate of the server and the virtual resource average occupancy rate of the virtual service; the virtual resource average occupancy rate is an average value of virtual resource occupancy rates of a plurality of preset services in the virtual service, and the types of the preset services are the same as the type of the target service;
under the condition that the utilization rate of the hardware resources is smaller than or equal to a first threshold value and the average occupancy rate of the virtual resources is smaller than or equal to a second threshold value, amplifying the target resource information based on a fourth preset multiple, and distributing the target resource information amplified based on the fourth preset multiple to the virtual service; the fourth preset multiple is greater than 1;
under the condition that the hardware resource utilization rate is larger than the first threshold value, distributing the target resource information for the virtual service;
under the condition that the hardware resource utilization rate is smaller than or equal to the first threshold value and the virtual resource average occupancy rate is larger than the second threshold value, amplifying the target resource information based on a fifth preset multiple, and distributing the target resource information amplified based on the fifth preset multiple to the virtual service; the fifth preset multiple is greater than the fourth preset multiple.
17. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 8.
18. A computer-readable storage medium, wherein computer-executable instructions stored in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of claims 1-8.
CN202211182840.5A 2022-09-27 2022-09-27 Resource allocation method, device, equipment and storage medium Pending CN115766336A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211182840.5A CN115766336A (en) 2022-09-27 2022-09-27 Resource allocation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211182840.5A CN115766336A (en) 2022-09-27 2022-09-27 Resource allocation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115766336A true CN115766336A (en) 2023-03-07

Family

ID=85350285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211182840.5A Pending CN115766336A (en) 2022-09-27 2022-09-27 Resource allocation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115766336A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104142861A (en) * 2013-05-10 2014-11-12 中国电信股份有限公司 Processing method and processing device for configuration of server resources
CN105207812A (en) * 2015-08-28 2015-12-30 广东三盟信息科技有限公司 Service-model-based cloud computing resource prediction method and system
CN107656807A (en) * 2016-07-26 2018-02-02 华为技术有限公司 The automatic elastic telescopic method and device of a kind of virtual resource
CN109995677A (en) * 2018-01-02 2019-07-09 中国移动通信有限公司研究院 Resource allocation methods, device and storage medium
CN113453285A (en) * 2021-06-23 2021-09-28 中国联合网络通信集团有限公司 Resource adjusting method, device and storage medium
CN114095382A (en) * 2020-08-05 2022-02-25 中国移动通信集团重庆有限公司 Network slice virtual resource scheduling method, system, device and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104142861A (en) * 2013-05-10 2014-11-12 中国电信股份有限公司 Processing method and processing device for configuration of server resources
CN105207812A (en) * 2015-08-28 2015-12-30 广东三盟信息科技有限公司 Service-model-based cloud computing resource prediction method and system
CN107656807A (en) * 2016-07-26 2018-02-02 华为技术有限公司 The automatic elastic telescopic method and device of a kind of virtual resource
CN109995677A (en) * 2018-01-02 2019-07-09 中国移动通信有限公司研究院 Resource allocation methods, device and storage medium
CN114095382A (en) * 2020-08-05 2022-02-25 中国移动通信集团重庆有限公司 Network slice virtual resource scheduling method, system, device and equipment
CN113453285A (en) * 2021-06-23 2021-09-28 中国联合网络通信集团有限公司 Resource adjusting method, device and storage medium

Similar Documents

Publication Publication Date Title
US11301303B2 (en) Resource pool processing to determine to create new virtual resource pools and storage devices based on currebt pools and devices not meeting SLA requirements
US11704144B2 (en) Creating virtual machine groups based on request
US9780998B2 (en) Method and apparatus for managing physical network interface card, and physical host
CN107342895B (en) Multi-tenant network optimization method, system, computing device and storage medium
US9639402B2 (en) Systems and methods for automatic hardware provisioning based on application characteristics
CN108924268B (en) Container cloud service system and pod creation method and device
CN109067877B (en) Control method for cloud computing platform deployment, server and storage medium
CN111404753B (en) Flat network configuration method, computer equipment and storage medium
CN114244717A (en) Configuration method and device of virtual network card resources, computer equipment and medium
CN110389843A (en) A kind of business scheduling method, device, equipment and readable storage medium storing program for executing
CN116431282A (en) Cloud virtual host server management method, device, equipment and storage medium
CN112312061A (en) Video conference method, device, electronic equipment and storage medium
CN111324424B (en) Virtual machine deployment method and device, server and storage medium
CN110636149B (en) Remote access method, device, router and storage medium
CN108833570B (en) Cluster storage and balanced transmission system based on cloud storage
CN108347341A (en) A kind of acceleration capacity method of adjustment and device for adjusting virtual machine acceleration capacity
CN111382141A (en) Master-slave architecture configuration method, device, equipment and computer readable storage medium
CN115766336A (en) Resource allocation method, device, equipment and storage medium
CN116436968A (en) Service grid communication method, system, device and storage medium
CN111262771A (en) Virtual private cloud communication system, system configuration method and controller
CN108268300B (en) Virtual machine migration method and device
CN113904871A (en) Network slice access method, PCF entity, terminal and communication system
CN114661465A (en) Resource management method, device, storage medium and electronic equipment
CN114780207A (en) Automatic test method, device and system for multi-virtual machine load of solid state disk
CN111580935A (en) Network communication method, device, equipment and storage medium

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