The message queue processing method of scheduling system
Technical field
The invention belongs to communication technique fields, more particularly, to a kind of message queue processing method of scheduling system.
Background technique
In scheduling operation system, message queue is the container that message is saved in the transmission process of message, message queue
Main purpose be to provide routing and guarantee the transmitting of message, communicated between all nodes by message, the tune of message queue
Degree strategy has vital effect to the operation of entire cluster.Scheduling operation message, scheduling in traditional scheduling operation system
Message queue is added according to time order and function relationship in response message and module response message, message processing module from message queue therefrom
Message is obtained to be handled, the scheduling strategy design of this kind of mode message queue is unreasonable, for two different disposal ranks but
It is that the message being simultaneously emitted by can not accomplish quickly to respond high-priority message, and receive a low priority and disappear
Breath, receives a high-priority message, two message are operated to identical member, and existing scheduling system can first be located at once
Low priority message is managed, receives high-priority message, the operation before covering does not have wherein there is original low priority message
There is necessity of processing, and need to do the rollback operation of low priority message before handling the covering operation of high-priority message, greatly
Increase the complexity of system greatly, and message be assigned in the more message handling task of message to be processed or priority ratio compared with
In low message handling task, block then this may result in timely message in the more message handling task of message to be processed
In or the lower message handling task of priority in, and then lead to timely message time-out or processing not in time, timely message obtains not
To rapid processing, the operational efficiency for eventually leading to entire scheduling operation system is affected.
Of the existing technology in order to solve the problems, such as, people have carried out long-term exploration, propose miscellaneous solution
Scheme.For example, Chinese patent literature discloses a kind of method and device application number that timely message is handled in time:
200910087065.3], this method includes:Message to be processed is divided into timely message and non-timely message, and respectively will
Timely message and non-timely message are inserted correspondingly into the message queue of message handling task;Judge be in message handling task
It is no to contain pending timely message, when containing pending timely message, then improve the priority of the message handling task;
The message handling task is handled timely message to be processed according still further to the priority after raising.Correspondingly, the present invention mentions
For a kind of device that timely message is handled in time, including:Message queue creation module, scheduler task module and message handling task
Module.
Above scheme solves the problems, such as that message can not be handled in time in existing message queue to a certain extent, but should
Scheme still remains:Treatment process is cumbersome, and response speed is low, the high problem of system resource.
Summary of the invention
Regarding the issue above, the present invention provides it is a kind of simple and reasonable, the good scheduling system of stability
Message queue processing method.
In order to achieve the above objectives, present invention employs following technical proposals:The message queue processing method of this scheduling system,
It is characterized in that, this method includes the following steps:
A, message is received:The message sent by the access terminal of scheduling system is received, the message has the first mark
Label and the second label, wherein the priority of the first tag characterization type of message and the first different labels is different, the second label list
The priority of this message in the type message is levied, the priority of first label is higher than the priority of the second label;
B, message queue is formed:Message is arranged successively to be formed according to priority according to the first label and the second label
Message queue;
C, message call:Message processing module therefrom obtains message from message queue and is handled.
This method is able to achieve the summary responses of scheduling system usage scenario, sends out for two different disposal ranks but simultaneously
Message out, which is able to achieve, quickly responds high-priority message, improves the response speed of system, reduces system
Resource improves the stability of system.
In the message queue processing method of above-mentioned scheduling system, when receiving same type message and priority is higher than
When the priority of the first message of the type, before current message is inserted in the first message of described the type, current message is then judged
Whether it is to be operated to identical member with first message, if identical member, then abandons the first message of described the type;If
For different members, then retain the first message of described the type.When receiving a low priority message, it is preferential that a height is received at once
Grade message, and when two message are to identical member, can first handle high-priority message, after the low priority message that receives then
It directly abandons, improves system performance, reduce the complexity of system, and the sequence problem that identical message different operation is introduced
Improved well.
In the message queue processing method of above-mentioned scheduling system, first label include dispatching response label,
Module responsive tags and scheduling operation label, wherein dispatching response label is the first priority, and module responsive tags are second
Priority, scheduling operation label are third priority.
In the message queue processing method of above-mentioned scheduling system, second label is dynamic labels.
In the message queue processing method of above-mentioned scheduling system, when a new message is received, calculated using Hash lookup
Method is according to the first label pointer corresponding with the second label lookup, by the new information insertion message queue.
Compared with prior art, the advantages of message queue processing method of this scheduling system, is:Multiple client into
The case where being obviously improved the response speed of system when row automatic operation, having reduced system resource, call out improves system
Stability realizes the summary responses of scheduling system usage scenario.
Detailed description of the invention
Fig. 1 is structural block diagram when receiving message in the present invention.
Fig. 2 is structural block diagram when forming message queue in the present invention.
Structural block diagram when Fig. 3 is message call in the present invention.
In figure, message 1, message queue 2, message processing module 3, dispatching response label B, the first priority scheduling response mark
Sign B1, the second priority scheduling responsive tags B2, module responsive tags C, the first priority block responsive tags C1, second preferentially
Grade module responsive tags C2, scheduling operation label A, the first priority scheduling operation label A 1, the second priority scheduling operation mark
Sign A2, pointer P.
Specific embodiment
The present invention will be further described in detail with reference to the accompanying drawings and detailed description.
As shown in Figure 1-3, the message queue processing method of this scheduling system, includes the following steps:A, message is received:It receives
The message 1 sent by the access terminal of scheduling system, message 1 has the first label and the second label, wherein the first label list
It levies 1 type of message and the priority of the first different labels is different, this message 1 is excellent in second tag characterization the type message 1
First grade, the priority of the first label are higher than the priority of the second label;B, message queue is formed:It is marked according to the first label and second
Message 1 is arranged successively to form message queue 2 according to priority by label;C, message call:Message processing module 3 is from message team
Column 2 therefrom obtain message 1 and are handled, and this method is able to achieve the summary responses of scheduling system usage scenario, for two differences
The message 1 that processing rank is still simultaneously emitted by, which is able to achieve, quickly responds high-priority message 1, improves system
Response speed reduces system resource, improves the stability of system.
Specifically, in the present embodiment, it is higher than the first message 1 of the type when receiving same type message 1 and priority
When priority, before current message 1 is inserted in the first message 1 of described the type, then judge that current message 1 is with first message 1
No is to operate to identical member, if identical member, is then abandoned the first message 1 of described the type;If different members,
Then retain the first message 1 of described the type, i.e., ought receive a low priority message 1, receives a high-priority message at once
1, and when two message 1 are to identical member, can first handle high-priority message 1, after the low priority message 1 that receives it is then straight
Discarding is connect, system performance is improved, reduces the complexity of system, and the sequence problem that 1 different operation of identical message is introduced
Improved well.
Wherein, the first label in the present embodiment includes dispatching response label B, module responsive tags C and scheduling operation
Label A, wherein dispatching response label B is the first priority, and module responsive tags C is the second priority, scheduling operation label A
For third priority, the second label here is dynamic labels.Assuming that according to the second label, dispatching response label B, module response
Two priority are all had in label C and scheduling operation label A, then dispatching response label B here is divided into the first priority
Dispatching response label B 1 and the second priority scheduling responsive tags B2;Module responsive tags C points respond for the first priority block
Label C 1 and the second priority block responsive tags C2;Scheduling operation label A is divided into the first priority scheduling operation 1 He of label A
Second priority scheduling operates label A 2.
When receiving new information 1, it is assumed that pointer P is directed toward dispatching response label B and is directed toward the response of the second priority scheduling
Label B 2 then, according to the first label pointer P corresponding with the second label lookup, is newly disappeared using using Hash lookup algorithm by described
1 insertion message queue 2 of breath.
Specific embodiment described herein is only an example for the spirit of the invention.The neck of technology belonging to the present invention
The technical staff in domain can make various modifications or additions to the described embodiments or replace by a similar method
In generation, however, it does not deviate from the spirit of the invention or beyond the scope of the appended claims.
Although message 1, message queue 2, message processing module 3, dispatching response label B, first is used more herein
Priority scheduling responsive tags B1, the second priority scheduling responsive tags B2, module responsive tags C, the first priority block are rung
Answer label C 1, the second priority block responsive tags C2, scheduling operation label A, the first priority scheduling operation label A 1, second
Priority scheduling operates the terms such as label A 2, pointer P, but it does not exclude the possibility of using other terms.Use these terms
It is only for the convenience of describing and explaining the nature of the invention;Be construed as any additional limitation all and be with
What spirit of that invention was disagreed.