CN102594691B - A kind of method and device handling message - Google Patents

A kind of method and device handling message Download PDF

Info

Publication number
CN102594691B
CN102594691B CN201210041923.2A CN201210041923A CN102594691B CN 102594691 B CN102594691 B CN 102594691B CN 201210041923 A CN201210041923 A CN 201210041923A CN 102594691 B CN102594691 B CN 102594691B
Authority
CN
China
Prior art keywords
message
queue
team
priority
processing
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.)
Active
Application number
CN201210041923.2A
Other languages
Chinese (zh)
Other versions
CN102594691A (en
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 CN201210041923.2A priority Critical patent/CN102594691B/en
Publication of CN102594691A publication Critical patent/CN102594691A/en
Application granted granted Critical
Publication of CN102594691B publication Critical patent/CN102594691B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention provides a kind of method and device for handling message, this method comprises: after the message received, judge whether current cache reaches alarming threshold, if reaching the alarming threshold, whether the type for then judging the message is designated high priority, if so, carrying out processing of joining the team to the message, the message is otherwise abandoned.It through the invention can be preferential to guarantee transmitting without discarding low latency for high priority message effectively in the case where network congestion.

Description

A kind of method and device handling message
Technical field
The present invention relates to data communication field more particularly to a kind of method and apparatus for ensuring high priority message.
Background technique
In data communication field, the requirement to data product QoS (Quality of Service, service quality) performance is got over Come higher.The maximum bandwidth processing ability of traffic management chip, the hardness index such as number of queues of support are directly determined to caching The requirement of capacity.
In actual application, due to the influence of the factors such as single board design area, chip pin quantity, determine in chip It can not unlimited plug-in storage chip greatly in design.Most common solution is caching shared mechanism, i.e., entire system Data packet is stored entirely in the list structure as unit of queue in uniting, and it is one that the packet for belonging to the same queue is connected by pointer A chained list.When storing in the buffer, priority is not distinguished between different queue, can arbitrarily be stored within the scope of shared buffer memory.
Fig. 1 is that the message of the prior art manages schematic diagram, it is assumed that has 5 data message queues, is q1, q2, q3, q4 respectively And q5, the priority of queue is q1 highest, and q5 is minimum, i.e. q1 > q2 > q3 > q4 > q5.Firstly, the sequence of joining the team of data message Q5, q3, q1, q2, q4 are shown such as 101, into system after data be stored in shared buffer memory 102, wherein shown in shared buffer memory 102 Buffer-q1~Buffer-q5 indicates that this 5 queues occupy the size of shared buffer memory spatial content respectively, does not represent and is caching In actual storage mode and storage location.Scheduler 103 is scheduled out team, final report according to the height of queue priority Literary output sequence is q1, q2, q3, q4, q5 as shown at 104.Compare Buffer-q1 and Buffer-q5 it can be found that queue occupies Memory space with queue priority be not related.It is when network generation congestion, i.e., low when rate of discharge is less than inlet flow rate The team that goes out of priority query will receive limitation, but continue to join the team with low priority message, and Low Priority Queuing occupies slow Depositing space can further increase, and most harsh conditions are that Low Priority Queuing has seized all spatial caches, lead to high priority report Text can not join the team and abandon.It is that (N is any nature greater than 1 or more for N number of queue that the trafficmanagementmodel of above example, which changes into, Number) set up.In a data network, some messages are not allow discarding, such as protocol massages, are illustrated below for convenience, this It is to ensure high priority message that text, which unitedly calls such message, and other messages are referred to as common message accordingly.
Based on the above analysis, under existing storage organization, not can avoid if the caching between queue is mutually seized, It will necessarily cause the serious packet loss phenomenon in network, how guarantee to ensure high priority message under this network congestion Transmission, lacks corresponding settlement mechanism in the prior art.
Summary of the invention
The technical problem to be solved in the present invention is to provide it is a kind of handle message method and device, with number of queues increasingly Increase and cache and seize in the flow management system got worse, occurring, which can guarantee in the case where network congestion, ensures high priority Message is transmitted without loss.
In order to solve the above-mentioned technical problems, the present invention provides a kind of methods for handling message, comprising:
After the message received, judge whether current cache reaches alarming threshold, if reaching the alarming threshold, judges Whether the type of the message is designated high priority, if so, carrying out processing of joining the team to the message, otherwise abandons the report Text.
Further, the above method also has the characteristics that following:
The alarming threshold is less than largest buffered capability value.
Further, the above method also has the characteristics that following:
If the message carries high priority mark, determine the type of the message for designated high priority.
Further, the above method also has the characteristics that following: described to include: to the message processing that join the team
Whether the caching depth of the specified high-priority queue of judgement is more than preconfigured quene threshold, if not exceeded, Then the message is joined the team to the high-priority queue;If being more than, the message is abandoned.
Further, the above method also has the characteristics that following: after the processing of joining the team, further including team's processing out, is executing Include: during team's processing out
Judge whether there is the high-priority queue, and if it exists, the then report in high-priority queue described in priority scheduling Text.
Further, the above method also has the characteristics that following: after the processing of joining the team, further including team's processing out, is executing Include: during team's processing out
The queue of team to be gone out is grouped with high-priority queue and non-high priority queue, priority scheduling high priority Queue in set of queues.
To solve the above-mentioned problems, the present invention also provides a kind of devices for handling message, comprising:
Judgment module after the message for receiving, judges whether current cache reaches alarming threshold, judges the message Type whether be designated high priority;
It joins the team processing module, for reaching the alarming threshold, and the type of the message in judgment module judgement In the case where being designated high priority, processing of joining the team is carried out to the message;
Discard processing module, for reaching the alarming threshold, and the type of the message in judgment module judgement In the case where for non-designated high priority, the message is abandoned.
Further, above-mentioned apparatus also has the characteristics that following:
The judgment module is by judging whether the message carries high priority mark, to determine the message Whether type is designated high priority.
Further, above-mentioned apparatus also has the characteristics that following:
The processing module of joining the team, specifically for judging whether the caching depth of specified high-priority queue is more than preparatory The quene threshold of configuration, if not exceeded, then the message is joined the team to the high-priority queue;If being more than, described in discarding Message.
Further, above-mentioned apparatus also has the characteristics that following: further include:
Team's processing module out, for judging whether there is the high-priority queue, and if it exists, then height described in priority scheduling Message in priority query.
Further, above-mentioned apparatus also has the characteristics that following: further include:
Team's processing module out, for being divided the queue of team with high-priority queue and non-high priority queue Group, the queue in priority scheduling high-priority queue group.
To sum up, the present invention provides a kind of method and device for handling message, can be excellent effectively in the case where network congestion First guarantee transmitting without discarding low latency for high priority message.
Detailed description of the invention
Attached drawing is used to provide further understanding of the present invention, and constitutes part of specification, with reality of the invention It applies example to be used to explain the present invention together, not be construed as limiting the invention.
Fig. 1 is that the message of the prior art manages schematic diagram;
Fig. 2 is a kind of flow chart of the method for processing message of the embodiment of the present invention;
Fig. 3 is the flow chart of the method for the exemplary processing message of one application of the present invention;
Fig. 4 is the schematic diagram that the buffer threshold of the present embodiment configures;
Fig. 5 is a kind of schematic diagram of device for handling message provided in an embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Fig. 2 is a kind of flow chart of the method for processing message of the embodiment of the present invention, as shown in Fig. 2, the side of the present embodiment Method includes below step:
After S11, the message received, judge whether current cache reaches alarming threshold, if reaching the alarming threshold, Execute step S12;It is normal to handle message if the not up to described alarming threshold;
Whether S12, the type for judging the message are designated high priority, if so, thening follow the steps S13, are otherwise abandoned The message;
S13, processing of joining the team is carried out to the message.
Fig. 3 is the flow chart of the method for the exemplary processing message of one application of the present invention, as shown in figure 3, including below step:
Step S201 configures queue buffer threshold, comprising common queue and ensures high-priority queue;
Queue buffer threshold refers to the caching depth for allowing at most to occupy of queue assignment, and each queue is according to actual system System demand allows to configure different threshold values.
High-priority queue, common queue thresholding execute be the first order judgement, the first order judgement for allow when execute If the second level judgement reach largest buffered thresholding so either high priority or common queue will packet loss, if reached The necessary packet loss of system-level thresholding common queue message, high-priority queue are then not involved in system-level thresholding judgement
Step S202 configures system-level buffer threshold;
System-level buffer threshold needs to be arranged according to the largest buffered capacity being arranged in whole system one and is less than maximum delay Deposit the value of capacity.
Fig. 4 is the schematic diagram that the buffer threshold of the present embodiment configures, and system-level buffer threshold Configuration Values need to be less than maximum slow Capacity is deposited, entire spatial cache is divided into two parts by system-level buffer threshold: being general lower than the part of system-level buffer threshold Spatial cache 21, common message queue and ensures that high priority message queue can occupy;Higher than the portion of system-level buffer threshold It is divided into the exclusive spatial cache 22 for ensuring high priority message.
The message for ensuring self-contained high priority mark when high priority message refers into system, by this mark come Differentiation is to ensure that high priority message and common message.
When caching surplus in systems is abundant, high priority message and common message can be according to the queues of each self-configuring Depth execution is joined the team or is abandoned, high when the caching in system Buffer reaches alarming threshold (i.e. system-level buffer threshold) Priority packet ensures that mechanism function starts, and the anticipation for carrying out common message abandons the caching for preferentially to meet high priority message Occupancy demand.
Step S203, system receive message, read queue current cache depth;
Step S204 judges that queue caches depth, is more than that configured threshold executes S208, no to then follow the steps S205;
Step S205 judges whether type of message is high priority message, if so, S209 is executed, if not high preferential Grade message, is common message, then executes S206;
Step S206 reads system-level caching depth;
Step S207 judges system-level caching depth, more than the system-level buffer threshold of configuration, adjudicates the message and is unsatisfactory for It joins the team condition, then executes S208, otherwise adjudicate message satisfaction and join the team condition, execute step S209;
Step S208, dropping packets;
Step S209, into caching Buffer storage;
Step S210 safeguards queue depth according to message length;
Step S211, maintenance system depth;
Step S212 executes processing of joining the team, and applies for idle spatial cache, and message is stored in caching Buffer, Suo Youman The queue that foot goes out team's condition, which is lined up, enters team's process flow;
Step S213 executes out team's scheduling;
The queue for needing team out is divided into two groups: ensuring that high-priority queue group and common queue group, priority scheduling are true Protect the queue in high-priority queue group.Only when ensuring that all scheduling is completed just to allow to adjust for message in high-priority queue group Spend the message in common queue group.All messages for being allowed to out team are read from caching Buffer according to the information for going out team's message Message output, release queue cache and update the queue depth of the queue.
Carry out high priority message and common packet go out team be to ensure that high priority message without packet loss, low time delay one Kind added machinery, RR (round-robin method) scheduling mechanism is carried out in the queue in high priority message group, in common message group In queue carry out RR scheduling, realize priority scheduling between two groups.
Step S214 discharges system cache;
Step S215, release queue caching.
Fig. 5 is a kind of schematic diagram of device for handling message provided in an embodiment of the present invention, as shown in figure 5, the present embodiment Device include:
Judgment module 301 after the message for receiving, judges whether current cache reaches alarming threshold, described in judgement Whether the type of message is designated high priority;
Processing module of joining the team 303, for reaching the alarming threshold, and the class of the message in judgment module judgement In the case that type is designated high priority, processing of joining the team is carried out to the message;
Discard processing module 302, for reaching the alarming threshold, and the class of the message in judgment module judgement In the case that type is non-designated high priority, the message is abandoned.
The device of the present embodiment can also include:
Team's processing module 304 out, for judging whether there is the high-priority queue, and if it exists, then priority scheduling institute State the message in high-priority queue.
The team that goes out that team's processing module 304 is used to complete message out dispatches, and according to the priority attribute of message queue, executes height Priority first dispatches out the scheduling rule that team is dispatched out after team, low priority, it is ensured that high priority message goes out team completely, without losing It abandons.
Wherein, the judgment module 301 is by judging whether the message carries high priority mark, to determine Whether the type for stating message is designated high priority.
Wherein, the processing module 303 of joining the team, specifically for judge specified high-priority queue caching depth whether More than preconfigured quene threshold, if not exceeded, then the message is joined the team to the high-priority queue;If being more than, Abandon the message.
The device of the present embodiment can also include:
Cache module 306, for storing the message data joined the team;
Cache depth maintenance module 305, for the caching depth of maintenance packet queue, using as grant judgement of joining the team according to According to.
Those of ordinary skill in the art will appreciate that all or part of the steps in the above method can be instructed by program Related hardware is completed, and described program can store in computer readable storage medium, such as read-only memory, disk or CD Deng.Optionally, one or more integrated circuits can be used also to realize in all or part of the steps of above-described embodiment.Accordingly Ground, each module/unit in above-described embodiment can take the form of hardware realization, can also use the shape of software function module Formula is realized.The present invention is not limited to the combinations of the hardware and software of any particular form.
The above is only a preferred embodiment of the present invention, and certainly, the invention may also have other embodiments, without departing substantially from this In the case where spirit and its essence, those skilled in the art make various corresponding changes in accordance with the present invention And deformation, but these corresponding changes and modifications all should fall within the scope of protection of the appended claims of the present invention.

Claims (8)

1. a kind of method for handling message, comprising:
Configure queue buffer threshold and system-level buffer threshold;
After the message received, queue current cache depth is read;
When judging that the caching depth is more than the queue buffer threshold, dropping packets;
Otherwise, judge whether type of message is designated high priority message;
It is that processing of joining the team is carried out to the message;
Otherwise, system-level caching depth is read;
When judging that the system-level caching depth is more than the system-level buffer threshold, dropping packets;
Otherwise, processing of joining the team is carried out to the message.
2. the method as described in claim 1, it is characterised in that:
If the message carries high priority mark, determine the type of the message for designated high priority.
3. the method as described in claim 1, it is characterised in that: after the processing of joining the team, further include team's processing out, executing out Include: during team's processing
Judge whether there is the high-priority queue, and if it exists, the then message in high-priority queue described in priority scheduling.
4. the method as described in claim 1, it is characterised in that: after the processing of joining the team, further include team's processing out, executing out Include: during team's processing
The queue of team to be gone out is grouped with high-priority queue and non-high priority queue, priority scheduling high-priority queue Queue in group.
5. a kind of device for handling message, comprising:
Configure the module of queue buffer threshold and system-level buffer threshold;
After the message received, the module of queue current cache depth is read;
When judging that the caching depth is more than the queue buffer threshold, the module of dropping packets;
When judging that the caching depth is less than the queue buffer threshold, judge whether type of message is designated high priority report The module of text;
When judging that type of message is designated high priority message, the message join the team the module of processing;
When to judge type of message not be designated high priority message, the module of system-level caching depth is read;
Judge that the system-level caching depth is more than the module of the system-level buffer threshold;
When judging that the system-level caching depth is more than the system-level buffer threshold, the module of dropping packets;
When judging that the system-level caching depth is less than the system-level buffer threshold, processing of joining the team is carried out to the message Module.
6. device as claimed in claim 5, it is characterised in that:
By judging whether the message carries high priority mark, to determine whether the type of the message is specified Gao You First grade.
7. device as claimed in claim 5, it is characterised in that: further include:
Team's processing module out, for judging whether there is the high-priority queue, and if it exists, then height described in priority scheduling is preferential Message in grade queue.
8. device as claimed in claim 5, it is characterised in that: further include:
Team's processing module out, it is excellent for the queue of team to be gone out to be grouped with high-priority queue and non-high priority queue Queue in first schedules high priority set of queues.
CN201210041923.2A 2012-02-23 2012-02-23 A kind of method and device handling message Active CN102594691B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210041923.2A CN102594691B (en) 2012-02-23 2012-02-23 A kind of method and device handling message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210041923.2A CN102594691B (en) 2012-02-23 2012-02-23 A kind of method and device handling message

Publications (2)

Publication Number Publication Date
CN102594691A CN102594691A (en) 2012-07-18
CN102594691B true CN102594691B (en) 2019-02-15

Family

ID=46482907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210041923.2A Active CN102594691B (en) 2012-02-23 2012-02-23 A kind of method and device handling message

Country Status (1)

Country Link
CN (1) CN102594691B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014059576A1 (en) * 2012-10-15 2014-04-24 华为技术有限公司 Method for processing request message, sending method, node and system thereof
CN106330758A (en) * 2015-06-19 2017-01-11 中兴通讯股份有限公司 Transfer method and device based on multilayer queue fluid control back pressure
CN105812285A (en) * 2016-04-29 2016-07-27 华为技术有限公司 Port congestion management method and device
CN107454014A (en) * 2016-05-30 2017-12-08 中兴通讯股份有限公司 A kind of method and device of Priority Queuing
JP6664495B2 (en) * 2016-08-08 2020-03-13 三菱電機株式会社 Transmission device, system control device, train transmission system and transmission method
CN108632169A (en) * 2017-03-21 2018-10-09 中兴通讯股份有限公司 A kind of method for ensuring service quality and field programmable gate array of fragment
CN107959637A (en) * 2017-10-23 2018-04-24 新华三技术有限公司 Message caching method and device
CN109729014B (en) * 2017-10-31 2023-09-12 深圳市中兴微电子技术有限公司 Message storage method and device
CN108173784B (en) * 2017-12-29 2021-12-28 湖南恒茂高科股份有限公司 Aging method and device for data packet cache of switch
CN116418757A (en) * 2018-12-12 2023-07-11 深圳市中兴微电子技术有限公司 Congestion control method and device, network equipment and storage medium
CN111355673A (en) * 2018-12-24 2020-06-30 深圳市中兴微电子技术有限公司 Data processing method, device, equipment and storage medium
CN110493145B (en) * 2019-08-01 2022-06-24 新华三大数据技术有限公司 Caching method and device
CN113206800B (en) * 2021-03-15 2022-05-27 新华三信息安全技术有限公司 Message caching method and device and network equipment
CN113923169A (en) * 2021-10-11 2022-01-11 浙江大华技术股份有限公司 Message filtering method and device, storage medium and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616097A (en) * 2009-07-31 2009-12-30 中兴通讯股份有限公司 A kind of management method of output port queue of network processor and system
CN102025638A (en) * 2010-12-21 2011-04-20 福建星网锐捷网络有限公司 Data transmission method and device based on priority level as well as network equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100512218C (en) * 2006-03-10 2009-07-08 杭州华三通信技术有限公司 Transmitting method for data message
CN101800699A (en) * 2010-02-09 2010-08-11 上海华为技术有限公司 Method and device for dropping packets

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616097A (en) * 2009-07-31 2009-12-30 中兴通讯股份有限公司 A kind of management method of output port queue of network processor and system
CN102025638A (en) * 2010-12-21 2011-04-20 福建星网锐捷网络有限公司 Data transmission method and device based on priority level as well as network equipment

Also Published As

Publication number Publication date
CN102594691A (en) 2012-07-18

Similar Documents

Publication Publication Date Title
CN102594691B (en) A kind of method and device handling message
TWI510030B (en) System and method for performing packet queuing on a client device using packet service classifications
EP2677703A2 (en) Method and device for scheduling queue
JP5863076B2 (en) Method, apparatus, and system for reconstructing and reordering packets
CN101694631B (en) Real time job dispatching patcher and method
CN110493145A (en) A kind of caching method and device
CN109697122B (en) Task processing method, device and computer storage medium
US9152482B2 (en) Multi-core processor system
US8428076B2 (en) System and method for priority scheduling of plurality of message types with serialization constraints and dynamic class switching
WO2017000657A1 (en) Cache management method and device, and computer storage medium
CN108337188A (en) The traffic and the management of Load-aware dynamic queue
CN106612236A (en) Many-core network processor and micro engine message scheduling method and micro engine message scheduling system thereof
US8295305B2 (en) Dual scheduling of work from multiple sources to multiple sinks using source and sink attributes to achieve fairness and processing efficiency
CN103338157A (en) Internuclear data message caching method and equipment of multinuclear system
CN113312160A (en) Techniques for behavioral pairing in a task distribution system
CN107528789A (en) Method for dispatching message and device
CN109688070A (en) A kind of data dispatching method, the network equipment and retransmission unit
CN104935636A (en) Network channel acceleration method and system
CN109660468A (en) A kind of port congestion management method, device and equipment
CN102984083B (en) queue management method and device
US8018958B1 (en) System and method for fair shared de-queue and drop arbitration in a buffer
US9344384B2 (en) Inter-packet interval prediction operating algorithm
US9128771B1 (en) System, method, and computer program product to distribute workload
US9304706B2 (en) Efficient complex network traffic management in a non-uniform memory system
CN102281202A (en) Dispatching method, server 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
GR01 Patent grant
GR01 Patent grant