Summary of the invention
For the problems of the prior art, present applicant proposes the methods and apparatus for determining key node, existing to solve
The phenomenon that having the problems in technology, improve the efficiency of Optimization Work, alleviating task delay.
Present applicant proposes the methods for determining key node, comprising:
Obtain the corresponding runing time of each node in the system;
Determine the longest link of runing time between start node to destination node;
Count that each node for including in the link is corresponding to optimize duration;
Duration can be optimized by selecting in the link meets the node of preset condition for key node.
Preferably, the longest link of determination runing time between start node to destination node, it is specific to wrap
It includes:
Determine the end value of each node in addition to start node according to preset order, the end value of the node include from
Information and the link corresponding runing time of the start node to the longest link of the node runing time;
Search the information of the longest link of runing time in the end value of destination node, the corresponding chain of the information
Lu Weicong start node is to the longest link of runing time between destination node.
Preferably, the end value that each node in addition to start node is determined according to preset order, specifically includes:
From start node, each node is controlled according to preset rules and sends message to downstream node adjacent thereto;
Whether the node that confirmation receives message is to receive message for the first time;If the node for receiving message is to receive to disappear for the first time
Breath, the content of the message are to receive the value of the node of message;If the node for receiving message is not to receive message for the first time, sentence
The disconnected the content whether content of the current value of the node is replaced with to the message being most recently received;
When the message of other nodes transmission can be received again by determining any node not according to preset standard, any node
Value be any node end value;
Wherein, the content that start node sends message includes letter of the start node to the inter-node link for receiving the message
Breath and the corresponding runing time information of the link;The content for modifying the end value of other nodes in addition to start node is made
For other nodes message to be sent in addition to start node, the modification includes the link in the end value of the node
Information in addition to receive the message node information, and in the runing time of the link in the value of the node
Increase the runing time for sending the node itself of message;
Wherein, described to determine whether to replace with the content of the current value of the node in the message being most recently received
Hold, comprising: runing time in the current value of the node and the runing time in the message received;If the value of itself
In runing time be less than the runing time in the message received, then by the letter of runing time and link in the value of itself
Breath replaces with the information of runing time and link in the message received;If the runing time in the value of itself is not less than
The runing time in message received, then the value of itself is constant.
Preferably, described any node determined not according to preset standard to receive the message of other nodes transmission, tool again
Body includes:
Disabled state is set by the node for having sent message to all downstream nodes adjacent thereto;
When determining that all upstream nodes adjacent with any node are all disabled state, any node is had received
The message that all upstream nodes adjacent thereto are sent, can not receive the message of other nodes transmission again.
Preferably, each node for including in the statistics link is corresponding to optimize duration, specifically includes:
Obtain the node for including in the longest link of the runing time can Optimal Ratio;
According to the node can Optimal Ratio and operation duration calculate when optimizing of the node for including in the link
It is long, the node a length of when optimizing can Optimal Ratio and operation duration product.
The embodiment of the present application also discloses a kind of equipment of determining key node, comprising:
Module is obtained, for obtaining the corresponding runing time of each node in the system;
Determining module, for determining the longest link of runing time between start node to destination node;
Statistical module, for counting, each node for including in the link is corresponding to optimize duration;
Selecting module meets the node of preset condition for selecting that duration can be optimized in the link for key node.
Preferably, the determining module, specifically includes:
Determination module, for determining the end value of each node in addition to start node, the node according to preset order
End value include being answered from start node to the information of the longest link of the node runing time and the link pair
Runing time;
Searching module, the information of the longest link of the runing time in end value for searching destination node, institute
Stating the corresponding link of information is the longest link of runing time between start node to destination node.
Preferably, the determination module, is specifically used for:
From start node, each node is controlled according to preset rules and sends message to downstream node adjacent thereto;
If the node for receiving message is to receive message for the first time, the content of the message is the node for receiving message
Value;If the node for receiving message is not to receive message for the first time, determine whether to replace the content of the current value of the node
It is changed to the content for the message being most recently received;
When the message of other nodes transmission can be received again by determining any node not according to preset standard, any node
Value be any node end value;
Wherein, the content that start node sends message includes letter of the start node to the inter-node link for receiving the message
Breath and the corresponding runing time information of the link;The content for modifying the end value of other nodes in addition to start node is made
For other nodes message to be sent in addition to start node, the modification includes the link in the end value of the node
Information in addition to receive the message node information, and in the runing time of the link in the value of the node
Increase the runing time for sending the node itself of message;
Wherein, described to determine whether to replace with the content of the current value of the node in the message being most recently received
Hold, comprising: runing time in the current value of the node and the runing time in the message received;If the value of itself
In runing time be less than the runing time in the message received, then by the letter of runing time and link in the value of itself
Breath replaces with the information of runing time and link in the message received;If the runing time in the value of itself is not less than
The runing time in message received, then the value of itself is constant.
Preferably, the determination module determines any node not according to preset standard can receive the transmission of other nodes again
Message specifically includes:
Disabled state is set by the node for having sent message to all downstream nodes adjacent thereto;
When determining that all upstream nodes adjacent with any node are all disabled state, any node is had received
The message that all upstream nodes adjacent thereto are sent, can not receive the message of other nodes transmission again.
Preferably, the statistical module, is specifically used for:
Obtain the node for including in the longest link of the runing time can Optimal Ratio;
According to the node can Optimal Ratio and operation duration calculate when optimizing of the node for including in the link
It is long, the node a length of when optimizing can Optimal Ratio and operation duration product.
Compared with prior art, the application improves the effect of Optimization Work by finding the key node to be optimized
Rate alleviates the phenomenon that task postpones.
Specific embodiment
In order to solve in the prior art, large-scale task scheduling system inefficiency, the serious defect of task delay phenomenon, this
Application proposes a kind of method of determining key node, to instruct the Optimization Work of task scheduling system, as shown in Figure 1, including
Following steps:
Step 101 obtains the corresponding runing time of each node in the system;
Step 102 determines the longest link of runing time between start node to destination node;
In specific application scenarios, the longest link of runing time is determined between start node to destination node
Method have very much, such as:
1, link all between start node to destination node in system is found, all links found are counted
Runing time, it is final to determine that runing time is longest between start node to destination node by the sequence to runing time
One link.
2, according to certain sequence or algorithm, the longest chain of runing time between start node to destination node is found
Road e.g. determines the end value of each node in addition to start node according to preset order, the end value of the node includes from
Information and the link corresponding runing time of the beginning node to the longest link of the node runing time;Wherein
The preset order can be the sequence of upstream node to downstream node, can also be determined according to algorithms of different, pass through transformation
Existing signal source shortest path algorithm, such as Di Jiesitela Dijkstra signal source shortest path algorithm, Bellman Ford
Bellman-Ford algorithm, SPFA algorithm, ASP algorithm and Floyd-Warshall algorithm etc., also available other are found most
The algorithm in long path, in this way, need to only search the end value of the destination node for specified destination node, can be obtained from
Information of the start node to the longest link of runing time between destination node.
Wherein, Dijkstra signal source shortest path algorithm goes to solve non-negative right digraph using breadth first search
Signal source shortest path problem, algorithm will eventually get a shortest path tree, and the input of the algorithm contains a Weight
Digraph G and start node S, the set on all vertex in G is indicated with V.Side in each figure is all two vertex institutes
The Sequential Elements pair of formation.(u, v) expression has path to be connected from vertex u to v.We indicate the set on all sides in G with E, and
The weight on side is then defined by weighting function w:E → [0, ∞].Therefore, w (u, v) is exactly the nonnegative curvature from vertex u to vertex v
(weight).The weight on side can imagine into the distance between two vertex.The weight for appointing inter-two-point path, is exactly on the path
The weight summation on all sides.It has been known that there is having vertex s and t in V, dijkstra's algorithm can find the lowest weightings path of s to t
(for example, shortest path).This algorithm can also be found from a vertex s to the most short of any other vertex in one drawing
Path.
A kind of preferred method is, from start node, controls each node according to preset rules under adjacent thereto
It swims node and sends message;Whether the node that confirmation receives message is to receive message for the first time;If the node for receiving message is for the first time
Message is received, the content of the message is to receive the value of the node of message;If the node for receiving message is not to receive for the first time
To message, the content that the content of the current value of the node is replaced with to the message being most recently received is determined whether to;According to pre-
When bidding accurately determines any node not and can receive again the message of other nodes transmission, the value of any node is described any
The end value of node;
Wherein, the content that start node sends message includes letter of the start node to the inter-node link for receiving the message
Breath and the corresponding runing time information of the link;The content for modifying the end value of other nodes in addition to start node is made
For other nodes message to be sent in addition to start node, the modification includes the link in the end value of the node
Information in addition to receive the message node information, and in the runing time of the link in the value of the node
Increase the runing time for sending the node itself of message;
Wherein, described to determine whether to replace with the content of the current value of the node in the message being most recently received
Hold, comprising: runing time in the current value of the node and the runing time in the message received;If the value of itself
In runing time be less than the runing time in the message received, then by the letter of runing time and link in the value of itself
Breath replaces with the information of runing time and link in the message received;If the runing time in the value of itself is not less than
The runing time in message received, then the value of itself is constant.
Wherein, the method for the message that any node determined not according to preset standard can receive again the transmission of other nodes
Have very much, such as can be determined by the setting of disabled state, specifically, can will be to all downstream joints adjacent thereto
The node that point has sent message is set as disabled state;Determine that all upstream nodes adjacent with any node are all inactive
When state, any node has received the message that all upstream nodes adjacent thereto are sent, and can not receive other again
The message that node is sent.
Another method is to can specify that one section of preset time, does not receive other nodes in preset time node and sends
Message, it is determined that the node can not receive again other nodes transmission message.
Wherein, distributed BSP Computational frame can be used in specific determination process, hardware aspect, supports magnanimity numbers up to a million
According to the processing of figure, it is better than conventional individual solution.
Wherein, Integral synchronous parallel computational model Bulk Synchronous Parallel, feature is by processor and road
It is separated by device, highlights separating for calculating task and communication task, and router is only only completed the message transmission of point-to-point, does not mention
For functions such as combination, duplication and broadcast, does so and both cover specific interference networks topology, communication protocol is in turn simplified, in BSP
In, a calculating process is made of a series of global superledges, each superledge is by concurrent, communication three steps synchronous with fence
Rapid composition.It synchronously completes, indicates the completion of this superledge and the beginning of next superledge.
The each node for including in step 103, the statistics link is corresponding to optimize duration;
It can directly evaluate in the link that each node for including is corresponding to optimize duration, can also first obtain institute
That states the node for including in the longest link of runing time can Optimal Ratio;Further according to the node can Optimal Ratio with
Operation duration calculates the duration that optimizes for the node for including in the link, and a length of node when optimizing optimizes
The product of ratio and operation duration.
Step 104, duration can be optimized by selecting in the link meet the node of preset condition for key node.
The duration that optimizes of the link interior joint can be ranked up, optimal optimization sequence can be obtained, choose
The part of nodes of optimization front optimizes, or successively optimizes to these nodes according to optimal optimization sequence,
In this way depending on the quantity of the obtained key node of concrete condition determination, the efficiency of optimization ensure that, while avoiding the negative of system
It carries on a shoulder pole overweight.
In order to further describe the present application, the embodiment of the present application two discloses a kind of in specific determining crucial section
The method of point, comprising:
Relatively simple task scheduling system as shown in Figure 2, be applied to data warehouse in, data warehouse be one towards
Theme, integrated, metastable, reflecting history variation data acquisition system, for supporting administrative decision.The task schedule system
It include working node #1, #2, #4, #3, #5 in system, the operation duration of working node #1, #2, #4, #3, #5 are respectively 8 minutes, 5
Minute, 2 minutes, 3 minutes, 1 minute.
Step 1 obtains the corresponding runing time of each node in the system.
Step 2, in original state, control node #1 sends message to its downstream node #2, #4, and the content of message includes
" start node -> intermediate node -> terminal node: operation duration ", as control node #1 sends message " #1- > # to node #2
2:8 ", Xiang Jiedian #4 send message " #1- > #4:8 ";Disappear at this point, node #1 is over to all downstream node transmissions adjacent with it
Breath, sets disabled state for node #1.
Node #2, #4 is to receive message for the first time at this time, and " #1- > #2:8 " is saved as the value of itself by node #2, section
" #1- > #4:8 " is saved as the value of itself by point #4, and the upstream node of node #2 only has node #1, and node #1 has been inactive
State, so " #1- > #2:8 " is end value of node #2, after determining end value, control node #2 is to the downstream joint adjacent with it
Point #3, #4 send message, downstream node will be added in the link in node #2 end value, while plus certainly in " operation duration "
This message is sent to downstream node, such as sends message " #1- > #2- > #3:13 " to node #3 by the operation duration of body, node #
2 send message " #1- > #2- > #4:13 " to node #4;At this point, node #2 is over to all downstream node transmissions adjacent with it
Node #2 is set disabled state by message.
Node #3 is to receive message for the first time at this time, and " #1- > #2- > #3:13 " is saved as the value of itself by node #3, section
Point #4 is not to receive message for the first time, so runing time in the value of comparison node #4 itself and newly receiving the fortune in message
The row time, since 13 are greater than 8, so the value of node #4 is replaced with " #1- > #2- > #4:13 ", the upstream node of node #3 only has
Node #2, and node #2 has been disabled state, so " #1- > #2- > #3:13 " is the end value of node #3, node #4's is upper
Trip node has node #1 and node #2, and node #1 and node #2 are disabled state, so " #1- > #2- > #4:13 " is section
The end value of point #4, after determining end value, control node #3, #4 sends message to the downstream node #5 adjacent with them respectively,
Disabled state is set by node #3, #4 after being sent completely, wherein node #3 sends message " #1- > #2- > #3- to node #5
> #5:15 ", node #4 send message #1- > #2- > #4- > #5:16 " to node #5, and node #5 final value is " #1- > #2- > #4-
> #5:16 ", i.e., from node #1 to node #5, the longest link of runing time is #1- > #2- > #4- > #5.
Next the node in a link longest to runing time is investigated, i.e., examines #1, #2, #4, #5
It examines, chooses part of nodes therein and optimize operation;Specifically, the operation duration of available node #1, #2, #4, #5 are simultaneously
Assess they can Optimal Ratio, (operation duration * can be excellent for the duration that optimizes for determining the node related in the link with this
Change ratio), optimal optimization sequence can be obtained after sequence, the part of nodes for choosing optimization front optimizes, or
Successively these nodes are optimized according to optimal optimization sequence.
In practical application scene, the node of system can be more than system shown in Fig. 2, and the node on longest path also can be more
More, principle is identical as above-mentioned example, can search out the key node preferentially to be optimized according to the method described above.
The embodiment of the present application three also discloses a kind of data processing equipment, as shown in Figure 3, comprising:
Module 301 is obtained, for obtaining the corresponding runing time of each node in the system;
Determining module 302, for determining the longest link of runing time between start node to destination node;
Statistical module 303, for counting, each node for including in the link is corresponding to optimize duration;
Selecting module 304 meets the node of preset condition for selecting that duration can be optimized in the link for key node.
Preferably, the determining module 302, specifically includes:
Determination module, for determining the end value of each node in addition to start node, the node according to preset order
End value include being answered from start node to the information of the longest link of the node runing time and the link pair
Runing time;
Searching module, the information of the longest link of the runing time in end value for searching destination node, institute
Stating the corresponding link of information is the longest link of runing time between start node to destination node.
Preferably, the determination module, is specifically used for:
From start node, each node is controlled according to preset rules and sends message to downstream node adjacent thereto;
If the node for receiving message is to receive message for the first time, the content of the message is the node for receiving message
Value;If the node for receiving message is not to receive message for the first time, determine whether to replace the content of the current value of the node
It is changed to the content for the message being most recently received;
When determining that node no longer receives the message of other nodes transmission, the value of the node is the final of the node
Value;
Wherein, the content that start node sends message includes letter of the start node to the inter-node link for receiving the message
Breath and the corresponding runing time information of the link;The content for modifying the end value of other nodes in addition to start node is made
For other nodes message to be sent in addition to start node, the modification includes the link in the end value of the node
Information in addition to receive the message node information, and in the runing time of the link in the value of the node
Increase the runing time for sending the node itself of message;
Wherein, described to determine whether to replace with the content of the current value of the node in the message being most recently received
Hold, comprising: runing time in the current value of the node and the runing time in the message received;If the value of itself
In runing time be less than the runing time in the message received, then by the letter of runing time and link in the value of itself
Breath replaces with the information of runing time and link in the message received;If the runing time in the value of itself is not less than
The runing time in message received, then the value of itself is constant.
Preferably, the determination module determines any node not according to preset standard can receive the transmission of other nodes again
Message specifically includes:
Disabled state is set by the node for having sent message to all downstream nodes adjacent thereto;
When determining that all upstream nodes adjacent with any node are all disabled state, any node is had received
The message that all upstream nodes adjacent thereto are sent, can not receive the message of other nodes transmission again.
Preferably, the statistical module 303, is specifically used for:
Obtain the node for including in the longest link of the runing time can Optimal Ratio;
According to the node can Optimal Ratio and operation duration calculate when optimizing of the node for including in the link
It is long, the node a length of when optimizing can Optimal Ratio and operation duration product.
Compared with prior art, the application improves the effect of Optimization Work by finding the key node to be optimized
Rate alleviates the phenomenon that task postpones.
Through the above description of the embodiments, those skilled in the art can be understood that the application can lead to
Hardware realization is crossed, the mode of necessary general hardware platform can also be added to realize by software.Based on this understanding, this Shen
Technical solution please can be embodied in the form of software products, which can store in a non-volatile memories
In medium (can be CD-ROM, USB flash disk, mobile hard disk etc.), including some instructions are used so that a computer equipment (can be
Personal computer, server or network equipment etc.) execute method described in each implement scene of the application.
It will be appreciated by those skilled in the art that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, module in attached drawing or
Process is not necessarily implemented necessary to the application.
It will be appreciated by those skilled in the art that the module in device in implement scene can be described according to implement scene into
Row is distributed in the device of implement scene, can also be carried out corresponding change and is located at the one or more dresses for being different from this implement scene
In setting.The module of above-mentioned implement scene can be merged into a module, can also be further split into multiple submodule.
Above-mentioned the application serial number is for illustration only, does not represent the superiority and inferiority of implement scene.
Disclosed above is only several specific implementation scenes of the application, and still, the application is not limited to this, Ren Heben
What the technical staff in field can think variation should all fall into the protection scope of the application.