CN106911772A - Server-assignment method, server-assignment device and electronic equipment - Google Patents

Server-assignment method, server-assignment device and electronic equipment Download PDF

Info

Publication number
CN106911772A
CN106911772A CN201710090797.2A CN201710090797A CN106911772A CN 106911772 A CN106911772 A CN 106911772A CN 201710090797 A CN201710090797 A CN 201710090797A CN 106911772 A CN106911772 A CN 106911772A
Authority
CN
China
Prior art keywords
server
processing resources
amount
spare processing
hard disk
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
CN201710090797.2A
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201710090797.2A priority Critical patent/CN106911772A/en
Publication of CN106911772A publication Critical patent/CN106911772A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1012Server selection for load balancing based on compliance of requirements or conditions with available server resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Hardware Redundancy (AREA)

Abstract

There is provided a kind of server-assignment method, server-assignment device and electronic equipment.The server-assignment method, including:Obtain the spare processing resources of at least two servers for being capable of process task;Estimate the demand process resource of the server that pending task items are operationally used;And spare processing resources and the demand process resource based at least two server select the destination server for running the task items.In the technical scheme according to the embodiment of the present application, each service is enabled to there are enough resources to be calculated, the server in cluster is fully used, so as to reach the optimum use to cluster resource.

Description

Server-assignment method, server-assignment device and electronic equipment
Technical field
The present invention relates to a kind of server-assignment method, server-assignment device and electronic equipment.
Background technology
With the development of computer technology, cluster is widely used.
At present, the manager being managed to Hadoop clusters can only carry out deployment services component according to function dependence Deployment, does not account for the resource/disposal ability and serviced component of server disappearing to the resource/disposal ability of server completely Consumption, so needing deployment personnel according to the experience of oneself to manually adjust which server each serviced component should be deployed to.Cause For this mode is not only high to deployment personnel requirement, and it is time-consuming when cluster scale is larger and especially cumbersome, should not reaches To the optimum use to cluster resource.
Accordingly, it is desired to provide personnel need not be disposed according to the experience of oneself to manually adjust, even in cluster scale When larger, it is also possible to simply reach the scheme of the optimum use of cluster resource.
The content of the invention
The embodiment of the present application provides a kind of server-assignment method, server-assignment device and electronic equipment, and it is not Need deployment personnel according to the experience of oneself to manually adjust, even when cluster scale is larger, it is also possible to simply reach The optimum use of cluster resource.
A kind of first aspect, there is provided server-assignment method, including:Obtain at least two clothes for being capable of process task The spare processing resources of business device;Estimate the demand process resource of the server that pending task items are operationally used;With And the spare processing resources and the demand process resource based at least two server are selected for running described appointing The destination server of business item.
It is described based at least two server with reference in a first aspect, in a kind of implementation of first aspect Spare processing resources and the demand process resource select to include for running the destination server of the task items:Compare institute State the spare processing resources and the demand process resource of each server at least two servers;And based on the ratio Relatively result selects the destination server.
It is described based on described in another implementation of first aspect with reference to first aspect and its above-mentioned implementation Comparative result includes selecting the destination server:If the spare processing resources of server process money less than the demand Source, then do not select the server as the destination server;If the spare processing resources of server are more than or equal to the need Process resource is sought, then using the server as standby server;And the destination service is selected from the standby server Device.
It is described from described standby in another implementation of first aspect with reference to first aspect and its above-mentioned implementation Included with the destination server is selected in server:Calculate the remaining Service Source of each standby server, residue service Resource is the surplus resources after the server runs the task items;And remaining service is selected from the standby server The maximum server of resource is used as destination server.
With reference to first aspect and its above-mentioned implementation, in another implementation of first aspect, in the standby clothes In the case that the quantity of business device is at least two, the service for selecting remaining Service Source maximum from the standby server Device includes as destination server:The demand process resource is subtracted from the spare processing resources of the standby server, by institute The difference for obtaining is normalized;Normalized value is weighted;And the maximum standby server of selection weighted value is used as the mesh Mark server.
With reference to first aspect and its above-mentioned implementation, in another implementation of first aspect, the acquisition can The spare processing resources of at least two servers of process task include:The CPU for obtaining at least two server is remaining At least one of the vacant amount of amount, free memory, network, residual memory space of hard disk, as the spare processing resources, It is described normalized value to be weighted including being respectively provided with corresponding weight for different spare processing resources.
It is described based on described in another implementation of first aspect with reference to first aspect and its above-mentioned implementation The spare processing resources of at least two servers and the demand process resource select the target for running the task items Server includes:The spare processing resources are sorted successively from high to low;By the standby treatment money of the most preceding server that sorts Source is compared with the demand process resource;Processed more than the demand in the spare processing resources of the most preceding server that sorts During resource, using the most preceding server of the sequence as the destination server.
With reference to first aspect and its above-mentioned implementation, in another implementation of first aspect, the acquisition can The spare processing resources of at least two servers of process task include:The CPU for obtaining at least two server is remaining At least one of the vacant amount of amount, free memory, network, residual memory space of hard disk, as the spare processing resources.
A kind of second aspect, there is provided server-assignment device, including:Acquiring unit, obtains and is capable of process task The spare processing resources of at least two servers;Estimation unit, estimates the service that pending task items are operationally used The demand process resource of device;And select unit, spare processing resources and the demand based at least two server Process resource selects the destination server for running the task items.
With reference to second aspect, in a kind of implementation of second aspect, the select unit includes:First comparing section Part, the spare processing resources and the demand process resource of each server in relatively more described at least two server;And First choice part, the destination server is selected based on the comparative result.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, if server Spare processing resources are less than the demand process resource, then the first choice part does not select the server as the target Server, if the spare processing resources of server are more than or equal to the demand process resource, the first choice part will Used as standby server, the first choice part selects the destination server to the server from the standby server.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, the first choice Part calculates the remaining Service Source of each standby server, the remaining Service Source be the server run the task items it Surplus resources afterwards, select the maximum server of remaining Service Source as destination server from the standby server.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, in the standby clothes In the case that the quantity of business device is at least two, the first choice part subtracts from the spare processing resources of the standby server The demand process resource is gone, the difference of gained is normalized, normalized value is weighted, select the standby of weighted value maximum With server as the destination server.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, the acquiring unit In obtaining CPU surpluses, free memory, the vacant amount of network, the residual memory space of hard disk of at least two server At least one, used as the spare processing resources, the first choice part sets respectively for different spare processing resources Put corresponding weight.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, the select unit Including:The spare processing resources are sorted by ordering element successively from high to low;Second comparing unit, by the most preceding clothes that sort The spare processing resources of business device are compared with the demand process resource;Second alternative pack, in the most preceding server that sorts Spare processing resources be more than the demand process resource when, using the most preceding server of the sequence as the destination server.
With reference to second aspect and its above-mentioned implementation, in another implementation of second aspect, the acquiring unit In obtaining CPU surpluses, free memory, the vacant amount of network, the residual memory space of hard disk of at least two server At least one, as the spare processing resources.
The third aspect, there is provided a kind of electronic equipment, it may include server-assignment device as described above.
In the technical side of server-assignment method, server-assignment device and electronic equipment according to the embodiment of the present application In case, each service is enabled to there are enough resources to be calculated, the server in cluster is fully used, so that Reach the optimum use to cluster resource.
Brief description of the drawings
In order to illustrate more clearly of the technical scheme of the embodiment of the present application, below will be in embodiment or description of the prior art The required accompanying drawing for using is briefly described, it should be apparent that, drawings in the following description are only some realities of the application Example is applied, for those of ordinary skill in the art, on the premise of not paying creative work, can also be according to these accompanying drawings Obtain other accompanying drawings.
Fig. 1 is the schematic diagram of the application scenarios for schematically illustrating embodiments herein;
Fig. 2 is the flow chart for schematically illustrating the server-assignment method according to the embodiment of the present application;
Fig. 3 schematically illustrates the flow of the selection target server in the server-assignment method of Fig. 2;
Fig. 4 schematically illustrates the further flow of the selection target server in the server-assignment method of Fig. 2
Fig. 5 schematically illustrates another flow of the selection target server in the server-assignment method of Fig. 2;
Fig. 6 is the block diagram for schematically illustrating the server-assignment device according to the embodiment of the present application;
Fig. 7 is the block diagram of the select unit for schematically illustrating the server-assignment device according to the embodiment of the present application;
Fig. 8 is another frame for the select unit for schematically illustrating the server-assignment device according to the embodiment of the present application Figure;
Fig. 9 is the block diagram for schematically illustrating another server-assignment device according to the embodiment of the present application.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is carried out clear, complete Site preparation is described, it is clear that described embodiment is some embodiments of the present application, rather than whole embodiments.
Fig. 1 is the schematic diagram of the application scenarios for schematically illustrating embodiments herein.As shown in figure 1, in cluster, At least two servers are connected with one platform manager, be shown server 11, server 12 ... server 1n, Wherein, n is greater than 1 natural number.
These servers 11, server 12 ... as long as server 1n includes processor, hard disk, internal memory, system bus Deng being then not particularly limited its species.As long as also, connected on a platform manager, then these servers may be located at together One place, it is also possible to positioned at different places.
The manager being managed to cluster considers to be connected to the disposal ability and pending task of the server of oneself Item uses the discreet value of server resource, to the pending automatic distribution server of task items, so that each server It is fully utilized.
Rule of thumb manually adjusted which server is each task items be assigned to due to personnel need not be disposed, so this When the especially suitable cluster scale of the mode of kind is larger.Reach the optimum use to cluster resource.
Fig. 2 is the flow chart for schematically illustrating the server-assignment method S2 according to the embodiment of the present application.
As shown in Fig. 2 server-assignment method S2 may include:Obtain server 11, the service for being capable of process task Device 12 ... the spare processing resources (S21) of server 1n;Estimate the server that pending task items are operationally used Demand process resource (S22);And based on the server 11, server 12 ... the spare processing resources of server 1n The destination server (S23) for running the task items is selected with the demand process resource.
As described above, these servers 11, server 12 ... server 1n may be located at same place, it is also possible to Positioned at different places.Here, spare processing resources are the abilities that server can provide process resource, can be each services The vacant amount of the CPU surpluses of device, free memory, network, residual memory space of hard disk etc., but it is not limited to this.Demand Process resource is the process resource of the server needed to use when task items are run in the server, can be CPU usage amounts, interior Usage amount, Web vector graphic amount, hard disk usage amount etc. are deposited, but is not limited to this.Can in advance assess and pending appoint at each The average resource that business item is needed to use in operation or calculating.
Fig. 3 schematically illustrates the flow of the selection target server in the server-assignment method S2 of Fig. 2.
As shown in figure 3, can as follows select the destination server for running the task items in S23:Compare described Server 11, server 12 ... the spare processing resources of each server in server 1n and the demand process resource (S231);And the destination server (S232) is selected based on the comparative result.
Here, spare processing resources can be the CPU surpluses of each server, free memory, the vacant amount of network, hard Residual memory space of disk etc., demand process resource can be that CPU usage amounts, internal memory usage amount, Web vector graphic amount, hard disk are used Amount etc..
For example, when spare processing resources to be set to the CPU surpluses of each server, demand process resource is set to CPU usage amounts, compare the CPU surpluses and CPU usage amounts of each server;Spare processing resources are being set to each server Free memory when, demand process resource is set to internal memory usage amount, the free memory and internal memory for comparing each server are used Amount;In the vacant amount of network that spare processing resources are set to each server, demand process resource is set to Web vector graphic Amount, compares the vacant amount of network and Web vector graphic amount of each server;Spare processing resources are being set to each server During the residual memory space of hard disk, demand process resource is set to hard disk usage amount, compares the residue of the hard disk of each server Memory space and hard disk usage amount.
Again for example, when spare processing resources to be set to the CPU surpluses and free memory of each server, at demand Reason resource be set to CPU usage amounts and internal memory usage amount, be respectively compared in each server CPU surpluses and CPU usage amounts with And free memory and internal memory usage amount;It is vacant in the CPU surpluses and network that spare processing resources are set to each server During amount, demand process resource is set to CPU usage amounts and Web vector graphic amount, CPU surpluses are respectively compared in each server With CPU usage amounts and the vacant amount of network and Web vector graphic amount;Remained in the CPU that spare processing resources are set to each server During the residual memory space of surplus and hard disk, demand process resource is set to CPU usage amounts and hard disk usage amount, in each service The residual memory space and hard disk usage amount of CPU surpluses and CPU usage amounts and hard disk are respectively compared in device;By standby place When reason resource is set to the vacant amount of free memory and network of each server, by demand process resource be set to internal memory usage amount and Web vector graphic amount, free memory and internal memory usage amount and the vacant amount of network and network are respectively compared in each server to be made Consumption;When spare processing resources to be set to the residual memory space of the free memory of each server and hard disk, at demand Reason resource be set to internal memory usage amount and hard disk usage amount, be respectively compared in each server free memory and internal memory usage amount with And the residual memory space and hard disk usage amount of hard disk;Spare processing resources are being set to the vacant amount of network of each server During with the residual memory space of hard disk, demand process resource is set to Web vector graphic amount and hard disk usage amount, in each server In be respectively compared the residual memory space and hard disk usage amount of the vacant amount of network and Web vector graphic amount and hard disk.
Again for example, not accounted in CPU surpluses, free memory and the network that spare processing resources are set to each server During consumption, demand process resource is set to CPU usage amounts, internal memory usage amount and Web vector graphic amount, divided in each server Do not compare CPU surpluses and CPU usage amounts, free memory and internal memory usage amount and the vacant amount of network and Web vector graphic amount; In the residual memory space of the free memory, the vacant amount of network and hard disk that spare processing resources are set to each server When, demand process resource is set to internal memory usage amount, Web vector graphic amount and hard disk usage amount, compare respectively in each server Residual memory space and hard disk compared with free memory and the vacant amount of internal memory usage amount, network and Web vector graphic amount and hard disk make Consumption;Spare processing resources are being set to the remaining storage of CPU surpluses, the vacant amount of network and the hard disk of each server During space, demand process resource is set to CPU usage amounts, Web vector graphic amount and hard disk usage amount, divided in each server Do not compare the residual memory space of CPU surpluses and the vacant amount of CPU usage amounts, network and Web vector graphic amount and hard disk and hard Disk usage amount;Spare processing resources are being set to the remaining storage of CPU surpluses, free memory and the hard disk of each server During space, demand process resource is set to CPU usage amounts, internal memory usage amount and hard disk usage amount, divided in each server The residual memory space and hard disk for not comparing CPU surpluses and CPU usage amounts, free memory and internal memory usage amount and hard disk make Consumption.
Again for example, vacant spare processing resources to be set to the CPU surpluses of each server, free memory, network When amount, the residual memory space of hard disk, demand process resource is set to CPU usage amounts, internal memory usage amount, Web vector graphic amount, net Network usage amount, is respectively compared CPU surpluses and CPU usage amounts, free memory and internal memory usage amount, network in each server Vacant amount and Web vector graphic amount, the residual memory space of hard disk and hard disk usage amount.
Fig. 4 schematically illustrates the further flow of the selection target server in the server-assignment method S2 of Fig. 2.
As shown in figure 4, can as follows select the destination server in S232:If the spare processing resources of server Less than the demand process resource, then the server is not selected as the destination server (S2321);If server is standby It is more than or equal to the demand process resource with process resource, then using the server as standby server (S2322);And from institute State and select the destination server (S2323) in standby server.
Here, spare processing resources can be the CPU surpluses of each server, free memory, the vacant amount of network, hard Residual memory space of disk etc., demand process resource can be that CPU usage amounts, internal memory usage amount, Web vector graphic amount, hard disk are used Amount etc..
For example, when spare processing resources to be set to the CPU surpluses of each server, demand process resource is set to CPU usage amounts, compare the CPU surpluses and CPU usage amounts of each server, if the CPU surpluses of server are used less than CPU Amount, then do not select the server as destination server, if the CPU surpluses of server are more than or equal to CPU usage amounts, should Server is used as standby server;When spare processing resources to be set to the free memory of each server, demand treatment is provided Source is set to internal memory usage amount, compares the free memory and internal memory usage amount of each server, if the free memory of server is less than Internal memory usage amount, then do not select the server as destination server, if the free memory of server is used more than or equal to internal memory Amount, then using the server as standby server;In the vacant amount of network that spare processing resources are set to each server, Demand process resource is set to Web vector graphic amount, compares the vacant amount of network and Web vector graphic amount of each server, if service The vacant amount of network of device is less than Web vector graphic amount, then the server is not selected as destination server, if the network of server Vacant amount is more than or equal to Web vector graphic amount, then using the server as standby server;It is set to often by spare processing resources During the residual memory space of the hard disk of individual server, demand process resource is set to hard disk usage amount, compares each server The residual memory space and hard disk usage amount of hard disk, if the residual memory space of the hard disk of server is less than hard disk usage amount, The server is not selected as destination server, if the residual memory space of the hard disk of server is more than or equal to hard disk usage amount, Then using the server as standby server.
Again for example, when spare processing resources to be set to the CPU surpluses and free memory of each server, at demand Reason resource be set to CPU usage amounts and internal memory usage amount, be respectively compared in each server CPU surpluses and CPU usage amounts with And free memory and internal memory usage amount, if the CPU surpluses of server make less than CPU usage amounts or free memory less than internal memory Consumption, then do not select the server as destination server, if the CPU surpluses of server are more than or equal to CPU usage amounts and can It is more than or equal to internal memory usage amount with internal memory, then using the server as standby server;Spare processing resources are being set to each During the vacant amount of the CPU surpluses and network of server, demand process resource is set to CPU usage amounts and Web vector graphic amount, CPU surpluses and CPU usage amounts and the vacant amount of network and Web vector graphic amount are respectively compared in each server, if server CPU surpluses be less than Web vector graphic amount less than CPU usage amounts or the vacant amount of network, then do not select the server as mesh Mark server, if the CPU surpluses of server are more than or equal to CPU usage amounts and the vacant amount of network is more than or equal to Web vector graphic Amount, then using the server as standby server;Spare processing resources are being set to the CPU surpluses and hard disk of each server Residual memory space when, demand process resource is set to CPU usage amounts and hard disk usage amount, compare respectively in each server Compared with CPU surpluses and the residual memory space and hard disk usage amount of CPU usage amounts and hard disk, if the CPU surpluses of server Residual memory space less than CPU usage amounts or hard disk is less than hard disk usage amount, then do not select the server to be taken as target Business device, if the CPU surpluses of server are used more than or equal to the residual memory space of CPU usage amounts and hard disk more than or equal to hard disk Amount, then using the server as standby server;Spare processing resources are being set to the free memory and network of each server During vacant amount, demand process resource is set to internal memory usage amount and Web vector graphic amount, being respectively compared in each server can With internal memory and internal memory usage amount and the vacant amount of network and Web vector graphic amount, if the free memory of server is used less than internal memory Amount or the vacant amount of network are less than Web vector graphic amount, then do not select the server as destination server, if server can It is more than or equal to Web vector graphic amount more than or equal to internal memory usage amount and the vacant amount of network with internal memory, then using the server as standby Server;When spare processing resources to be set to the residual memory space of the free memory of each server and hard disk, by demand Process resource is set to internal memory usage amount and hard disk usage amount, and free memory and internal memory usage amount are respectively compared in each server And the residual memory space and hard disk usage amount of hard disk, if the free memory of server is less than internal memory usage amount or hard disk Residual memory space is less than hard disk usage amount, then the server is not selected as destination server, if the free memory of server Residual memory space more than or equal to internal memory usage amount and hard disk is more than or equal to hard disk usage amount, then using the server as standby Server;When spare processing resources to be set to the residual memory space of the vacant amount of network of each server and hard disk, will Demand process resource is set to Web vector graphic amount and hard disk usage amount, and the vacant amount of network and net are respectively compared in each server The residual memory space and hard disk usage amount of network usage amount and hard disk, if the vacant amount of the network of server is less than Web vector graphic The residual memory space of amount or hard disk is less than hard disk usage amount, then the server is not selected as destination server, if service The vacant amount of network of device is more than or equal to hard disk usage amount more than or equal to the residual memory space of Web vector graphic amount and hard disk, then will The server is used as standby server.
Again for example, not accounted in CPU surpluses, free memory and the network that spare processing resources are set to each server During consumption, demand process resource is set to CPU usage amounts, internal memory usage amount and Web vector graphic amount, divided in each server Do not compare CPU surpluses and CPU usage amounts, free memory and internal memory usage amount and the vacant amount of network and Web vector graphic amount, If the CPU surpluses of server are small less than internal memory usage amount or the vacant amount of network less than CPU usage amounts or free memory In Web vector graphic amount, then the server is not selected as destination server, if the CPU surpluses of server make more than or equal to CPU Consumption and free memory are more than internal memory usage amount and the vacant amount of network is more than or equal to Web vector graphic amount, then using the server as Standby server;Spare processing resources are being set to the surplus of free memory, the vacant amount of network and the hard disk of each server During remaining memory space, demand process resource is set to internal memory usage amount, Web vector graphic amount and hard disk usage amount, in each service The remaining storage that free memory and the vacant amount of internal memory usage amount, network and Web vector graphic amount and hard disk are respectively compared in device is empty Between and hard disk usage amount, if the free memory of server is less than Web vector graphic amount less than internal memory usage amount or the vacant amount of network Or the residual memory space of hard disk is less than hard disk usage amount, then the server is not selected as destination server, if server Remaining storage of the free memory more than or equal to internal memory usage amount and the vacant amount of network more than or equal to Web vector graphic amount and hard disk Space is more than or equal to hard disk usage amount, then using the server as standby server;Spare processing resources are being set to each clothes During the residual memory space of the CPU surpluses, the vacant amount of network and hard disk of business device, demand process resource is set into CPU makes Consumption, Web vector graphic amount and hard disk usage amount, are respectively compared CPU surpluses and CPU usage amounts, network in each server The residual memory space and hard disk usage amount of vacant amount and Web vector graphic amount and hard disk, if the CPU surpluses of server are small Used less than hard disk less than the residual memory space of Web vector graphic amount or hard disk in CPU usage amounts or the vacant amount of network Amount, then do not select the server as destination server, if the CPU surpluses of server are more than or equal to CPU usage amounts and network Vacant amount is more than or equal to hard disk usage amount more than or equal to the residual memory space of Web vector graphic amount and hard disk, then by the server As standby server;Spare processing resources are being set to the surplus of CPU surpluses, free memory and the hard disk of each server During remaining memory space, demand process resource is set to CPU usage amounts, internal memory usage amount and hard disk usage amount, in each service Be respectively compared in device CPU surpluses and CPU usage amounts, free memory and internal memory usage amount and hard disk residual memory space and Hard disk usage amount, if the CPU surpluses of server are less than internal memory usage amount or hard disk less than CPU usage amounts or free memory Residual memory space be less than hard disk usage amount, then the server is not selected as destination server, if the CPU of server is remaining Amount is more than or equal to CPU usage amounts and free memory is more than or equal to the residual memory space of internal memory usage amount and hard disk more than or equal to hard Disk usage amount, then using the server as standby server.
Again for example, vacant spare processing resources to be set to the CPU surpluses of each server, free memory, network When amount, the residual memory space of hard disk, demand process resource is set to CPU usage amounts, internal memory usage amount, Web vector graphic amount, hard Disk usage amount, is respectively compared CPU surpluses and CPU usage amounts, free memory and internal memory usage amount, network in each server Vacant amount and Web vector graphic amount, the residual memory space of hard disk and hard disk usage amount, if the CPU surpluses of server are less than CPU usage amounts or free memory are surplus less than Web vector graphic amount or hard disk less than internal memory usage amount or the vacant amount of network Remaining memory space is less than hard disk usage amount, then the server is not selected as destination server, if the CPU surpluses of server are big In equal to CPU usage amounts and free memory more than or equal to internal memory usage amount and the vacant amount of network more than or equal to Web vector graphic amount and The residual memory space of hard disk is more than or equal to hard disk usage amount, then using the server as standby server.
Also, the destination server can be as follows selected in S2323:Calculate the remaining service of each standby server Resource, the remaining Service Source is the surplus resources after the server runs the task items;And from the active service The maximum server of remaining Service Source is selected in device as destination server.
For example, when spare processing resources to be set to the CPU surpluses of each server, demand process resource is set to CPU usage amounts, calculate CPU surpluses more than or equal to the remaining Service Source of each standby server of CPU usage amounts namely (CPU surplus-CPU usage amounts), selects (CPU surplus-CPU usage amounts) maximum server from multiple standby servers As destination server;When spare processing resources to be set to the free memory of each server, demand process resource is set to Internal memory usage amount, calculate free memory more than or equal to internal memory usage amount each standby server remaining Service Source namely (free memory-internal memory usage amount), selects (free memory-internal memory usage amount) maximum server from multiple standby servers As destination server;In the vacant amount of network that spare processing resources are set to each server, by demand process resource It is set to Web vector graphic amount, remaining service money of the vacant amount of calculating network more than or equal to each standby server of Web vector graphic amount Source namely (the vacant amount of network-Web vector graphic amount), select (vacant amount-the Web vector graphic of network from multiple standby servers Amount) maximum server is used as destination server;Spare processing resources are being set to the remaining storage of the hard disk of each server During space, demand process resource is set to hard disk usage amount, the residual memory space for calculating hard disk is more than or equal to hard disk usage amount Each standby server remaining Service Source namely (residual memory space of hard disk-hard disk usage amount), from multiple it is standby (residual memory space of hard disk-hard disk usage amount) maximum server is selected in server as destination server.
Preferably, from server 11, server 12 ... the spare processing resources of server 1n subtract demand treatment Resource, the difference of gained is normalized, and normalized value is weighted, and the maximum standby server of selection weighted value is used as institute State destination server.
For example, quantifying to the spare processing resources of each server in cluster, and recorded by vector.This In, spare processing resources may include that the CPU surpluses of each server, free memory, the vacant amount of network, the residue of hard disk are deposited At least one of storage space.Such as press the vacant amount of CPU surpluses, free memory, network, the residual memory space of hard disk it is suitable The vector (34.08,256,1000,2000) of sequence record, represents that this standby server has the CPU surpluses of 34.08GHz, 256G free memories, the network interface card of 1000Mbps, 2000GB is the hard disk of 2T.Then, to each task items in operation or calculating The average resource for using is estimated, and is recorded by the vector of identical dimensional, such as (2.13,16,0,1), represents this task Item needs to use the CPU of 2.13GHz, 16G internal memories not to use Internet resources, at most use the disk of 1GB in operation/calculating Space.
When for task items distribution server, the spare processing resources of each standby server first subtract demand treatment money The difference in source, it is assumed that the spare processing resources of standby server are vectorial (C1, C2 ... Cn), demand process resource for vector (U1, U2 ... Un), then it is poor to be represented by (C1-U1, C2-U2 ... Cn-Un), at this moment if there is negative value, then show this task items not It is adapted to be performed on this standby server.Then, the difference to gained is normalized ((C1-U1)/C1, (C2-U2)/C2 ... (Cn-Un)/Cn).Then, ((k1, k2 ... k4) carries out product, and weight vectors here can be according to each dimension with weight vectors Proportion be defined, but each single item value all more than zero less than or equal between 1.Finally, selection weighted value maximum is standby Server is used as destination server.
Fig. 5 schematically illustrates another flow of the selection target server in the server-assignment method S2 of Fig. 2.
As shown in figure 5, can as follows select the destination server for running the task items in S23:To standby place Reason resource sorts (S233) successively from high to low;The spare processing resources of the most preceding server that sorts are entered with demand process resource Row compares (S234);When the spare processing resources of the most preceding server that sorts are more than demand process resource, before the sequence most Server as destination server (S235).
For example, it is also possible to first the spare processing resources to server sort successively from high to low, then from each server Spare processing resources subtract the demand process resource, and the difference of gained is normalized, and normalized value is weighted, selection The maximum standby server of weighted value is used as the destination server.
According to the technical scheme of the above-mentioned server-assignment method of the embodiment of the present application, each is enabled to service There can be enough resources to be calculated, even when cluster scale is larger, the server in cluster is also fully used, from And reach the optimum use to cluster resource.
Fig. 6 is the block diagram for schematically illustrating the server-assignment device 6 according to the embodiment of the present application.
As shown in fig. 6, the server-assignment device 6 may include:Acquiring unit 61, obtain can process task at least Two spare processing resources of server;Estimation unit 62, estimates the server that pending task items are operationally used Demand process resource;And select unit 63, spare processing resources and the demand based at least two server Process resource selects the destination server for running the task items.
Here, spare processing resources are the abilities that server can provide process resource, can be the CPU of each server The vacant amount of surplus, free memory, network, residual memory space of hard disk etc., but it is not limited to this.
Demand process resource is the process resource of the server needed to use when task items are run in the server, Ke Yishi CPU usage amounts, internal memory usage amount, Web vector graphic amount, hard disk usage amount etc., but it is not limited to this.Can assess in advance every The average resource that individual pending task items are needed to use in operation or calculating.
Fig. 7 is the block diagram of the select unit 63 for schematically illustrating the server-assignment device 6 according to the embodiment of the present application.
As shown in fig. 7, select unit 63 can be further included:First comparing unit 631, relatively more described at least two service The spare processing resources of each server in device and the demand process resource;And first choice part 632, based on described Comparative result selects the destination server.
Here, spare processing resources can be the CPU surpluses of each server, free memory, the vacant amount of network, hard Residual memory space of disk etc., demand process resource can be that CPU usage amounts, internal memory usage amount, Web vector graphic amount, hard disk are used Amount etc..
For example, when spare processing resources to be set to the CPU surpluses of each server, demand process resource is set to CPU usage amounts, compare the CPU surpluses and CPU usage amounts of each server;Spare processing resources are being set to each server Free memory when, demand process resource is set to internal memory usage amount, the free memory and internal memory for comparing each server are used Amount;In the vacant amount of network that spare processing resources are set to each server, demand process resource is set to Web vector graphic Amount, compares the vacant amount of network and Web vector graphic amount of each server;Spare processing resources are being set to each server During the residual memory space of hard disk, demand process resource is set to hard disk usage amount, compares the residue of the hard disk of each server Memory space and hard disk usage amount.
Again for example, when spare processing resources to be set to the CPU surpluses and free memory of each server, at demand Reason resource be set to CPU usage amounts and internal memory usage amount, be respectively compared in each server CPU surpluses and CPU usage amounts with And free memory and internal memory usage amount;It is vacant in the CPU surpluses and network that spare processing resources are set to each server During amount, demand process resource is set to CPU usage amounts and Web vector graphic amount, CPU surpluses are respectively compared in each server With CPU usage amounts and the vacant amount of network and Web vector graphic amount;Remained in the CPU that spare processing resources are set to each server During the residual memory space of surplus and hard disk, demand process resource is set to CPU usage amounts and hard disk usage amount, in each service The residual memory space and hard disk usage amount of CPU surpluses and CPU usage amounts and hard disk are respectively compared in device;By standby place When reason resource is set to the vacant amount of free memory and network of each server, by demand process resource be set to internal memory usage amount and Web vector graphic amount, free memory and internal memory usage amount and the vacant amount of network and network are respectively compared in each server to be made Consumption;When spare processing resources to be set to the residual memory space of the free memory of each server and hard disk, at demand Reason resource be set to internal memory usage amount and hard disk usage amount, be respectively compared in each server free memory and internal memory usage amount with And the residual memory space and hard disk usage amount of hard disk;Spare processing resources are being set to the vacant amount of network of each server During with the residual memory space of hard disk, demand process resource is set to Web vector graphic amount and hard disk usage amount, in each server In be respectively compared the residual memory space and hard disk usage amount of the vacant amount of network and Web vector graphic amount and hard disk.
Again for example, not accounted in CPU surpluses, free memory and the network that spare processing resources are set to each server During consumption, demand process resource is set to CPU usage amounts, internal memory usage amount and Web vector graphic amount, divided in each server Do not compare CPU surpluses and CPU usage amounts, free memory and internal memory usage amount and the vacant amount of network and Web vector graphic amount; In the residual memory space of the free memory, the vacant amount of network and hard disk that spare processing resources are set to each server When, demand process resource is set to internal memory usage amount, Web vector graphic amount and hard disk usage amount, compare respectively in each server Residual memory space and hard disk compared with free memory and the vacant amount of internal memory usage amount, network and Web vector graphic amount and hard disk make Consumption;Spare processing resources are being set to the remaining storage of CPU surpluses, the vacant amount of network and the hard disk of each server During space, demand process resource is set to CPU usage amounts, Web vector graphic amount and hard disk usage amount, divided in each server Do not compare the residual memory space of CPU surpluses and the vacant amount of CPU usage amounts, network and Web vector graphic amount and hard disk and hard Disk usage amount;Spare processing resources are being set to the remaining storage of CPU surpluses, free memory and the hard disk of each server During space, demand process resource is set to CPU usage amounts, internal memory usage amount and hard disk usage amount, divided in each server The residual memory space and hard disk for not comparing CPU surpluses and CPU usage amounts, free memory and internal memory usage amount and hard disk make Consumption.
Again for example, vacant spare processing resources to be set to the CPU surpluses of each server, free memory, network When amount, the residual memory space of hard disk, demand process resource is set to CPU usage amounts, internal memory usage amount, Web vector graphic amount, net Network usage amount, is respectively compared CPU surpluses and CPU usage amounts, free memory and internal memory usage amount, network in each server Vacant amount and Web vector graphic amount, the residual memory space of hard disk and hard disk usage amount.
If the spare processing resources of server are less than demand process resource, first choice part 632 does not select the clothes Business device is used as destination server, if the spare processing resources of server are more than or equal to demand process resource, first choice portion Part 632 is using the server as standby server, the selection target server from standby server of first choice part 632.
For example, when spare processing resources to be set to the CPU surpluses of each server, demand process resource is set to CPU usage amounts, compare the CPU surpluses and CPU usage amounts of each server, if the CPU surpluses of server are used less than CPU Amount, then first choice part 632 does not select the server as destination server, if the CPU surpluses of server are more than or equal to CPU usage amounts, then first choice part 632 is using the server as standby server;Spare processing resources are being set to each During the free memory of server, demand process resource is set to internal memory usage amount, compares the free memory of each server and interior Usage amount is deposited, if the free memory of server is less than internal memory usage amount, first choice part 632 does not select the server conduct Destination server, if the free memory of server is more than or equal to internal memory usage amount, first choice part 632 makees the server It is standby server;In the vacant amount of network that spare processing resources are set to each server, demand process resource is set It is Web vector graphic amount, compares the vacant amount of network and Web vector graphic amount of each server, if the vacant amount of the network of server Less than Web vector graphic amount, then first choice part 632 does not select the server as destination server, if the network of server is not Occupancy is more than or equal to Web vector graphic amount, then first choice part 632 is using the server as standby server;By standby place During the residual memory space of the hard disk that reason resource is set to each server, demand process resource is set to hard disk usage amount, compared The residual memory space and hard disk usage amount of the hard disk of each server, if the residual memory space of the hard disk of server is less than hard Disk usage amount, then first choice part 632 do not select the server as destination server, if the residue of the hard disk of server is deposited Storage space is more than or equal to hard disk usage amount, then first choice part 632 is using the server as standby server.
Again for example, when spare processing resources to be set to the CPU surpluses and free memory of each server, at demand Reason resource be set to CPU usage amounts and internal memory usage amount, be respectively compared in each server CPU surpluses and CPU usage amounts with And free memory and internal memory usage amount, if the CPU surpluses of server make less than CPU usage amounts or free memory less than internal memory Consumption, then first choice part 632 do not select the server as destination server, if the CPU surpluses of server more than etc. It is more than or equal to internal memory usage amount in CPU usage amounts and free memory, then first choice part 632 is using the server as standby clothes Business device;In the vacant amount of CPU surpluses and network that spare processing resources are set to each server, by demand process resource CPU usage amounts and Web vector graphic amount are set to, CPU surpluses and CPU usage amounts and network are respectively compared in each server Vacant amount and Web vector graphic amount, if the CPU surpluses of server are less than network less than CPU usage amounts or the vacant amount of network Usage amount, then first choice part 632 do not select the server as destination server, if the CPU surpluses of server are more than Be more than or equal to Web vector graphic amount equal to CPU usage amounts and the vacant amount of network, then first choice part 632 using the server as Standby server;When spare processing resources to be set to the residual memory space of the CPU surpluses of each server and hard disk, will Demand process resource is set to CPU usage amounts and hard disk usage amount, and CPU surpluses and CPU are respectively compared in each server to be made The residual memory space and hard disk usage amount of consumption and hard disk, if the CPU surpluses of server are less than CPU usage amounts or hard The residual memory space of disk is less than hard disk usage amount, then first choice part 632 does not select the server as destination server, If the CPU surpluses of server are more than or equal to hard disk usage amount more than or equal to the residual memory space of CPU usage amounts and hard disk, First choice part 632 is using the server as standby server;Spare processing resources are being set to the available of each server When internal memory and the vacant amount of network, demand process resource is set to internal memory usage amount and Web vector graphic amount, in each server Free memory and internal memory usage amount and the vacant amount of network and Web vector graphic amount are respectively compared, if the free memory of server is small Web vector graphic amount is less than in internal memory usage amount or the vacant amount of network, then first choice part 632 does not select the server to make It is destination server, if the free memory of server is more than or equal to internal memory usage amount and the vacant amount of network and makes more than or equal to network Consumption, then first choice part 632 is using the server as standby server;Spare processing resources are being set to each server Free memory and hard disk residual memory space when, demand process resource is set to internal memory usage amount and hard disk usage amount, The residual memory space and hard disk usage amount of free memory and internal memory usage amount and hard disk are respectively compared in each server, if The free memory of server is less than hard disk usage amount less than the residual memory space of internal memory usage amount or hard disk, then first choice Part 632 does not select the server as destination server, if the free memory of server is more than or equal to internal memory usage amount and hard The residual memory space of disk is more than or equal to hard disk usage amount, then first choice part 632 is using the server as standby server; When spare processing resources to be set to the residual memory space of the vacant amount of network of each server and hard disk, demand is processed Resource is set to Web vector graphic amount and hard disk usage amount, and the vacant amount of network and Web vector graphic amount are respectively compared in each server And the residual memory space and hard disk usage amount of hard disk, if the vacant amount of the network of server is less than Web vector graphic amount or hard The residual memory space of disk is less than hard disk usage amount, then first choice part 632 does not select the server as destination server, If the vacant amount of the network of server is used more than or equal to the residual memory space of Web vector graphic amount and hard disk more than or equal to hard disk Amount, then first choice part 632 is using the server as standby server.
Again for example, not accounted in CPU surpluses, free memory and the network that spare processing resources are set to each server During consumption, demand process resource is set to CPU usage amounts, internal memory usage amount and Web vector graphic amount, divided in each server Do not compare CPU surpluses and CPU usage amounts, free memory and internal memory usage amount and the vacant amount of network and Web vector graphic amount, If the CPU surpluses of server are small less than internal memory usage amount or the vacant amount of network less than CPU usage amounts or free memory In Web vector graphic amount, then first choice part 632 does not select the server as destination server, if the CPU of server is remaining Amount is more than or equal to CPU usage amounts and free memory is more than internal memory usage amount and the vacant amount of network is more than or equal to Web vector graphic amount, Then first choice part 632 is using the server as standby server;Can what spare processing resources were set into each server During with the residual memory space of internal memory, the vacant amount of network and hard disk, demand process resource is set to internal memory usage amount, network Usage amount and hard disk usage amount, are respectively compared free memory and the vacant amount of internal memory usage amount, network in each server With Web vector graphic amount and the residual memory space and hard disk usage amount of hard disk, if the free memory of server is used less than internal memory Amount or the vacant amount of network are less than hard disk usage amount less than the residual memory space of Web vector graphic amount or hard disk, then the first choosing Select part 632 and do not select the server as destination server, if the free memory of server more than or equal to internal memory usage amount and The vacant amount of network is more than or equal to hard disk usage amount more than or equal to the residual memory space of Web vector graphic amount and hard disk, then the first choosing Part 632 is selected using the server as standby server;Spare processing resources are set to each server CPU surpluses, During the residual memory space of the vacant amount of network and hard disk, by demand process resource be set to CPU usage amounts, Web vector graphic amount with And hard disk usage amount, CPU surpluses and the vacant amount of CPU usage amounts, network and network are respectively compared in each server to be made The residual memory space and hard disk usage amount of consumption and hard disk, if the CPU surpluses of server are less than CPU usage amounts or net The vacant amount of network is less than hard disk usage amount less than the residual memory space of Web vector graphic amount or hard disk, then first choice part 632 do not select the server as destination server, if the CPU surpluses of server are more than or equal to CPU usage amounts and network not Occupancy is more than or equal to hard disk usage amount more than or equal to the residual memory space of Web vector graphic amount and hard disk, then first choice part 632 using the server as standby server;In spare processing resources are set to the CPU surpluses of each server, can use Deposit and hard disk residual memory space when, demand process resource is set to CPU usage amounts, internal memory usage amount and hard disk and is used Amount, is respectively compared CPU surpluses and CPU usage amounts, free memory and internal memory usage amount and hard disk in each server Residual memory space and hard disk usage amount, if the CPU surpluses of server are less than internal memory less than CPU usage amounts or free memory The residual memory space of usage amount or hard disk is less than hard disk usage amount, then first choice part 632 does not select the server to make It is destination server, if the CPU surpluses of server are more than or equal to CPU usage amounts and free memory is more than or equal to internal memory usage amount And the residual memory space of hard disk is more than or equal to hard disk usage amount, then first choice part 632 is using the server as standby clothes Business device.
Again for example, vacant spare processing resources to be set to the CPU surpluses of each server, free memory, network When amount, the residual memory space of hard disk, demand process resource is set to CPU usage amounts, internal memory usage amount, Web vector graphic amount, hard Disk usage amount, is respectively compared CPU surpluses and CPU usage amounts, free memory and internal memory usage amount, network in each server Vacant amount and Web vector graphic amount, the residual memory space of hard disk and hard disk usage amount, if the CPU surpluses of server are less than CPU usage amounts or free memory are surplus less than Web vector graphic amount or hard disk less than internal memory usage amount or the vacant amount of network Remaining memory space is less than hard disk usage amount, then first choice part 632 does not select the server as destination server, if service The CPU surpluses of device are more than or equal to CPU usage amounts and free memory is more than or equal to internal memory usage amount and the vacant amount of network is more than Residual memory space equal to Web vector graphic amount and hard disk is more than or equal to hard disk usage amount, then first choice part 632 takes this Business device is used as standby server.
Further, first choice part 632 calculates the remaining Service Source of each standby server, the remaining Service Source It is the surplus resources after the server operation task, the server for selecting remaining Service Source maximum from standby server As destination server.
For example, when spare processing resources to be set to the CPU surpluses of each server, demand process resource is set to CPU usage amounts, calculate CPU surpluses more than or equal to the remaining Service Source of each standby server of CPU usage amounts namely (CPU surplus-CPU usage amounts), selects (CPU surplus-CPU usage amounts) maximum server from multiple standby servers As destination server;When spare processing resources to be set to the free memory of each server, demand process resource is set to Internal memory usage amount, calculate free memory more than or equal to internal memory usage amount each standby server remaining Service Source namely (free memory-internal memory usage amount), selects (free memory-internal memory usage amount) maximum server from multiple standby servers As destination server;In the vacant amount of network that spare processing resources are set to each server, by demand process resource It is set to Web vector graphic amount, remaining service money of the vacant amount of calculating network more than or equal to each standby server of Web vector graphic amount Source namely (the vacant amount of network-Web vector graphic amount), select (vacant amount-the Web vector graphic of network from multiple standby servers Amount) maximum server is used as destination server;Spare processing resources are being set to the remaining storage of the hard disk of each server During space, demand process resource is set to hard disk usage amount, the residual memory space for calculating hard disk is more than or equal to hard disk usage amount Each standby server remaining Service Source namely (residual memory space of hard disk-hard disk usage amount), from multiple it is standby (residual memory space of hard disk-hard disk usage amount) maximum server is selected in server as destination server.
Preferably, standby server quantity in the case of at least two, first choice part 632 is from active service The spare processing resources of device subtract demand process resource, and the difference of gained is normalized, and normalized value is weighted, selection The maximum standby server of weighted value is used as the destination server.
Acquiring unit 61 obtains the CPU surpluses of at least two server, free memory, the vacant amount of network, hard At least one of residual memory space of disk, used as the spare processing resources, first choice part 632 is for different standby Corresponding weight is respectively provided with process resource.
Fig. 8 be schematically illustrate the server-assignment device 6 according to the embodiment of the present application select unit 63 it is another Individual block diagram.
As shown in figure 8, select unit 63 can be further included:Ordering element 633, to the spare processing resources from height to It is low to sort successively;Second comparing unit, the spare processing resources of the most preceding server that sorts are entered with the demand process resource Row compares;Second alternative pack 634, the demand process resource is more than in the spare processing resources of the most preceding server that sorts When, using the most preceding server of the sequence as the destination server.
For example, it is also possible to first the spare processing resources to server sort successively from high to low, then from each server Spare processing resources subtract the demand process resource, and the difference of gained is normalized, and normalized value is weighted, selection The maximum standby server of weighted value is used as the destination server.
According to the technical scheme of the above-mentioned server-assignment device of the embodiment of the present application, each is enabled to service There can be enough resources to be calculated, even when cluster scale is larger, the server in cluster is also fully used, from And reach the optimum use to cluster resource.
Fig. 9 is the block diagram for schematically illustrating the server-assignment device 9 according to another embodiment of the application.The server Distributor 9 includes:Memory 91, for store program codes;Processor 92, for performing described program code to realize knot The method for closing Fig. 2-5 descriptions.
Memory 91 can include at least one of read-only storage and random access memory, and be carried to processor 92 For instruction and data.The a part of of memory 91 can also include non-volatile row random access memory (NVRAM).
Processor 92 can be general processor, digital signal processor (DSP), application specific integrated circuit (ASIC), ready-made Programmable gate array (FPGA) or other PLDs, discrete gate or transistor logic, discrete hardware group Part.General processor can be microprocessor or any conventional processor etc..
The step of method with reference to disclosed in the embodiment of the present application, can be embodied directly in and be completed by computing device, or Combined with the hardware in processor and software module and perform completion.Software module may be located at random access memory, flash memory, read-only deposit In the ripe storage medium in this area such as reservoir, programmable read only memory or electrically erasable programmable memory, register. The storage medium is located in memory 91, and processor 92 reads the information in memory 91, and the above method is completed with reference to its hardware The step of.
In the case of the server-assignment device according to the embodiment of the present application being disclosed above in conjunction with Fig. 6-8, all bags The electronic equipment for including the server-assignment device is also in the open scope of the embodiment of the present application.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein Unit and algorithm steps, can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually Performed with hardware or software mode, depending on the application-specific and design constraint of technical scheme.Professional and technical personnel Described function, but this realization can be realized it is not considered that exceeding using distinct methods to each specific application Scope of the present application.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the device of foregoing description With the specific work process of unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, can be by it Its mode is realized.For example, device embodiment described above is only schematical, for example, the division of the unit, only Only a kind of division of logic function, can there is other dividing mode when actually realizing, such as multiple units or component can be tied Another equipment is closed or is desirably integrated into, or some features can be ignored, or do not perform.
The unit that is illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit The part for showing can be or may not be physical location.Can select according to the actual needs therein some or all of Unit realizes the purpose of this embodiment scheme.
If the function is to realize in the form of SFU software functional unit and as independent production marketing or when using, can be with Storage is in a computer read/write memory medium.Based on such understanding, the technical scheme of the application is substantially in other words The part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, including some instructions are used to so that a computer equipment (can be individual People's computer, server, or network equipment etc.) perform all or part of step of the application each embodiment methods described. And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage, random access memory, magnetic disc or CD etc. are each Planting can be with the medium of store program codes.
The above, the protection domain of the only specific embodiment of the application, but the application is not limited thereto, any Those familiar with the art can readily occur in change or replacement in the technical scope that the application is disclosed, and should all contain Cover within the protection domain of the application.Therefore, the protection domain of the application described should be defined by scope of the claims.

Claims (17)

1. a kind of server-assignment method, including:
Obtain the spare processing resources of at least two servers for being capable of process task;
Estimate the demand process resource of the server that pending task items are operationally used;And
Spare processing resources and the demand process resource based at least two server are described for running to select The destination server of task items.
2. server-assignment method as claimed in claim 1, wherein, the standby place based at least two server Resource and the demand process resource is managed to select to include for running the destination server of the task items:
Compare the spare processing resources and the demand process resource of each server at least two server;And
The destination server is selected based on the comparative result.
3. server-assignment method as claimed in claim 2, wherein, it is described that the target is selected based on the comparative result Server includes:
If the spare processing resources of server are less than the demand process resource, the server is not selected as the target Server;
If the spare processing resources of server are more than or equal to the demand process resource, using the server as active service Device;And
The destination server is selected from the standby server.
4. server-assignment method as claimed in claim 3, wherein, it is described that the target is selected from the standby server Server includes:
Calculate the remaining Service Source of each standby server, the remaining Service Source be the server run the task items it Surplus resources afterwards;And
The maximum server of remaining Service Source is selected from the standby server as destination server.
5. server-assignment method as claimed in claim 4, wherein, it is at least two in the quantity of the standby server In the case of, the server for selecting remaining Service Source maximum from the standby server includes as destination server:
The demand process resource is subtracted from the spare processing resources of the standby server, the difference of gained is normalized;
Normalized value is weighted;And
The maximum standby server of selection weighted value is used as the destination server.
6. server-assignment method as claimed in claim 5, wherein, at least two clothes of process task are capable of in the acquisition The spare processing resources of business device include:
Obtain CPU surpluses, free memory, the vacant amount of network, the remaining storage sky of hard disk of at least two server At least one of between, as the spare processing resources,
It is described normalized value to be weighted including being respectively provided with corresponding weight for different spare processing resources.
7. server-assignment method as claimed in claim 1, wherein, the standby place based at least two server Resource and the demand process resource is managed to select to include for running the destination server of the task items:
The spare processing resources are sorted successively from high to low;
The spare processing resources of the most preceding server that sorts are compared with the demand process resource;
When the spare processing resources of the most preceding server that sorts are more than the demand process resource, by the service that the sequence is most preceding Device is used as the destination server.
8. server-assignment method as claimed in claim 1, wherein, at least two clothes of process task are capable of in the acquisition The spare processing resources of business device include:
Obtain CPU surpluses, free memory, the vacant amount of network, the remaining storage sky of hard disk of at least two server At least one of between, as the spare processing resources.
9. a kind of server-assignment device, including:
Acquiring unit, obtains the spare processing resources of at least two servers for being capable of process task;
Estimation unit, estimates the demand process resource of the server that pending task items are operationally used;And
Select unit, spare processing resources and the demand process resource based at least two server select to be used for Run the destination server of the task items.
10. server-assignment device as claimed in claim 9, wherein, the select unit includes:
First comparing unit, the spare processing resources and the demand of each server in relatively more described at least two server Process resource;And
First choice part, the destination server is selected based on the comparative result.
11. server-assignment devices as claimed in claim 10, wherein,
If the spare processing resources of server are less than the demand process resource, the first choice part does not select the clothes Device be engaged in as the destination server,
If the spare processing resources of server are more than or equal to the demand process resource, the first choice part takes this Device be engaged in as standby server,
The first choice part selects the destination server from the standby server.
12. server-assignment devices as claimed in claim 11, wherein,
The first choice part calculates the remaining Service Source of each standby server, and the remaining Service Source is the server The surplus resources after the task items are run, the server for selecting remaining Service Source maximum from the standby server is made It is destination server.
13. server-assignment devices as claimed in claim 12, wherein,
The standby server quantity in the case of at least two, the first choice part is from the standby server Spare processing resources subtract the demand process resource, the difference of gained is normalized, normalized value is weighted, select The maximum standby server of weighted value is selected as the destination server.
14. server-assignment devices as claimed in claim 13, wherein,
The acquiring unit obtains CPU surpluses, free memory, the vacant amount of network, the hard disk of at least two server At least one of residual memory space, as the spare processing resources,
The first choice part is respectively provided with corresponding weight for different spare processing resources.
15. server-assignment devices as claimed in claim 9, wherein, the select unit includes:
The spare processing resources are sorted by ordering element successively from high to low;
Second comparing unit, the spare processing resources of the most preceding server that sorts are compared with the demand process resource;
Second alternative pack, when the spare processing resources of the most preceding server that sorts are more than the demand process resource, by this The most preceding server of sequence is used as the destination server.
16. server-assignment devices as claimed in claim 9, wherein,
The acquiring unit obtains CPU surpluses, free memory, the vacant amount of network, the hard disk of at least two server At least one of residual memory space, as the spare processing resources.
17. a kind of electronic equipment, including the server-assignment device as any one of claim 9-16.
CN201710090797.2A 2017-02-20 2017-02-20 Server-assignment method, server-assignment device and electronic equipment Pending CN106911772A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710090797.2A CN106911772A (en) 2017-02-20 2017-02-20 Server-assignment method, server-assignment device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710090797.2A CN106911772A (en) 2017-02-20 2017-02-20 Server-assignment method, server-assignment device and electronic equipment

Publications (1)

Publication Number Publication Date
CN106911772A true CN106911772A (en) 2017-06-30

Family

ID=59209373

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710090797.2A Pending CN106911772A (en) 2017-02-20 2017-02-20 Server-assignment method, server-assignment device and electronic equipment

Country Status (1)

Country Link
CN (1) CN106911772A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874533A (en) * 2018-01-08 2018-11-23 深圳市铱硙医疗科技有限公司 Handle the server distribution method and device of MRI image
CN108874516A (en) * 2018-01-08 2018-11-23 深圳市铱硙医疗科技有限公司 The method and device of csv file is generated based on MRI image
CN111510493A (en) * 2020-04-15 2020-08-07 中国工商银行股份有限公司 Distributed data transmission method and device
CN113742059A (en) * 2021-07-15 2021-12-03 上海朋熙半导体有限公司 Task allocation method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102195886A (en) * 2011-05-30 2011-09-21 兰雨晴 Service scheduling method on cloud platform
CN102426544A (en) * 2011-11-04 2012-04-25 浪潮(北京)电子信息产业有限公司 Task allocating method and system
CN103002043A (en) * 2012-12-14 2013-03-27 百度在线网络技术(北京)有限公司 Method and system used for resource management of cloud environment
CN103019853A (en) * 2012-11-19 2013-04-03 北京亿赞普网络技术有限公司 Method and device for dispatching job task
CN104834569A (en) * 2015-05-11 2015-08-12 北京京东尚科信息技术有限公司 Cluster resource scheduling method and cluster resource scheduling system based on application types

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102195886A (en) * 2011-05-30 2011-09-21 兰雨晴 Service scheduling method on cloud platform
CN102426544A (en) * 2011-11-04 2012-04-25 浪潮(北京)电子信息产业有限公司 Task allocating method and system
CN103019853A (en) * 2012-11-19 2013-04-03 北京亿赞普网络技术有限公司 Method and device for dispatching job task
CN103002043A (en) * 2012-12-14 2013-03-27 百度在线网络技术(北京)有限公司 Method and system used for resource management of cloud environment
CN104834569A (en) * 2015-05-11 2015-08-12 北京京东尚科信息技术有限公司 Cluster resource scheduling method and cluster resource scheduling system based on application types

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874533A (en) * 2018-01-08 2018-11-23 深圳市铱硙医疗科技有限公司 Handle the server distribution method and device of MRI image
CN108874516A (en) * 2018-01-08 2018-11-23 深圳市铱硙医疗科技有限公司 The method and device of csv file is generated based on MRI image
CN111510493A (en) * 2020-04-15 2020-08-07 中国工商银行股份有限公司 Distributed data transmission method and device
CN111510493B (en) * 2020-04-15 2023-09-26 中国工商银行股份有限公司 Distributed data transmission method and device
CN113742059A (en) * 2021-07-15 2021-12-03 上海朋熙半导体有限公司 Task allocation method and device, computer equipment and storage medium
CN113742059B (en) * 2021-07-15 2024-03-29 上海朋熙半导体有限公司 Task allocation method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106911772A (en) Server-assignment method, server-assignment device and electronic equipment
CN108932585B (en) Merchant operation management method and equipment, storage medium and electronic equipment thereof
CN107885796A (en) Information recommendation method and device, equipment
CN107728878A (en) Display methods, terminal and the computer-readable recording medium of application icon
CN108197873A (en) Warehouse article goods sorting method, device, computer equipment and storage medium
CN109190930A (en) A kind of index generation method and device
CN107783734A (en) A kind of resource allocation methods, device and terminal based on super fusion storage system
CN107657051A (en) A kind of generation method of picture tag, terminal device and storage medium
CN110163042A (en) Image-recognizing method and device
CN108776791A (en) Client identity identifies method of calibration, device, computer equipment and storage medium
CN107622326A (en) User's classification, available resources Forecasting Methodology, device and equipment
CN109889370A (en) A kind of network equipment location determining method, device and computer readable storage medium
CN103699614B (en) A kind of method and apparatus for determining Default saving path when downloading resource
CN109769007A (en) Serve resources management system and method
CN108876409A (en) Authentication method, system and relevant device are subsidized in a kind of colleges and universities' poverty
CN108920183A (en) A kind of operational decision making method, device and equipment
CN114070791A (en) Data flow rate limiting processing method and device
CN110297959A (en) Date storage method, device, storage medium and Edge Server
CN109753330A (en) A kind of navigation equipment interface display method, system, computer equipment and storage medium
CN109344255A (en) The fill method and terminal device of label
Zare et al. Exact analysis of the (R, Q) inventory policy in a two-echelon production–inventory system
CN111507779A (en) Method and device for grading commodities
CN114625975B (en) Knowledge graph-based customer behavior analysis system
CN110046545A (en) A kind of laying for goods system, method, apparatus, electronic equipment and storage medium
CN108460673A (en) A kind of processing method and processing device of training data

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20170630

RJ01 Rejection of invention patent application after publication