Embodiment
For above-mentioned feature, the advantage that makes the embodiment of the invention becomes apparent more, be elaborated below in conjunction with embodiment.
Please refer to Fig. 1, be the embodiment of the invention one method flow diagram, can may further comprise the steps:
Step 101: send heartbeat message;
Step 102:, then obtain the information on load of described processor according to described response when in preset time, obtaining the response that processor returns according to described heartbeat message;
Step 103: judge according to described information on load whether described processor overload has taken place.
As can be seen, in embodiments of the present invention,, can judge processor according to the information on load that carries in the response and whether transship if in preset time, received the response that processor returns at heartbeat message.Therefore, no matter under which kind of situation, can learn that whether processor transships, and has eliminated the potential safety hazard of equipment.
It is pointed out that step 101 can comprise two kinds of implementations.First kind of implementation is: directly send heartbeat message to processor.Second kind of implementation is: the content of heartbeat message is write intermediate storage medium.Respectively top dual mode is described below.
At first, describe directly sending this implementation of described heartbeat message with an embodiment to described processor.
Please refer to Fig. 2, be the embodiment of the invention two method flow diagrams, can may further comprise the steps:
Step 201: send heartbeat message to processor;
This step is finished by Distribution Center, and the heartbeat message here can be understood as some data messages, can be used to obtain the information on load of processor for carrying out mutual proprietary protocol in the equipment between each module.Each data of heartbeat message all have certain interval (be similar to each heartbeat certain time interval is all arranged) when sending, and in the present embodiment, this is spaced apart fixed value, as just send a data message every 0.5ms; In other embodiments, the interval between the data message also can be the on-fixed value, as sending a data message behind the 0.2ms at interval for the first time, sends a data message behind the 0.3ms at interval for the second time, sends a data message behind the 0.4ms at interval for the third time; Next carry out the blanking time that periodicity repeated or used other according to the interval of 0.2ms, 0.3ms, 0.4ms again.Generally be no more than the threshold values of a setting this blanking time in actual applications, this threshold values can be determined by test or by empirical value or other means according to concrete application.
The content of heartbeat message can comprise at least: the sequence number of heartbeat message and/or timestamp.For the consideration of fail safe, the content of heartbeat message can also comprise identifying code.In addition, at the load of using, the content of heartbeat message can also comprise out of Memory, for example: the flow maximum of current which kind of message etc.
Step 202: the heartbeat message that sends is carried out timing;
Distribution Center carries out timing can comprise following dual mode:
First kind of mode is: start a timer at each heartbeat message, be used for described processor is carried out timing to the response time of described heartbeat message;
In this manner, each heartbeat message all starts a timer, and when sending message, whether timer picks up counting, by timer, can decision processor in preset time described heartbeat message be responded.
The second way is: inquire about the have or not response of described processor to the heartbeat message that sends at regular intervals.
In this manner, can check the heartbeat message of described processor at regular intervals to sending; Also the above-mentioned time can be divided into several sections, whether certain a part of message of inquiry responds in the time period after division.In view procedure, in the present embodiment, use the mode of repeating query to check; In other embodiments, also can use other self-defining rule to check.Below by following example the second way is described:
Suppose to have now 100 heartbeat messages, can adopt and check at regular intervals whether whole transmission messages respond: inquire about once these 100 heartbeat messages such as setting every 1ms and whether respond; Also can again 1ms be divided into several sections, as be divided into 5 parts, each accounts for 0.2ms, and whether preceding 20 in first 0.2ms in 100 heartbeat messages of inquiry respond; Whether next 20 messages in second 0.2ms in 100 messages of inquiry respond; And the like, also can realize the function of inquiring about.
By the second way, can only need to start a timer, perhaps can utilize and regularly interrupt waiting other means to realize query function.
Step 203: judge in preset time, whether to have received the response that processor returns at heartbeat message, if enter step 204; Otherwise, enter step 206;
The above-mentioned time threshold that presets can be by empirical value or in actual applications according to obtaining by test.When comprising a plurality of data message in the heartbeat message that Distribution Center sends,, so just enter step 206 if wherein have at least a data message not return response.
Step 204: know according to information on load whether processor overload has taken place;
Processor can comprise at the response that heartbeat message returns: with the corresponding sequence number of the sequence number of the heartbeat message that receives, and processor utilization.The sequence number of the response that processor returns can be identical with the sequence number of heartbeat message, also can be corresponding according to the sequence number of certain computation rule and heartbeat message.
Alternatively, processor can also comprise at the response that heartbeat message returns: (FIFO comprises hardware description symbol resource or memory source etc. for First In First Out, FIFO) relevant information for memory usage, keystone resources utilance or first in first out.Concern that wherein resource utilization can comprise: buffering is used the size or the queue length etc. that is untreated.If the content of heartbeat message comprises identifying code, also comprise identifying code in the response that processor returns, the identifying code that processor returns also can be identical with the identifying code of heartbeat message, and is perhaps corresponding according to the identifying code of certain computation rule and heartbeat message.
The information on load of processor can comprise: the utilance of processor.When utilance is higher than the threshold values that presets, just show the process of having taken place, the threshold values here also can obtain by test or empirical value or other means.
In addition, information on load also can comprise the number of FIFO, FIFO can comprise the FIFO that hardware FIFO and/or software are realized, in the present embodiment, preferably use the scheme of hardware FIFO in conjunction with software FIFO, when the use number of the use number of hardware FIFO in the information on load or software FIFO exceeds the threshold values that presets, show then overload taken place that the threshold values here also can obtain by test or empirical value or other means.
Step 205: if processor transships, the network message that will handle is sent to processor, by the processor executable operations; If load condition shows that overload has taken place processor, then the network message that will handle transships processing, and returns step 201;
Step 206: overload has appearred in decision processor;
When exceeding the time threshold that presets, Distribution Center does not also receive the response that processor returns at heartbeat message, and overload has appearred in Distribution Center's decision processor;
Too high when processor utilization, when perhaps related hardware disconnects (as situations such as hardware FIFO space have been full), can not in the time threshold that presets, return response to heartbeat message, therefore, directly decision processor overload.
Step 207: the network message that will handle transships processing, and returns step 201.
Received heartbeat message as long as it is pointed out that processor, will return response to Distribution Center from Distribution Center.When processor transshipped, if back-pressure does not also take place the upstream or downstream passage, Distribution Center just can judge processor according to the information on load of processor overload has taken place.When processor does not return response to heartbeat message in the time threshold that is presetting, then directly overload has taken place in decision processor.
In step shown in Figure 2, overload that Distribution Center carries out is handled and is comprised and be sent to other processor or directly be forwarded to miscellaneous equipment.
More than be illustrated directly sending this implementation of heartbeat message to processor, with an embodiment content with heartbeat message is write this implementation of intermediate storage medium below and describes.
In the middle of another embodiment, heartbeat message can carry out message transmissions by Distribution Center and processors sharing intermediate storage medium, and promptly intermediate storage medium is used to accept Distribution Center and the processor read-write operation to the content of heartbeat message.
Specific implementation comprises: up or descending back-pressure information is at first read in Distribution Center, to understand whether back-pressure has taken place, and when finding that back-pressure takes place, Distribution Center no longer continues executable operations, and flow process finishes.When not finding back-pressure, Distribution Center writes intermediate storage medium with the content of heartbeat message, begins subsequently timing is carried out in the write operation of this execution.When in the time threshold that is presetting, if Distribution Center finds processor content at heartbeat message in intermediate storage medium and has write relevant information, then obtain the information on load of processor, whether overload has taken place according to the information on load decision processor according to relevant information.When exceeding the time threshold that presets, if Distribution Center does not find that also processor content at heartbeat message in intermediate storage medium writes relevant information, then overload has taken place in decision processor.At this moment, the network message that will handle of Distribution Center is sent to other processor or is forwarded to miscellaneous equipment.
For processor, processor is read intermediate storage medium at regular intervals, and writes and the corresponding information of the content of heartbeat message to intermediate storage medium according to self load condition.But when processor transshipped, carrying out write operation will postpone, and therefore, the information that processor writes can't be read in Distribution Center in the time threshold that presets, and then directly decision processor is transshipped.
As can be seen, in embodiments of the present invention, if Distribution Center has received the response that processor returns at heartbeat message in preset time, whether can judge processor according to the information on load that carries in the response transships, if exceed the response that preset time does not also receive from processor, then directly overload has taken place in decision processor.By the embodiment of the invention, whether query processor process has taken place in real time, has improved the promptness that detects, thereby has reduced the potential safety hazard of equipment.
Referring to Fig. 3, the embodiment of the invention also provides a kind of overload detector 300, can comprise:
Transmitting element 301 is used to send heartbeat message;
Acquiring unit 302 is used for then obtaining the information on load of described processor according to described response when obtain the response that processor returns according to described heartbeat message in preset time;
First judging unit 303 is used for judging according to described information on load whether described processor overload has taken place; The information on load here can be the utilance of processor, and the FIFO number etc.
Described device 300 also comprises:
Second judging unit 304 is used for judging that then overload has taken place described processor if exceeding described preset time does not receive the response that described processor returns.
Described transmitting element 301 comprises:
Directly transmitting element is used for directly sending described heartbeat message to described processor;
Perhaps;
Transmitting element is used for the content of described heartbeat message is write intermediate storage medium indirectly.
When using described direct transmitting element to send described heartbeat message, described acquiring unit 302 also comprises:
Directly acquiring unit is used for directly obtaining the response that described processor returns;
Perhaps,
When the content of using described indirect transmitting element with described heartbeat message write intermediate storage medium, described acquiring unit 302 also comprised:
Acquiring unit is used for obtaining described processor writes on described intermediate storage medium according to heartbeat message response from described intermediate storage medium indirectly indirectly.
Described device 300 also comprises:
Timing unit 305 is used for starting a timer at each heartbeat message, so that described processor is carried out timing to the response time of described heartbeat message;
Perhaps,
Inquire about described processor at regular intervals the heartbeat message that sends is had or not response.
The flow process of the interaction flow of each unit in specifically can reference method embodiment repeats no more here in this device.
By the embodiment of the invention, whether query processor process has taken place in real time, has improved the promptness that detects, thereby has reduced the potential safety hazard of equipment.
Referring to Fig. 4, the embodiment of the invention also provides a kind of overload detection system 400, comprising:
Distribution Center 401, processor 402;
Described Distribution Center 401 is used to send heartbeat message;
Described processor 402 is used to receive described heartbeat message, and makes response according to described heartbeat message;
When described Distribution Center 401 obtains the response that described processor 402 returns according to heartbeat message in preset time, then obtain the information on load of described processor 402, judge according to described information on load whether described processor 402 overload has taken place according to described response.
Described Distribution Center 401 also is used for:
If in described preset time, do not obtain the response that described processor 402 returns according to described heartbeat message, judge that then overload has taken place described processor 402.
Described Distribution Center 401 sends to described processor 402 by direct sending method with described heartbeat message; Described processor directly returns response to described Distribution Center 401 after making response;
Perhaps,
Referring to Fig. 5, described system also comprises intermediate storage medium 403, and described Distribution Center 401 sends to described intermediate storage medium 403 with described heartbeat message; After described processor 402 is made response, response is write described intermediate storage medium 403, read for described Distribution Center 401.
In the native system, the flow process of the concrete interaction flow of Distribution Center 401 and processor 402 in can reference method embodiment repeats no more here.
By the embodiment of the invention, whether query processor process has taken place in real time, has improved the promptness that detects, thereby has reduced the potential safety hazard of equipment.
At last, also need to prove, in this article, relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint and have the relation of any this reality or in proper order between these entities or the operation.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby make and comprise that process, method, article or the equipment of a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or also be included as this process, method, article or equipment intrinsic key element.Do not having under the situation of more restrictions, the key element that limits by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential hardware platform, can certainly all implement, but the former is better execution mode under a lot of situation by hardware.Based on such understanding, all or part of can the embodying that technical scheme of the present invention contributes to background technology with the form of software product, this computer software product can be stored in the storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be a personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
More than the present invention is described in detail, used specific case herein principle of the present invention and execution mode set forth, the explanation of above embodiment just is used for help understanding method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.