CN104468401A - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN104468401A
CN104468401A CN201410667090.XA CN201410667090A CN104468401A CN 104468401 A CN104468401 A CN 104468401A CN 201410667090 A CN201410667090 A CN 201410667090A CN 104468401 A CN104468401 A CN 104468401A
Authority
CN
China
Prior art keywords
message
queue
service
identification
recorded
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.)
Granted
Application number
CN201410667090.XA
Other languages
Chinese (zh)
Other versions
CN104468401B (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.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410667090.XA priority Critical patent/CN104468401B/en
Publication of CN104468401A publication Critical patent/CN104468401A/en
Application granted granted Critical
Publication of CN104468401B publication Critical patent/CN104468401B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a message processing method and device and belongs to the technical field of communication. When distributed messages are processed, according to the service types carried by the messages, queue identification of service queues corresponding to the service types carried by the messages is recorded into message descriptors corresponding to the queue identification, accordingly, after message processing, the message identification is distributed into service queues with different priorities, the output sequence of the messages is determined by the set priorities of the service queues, and the messages corresponding to the message identification recorded in the service queues are output according to the sequence from a high priority to a low priority from the service queue with the highest priority. During message processing, the service queues where the messages are placed are determined according to the service types of the messages, the priorities of the output messages are set for the service queues, and therefore according to difference of application scenarios, the output sequence of the messages can be configured flexibly.

Description

A kind of message processing method and device
Technical field
The present invention relates to communication technical field, particularly a kind of message processing method and device.
Background technology
Along with the intensification of social informatization degree, people are more and more stronger to the dependence of the Internet, are connected to the also growth at double of computer node on network.The network equipment such as switch, network processing unit is as the data exchange node of computer and the Internet, and its data processing performance determines the performance of whole network.Along with the appearance of the bandwidth applications such as sharp increase and Online Video of user's linking number, the single core processor being responsible for process message is in the network device set and is more and more difficult to the performance requirement meeting high-speed data process, and polycaryon processor relies on the characteristic that its computation capability is strong, be used widely in network communication field gradually.So-called polycaryon processor, refer to the processor with multiple processor core integrated on the network equipment such as switch, network processing unit, each processor core in polycaryon processor once can only process a message.Polycaryon processor, can the process operation of executed in parallel message by multiple processor cores of working alone each other, meets the performance requirement of the Internet high speed data processing.
Current existence undertaken in the implementation of Message processing by the network equipment with polycaryon processor: the network equipment can according to the difference of the source address of message repeating and destination address, before to Message processing, just the message received is divided into different message flows, wherein, multiple messages identical with destination address for the source address of record are put into same message flow according to the order that the network equipment receives.When forwarding Message processing is complete, the order receiving message according to the network equipment forwards the message in same message flow.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem:
The network equipment, in the process forwarded message according to the order receiving message, can only carry out forwarding operation according to the message sequence recorded in the message flow formed before Message processing to the message in same message flow.So more fixing to the pass-through mode of message, can not pay the utmost attention to according to the output of the difference of business scenario to the message of some type of service.
Summary of the invention
In order to solve the problem of prior art, embodiments provide a kind of message processing method and device.Described technical scheme is as follows:
First aspect, embodiments provides a kind of message processing method, and described method comprises:
Distribute the message received, according to the reception order of message, the message received is registered in the default queue of queue lists, wherein, described queue lists also comprises multiple service queue carrying out classifying according to different types of service, and each described service queue has queue identity;
In the process that the message be assigned to is processed, according to the described type of service that message carries, the queue identity of the described service queue corresponding with the described type of service that message carries is recorded in the message descriptor corresponding with message identification, wherein, described message identification distributes message in process message being registered to default queue;
After Message processing completes, according to the queue identity recorded in the message descriptor of described message, the message identification of described message is moved to the service queue corresponding with the described queue identity recorded from default queue;
According to predetermined message output policy, according to the Sequential output message of the message identification recorded in each described service queue.
In the first possible implementation of first aspect, it is described after Message processing completes, according to the queue identity recorded in the message descriptor of described message, the message identification of described message is moved to from default queue step in the service queue corresponding with the described queue identity recorded and comprises:
Judge that whether the message identification of the described message processed is first message identification in described default queue;
The message identification of the described message processed if determine is first message identification in described default queue, then according to the queue identity recorded in the message descriptor of described message, described first message identification in described default queue is moved in the service queue corresponding with the described queue identity recorded from default queue.
In the implementation that the second of first aspect is possible, described after Message processing completes, according to the queue identity recorded in the message descriptor of described message, moved to the service queue corresponding with the described queue identity recorded after step from default queue by the message identification of described message, described method also comprises:
Buffer memory is carried out to the message processed.
In conjunction with in the implementation that the second of first aspect and first aspect is possible, in the third possible implementation of first aspect, carry out in the step of buffer memory at the described message to having processed:
When there being at least two processor cores to process message simultaneously, according to the order completing at least two processor core numberings described in Message processing simultaneously, by the mode of poll, the described message simultaneously processed is carried out buffer memory.
In the 4th kind of possible implementation of first aspect, described according to predetermined message output policy, comprise according to the Sequential output message step of the message identification recorded in each described service queue:
When getting the instruction of outgoing message, determine the multiple described service queue with priority;
From the service queue that priority is the highest, according to the order of the message identification recorded in described service queue, export the described message of buffer memory in described cache module.
In conjunction with in the 4th kind of possible implementation of first aspect and first aspect, in the 5th kind of possible implementation of first aspect, when there being service queue not arrange priority, described method also comprises:
According to the order of queue identity of service queue not arranging priority, poll exports message corresponding to first message identification respectively do not arranged in the described service queue of priority.
Second aspect, embodiments provides a kind of message process device, and described device comprises:
Distribution module, for distributing the message received, according to the reception order of message, the message received is registered in the default queue of queue lists, wherein, described queue lists also comprises multiple service queue carrying out classifying according to different types of service, and each described service queue has queue identity;
Processing module, for the described type of service of carrying according to message, the queue identity of the described service queue corresponding with the described type of service that message carries is recorded in the message descriptor corresponding with message identification, wherein, described message identification distributes message in process message being registered to default queue;
Adjust sequence module, for according to the queue identity recorded in the message descriptor of described message, the message identification of described message is moved to the service queue corresponding with the described queue identity recorded from default queue;
Output module, for the service queue the highest from priority, according to the Sequential output message of the message identification recorded in each described service queue.
In the first possible implementation of second aspect, described tune sequence module is used for:
Judge that whether the message identification of the described message processed is first message identification in described default queue;
The message identification of the described message processed if determine is first message identification in described default queue, then according to the queue identity recorded in the message descriptor of described message, described first message identification in described default queue is moved in the service queue corresponding with the described queue identity recorded from default queue.
In the implementation that the second of second aspect is possible, described device also comprises:
Cache module, for carrying out buffer memory to the message processed.
In conjunction with in the implementation that the second of second aspect and second aspect is possible, in the third possible implementation of second aspect, in described cache module:
When there being at least two processor cores to process message simultaneously, according to the order completing at least two processor core numberings described in Message processing simultaneously, by the mode of poll, the described message simultaneously processed is carried out buffer memory.
In the 4th kind of possible implementation of second aspect, when there being service queue not arrange priority, described output module also for:
According to the order of queue identity of service queue not arranging priority, poll exports message corresponding to first message identification respectively do not arranged in the described service queue of priority.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
The message processing method that the embodiment of the present invention provides and device, by in the process processed the message be assigned to, according to the type of service that message carries, the queue identity of the service queue corresponding with the type of service that message carries is recorded in the message descriptor corresponding with message identification, thus after Message processing is completed, 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, from the service queue that priority is the highest, according to the message that the message identification recorded in each service queue of priority Sequential output is from high to low corresponding, owing to being the service queue according to the type of service determination message place of message in the processing procedure of message, and service queue is provided with to the priority of outgoing message, so can according to the difference of application scenarios, the output order of configuration message flexibly, and, according to the priority of service queue, when can export at the message prior determining to carry certain type of service, the message that just directly can carry out this type of service carries out output function, and avoid the existing defect needing to wait for that the message inputted before first message of the message of this type of service could export after being output.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the structural representation of a kind of implementation environment involved by message processing method that the embodiment of the present invention provides;
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 one in the message processing method that provides of the embodiment of the present invention two, service queue being arranged to priority;
Fig. 5 is the schematic diagram two in the message processing method that provides of the embodiment of the present invention two, service queue being arranged to priority;
Fig. 6 is the schematic diagram three in the message processing method that provides of the embodiment of the present invention two, service queue being arranged to priority;
Fig. 7 is the structural representation of the message process device that the embodiment of the present invention three provides;
Fig. 8 is the structural representation of the message process device that the embodiment of the present invention four provides.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Unless otherwise defined, technical term used herein or scientific terminology should be in field belonging to the present invention the ordinary meaning that the personage with general technical ability understands." first ", " second " that use in patent application specification of the present invention and claims and similar word do not represent any order, quantity or importance, and are only used to distinguish different parts.Equally, the similar word such as " " or " " does not represent restricted number yet, but represents to there is at least one.
See Fig. 1, it illustrates a kind of device with message repeating and processing capacity involved by message forwarding method that the embodiment of the present invention provides.This environment comprises: multi-core processor 100, distribution module 101, arbitration modules 102, order module 103 and cache module 104.
Wherein, polycaryon processor 100, comprises multiple processor core 1, the processor core 2 with identical function ... processor core n; These processor cores are used for resolving and forwarding the message received; Wherein, processor core has idle and busy two states, and when processor core is when processing message, then processor core is in busy state; When the untreated message of processor core, then processor core is in idle state.The message received, according to the state of each processor core in polycaryon processor 100, is assigned to each processor core of idle condition in the heart by distribution module 101, and sends to order module the instruction that registration receives message.These many orders, for when there being multiple processor core to give an order to order module 103 simultaneously, according to the mark order of processor core, being sent to order module 103 by the mode of poll and processing by arbitration modules 102 one by one; Under normal circumstances, when only getting the order that a polycaryon processor sends to order module, directly by the command transfer that gets to order module.Order module 103, to the message assignment message mark of registration, and store the queue lists of recorded message input sequence and output order, wherein, queue lists comprises a default queue and multiple service queue, default queue carrys out the input sequence of recorded message by the message identification of recorded message, records the output order of mark to message with the message of identical services type respectively and carry out record in multiple service queue; When needs outgoing message, send message output order to cache module 104, control cache module 104 carries out message output according to the message sequence recorded in service queue multiple in queue lists.Cache module 104, carries out buffer memory to the message that each processor core processing of polycaryon processor completes, and when receiving the message output order that order module 103 sends outgoing message.
Wherein, multi-core processor 100, distribution module 101, arbitration modules 102, order module 103 and cache module 104 is comprised and the device with message repeating and processing capacity is generally switch or network processing unit.
Embodiment one
Embodiments provide a kind of message processing method, see Fig. 2, method flow comprises:
The distribution module of step 200, switch distributes the message received, order module is according to the reception order of message, the message received is registered in the default queue of queue lists, wherein, queue lists also comprises multiple service queue carrying out classifying according to different types of service, and each service queue has queue identity.
Wherein, the message that switch receives can be need to process in network and any message forwarded.
Wherein, the distribution module of switch is according to the state of processor core each in polycaryon processor, and each processor core message being assigned to idle condition processes in the heart.
Step 201, in the process that the message be assigned to is processed, the type of service that in the polycaryon processor of switch, each processor core is carried according to message, the queue identity of the service queue corresponding with the type of service that message carries is recorded in the message descriptor corresponding with message identification, wherein, message identification distributes message in process message being registered to default queue.
Step 202, after Message processing completes, the message identification of message, according to the queue identity recorded in the message descriptor of message, moves to the service queue corresponding with the queue identity recorded from default queue by the order module of switch.
Step 203, from the service queue that priority is the highest, the cache module of switch, according to the order of the message identification recorded in service queue each in order module, exports the message of buffer memory.
By above description, by in the process processed the message be assigned to, according to the type of service that message carries, the queue identity of the service queue corresponding with the type of service that message carries is recorded in the message descriptor corresponding with message identification, thus after Message processing is completed, 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, from the service queue that priority is the highest, according to the message that the message identification recorded in each service queue of priority Sequential output is from high to low corresponding, owing to being the service queue according to the type of service determination message place of message in the processing procedure of message, and service queue is provided with to the priority of outgoing message, so can according to the difference of application scenarios, the output order of configuration message flexibly.
Embodiment two
Embodiments provide a kind of message processing method, see Fig. 3, method flow comprises:
The distribution module of step 300, switch distributes the message received, order module is according to the reception order of message, the message received is registered in the default queue of queue lists, wherein, queue lists also comprises multiple service queue carrying out classifying according to different types of service, and each service queue has queue identity.
Particularly, the flow process of step 300 is specifically described by step 3001-step 3003.
The distribution module of step 3001, switch receives message.
Wherein, the message that switch receives is the message waited for switch processes and forward.Wherein, distribution module is decoder.
Alternatively, the equipment that distribution module adopts can be not only decoder, also can be other existing hardware that can realize arbitrarily distribution module function, repeat no longer one by one here.
The distribution module of step 3002, switch is to the message allocation process device core received.
Particularly, the message received distributes according to the state of current each processor core by the distribution module of switch, and wherein, processor core has idle and busy two states, when processor core is when processing message, then processor core is in busy state; When the untreated message of processor core, then processor core is in idle state.Distribution module records the state of each processor core, according to the state of each processor core in polycaryon processor in the process of assignment message, the message received is assigned to each processor core of idle condition in the heart.Then distribution module sends the register instruction of message to order module, wherein, comprises the processor numbering of the processor core of this message of process in the register instruction of message.
Wherein, each processor core once can only process a message, and distribution module only distributes the message that each processor core can process quantity.
Step 3003, according to the reception of message order, the message received is registered in the default queue of queue lists by the order module of switch.
Particularly, in order module, the queue lists of buffer memory comprises the default queue of a recorded message reception order; The register instruction of the message that order module sends according to distribution module, message assignment message is identified, then number according to the processor of the processor core of this message of process carried in register instruction, set up processor and number the first corresponding relation with the message identification distributing to this message, then message identification is put into default queue, complete the registration of message.
Wherein, message identification is set of number string, uniquely can identify message for making the order module of switch.In different switches, the message identification that message is assigned with is different.
Step 301, in the process that the message be assigned to is processed, the type of service that in the polycaryon processor of switch, each processor core is carried according to message, the queue identity of the service queue corresponding with the type of service that message carries is recorded in the message descriptor corresponding with message identification, wherein, message identification distributes message in process message being registered to default queue.
Particularly, each processor core of polycaryon processor is in the process of process message, first message is resolved, obtain the type of service that message carries, according to the type of service that message carries, the second corresponding relation prestored is traveled through, thus find the queue identity that the type of service of carrying with message recorded in the second corresponding relation has the service queue of identical services type, the corresponding relation of generating process device numbering and queue identity, then the corresponding relation of the processor of generation numbering and queue identity is sent to order module, order module is according to the processor numbering obtained and the corresponding relation of queue identity, corresponding message identification is found by processor numbering, then the queue identity of carrying in the corresponding relation of processor numbering and queue identity is recorded in the message descriptor corresponding with message identification.
Wherein, the type of service of service queue and the second corresponding relation of queue identity is previously stored with in polycaryon processor.
Wherein, can divide according to the communication protocol of any one deck in any network seven layer protocol the division of the type of service of message.If switch divides message according to the agreement of network layer, the type of service that the message so entering this switch carries is all the agreement of network layer; If switch divides message according to the agreement of transport layer, the type of service that the message so entering this switch carries is all the agreement of transport layer.Such as, can be (English: InternetProtocol according to the agreement interconnected between the network of network layer, abbreviation: IP) and internet data packet switching protocol (English: Internetwork Packet Exchangeprotocol, abridge: division IPX) message being carried out to type of service.
Wherein, queue lists, except comprising default queue, also comprises multiple service queue carrying out classifying according to different types of service; Each service queue has queue identity respectively.
Wherein, message descriptor and message identification are relations one to one, are stored in advance in order module, in the process forwarded by switch for recorded message the message information that uses.The message received when switch is registered and after being assigned with message identification, will to record in the message descriptor corresponding at the message identification be assigned with in the process forwarded by switch the message information that uses.
Wherein, the queue identity of the service queue that the queue identity recorded in message descriptor is moved to for recorded message; Queue identity is default value in an initial condition; When determining message and should being moved in certain service queue, just the queue identity recorded in the message descriptor of this message is revised as the queue identity numbering of corresponding service queue from default value.
Wherein, if each processor core, in the process of process message, does not find the service queue corresponding with the type of service of message, so just revising the queue identity recorded in the message descriptor of this message is the queue identity retaining queue.
Wherein, retaining queue is the service queue that in multiple service queue, queue identifier number is maximum.
Wherein, each processor core in polycaryon processor processes message according to being preset in each processor core software in the heart.
Wherein, the function that the process of each processor core to message realizes is determined by the software preset, as to the parsing of message and the determination etc. to message repeating port; Certainly, each processor core can also have other processing mode to message, repeat no longer one by one here.
Wherein, the quantity of processor core that polycaryon processor comprises can be 2,4 or 8.The processor core quantity that polycaryon processor comprises is more, illustrates that the parallel processing capability of this polycaryon processor to message is stronger.
Alternatively, can be not only processor core to the equipment of Message processing in polycaryon processor, also can be other existing hardware acceleration engine that can be arranged on arbitrarily in polycaryon processor, repeat no longer one by one here.
Step 302, after Message processing completes, the message identification of message, according to the queue identity recorded in the message descriptor of message, moves to the service queue corresponding with the queue identity recorded from default queue by the order module of switch.
Particularly, the flow process of step 302 is specifically described by step 3021-step 3023.
The order module of step 3021, switch judges that whether the message identification of the message processed is first message identification in default queue.
If switch determines that the message identification of the message processed is first message identification in default queue, so carry out step 3022.
If switch determines that the bid quotation knowledge of the message processed is not first message identification in default queue, so carry out step 3023.
Wherein, message descriptor has also comprised mark, completing mark for representing whether message is processed by polycaryon processor, not being completed during polycaryon processor process and being designated 0, complete being designated 1 when message is completed by polycaryon processor process at message.
Particularly, after process completes certain message, the polycaryon processor of switch can send the Message processing carrying processor numbering and complete order to order module, order module completes the processor numbering of carrying in order according to Message processing, find out the message identification that this processor numbering is corresponding, the mark that completes in the message descriptor that the message identification then this found out is corresponding is set to 1; Whether then order module can judge whether the mark that completes of the message descriptor record that first message identification of default queue is corresponding is 1, be that first message identification in default queue judges to the message identification of the message processed.
If step 3022 determines that the message identification of the message processed is first message identification in default queue, then the order module of switch is according to the queue identity recorded in the message descriptor of message, is moved in the service queue corresponding with queue identity by the message identification of first in default queue from default queue.
Particularly, when first message of order module determination default queue message descriptor record complete mark be for 1 time, so order module is according to the queue identity recorded in the message descriptor of message, in default queue first message identification is taken out from default queue, then puts into the service queue corresponding to queue identity recorded with message descriptor.
If step 3023 determines that first message identification in the message identification of the message processed and default queue is inconsistent, then the message identification of message that this process temporarily can not complete according to queue identity by the order module of switch moves in corresponding service queue.
Particularly, if when the completing of the message descriptor record that first message identification of order module determination default queue is corresponding is designated 0, then the message identification of message that this process temporarily can not complete according to queue identity by the order module of switch moves in corresponding service queue; And order module periodically can judge whether the mark that completes of first message descriptor record of default queue is 1, only when completing of determining to record in the message identifier that first message identification of default queue is corresponding is designated 1, illustrate that first message in now default queue has processed, just the message identification of this message can be moved in the service queue corresponding with queue identity.
Wherein, order module is logical circuit.
By step 3021 to the description of step 3023, the possibility of packet congestion can be reduced further.By only the message descriptor of first in default queue being moved in corresponding service queue, ensure that the sequence consensus that the order of message in service queue inputs with message, when can message be avoided to export, occurring out of order situation.
The message processed is sent to by arbitration modules the cache module pre-set and carries out buffer memory by each processor core of the polycaryon processor of step 303, switch.
Wherein, message descriptor also comprises buffer address, and buffer address is for recording the packet buffer that completed by polycaryon processor process to the physical address in the cache module of switch.
Particularly, after managing the complete message of device core processing throughout, each processor core of polycaryon processor can be sent to cache module to by the message processed by arbitration modules, and sends the cache instruction with processing into the processor numbering that this treats the processor core of buffer memory message to cache module, the message of reception is first carried out buffer memory by the cache module of switch, then according to the processor numbering that cache instruction carries, generating process this processor numbering of the processor core of buffer memory message and the 3rd corresponding relation of buffer address, then the 3rd corresponding relation generated is sent to order module, order module is according to the processor numbering in the 3rd corresponding relation received, found in default queue with the first corresponding relation by the mode of traversal and number corresponding message identification with this processor, corresponding message identifier is being found by message identification, then the buffer address in the 3rd corresponding relation is recorded in queue descriptor, then order module is according to the processor numbering recorded in the 3rd corresponding relation, the state of processor core corresponding for this processor numbering is revised as the free time by busy by notice distribution module, and discharge the first corresponding relation of this processor numbering and the message identification of the message of buffer memory.
Wherein, cache module is buffer.
Wherein, each processor core is different from the release time of message identification, and each processor core will discharge after having processed distributed message, thus the next message be assigned with of process; And message identification only just can be released after message exports, thus distribute to next message when registering the message received.
Processor core in existing polycaryon processor is when processing message, may occur that multiple processor core processes the situation of message simultaneously, cache module is to receive and these messages processed of buffer memory simultaneously, so could carry out buffer memory to multiple message processed simultaneously with regard to the bandwidth that needs one are larger, if when the bandwidth of cache module design does not reach and carries out the demand of buffer memory to multiple message processed simultaneously, the message that then can not process these carries out buffer memory, if want cache module to carry out buffer memory to multiple message simultaneously, that is in the design carrying out cache module, just should design a larger bandwidth for cache module, but this can increase the design cost of switch in the process of the circuit design of switch.
Therefore, in step 303, when there being at least two processor cores to process message simultaneously, the arbitration modules of switch according to the order of at least two processor cores numberings completing Message processing simultaneously, by the mode of poll by the packet buffer processed simultaneously in the cache module pre-set.
Particularly, be provided with the port of multiple reception message in arbitration modules, these receive the port of message and each processor core one_to_one corresponding, such as: processor core 1 corresponding ports a, processor core 2 corresponding ports b etc.After having processor core process to complete message, this processor core will send message to the port of the arbitration modules of correspondence, by receiving the port of message, such arbitration modules will know which processor core process is over message, so when there being at least two processor cores to process message simultaneously, arbitration modules first carries out buffer memory to the message received, then the numbering of the processor core of process message just can have been known according to the port numbers receiving message simultaneously, thus according to the order that processor is numbered, by the mode of poll, the multiple messages simultaneously processed are cached in the cache module pre-set successively.
Wherein, arbitration modules is MUX.
Alternatively, the equipment that arbitration modules adopts can be not only MUX, also can be other existing hardware that can realize arbitrarily arbitration modules function, repeat no longer one by one here.
By the description of step 303, when the message that the multiple process of buffer memory completes, according to the order of at least two processor core marks, successively the multiple messages received are carried out buffer memory, therefore cache module only needs buffer memory message at every turn, and there will not be the situation of a multiple message of buffer memory, makes when the bandwidth of the cache module designing switch, the bandwidth of design only need meet a message and can pass through and enter cache module, thus saves the design cost of switch.
Step 304, from the service queue that priority is the highest, the cache module of switch is according to the Sequential output message of the message identification recorded in service queue each in order module.
Particularly, the flow process of step 304 is specifically described by step 3041-step 3043.
Step 3041, when getting the instruction of outgoing message, the order module of switch determines multiple service queues with priority.
Wherein, in different application scenarioss, switch all can use the situation of service according to user, and preferential output provides user the current message using service, and which service message can provide be that type of service by carrying is distinguished.And the order module of switch is before message exports, according to the type of service that message carries, message is assigned in different service queues, so the difference of service that the order module of switch can use according to user under different application scenarioss, in advance to providing the service queue of user's current service to arrange high priority in multiple service queue.As shown in Figures 4 to 6, for arranging the schematic diagram of priority in the present embodiment to service queue.
Further, switch can also arrange output priority to other any service queues, in some cases, more can arrange priority to all service queues, repeat no longer one by one here.
Such as: user passes through to download software download video file while carrying out online game, so the order module of switch will according to the service of the current use of user, determine to provide the priority of the service queue of data of network game message to be limit priority in multiple service queue, determine to provide the priority of the service queue of the data message of foradownloaded video to be the second high priority, other service queues do not arrange priority.
Step 3042, from the service queue that priority is the highest, the cache module of switch, according to the order of the message identification recorded in the service queue of order module, exports the message of buffer memory.
Particularly, the order module of switch obtains the buffer address of message from message descriptor corresponding to each message identification according to the order of message identification in the highest service queue of fixed priority, then according to the order obtaining buffer address, the buffer address got is sent to cache module, cache module reads message from the buffer address obtained, and is exported by the message read; Then order module obtains the buffer address of message from message descriptor corresponding to each message identification according to the order of message identification in the high service queue of priority second, then according to the order obtaining buffer address, the buffer address got is sent to cache module, cache module reads message from the buffer address obtained, and is exported by the message read; By that analogy, until export all messages had in the service queue of priority.
Wherein, switch can use existing arbitrary mode to carry out searching of message, repeats no longer one by one here.
Step 3043, when there being service queue not arrange priority, switch is according to the order of queue identity of service queue not arranging priority, and poll exports message corresponding to first message identification respectively do not arranged in the service queue of priority.
Particularly, the cache module of switch obtains according to the order poll of queue identity of the service queue not arranging priority the message descriptor respectively not arranging first message of the service queue of priority, after the message descriptor of first message getting each service queue, cache module finds corresponding message according to the buffer address of the message recorded in message descriptor, is exporting first message of the service queue not arranging priority in turn.
First message of service queue refers to and comes the message that in service queue, the message identification of most advanced position is corresponding.
By step 3041 to the description of step 3043, under different business scenarios, the type of the data of process is different, can for the different business scenario of demand data type, different priority is arranged to multiple service queue, meets the demand that priority treatment data message under different business scenarios is different.
The message processing method that the present embodiment provides, by in the process processed the message be assigned to, according to the type of service that message carries, the queue identity of the service queue corresponding with the type of service that message carries is recorded in the message descriptor corresponding with message identification, thus after Message processing is completed, 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, from the service queue that priority is the highest, according to the message that the message identification recorded in each service queue of priority Sequential output is from high to low corresponding, owing to being the service queue according to the type of service determination message place of message in the processing procedure of message, and service queue is provided with to the priority of outgoing message, so can according to the difference of application scenarios, the output order of configuration message flexibly, and, according to the priority of service queue, when can export at the message prior determining to carry certain type of service, the message that just directly can carry out this type of service carries out output function, and avoid the existing defect needing to wait for that the message inputted before first message of the message of this type of service could export after being output.
Embodiment three
See Fig. 7, present embodiments provide a kind of message process device, this device comprises:
Distribution module 400, for distributing the message received, according to the reception order of message, the message received is registered in the default queue of queue lists, wherein, queue lists also comprises multiple service queue carrying out classifying according to different types of service, and each service queue has queue identity;
Processing module 401, for the type of service of carrying according to message, the queue identity of the service queue corresponding with the type of service that message carries be recorded in the message descriptor corresponding with message identification, wherein, message identification distributes message in process message being registered to default queue;
Adjust sequence module 402, for according to the queue identity recorded in the message descriptor of message, the message identification of message is moved to the service queue corresponding with the queue identity recorded from default queue;
Output module 403, for the service queue the highest from priority, according to the order of the message identification recorded in each service queue, outgoing message.
The message process device that the present embodiment provides, by in the process processed the message be assigned to, according to the type of service that message carries, the queue identity of the service queue corresponding with the type of service that message carries is recorded in the message descriptor corresponding with message identification, thus after Message processing is completed, 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, from the service queue that priority is the highest, according to the message that the message identification recorded in each service queue of priority Sequential output is from high to low corresponding, owing to being the service queue according to the type of service determination message place of message in the processing procedure of message, and service queue is provided with to the priority of outgoing message, so can according to the difference of application scenarios, the output order of configuration message flexibly, and, according to the priority of service queue, when can export at the message prior determining to carry certain type of service, the message that just directly can carry out this type of service carries out output function, and avoid the existing defect needing to wait for that the message inputted before first message of the message of this type of service could export after being output.
Embodiment four
See Fig. 8, present embodiments provide a kind of message process device, this device comprises:
Distribution module 500, for distributing the message received, according to the reception order of message, the message received is registered in the default queue of queue lists, wherein, queue lists also comprises multiple service queue carrying out classifying according to different types of service, and each service queue has queue identity;
Processing module 501, for the type of service of carrying according to message, the queue identity of the service queue corresponding with the type of service that message carries be recorded in the message descriptor corresponding with message identification, wherein, message identification distributes message in process message being registered to default queue;
Adjust sequence module 502, for according to the queue identity recorded in the message descriptor of message, the message identification of message is moved to the service queue corresponding with the queue identity recorded from default queue;
Cache module 503, for carrying out buffer memory to the message processed.
Output module 504, for the service queue the highest from priority, according to the order of the message identification recorded in each service queue, the message of buffer memory in output buffer module 503.
Particularly, adjust sequence module 502 for:
Judge that whether the message identification of the message processed is first message identification in default queue;
The message identification of the message processed if determine is first message identification in default queue, then according to the queue identity recorded in the message descriptor of message, the message identification of first in default queue is moved in the service queue corresponding with the queue identity recorded from default queue.
Particularly, in cache module 503:
When there being at least two processor cores to process message simultaneously, according to the order that at least two processor cores completing Message processing are numbered simultaneously, by the mode of poll, the message simultaneously processed is carried out buffer memory.
Particularly, output module 504 for:
When getting the instruction of outgoing message, determine multiple service queues with priority;
From the service queue that priority is the highest, according to the order of the message identification recorded in service queue, the message of buffer memory in output buffer module.
When there being service queue not arrange priority, output module 504 also for:
According to the order of queue identity of service queue not arranging priority, poll exports message corresponding to first message identification respectively do not arranged in the service queue of priority.
The message process device that the present embodiment provides, by in the process processed the message be assigned to, according to the type of service that message carries, the queue identity of the service queue corresponding with the type of service that message carries is recorded in the message descriptor corresponding with message identification, thus after Message processing is completed, 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, from the service queue that priority is the highest, according to the message that the message identification recorded in each service queue of priority Sequential output is from high to low corresponding, owing to being the service queue according to the type of service determination message place of message in the processing procedure of message, and service queue is provided with to the priority of outgoing message, so can according to the difference of application scenarios, the output order of configuration message flexibly, and, according to the priority of service queue, when can export at the message prior determining to carry certain type of service, the message that just directly can carry out this type of service carries out output function, and avoid the existing defect needing to wait for that the message inputted before first message of the message of this type of service could export after being output.
It should be noted that: the message process device that above-described embodiment provides is when processing message, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, internal structure by device is divided into different functional modules, to complete all or part of function described above.In addition, the message process device that above-described embodiment provides and message processing method embodiment belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be read-only memory, disk or CD etc.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.

Claims (10)

1. a message processing method, is characterized in that, described method comprises:
Distribute the message received, according to the reception order of message, the message received is registered in the default queue of queue lists, wherein, described queue lists also comprises multiple service queue carrying out classifying according to different types of service, and each described service queue has queue identity;
In the process that the message be assigned to is processed, according to the described type of service that message carries, the queue identity of the described service queue corresponding with the described type of service that message carries is recorded in the message descriptor corresponding with message identification, wherein, described message identification distributes message in process message being registered to default queue;
After Message processing completes, according to the queue identity recorded in the message descriptor of described message, the message identification of described message is moved to the service queue corresponding with the described queue identity recorded from default queue;
From the service queue that priority is the highest, according to the message identification recorded in each described service queue Sequential output described in message.
2. message processing method according to claim 1, it is characterized in that, it is described after Message processing completes, according to the queue identity recorded in the message descriptor of described message, the message identification of described message is moved to from default queue step in the service queue corresponding with the described queue identity recorded and comprises:
Judge that whether the message identification of the described message processed is first message identification in described default queue;
The message identification of the described message processed if determine is first message identification in described default queue, then according to the queue identity recorded in the message descriptor of described message, described first message identification in described default queue is moved in the service queue corresponding with the described queue identity recorded from default queue.
3. message processing method according to claim 1, it is characterized in that, described after Message processing completes, according to the queue identity recorded in the message descriptor of described message, moved to the service queue corresponding with the described queue identity recorded after step from default queue by the message identification of described message, described method also comprises:
Buffer memory is carried out to the message processed.
4. message processing method according to claim 3, is characterized in that, carries out in the step of buffer memory at the described message to having processed:
When there being at least two processor cores to process message simultaneously, according to the order completing at least two processor core numberings described in Message processing simultaneously, by the mode of poll, the described message simultaneously processed is carried out buffer memory.
5. message processing method according to claim 1, is characterized in that, when there being service queue not arrange priority, described method also comprises:
According to the order of queue identity of service queue not arranging priority, poll exports message corresponding to first message identification respectively do not arranged in the described service queue of priority.
6. a message process device, is characterized in that, described device comprises:
Distribution module, for distributing the message received, according to the reception order of message, the message received is registered in the default queue of queue lists, wherein, described queue lists also comprises multiple service queue carrying out classifying according to different types of service, and each described service queue has queue identity;
Processing module, for the described type of service of carrying according to message, the queue identity of the described service queue corresponding with the described type of service that message carries is recorded in the message descriptor corresponding with message identification, wherein, described message identification distributes message in process message being registered to default queue;
Adjust sequence module, for according to the queue identity recorded in the message descriptor of described message, the message identification of described message is moved to the service queue corresponding with the described queue identity recorded from default queue;
Output module, for the service queue the highest from priority, according to the Sequential output message of the message identification recorded in each described service queue.
7. message process device according to claim 6, is characterized in that, described tune sequence module is used for:
Judge that whether the message identification of the described message processed is first message identification in described default queue;
The message identification of the described message processed if determine is first message identification in described default queue, then according to the queue identity recorded in the message descriptor of described message, described first message identification in described default queue is moved in the service queue corresponding with the described queue identity recorded from default queue.
8. message process device according to claim 6, is characterized in that, described device also comprises:
Cache module, for carrying out buffer memory to the message processed.
9. message process device according to claim 8, is characterized in that, in described cache module:
When there being at least two processor cores to process message simultaneously, according to the order completing at least two processor core numberings described in Message processing simultaneously, by the mode of poll, the described message simultaneously processed is carried out buffer memory.
10. message process device according to claim 6, is characterized in that, when there being service queue not arrange priority, described output module also for:
According to the order of queue identity of service queue not arranging priority, poll exports message corresponding to first message identification respectively do not arranged in the described service queue of priority.
CN201410667090.XA 2014-11-20 2014-11-20 A kind of message processing method and device Active CN104468401B (en)

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 true CN104468401A (en) 2015-03-25
CN104468401B 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)

Cited By (13)

* Cited by examiner, † Cited by third party
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
CN107656896A (en) * 2017-09-12 2018-02-02 新华三信息安全技术有限公司 A kind of polycaryon processor and message processing method
CN107682265A (en) * 2017-09-07 2018-02-09 北京驰波信息工程有限公司 The packet routing method and device of payment system
CN108768882A (en) * 2018-04-23 2018-11-06 烽火通信科技股份有限公司 A kind of processing method and system of protocol massages
CN109062781A (en) * 2018-06-22 2018-12-21 北京星网锐捷网络技术有限公司 A kind of message buffer management method and device
CN109150755A (en) * 2018-09-25 2019-01-04 西安空间无线电技术研究所 A kind of spaceborne message dispatching method of space-based data-link and device
CN109246023A (en) * 2018-11-16 2019-01-18 锐捷网络股份有限公司 Flow control methods, the network equipment and storage medium
CN109962760A (en) * 2019-04-09 2019-07-02 湖南智领通信科技有限公司 A kind of business scheduling method suitable for wireless TDMA ad hoc network
CN110636071A (en) * 2019-09-26 2019-12-31 光大兴陇信托有限责任公司 Interface docking method
CN110830386A (en) * 2019-11-14 2020-02-21 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Method, device and system for preserving order of messages
CN111163018A (en) * 2019-12-02 2020-05-15 华为技术有限公司 Network equipment and method for reducing transmission delay thereof
CN111698175A (en) * 2020-06-24 2020-09-22 北京经纬恒润科技有限公司 Message receiving and sending method and system for gateway
CN112099975A (en) * 2020-09-25 2020-12-18 Oppo广东移动通信有限公司 Message processing method and system, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
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
US20140211718A1 (en) * 2009-03-11 2014-07-31 Sony Electronics Inc. Quality of Service Traffic Recognition and Packet Classification for Home Mesh Network
CN104158764A (en) * 2014-08-12 2014-11-19 杭州华三通信技术有限公司 Message processing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
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
US20140211718A1 (en) * 2009-03-11 2014-07-31 Sony Electronics Inc. Quality of Service Traffic Recognition and Packet Classification for Home Mesh Network
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)

* Cited by examiner, † Cited by third party
Title
李寅: "基于区分服务的拥塞控制算法研究", 《中国优秀硕士学位论文全文数据库信息科技辑(2012)》 *

Cited By (17)

* Cited by examiner, † Cited by third party
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
CN107682265A (en) * 2017-09-07 2018-02-09 北京驰波信息工程有限公司 The packet routing method and device of payment system
CN107656896B (en) * 2017-09-12 2020-07-07 新华三信息安全技术有限公司 Multi-core processor and message processing method
CN107656896A (en) * 2017-09-12 2018-02-02 新华三信息安全技术有限公司 A kind of polycaryon processor and message processing method
CN108768882A (en) * 2018-04-23 2018-11-06 烽火通信科技股份有限公司 A kind of processing method and system of protocol massages
CN109062781A (en) * 2018-06-22 2018-12-21 北京星网锐捷网络技术有限公司 A kind of message buffer management method and device
CN109150755A (en) * 2018-09-25 2019-01-04 西安空间无线电技术研究所 A kind of spaceborne message dispatching method of space-based data-link and device
CN109150755B (en) * 2018-09-25 2022-03-04 西安空间无线电技术研究所 Space-based data link satellite-borne message scheduling method and device
CN109246023A (en) * 2018-11-16 2019-01-18 锐捷网络股份有限公司 Flow control methods, the network equipment and storage medium
CN109962760A (en) * 2019-04-09 2019-07-02 湖南智领通信科技有限公司 A kind of business scheduling method suitable for wireless TDMA ad hoc network
CN110636071A (en) * 2019-09-26 2019-12-31 光大兴陇信托有限责任公司 Interface docking method
CN110830386A (en) * 2019-11-14 2020-02-21 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Method, device and system for preserving order of messages
CN111163018A (en) * 2019-12-02 2020-05-15 华为技术有限公司 Network equipment and method for reducing transmission delay thereof
CN111698175A (en) * 2020-06-24 2020-09-22 北京经纬恒润科技有限公司 Message receiving and sending method and system for gateway
CN111698175B (en) * 2020-06-24 2023-09-19 北京经纬恒润科技股份有限公司 Message receiving and transmitting method and system for gateway
CN112099975A (en) * 2020-09-25 2020-12-18 Oppo广东移动通信有限公司 Message processing method and system, and storage medium
CN112099975B (en) * 2020-09-25 2024-03-26 Oppo广东移动通信有限公司 Message processing method and system and storage medium

Also Published As

Publication number Publication date
CN104468401B (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN104468401A (en) Message processing method and device
US10659315B2 (en) Virtual network function (VNF) relocation in a software defined network (SDN)
CN112039942A (en) Subscription and publishing method and server
EP2613479A1 (en) Relay device
US11343307B2 (en) Virtual network function (VNF) resource management in a software defined network (SDN)
TW200915084A (en) Allocating network adapter resources among logical partitions
US9847937B2 (en) Hardware acceleration for routing programs
US9590922B2 (en) Programmable and high performance switch for data center networks
US8725873B1 (en) Multi-server round robin arbiter
WO2010036656A2 (en) Directing data units to a core supporting tasks
WO2016175768A1 (en) Map tables for hardware tables
CN115426312B (en) Method and device for managing, optimizing and forwarding identifiers in large-scale multi-modal network
CN103067295A (en) Method and device and system for service transmission
CN111382115B (en) Path creating method and device for network on chip and electronic equipment
US9641611B2 (en) Logical interface encoding
US10616116B1 (en) Network traffic load balancing using rotating hash
CN110737530B (en) Method for improving packet receiving capacity of HANDLE identification analysis system
CN106209634B (en) Learning method and device of address mapping relation
CN114079634B (en) Message forwarding method and device and computer readable storage medium
CN114257545B (en) Message forwarding method and device
JP2011091711A (en) Node, method for distributing transmission frame, and program
CN113918504A (en) Method and device for realizing isolation group
CN111679918B (en) Message transmission method and device
CN110896378B (en) Network traffic forwarding method and device, electronic equipment and machine-readable storage medium
US11271897B2 (en) Electronic apparatus for providing fast packet forwarding with reference to additional network address translation table

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: Super fusion Digital Technology 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