CN107704320B - A kind of method for allocating tasks and system of distributed system - Google Patents

A kind of method for allocating tasks and system of distributed system Download PDF

Info

Publication number
CN107704320B
CN107704320B CN201710333404.6A CN201710333404A CN107704320B CN 107704320 B CN107704320 B CN 107704320B CN 201710333404 A CN201710333404 A CN 201710333404A CN 107704320 B CN107704320 B CN 107704320B
Authority
CN
China
Prior art keywords
total score
resource
process resource
combination
scoring
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.)
Active
Application number
CN201710333404.6A
Other languages
Chinese (zh)
Other versions
CN107704320A (en
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.)
Guizhou Baishan cloud Polytron Technologies Inc
Original Assignee
Guizhou White Cloud Technology 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 Guizhou White Cloud Technology Co Ltd filed Critical Guizhou White Cloud Technology Co Ltd
Priority to CN201710333404.6A priority Critical patent/CN107704320B/en
Publication of CN107704320A publication Critical patent/CN107704320A/en
Priority to PCT/CN2018/085624 priority patent/WO2018205890A1/en
Application granted granted Critical
Publication of CN107704320B publication Critical patent/CN107704320B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/501Performance criteria

Abstract

The invention discloses a kind of method for allocating tasks of distributed system and systems.This method includes:Step 1, the Current resource situation of the multiple process resources for each process resource combination that multiple servers include is obtained;Step 2, using the weight of multiple process resources of the Current resource situation and each process resource combination of multiple process resources of each process resource of acquisition combination, the total score of each process resource combination is calculated;Step 3, based on the total score for managing combination of resources everywhere in calculating, process resource combination is selected, and allocation processing task is combined to selected process resource.Making full use of for resource may be implemented in the method for the present invention and system, cost-effective, and service availability is greatly improved.In addition, realizing automatic distribution when carrying out task distribution, the robustness of system is improved.

Description

A kind of method for allocating tasks and system of distributed system
Technical field
The present invention relates to the method for allocating tasks and system of data processing field more particularly to a kind of distributed system.
Background technology
Distributed system is usually directed to multiple servers, includes multiple disks on each server.Distributed system needs The data volume of processing is typically very big, is handled, can be caused if assigning data to some or certain several disks Some disks are constantly in busy state, and some disks are then constantly in idle state, to cannot reasonably utilize service Process resource on device.
Therefore, when data are written and read, handled etc. with operations by distributed system, need one kind that can rationally utilize Process resource on each server improves the method and system of server process efficiency.
Invention content
In order to solve the problems, such as the processing resource allocation task in the prior art on server, it is proposed that one kind is for dividing The method for allocating tasks and system of cloth system.
According to an aspect of the invention, there is provided a kind of method for allocating tasks of distributed system, the method includes:
Step 1, the Current resource shape of the multiple process resources for each process resource combination that multiple servers include is obtained Condition;
Step 2, using the Current resource situation of multiple process resources of each process resource of acquisition combination and each The weight of multiple process resources of process resource combination calculates the total score of each process resource combination;
Step 3, based on the total score for managing combination of resources everywhere in calculating, process resource combination is selected, and to selected place Manage combination of resources allocation processing task.
Wherein, the step 2 includes:
The scoring of each process resource is determined based on the Current resource situation of multiple process resources of each process resource combination, The scoring of process resource, which is multiplied by after the weight of the process resource, during each process resource is combined obtains the weighting of the process resource Scoring, and the weighted scoring of each process resource in the combination of each process resource is added, respectively obtain each process resource combination Total score.
Wherein, the step 3 includes:
By the total score of each processing combination of resources by being segmented after sorting from high to low, n total score set is obtained, i-th Total score in total score set is all higher than the total score that i+1 total diversity is bonded in n-th of total score set, from the n total diversity M total score set before being selected in conjunction, and selection sets quantity respectively from each total score set of the preceding m total score set Total score combines allocation processing task to process resource corresponding with selected total score, and wherein n, m and i is just whole more than 0 Number, and m≤n, i≤n.
Wherein, the step 3 includes:
By the total score of each processing combination of resources by being segmented after sorting from low to high, n total score set is obtained, i-th Total score in total score set is respectively less than the total score that i+1 total diversity is bonded in n-th of total score set, from the n total diversity M total score set before being selected in conjunction, and selection sets quantity respectively from each total score set of the preceding m total score set Total score combines allocation processing task to process resource corresponding with selected total score, and wherein n, m and i is just whole more than 0 Number, and m≤n, i≤n.
Wherein, the step 2 further includes that the scoring of each process resource is determined according to following manner:
Mode one, when the Current resource situation of a process resource indicates that the available resources accounting of the process resource is more than or equal to When given threshold, the scoring of the process resource is determined as the available resources accounting;
Mode two, when the Current resource situation of a process resource indicates the available resources accounting of the process resource less than described When given threshold, the scoring of the process resource is determined as zero.
Wherein, the step 2 further includes that the scoring of each process resource is determined according to following manner:
Mode one, when the Current resource situation of a process resource indicates being less than or equal to resource accounting for the process resource When given threshold, the scoring of the process resource is determined as this and has used resource accounting;
Mode two, when the Current resource situation of a process resource indicate the process resource to have used resource accounting to be more than described When given threshold, the scoring of the process resource is determined as zero.
Wherein, further include before the step 2:
It is corresponding for multiple process resources setting of process resource combination according to the attribute that the process resource combines Weight.
Wherein, the total score of selection setting quantity includes respectively from each total score set of the preceding m total score set:Base In Hash operation, selection sets the total score of quantity respectively from each total score set.
According to another aspect of the present invention, a kind of task distribution system of distributed system, the system packet are additionally provided It includes:
Resource situation acquisition module obtains the multiple process resources for each process resource combination that multiple servers include Current resource situation;
Total score computing module, the Current resource shape for multiple process resources using each process resource combination obtained The weight of condition and multiple process resources of each process resource combination calculates the total score of each process resource combination;
Task allocating module, for based on the total score for managing combination of resources everywhere in calculating, process resource being selected to combine, and to Selected process resource combines allocation processing task.
Wherein, the total score computing module is additionally operable to:
The scoring of each process resource is determined based on the Current resource situation of multiple process resources of each process resource combination, The scoring of process resource, which is multiplied by after the weight of the process resource, during each process resource is combined obtains the weighting of the process resource Scoring, and the weighted scoring of each process resource in the combination of each process resource is added, respectively obtain each process resource combination Total score.
Wherein, the task allocating module is additionally operable to:
By the total score of each processing combination of resources by being segmented after sorting from high to low, n total score set is obtained, i-th Total score in total score set is all higher than the total score that i+1 total diversity is bonded in n-th of total score set, from the n total diversity M total score set before being selected in conjunction, and selection sets quantity respectively from each total score set of the preceding m total score set Total score combines allocation processing task to process resource corresponding with selected total score, and wherein n, m and i is just whole more than 0 Number, and m≤n, i≤n.
Wherein, the task allocating module is additionally operable to:
By the total score of each processing combination of resources by being segmented after sorting from low to high, n total score set is obtained, i-th Total score in total score set is respectively less than the total score that i+1 total diversity is bonded in n-th of total score set, from the n total diversity M total score set before being selected in conjunction, and selection sets quantity respectively from each total score set of the preceding m total score set Total score combines allocation processing task to process resource corresponding with selected total score, and wherein n, m and i is just whole more than 0 Number, and m≤n, i≤n.
Wherein, the total score computing module is additionally operable to determine the scoring of each process resource according to following manner:
Mode one, when the Current resource situation of a process resource indicates that the available resources accounting of the process resource is more than or equal to When given threshold, the scoring of the process resource is determined as the available resources accounting;
Mode two, when the Current resource situation of a process resource indicates the available resources accounting of the process resource less than described When given threshold, the scoring of the process resource is determined as zero.
Wherein, the total score computing module is additionally operable to determine the scoring of each process resource according to following manner:
Mode one, when the Current resource situation of a process resource indicates being less than or equal to resource accounting for the process resource When given threshold, the scoring of the process resource is determined as this and has used resource accounting;
Mode two, when the Current resource situation of a process resource indicate the process resource to have used resource accounting to be more than described When given threshold, the scoring of the process resource is determined as zero.
Wherein, the system also includes:
Weight setting module, the attribute for being combined according to the process resource, for the multiple of process resource combination Corresponding weight is arranged in process resource.
Wherein, the task allocating module is additionally operable to:
Based on Hash operation, selection sets the total score of quantity respectively from each total score set.
The method for allocating tasks and system of distributed system in the present invention, are respectively handled in being combined by using process resource The total score of the scoring and weight calculation process resource of resource, and be segmented after total score is sorted, select process resource combination distribution to appoint Business, can effectively utilize process resource, avoid part process resource excessively busy, and part process resource is but excessively idle, from And improve the treatment effeciency of system.Therefore, making full use of for resource may be implemented in method and system using the present invention, saves Service availability is greatly improved in cost.In addition, realizing automatic distribution when carrying out task distribution, the robustness of system is improved.
Description of the drawings
The attached drawing for constituting the part of the present invention is used to provide further understanding of the present invention, schematic reality of the invention Example and its explanation are applied for explaining the present invention, is not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the method for allocating tasks flow chart of distributed system according to the present invention;
Fig. 2 is the task distribution system module map of distributed system according to the present invention.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.It needs Illustrate, in the absence of conflict, the features in the embodiments and the embodiments of the present application mutually can be combined arbitrarily.
The present invention provides a kind of method for allocating tasks of distributed system, and as described in Figure 1, this method includes:
Step 101, the Current resource of the multiple process resources for each process resource combination that multiple servers include is obtained Situation;
Step 102, using the Current resource situation of multiple process resources of each process resource of acquisition combination and often The weight of multiple process resources of a process resource combination calculates the total score of each process resource combination;
Step 103, based on the total score for managing combination of resources everywhere in calculating, process resource combination is selected, and to selected Process resource combines allocation processing task.
Above-mentioned steps 102 include:It is determined based on the Current resource situation of multiple process resources of each process resource combination The scoring of each process resource obtains after the weight of the process resource is multiplied by the scoring of process resource in the combination of each process resource The weighted scoring of the process resource, and the weighted scoring of each process resource in the combination of each process resource is added, it respectively obtains The total score of each process resource combination.That is, the total score of process resource is carried out by the scoring of each process resource and corresponding weight It is calculated.
Above-mentioned steps 103 include:It is segmented after the total score of each processing combination of resources is sorted by height, obtains n always Divide set, the total score in i-th of total score set is all higher than the total score that i+1 total diversity is bonded in n-th of total score set, from institute M total score set before being selected in n total score set is stated, and is selected respectively from each total score set of the preceding m total score set The total score for selecting setting quantity, combines allocation processing task, wherein n, m and i is equal to process resource corresponding with selected total score For the positive integer more than 0, and m≤n, i≤n.
That is, being segmented after the total score of each processing combination of resources is sorted by height, multiple total score set is obtained, for example, the 1st is total Point set, the 2nd total score set ..., the n-th total score set.Come the total score in the total score set of front be all higher than come it is subsequent Total score in total score set.It is not all from ranking in preceding total score set in addition, when selecting process resource combination Selection, but several total score set in the top are selected first, then selection sets number from selected total score set respectively The total score of amount.This is because the total score calculated in a step 102 is calculated according to the Current resource situation of each processing resource reporting , and the resource behaviour in service of each process resource may change in real time, i.e., calculated total score may adjust in real time, at this In the case of kind, if all selected in preceding total score set from ranking, this distribution method is not necessarily optimal 's.And this sequencingsegmenting of the present invention is used, and select the method for multiple total score respectively from multiple set, it can be effectively ensured The real-time optimization of process resource utilizes.
In this case, step 102 further includes that the scoring of each process resource is determined according to following manner:
Mode one, when the Current resource situation of a process resource indicates that the available resources accounting of the process resource is more than or equal to When given threshold, the scoring of the process resource is determined as the available resources accounting;
Mode two, when the Current resource situation of a process resource indicates the available resources accounting of the process resource less than described When given threshold, the scoring of the process resource is determined as zero.
In the mode of the scoring of above-mentioned determining process resource, when the available resources accounting of process resource is smaller, then Think that the process resource is unavailable, i.e., the scoring of the process resource is determined as zero.In addition, the processing obtained in step 101 The Current resource situation of resource can be that behaviour in service or resource can use situation for the resource of the process resource, i.e., accounted for resource Than or available resources accounting.When acquisition be to have used resource accounting when, calculate 1- can be obtained available resources with resource accounting Accounting, accounting therein can be percentage.
In addition, above-mentioned steps 103 can also include:By it is each processing combination of resources total score by from low to high sort after carry out Segmentation, obtains n total score set, the total score in i-th of total score set is respectively less than i+1 total diversity and is bonded to n-th of total diversity Total score in conjunction, m total score set before being selected from the n total score set, and it is total from each of described preceding m total score set Divide in set and select the total score of setting quantity respectively, combines allocation processing to process resource corresponding with selected total score and appoint Business, wherein n, m and i are the positive integer more than 0, and m≤n, i≤n.The method phase from high to low of the sort method and front Instead, it is to have used resource accounting the smaller the better because the scoring of used process resource is to have used resource accounting.
In this case, step 102 further includes that the scoring of each process resource is determined according to following manner:
Mode one, when the Current resource situation of a process resource indicates being less than or equal to resource accounting for the process resource When given threshold, the scoring of the process resource is determined as this and has used resource accounting;
Mode two, when the Current resource situation of a process resource indicate the process resource to have used resource accounting to be more than described When given threshold, the scoring of the process resource is determined as zero.
In the mode of the scoring of above-mentioned determining process resource, when process resource is when having used resource accounting bigger, then Think that the process resource is unavailable, i.e., the scoring of the process resource is determined as zero.In addition, the processing obtained in step 101 The Current resource situation of resource can be that behaviour in service or resource can use situation for the resource of the process resource, i.e., accounted for resource Than or available resources accounting.When acquisition be available resources accounting when, calculate 1- available resources accountings and can be obtained and has used resource Accounting, accounting therein can be percentage.
It should be noted that total subpackage of selection setting quantity respectively from each total score set of preceding m total score set It includes:Based on Hash operation, selection sets the total score of quantity respectively from each total score set.That is, first from high to low according to total score Sequence sequence after be segmented, or according to total score from low to high sequence sequence after be segmented.After segmentation, from each total score set Random Harsh operation may be used when the total score of selection setting quantity to be selected.In a total score set, although each total Score value is not exactly the same, but very close, therefore, the total score of setting quantity can be randomly choosed from the total score set.In addition to Hash operation can also use other stochastic selection algorithms.
Further include before above-mentioned steps 102:According to the attribute that the process resource combines, combined for the process resource Multiple process resources corresponding weight is set.That is, before the total score for calculating each process resource combination, it is also necessary to for everywhere It manages resource and weight is set.The attribute of process resource combination can be, for example, computational, data write-in, digital independent.It is fallen into a trap In the property calculated combination of resources, CPU, the priority of memory are high, i.e., weight is big;Data are written in combination of resources, magnetic disc i/o, network I/O Priority it is high, i.e., weight is big;In digital independent combination of resources, network I/O, magnetic disc i/o, the priority of network I/O are high, that is, weigh It is great.Following table lists the weight of the corresponding process resource of each attribute in an exemplary embodiment.
Table 1
CPU weight Memory weight Network I/O weights Magnetic disc i/o weight Disk size weight
It is computational 50 40 10 0 0
Data are written 10 10 20 30 30
Digital independent 10 10 40 40 0
The method that this scoring to each process resource is weighted summation is each based on the attribute of process resource combination Suitable weight is arranged in process resource, calculates the rational total score of process resource combination, which represents the process resource group The processing capacity of conjunction, to the stronger process resource combination of total component selections processing capacity according to each processing combination of resources, to divide With task.In such manner, it is possible to effectively utilize the resource of distributed system, the treatment effeciency of distributed system is improved.
Above-mentioned process resource includes at least:CPU, memory, network inputs/output, disk input/output, disk size.
In addition, each process resource can periodically report the Current resource situation of oneself, for example, it is per minute report it is primary, with Just system can carry out calculating according to real-time data and task is distributed.
The specific embodiment of the method for allocating tasks of distributed system according to the present invention is given below.In the embodiment In, distributed system includes 3 servers, and each server includes 4 disks, i.e. 4 process resource combinations, process resource packet Include CPU, memory, network inputs/output, disk input/output, disk size.Wherein, server one is for digital independent Server, server two are the server being written for data, and server three is the server calculated for data.It is specific to appoint Distribution method of being engaged in is as follows:
The first step, obtain the CPU of each disk in 3 servers, memory, network inputs/output, disk input/output, The Current resource situation of disk size.
Second step, according to the Current resource situation of acquisition determine the CPU of each disk, memory, network inputs/output, magnetic The available resources accounting of disk input/output disk size, and further determine that the CPU, memory, network inputs of each disk/defeated Go out, disk input/output, the scoring of disk size.For example, CPU, memory, the network of 4 disks of the server one determined are defeated Enter/export, disk input/output, the scoring of disk size it is as shown in table 2, scoring therein is that available resources accounting is multiplied by 100:
Table 2
CPU scores Memory scores Network I/O scorings Magnetic disc i/o scores Disk size scores
Disk one 80 40 20 40 100
Disk two 50 60 70 100 70
Disk three 50 60 70 80 90
Disk four 50 60 70 40 0
Third walks, and the scoring based on each disk and its corresponding weight calculate the total score of each disk.Wherein, it services The attribute of device one is digital independent, and for the disk in server one, setting CPU, memory, network inputs/output, disk are defeated Enter/export, the weight of disk size is respectively 10%, 10%, 20%, 30%, 30%.By the scoring of each process resource and weight Be multiplied and sum, obtain disk one, disk two, disk three, disk four total score be respectively:36、79、71、55.And so on, Calculate separately the total score of each disk in server two and server three.Wherein, the attribute of server two is written for data, wherein respectively The CPU of disk, memory, network inputs/output, disk input/output, disk size weight be respectively 10%, 10%, 20%, 30%, 30%;The attribute of server three calculates for data, wherein the CPU of each disk, memory, network inputs/output, magnetic Disk input/output, disk size weight be respectively 10%, 10%, 40%, 40%, 0%.For example, the server being calculated The total score of four disks is respectively in two:58,76,76,37, the total score difference of four disks in the server three being calculated For:58、56、56、56.
The total score that 12 disks are calculated is sorted and is segmented using Hash operation by the 4th step.From high to low by total score 79,76,76,71,58,58,56,56,56,55,37,36 are obtained after sequence.Wherein, the score value by total score in 71-80 is assigned to In 1st total score set, score value of the total score in 51-60 is assigned in the 2nd total score set, by score value of the total score in 31-40 point Into the 3rd total score set.After segmentation, the 1st total score set includes 4 total scores, and the 2nd total score set includes 6 total scores, the 3rd total score Set includes 2 total scores.
5th step selects 2 total scores from the 1st total score set, and 1 total score is selected from the 2nd total score set, total from the 3rd Divide and selects 1 total score in set.The number of total score is selected to be obtained according to many experiments from each total score set in the step What empirical value was set.Also, the selection in each total score set is random.
6th step distributes task to disk corresponding with selected total score.
In the embodiment, select CPU, memory, network inputs/output, disk input/output, disk size available money Source accounting scores as it, and when being ranked up to disk total score, is ranked up and is segmented according to sequence from high to low. In other embodiments, it can select to have used resource accounting as scoring, disk total score is carried out according to sequence from low to high It sorts and is segmented.
The present invention also provides a kind of task distribution system of distributed system, the system comprises:
Resource situation acquisition module 201 obtains the multiple processing money for each process resource combination that multiple servers include The Current resource situation in source;
Total score computing module 202, the current money for multiple process resources using each process resource combination obtained The weight of source situation and multiple process resources of each process resource combination calculates the total of each process resource combination Point;
Task allocating module 203, for based on the total score for managing combination of resources everywhere in calculating, selecting process resource combination, And combine allocation processing task to selected process resource.
Wherein, the total score computing module 202 is additionally operable to:
The scoring of each process resource is determined based on the Current resource situation of multiple process resources of each process resource combination, The scoring of process resource, which is multiplied by after the weight of the process resource, during each process resource is combined obtains the weighting of the process resource Scoring, and the weighted scoring of each process resource in the combination of each process resource is added, respectively obtain each process resource combination Total score.
Wherein, the task allocating module 203 is additionally operable to:
By the total score of each processing combination of resources by being segmented after sorting from high to low, n total score set is obtained, i-th Total score in total score set is all higher than the total score that i+1 total diversity is bonded in n-th of total score set, from the n total diversity M total score set before being selected in conjunction, and selection sets quantity respectively from each total score set of the preceding m total score set Total score combines allocation processing task to process resource corresponding with selected total score, and wherein n, m and i is just whole more than 0 Number, and m≤n, i≤n.
Wherein, the task allocating module 203 is additionally operable to:
By the total score of each processing combination of resources by being segmented after sorting from low to high, n total score set is obtained, i-th Total score in total score set is respectively less than the total score that i+1 total diversity is bonded in n-th of total score set, from the n total diversity M total score set before being selected in conjunction, and selection sets quantity respectively from each total score set of the preceding m total score set Total score combines allocation processing task to process resource corresponding with selected total score, and wherein n, m and i is just whole more than 0 Number, and m≤n, i≤n.
Wherein, the total score computing module 202 is additionally operable to determine the scoring of each process resource according to following manner:
Mode one, when the Current resource situation of a process resource indicates that the available resources accounting of the process resource is more than or equal to When given threshold, the scoring of the process resource is determined as the available resources accounting;
Mode two, when the Current resource situation of a process resource indicates the available resources accounting of the process resource less than described When given threshold, the scoring of the process resource is determined as zero.
Wherein, the total score computing module 202 is additionally operable to determine the scoring of each process resource according to following manner:
Mode one, when the Current resource situation of a process resource indicates being less than or equal to resource accounting for the process resource When given threshold, the scoring of the process resource is determined as this and has used resource accounting;
Mode two, when the Current resource situation of a process resource indicate the process resource to have used resource accounting to be more than described When given threshold, the scoring of the process resource is determined as zero.
Wherein, the system also includes:
Weight setting module 204, the attribute for being combined according to the process resource, for the more of process resource combination Corresponding weight is arranged in a process resource.
Wherein, the process resource includes at least:CPU, memory, disk input/output, network inputs/output.
Wherein, the task allocating module 203 is additionally operable to:Based on Hash operation, selected respectively from each total score set Set the total score of quantity.
The method for allocating tasks and system of distributed system in the present invention, are respectively handled in being combined by using process resource The total score of the scoring and weight calculation process resource of resource, and be segmented after total score is sorted, select process resource combination distribution to appoint Business, can effectively utilize process resource, avoid part process resource excessively busy, and part process resource is but excessively idle, from And improve the treatment effeciency of system.Therefore, making full use of for resource may be implemented in method and system using the present invention, saves Service availability is greatly improved in cost.In addition, realizing automatic distribution when carrying out task distribution, the robustness of system is improved.
Descriptions above can combine implementation individually or in various ways, and these variants all exist Within protection scope of the present invention.
It should be noted that herein, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that article or equipment including a series of elements include not only those elements, but also includes not having There is the other element being expressly recited, or further includes for this article or the intrinsic element of equipment.Do not limiting more In the case of system, the element that is limited by sentence " including ... ", it is not excluded that including the element article or equipment in There is also other identical elements.
The above examples are only used to illustrate the technical scheme of the present invention and are not limiting, reference only to preferred embodiment to this hair It is bright to be described in detail.It will be understood by those of ordinary skill in the art that can modify to technical scheme of the present invention Or equivalent replacement should all cover the claim model in the present invention without departing from the spirit of the technical scheme of the invention and range In enclosing.

Claims (14)

1. a kind of method for allocating tasks of distributed system, which is characterized in that the method includes:
Step 1, the Current resource situation of the multiple process resources for each process resource combination that multiple servers include is obtained;
Step 2, the Current resource situation using multiple process resources of each process resource of acquisition combination and each processing The weight of multiple process resources of combination of resources calculates the total score of each process resource combination;
Step 3, based on the total score for managing combination of resources everywhere in calculating, process resource combination is selected, and provide to selected processing Combine allocation processing task in source;
The wherein described step 3 includes:By the total score of each processing combination of resources by being segmented after sorting from high to low, n are obtained Total score set, the total score in i-th of total score set are all higher than the total score that i+1 total diversity is bonded in n-th of total score set, from M total score set before being selected in the n total score set, and from each total score set of the preceding m total score set respectively The total score of selection setting quantity, allocation processing task, wherein n, m and i are combined to process resource corresponding with selected total score It is the positive integer more than 0, and m≤n, i≤n.
2. the method as described in claim 1, which is characterized in that the step 2 includes:
The scoring that each process resource is determined based on the Current resource situation of multiple process resources of each process resource combination, will be every The scoring of process resource obtains the weighted scoring of the process resource after being multiplied by the weight of the process resource in a process resource combination, And the weighted scoring of each process resource is added in combining each process resource, respectively obtains the total of each process resource combination Point.
3. method as claimed in claim 2, which is characterized in that the step 3 includes:
By the total score of each processing combination of resources by being segmented after sorting from low to high, n total score set, i-th of total score are obtained Total score in set is respectively less than the total score that i+1 total diversity is bonded in n-th of total score set, from the n total score set M total score set before selection, and selection sets the total of quantity respectively from each total score set of the preceding m total score set Point, allocation processing task is combined to process resource corresponding with selected total score, wherein n, m and i is just whole more than 0 Number, and m≤n, i≤n.
4. the method as described in claim 1, which is characterized in that the step 2 further includes determining each processing according to following manner The scoring of resource:
Mode one, when the Current resource situation of a process resource indicates that the available resources accounting of the process resource is more than or equal to setting When threshold value, the scoring of the process resource is determined as the available resources accounting;
Mode two, when the Current resource situation of a process resource indicates that the available resources accounting of the process resource is less than the setting When threshold value, the scoring of the process resource is determined as zero.
5. method as claimed in claim 3, which is characterized in that the step 2 further includes determining each processing according to following manner The scoring of resource:
Mode one, when the Current resource situation of a process resource indicate the process resource used resource accounting be less than or equal to setting When threshold value, the scoring of the process resource is determined as this and has used resource accounting;
Mode two, when the Current resource situation of a process resource indicate the process resource used resource accounting be more than the setting When threshold value, the scoring of the process resource is determined as zero.
6. method as claimed in claim 1 or 2, which is characterized in that further include before the step 2:
According to the attribute that the process resource combines, for the corresponding power of multiple process resources setting of process resource combination Weight.
7. the method as described in claim 1 or 3, which is characterized in that
The total score of selection setting quantity includes respectively from each total score set of the preceding m total score set:It is transported based on Hash It calculates, selection sets the total score of quantity respectively from each total score set.
8. a kind of task distribution system of distributed system, which is characterized in that the system comprises:
Resource situation acquisition module obtains the current of the multiple process resources for each process resource combination that multiple servers include Resource situation;
Total score computing module, for using obtain each process resource combination multiple process resources Current resource situation with And the weight of multiple process resources of each process resource combination, calculate the total score of each process resource combination;
Task allocating module, for based on the total score for managing combination of resources everywhere in calculating, selecting process resource combination, and to selected The process resource combination allocation processing task selected;
Wherein, the task allocating module is additionally operable to:By it is each processing combination of resources total score by from high to low sort after divided Section, obtains n total score set, the total score in i-th of total score set is all higher than i+1 total diversity and is bonded to n-th of total score set In total score, m total score set before being selected from the n total score set, and from each total score of the preceding m total score set Selection sets the total score of quantity respectively in set, and allocation processing task is combined to process resource corresponding with selected total score, Wherein n, m and i is the positive integer more than 0, and m≤n, i≤n.
9. system as claimed in claim 8, which is characterized in that the total score computing module is additionally operable to:
The scoring that each process resource is determined based on the Current resource situation of multiple process resources of each process resource combination, will be every The scoring of process resource obtains the weighted scoring of the process resource after being multiplied by the weight of the process resource in a process resource combination, And the weighted scoring of each process resource is added in combining each process resource, respectively obtains the total of each process resource combination Point.
10. system as claimed in claim 9, which is characterized in that the task allocating module is additionally operable to:
By the total score of each processing combination of resources by being segmented after sorting from low to high, n total score set, i-th of total score are obtained Total score in set is respectively less than the total score that i+1 total diversity is bonded in n-th of total score set, from the n total score set M total score set before selection, and selection sets the total of quantity respectively from each total score set of the preceding m total score set Point, allocation processing task is combined to process resource corresponding with selected total score, wherein n, m and i is just whole more than 0 Number, and m≤n, i≤n.
11. system as claimed in claim 8, which is characterized in that the total score computing module is additionally operable to true according to following manner The scoring of fixed each process resource:
Mode one, when the Current resource situation of a process resource indicates that the available resources accounting of the process resource is more than or equal to setting When threshold value, the scoring of the process resource is determined as the available resources accounting;
Mode two, when the Current resource situation of a process resource indicates that the available resources accounting of the process resource is less than the setting When threshold value, the scoring of the process resource is determined as zero.
12. system as claimed in claim 10, which is characterized in that the total score computing module is additionally operable to true according to following manner The scoring of fixed each process resource:
Mode one, when the Current resource situation of a process resource indicate the process resource used resource accounting be less than or equal to setting When threshold value, the scoring of the process resource is determined as this and has used resource accounting;
Mode two, when the Current resource situation of a process resource indicate the process resource used resource accounting be more than the setting When threshold value, the scoring of the process resource is determined as zero.
13. system as claimed in claim 8 or 9, which is characterized in that the system also includes:
Weight setting module, the attribute for being combined according to the process resource, for multiple processing of process resource combination Corresponding weight is arranged in resource.
14. the system as described in claim 8 or 10, which is characterized in that the task allocating module is additionally operable to:
Based on Hash operation, selection sets the total score of quantity respectively from each total score set.
CN201710333404.6A 2017-05-12 2017-05-12 A kind of method for allocating tasks and system of distributed system Active CN107704320B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710333404.6A CN107704320B (en) 2017-05-12 2017-05-12 A kind of method for allocating tasks and system of distributed system
PCT/CN2018/085624 WO2018205890A1 (en) 2017-05-12 2018-05-04 Task assignment method and system of distributed system, computer readable storage medium and computer device therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710333404.6A CN107704320B (en) 2017-05-12 2017-05-12 A kind of method for allocating tasks and system of distributed system

Publications (2)

Publication Number Publication Date
CN107704320A CN107704320A (en) 2018-02-16
CN107704320B true CN107704320B (en) 2018-08-17

Family

ID=61169482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710333404.6A Active CN107704320B (en) 2017-05-12 2017-05-12 A kind of method for allocating tasks and system of distributed system

Country Status (2)

Country Link
CN (1) CN107704320B (en)
WO (1) WO2018205890A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107704320B (en) * 2017-05-12 2018-08-17 贵州白山云科技有限公司 A kind of method for allocating tasks and system of distributed system
CN111858014A (en) * 2019-04-24 2020-10-30 中国移动通信集团河北有限公司 Resource allocation method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105022662A (en) * 2014-04-22 2015-11-04 中国银联股份有限公司 Distributive task allocation method
CN105427171A (en) * 2015-11-30 2016-03-23 北京口袋财富信息科技有限公司 Data processing method of Internet lending platform rating

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7685254B2 (en) * 2003-06-10 2010-03-23 Pandya Ashish A Runtime adaptable search processor
CN102902587B (en) * 2011-07-28 2015-10-07 中国移动通信集团四川有限公司 Distributed task dispatching mthods, systems and devices
US9880885B2 (en) * 2015-02-04 2018-01-30 Telefonaktiebolaget Lm Ericsson (Publ) Method and system to rebalance constrained services in a cloud using a genetic algorithm
US9778957B2 (en) * 2015-03-31 2017-10-03 Stitch Fix, Inc. Systems and methods for intelligently distributing tasks received from clients among a plurality of worker resources
CN106445676B (en) * 2015-08-05 2019-10-22 杭州海康威视系统技术有限公司 A kind of method for allocating tasks and task allocation apparatus that distributed data calculates
CN106126346B (en) * 2016-07-05 2019-02-26 东北大学 A kind of large-scale distributed data collection system and method
CN107704320B (en) * 2017-05-12 2018-08-17 贵州白山云科技有限公司 A kind of method for allocating tasks and system of distributed system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105022662A (en) * 2014-04-22 2015-11-04 中国银联股份有限公司 Distributive task allocation method
CN105427171A (en) * 2015-11-30 2016-03-23 北京口袋财富信息科技有限公司 Data processing method of Internet lending platform rating

Also Published As

Publication number Publication date
WO2018205890A1 (en) 2018-11-15
CN107704320A (en) 2018-02-16

Similar Documents

Publication Publication Date Title
CN109783224B (en) Task allocation method and device based on load allocation and terminal equipment
CN102929707B (en) Parallel task dynamical allocation method
CN109685609B (en) Order allocation method and device, electronic equipment and storage medium
US11496413B2 (en) Allocating cloud computing resources in a cloud computing environment based on user predictability
CN106878415B (en) Load balancing method and device for data consumption
CN111880939A (en) Container dynamic migration method and device and electronic equipment
CN104598316B (en) A kind of storage resource distribution method and device
CN105589750A (en) CPU (Central Processing Unit) resource scheduling method and server
CN103391206B (en) A kind of method for scheduling task and device thereof
CN104484233B (en) A kind of resource allocation methods
CN111045808B (en) Distributed network task scheduling method and device
CN111176840B (en) Distribution optimization method and device for distributed tasks, storage medium and electronic device
CN105516325A (en) Cloud load balancing method for carrying out elastic expansion and traffic distribution expansion according to application load
CN108108384A (en) A kind of date storage method and device
CN107704320B (en) A kind of method for allocating tasks and system of distributed system
CN104320854A (en) Resource scheduling method and device
CN102932271A (en) Method and device for realizing load balancing
CN106055706B (en) A kind of cache resources storage method and device
CN113886034A (en) Task scheduling method, system, electronic device and storage medium
CN110708369B (en) File deployment method and device for equipment nodes, scheduling server and storage medium
CN104778125B (en) A kind of EMS memory management process and system
CN110297959A (en) Date storage method, device, storage medium and Edge Server
CN104618492B (en) A kind of data handling system based on multiple servers
CN114330879B (en) Order distribution method and system of multi-dimensional constraint
CN104270321A (en) Network load balancing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100015 5 floor, block E, 201 IT tower, electronic city, 10 Jiuxianqiao Road, Chaoyang District, Beijing.

Patentee after: Guizhou Baishan cloud Polytron Technologies Inc

Address before: 100015 5 floor, block E, 201 IT tower, electronic city, 10 Jiuxianqiao Road, Chaoyang District, Beijing.

Patentee before: Guizhou white cloud Technology Co., Ltd.