CN104468401B - A kind of message processing method and device - Google Patents
A kind of message processing method and device Download PDFInfo
- Publication number
- CN104468401B CN104468401B CN201410667090.XA CN201410667090A CN104468401B CN 104468401 B CN104468401 B CN 104468401B CN 201410667090 A CN201410667090 A CN 201410667090A CN 104468401 B CN104468401 B CN 104468401B
- Authority
- CN
- China
- Prior art keywords
- message
- queue
- service
- identification
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 22
- 238000012545 processing Methods 0.000 claims abstract description 93
- 238000000034 method Methods 0.000 claims abstract description 31
- 230000008569 process Effects 0.000 claims description 16
- 238000012163 sequencing technique Methods 0.000 claims description 7
- 238000000151 deposition Methods 0.000 claims 1
- 238000004891 communication Methods 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 9
- 238000013461 design Methods 0.000 description 7
- 230000007547 defect Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a kind of message processing method and device, belong to communication technical field.During the present invention in the message to being assigned to by handling, the type of service carried according to message, the queue identity of service queue corresponding with the type of service that message carries is recorded in message descriptor corresponding with message identification, so as to after the completion of to Message processing, message identification is assigned in the service queue with different priority, the output order of message is determined by the priority of the service queue set, since the service queue of highest priority, according to message corresponding to the message identification recorded in each service queue of the Sequential output of priority from high to low;Due to being the service queue in the processing procedure to message according to where the type of service of message determines message, and the priority of outgoing message is provided with to service queue, it is possible to according to the difference of application scenarios, the output order of flexible configuration message.
Description
Technical field
The present invention relates to communication technical field, more particularly to a kind of message processing method and device.
Background technology
With the intensification of social informatization degree, people are more and more stronger to the dependence of internet, are connected on network
The growth of computer node also at double.The network equipments such as interchanger, network processing unit are handed over as the data of computer and internet
Node is changed, its data processing performance determines the performance of whole network.As user connects sharp increase and the Online Video of number
Etc. the appearance of bandwidth applications, the single core processor for being responsible for processing message in the network device is set to be increasingly difficult to meet at a high speed
The performance requirement of data processing, and polycaryon processor relies on the strong characteristic of its computation capability, gradually in network communication field
It is used widely.So-called polycaryon processor, refer to that what is integrated on the network equipments such as interchanger, a network processing unit has
The processor of multiple processor cores, each processor core in polycaryon processor can only once handle a message.Multinuclear
Processor can perform the processing operation of message parallel, meet interconnection by the multiple processor cores to work independently each other
The performance requirement of net high speed data processing.
In the implementation that Message processing is carried out by the network equipment with polycaryon processor that presently, there are:Network is set
The difference of the standby source address that can be forwarded according to message and destination address, just by the message received point before to Message processing
For different message flows, wherein, the source address of record and the multiple messages of destination address identical are received according to the network equipment
Order is put into same message flow.Message processing is finished forward when, according to the network equipment receive message order
Message in same message flow is forwarded.
During the present invention is realized, inventor has found that prior art at least has problems with:
The network equipment, can only be according to Message processing during being forwarded according to the order for receiving message to message
The message sequence recorded in the message flow formed before carries out forwarding operation to the message in same message flow.So to message
Pass-through mode it is relatively fixed, it is impossible to row major is entered according to the different outputs to the message of some types of service of business scenario and examined
Consider.
The content of the invention
In order to solve problem of the prior art, the embodiments of the invention provide a kind of message processing method and device.It is described
Technical scheme is as follows:
In a first aspect, the embodiments of the invention provide a kind of message processing method, methods described includes:
The message received is distributed, according to the reception of message order, the message received is registered to the silent of queue lists
Recognize in queue, wherein, the queue lists also include multiple service queues classified according to different types of service, each institute
Stating service queue has queue identity;
, will be with message according to the type of service of message carrying during the message to being assigned to is handled
The queue identity of the service queue corresponding to the type of service carried is recorded in message description corresponding with message identification
Fu Zhong, wherein, the message identification is that message is distributed during message is registered into default queue;
After the completion of Message processing, according to the queue identity recorded in the message descriptor of the message, by the message
Message identification from default queue is moved to the corresponding service queue of the queue identity with recording;
According to predetermined message output policy, according to the Sequential output report of the message identification recorded in each service queue
Text.
It is described after the completion of Message processing in the first possible implementation of first aspect, according to the message
Message descriptor in the queue identity that records, the message identification of the message is moved to the institute with recording from default queue
Stating step in service queue corresponding to queue identity includes:
Whether the message identification for judging the message that processing is completed is first message identification in the default queue;
If it is determined that the message identification for the message that processing is completed is first message identification in the default queue, then
According to the queue identity recorded in the message descriptor of the message, by first message identification in the default queue
It is moved to from default queue in service queue corresponding with the queue identity recorded.
In second of possible implementation of first aspect, described after the completion of Message processing, according to the report
The queue identity recorded in the message descriptor of text, the institute that the message identification of the message is moved to and recorded from default queue
State in service queue corresponding to queue identity after step, methods described also includes:
The message completed to processing caches.
With reference in second of possible implementation of first aspect and first aspect, the third in first aspect can
In the implementation of energy, in the step of message that described pair of processing is completed caches:
When having at least two processor cores while having handled message, according to completing Message processing simultaneously at least
The order of two processor core numberings, the message for handling completion simultaneously is cached by way of poll.
It is described according to predetermined message output policy in the 4th kind of possible implementation of first aspect, according to each
The Sequential output message step of the message identification recorded in the service queue includes:
When getting the instruction of outgoing message, it is determined that multiple service queues with priority;
It is defeated according to the order of the message identification recorded in the service queue since the service queue of highest priority
Go out in the cache module message cached.
With reference in the 4th kind of possible implementation of first aspect and first aspect, the 5th kind in first aspect can
In the implementation of energy, when there is service queue to be not provided with priority, methods described also includes:
According to the order of the queue identity for the service queue for being not provided with priority, poll exports the institute for being respectively not provided with priority
State message corresponding to first message identification in service queue.
Second aspect, the embodiments of the invention provide a kind of message process device, described device includes:
Distribute module, for distributing the message received, according to the reception of message order, the message received is registered to
In the default queue of queue lists, wherein, the queue lists also include multiple being classified according to different types of service
Service queue, each service queue have queue identity;
Processing module, for the type of service carried according to message, the type of service pair that will be carried with message
The queue identity for the service queue answered is recorded in message descriptor corresponding with message identification, wherein, the message mark
Knowledge is that message is distributed during message is registered into default queue;
Sequencing module, for the queue identity recorded in the message descriptor according to the message, by the report of the message
Text mark is moved in service queue corresponding with the queue identity recorded from default queue;
Output module, for since the service queue of highest priority, according to the report recorded in each service queue
The Sequential output message of text mark.
In the first possible implementation of second aspect, the sequencing module is used for:
Whether the message identification for judging the message that processing is completed is first message identification in the default queue;
If it is determined that the message identification for the message that processing is completed is first message identification in the default queue, then
According to the queue identity recorded in the message descriptor of the message, by first message identification in the default queue
It is moved to from default queue in service queue corresponding with the queue identity recorded.
In second of possible implementation of second aspect, described device also includes:
Cache module, the message for being completed to processing cache.
With reference in second of possible implementation of second aspect and second aspect, the third in second aspect can
In the implementation of energy, in the cache module:
When having at least two processor cores while having handled message, according to completing Message processing simultaneously at least
The order of two processor core numberings, the message for handling completion simultaneously is cached by way of poll.
It is described defeated when there is service queue to be not provided with priority in the 4th kind of possible implementation of second aspect
Go out module to be additionally operable to:
According to the order of the queue identity for the service queue for being not provided with priority, poll exports the institute for being respectively not provided with priority
State message corresponding to first message identification in service queue.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
Message processing method and device provided in an embodiment of the present invention, pass through the mistake handled in the message to being assigned to
Cheng Zhong, the type of service carried according to message, the queue identity of service queue corresponding with the type of service that message carries is remembered
Record is in message descriptor corresponding with message identification, so as to which after the completion of to Message processing, message identification, which is assigned to, to be had
In the service queue of different priority, the output order of message is determined by the priority of the service queue set, from priority most
High service queue starts, according to corresponding to the message identification recorded in each service queue of the Sequential output of priority from high to low
Message;Due to being the service queue in the processing procedure to message according to where the type of service of message determines message, and it is right
Service queue be provided with outgoing message priority, it is possible to according to the difference of application scenarios, flexible configuration message it is defeated
Go out order, moreover, according to the priority of service queue, can be it is determined that carrying the situation of the message prior output of certain type of service
Under, it is possible to the message for directly carrying out this type of service carries out output operation, and avoid it is existing need etc. stay in it is this
The message inputted before first message of the message of type of service after being output could export the defects of.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment
Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings
Accompanying drawing.
Fig. 1 is a kind of structural representation of implementation environment involved by message processing method provided in an embodiment of the present invention;
Fig. 2 is the message processing method flow chart that the embodiment of the present invention one provides;
Fig. 3 is the message processing method flow chart that the embodiment of the present invention two provides;
Fig. 4 is the schematic diagram for setting priority in the message processing method that the embodiment of the present invention two provides to service queue
One;
Fig. 5 is the schematic diagram for setting priority in the message processing method that the embodiment of the present invention two provides to service queue
Two;
Fig. 6 is the schematic diagram for setting priority in the message processing method that the embodiment of the present invention two provides to service queue
Three;
Fig. 7 is the structural representation for the message process device that the embodiment of the present invention three provides;
Fig. 8 is the structural representation for the message process device that the embodiment of the present invention four provides.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Unless otherwise defined, technical term or scientific terminology used herein should be in art of the present invention and had
The ordinary meaning that the personage of general technical ability is understood.Used in present patent application specification and claims " the
One ", " second " and similar word are not offered as any order, quantity or importance, and are used only to distinguish different
Part.Equally, the similar word such as "one" or " one " does not indicate that quantity limits yet, but represents to exist at least one.
Referring to Fig. 1, turn it illustrates one kind involved by message forwarding method provided in an embodiment of the present invention with message
The device of hair and processing function.The environment includes:Multi-core processor 100, distribution module 101, arbitration modules 102, sequence mould
Block 103 and cache module 104.
Wherein, polycaryon processor 100, including multiple processor cores 1 with identical function, processor core 2 ... place
Manage device core n;These processor cores are used for parsing and forwarding the message received;Wherein, processor core has the free time
With busy two states, when processor core is being handled message, then processor core is in busy state;Work as processor
During the untreated message of core, then processor core is in idle state.Distribution module 101 is according to each in polycaryon processor 100
The state of individual processor core, the message received is assigned in the minds of each processor core of idle condition, and to order module
Send the instruction that registration receives message.Arbitration modules 102, there are multiple processor cores to be simultaneously emitted by order to the mould that sorts for working as
During block 103, according to the mark of processor core order, this plurality of order is sent to order module one by one by way of poll
103 are handled;Under normal circumstances, when only getting the order that a polycaryon processor is sent to order module, will directly obtain
The order got is transferred to order module.Order module 103, the message assignment message of registration is identified, and be stored with record report
The queue lists of literary input sequence and output order, wherein, queue lists include a default queue and multiple service queues, write from memory
Queue is recognized by the message identification of recorded message come the input sequence of recorded message, and record has phase respectively in multiple service queues
Mark with the message of type of service records come the output order to message;When needing outgoing message, to cache module
104 send message output order, and control cache module 104 is according to the message sequence recorded in multiple service queues in queue lists
Carry out the output of message.Cache module 104, the message completed to each processor core processing of polycaryon processor cache, and
The outgoing message when receiving the message output order that order module 103 is sent.
Wherein, including multi-core processor 100, distribution module 101, arbitration modules 102, order module 103 and caching mould
Block 104 and with message forwarding and processing function device be usually interchanger either network processing unit.
Embodiment one
The embodiments of the invention provide a kind of message processing method, and referring to Fig. 2, method flow includes:
The message that receives of distribution module distribution of step 200, interchanger, order module according to the reception order of message,
The message received is registered in the default queue of queue lists, wherein, queue lists also include multiple according to different industry
The service queue that service type is classified, each service queue have queue identity.
Wherein, the message that interchanger receives, can be any message for needing to handle in network and forwarding.
Wherein, message is assigned to by the distribution module of interchanger according to the state of each processor core in polycaryon processor
Each processor core of idle condition is handled in the heart.
Step 201, during the message to being assigned to is handled, each processor in the polycaryon processor of interchanger
The type of service that core carries according to message, the queue identity of service queue corresponding with the type of service that message carries is recorded
In message descriptor corresponding with message identification, wherein, message identification is during message is registered into default queue
To message distribution.
Step 202, after the completion of Message processing, what the order module of interchanger recorded in the message descriptor according to message
Queue identity, the message identification of message is moved in service queue corresponding with the queue identity recorded from default queue.
Step 203, since the service queue of highest priority, the cache module of interchanger is according to each industry in order module
The order of the message identification recorded in business queue, export the message of caching.
By above description, during being handled in the message to being assigned to, according to the business of message carrying
Type, the queue identity of service queue corresponding with the type of service that message carries is recorded in message corresponding with message identification
In descriptor, so as to which after the completion of to Message processing, message identification is assigned in the service queue with different priority, report
The output order of text is determined by the priority of the service queue set, since the service queue of highest priority, according to preferential
Message corresponding to the message identification recorded in each service queue of Sequential output of level from high to low;Due to being in the processing to message
During service queue according to where the type of service of message determines message, and the excellent of outgoing message is provided with to service queue
First weigh, it is possible to according to the difference of application scenarios, the output order of flexible configuration message.
Embodiment two
The embodiments of the invention provide a kind of message processing method, and referring to Fig. 3, method flow includes:
The message that receives of distribution module distribution of step 300, interchanger, order module according to the reception order of message,
The message received is registered in the default queue of queue lists, wherein, queue lists also include multiple according to different industry
The service queue that service type is classified, each service queue have queue identity.
Specifically, the flow of step 300 is specifically described by step 3001- steps 3003.
Step 3001, the distribution module of interchanger receive message.
Wherein, the message that interchanger is received, switch processes and the message forwarded are to wait for.Wherein, distribution module is
Decoder.
Alternatively, the equipment that distribution module uses can be not only decoder or other it is existing arbitrarily can be with
The hardware of distribution module function is realized, is no longer repeated one by one here.
Step 3002, the distribution module of interchanger distribute processor core to the message received.
Specifically, the distribution module of interchanger is carried out the message received according to the state of current each processor core
Distribution, wherein, processor core has idle and two states of doing, and when processor core is being handled message, then locates
Manage the state that device core is in busy;When the untreated message of processor core, then processor core is in idle state.Distribution
Module records the state for having each processor core, according to each processor core in polycaryon processor during assignment message
State, the message received is assigned in the minds of each processor core of idle condition.Then distribution module is sent out to order module
Deliver newspaper text register instruction, wherein, in the register instruction of message comprising handle the message processor core processor numbering.
Wherein, each processor core can only once handle a message, and distribution module can only be located to each processor core
The message of reason quantity is allocated.
The message received is registered to queue by step 3003, the reception order according to message, the order module of interchanger
In the default queue of list.
Specifically, the queue lists cached in order module include the default queue of a recorded message reception order;Row
The register instruction for the message that sequence module is sent according to distribution module, message assignment message is identified, then according in register instruction
The processor numbering of the processor core of the processing of the carrying message, establish message mark of the processor numbering with distributing to the message
Message identification, is then put into default queue, completes the registration of message by the first corresponding relation known.
Wherein, message identification is set of number string, for making the order module of interchanger can be with unique identification message.Not
In same interchanger, the allocated message identification of message is different.
Step 301, during the message to being assigned to is handled, each processor in the polycaryon processor of interchanger
The type of service that core carries according to message, the queue identity of service queue corresponding with the type of service that message carries is recorded
In message descriptor corresponding with message identification, wherein, message identification is during message is registered into default queue
To message distribution.
Specifically, each processor core of polycaryon processor is first parsed to message, obtained during message is handled
The type of service carried to message, is traveled through according to the type of service that message carries to the second corresponding relation prestored,
There is the service queue of identical services type so as to find the type of service carried with message recorded in the second corresponding relation
Queue identity, the corresponding relation of generation processor numbering and queue identity, then by the processor of generation numbering and queue mark
The corresponding relation of knowledge is sent to order module, and order module is numbered according to obtained processor and the corresponding relation of queue identity,
Corresponding message identification is found by processor numbering, processor is then numbered what is carried in the corresponding relation with queue identity
Queue identity is recorded in message descriptor corresponding with message identification.
Wherein, the type of service of service queue and the second corresponding pass of queue identity are previously stored with polycaryon processor
System.
Wherein, the division to the type of service of message can be according to any one layer of communication in any layer protocol of network seven
Agreement is divided.If interchanger is that message is divided according to the agreement of Internet, then into the report of the interchanger
The type of service that text carries all is the agreement of Internet;If interchanger is that message is divided according to the agreement of transport layer,
The type of service so carried into the message of the interchanger is all the agreement of transport layer.Such as can be according to the net of Internet
Agreement (the English interconnected between network:Internet Protocol, abbreviation:IP) and internet data packet switching protocol is (English:
Internetwork Packet Exchange protocol, abbreviation:IPX the division of type of service) is carried out to message.
Wherein, queue lists are in addition to including default queue, in addition to multiple are classified according to different types of service
Service queue;Each service queue has queue identity respectively.
Wherein, message descriptor and message identification are one-to-one relations, are stored in advance in order module, for remembering
Used message information during record message is forwarded by the switch.When the message that interchanger receives is registered and is allocated
, will be during record be forwarded by the switch in message descriptor corresponding to allocated message identification after message identification
Used message information.
Wherein, the queue identity recorded in message descriptor is used for the queue mark for the service queue that recorded message is moved to
Know;Queue identity is default value in an initial condition;When being determined that message should be moved in some service queue, just will
The queue identity recorded in the message descriptor of the message is revised as the queue identity numbering of corresponding service queue from default value.
Wherein, if each processor core is during message is handled, do not find corresponding with the type of service of message
Service queue, then it is to retain the queue identity of queue just to change the queue identity recorded in the message descriptor of the message.
Wherein, it is the service queue that queue identifier number is maximum in multiple service queues to retain queue.
Wherein, each processor core in polycaryon processor is entered according to the software being preset in the minds of each processor core to message
Row processing.
Wherein, the function that processing of each processor core to message is realized is determined by default software, as to message
Parse and determination of port etc. is forwarded to message;Certainly, each processor core can also have other processing sides to message
Formula, no longer repeat one by one here.
Wherein, the quantity for the processor core that polycaryon processor includes can be 2,4 or 8.Polycaryon processor
Comprising processor core quantity it is more, illustrate that the polycaryon processor is stronger to the parallel processing capability of message.
Alternatively, can be not only to the equipment of Message processing in polycaryon processor processor core or other
The existing hardware acceleration engine that can be arbitrarily arranged in polycaryon processor, is no longer repeated one by one here.
Step 302, after the completion of Message processing, what the order module of interchanger recorded in the message descriptor according to message
Queue identity, the message identification of message is moved in service queue corresponding with the queue identity recorded from default queue.
Specifically, the flow of step 302 is specifically described by step 3021- steps 3023.
Step 3021, the order module of interchanger judge whether the message identification for the message that processing is completed is in default queue
First message identification.
If interchanger determines that the message identification for the message that processing is completed is first message identification in default queue, then
Carry out step 3022.
If interchanger determines that the bid quotation knowledge for the message that processing is completed is not first message identification in default queue, then
Carry out step 3023.
Wherein, whether message descriptor also includes completing mark, complete mark and be used to represent message by polycaryon processor
It has been managed that, complete to be identified as 0 when message is not handled by polycaryon processor, completed when message is completed by polycaryon processor processing
It is identified as 1.
Specifically, after some message is completed in processing, the polycaryon processor of interchanger, which can be sent, carries processor numbering
Message processing complete order to order module, the processor that order module is completed to carry in order according to Message processing is numbered,
Find out message identification corresponding to processor numbering, the completion in message descriptor corresponding to the message identification for then finding out this
Mark is arranged to 1;Then order module can judge what message descriptor corresponding to first message identification of default queue recorded
Whether completion identified whether as 1, be first message identification in default queue the message identification of message completed to processing
Judged.
Step 3022, if it is determined that processing complete message message identification be default queue in first message identification,
The queue identity then recorded in message descriptor of the order module of interchanger according to message, by first report in default queue
Text mark is moved to from default queue in service queue corresponding with queue identity.
Specifically, when order module determines that the completion mark of the message descriptor record of first message of default queue is
For 1 when, then the queue identity that order module records in the message descriptor according to message, by first in default queue report
Text mark is taken out from default queue, is then placed in and the service queue corresponding to the queue identity that is recorded in message descriptor
In.
Step 3023, if it is determined that processing complete message message identification and default queue in first message identification not
Unanimously, then the message identification for the message that the order module of interchanger will not temporarily complete the processing according to queue identity is moved to
In corresponding service queue.
Specifically, if order module determines that message descriptor corresponding to first message identification of default queue records complete
Into when being identified as 0, then the message mark for the message that the order module of interchanger will not temporarily complete the processing according to queue identity
Knowledge is moved in corresponding service queue;And order module can periodically judge first message descriptor record of default queue
Completion identify whether as 1, only it is determined that being recorded in message identifier corresponding to first message identification of default queue
When completion is identified as 1, illustrate that first in now default queue message has handled completion, just can be by the message mark of the message
Knowledge is moved in service queue corresponding with queue identity.
Wherein, order module is logic circuit.
By the description of step 3021 to step 3023, the possibility of packet congestion can be further reduced.By only will
First message descriptor in default queue is moved in corresponding service queue, ensure that the order of message in service queue
With the sequence consensus of message input, occurs out of order situation when message can be avoided to export.
Step 303, each processor core of polycaryon processor of interchanger send out the message handled by arbitration modules
The cache module pre-set is sent to be cached.
Wherein, message descriptor also includes buffer address, and buffer address is used to record to be completed by polycaryon processor processing
Packet buffer to the physical address in the cache module of interchanger.
Specifically, after throughout managing the complete message of device core processing, each processor core of polycaryon processor can be to will processing
The message of completion is sent to cache module by arbitration modules, and is sent to cache module and complete the message to be cached with processing
Processor core processor numbering cache instruction;The cache module of interchanger is first cached the message of reception, so
Afterwards according to cache instruction carry processor number, generation processing this cached message processor core processor numbering and
3rd corresponding relation of buffer address, the 3rd corresponding relation of generation is then sent to order module, order module is according to connecing
In the 3rd corresponding relation received processor numbering, found by way of traversal in default queue with the first corresponding relation
With the corresponding message identification of processor numbering, corresponding message identifier is being found by message identification, then by the 3rd pair
Buffer address in should being related to recorded in queue descriptor, and then order module is according to the processing recorded in the 3rd corresponding relation
Device is numbered, and the state of processor core corresponding to processor numbering is revised as the free time by notice distribution module by busy, and is discharged
Fall the first corresponding relation of the message identification of processor numbering and the message cached.
Wherein, cache module is buffer.
Wherein, each processor core is different from the release time of message identification, and each processor core is completed to divide in processing
It will be discharged after the message matched somebody with somebody, so as to handle next allocated message;And message identification ability only after message output
It is released, so as to distribute to next message when registering the message received.
Processor core in existing polycaryon processor is when handling message, in fact it could happen that multiple processor cores are simultaneously
Handled the situation of message, cache module to receive and caching these messages handle simultaneously, then just needs one compared with
Big bandwidth could be to multiple while handle the message of completion and cache, if the bandwidth of cache module design does not reach to multiple
When handling the demand that the message of completion is cached simultaneously, then the message that these processing are completed can not be cached, if it is desired to
Want cache module while multiple messages are cached, that should just set in the design for carrying out cache module for cache module
A larger bandwidth is counted, but this can increase the design cost of interchanger during the circuit design of interchanger.
Therefore, in step 303, when having at least two processor cores while having handled message, the arbitration of interchanger
The order that module is numbered according at least two processor cores for completing Message processing simultaneously, will be located simultaneously by way of poll
The packet buffer completed is managed into the cache module pre-set.
Specifically, the port of multiple reception messages is provided with arbitration modules, these receive the port of message and each processing
Device core corresponds, such as:The corresponding ports a of processor core 1, the corresponding ports b of processor core 2 etc..When there is processor core
After message is completed in heart processing, the processor core will send message, such arbitration modules to the port of corresponding arbitration modules
It will know which processor core handles the message that is over by receiving the port of message, so working as has at least two processors
When core has handled message simultaneously, arbitration modules first cache to the message received, and then basis receives message simultaneously
Port numbers it is known that complete processing message processor core numbering, so as to according to processor number order, lead to
The multiple messages for handling completion simultaneously are cached in the cache module pre-set by the mode of overpolling successively.
Wherein, arbitration modules are MUXs.
Alternatively, the equipment that arbitration modules use can be not only MUX or other are existing any
The hardware of arbitration modules function can be realized, is no longer repeated one by one here.
By the description of step 303, when caching the message that multiple processing are completed, according at least two processor core marks
The order of knowledge, the multiple messages received are cached successively, therefore cache module need to only cache a message every time,
Situation without once caching multiple messages so that when designing the bandwidth of cache module of interchanger, the band of design
Wide need to meet a message can by and enter cache module, so as to save the design cost of interchanger.
Step 304, since the service queue of highest priority, the cache module of interchanger is according to each industry in order module
The Sequential output message of the message identification recorded in business queue.
Specifically, the flow of step 304 is specifically described by step 3041- steps 3043.
Step 3041, when getting the instruction of outgoing message, the order module of interchanger determines more with priority
Individual service queue.
Wherein, in different application scenarios, interchanger can all be provided according to user using situation about servicing, preferential output
The message of the currently used service of user, and which service message, which can provide, is distinguished by the type of service of carrying.And
Before message output, message has been assigned to different the order module of interchanger by the type of service that is carried according to message
In service queue, thus the order module of interchanger can according to the difference of the service that user uses under different application scenarios,
High priority is set to the service queue that user's current service is provided in multiple service queues in advance.As shown in Figures 4 to 6, it is
The schematic diagram of priority is set in the present embodiment to service queue.
Further, interchanger can also set output priority to other any service queues, in some cases, more
Priority can be set to all service queues, no longer repeat one by one here.
Such as:User is while online game is carried out by downloading software download video file, then the row of interchanger
Sequence module will determine to provide the business of data of network game message in multiple service queues according to the currently used service of user
The priority that the priority of queue is limit priority, determines to provide the service queue of the data message of foradownloaded video is second high
Priority, other service queues are not provided with priority.
Step 3042, since the service queue of highest priority, the cache module of interchanger according to order module industry
The order of the message identification recorded in business queue, export the message of caching.
Specifically, the order module of interchanger according in the service queue of fixed highest priority message identification it is suitable
The buffer address of message is obtained in message descriptor corresponding to sequence from each message identification, then according to the order for obtaining buffer address
The buffer address got is sent to cache module, cache module reads message from obtained buffer address, and will read
Message output;Then order module according to the order of message identification in the high service queue of priority second from each message identification
The buffer address of message, the caching that then will be got according to the order for obtaining buffer address are obtained in corresponding message descriptor
Address is sent to cache module, and cache module reads message from obtained buffer address, and the message of reading is exported;With this
Analogize, until exporting the message in all service queues with priority.
Wherein, interchanger can use existing arbitrary mode to carry out the lookup of message, no longer repeat one by one here.
Step 3043, when there is service queue to be not provided with priority, interchanger is according to the service queue for being not provided with priority
Queue identity order, poll output is respectively not provided with reporting corresponding to first message identification in the service queue of priority
Text.
Specifically, the cache module of interchanger according to the queue identity for the service queue for being not provided with priority order poll
The message descriptor of first message of the service queue for being respectively not provided with priority is obtained, is getting the first of each service queue
After the message descriptor of individual message, cache module finds corresponding report according to the buffer address of the message recorded in message descriptor
Text, first message of the service queue of priority is not provided with output in turn.
First message of service queue refers to come message corresponding to the message identification of most advanced position in service queue.
By the description of step 3041 to step 3043, under different business scenarios, the type of the data of processing is not
With, the different types of business scenario of demand data can be directed to, multiple service queues are set with different priority, is met not
The different demand of priority treatment data message under same business scenario.
The message processing method that the present embodiment provides, during being handled in the message to being assigned to, according to
The type of service that message carries, the queue identity of service queue corresponding with the type of service that message carries is recorded in and message
In message descriptor corresponding to mark, so as to which after the completion of to Message processing, message identification is assigned to different priority
Service queue in, the output of message order is determined by the priority of the service queue set, from the business team of highest priority
Row start, according to message corresponding to the message identification recorded in each service queue of the Sequential output of priority from high to low;Due to
It is the service queue in the processing procedure to message according to where the type of service of message determines message, and service queue is set
Put the priority of outgoing message, it is possible to according to the difference of application scenarios, the output order of flexible configuration message, and
And according to the priority of service queue, can be in the case of it is determined that carrying the message prior output of certain type of service, it is possible to
The message for directly carrying out this type of service carries out output operation, and avoids existing needs etc. and stay in this type of service
The message inputted before first message of message after being output could export the defects of.
Embodiment three
Referring to Fig. 7, a kind of message process device is present embodiments provided, the device includes:
Distribute module 400, for distributing the message received, according to the reception of message order, the message received is noted
Volume into the default queue of queue lists, wherein, queue lists also include multiple being classified according to different types of service
Service queue, each service queue have queue identity;
Processing module 401, for the type of service carried according to message, by industry corresponding with the type of service that message carries
The queue identity of business queue is recorded in message descriptor corresponding with message identification, wherein, message identification is noted by message
Volume to during default queue to message distribution;
Sequencing module 402, for the queue identity recorded in the message descriptor according to message, by the message identification of message
It is moved to from default queue in service queue corresponding with the queue identity recorded;
Output module 403, for since the service queue of highest priority, according to the message recorded in each service queue
The order of mark, outgoing message.
The message process device that the present embodiment provides, during being handled in the message to being assigned to, according to
The type of service that message carries, the queue identity of service queue corresponding with the type of service that message carries is recorded in and message
In message descriptor corresponding to mark, so as to which after the completion of to Message processing, message identification is assigned to different priority
Service queue in, the output of message order is determined by the priority of the service queue set, from the business team of highest priority
Row start, according to message corresponding to the message identification recorded in each service queue of the Sequential output of priority from high to low;Due to
It is the service queue in the processing procedure to message according to where the type of service of message determines message, and service queue is set
Put the priority of outgoing message, it is possible to according to the difference of application scenarios, the output order of flexible configuration message, and
And according to the priority of service queue, can be in the case of it is determined that carrying the message prior output of certain type of service, it is possible to
The message for directly carrying out this type of service carries out output operation, and avoids existing needs etc. and stay in this type of service
The message inputted before first message of message after being output could export the defects of.
Example IV
Referring to Fig. 8, a kind of message process device is present embodiments provided, the device includes:
Distribute module 500, for distributing the message received, according to the reception of message order, the message received is noted
Volume into the default queue of queue lists, wherein, queue lists also include multiple being classified according to different types of service
Service queue, each service queue have queue identity;
Processing module 501, for the type of service carried according to message, by industry corresponding with the type of service that message carries
The queue identity of business queue is recorded in message descriptor corresponding with message identification, wherein, message identification is noted by message
Volume to during default queue to message distribution;
Sequencing module 502, for the queue identity recorded in the message descriptor according to message, by the message identification of message
It is moved to from default queue in service queue corresponding with the queue identity recorded;
Cache module 503, the message for being completed to processing cache.
Output module 504, for since the service queue of highest priority, according to the message recorded in each service queue
The order of mark, the message cached in output buffer module 503.
Specifically, sequencing module 502 is used for:
Whether the message identification for judging the message that processing is completed is first message identification in default queue;
If it is determined that the message identification for the message that processing is completed is first message identification in default queue, then according to message
Message descriptor in the queue identity that records, by first message identification in default queue be moved to from default queue with
In service queue corresponding to the queue identity of record.
Specifically, in cache module 503:
When having at least two processor cores while having handled message, according to simultaneously complete at least two of Message processing
The order of processor core numbering, the message for handling completion simultaneously is cached by way of poll.
Specifically, output module 504 is used for:
When getting the instruction of outgoing message, it is determined that multiple service queues with priority;
It is slow according to the order of the message identification recorded in service queue, output since the service queue of highest priority
The message cached in storing module.
When there is service queue to be not provided with priority, output module 504 is additionally operable to:
According to the order of the queue identity for the service queue for being not provided with priority, poll exports the industry for being respectively not provided with priority
Message corresponding to first message identification being engaged in queue.
The message process device that the present embodiment provides, during being handled in the message to being assigned to, according to
The type of service that message carries, the queue identity of service queue corresponding with the type of service that message carries is recorded in and message
In message descriptor corresponding to mark, so as to which after the completion of to Message processing, message identification is assigned to different priority
Service queue in, the output of message order is determined by the priority of the service queue set, from the business team of highest priority
Row start, according to message corresponding to the message identification recorded in each service queue of the Sequential output of priority from high to low;Due to
It is the service queue in the processing procedure to message according to where the type of service of message determines message, and service queue is set
Put the priority of outgoing message, it is possible to according to the difference of application scenarios, the output order of flexible configuration message, and
And according to the priority of service queue, can be in the case of it is determined that carrying the message prior output of certain type of service, it is possible to
The message for directly carrying out this type of service carries out output operation, and avoids existing needs etc. and stay in this type of service
The message inputted before first message of message after being output could export the defects of.
It should be noted that:The message process device that above-described embodiment provides is when handling message, only with above-mentioned each function
The division progress of module, can be as needed and by above-mentioned function distribution by different function moulds for example, in practical application
Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of work(described above
Energy.In addition, the message process device that above-described embodiment provides belongs to same design with message processing method embodiment, it is specific real
Existing process refers to embodiment of the method, repeats no more here.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment
To complete, by program the hardware of correlation can also be instructed to complete, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
The present invention is described in detail with reference to foregoing embodiments for pipe, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, either which part or all technical characteristic are entered
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.
Claims (10)
1. a kind of message processing method, it is characterised in that methods described includes:
The message received is distributed, according to the reception of message sequentially, the message received is registered to the acquiescence team of queue lists
In row, wherein, the queue lists also include multiple service queues classified according to different types of service, each industry
Business queue has queue identity;
During the message to being assigned to is handled, according to the type of service of message carrying, it will be carried with message
The type of service corresponding to the queue identity of the service queue be recorded in message descriptor corresponding with message identification,
Wherein, the message identification is that message is distributed during message is registered into default queue;
After the completion of Message processing, according to the queue identity recorded in the message descriptor of the message, by the report of the message
Text mark is moved in service queue corresponding with the queue identity recorded from default queue;
Since the service queue of highest priority, according to the Sequential output institute of the message identification recorded in each service queue
State message.
2. message processing method according to claim 1, it is characterised in that it is described after the completion of Message processing, according to institute
The queue identity recorded in the message descriptor of message is stated, the message identification of the message is moved to and remembered from default queue
Step includes in service queue corresponding to the queue identity of record:
Whether the message identification for judging the message that processing is completed is first message identification in the default queue;
If it is determined that the message identification for the message that processing is completed is first message identification in the default queue, then basis
The queue identity recorded in the message descriptor of the message, by first message identification in the default queue from silent
Recognize in queue and be moved in service queue corresponding with the queue identity recorded.
3. message processing method according to claim 1, it is characterised in that described after the completion of Message processing, according to
The queue identity recorded in the message descriptor of the message, the message identification of the message is moved to and remembered from default queue
In service queue corresponding to the queue identity of record after step, methods described also includes:
The message completed to processing caches.
4. message processing method according to claim 3, it is characterised in that delay in the message that described pair of processing is completed
In the step of depositing:
When have at least two processor cores and meanwhile handled each be allocated message to be processed when, according to simultaneously complete message
The order of at least two processor core numbering of processing, it will be handled simultaneously described in completion at least by way of poll
Two processor cores are each allocated message to be processed and cached.
5. message processing method according to claim 1, it is characterised in that when there is service queue to be not provided with priority,
Methods described also includes:
According to the order of the queue identity for the service queue for being not provided with priority, poll exports the industry for being respectively not provided with priority
Message corresponding to first message identification being engaged in queue.
6. a kind of message process device, it is characterised in that described device includes:
Distribute module, for distributing the message received, according to the reception of message order, the message received is registered to queue
In the default queue of list, wherein, the queue lists also include multiple business classified according to different types of service
Queue, each service queue have queue identity;
Processing module, will be corresponding with the type of service that message carries for the type of service carried according to message
The queue identity of the service queue is recorded in message descriptor corresponding with message identification, wherein, the message identification is
To message distribution during message is registered into default queue;
Sequencing module, for the queue identity recorded in the message descriptor according to the message, by the message mark of the message
Know from default queue and be moved in service queue corresponding with the queue identity recorded;
Output module, for since the service queue of highest priority, according to the message mark recorded in each service queue
The Sequential output message of knowledge.
7. message process device according to claim 6, it is characterised in that the sequencing module is used for:
Whether the message identification for judging the message that processing is completed is first message identification in the default queue;
If it is determined that the message identification for the message that processing is completed is first message identification in the default queue, then basis
The queue identity recorded in the message descriptor of the message, by first message identification in the default queue from silent
Recognize in queue and be moved in service queue corresponding with the queue identity recorded.
8. message process device according to claim 6, it is characterised in that described device also includes:
Cache module, the message for being completed to processing cache.
9. message process device according to claim 8, it is characterised in that in the cache module:
When have at least two processor cores and meanwhile handled each be allocated message to be processed when, according to simultaneously complete message
The order of at least two processor core numbering of processing, it will be handled simultaneously described in completion at least by way of poll
Two processor cores are each allocated message to be processed and cached.
10. message process device according to claim 6, it is characterised in that when there is service queue to be not provided with priority,
The output module is additionally operable to:
According to the order of the queue identity for the service queue for being not provided with priority, poll exports the industry for being respectively not provided with priority
Message corresponding to first message identification being engaged in queue.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410667090.XA CN104468401B (en) | 2014-11-20 | 2014-11-20 | A kind of message processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410667090.XA CN104468401B (en) | 2014-11-20 | 2014-11-20 | A kind of message processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104468401A CN104468401A (en) | 2015-03-25 |
CN104468401B true CN104468401B (en) | 2017-11-17 |
Family
ID=52913797
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410667090.XA Active CN104468401B (en) | 2014-11-20 | 2014-11-20 | A kind of message processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104468401B (en) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107426025A (en) * | 2017-07-28 | 2017-12-01 | 江西山水光电科技股份有限公司 | A kind of dispatching method for strengthening webmaster north orientation message response degree |
CN107682265B (en) * | 2017-09-07 | 2021-04-20 | 银清科技有限公司 | Message routing method and device for payment system |
CN107656896B (en) * | 2017-09-12 | 2020-07-07 | 新华三信息安全技术有限公司 | Multi-core processor and message processing method |
CN108768882A (en) * | 2018-04-23 | 2018-11-06 | 烽火通信科技股份有限公司 | A kind of processing method and system of protocol massages |
CN109062781B (en) * | 2018-06-22 | 2022-04-26 | 北京星网锐捷网络技术有限公司 | Message buffer management method and device |
CN109150755B (en) * | 2018-09-25 | 2022-03-04 | 西安空间无线电技术研究所 | A space-based data link onboard message scheduling method and device |
CN109246023A (en) * | 2018-11-16 | 2019-01-18 | 锐捷网络股份有限公司 | Flow control methods, the network equipment and storage medium |
CN109962760B (en) * | 2019-04-09 | 2022-08-30 | 湖南智领通信科技有限公司 | Service scheduling method suitable for wireless TDMA ad hoc network |
CN110636071B (en) * | 2019-09-26 | 2020-07-07 | 光大兴陇信托有限责任公司 | Interface docking method |
CN110830386B (en) * | 2019-11-14 | 2023-06-30 | 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) | Method, device and system for message order preservation |
CN111163018B (en) * | 2019-12-02 | 2022-08-26 | 华为技术有限公司 | Network equipment and method for reducing transmission delay thereof |
CN111698175B (en) * | 2020-06-24 | 2023-09-19 | 北京经纬恒润科技股份有限公司 | Message receiving and transmitting method and system for gateway |
CN112099975B (en) * | 2020-09-25 | 2024-03-26 | Oppo广东移动通信有限公司 | Message processing method and system and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1414761A (en) * | 2002-02-27 | 2003-04-30 | 华为技术有限公司 | Multi-priority buffer reliable transmission method in communication system |
CN101631077A (en) * | 2009-08-24 | 2010-01-20 | 中兴通讯股份有限公司 | Message processing method and device |
CN102638403A (en) * | 2012-04-01 | 2012-08-15 | 华为技术有限公司 | Method and device for processing messages |
WO2014039505A1 (en) * | 2012-09-06 | 2014-03-13 | Unisys Corporation | Fast data packet transfer operations |
CN104158764A (en) * | 2014-08-12 | 2014-11-19 | 杭州华三通信技术有限公司 | Message processing method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8761174B2 (en) * | 2009-03-11 | 2014-06-24 | Sony Corporation | Quality of service traffic recognition and packet classification home mesh network |
-
2014
- 2014-11-20 CN CN201410667090.XA patent/CN104468401B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1414761A (en) * | 2002-02-27 | 2003-04-30 | 华为技术有限公司 | Multi-priority buffer reliable transmission method in communication system |
CN101631077A (en) * | 2009-08-24 | 2010-01-20 | 中兴通讯股份有限公司 | Message processing method and device |
CN102638403A (en) * | 2012-04-01 | 2012-08-15 | 华为技术有限公司 | Method and device for processing messages |
WO2014039505A1 (en) * | 2012-09-06 | 2014-03-13 | Unisys Corporation | Fast data packet transfer operations |
CN104158764A (en) * | 2014-08-12 | 2014-11-19 | 杭州华三通信技术有限公司 | Message processing method and device |
Non-Patent Citations (1)
Title |
---|
基于区分服务的拥塞控制算法研究;李寅;《中国优秀硕士学位论文全文数据库信息科技辑(2012)》;20120715(第7期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN104468401A (en) | 2015-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104468401B (en) | A kind of message processing method and device | |
US11343307B2 (en) | Virtual network function (VNF) resource management in a software defined network (SDN) | |
US10659315B2 (en) | Virtual network function (VNF) relocation in a software defined network (SDN) | |
CN102656850B (en) | For the treatment of the method for multiple data and the switching equipment for switched communication grouping | |
CN109428922A (en) | A kind of subscription dissemination method and server | |
CN105991444B (en) | The method and apparatus of business processing | |
US20120287782A1 (en) | Programmable and high performance switch for data center networks | |
US8725873B1 (en) | Multi-server round robin arbiter | |
CN109684269A (en) | A kind of PCIE exchange chip kernel and working method | |
US9847937B2 (en) | Hardware acceleration for routing programs | |
CN107025142A (en) | A kind of cross-thread message delivery method, device and electronic equipment | |
CN106789652A (en) | Service shunting method and device | |
CN107547346A (en) | A kind of message transmitting method and device | |
CN113986969B (en) | Data processing method, device, electronic device and storage medium | |
CN109391522A (en) | A kind of network flow based on RDMA determines method and device | |
US20040246956A1 (en) | Parallel packet receiving, routing and forwarding | |
US6101554A (en) | Apparatus for controlling data flow using lookup tables to link incoming packets directly to output ports | |
US10103992B1 (en) | Network traffic load balancing using rotating hash | |
CN107819697A (en) | Data transmission method, interchanger and data center | |
US11314711B2 (en) | Network switch with network analysis data producer-consumer shared memory | |
WO2016101490A1 (en) | Update processing method and device | |
US9996468B1 (en) | Scalable dynamic memory management in a network device | |
US7466716B2 (en) | Reducing latency in a channel adapter by accelerated I/O control block processing | |
CN107707485A (en) | A kind of range type IP message strategy matching circuits and method | |
CN115567590A (en) | Data packet scheduling method, device, equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220118 Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province Patentee after: xFusion Digital Technologies Co., Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |
|
TR01 | Transfer of patent right |