CN101599987A - message queue management method and device - Google Patents

message queue management method and device Download PDF

Info

Publication number
CN101599987A
CN101599987A CNA2008101112634A CN200810111263A CN101599987A CN 101599987 A CN101599987 A CN 101599987A CN A2008101112634 A CNA2008101112634 A CN A2008101112634A CN 200810111263 A CN200810111263 A CN 200810111263A CN 101599987 A CN101599987 A CN 101599987A
Authority
CN
China
Prior art keywords
message
priority
threshold value
message queue
situation
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
CNA2008101112634A
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNA2008101112634A priority Critical patent/CN101599987A/en
Publication of CN101599987A publication Critical patent/CN101599987A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a kind of message queue management method and device, wherein, this method comprises: step S102 is provided with one or more threshold values of message count in the message queue; Step S104, adjustment is used for receiving the priority of the message sink task of message queue message according to threshold value.The application of the invention can improve message and send success rate, reduces message retransmission and reduces to the performance that system brings, and replys the overtime response speed that improves system thereby reduce, and has improved the embedded system message handling ability.

Description

Message queue management method and device
Technical field
The present invention relates to the embedded system field, and especially, relate to a kind of message queue management method and device.
Background technology
Because having message and the message boundaries of transmitting different length, message queue do not need user management, so all take the mode of message queue to communicate between the task of a lot of embedded devices.
Yet, under the situation that the employing message queue communicates, when creating message queue, must specify the maximum of depositing message in this message queue, and, if message count has reached maximum, send message to this message queue again and will return failure information.Reach under the peaked situation in message count, the task that must receive message is by the time taken message away and is made when message number is less than maximum in the message queue, and the transmission task just can send success.
Because consider the problem such as ageing of the effective utilization rate of resource of system and message, the capacity of message queue can not be excessive.But, if the message queue capacity is little, the situation of queue full just appears easily, the problem that causes above-mentioned transmission message failure, and message will be sent out several times even tens ability send successfully sometimes, thereby causes a large amount of wastes of system resource, has reduced the ability of system handles message.
Yet,, effective solution is not proposed as yet at present at the full problem that is caused of message queue to formation transmission message failure.
Summary of the invention
Consider the problems referred to above and make the present invention, for this reason, main purpose of the present invention is to provide a kind of message queue administrative mechanism, to solve the very easy full problem to formation transmission message failure that therefore causes of message queue in the correlation technique.
According to embodiments of the invention, provide a kind of message queue management method.
This method comprises: one or more threshold values that message count in the message queue is set; Adjustment is used for receiving the priority of the message sink task of message queue message according to threshold value.
Wherein, the threshold value of setting comprises sending threshold value and receive threshold, and wherein, sending threshold value is greater than receive threshold.
And the processing of adjusting the priority of message sink task according to sending threshold value and receive threshold is specially: under the situation of message count greater than sending threshold value, improve the priority of message sink task according to pre-defined rule in message queue; Perhaps in message queue under the situation of message count less than receive threshold, the priority of message sink task is reduced to its original priority.
On the other hand, under the situation that a threshold value only is set, the processing of adjusting the priority of message sink task is specially: under the situation of message count greater than threshold value, improve the priority of message sink task according to pre-defined rule in message queue; Perhaps in message queue under the situation of message count less than threshold value, the priority of message sink task is reduced to its original priority.
According to another embodiment of the present invention, provide a kind of message queue management devices.
This device comprises: module is set, is used for being provided with one or more threshold values of message queue message count; Adjusting module is used for the priority that according to threshold value adjustment is used to receive the message sink task of message queue message.
Wherein, comprise sending threshold value and receive threshold by the threshold value that the module setting is set, wherein, sending threshold value is greater than receive threshold.
And adjusting module is specially according to the processing of the priority of sending threshold value and receive threshold adjustment message sink task: under the situation of message count greater than sending threshold value, adjusting module improves the priority of message sink task according to pre-defined rule in message queue; Perhaps in message queue under the situation of message count less than receive threshold, adjusting module is reduced to its original priority with the priority of message sink task.
On the other hand, be provided with under the situation that module only is provided with a threshold value, the processing that adjusting module is adjusted the priority of message sink task is specially: under the situation of message count greater than threshold value, adjusting module improves the priority of message sink task according to pre-defined rule in message queue; Perhaps in message queue under the situation of message count less than threshold value, adjusting module is reduced to its original priority with the priority of message sink task.
By technique scheme of the present invention, can improve message and send success rate, reduce message retransmission and reduce to the performance that system brings, reply the overtime response speed that improves system thereby reduce, improved the embedded system message handling ability.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 is the flow chart according to the message queue management method of the inventive method embodiment;
Fig. 2 is according to the process chart that improves the message sink task priority in the method for the inventive method embodiment;
Fig. 3 is according to the process chart that reduces the message sink task priority in the method for the inventive method embodiment; And
Fig. 4 is the block diagram according to the message queue management devices of apparatus of the present invention embodiment.
Embodiment
Method embodiment
In the present embodiment, provide a kind of message queue management method.Thereby to solve the problem that has caused the system handles message capability to reduce owing to the message transmission failure that forms owing to message queue is full in the embedded system.
As shown in Figure 1, comprise according to the message queue management method of present embodiment: step S102 is provided with one or more threshold values of message count in the message queue; Step S104, adjustment is used for receiving the priority of the message sink task of message queue message according to threshold value.
Under the situation that a threshold value only is set, the processing of adjusting the priority of message sink task is specially: under the situation of message count greater than threshold value, improve the priority of message sink task according to pre-defined rule in message queue; Perhaps in message queue under the situation of message count less than threshold value, the priority of message sink task is reduced to its original priority.
In addition, a plurality of threshold values can also be set, comprise: sending threshold value and receive threshold, wherein, sending threshold value is greater than receive threshold.
And the processing of adjusting the priority of message sink task according to sending threshold value and receive threshold is specially: under the situation of message count greater than sending threshold value, improve the priority of message sink task according to pre-defined rule in message queue; Perhaps in message queue under the situation of message count less than receive threshold, the priority of message sink task is reduced to its original priority.By this two threshold values are set, not only can effectively avoid message queue completely to cause sending failure, and can avoid the priority of frequent task switching.
When improving the priority of message sink task, the pre-defined rule of employing can be predefined task priority method of adjustment.Be used to improve the reception task priority that surpasses the message queue correspondence that sends threshold values, and can judge which priority is task brought up to according to the original priority of task and the message count of message queue.
Fig. 2 shows the handling process that improves the message sink task priority.
As shown in Figure 2, specifically comprise following processing:
(1) obtains the message count of message queue;
(2) judge whether message count surpasses sending threshold value, is being judged as execution in step under the situation that is (3), otherwise execution in step (4);
(3) priority of raising reception task, and execution in step (4);
(4) send a message to message queue.
Fig. 3 shows the processing that reduces message queue priority.
As shown in Figure 3, need at first to judge that whether message count is less than receive threshold, be judged as under the situation that is, whether the priority of judging the message sink task is enhanced, if the priority of this message sink task has been enhanced, then the priority with the message sink task is reduced to the preceding original priority of raising, and must not be lower than original priority.
To be that example is described processing procedure of the present invention in detail below with the situation that two threshold values are set.
In the middle of practical application, specifically can comprise following processing procedure:
(1) at first define threshold values, the setting of threshold values should be satisfied following condition 0<M1<M2<MAXNUM;
M1 is for receiving threshold values, and M2 is for sending threshold values, and MAXNUM is a message queue length.Difference between M1, the M2 can prevent the priority of frequent task switching.And M1 and M2 can be the ratios of the shared message queue total length of message count in the message queue, for example, can be set to 60% by M1, and M2 is set to 80%.
(2) priority computing function of definition.
int?taskPriorityCount
(
Int tid ,/* reception message task ID*/
Int msgNum/* message queue message count */
)
(3) definition modification task sends the method for message, and is specific as follows:
I) obtain the message count tNum of message queue Q1;
Ii) compare tNum and M2;
If iii) tNum>M2 then call that taskPriorityCount calculates and improve the priority of the reception task T1 of Q1 correspondence;
Iv) call and send message function transmission message.
(4) modification task receives the method for message, and is specific as follows:
I) obtain the message count rNum of message queue Q1;
Ii) compare rNum and M1;
If iii) the priority of the reception task T1 of rNum<M1 and Q1 correspondence be not equal to original priority the priority that reduces task to original priority;
Iv) call and receive message function reception message.
Device embodiment
In the present embodiment, provide a kind of message queue management devices.
As shown in Figure 4, the message queue management devices according to present embodiment comprises: module 402 is set, is used for being provided with one or more threshold values of message queue message count; Adjusting module 404 is used for the priority that according to threshold value adjustment is used to receive the message sink task of message queue message.
Wherein, comprise sending threshold value and receive threshold by the threshold value that module 402 settings are set, wherein, sending threshold value is greater than receive threshold.
And, adjusting module 404 is specially according to the processing of the priority of sending threshold value and receive threshold adjustment message sink task: under the situation of message count greater than sending threshold value, adjusting module 404 improves the priority of message sink task according to pre-defined rule in message queue; Perhaps in message queue under the situation of message count less than receive threshold, adjusting module is reduced to its original priority with the priority of message sink task.
On the other hand, be provided with under the situation that module 402 only is provided with a threshold value, the processing that adjusting module 404 is adjusted the priority of message sink task is specially: under the situation of message count greater than threshold value, adjusting module 404 improves the priority of message sink task according to pre-defined rule in message queue; Perhaps in message queue under the situation of message count less than threshold value, adjusting module 404 is reduced to its original priority with the priority of message sink task.
In sum, by means of technical scheme of the present invention, can change the priority of task simply according to the message count of message queue, improve message and send success rate, having reduced message retransmission reduces to the performance that system brings, reply the overtime response speed that improves system thereby reduced, improved the embedded system message handling ability.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a message queue management method is characterized in that, comprising:
One or more threshold values of message count in the message queue are set;
The priority that is used for receiving the message sink task of described message queue message according to described threshold value adjustment.
2. method according to claim 1 is characterized in that, the described threshold value of setting comprises sending threshold value and receive threshold, and wherein, described sending threshold value is greater than described receive threshold.
3. method according to claim 2 is characterized in that, the processing of adjusting the priority of described message sink task according to described sending threshold value and described receive threshold is specially:
In described message queue, under the situation of message count greater than described sending threshold value, improve the priority of described message sink task according to pre-defined rule; Perhaps
In described message queue under the situation of message count less than described receive threshold, the priority of described message sink task is reduced to its original priority.
4. method according to claim 1 is characterized in that, under the situation that a threshold value only is set, the processing of adjusting the priority of described message sink task is specially:
In described message queue, under the situation of message count greater than described threshold value, improve the priority of described message sink task according to pre-defined rule; Perhaps
In described message queue under the situation of message count less than described threshold value, the priority of described message sink task is reduced to its original priority.
5. a message queue management devices is characterized in that, comprising:
Module is set, is used for being provided with one or more threshold values of message queue message count;
Adjusting module is used for being used to receive according to described threshold value adjustment the priority of the message sink task of described message queue message.
6. device according to claim 5 is characterized in that, comprises sending threshold value and receive threshold by the described described threshold value that the module setting is set, and wherein, described sending threshold value is greater than described receive threshold.
7. device according to claim 6 is characterized in that, the processing that described adjusting module is adjusted the priority of described message sink task according to described sending threshold value and described receive threshold is specially:
Under the situation of message count greater than described sending threshold value, described adjusting module improves the priority of described message sink task according to pre-defined rule in described message queue; Perhaps
Under the situation of message count less than described receive threshold, described adjusting module is reduced to its original priority with the priority of described message sink task in described message queue.
8. device according to claim 5 is characterized in that, is provided with under the situation that module only is provided with a threshold value described, and the processing that described adjusting module is adjusted the priority of described message sink task is specially:
Under the situation of message count greater than described threshold value, described adjusting module improves the priority of described message sink task according to pre-defined rule in described message queue; Perhaps
Under the situation of message count less than described threshold value, described adjusting module is reduced to its original priority with the priority of described message sink task in described message queue.
CNA2008101112634A 2008-06-05 2008-06-05 message queue management method and device Pending CN101599987A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008101112634A CN101599987A (en) 2008-06-05 2008-06-05 message queue management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008101112634A CN101599987A (en) 2008-06-05 2008-06-05 message queue management method and device

Publications (1)

Publication Number Publication Date
CN101599987A true CN101599987A (en) 2009-12-09

Family

ID=41421232

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008101112634A Pending CN101599987A (en) 2008-06-05 2008-06-05 message queue management method and device

Country Status (1)

Country Link
CN (1) CN101599987A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101782891A (en) * 2010-03-26 2010-07-21 中兴通讯股份有限公司 Method and system for communication of distributed system
CN101996099A (en) * 2010-11-17 2011-03-30 山东中创软件工程股份有限公司 Method and system for processing information
CN102591658A (en) * 2011-12-28 2012-07-18 奇智软件(北京)有限公司 Method and device for processing message
CN103986668A (en) * 2014-05-28 2014-08-13 浪潮电子信息产业股份有限公司 Maximum priority queue designing method
CN104734983A (en) * 2013-12-24 2015-06-24 中国移动通信集团公司 Scheduling system, method and device for service data request
CN105763608A (en) * 2016-02-05 2016-07-13 浪潮(北京)电子信息产业有限公司 Message processing method used for cloud storage system and device thereof
CN105898404A (en) * 2015-12-14 2016-08-24 乐视云计算有限公司 Priority control method and device of transcoding system
CN109240836A (en) * 2018-09-06 2019-01-18 郑州云海信息技术有限公司 A kind of method and apparatus for configuring the message of message queue
CN110888726A (en) * 2019-11-25 2020-03-17 中冶赛迪重庆信息技术有限公司 Multitask concurrent processing method and system
CN110990147A (en) * 2019-11-12 2020-04-10 中国银联股份有限公司 Method and system for processing task
CN111782395A (en) * 2020-06-30 2020-10-16 北京思特奇信息技术股份有限公司 Message processing shunt control method and system
CN115550280A (en) * 2022-11-24 2022-12-30 云账户技术(天津)有限公司 Multi-level message queue implementation method, system, electronic device and readable storage medium

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101782891B (en) * 2010-03-26 2013-12-11 中兴通讯股份有限公司 Method and system for communication of distributed system
CN101782891A (en) * 2010-03-26 2010-07-21 中兴通讯股份有限公司 Method and system for communication of distributed system
CN101996099A (en) * 2010-11-17 2011-03-30 山东中创软件工程股份有限公司 Method and system for processing information
CN102591658A (en) * 2011-12-28 2012-07-18 奇智软件(北京)有限公司 Method and device for processing message
CN104734983B (en) * 2013-12-24 2018-10-12 中国移动通信集团公司 Scheduling system, the method and device of service data request
CN104734983A (en) * 2013-12-24 2015-06-24 中国移动通信集团公司 Scheduling system, method and device for service data request
CN103986668A (en) * 2014-05-28 2014-08-13 浪潮电子信息产业股份有限公司 Maximum priority queue designing method
CN105898404A (en) * 2015-12-14 2016-08-24 乐视云计算有限公司 Priority control method and device of transcoding system
CN105763608A (en) * 2016-02-05 2016-07-13 浪潮(北京)电子信息产业有限公司 Message processing method used for cloud storage system and device thereof
CN105763608B (en) * 2016-02-05 2019-03-15 浪潮(北京)电子信息产业有限公司 A kind of message treatment method and device for cloud storage system
CN109240836A (en) * 2018-09-06 2019-01-18 郑州云海信息技术有限公司 A kind of method and apparatus for configuring the message of message queue
CN109240836B (en) * 2018-09-06 2020-10-30 苏州浪潮智能科技有限公司 Method and device for configuring messages of message queue
CN110990147A (en) * 2019-11-12 2020-04-10 中国银联股份有限公司 Method and system for processing task
CN110990147B (en) * 2019-11-12 2023-03-28 中国银联股份有限公司 Method and system for processing task
CN110888726A (en) * 2019-11-25 2020-03-17 中冶赛迪重庆信息技术有限公司 Multitask concurrent processing method and system
CN111782395A (en) * 2020-06-30 2020-10-16 北京思特奇信息技术股份有限公司 Message processing shunt control method and system
CN111782395B (en) * 2020-06-30 2024-01-05 北京思特奇信息技术股份有限公司 Shunting control method and system for message processing
CN115550280A (en) * 2022-11-24 2022-12-30 云账户技术(天津)有限公司 Multi-level message queue implementation method, system, electronic device and readable storage medium
CN115550280B (en) * 2022-11-24 2023-03-31 云账户技术(天津)有限公司 Multi-level message queue implementation method, system, electronic device and readable storage medium

Similar Documents

Publication Publication Date Title
CN101599987A (en) message queue management method and device
US9798680B2 (en) Policy control method and apparatus for terminal peripheral
US20080049617A1 (en) System for fine grained flow-control concurrency to prevent excessive packet loss
CN102487494B (en) Short message flow control method and system
CN101877604A (en) Method and system for transmitting files
CN101938414A (en) Method and device for transmitting messages
CN105242547A (en) Linkage method and device of AllJoyn devices
CN103534978A (en) Mass texting method and device
CN105631743A (en) Method and system for ATM transaction real-time traffic control
CN102271077B (en) The resource control method of streaming media server and streaming media server
CN101924679A (en) Message rate-limiting method of Ethernet port, device and data communication device
CN108932182B (en) Message bus performance test method and system
CN104427286A (en) Method and system for making video call
CN102447606A (en) Flow control method and device for data transmission
CN106549876A (en) Based on the method for controlling network congestion of ICAP agreements, device and client
CN101207570A (en) Data transmission method, data sending rate control method and base station
CN1224291C (en) Method for reporting status information between a mobile station and a radio access network
CN102056095B (en) Method, system and device for controlling short message transmitting flow rate
CN104104601A (en) Data transmission method, device and system
CN101237270A (en) A method for the node B to get retransfer interval control information
CN103124400A (en) Short message cache method and system
CN101951571A (en) Short message retrying method and short message gateway
CN102821423B (en) Message method of reseptance and device
CN104660638A (en) Data transmission method and system
CN103179051B (en) A kind of retransmission method of Streaming Media and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20091209