CN110389822A - The node scheduling method, apparatus and server of execution task - Google Patents

The node scheduling method, apparatus and server of execution task Download PDF

Info

Publication number
CN110389822A
CN110389822A CN201910693981.5A CN201910693981A CN110389822A CN 110389822 A CN110389822 A CN 110389822A CN 201910693981 A CN201910693981 A CN 201910693981A CN 110389822 A CN110389822 A CN 110389822A
Authority
CN
China
Prior art keywords
node
running state
task requests
state data
value
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
CN201910693981.5A
Other languages
Chinese (zh)
Inventor
王文姝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft 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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201910693981.5A priority Critical patent/CN110389822A/en
Publication of CN110389822A publication Critical patent/CN110389822A/en
Pending legal-status Critical Current

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/505Allocation 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 the load

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of node scheduling method, apparatus of execution task and servers, wherein this method comprises: obtaining the running state data of each node when receiving task requests;The node to be selected for meeting task requests is determined based on the row status data;According to the running state data of each node to be selected, give a mark to each node to be selected;Based on the marking value of each node to be selected, random selection meets the execution node of task requests;It dispatches the execution node and executes task requests.For intensive task requests, which can be randomly choosed from node to be selected according to marking value execute node, efficiently avoid all executions mission dispatchings to same node, at the same can equilibrium node load pressure, be conducive to node successful execution task.

Description

The node scheduling method, apparatus and server of execution task
Technical field
The present invention relates to field of cloud computer technology, a kind of node scheduling method, apparatus more particularly, to execution task and Server.
Background technique
In task schedule, need to select suitably to execute node.The mode for executing node is chosen in the related technology, usually Need to give a mark to all nodes, select the highest node of marking as executing node, which multiple tasks simultaneously When reaching or receive intensive task requests, all tasks will be issued to the highest node of the marking simultaneously, and the node is negative Pressure jump is carried, causes node pressure unbalanced, in some instances it may even be possible to cause node paralysis, the mission failure etc..
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of node scheduling method, apparatus of execution task and server, To avoid all execution mission dispatchings to same node, the load pressure of balanced node, so that node successful execution task.
In a first aspect, the embodiment of the invention provides a kind of node scheduling methods of execution task, this method comprises: when connecing When receiving task requests, the running state data of each node is obtained;Meet task requests based on running state data determination Node to be selected;According to the running state data of each node to be selected, give a mark to each node to be selected;Based on each node to be selected Marking value, randomly choose the execution node of task requests;Scheduling executes node and executes task requests.
In preferred embodiments of the present invention, the step of the running state data of the above-mentioned each node of acquisition, comprising: from number The running state data of each node is obtained according to library;Wherein, the running state data in the database is to update after node reports 's.
In preferred embodiments of the present invention, the above method further include: if receiving the operation shape that first node reports State data use the running state data of first node in the running state data replacement data library received;If setting The operation data that second node reports is not received in duration, it is not that second node or label second node are removed from database Available mode.
In preferred embodiments of the present invention, above-mentioned running state data includes the corresponding available resources of multiple indexs Value;The step of meeting the node to be selected of task requests is determined based on running state data, comprising: is determined according to task requests each The threshold value of index;According to the running state data of each node, the available resources value of each index is selected to be greater than the threshold of the index To be selected node of the node of value as task requests.
In preferred embodiments of the present invention, the above-mentioned running state data according to each node to be selected, to each to be selected The step of node is given a mark, including to each node to be selected, it is performed both by following operation: calculate the available of each index of node to be selected The product of the default weight of resource value and index;Using the summation of the product addition of each index as marking value;Alternatively, by each The average value of the product of index is as marking value.
In preferred embodiments of the present invention, above-mentioned marking value is positive value;Based on the marking value of each node to be selected, at random The step of selecting the execution node of task requests, comprising: each section to be selected is sorted from large to small according to the marking value of node to be selected Point;Since first node to be selected after sequence, the node to be selected of specified quantity is chosen;From the to be selected of the specified quantity of selection The execution node of task requests is randomly choosed in node.
In preferred embodiments of the present invention, the above-mentioned marking value based on each node to be selected randomly chooses task requests Execution node the step of, comprising: according to the marking value of node to be selected, node to be selected is carried out by preset heapsort mode It sorts, there is the node to be selected of specified quantity in obtained top heap;The execution node of task requests is randomly choosed from the heap of top.
In preferred embodiments of the present invention, node to be selected is ranked up above by preset heapsort mode step Suddenly, comprising: node to be selected is put into preset top heap, and is sorted in the heap of top according to the marking value of node to be selected;When top heap In when having piled the node to be selected of specified quantity, traverse subsequent node to be selected, and execute following operation: by next section to be selected The marking value of point judges whether to delete the to be selected of the heap top according to comparison result compared with the marking value of the node to be selected on heap top Node;If deleting the node to be selected on the heap top, next node to be selected is put into the heap of top;Continue to choose next Node to be selected, until all nodes to be selected are traversed.
Second aspect, the embodiment of the invention provides a kind of node scheduling device of execution task, which includes: data Module is obtained, for when receiving task requests, obtaining the running state data of each node;Node determining module to be selected, For determining the node to be selected for meeting task requests based on running state data;Scoring modules, for according to each node to be selected Running state data, give a mark to each node to be selected;Node determining module is executed, for the marking based on each node to be selected Value, randomly chooses the execution node of task requests;Scheduler module executes node execution task requests for dispatching.
In preferred embodiments of the present invention, above-mentioned running state data includes the corresponding available resources of multiple indexs Value;Above-mentioned node determining module to be selected, is used for: determining the threshold value of each index according to task requests;According to the fortune of each node Row status data selects the available resources value of each index to be greater than to be selected section of the node of the threshold value of the index as task requests Point.
In preferred embodiments of the present invention, above-mentioned execution node determining module is used for: according to the marking of node to be selected Value, is ranked up node to be selected by preset heapsort mode, there is the node to be selected of specified quantity in obtained top heap;From Push up the execution node that task requests are randomly choosed in heap.
The third aspect, the embodiment of the invention provides a kind of server, including processor and memory, memory storages There is the machine-executable instruction that can be executed by processor, which executes machine-executable instruction to realize that above-mentioned execution is appointed The node scheduling method of business.
Fourth aspect, the embodiment of the invention provides a kind of machine readable storage medium, which is deposited Machine-executable instruction is contained, when being called and being executed by processor, which promotees the machine-executable instruction Processor is set to realize the node scheduling method of above-mentioned execution task.
The embodiment of the present invention bring it is following the utility model has the advantages that
The present invention provides a kind of node scheduling method, apparatus of execution task and server, when receiving task requests When, the running state data of each node is obtained first, then the section to be selected for meeting task requests is determined based on the row status data Point, and given a mark according to running state data to each node to be selected, the finally marking value random selection based on each node to be selected The execution node for meeting task requests executes task requests.For intensive task requests, which can according to marking value to It selects random selection in node to execute node, efficiently avoids all execution mission dispatchings to same node, while can be balanced The load pressure of node is conducive to node successful execution task.
Other features and advantages of the present invention will illustrate in the following description, alternatively, Partial Feature and advantage can be with Deduce from specification or unambiguously determine, or by implementing above-mentioned technology of the invention it can be learnt that.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, better embodiment is cited below particularly, and match Appended attached drawing is closed, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of hardware schematic diagram of a scenario of task schedule provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of the node scheduling method of execution task provided in an embodiment of the present invention;
Fig. 3 is the flow chart of the node scheduling method of another execution task provided in an embodiment of the present invention;
Fig. 4 is the flow chart of the node scheduling method of another execution task provided in an embodiment of the present invention;
Fig. 5 is the flow chart of the node scheduling method of another execution task provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of the node scheduling device of execution task provided in an embodiment of the present invention;
Fig. 7 is a kind of structural schematic diagram of server provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise Under every other embodiment obtained, shall fall within the protection scope of the present invention.
Fig. 1 show a kind of hardware schematic diagram of a scenario of task schedule;In Fig. 1 include a task scheduling server and with M connected node of task scheduling server, M are typically greater than 1 integer.Task scheduling server can be selected according to task requests Take suitable node as execution node.In the related technology, it usually using marking value as the performance indicator of evaluation node, is executing Task is assigned to the initial stage of node, and node is not execution task distribution resource, causes the performance indicator of node cannot immediately more Newly.Therefore, for intensive task requests, all tasks will be assigned on the highest node of marking value, for example, it is assumed that node 1 Marking value highest, when task scheduling server receives 3 tasks simultaneously, task schedule service by 3 tasks all point It is fitted on node 1.Thus which leads to the node load pressure jump, influences task execution and even results in node failure.
Based on the above issues, the embodiment of the present invention provides the node scheduling method, apparatus and server of a kind of execution task, The technology can be applied in the system that multinode executes task, during being scheduled to task;Especially choose service Process for device unit, server or server etc. executes in the scene of task.
For the node convenient for understanding the present embodiment, first to a kind of execution task disclosed in the embodiment of the present invention Dispatching method describes in detail, as shown in Fig. 2, this method comprises the following steps:
Step S202 obtains the running state data of each node when receiving task requests.
Above-mentioned node can be a server, a service processes being also possible on server;The operation of the node Status data generally includes rest network bandwidth, remaining disk, free memory, residue CPU (Central Processing Unit, central processing unit) etc..
Step S204 determines the node to be selected for meeting task requests based on above-mentioned running state data.
The task requests generally include pending task, and execute the condition that the node of the task needs to meet.This Part may is that certain indexs in the running state data of node meet the parameter value for executing the required by task.If the node Meet the corresponding condition of above-mentioned task requests, determines that the node is node to be selected.For example, pending task needs the disk to be 500MB, the node by disk surplus in running state data greater than 500MB are determined as node to be selected;For another example, pending task Memory 300MB, network bandwidth 400MB are needed, memory surplus in running state data is greater than 300MB and network bandwidth is remaining Amount is greater than the node of 400MB, is determined as node to be selected.
Step S206 gives a mark to each node to be selected according to the running state data of each above-mentioned node to be selected.
In specific implementation, the index that can include in the running state data according to node to be selected carries out the node to be selected Marking that is to say that the corresponding numerical value of the index that will include in running state data substitutes into marking formula, determine node to be selected Marking value.In general, the marking formula can be used by obtaining for the setup measures weight for including in running state data Machine learning algorithm training obtains, and can also be obtained according to other preset strategies.
Step S208 randomly chooses the execution node of task requests based on the marking value of each node to be selected.
Above-mentioned random selection task requests execution node mode can there are many, for example, can be from node to be selected The execution node of task requests is randomly choosed in the N number of node to be selected of marking value within the specified range;It can also be from node to be selected Marking be worth in higher N number of node to be selected randomly choose task requests execution node, wherein N number of node to be selected can be with table Show that random selection executes the range of node, the value of N can usually be determined according to node total number, can also be according in task requests Task amount determine.
Step S210 dispatches above-mentioned execution node and executes task requests.
The present invention provides a kind of node scheduling methods of execution task, when receiving task requests, obtain first each The running state data of a node, then the node to be selected for meeting task requests is determined based on the row status data, and according to operation Status data gives a mark to each node to be selected, and finally the marking value random selection based on each node to be selected meets task requests It executes node and executes task requests.For intensive task requests, which can be selected at random from node to be selected according to marking value Select execution node, efficiently avoid all execution mission dispatchings to same node, at the same can balanced node load pressure, Be conducive to node successful execution task.
The embodiment of the present invention also provides the node scheduling method of another execution task, and this method is described in above-described embodiment It is realized on the basis of method;The description of this method emphasis determines the tool for meeting the node to be selected of task requests based on running state data Body process, and the concrete mode given a mark for node to be selected;As shown in figure 3, this method comprises the following steps:
Step S302 obtains the running state data of each node from database when receiving task requests;The operation Status data includes the corresponding available resources value of multiple indexs;Wherein, the running state data in the database is node It is updated after reporting.
Each node usually can report running state data to database according to preset duration;If received The running state data that first node reports uses the operation of first node in the running state data replacement data library received Status data;If not receiving the operation data that second node reports within the set duration, the second section is removed from database Point or label second node are down state.
Above-mentioned first node and second node are usually any one in all nodes.When receiving task requests, The running state data of the node got is usually updated running state data in database, from database remove or Person will not usually be acquired labeled as the running state data of the node of down state.If all nodes are not to data Library reports running state data, and the corresponding task of task requests will will appear obstruction, until there is node to report operation to database Status data, the task can be just assigned in database on corresponding node.
The index that above-mentioned running state data includes can be rest network bandwidth, free memory, remaining disk, residue CPU etc., then available resources value is usually the corresponding surplus of each index, for example, network bandwidth surplus.
Step S304 determines the threshold value of each index according to above-mentioned task requests.
The resource value according to needed for task requests, it may be determined that the threshold value of each index in running state data.Wherein, no With the corresponding threshold value of index may it is identical may also be different.
Step S306 selects the available resources value of each index to refer to greater than this according to the running state data of each node To be selected node of the node of target threshold value as task requests.
Operations described below is performed both by for each node: judging whether the available resources value of each index of node both greater than should The threshold value of index, if so, the node is determined as node to be selected.For example, it is assumed that determining rest network band according to task requests Wide threshold value is 1GB, the threshold value of free memory is 800MB, the threshold value of remaining disk is 900MB, filters out rest network bandwidth Being greater than 800MB and remaining node of the disk greater than 900MB greater than 1GB, free memory is node to be selected;Discarding is unsatisfactory for above-mentioned three The node of a threshold condition.
Step S308 calculates the available resources value of each index and multiplying for the default weight of the index of above-mentioned node to be selected Product;Using the summation of the product addition of each index as marking value;Alternatively, using the average value of the product of each index as marking Value.
The default weight can be set to be positively correlated with available resources value, can be set to negative correlation;Each index it is pre- If weight can be identical, different weights can also be arranged according to the importance of index when the task of execution, appointed for example, it is assumed that executing Rest network bandwidth is more important than remaining disk when business, the ratio remanence that the weight (for example, 1) of rest network bandwidth can be arranged The weight (for example, 0.5) of disk is big.
By the product addition of the surplus (being equivalent to above-mentioned available resources value) of each index and the default weight of the index Sum can be with as the formula of marking value are as follows: marking value=rest network bandwidth weighting * network bandwidth surplus+free memory power Weight * memory surplus+residue disk weight * disk surplus+....For example, the network bandwidth surplus when node to be selected is 800MB, memory surplus are 900MB, and disk surplus is 500MB;Rest network bandwidth weighting is set as 0.01, free memory Weight is set as 0.03, and remaining disk weight is set as 0.02, obtains marking value=0.01*800+0.03* of the node to be selected 900+0.02*500=45.
It can be with as the formula of marking value using the average value of the product of each index are as follows: marking value=(rest network bandwidth Weight * network bandwidth surplus+free memory weight * memory surplus+residue disk weight * disk surplus+...)/n;Its In, n indicates to participate in the quantity of the index of marking.For example, when the network bandwidth surplus of node to be selected is 800MB, memory is remaining Amount is 900MB, and disk surplus is 500MB;Rest network bandwidth weighting is set as 0.01, and free memory weight is 0.03, remains Residual magnetism disk weight is set as 0.02, obtains marking value=(0.01*800+0.03*900+0.02*500)/3=of the node to be selected 15.Based on foregoing description, the available resources value of each index of node to be selected is substituted into above-mentioned formula, the section to be selected can be obtained The marking value of point.
Step S310 randomly chooses the execution node of task requests based on the marking value of each node to be selected, and dispatching should It executes node and executes task requests.
The node scheduling method of above-mentioned execution task requests to determine each in running state data according to received task The threshold value of index, and the index is greater than according to the available resources value that the running state data of each node selects each index To be selected node of the node of threshold value as task requests;Again to the available resources value of each index of node to be selected and the index The product of default weight is summed up or is averaging, and the marking value of node to be selected is obtained, finally based on each node to be selected Marking value, randomly chooses the execution node of task requests, and dispatches the execution node and execute task requests.Which is only for can It is given a mark with the node that resource value is greater than threshold value, it is possible to reduce the calculation amount of system can also targetedly be chosen and meet The execution node of condition.
The embodiment of the present invention also provides the node scheduling method of another execution task, and this method is described in above-described embodiment It is realized on the basis of method;The description of this method emphasis randomly chooses the specific mistake of the execution node of task requests from node to be selected Journey;As shown in figure 4, this method comprises the following steps:
Step S402 obtains the running state data of each node when receiving task requests.
Step S404 determines the node to be selected for meeting task requests based on above-mentioned running state data.
Step S406 gives a mark to each node to be selected according to the running state data of each node to be selected.
Step S408 sorts from large to small each section to be selected according to the marking value of node to be selected when marking value is positive value Point.
The marking value is positive value, it can be understood as the default weight of the index in running state data is positive value.Work as marking Value be positive value when, the marking value of the node to be selected is higher, and the performance for representing the node to be selected is better, therefore, according to marking value from It arrives small sequence greatly to be ranked up node to be selected, the sequence of available joint behavior to be selected.
Correspondingly, which may be negative value, that is to say that the default weight in running state data is negative value, this When, the marking value of node to be selected is lower, and the performance for representing the node to be selected is better, therefore, can be according to marking value from small to large Sequence node to be selected is ranked up.
Step S410 chooses the node to be selected of specified quantity since first node to be selected after sequence.
The specified quantity can be according to node to be selected sum determine, for example, setting node total number amount to be selected 30% is specified quantity;It is also possible to according to the task amount setting in task requests, for example, appointing in task requests comprising 3 Business determines that the specified quantity is 10.
Step S412 randomly chooses the execution node of task requests from the node to be selected of the specified quantity of selection.
Execution node is randomly selected from the node to be selected for sorting forward specified quantity.When in task requests include one When a task, a node can be selected as execution node from the node to be selected of specified quantity;When including in task requests When multiple tasks, multiple nodes can be randomly choosed from the node to be selected of specified quantity and are used as execution node, what this was randomly selected Process can avoid to the maximum extent in mission dispatching to the same node.
Step S414 dispatches above-mentioned execution node and executes task requests.
The node scheduling method of above-mentioned execution task, when the marking value of node to be selected is positive value, according to node to be selected Marking value sorts from large to small each node to be selected, and specified quantity is then chosen first after sequence node to be selected Node to be selected finally randomly chooses the execution node for executing task requests from the node to be selected of the specified quantity of selection.Close When task requests are initiated on collection ground, which can be randomly choosed from the node of specified quantity executes node, so that task is uniform It is assigned on the node of specified quantity, to ensure that node load pressure is balanced.
The embodiment of the present invention also provides the node scheduling method of another execution task, and this method is described in above-described embodiment It is realized on the basis of method;The description of this method emphasis randomly chooses the detailed process of the execution node of task requests from the heap of top; As shown in figure 5, this method comprises the following steps:
Step S502 obtains the running state data of each node when receiving task requests.
Step S504 determines the node to be selected for meeting task requests based on above-mentioned running state data.
Step S506 gives a mark to each node to be selected according to the running state data of each node to be selected.
Step S508 carries out node to be selected by preset heapsort mode according to the marking value of above-mentioned node to be selected It sorts, there is the node to be selected of specified quantity in obtained top heap.
The mode of above-mentioned preset heapsort includes quick heapsort, pushes up heapsort, small top heapsort etc. greatly.By default Heapsort mode the step of node to be selected is ranked up, can be realized with following step 40-41:
Step 40, above-mentioned node to be selected is put into preset top heap, and according to the marking value of node to be selected in the heap of top Sequence;The node to be selected of specified quantity can be stored in the preset top heap.
In specific implementation, successively node to be selected is put into preset top heap first, which can be worth according to marking The node to be selected being put into is ranked up, is put into node to be selected into preset top heap every time, the node to be selected in addendum cone all can Rearrangement, to guarantee the node on heap top as score value highest or minimum node to be selected.
Step 41, when having piled the node to be selected of specified quantity in above-mentioned top heap, subsequent node to be selected is traversed, and hold The following operation of row: by the marking value of next node to be selected compared with the marking value of the node to be selected on heap top, according to comparison result Judge whether the node to be selected on deletion heap top;If deleting the node to be selected on heap top, next node to be selected is put into the heap of top; Continue to choose next node to be selected, until all nodes to be selected are traversed.
When the marking value of node to be selected is positive value, it can choose small top heap and node to be selected be ranked up, preset N number of (being equivalent to above-mentioned specified quantity) node to be selected can be stored in the small addendum cone, the ordering rule of the small top heap are as follows: heap top The marking value of node to be selected is the smallest in N number of node to be selected, and the marking value of the node to be selected of leaf node is greater than root node Marking value.Successively node to be selected is put into small top heap and is ranked up, it, will when piling N number of node to be selected in the small top heap The marking value of N+1 nodes to be selected is compared with the marking value of the node to be selected on heap top, if a node to be selected of N+1 Marking value is greater than the marking value of the node to be selected on heap top, deletes the node to be selected in heap top, and N+1 nodes to be selected are put into this In small top heap, so that rickle top is again ranked up the node to be selected in small top heap according to ordering rule;According still further to this rule The marking value of more next node to be selected, until all nodes to be selected are traversed to.Finally obtain one storage have it is N number of to Select the little Ding Dui of node.
Correspondingly, when the marking value of node to be selected is negative value, it can choose big top heap and node to be selected be ranked up, in advance N number of (being equivalent to above-mentioned specified quantity) node to be selected can be stored by first setting in the big addendum cone, the ordering rule of the big top heap is The marking value of the node to be selected on heap top is maximum in N number of node to be selected, and the marking value of the node to be selected of leaf node is less than The marking value of root node.Successively node to be selected is put into big top heap and is ranked up, when piling N number of node to be selected in the big top heap When, the marking value of N+1 nodes to be selected is compared with the marking value of the node to be selected on heap top, if N+1 are to be selected The marking value of node is less than the marking value of the node to be selected on heap top, deletes the node to be selected in heap top, by N+1 nodes to be selected It is put into the big top heap, so that raft top is again ranked up the node to be selected in big top heap according to ordering rule;According still further to The marking value of this more next node to be selected of rule, until all nodes to be selected are traversed to.Finally obtain a storage There is the great Ding Dui of N number of node to be selected.
When the quantity of node to be selected is less than the specified quantity that top heap can be stored, all section to be selected nodes to be selected are put into It pushes up in heap, which is ranked up the node to be selected of deposit, and only randomly selects execution node from the top heap.
Step S510 randomly chooses the execution node of task requests from above-mentioned top heap.
Include the node to be selected of specified quantity in above-mentioned top heap, can be randomly selected from the node of the specified quantity of top heap Execute node.
Step S512 dispatches above-mentioned execution node and executes task requests.
The node scheduling method of above-mentioned execution task obtains each section from database first when receiving task requests The running state data of point, then the node to be selected of task requests is met and to each node to be selected based on running state data determination It gives a mark, then according to the marking value of node to be selected, node to be selected is ranked up by preset heapsort mode, is obtained Top heap in have the node to be selected of specified quantity, finally random selection executes the execution nodes of task requests from the heap of top.Relatively In traditional sortord, which safeguards the top heap of a specified quantity, reduces the usage amount of memory, while can be quick Selection executes node, saves process expense.
Corresponding to above method embodiment, the embodiment of the invention provides a kind of node scheduling devices of execution task, such as Shown in Fig. 6, which includes:
Data acquisition module 60, for when receiving task requests, obtaining the running state data of each node;
Node determining module 61 to be selected, for determining the section to be selected for meeting task requests based on above-mentioned running state data Point;
Scoring modules 62 give a mark to each node to be selected for the running state data according to each node to be selected;
It executes node determining module 63 and randomly chooses holding for task requests for the marking value based on each node to be selected Row node;
Scheduler module 64 executes node execution task requests for dispatching.
The node scheduling device of above-mentioned execution task obtains the operation of each node when receiving task requests first Status data, then the node to be selected for meeting task requests is determined based on the row status data, and according to running state data to each A node marking to be selected, the execution node that finally the marking value random selection based on each node to be selected meets task requests execute Task requests.For intensive task requests, which can be randomly choosed from node to be selected according to marking value executes node, has Effect ground avoid all execution mission dispatchings to same node, while can equilibrium node load pressure, be conducive to node at Function executes task.
Above-mentioned data acquisition module 60, for obtaining the running state data of each node from database;Wherein, the data Running state data in library is to update after node reports.
Above-mentioned apparatus further includes data update module, if the running state data reported for receiving first node, Use the running state data of first node in the running state data replacement data library received;If within the set duration not The operation data that second node reports is received, it is unavailable shape that second node or label second node are removed from database State.
Above-mentioned running state data includes the corresponding available resources value of multiple indexs;Above-mentioned node determining module to be selected 61, for determining the threshold value of each index according to task requests;According to the running state data of each node, each index is selected Available resources value be greater than the index threshold value to be selected node of the node as task requests.
Above-mentioned scoring modules 62, for calculating the available resources value of each index of node to be selected and the default weight of index Product;Using the summation of the product addition of each index as marking value;Alternatively, using the average value of the product of each index as Marking value.
Above-mentioned marking value is positive value, above-mentioned execution node determining module 63, for according to the marking value of node to be selected from big To the small each node to be selected of sequence;Since first node to be selected after sequence, the node to be selected of specified quantity is chosen;From choosing The execution node of task requests is randomly choosed in the node to be selected of the specified quantity taken.
Above-mentioned execution node determining module 63 passes through preset heapsort mode for the marking value according to node to be selected Node to be selected is ranked up, there is the node to be selected of specified quantity in obtained top heap;Task requests are randomly choosed from the heap of top Execution node.
Above-mentioned execution node determining module 63, for node to be selected to be put into preset top heap, and top heap according to The marking value of node to be selected sorts;When having piled the node to be selected of specified quantity in the heap of top, subsequent node to be selected is traversed, and It executes following operation: by the marking value of next node to be selected compared with the marking value of the node to be selected on heap top, being tied according to comparing Fruit judges whether to delete the node to be selected on heap top;If deleting the node to be selected on heap top, next node to be selected is put into top heap In;Continue to choose next node to be selected, until all nodes to be selected are traversed.
The technical effect of the node scheduling device of execution task provided by the embodiment of the present invention, realization principle and generation Identical with preceding method embodiment, to briefly describe, Installation practice part does not refer to place, can refer to preceding method embodiment Middle corresponding contents.
The embodiment of the invention also provides a kind of servers, for running the node scheduling method of above-mentioned execution task;Ginseng As shown in Figure 7, which includes processor 101 and memory 100, which, which is stored with, to be held by processor 101 Capable machine-executable instruction, the processor 101 execute machine-executable instruction to realize the node scheduling of above-mentioned execution task Method.
Further, server shown in Fig. 7 further includes bus 102 and communication interface 103, processor 101, communication interface 103 and memory 100 connected by bus 102.
Wherein, memory 100 may include high-speed random access memory (RAM, Random Access Memory), It may further include non-labile memory (non-volatile memory), for example, at least a magnetic disk storage.By extremely A few communication interface 103 (can be wired or wireless) is realized logical between the system network element and at least one other network element Letter connection, can be used internet, wide area network, local network, Metropolitan Area Network (MAN) etc..Bus 102 can be isa bus, pci bus or Eisa bus etc..The bus can be divided into address bus, data/address bus, control bus etc..Only to be used in Fig. 7 convenient for indicating One four-headed arrow indicates, it is not intended that an only bus or a type of bus.
Processor 101 may be a kind of IC chip, the processing capacity with signal.It is above-mentioned during realization Each step of method can be completed by the integrated logic circuit of the hardware in processor 101 or the instruction of software form.On The processor 101 stated can be general processor, including central processing unit (Central Processing Unit, abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), ready-made programmable gate array (Field-Programmable Gate Array, abbreviation FPGA) or Person other programmable logic device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute sheet Disclosed each method, step and logic diagram in inventive embodiments.General processor can be microprocessor or the processing Device is also possible to any conventional processor etc..The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly in Hardware decoding processor executes completion, or in decoding processor hardware and software module combination execute completion.Software mould Block can be located at random access memory, flash memory, read-only memory, programmable read only memory or electrically erasable programmable storage In the storage medium of this fields such as device, register maturation.The storage medium is located at memory 100, and processor 101 reads memory Information in 100, in conjunction with its hardware complete previous embodiment method the step of.
The embodiment of the invention also provides a kind of machine readable storage medium, which is stored with machine Executable instruction, for the machine-executable instruction when being called and being executed by processor, which promotes processor Realize the node scheduling method of above-mentioned execution task, specific implementation can be found in embodiment of the method, and details are not described herein.
The node scheduling method, apparatus of execution task provided by the embodiment of the present invention and the computer program of server produce Product, the computer readable storage medium including storing program code, before the instruction that said program code includes can be used for execution Method described in the embodiment of the method for face, specific implementation can be found in embodiment of the method, and details are not described herein.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (13)

1. a kind of node scheduling method of execution task, which is characterized in that the described method includes:
When receiving task requests, the running state data of each node is obtained;
The node to be selected for meeting the task requests is determined based on the running state data;
According to the running state data of each node to be selected, give a mark to each node to be selected;
Based on the marking value of each node to be selected, the execution node of the task requests is randomly choosed;
It dispatches the execution node and executes the task requests.
2. the method according to claim 1, wherein the step of obtaining the running state data of each node, packet It includes: obtaining the running state data of each node from database;Wherein, the running state data in the database is the section What point updated after reporting.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
If receiving the running state data that first node reports, using described in the running state data replacement received The running state data of first node described in database;
If not receiving the operation data that second node reports within the set duration, described second is removed from the database Node or the label second node are down state.
4. the method according to claim 1, wherein the running state data includes that multiple indexs respectively correspond Available resources value;
The step of meeting the node to be selected of the task requests is determined based on the running state data, comprising:
The threshold value of each index is determined according to the task requests;
According to the running state data of each node, the available resources value of each index is selected to be greater than the threshold of the index To be selected node of the node of value as the task requests.
5. according to the method described in claim 4, it is characterized in that, according to the running state data of each node to be selected, The step of to the marking of each node to be selected, including to each node to be selected, it is performed both by following operation:
Calculate the product of the available resources value of each index of the node to be selected and the default weight of the index;
Using the summation of the product addition of each index as marking value;Alternatively, being averaged the product of each index Value is used as marking value.
6. the method according to claim 1, wherein the marking value is positive value;
Based on the marking value of each node to be selected, the step of randomly choosing the execution node of the task requests, comprising:
Each node to be selected is sorted from large to small according to the marking value of the node to be selected;
Since first node to be selected after sequence, the node to be selected of specified quantity is chosen;
The execution node of the task requests is randomly choosed from the node to be selected of the specified quantity of selection.
7. the method according to claim 1, wherein the marking value based on each node to be selected, random to select The step of selecting the execution node of the task requests, comprising:
According to the marking value of the node to be selected, the node to be selected is ranked up by preset heapsort mode, is obtained Top heap in have the node to be selected of specified quantity;
The execution node of the task requests is randomly choosed from the top heap.
8. the method according to the description of claim 7 is characterized in that by preset heapsort mode to the node to be selected into The step of row sequence, comprising:
The node to be selected is put into preset top heap, and is arranged in the top heap according to the marking value of the node to be selected Sequence;
When having piled the node to be selected of the specified quantity in the top heap, the subsequent node to be selected is traversed, and It executes following operation: by the marking value of next node to be selected compared with the marking value of the node to be selected on heap top, being tied according to comparing Fruit judges whether to delete the node to be selected on the heap top;It, will be described next to be selected if deleting the node to be selected on the heap top Node is put into the top heap;Continue to choose next node to be selected, until all nodes to be selected are traversed.
9. a kind of node scheduling device of execution task, which is characterized in that described device includes:
Data acquisition module, for when receiving task requests, obtaining the running state data of each node;
Node determining module to be selected, for determining the node to be selected for meeting the task requests based on the running state data;
Scoring modules give a mark to each node to be selected for the running state data according to each node to be selected;
It executes node determining module and randomly chooses the task requests for the marking value based on each node to be selected Execute node;
Scheduler module executes the task requests for dispatching the execution node.
10. device according to claim 9, which is characterized in that the running state data includes that multiple indexs are right respectively The available resources value answered;The node determining module to be selected, is used for:
The threshold value of each index is determined according to the task requests;
According to the running state data of each node, the available resources value of each index is selected to be greater than the threshold of the index To be selected node of the node of value as the task requests.
11. device according to claim 9, which is characterized in that the execution node determining module is used for:
According to the marking value of the node to be selected, the node to be selected is ranked up by preset heapsort mode, is obtained Top heap in have the node to be selected of specified quantity;
The execution node of the task requests is randomly choosed from the top heap.
12. a kind of server, which is characterized in that including processor and memory, the memory is stored with can be by the place The machine-executable instruction that device executes is managed, the processor executes the machine-executable instruction to realize claim 1 to 8 times The node scheduling method of execution task described in one.
13. a kind of machine readable storage medium, which is characterized in that the machine readable storage medium is stored with the executable finger of machine It enables, for the machine-executable instruction when being called and being executed by processor, the machine-executable instruction promotes processor to realize The node scheduling method of the described in any item execution tasks of claim 1 to 8.
CN201910693981.5A 2019-07-29 2019-07-29 The node scheduling method, apparatus and server of execution task Pending CN110389822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910693981.5A CN110389822A (en) 2019-07-29 2019-07-29 The node scheduling method, apparatus and server of execution task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910693981.5A CN110389822A (en) 2019-07-29 2019-07-29 The node scheduling method, apparatus and server of execution task

Publications (1)

Publication Number Publication Date
CN110389822A true CN110389822A (en) 2019-10-29

Family

ID=68287943

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910693981.5A Pending CN110389822A (en) 2019-07-29 2019-07-29 The node scheduling method, apparatus and server of execution task

Country Status (1)

Country Link
CN (1) CN110389822A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110888730A (en) * 2019-12-06 2020-03-17 深圳前海环融联易信息科技服务有限公司 Distributed task scheduling method and device, computer equipment and storage medium
CN110933136A (en) * 2019-10-31 2020-03-27 北京浪潮数据技术有限公司 Service node selection method, device, equipment and readable storage medium
CN111427682A (en) * 2020-03-11 2020-07-17 支付宝(杭州)信息技术有限公司 Task allocation method, system, device and equipment
CN111597047A (en) * 2020-05-15 2020-08-28 北京金山云网络技术有限公司 Service deployment method, device, electronic equipment and storage medium
CN113542424A (en) * 2021-07-19 2021-10-22 中移(杭州)信息技术有限公司 Data processing method, device, equipment and computer program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073546A (en) * 2010-12-13 2011-05-25 北京航空航天大学 Task-dynamic dispatching method under distributed computation mode in cloud computing environment
US20130247061A1 (en) * 2012-03-19 2013-09-19 Ati Technologies Ulc Method and apparatus for the scheduling of computing tasks
CN103646078A (en) * 2013-12-11 2014-03-19 北京启明星辰信息安全技术有限公司 Method and device for realizing internet propaganda monitoring target evaluations
CN108628674A (en) * 2018-05-11 2018-10-09 深圳市零度智控科技有限公司 Method for scheduling task, cloud platform based on cloud platform and computer storage media
CN109933420A (en) * 2019-04-02 2019-06-25 深圳市网心科技有限公司 Node tasks dispatching method, electronic equipment and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073546A (en) * 2010-12-13 2011-05-25 北京航空航天大学 Task-dynamic dispatching method under distributed computation mode in cloud computing environment
US20130247061A1 (en) * 2012-03-19 2013-09-19 Ati Technologies Ulc Method and apparatus for the scheduling of computing tasks
CN103646078A (en) * 2013-12-11 2014-03-19 北京启明星辰信息安全技术有限公司 Method and device for realizing internet propaganda monitoring target evaluations
CN108628674A (en) * 2018-05-11 2018-10-09 深圳市零度智控科技有限公司 Method for scheduling task, cloud platform based on cloud platform and computer storage media
CN109933420A (en) * 2019-04-02 2019-06-25 深圳市网心科技有限公司 Node tasks dispatching method, electronic equipment and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933136A (en) * 2019-10-31 2020-03-27 北京浪潮数据技术有限公司 Service node selection method, device, equipment and readable storage medium
CN110888730A (en) * 2019-12-06 2020-03-17 深圳前海环融联易信息科技服务有限公司 Distributed task scheduling method and device, computer equipment and storage medium
CN111427682A (en) * 2020-03-11 2020-07-17 支付宝(杭州)信息技术有限公司 Task allocation method, system, device and equipment
CN111427682B (en) * 2020-03-11 2023-09-01 支付宝(杭州)信息技术有限公司 Task allocation method, system, device and equipment
CN111597047A (en) * 2020-05-15 2020-08-28 北京金山云网络技术有限公司 Service deployment method, device, electronic equipment and storage medium
CN113542424A (en) * 2021-07-19 2021-10-22 中移(杭州)信息技术有限公司 Data processing method, device, equipment and computer program product

Similar Documents

Publication Publication Date Title
CN110389822A (en) The node scheduling method, apparatus and server of execution task
CN105900064B (en) The method and apparatus for dispatching data flow task
CN109800936B (en) Scheduling method based on tree search and electronic device using the same
CN108287666A (en) Date storage method and device for cloud storage environment
CN111404838A (en) Message processing method, device and equipment
CN108616553B (en) Method and device for resource scheduling of cloud computing resource pool
CN106202092A (en) The method and system that data process
CN111176840A (en) Distributed task allocation optimization method and device, storage medium and electronic device
CN111459675A (en) Data processing method and device, readable storage medium and electronic equipment
CN111445191A (en) Distribution difficulty estimation method and device and storage medium
CN112491742B (en) Method and device for scheduling edge computing terminal resources
CN109800074A (en) Task data concurrently executes method, apparatus and electronic equipment
CN109635034A (en) Training data method for resampling, device, storage medium and electronic equipment
CN115794570A (en) Pressure testing method, device, equipment and computer readable storage medium
CN106934015A (en) Address date treating method and apparatus
CN112596985A (en) IT asset detection method, device, equipment and medium
CN112333246A (en) ABtest experiment method and device, intelligent terminal and storage medium
CN114979282B (en) Task scheduling method, device, storage medium and electronic equipment
Van der Merwe et al. Decision support for grape harvesting at a South African winery
CN110543994A (en) Information processing method and device, readable storage medium and electronic equipment
CN107547429A (en) One kind load determines method, apparatus and electronic equipment
CN108429704B (en) Node resource allocation method and device
CN113761702B (en) Sorting scheme evaluation method and device
CN114881465A (en) Production management method, system, device and storage medium
CN110516922B (en) Method and device for distributing data processing objects

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: 20191029

RJ01 Rejection of invention patent application after publication