CN110149281A - A kind of message forwarding method, device and program product, storage medium - Google Patents

A kind of message forwarding method, device and program product, storage medium Download PDF

Info

Publication number
CN110149281A
CN110149281A CN201910446373.4A CN201910446373A CN110149281A CN 110149281 A CN110149281 A CN 110149281A CN 201910446373 A CN201910446373 A CN 201910446373A CN 110149281 A CN110149281 A CN 110149281A
Authority
CN
China
Prior art keywords
message
transmit queue
forwarding
forwarded
common
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
CN201910446373.4A
Other languages
Chinese (zh)
Other versions
CN110149281B (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Neusoft Corp filed Critical Neusoft Corp
Priority to CN201910446373.4A priority Critical patent/CN110149281B/en
Publication of CN110149281A publication Critical patent/CN110149281A/en
Application granted granted Critical
Publication of CN110149281B publication Critical patent/CN110149281B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6255Queue scheduling characterised by scheduling criteria for service slots or service orders queue load conditions, e.g. longest queue first

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the present application discloses a kind of message forwarding method and device, specially, for forwarding processor each in message forwarding system and network interface card, two message transmit queues are established between forwarding processor and network interface card, and set the different message transmit queue of priority for two message transmit queues.After forwarding processor receives message to be forwarded, the type of the message to be forwarded is determined, to determine the message transmit queue for sending the message to be forwarded according to the type of message to be forwarded.When the type of message to be forwarded is common message, the first message transmit queue is added in common message, is sent with the message transmitting party formula using no parity check operation;When the type of message to be forwarded is complicated message, by the complexity message the second message transmit queue of addition, to be sent using general message sending method.That is, accelerating message transferring speed by establishing two message transmit queues, whole performance of giving out a contract for a project is promoted.

Description

A kind of message forwarding method, device and program product, storage medium
Technical field
This application involves fields of communication technology, and in particular to a kind of message forwarding method, device and program product, storage are situated between Matter.
Background technique
For security firm, the forwarding performance of firewall box is important indicator.With the continuous development of technology, soft Part firewall, such as the firewall based on DPDK (Data Plane Development Kit, data plane development kit), The message forwarding of larger flow may be implemented.The repeater system of software firewall is primarily implemented in User space and receives report from network interface card Text simultaneously forwards the packet away.Currently, simply promoting the time of any one algorithm in the forwarding processor of software firewall And complexity, it can no longer meet the promotion demand of forwarding performance, therefore, how further to promote the forwarding of firewall box It can be a technical problem to be solved urgently.
Summary of the invention
In view of this, the embodiment of the present application provides a kind of message forwarding method, device and Related product, it is further to realize Promote the forwarding performance of firewall box.
To solve the above problems, technical solution provided by the embodiments of the present application is as follows:
A kind of message forwarding method, the method are applied to the forwarding processor in message forwarding system, and the message turns Hair system includes at least one forwarding processor, established between the forwarding processor and network interface card the first message transmit queue and Second message transmit queue, which comprises
The forwarding processor receives message to be forwarded;
Determine the type of the message to be forwarded;
If the type of the message to be forwarded is common message, first message is added in the common message and sends team Column, the first message transmit queue are sent using the message transmitting party formula of no parity check operation;
If the type of the message to be forwarded is complicated message, second message is added in the complicated message and sends team Column, the second message transmit queue are sent using general message sending method.
In one possible implementation, the method also includes:
When the first message transmit queue can not be added in the common message, by the common message addition described second Message transmit queue is sent.
In one possible implementation, the method also includes:
The first message transmit queue is detected according to preset time interval and/or whether the second message transmit queue is in high negative Load state;
If it is determined that the first message transmit queue and the second message transmit queue are in high load condition, it will be described Common message or the complicated message move to idle forwarding processor and are handled;
If it is determined that the first message transmit queue is in high load condition, the second message transmit queue is not in height The second message transmit queue is added in the common message or the complicated message by load condition;
If it is determined that the first message transmit queue is not in high load condition, the second message transmit queue is in height The complicated message is moved to the idle forwarding processor and handled by load condition;
If it is determined that the first message transmit queue and the second message transmit queue are not in high load condition, by institute It states common message and the first message transmit queue or the second message transmit queue is added, or institute is added in the complicated message State the second message transmit queue.
In one possible implementation, the detection the first message transmit queue and/or the second message are sent Whether queue is in high load condition, comprising:
When the type of the message to be forwarded is common message, the common message can not be added first message and send When queue, determine that the first message transmit queue is in high load condition;
When the type of the message to be forwarded is common message or complicated message, the common message or complicated message can not When the second message transmit queue is added, determine that the second message transmit queue is in high load condition.
In one possible implementation, described by the common message or the complicated message moves to the sky Not busy forwarding processor is handled, comprising:
When there are the session informations of the common message perhaps complicated message by the common message or described multiple Miscellaneous message and its corresponding session information move to the idle forwarding processor, so that the free time forwarding processor is to institute It states common message or the complicated message is sent;
When there is no the session informations of the common message perhaps complexity by the common message or the complexity Message moves to the idle forwarding processor, so that the free time forwarding processor establishes the common message or described multiple Miscellaneous session information is simultaneously sent.
In one possible implementation, the determination of the idle forwarding processor includes:
Transmission message amount of each forwarding processor in the unit time to the network interface card is obtained from configuration processor;
It will be determined as sky to the forwarding processor that the transmission message amount of the network interface card meets preset condition in the unit time Not busy forwarding processor.
A kind of apparatus for forwarding message, described device are applied to the forwarding processor in message forwarding system, and the message turns Hair system includes at least one forwarding processor, established between the forwarding processor and network interface card the first message transmit queue and Second message transmit queue, described device include:
Receiving unit receives message to be forwarded for the forwarding processor;
First determination unit, for determining the type of the message to be forwarded;
First adding unit, the judging result for working as first judging unit are that the type of the message to be forwarded is The first message transmit queue is added in the common message by common message, and the first message transmit queue is using no school The message transmitting party formula for testing operation is sent;
Second adding unit, the judging result for working as first judging unit are that the type of the message to be forwarded is The second message transmit queue is added in the complicated message by complicated message, and the second message transmit queue is using general Message transmitting party formula is sent.
In one possible implementation, second adding unit is also used to not to be added when the common message The message to be forwarded is added the second message transmit queue and sent by the first message transmit queue.
A kind of computer readable storage medium is stored with instruction in the computer readable storage medium storing program for executing, works as described instruction When running on the terminal device, so that the method that the terminal device executes above-mentioned message forwarding.
A kind of computer program product, when the computer program product is run on the terminal device, so that the terminal The method that equipment executes above-mentioned message forwarding.
It can be seen that the embodiment of the present application has the following beneficial effects:
The embodiment of the present application establishes two message transmit queues, i.e. the first message first between forwarding processor and network interface card Transmit queue and the second message transmit queue.After forwarding processor receives message to be forwarded, the class of message to be forwarded is judged Type, to select corresponding message transmit queue according to the type of message to be forwarded.When the type of message to be forwarded is common report The first message transmit queue is added in message to be forwarded by Wen Shi, is sent with the message transmitting party formula using no parity check operation; When the type of message to be forwarded is complicated message, the second message transmit queue is added in message to be forwarded, to use general report Literary sending method is sent.As it can be seen that the embodiment of the present application is sent out by the message redesigned between forwarding processor and network interface card Queue mapping relations are sent, establish two message transmit queues for the corresponding network interface card of each forwarding processor, and send out two messages Queue is sent to configure different priority, i.e., common message is quickly sent by the first message transmit queue, and complicated message is by Two message transmit queues are sent, and so as to accelerate to be sent the speed of common message by the first message transmit queue, promote message Forward process performance.
Detailed description of the invention
Fig. 1 is that a kind of message provided by the embodiments of the present application forwards schematic diagram;
Fig. 2 is a kind of flow chart of message forwarding method provided by the embodiments of the present application;
Fig. 3 is the flow chart of another message forwarding method provided by the embodiments of the present application;
Fig. 4 is a kind of apparatus for forwarding message structure chart provided by the embodiments of the present application.
Specific embodiment
In order to make the above objects, features, and advantages of the present application more apparent, with reference to the accompanying drawing and it is specific real Mode is applied to be described in further detail the embodiment of the present application.
Inventor by traditional message forwarding method the study found that the message forwarding system based on DPDK platform development In each network interface card and each processor establish a message transmit queue.When encounter burst flow or system performance by limited time, Give out a contract for a project unsuccessfully since queue of giving out a contract for a project completely may result in, increases message Forwarding Delay, influence forwarding performance.
Based on this, the embodiment of the present application provides a kind of message forwarding method, specifically, for every in message forwarding system A forwarding processor and network interface card, establish two message transmit queues between forwarding processor and network interface card, and by two messages Transmit queue is set as the different message transmit queue of priority.After forwarding processor receives message to be forwarded, determining should The type of message to be forwarded, to determine the message transmit queue for sending the message to be forwarded according to the type of message to be forwarded.When When the type of message to be forwarded is common message, the report that the first message transmit queue uses no parity check operation is added in common message Literary sending method is sent;When the type of message to be forwarded is complicated message, by complexity message addition the second message transmission Queue is sent using general message sending method.That is, quickly sending common message by the first message queue to accelerate to report Literary forwarding speed promotes whole performance of giving out a contract for a project.
Message provided by the embodiments of the present application forwards scheme for ease of understanding, and message shown in Figure 1 forwards schematic diagram.It should Message forwarding system may include that multiple forwarding processors and multiple network interface cards can be with each turns for any one network interface card Hair processor establishes two message transmit queues, i.e. the first message transmit queue and the second message transmit queue.Meanwhile Mei Gezhuan It sends out and there are two message transmit queues between processor and different network interface cards, i.e., there are two between forwarding processor 1 and network interface card 1 There is also two message transmit queues between message transmit queue, with network interface card 2, and there are two messages to send team between network interface card n Column.In specific implementation, forwarding processor can send common message to network interface card by the first message transmit queue, pass through second Message transmit queue sends complicated message to network interface card.
It should be noted that in practical applications, forwarding processor is sent to network interface card establishes the request for sending message queue, Network interface card establishes the first message transmit queue and the second message transmit queue according to request, so that forwarding processor passes through the first message Transmit queue and the second message transmit queue send message.
Scheme provided by the embodiments of the present application for ease of understanding says the message forwarding method below in conjunction with attached drawing It is bright.It should be noted that the present embodiment can be applied to the forwarding processor in message forwarding system, message forwarding system includes At least one forwarding processor can establish two messages in message forwarding system between each forwarding processor and each network interface card Transmit queue, i.e. the first message transmit queue and the second message transmit queue, will pass through two different message transmit queues Send different types of message.
Referring to fig. 2, which is a kind of flow chart of message forwarding method provided by the embodiments of the present application, as shown in Fig. 2, should Method may include:
S201: forwarding processor receives message to be forwarded.
S202: the type of message to be forwarded is determined.
In the present embodiment, forwarding processor receives the message to be forwarded sent to network interface card, and judges the class of message to be forwarded Type, to select to send the queue of the message to be forwarded according to the type of message to be forwarded.Wherein, the type of message to be forwarded can Think common message or complicated message.It can judge that the type of message to be forwarded is common according to message structure in specific implementation Message or complicated message, such as the message of single structure body is common message, the message of more structural bodies is complicated message.Common message When sending without carrying out additional verification operation, the report of no parity check operation can be directly used by the first message transmit queue Literary sending method is sent;Complicated message needs to carry out additional verification operation when sending, such as needs to calculate transmission control Agreement TCP check processed and Internet protocol IP are verified and are waited, and the second message transmit queue carries out after extra process to this message Message is sent, i.e., is sent using general message sending method.
S203: when message to be forwarded type be common message, by common message be added the first message transmit queue, first Message transmit queue is sent using the message transmitting party formula of no parity check operation.
S204: when the type of message to be forwarded is complicated message, being added the second message transmit queue for complicated message, and second Message transmit queue is sent using general message sending method.
In the present embodiment, when determining the type of message to be forwarded by S202, selected according to the type of message to be forwarded Corresponding message transmit queue is selected to be sent.When the type of message to be forwarded is common message, common message is added the One message transmit queue, so that the first message transmit queue is sent using the message transmitting party formula of no parity check operation, i.e., in fact Now quickly give out a contract for a project.When the type of message to be forwarded is complicated message, the second message transmit queue is added in complicated message, so that Second message transmit queue is sent using general message sending method.
It should be noted that in practical application, the transmission label of the first message transmit queue can be set to SIMPLE-FLAGS, to carry out the transmission of common message.First message transmit queue gives out a contract for a project when sending common message and drives nothing Verification need to be calculated and wait complex operations, directly send common message, reduce and send expense, accelerate message transmission speed. The transmission label of second message transmit queue is defaulted as initial configuration, without carrying out additional assignment, can send any class The message of type.Therefore, in specific implementation, for needing the complicated message of specially treated, it is added into the second message and sends team Column, to be sent by the second message transmit queue;For being not necessarily to the common message of specially treated, it is added into the first message Transmit queue, to be sent by the first message transmit queue.
As can be seen from the above description, two message transmit queues, i.e., the first report are established between forwarding processor and network interface card Literary transmit queue and the second message transmit queue.Wherein, the first message transmit queue uses the message transmitting party of no parity check operation Formula sends common message, and the second message transmit queue sends complicated message using general message sending method.Work as forwarding processor After receiving message to be forwarded, the type of message to be forwarded is judged, it, should if the type of message to be forwarded is common message Message to be forwarded is added the first message transmit queue and is quickly sent;If the type of message to be forwarded is complicated message, The second message transmit queue is added in message to be forwarded to send using general message sending method.As it can be seen that by being forwarding Processor and two message transmit queues of network card configuration, and the selection based on type of message progress message transmit queue, Ke Yiti Performance of giving out a contract for a project is risen, performance raising can also reduce message forward delay due to giving out a contract for a project.
It is understood that since the first message transmit queue can be sent without carrying out the message of complex process, and the Two message transmit queues can send any kind of message, therefore, when the first message transmit queue completely leads to give out a contract for a project failure, The second message transmit queue can be added in common message to send, to reduce probability of failure of giving out a contract for a project.Specifically, ought commonly report When the first message transmit queue can not be added in text, the second message transmit queue is added in common message and is sent.It is, working as When common message can not be sent by the first message transmit queue, the second message transmit queue is added in common message, to pass through Second message transmit queue is sent, and message forward process ability is not only promoted, and also reduces probability of failure of giving out a contract for a project.
In specific implementation, after the first message transmit queue is added in message to be forwarded, the first message transmit queue is adopted It treats to E-Packet with quick transmission message driving function and be sent;When by message to be forwarded be added the second message transmit queue Afterwards, the second message transmit queue is treated to E-Packet and be sent using general transmission message driving function.Wherein, it quickly sends Operation of the message driving function without verifying and waiting complex process, for sending common message;General transmission message driving letter Number can be verified and complex process is waited to operate, and common message can be both sent, and can also send complicated message.
It is understood that due to the first message transmit queue and the second message transmit queue can send it is different types of Message in practical application, there may be the first message transmit queues and/or the second message transmit queue to have expired, and causes to report The case where text can not normally be sent.To avoid message loss, forwarding processor is when receiving message, it is first determined works as the first two Whether message transmit queue is in high load condition, to take different measures according to the state of message transmit queue, specifically It can be realized by following steps:
1) the first message transmit queue is detected according to preset time interval and/or whether the second message transmit queue is in high Load condition.
In the present embodiment, forwarding processor can detect the first message transmit queue according to pre-set time interval And/or second message transmit queue whether be in high load condition, to be in high load when other message transmit queue When state, different pass-through modes can be taken to send to currently received message, avoid packet loss.
In specific implementation, a kind of the first message of determination transmit queue is provided, whether the second message transmit queue is in The specific implementation of high load condition may include: when the type of message to be forwarded is common message, which can not When the first message transmit queue is added, determine that the first message transmit queue is in high load condition;When the type of message to be forwarded For common message or complicated message, when the second message transmit queue can not be added in the common message or complicated message, second is determined Message transmit queue is in high load condition.
It is, having shown the first message transmit queue when the first message transmit queue can not be added in common message It is full, additional message can not be sent, it is determined that the first message transmit queue is in high load condition.When common message or complicated report When the second message transmit queue can not be added in text, shows that the second message transmit queue has been expired, additional message can not be sent, then Determine that the second message transmit queue is in high load condition.
It is understood that the state of the first message transmit queue and the state of the second message transmit queue can be mutually It is independent, it is understood that there may be only the first message transmit queue is in high load condition, or only the second message transmit queue is in high negative Load state and the first message transmit queue and the second message transmit queue are in high load condition, below will to it is above-mentioned not Same situation is illustrated.
2) it if it is determined that the first message transmit queue and the second message transmit queue are in high load condition, will commonly report Text or complicated message move to idle forwarding processor and are handled.
It is no matter currently received to be forwarded when two message transmit queues are in high load condition in the present embodiment Message is common message or complicated message, and can not join message transmit queue, then needs to migrate message to be forwarded, It migrates to idle forwarding processor, to be handled using idle forwarding processor.
Wherein, idle forwarding processor can be to give out a contract for a project to load lesser forwarding processor, about idle forwarding processor Determination process will be illustrated in subsequent embodiment.
3) if it is determined that the first message transmit queue is in high load condition, the second message transmit queue is not in high load shape The second message transmit queue is added in common message or complicated message by state.
In the present embodiment, when the first message transmit queue is in high load condition and the second message transmit queue is not in height Load condition shows that the second message transmit queue can continue the forwarding of message.Simultaneously because the second message transmit queue Both common message can be sent, complicated message can also be sent, it therefore, can be by received either common message or complexity The second message transmit queue can be added in message, to be sent by the second message transmit queue.
4) if it is determined that the first message transmit queue is not in high load condition, the second message transmit queue is in high load shape Complicated message is moved to idle forwarding processor and handled by state.
In the present embodiment, when the first message transmit queue is not in high load condition, and the second message transmit queue is in High load condition is to show that the first message transmit queue can continue to use the forwarding for carrying out common message.When the report received When text is complicated message, since the first message transmit queue can not send complicated message, then need complicated message moving to sky Not busy forward process is handled.
It 5), will be common if it is determined that the first message transmit queue is in and the second message transmit queue is not in high load condition The first message transmit queue or the second message transmit queue is added in message, or second message is added in complicated message and sends team Column.
In the present embodiment, when the first message transmit queue and the second message transmit queue are not in high load condition, table Bright two message transmit queues can continue the transmission of message.When the message received is common message, can incite somebody to action The first message transmit queue is added for the common message or the second message transmit queue is sent.When the message received is complexity When message, which can be added the second message transmit queue and sent.
It is understood that when detecting the first message transmit queue and/or the second message hair when certain message is sent When queue being sent to be in high load condition, is detected and waste of resource to avoid receiving message every time, detection can be preset Time interval.Then, according to prefixed time interval, whether detection messages transmit queue is still in high load condition again, if not In high load condition, then the message transmit queue that can use current forwarding processor is sent, and otherwise moves to other In idle forwarding processor.It is, when forwarding processor detects the first message transmit queue and/or the second report at a certain moment It, can be the first message transmit queue and/or be detected after separated in time again when literary transmit queue is in high load condition Whether two message transmit queues are still in high load condition, if taking corresponding transmission measure still in high load condition It is forwarded;If being not in high load condition, sent out using the first message transmit queue or the second message transmit queue It send.
In addition, being in high load condition or second when there is the first message transmit queue in practical message repeating process When message transmit queue is in high load condition, if continuing that above-mentioned message transmit queue for message is added, mistake of giving out a contract for a project will lead to It loses.The scheme of failure of usually solving to give out a contract for a project is to move in the corresponding other idle queues of the network interface card message to be forwarded and carry out Give out a contract for a project load balancing, which is other forwarding processors message transmit queue corresponding with the network interface card.At this time when Preceding forwarding processor needs message to be forwarded being sent to idle forwarding processor, falls the nuclear issue there are message.Moreover, for subsequent Message to be forwarded, which can may also continue through the message operation of falling core because giving out a contract for a project failure just can avoid message Give out a contract for a project failure the problem of, increase message Forwarding Delay, reduce message forwarding performance.
Based on this, the embodiment of the present application provides a kind of message moving method, i.e. conversation shift, current forwarding processor without When method normally E-Packets, by the conversation shift of message to be forwarded into idle forwarding processor, so that the subsequent report of the session Text can directly be sent by free time forwarding processor, to guarantee that the subsequent packet of the session is substantially no longer given out a contract for a project The problem of failure, realizes load balancing of giving out a contract for a project without by carrying out the operation of falling core to each message, gives out a contract for a project unsuccessfully to reduce Probability promotes message forwarding performance, is illustrated below in conjunction with attached drawing to the above method.
Referring to Fig. 3, which is a kind of flow chart of message moving method provided by the embodiments of the present application, as shown in figure 3, should Method may include:
S301: common message or complicated message are moved to idle forwarding processor and handled.
In the present embodiment, message to be forwarded is common message, which can not be added the first message transmit queue, The second message transmit queue can not be added, alternatively, message to be forwarded is complicated message, the second message hair can not be added in complicated message When sending queue, show that current message transmit queue is under high load condition, additional message to be forwarded can not be sent out It send, at this point, idle forwarding processor in message forwarding system is determined, to carry out message to be forwarded using idle forwarding processor Transmission.
In specific implementation, the implementation for present embodiments providing a kind of determining idle processor, specifically, from configuration Each forwarding processor is obtained in processor within the unit time to the transmission message amount of the network interface card;Will the unit time to this The forwarding processor that the transmission message amount of network interface card meets preset condition is determined as idle forwarding processor.
In the present embodiment, current forwarding processor obtains to current network interface card from configuration processor and sends the other each of message A forwarding processor sends message amount within the unit time, and will send message amount within the unit time and meet preset condition Forwarding processor be determined as idle forwarding processor.Wherein, preset condition can be set according to the actual situation, for example, It is determined as idle forwarding processor for the smallest forwarding processor of message amount is sent in the unit time.
In practical applications, message forwarding system may include multiple forwarding processors, each forwarding processor by itself It is sent to configuration processor to the information that each network interface card sends message amount within the unit time to be saved, at a certain forwarding Reason device need to obtain other forwarding processors within the unit time to the transmission message amount of a certain network interface card when, can be from configuration place Device is managed to read.For example, being respectively altogether network interface card 0 and network interface card including 3 forwarding processors cpu0, cpu1 and cpu2 and 2 network interface cards 1.For current forwarding processor cpu0 when receiving the message to be forwarded sent to network interface card 0, which can not be added the The second message transmit queue can not be also added in one message transmit queue.Then cpu0 obtains cpu1 in unit from configuration processor The message amount c2 that interior the message amount c1 and cpu2 sent to network interface card 0 is sent within the unit time to network interface card 0, and judge The corresponding forwarding processor of minimum value is determined idle processor by c1, c2 size.
S302: when there are the session information of common message or complicated message, by common message or complicated message and its is right The session information answered moves to idle forwarding processor, so that idle forwarding processor sends out common message or complicated message It send.
S303: when the session information that common message or complicated message is not present, common message or complicated message are moved to Idle forwarding processor, so that idle forwarding processor is established the session information of common message or complicated message and sent.
In the present embodiment, after determining idle processor, can conversate migration.But before the migration that conversates, It also needs to determine whether the corresponding session information of message to be forwarded (common message or complicated message) has built up.If there is wait turn Transmit messages text session information, show that current forwarding processor has built up the session of message to be forwarded, then by message to be forwarded with And the corresponding session information of message to be forwarded all moves to idle forwarding processor, thus realize conversation shift, so that Idle processor can not only send current message to be forwarded, can also to the corresponding subsequent packet of the session information into Row is sent.
If there is no the session information of message to be forwarded, show that the message to be forwarded is first packet (i.e. for a session The first message that forwarding processor receives), the session information of the message to be forwarded is not yet established in current forwarding processor.This When, only the message to be forwarded need to be moved to idle processor, so that idle forwarding processor establishes the meeting of message to be forwarded Words information simultaneously sends the message to be forwarded.It is, session information is created in idle forwarding processor, it should to utilize Idle forwarding processor carries out the forwarding of subsequent packet, fundamentally avoids establishing session letter in the biggish forwarding processor of load Breath reduces the probability for failure of giving out a contract for a project.
In addition, sent in the first message transmit queue of current forwarding processor and/or the second message in the present embodiment In the case that queue is in high load condition, idle forwarding processor is just determined, rather than in each forwarding or newly-built session When all carry out the determination of idle forwarding processor, to greatly reduce the calculating of load balancing, promote whole forwarding performance.
As can be seen from the above description, current forwarding can solve using the method for conversation shift between multiple forwarding processors Processor give out a contract for a project failure the problem of, substantially reduce current sessions subsequent packet continue send failure probability.
It is understood that above-described embodiment is directed to the first message transmit queue respectively and the second message transmit queue is independent Mark whether in high load condition.In a kind of possible implementation of the embodiment of the present application, can also by the two it is whole into Line flag shows as forwarding processor and whether is in high load condition for network interface card.Specifically, when forwarding processor will be to be forwarded When message is sent successfully, current state is labeled as to be not in high load condition;When the type of the message to be forwarded is common Message, the common message can not be added the first message transmit queue and the second message transmit queue can not be added When, alternatively, the complexity message can not be added second message and send when the type of the message to be forwarded is complicated message When queue, current state is labeled as to be in high load condition.
It should be noted that can be in high load condition for the forwarding processor and net in this kind of implementation Two message transmit queues between card.For example, the two message transmit queues being established for network interface card 1 of forwarding processor 1 without Message to be forwarded is added in method, then is labeled as being in high load condition for the current state of two message transmit queues of network interface card 1, And two message transmit queues between forwarding processor 1 and network interface card 2 can normally send message, then be directed to two of network interface card 2 The current state of message transmit queue is labeled as being not in high load condition.In practical application, receive message to be forwarded it Afterwards, judge whether current state is in high load condition;If current state be in high load condition, by common message or The complexity message moves to idle forwarding processor and is handled.Specifically, when there are common message or complicated messages Common message or complicated message and its corresponding session information are moved to idle forwarding processor by session information, so that Idle forwarding processor sends common message or complicated message;When there is no the session of common message or complexity letters Common message or complicated message are moved to idle forwarding processor by breath, so that idle forwarding processor establishes common message Or it complicated session information and is sent.Similar, current state can also be rejudged after prefixed time interval is It is no to be in high load condition.
It should be noted that message forwarding method is designed based on single forwarding processor in the present embodiment, for message Any one forwarding processor in repeater system can carry out the transmission of message using above-mentioned message forwarding method.It is each It can be carried out parallel between forwarding processor, resource contention is not present, the safety for guaranteeing resource access is locked without consideration, from And concurrency performance can be made to increase and linear increase with forwarding processor number.In addition, the message forwarding side of dialogue-based migration Method can substantially reduce a possibility that giving out a contract for a project failure, so that the number for calling load balancing to calculate is greatly reduced, saving is opened Pin, and then promote disposed of in its entirety performance.
Based on above method embodiment, the embodiment of the present application also provides a kind of apparatus for forwarding message, below in conjunction with attached Figure is illustrated the device.
Referring to fig. 4, which is a kind of apparatus for forwarding message structure chart provided by the embodiments of the present application, as shown in figure 4, described Device is applied to the forwarding processor in message forwarding system, and the message forwarding system includes at least one forwarding processor, The first message transmit queue and the second message transmit queue, the device are established between the forwarding processor and network interface card can wrap It includes:
Receiving unit 401 receives message to be forwarded for the forwarding processor;
First determination unit 402, for determining the type of the message to be forwarded;
First adding unit 403 is common message for the type when the message to be forwarded, the common message is added Enter the first message transmit queue, the first message transmit queue is sent using the message transmitting party formula of no parity check operation;
Second adding unit 404 is complicated message for the type when the message to be forwarded, and the complicated message is added Enter the second message transmit queue, the second message transmit queue is sent using general message sending method.
In one possible implementation, second adding unit is also used to not to be added when the common message The message to be forwarded is added the second message transmit queue and sent by the first message transmit queue.
In one possible implementation, described device further include:
Detection unit, for detecting the first message transmit queue and/or the second message transmission team according to preset time interval Whether column are in high load condition;
Migration units are used for if it is determined that the first message transmit queue and the second message transmit queue are in high negative The common message or the complicated message are moved to idle forwarding processor and handled by load state;
Second adding unit is also used to if it is determined that the first message transmit queue is in high load condition, described Second message transmit queue is not in high load condition, and second report is added in the common message or the complicated message Literary transmit queue;
The migration units are also used to if it is determined that the first message transmit queue is not in high load condition, described Two message transmit queues are in high load condition, and the complicated message is moved to the idle forwarding processor and is handled;
First adding unit is also used to if it is determined that the first message transmit queue and second message send team Column are not in high load condition, and the first message transmit queue is added in the common message or the second message of institute sends team Column;Or,
Second adding unit is also used to the complicated message the second message transmit queue is added.
In one possible implementation, the detection unit, comprising:
First determines subelement, and when the type of the message to be forwarded is common message, the common message can not be added When the first message transmit queue, determine that the first message transmit queue is in the high load condition;
Second determines subelement, is common message or complicated message for the type when the message to be forwarded, described general When the second message transmit queue can not be added in notification text or complicated message, determine that the second message transmit queue is in institute State high load condition.
In one possible implementation, the migration units, comprising:
First migration subelement, for working as the session information there are the common message or the complicated message, by institute It states common message or the complicated message and its corresponding session information moves to the idle forwarding processor, so that institute Idle forwarding processor is stated to send the common message or the complicated message;
Second migration subelement will be described for working as the session information there is no the common message or the complexity Common message or the complexity move to the idle forwarding processor so that the free time forwarding processor establish it is described general Notification text or the session information of the complexity are simultaneously sent.
In one possible implementation, each forwarding processor is obtained from configuration processor in the unit time to institute State the transmission message amount of network interface card;
It will be determined as sky to the forwarding processor that the transmission message amount of the network interface card meets preset condition in the unit time Not busy forwarding processor.
It should be noted that the specific implementation of each unit may refer to above method embodiment, this reality in the present embodiment Example is applied to repeat no more.
In addition, the embodiment of the present application also provides a kind of computer readable storage medium, the computer readable storage medium Instruction is stored in matter, when described instruction is run on the terminal device, so that the terminal device executes report described above The method of text forwarding.
The embodiment of the present application also provides a kind of computer program product, the computer program product is on the terminal device When operation, so that the method that the terminal device executes message forwarding described above.
The embodiment of the present application establishes two message transmit queues, i.e. the first message first between forwarding processor and network interface card Transmit queue and the second message transmit queue.After forwarding processor receives message to be forwarded, the class of message to be forwarded is judged Type, to select corresponding message transmit queue according to the type of message to be forwarded.When the type of message to be forwarded is common report The first message transmit queue is added in message to be forwarded by Wen Shi, is sent with the message transmitting party formula using no parity check operation; When the type of message to be forwarded is complicated message, the second message transmit queue is added in message to be forwarded, to use general report Literary sending method is sent.As it can be seen that the embodiment of the present application is sent out by the message redesigned between forwarding processor and network interface card Queue mapping relations are sent, establish two message transmit queues for the corresponding network interface card of each forwarding processor, and send out two messages Queue is sent to configure different priority, i.e., common message is quickly sent by the first message transmit queue, and complicated message is by Two message transmit queues are sent, and so as to accelerate to be sent the speed of common message by the first message transmit queue, promote message Forward process performance.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment emphasis is said Bright is the difference from other embodiments, and the same or similar parts in each embodiment may refer to each other.For reality For applying system or device disclosed in example, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, phase Place is closed referring to method part illustration.
It should be appreciated that in this application, " at least one (item) " refers to one or more, and " multiple " refer to two or two More than a."and/or" indicates may exist three kinds of relationships, for example, " A and/or B " for describing the incidence relation of affiliated partner It can indicate: only exist A, only exist B and exist simultaneously tri- kinds of situations of A and B, wherein A, B can be odd number or plural number.Word Symbol "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or"." at least one of following (a) " or its similar expression, refers to Any combination in these, any combination including individual event (a) or complex item (a).At least one of for example, in a, b or c (a) can indicate: a, b, c, " a and b ", " a and c ", " b and c ", or " a and b and c ", and wherein a, b, c can be individually, can also To be multiple.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation There are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to contain Lid non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments makes professional and technical personnel in the field can be realized or use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the application.Therefore, the application It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one The widest scope of cause.

Claims (10)

1. a kind of message forwarding method, which is characterized in that the method is applied to the forwarding processor in message forwarding system, institute Stating message forwarding system includes at least one forwarding processor, and the transmission of the first message is established between the forwarding processor and network interface card Queue and the second message transmit queue, which comprises
The forwarding processor receives message to be forwarded;
Determine the type of the message to be forwarded;
If the type of the message to be forwarded is common message, the first message transmit queue is added in the common message, The first message transmit queue is sent using the message transmitting party formula of no parity check operation;
If the type of the message to be forwarded is complicated message, the second message transmit queue is added in the complicated message, The second message transmit queue is sent using general message sending method.
2. the method according to claim 1, wherein the method also includes:
When the first message transmit queue can not be added in the common message, by the common message addition second message Transmit queue is sent.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
The first message transmit queue is detected according to preset time interval and/or whether the second message transmit queue is in high load shape State;
If it is determined that the first message transmit queue and the second message transmit queue are in high load condition, it will be described common Message or the complicated message move to idle forwarding processor and are handled;
If it is determined that the first message transmit queue is in high load condition, the second message transmit queue is not in high load The second message transmit queue is added in the common message or the complicated message by state;
If it is determined that the first message transmit queue is not in high load condition, the second message transmit queue is in high load The complicated message is moved to the idle forwarding processor and handled by state;
If it is determined that the first message transmit queue and the second message transmit queue are not in high load condition, it will be described general Notification text is added the first message transmit queue or the second message transmit queue, or by the complicated message addition described the Two message transmit queues.
4. according to the method described in claim 3, it is characterized in that, the detection the first message transmit queue and/or the Whether two message transmit queues are in high load condition, comprising:
When the type of the message to be forwarded is common message, the first message transmit queue can not be added in the common message When, determine that the first message transmit queue is in high load condition;
When the type of the message to be forwarded is common message or complicated message, the common message or complicated message can not be added When the second message transmit queue, determine that the second message transmit queue is in high load condition.
5. according to the method described in claim 3, it is characterized in that, described by the common message or the complicated message moves The idle forwarding processor is moved on to be handled, comprising:
When there are the session informations of the common message perhaps complicated message will the common message or the complicated report Text and its corresponding session information move to the idle forwarding processor, so that the free time forwarding processor is to described general Notification text or the complicated message are sent;
When there is no the common message perhaps complexity session information by the common message or it is described complexity message The idle forwarding processor is moved to, so that the free time forwarding processor establishes the common message or described complicated Session information is simultaneously sent.
6. according to the method described in claim 3, it is characterized in that, the determination of the free time forwarding processor includes:
Transmission message amount of each forwarding processor in the unit time to the network interface card is obtained from configuration processor;
It will be determined as idle turn to the forwarding processor that the transmission message amount of the network interface card meets preset condition in the unit time Send out processor.
7. a kind of apparatus for forwarding message, which is characterized in that described device is applied to the forwarding processor in message forwarding system, institute Stating message forwarding system includes at least one forwarding processor, and the transmission of the first message is established between the forwarding processor and network interface card Queue and the second message transmit queue, described device include:
Receiving unit receives message to be forwarded for the forwarding processor;
First determination unit, for determining the type of the message to be forwarded;
First adding unit is common for the type that the judging result when first judging unit is the message to be forwarded The first message transmit queue is added in the common message by message, and the first message transmit queue is grasped using no parity check The message transmitting party formula of work is sent;
Second adding unit is complicated for the type that the judging result when first judging unit is the message to be forwarded The second message transmit queue is added in the complicated message by message, and the second message transmit queue uses general message Sending method is sent.
8. device according to claim 7, which is characterized in that second adding unit is also used to when the common report The first message transmit queue can not be added in text, and the second message transmit queue is added in the message to be forwarded and is sent out It send.
9. a kind of computer readable storage medium, which is characterized in that it is stored with instruction in the computer readable storage medium storing program for executing, when When described instruction is run on the terminal device, so that the terminal device perform claim requires the described in any item messages of 1-6 to turn The method of hair.
10. a kind of computer program product, which is characterized in that when the computer program product is run on the terminal device, make Obtain the method that the terminal device perform claim requires the described in any item messages forwardings of 1-6.
CN201910446373.4A 2019-05-27 2019-05-27 Message forwarding method, device and storage medium Active CN110149281B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910446373.4A CN110149281B (en) 2019-05-27 2019-05-27 Message forwarding method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910446373.4A CN110149281B (en) 2019-05-27 2019-05-27 Message forwarding method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110149281A true CN110149281A (en) 2019-08-20
CN110149281B CN110149281B (en) 2022-11-11

Family

ID=67593202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910446373.4A Active CN110149281B (en) 2019-05-27 2019-05-27 Message forwarding method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110149281B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6691175B1 (en) * 2000-02-25 2004-02-10 Sun Microsystems, Inc. Method and apparatus for managing data propagation between software modules
CN101541038A (en) * 2009-04-27 2009-09-23 杭州华三通信技术有限公司 Method and device for strengthening upper layer application stability loaded by wireless local area network
CN102055649A (en) * 2009-10-29 2011-05-11 成都市华为赛门铁克科技有限公司 Method, device and system for treating messages of multi-core system
CN104518988A (en) * 2014-12-19 2015-04-15 上海顶竹通讯技术有限公司 Method and system for priority processing of messages

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6691175B1 (en) * 2000-02-25 2004-02-10 Sun Microsystems, Inc. Method and apparatus for managing data propagation between software modules
CN101541038A (en) * 2009-04-27 2009-09-23 杭州华三通信技术有限公司 Method and device for strengthening upper layer application stability loaded by wireless local area network
CN102055649A (en) * 2009-10-29 2011-05-11 成都市华为赛门铁克科技有限公司 Method, device and system for treating messages of multi-core system
CN104518988A (en) * 2014-12-19 2015-04-15 上海顶竹通讯技术有限公司 Method and system for priority processing of messages

Also Published As

Publication number Publication date
CN110149281B (en) 2022-11-11

Similar Documents

Publication Publication Date Title
CN108737218B (en) Automatic verification method and device for message push arrival rate
CN104836743A (en) Congestion control method and device
CN109600375A (en) Message tracing method, device, electronic equipment and storage medium
CN109614426A (en) Switching method, device and electronic equipment between multiple database
CN102957594A (en) Message queue-based message processing method, related device and system
CN115002047A (en) Remote direct data access method, device, equipment and storage medium
CN112152872B (en) Network sub-health detection method and device
CN103067184B (en) The abnormality eliminating method of offline charging and system
CN108259595A (en) The method and system of asynchronous call between a kind of service
CN109408251A (en) Message method and device, message sink processing method and device
CN109819000A (en) Methods, devices and systems and machine readable storage medium for PUSH message
CN108650170A (en) A kind of display methods and device of information
CN110149281A (en) A kind of message forwarding method, device and program product, storage medium
CN114025014B (en) Asset detection method and device, electronic equipment and storage medium
CN108830724A (en) A kind of resource data packet processing method and terminal device
CN112950171A (en) Bank business processing system and method
CN113986995A (en) Request distribution method and device, storage medium and electronic equipment
CN110677497B (en) Network medium distribution method and device
CN103856541B (en) Redirection page plane display method, gateway and user equipment
CN102609217B (en) High-speed storage method and high-speed storage system for IO (input/output) equipment
CN105871917A (en) Transmission control protocol TCP connection scheduling method and device
CN115622929B (en) Remote direct data access RDMA (remote direct memory Access) test method and related device
CN117061072B (en) Message transmission method, device, equipment and storage medium
CN106453588B (en) Discharge the method, apparatus and system of connection
CN112511277B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant