WO2016197822A1 - Packet sending method and device - Google Patents

Packet sending method and device Download PDF

Info

Publication number
WO2016197822A1
WO2016197822A1 PCT/CN2016/083341 CN2016083341W WO2016197822A1 WO 2016197822 A1 WO2016197822 A1 WO 2016197822A1 CN 2016083341 W CN2016083341 W CN 2016083341W WO 2016197822 A1 WO2016197822 A1 WO 2016197822A1
Authority
WO
WIPO (PCT)
Prior art keywords
packet
sent
message
receiving queue
sending
Prior art date
Application number
PCT/CN2016/083341
Other languages
French (fr)
Chinese (zh)
Inventor
何建军
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016197822A1 publication Critical patent/WO2016197822A1/en

Links

Images

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/26Flow control; Congestion control using explicit feedback to the source, e.g. choke packets
    • H04L47/266Stopping or restarting the source, e.g. X-on or X-off
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9063Intermediate storage in different physical parts of a node or terminal

Definitions

  • This application relates to, but is not limited to, the field of communication technology.
  • the devices in the communication network interact with each other through protocol packets. Through the sending and receiving of packets, the discovery of neighbor devices and the exchange of related information are completed. In order to be compatible with protocol communication between various vendors, it is usually possible to ensure interworking between different vendors by formulating common interaction rules and fixed protocol message formats.
  • the protocol packet is sent to the receiving queue of the device port through the protocol process, and the protocol packet is sent by the receiving queue of the device port.
  • a certain protocol process may generate a large number of protocol packets.
  • the routing protocol process may advertise a large amount of routing information, so that the receiving queue is filled with the protocol packet, causing the protocol packets sent by subsequent protocols to overflow. Discard, thereby affecting communication between other protocol processes.
  • FIG. 1 it is a schematic diagram for transmitting an image of a message in the related art.
  • the service process 1 in the application scenario shown in FIG. 1 is an Intermediate System-to-Intermediate System (ISIS) process
  • the service process 2 is a Border Gateway Protocol (referred to as BGP).
  • the process, the service process 3 is a link state routing algorithm, and the algorithm may include an Open Shortest Path First (OSPF) process.
  • OSPF Open Shortest Path First
  • the service process 1 ISIS process
  • HELLO neighbor keepalive
  • BGP process neighbor keepalive
  • the neighboring keepalive (HELLO) packet of the service process 2 (BGP process) will not be sent.
  • the BGP process of the peer device will not receive the BGP process of the local device.
  • the neighboring keepalive (HELLO) packet is sent, and the neighbor relationship of the local device is deleted. As a result, all the previously advertised routing information is deleted, which affects the normal forwarding of device data packets.
  • This paper proposes a message sending method and device to solve the technical problem that the receiving queue is easily filled in the related art, thereby discarding the message.
  • a message sending method comprising:
  • the first packet is saved in the cache space
  • saving the first packet in a cache space including:
  • the method further includes:
  • the first message in the buffer space is suspended according to the suspended sending information.
  • the method when receiving the indication sending information sent by the receiving queue, sending, according to the indication sending information, a corresponding quantity of the first packet in the buffer space to the receiving queue, so that After the receiving queue sends the corresponding number of the first packet, the method further includes:
  • the corresponding number of the legacy packet is sent to the receiving queue when the packet is sent next time.
  • the sending by the corresponding quantity, the first packet in the cache space to the interface
  • the method further includes:
  • the legacy packet and the corresponding second packet in the cache space are sent to the receiving queue when the packet is sent next time.
  • the second message is a message saved after the first message is sent.
  • the sending the legacy message and the corresponding number of second packets in the buffer space to the receiving queue, when the packet is sent includes:
  • a message sending device comprising:
  • the saving module is configured to: save the first packet in the cache space when the first packet is sent;
  • the requesting module is set to: initiate a sending request to the receiving queue;
  • a sending module configured to: when receiving the indication sending information sent by the receiving queue, send, according to the indication sending information, the saving module saves a corresponding number of the first packet in the buffer space to be sent to the
  • the receiving queue is configured to enable the receiving queue to send a corresponding number of the first message.
  • the saving module includes:
  • a development unit configured to: when the first message is sent, open the cache space;
  • the saving unit is configured to: save the first message in the cache space opened by the development unit.
  • the device further includes:
  • the suspension module is configured to: when receiving the suspended transmission information sent when the receiving queue is full, suspending transmitting the first packet in the buffer space according to the suspended sending information.
  • the device further includes:
  • a determining module configured to: send a corresponding number of the first packets in the cache space to When the queue is received, it is determined whether the legacy packet of the first packet is stored in the cache space;
  • the sending module is further configured to: if the legacy message is stored in the buffer space, send a corresponding quantity of the legacy message to the receiving queue when the message is sent next time.
  • the sending module is further configured to: if the legacy packet is stored in the buffer space, send the legacy packet and the cache to the receiving queue when the packet is sent next time A second number of packets in the space, wherein the second message is a message saved after the first message is sent.
  • the sending module is configured to: when the next time the message is sent, send the legacy message and the second number of the second message in the buffer space to the receiving queue, including:
  • the first packet When the first packet is sent, the first packet is saved in the buffer space, and the packet is sent to the receiving queue to receive the information. Sending, according to the information, a corresponding number of first packets in the buffer space to the receiving queue, so that the receiving queue sends a corresponding number of first packets.
  • the embodiment of the present invention first saves the packet in the buffer space, and then sends a corresponding number of packets to the receiving queue. For example, when the number of packets is relatively large, the receiving queue can receive the packet.
  • the receiving capability of the packet the number of packets corresponding to the receiving capability of the receiving queue is sent, and the legacy packet is sent next time, or when the number of packets is small, that is, the number of packets does not exceed the receiving capability of the receiving queue, all the packets are received.
  • the text is sent to the receiving queue, so that the other packets are not discarded because the receiving queue is filled, which ensures normal communication between the devices.
  • FIG. 1 is a schematic diagram of a message sending image in the related art
  • FIG. 2 is a flowchart of a method for sending a message according to an embodiment of the present invention
  • FIG. 3 is a flowchart of another method for sending a packet according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of still another method for sending a message according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a message sending apparatus according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a saving module in a message sending apparatus according to an embodiment of the present disclosure
  • FIG. 7 is a schematic structural diagram of another packet sending apparatus according to an embodiment of the present invention.
  • the invention provides a message sending method.
  • FIG. 2 is a flowchart of a method for sending a message according to an embodiment of the present invention.
  • the packet sending method includes steps 10 to 30:
  • Step 10 When the first packet is sent, save the first packet in a cache space.
  • the embodiment of the present invention may open a buffer space in the device memory or the storage space in advance, and in actual applications, the cache space may not be opened in advance.
  • the embodiment of the present invention first saves the generated message in a pre-opened cache space.
  • step 20 a sending request is initiated to the receiving queue.
  • a request for sending a packet in the buffer space is initiated to the receiving queue.
  • the receiving queue determines whether the current receiving queue is full. If the current receiving queue is full, the information corresponding to the current receiving queue is full, for example, the feedback information is suspended information; if the current receiving queue is current, the current receiving queue is received. If it is empty, the feedback corresponds to the information that the current receiving queue is empty. Then step 30 is performed.
  • Step 30 When receiving the indication sending information sent by the receiving queue, send the information according to the indication to send a corresponding number of the first packet in the buffer space to the receiving queue, so that the receiving queue sends a corresponding number of the first packet.
  • the service process of sending the message performs corresponding processing according to the information fed back by the receiving queue, and pauses the sending of the message in the buffer space when the received feedback information is suspended.
  • the service process of sending the packet when receiving the indication sending information of the feedback of the receiving queue, sends the information according to the indication fed back by the receiving queue, and sends the packet saved in the buffer space to the corresponding quantity.
  • the packet is sent to the receiving queue, and includes: when the number of the packets stored in the buffer space is less than or equal to the number of packets that can be received by the receiving queue, all the packets stored in the buffer space are sent to the receiving queue; If the number of packets to be received is greater than the number of packets that can be received by the receiving queue, the number of packets corresponding to the number of packets that can be received by the receiving queue is sent, and the packet is sent after the sending queue sends the packet.
  • the number of sent packets is mainly based on the receiving capability of the receiving queue.
  • the number of sent packets cannot be greater than the number of packets that can be received by the receiving queue.
  • the number of packets corresponding to the receiving capability of the receiving queue is sent each time until all the packets in the buffer space are sent.
  • the first packet When the first packet is sent, the first packet is saved in the buffer space, and the packet is sent to the receiving queue.
  • Sending information according to the indication sends a corresponding number of first packets in the buffer space to the receiving queue, so that the receiving queue sends a corresponding number of first packets.
  • the embodiment of the present invention first saves the packet in the buffer space, and then sends a corresponding number of packets to the receiving queue. For example, when the number of packets is relatively large, the receiving queue can receive the packet.
  • the receiving capability of the packet the number of packets corresponding to the receiving capability of the receiving queue is sent, and the legacy packet is sent next time, or when the number of packets is small, that is, the number of packets does not exceed the receiving capability of the receiving queue, all the packets are received.
  • the text is sent to the receiving queue, so that the other packets are not discarded because the receiving queue is filled, which ensures normal communication between the devices.
  • FIG. 3 is a flowchart of another method for sending a packet according to an embodiment of the present invention.
  • Steps 11 to 12 in FIG. 3 are: when the first packet is sent, the first packet is saved in the cache space. (ie step 10) the process.
  • step 10 in this embodiment may include:
  • step 11 when the first message is sent, the cache space is opened.
  • step 12 the first message is saved in the cache space.
  • the embodiment may also not open a buffer space in the memory or the storage module in advance, and when the message is sent, the buffer space is opened in the memory or the storage module, and then the packet to be sent is sent. Saved in this cache space.
  • FIG. 4 is a flowchart of still another method for sending a message according to an embodiment of the present invention.
  • the method provided in this embodiment may further include steps 40 to 50:
  • Step 40 When the first packet of the first packet in the buffer space is sent to the receiving queue, it is determined whether the legacy packet of the first packet is stored in the buffer space.
  • Step 50 If the legacy message is stored in the buffer space, the corresponding number of the legacy message is sent to the receiving queue when the message is sent next time.
  • the packet in the buffer space is sent to the receiving queue, it is also determined whether the legacy packet of the sent packet is stored in the buffer space. If the result of the determination is that the legacy space is stored in the buffer space, When the next message is sent, the corresponding number of legacy messages are sent to the receiving queue. For example, a total of 9 keep-alive messages are stored in the buffer space, and the receiving capability of the receiving queue is 5 packets. When 5 packets are sent to the receiving queue, it is determined that there are 4 keep-alive messages left in the buffer space. For example, when the next message is sent, the remaining 4 keep-alive messages are sent.
  • a total of 11 keep-alive messages are stored in the buffer space, and 5 messages are sent to the receiving queue to determine the cache. In the space, there are still 6 keep-alive messages.
  • the next message is sent, the remaining 5 keep-alive messages are sent, and then it is judged whether there are still messages in the cache space, and it is judged that the cache space is still in the cache space.
  • the remaining one keep-alive message is sent when the message is sent for the third time.
  • the legacy message is sent to the receiving queue and the corresponding number of the second message in the buffer space, where
  • the second packet is a packet that is saved after the first packet is sent.
  • a variety of packets are generated. If there are multiple packets in each packet, multiple types and quantities of packets are stored in the cache space on a first-in-first-out basis. When sent to the receive queue, they are first-in, first-out. The principle is sent to the receiving queue, and the quantity sent each time is the number corresponding to the receiving capability of the receiving queue.
  • the receiving queue can receive 5 messages each time, and the service process that sends the message is sent to the receiving queue each time. For the five messages, the number of each message is filled with the receiving queue as the first principle.
  • the second message is sent.
  • a plurality of packets are first sorted according to the time of entering the cache space, and when the packets are sent, the earliest entry into the cache space is first performed.
  • the message is taken out, and the corresponding number of the received message is sent to the receiving queue according to the criterion of filling the receiving queue.
  • the received message has a legacy message. When the legacy message is placed in the cache space, the position after the various messages are sorted according to the entered time. By analogy, you can continue to cycle.
  • the next time the message is sent according to the priority corresponding to the first message and the second report.
  • the priority corresponding to the text sends a corresponding number of legacy messages and/or second packets to the receiving queue.
  • the priority can be set in advance for different packets.
  • the cache space sorts the saved multiple packets each time according to the priority level. For example, the first time When sending a packet, you can first send the packet with the highest priority in the cache space to fill the receiving queue. The maximum number of packets with the highest priority is sent to the receiving queue. The packets in the space are sent. In the actual application, when the number of packets with the highest priority is an integer multiple of the receiving capability of the receiving queue, the packets are sent in the order of the buffers, and then sent after the sending. The packet with the second highest priority in the space, and so on.
  • the packet When the number of packets with the highest priority is not an integer multiple of the receiving capability of the receiving queue, the packet is first sent in the order of the buffer, the last time. When the packet is sent, because the receiving queue is not filled, a corresponding number of packets with the second highest priority are sent in the buffer space to fill up. Receive queue, and so transmitted. In actual applications, if two or more types of packets are stored in the same cache with the same priority, they can be sent on a first-in, first-out basis. It can also be sent in other ways in more implementations.
  • the embodiment of the invention further provides a message sending device.
  • FIG. 5 is a schematic structural diagram of a message sending apparatus according to an embodiment of the present invention.
  • the message sending apparatus includes: a saving module 10, a requesting module 20, and a sending module 30.
  • the saving module 10 is configured to save the first packet in the cache space when the first packet is sent.
  • the embodiment of the present invention may open a buffer space in the device memory or the storage space in advance, and in actual applications, the cache space may not be opened in advance.
  • the embodiment of the present invention first saves the generated message in a pre-opened cache space.
  • the requesting module 20 is configured to: initiate a sending request to the receiving queue.
  • a request for sending a packet in the buffer space is initiated to the receiving queue.
  • the receiving queue determines whether the current receiving queue is full. If the current receiving queue is full, the information corresponding to the current receiving queue is full, for example, the feedback information is suspended information; if the current receiving queue is current, the current receiving queue is received. If it is empty, the feedback corresponds to the information that the current receiving queue is empty.
  • the sending module 30 is configured to: when receiving the indication sending information sent by the receiving queue, send, according to the indication sending information, the first number of the first packet saved by the saving module 10 to the buffer space to be sent to the receiving queue, so that the receiving queue Send the corresponding number of first messages.
  • the service process of sending the message performs corresponding processing according to the information fed back by the receiving queue, and pauses the sending of the message in the buffer space when the received feedback information is suspended.
  • the service process of sending the packet when receiving the indication sending information of the feedback of the receiving queue, sends the information according to the indication fed back by the receiving queue, and sends the packet saved in the buffer space to the corresponding quantity.
  • the packet is sent to the receiving queue, and includes: when the number of the packets stored in the buffer space is less than or equal to the number of packets that can be received by the receiving queue, all the packets stored in the buffer space are sent to the receiving queue; If the number of packets to be received is greater than the number of packets that can be received by the receiving queue, the number of packets corresponding to the number of packets that can be received by the receiving queue is sent, and the packet is sent after the sending queue sends the packet.
  • the number of sent packets is mainly based on the receiving capability of the receiving queue.
  • the number of sent packets cannot be greater than the number of packets that can be received by the receiving queue.
  • the number of packets corresponding to the receiving capability of the receiving queue is sent each time until all the packets in the buffer space are sent.
  • the receiving queue sends the packet to the corresponding terminal.
  • the packet sending device sends a request to the receiving queue, and receives the indication sending message sent by the receiving queue.
  • Sending information according to the indication sends a corresponding number of first packets in the buffer space to the receiving queue, so that the receiving queue sends a corresponding number of first packets.
  • the embodiment of the present invention first saves the packet in the buffer space, and then sends a corresponding number of packets to the receiving queue. For example, when the number of packets is relatively large, the receiving queue can receive the packet.
  • the receiving capability of the packet the number of packets corresponding to the receiving capability of the receiving queue is sent, and the legacy packet is sent next time, or when the number of packets is small, that is, the number of packets does not exceed the receiving capability of the receiving queue, all the packets are received.
  • the text is sent to the receiving queue, so that the other packets are not discarded because the receiving queue is filled, which ensures normal communication between the devices.
  • FIG. 6 is a schematic structural diagram of a save module in a message sending apparatus according to an embodiment of the present invention.
  • the saving module 10 in this embodiment may include:
  • the development unit 11 is configured to: when the first message is sent, the cache space is opened.
  • the saving unit 12 is configured to save the first message in the cache space opened by the development unit 11.
  • the embodiment may also not open a buffer space in the memory or the storage module in advance, and when the message is sent, the buffer space is opened in the memory or the storage module, and then the packet to be sent is sent. Saved in this cache space.
  • FIG. 7 is a schematic structural diagram of another apparatus for sending a message according to an embodiment of the present invention.
  • the apparatus provided in this embodiment may further include: a suspending module 40 configured to: when the suspended sending information sent when the receiving queue is full, is sent according to the pause The information pauses the first message in the buffer space.
  • a suspending module 40 configured to: when the suspended sending information sent when the receiving queue is full, is sent according to the pause The information pauses the first message in the buffer space.
  • the embodiment may further include: a determining module 50, configured to: when the first number of the first packet in the buffer space is sent to the receiving queue, determine whether the legacy packet of the first packet is stored in the buffer space. Text.
  • a determining module 50 configured to: when the first number of the first packet in the buffer space is sent to the receiving queue, determine whether the legacy packet of the first packet is stored in the buffer space. Text.
  • the sending module 30 is further configured to: if a legacy message is stored in the buffer space, send a corresponding number of legacy messages to the receiving queue when the message is sent next time.
  • the sending module 30 in this embodiment is further configured to: if the legacy packet is stored in the buffer space, send the legacy packet and the corresponding amount in the buffer space to the receiving queue when the packet is sent next time. Second message.
  • the packet in the buffer space is sent to the receiving queue, it is also determined whether the legacy packet of the sent packet is stored in the buffer space. If the result of the determination is that the legacy space is stored in the buffer space, When the next message is sent, the corresponding number of legacy messages are sent to the receiving queue. For example, a total of 9 keep-alive packets are stored in the buffer space, and the receiving capability of the receiving queue is 5 packets. When 5 packets are sent to the receiving queue, it is determined that there are 4 keep-alives left in the buffer space. The message is sent to the remaining 4 keep-alive messages when the next message is sent. For example, a total of 11 keep-alive messages are stored in the buffer space, and 5 messages are sent to the receiving queue to determine the message.
  • the cache space there are still 6 keep-alive messages.
  • the next message is sent, the remaining 5 keep-alive messages are sent, and then it is determined whether there are still messages in the cache space, and the cache space is determined.
  • the remaining one keep-alive message is sent when the message is sent for the third time.
  • the legacy message is sent to the receiving queue and the corresponding number of the second message in the buffer space, where
  • the second packet is a packet that is saved after the first packet is sent.
  • multiple packets are continuously generated in the device, and there are multiple packets in each device, multiple types and quantities of packets are stored in the cache space on a first-in-first-out basis, and are sent to the receiving queue.
  • the method is sent to the receiving queue, and the quantity sent each time is the number corresponding to the receiving capability of the receiving queue.
  • the receiving queue can receive 5 messages each time, and the service process of sending the message is The secondary receiving queue sends five packets, and the number of each transmission is to fill the receiving queue as the first principle.
  • the second packet is sent.
  • a plurality of packets are first sorted according to the time of entering the cache space, and when the packets are sent, the earliest entry into the cache space is first performed.
  • the message is taken out to fill up
  • the receiving queue is a criterion, and the corresponding quantity in the received message is sent to the receiving queue.
  • the received message is not sent, if the received message has a legacy message, the legacy message is placed. The position after sorting multiple messages in the cache space according to the time of entry. By analogy, you can continue to cycle.
  • the sending module 30 is configured to send the legacy packet to the receiving queue and the cache space in the next transmission.
  • the corresponding number of the second packet may be used to: send the corresponding number of legacy packets to the receiving queue according to the priority corresponding to the first packet and the priority corresponding to the second packet when the packet is sent next time. And / or the second message.
  • the priority can be set in advance for different packets.
  • the cache space sorts the saved multiple packets each time according to the priority level. For example, the first time When sending a packet, you can first send the packet with the highest priority in the cache space to fill the receiving queue. The maximum number of packets with the highest priority is sent to the receiving queue. The packets in the space are sent. In the actual application, when the number of packets with the highest priority is an integer multiple of the receiving capability of the receiving queue, the packets are sent in the order of the buffers, and then sent after the sending. The packet with the second highest priority in the space, and so on.
  • the packet When the number of packets with the highest priority is not an integer multiple of the receiving capability of the receiving queue, the packet is first sent in the order of the buffer, the last time. When the packet is sent, because the receiving queue is not filled, a corresponding number of packets with the second highest priority are sent in the buffer space to fill up. Receive queue, and so transmitted. In actual applications, if two or more types of packets are stored in the same cache with the same priority, they can be sent on a first-in, first-out basis. It can also be sent in other ways in more implementations.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the packet when the packet is sent, the packet is first stored in the buffer space, and then the corresponding number of packets are sent to the receiving queue. For example, when the number of packets is relatively large, the packet can be received according to the receiving queue.
  • the receiving capability sends a packet corresponding to the receiving capability of the receiving queue, and the legacy packet is sent next time, or when the number of packets is small, that is, the number of packets does not exceed the receiving capability of the receiving queue, all the packets are sent to The queue is received so that the other packets are not discarded because the receiving queue is filled, ensuring normal communication between the devices.

Landscapes

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

Abstract

A packet sending method and device, the method comprising: when sending first packets, storing the first packets in a cache space; initiating a sending request to a receiving queue; when receiving sending instruction information sent by the receiving queue, sending a corresponding number of first packets in the cache space to the receiving queue according to the sending instruction information, so that the receiving queue sends the corresponding number of first packets.

Description

报文发送方法和装置Message sending method and device 技术领域Technical field
本申请涉及但不限于通信技术领域。This application relates to, but is not limited to, the field of communication technology.
背景技术Background technique
通信网络中的设备都是通过协议报文进行交互的,通过报文的发送和接收,完成邻居设备的发现和相关信息的交换。为了兼容各个厂商之间的协议通信,通常可以通过制定共同的交互规则和固定的协议报文格式,来保证不同厂商之间的互通。The devices in the communication network interact with each other through protocol packets. Through the sending and receiving of packets, the discovery of neighbor devices and the exchange of related information are completed. In order to be compatible with protocol communication between various vendors, it is usually possible to ensure interworking between different vendors by formulating common interaction rules and fixed protocol message formats.
相关技术中,业界一般通过协议进程将协议报文发送至设备端口的接收队列中,再由设备端口的接收队列将协议报文发送出去。这种方式可能会出现某一协议进程突发大量协议报文,例如路由协议进程可能通告大量路由信息,使得接收队列被该协议报文填满,导致后续其他协议发送来的协议报文溢出被丢弃,从而影响其他协议进程之间通信。In the related art, the protocol packet is sent to the receiving queue of the device port through the protocol process, and the protocol packet is sent by the receiving queue of the device port. In this way, a certain protocol process may generate a large number of protocol packets. For example, the routing protocol process may advertise a large amount of routing information, so that the receiving queue is filled with the protocol packet, causing the protocol packets sent by subsequent protocols to overflow. Discard, thereby affecting communication between other protocol processes.
如图1所示,为相关技术中报文发送形象的示意图。假设图1所示应用场景中的业务进程1为中间系统-中间系统(Intermediate System-to-Intermediate System,简称为:ISIS)进程,业务进程2为边界网关协议(Border Gateway Protocol,简称为:BGP)进程,业务进程3为链路状态路由算法,该算法可以包括开放式最短路径优先(Open Shortest Path First,简称为:OSPF)进程。图1所示应用场景中,业务进程1(ISIS进程)发送大量的协议报文至接收队列并且接收队列被填满,业务进程2(BGP进程)发送的邻居保活(HELLO)报文因为接收队列填满而溢出丢弃,业务进程2(BGP进程)的邻居保活(HELLO)报文一直发送不出去,一定时间后,对端设备的BGP进程会因为没有及时接收到本端设备的BGP进程发送的邻居保活(HELLO)报文,从而会删除本端设备的邻居关系,导致先前通告的路由信息全部删除,进而影响设备数据报文的正常转发。 As shown in FIG. 1, it is a schematic diagram for transmitting an image of a message in the related art. Assume that the service process 1 in the application scenario shown in FIG. 1 is an Intermediate System-to-Intermediate System (ISIS) process, and the service process 2 is a Border Gateway Protocol (referred to as BGP). The process, the service process 3 is a link state routing algorithm, and the algorithm may include an Open Shortest Path First (OSPF) process. In the application scenario shown in Figure 1, the service process 1 (ISIS process) sends a large number of protocol packets to the receive queue and the receive queue is filled. The neighbor keepalive (HELLO) message sent by service process 2 (BGP process) is received. If the queue is full and overflows, the neighboring keepalive (HELLO) packet of the service process 2 (BGP process) will not be sent. After a certain period of time, the BGP process of the peer device will not receive the BGP process of the local device. The neighboring keepalive (HELLO) packet is sent, and the neighbor relationship of the local device is deleted. As a result, all the previously advertised routing information is deleted, which affects the normal forwarding of device data packets.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本文提出一种报文发送方法和装置,以解决相关技术中接收队列容易被填满,从而丢弃报文的技术问题。This paper proposes a message sending method and device to solve the technical problem that the receiving queue is easily filled in the related art, thereby discarding the message.
一种报文发送方法,所述方法包括:A message sending method, the method comprising:
在发送第一报文时,将所述第一报文保存在缓存空间中;When the first packet is sent, the first packet is saved in the cache space;
向接收队列发起发送请求;Initiating a send request to the receive queue;
在接收到所述接收队列发送的指示发送信息时,根据所述指示发送信息将所述缓存空间中相应数量的所述第一报文发送至所述接收队列,以使得所述接收队列发送相应数量的所述第一报文。When receiving the indication sending information sent by the receiving queue, sending, according to the indication sending information, a corresponding number of the first packets in the buffer space to the receiving queue, so that the receiving queue sends corresponding The number of the first message.
可选地,所述在发送第一报文时,将所述第一报文保存在缓存空间中,包括:Optionally, when the first packet is sent, saving the first packet in a cache space, including:
在发送所述第一报文时,开所述辟缓存空间;When the first message is sent, the cache space is opened;
将所述第一报文保存在所述缓存空间中。Saving the first message in the cache space.
可选地,所述向接收队列发起发送请求之后,所述方法还包括:Optionally, after the sending the sending request to the receiving queue, the method further includes:
在接收到所述接收队列已满时发送的暂停发送信息时,根据所述暂停发送信息暂停发送所述缓存空间中的所述第一报文。And when the suspended transmission information sent when the receiving queue is full, the first message in the buffer space is suspended according to the suspended sending information.
可选地,所述在接收到所述接收队列发送的指示发送信息时,根据所述指示发送信息将所述缓存空间中相应数量的所述第一报文发送至所述接收队列,以使得所述接收队列发送相应数量的所述第一报文之后,所述方法还包括:Optionally, when receiving the indication sending information sent by the receiving queue, sending, according to the indication sending information, a corresponding quantity of the first packet in the buffer space to the receiving queue, so that After the receiving queue sends the corresponding number of the first packet, the method further includes:
将所述缓存空间中相应数量的所述第一报文发送至所述接收队列时,判断所述缓存空间中是否存储有所述第一报文的遗留报文;When the first number of the first packet in the buffer space is sent to the receiving queue, it is determined whether the legacy packet of the first packet is stored in the buffer space;
如果所述缓存空间中存储有所述遗留报文,则在下一次发送报文时,向所述接收队列发送相应数量的所述遗留报文。If the legacy packet is stored in the buffer space, the corresponding number of the legacy packet is sent to the receiving queue when the packet is sent next time.
可选地,所述将所述缓存空间中相应数量的所述第一报文发送至所述接 收队列时,判断所述缓存空间中是否存储有所述第一报文的遗留报文之后,所述方法还包括:Optionally, the sending, by the corresponding quantity, the first packet in the cache space to the interface After the queue is received, after determining whether the legacy packet of the first packet is stored in the cache space, the method further includes:
如果所述缓存空间中存储有所述遗留报文,则在下一次发送报文时,向所述接收队列发送所述遗留报文和所述缓存空间中相应数量的第二报文,其中,所述第二报文为在发送所述第一报文之后保存的报文。If the legacy packet is stored in the cache space, the legacy packet and the corresponding second packet in the cache space are sent to the receiving queue when the packet is sent next time. The second message is a message saved after the first message is sent.
可选地,所述在下一次发送报文时,向所述接收队列发送所述遗留报文和所述缓存空间中相应数量的第二报文,包括:Optionally, the sending the legacy message and the corresponding number of second packets in the buffer space to the receiving queue, when the packet is sent, includes:
在下一次发送报文时,根据所述第一报文对应的优先级和所述第二报文对应的优先级,向所述接收队列发送相应数量的所述遗留报文和/或所述第二报文。Sending, according to the priority corresponding to the first packet and the priority corresponding to the second packet, the corresponding number of the legacy packet and/or the first Two messages.
一种报文发送装置,所述装置包括:A message sending device, the device comprising:
保存模块,设置为:在发送第一报文时,将所述第一报文保存在缓存空间中;The saving module is configured to: save the first packet in the cache space when the first packet is sent;
请求模块,设置为:向接收队列发起发送请求;The requesting module is set to: initiate a sending request to the receiving queue;
发送模块,设置为:在接收到所述接收队列发送的指示发送信息时,根据所述指示发送信息将所述保存模块保存在所述缓存空间中相应数量的所述第一报文发送至所述接收队列,以使得所述接收队列发送相应数量的所述第一报文。a sending module, configured to: when receiving the indication sending information sent by the receiving queue, send, according to the indication sending information, the saving module saves a corresponding number of the first packet in the buffer space to be sent to the The receiving queue is configured to enable the receiving queue to send a corresponding number of the first message.
可选地,所述保存模块包括:Optionally, the saving module includes:
开辟单元,设置为:在发送所述第一报文时,开所述辟缓存空间;a development unit, configured to: when the first message is sent, open the cache space;
保存单元,设置为:将所述第一报文保存在所述开辟单元开辟的所述缓存空间中。The saving unit is configured to: save the first message in the cache space opened by the development unit.
可选地,所述装置还包括:Optionally, the device further includes:
暂停模块,设置为:在接收到所述接收队列已满时发送的暂停发送信息时,根据所述暂停发送信息暂停发送所述缓存空间中的所述第一报文。The suspension module is configured to: when receiving the suspended transmission information sent when the receiving queue is full, suspending transmitting the first packet in the buffer space according to the suspended sending information.
可选地,所述装置还包括:Optionally, the device further includes:
判断模块,设置为:将所述缓存空间中相应数量的所述第一报文发送至 所述接收队列时,判断所述缓存空间中是否存储有所述第一报文的遗留报文;a determining module, configured to: send a corresponding number of the first packets in the cache space to When the queue is received, it is determined whether the legacy packet of the first packet is stored in the cache space;
所述发送模块,还设置为:如果所述缓存空间中存储有所述遗留报文,则在下一次发送报文时,向所述接收队列发送相应数量的所述遗留报文。The sending module is further configured to: if the legacy message is stored in the buffer space, send a corresponding quantity of the legacy message to the receiving queue when the message is sent next time.
可选地,所述发送模块,还设置为:如果所述缓存空间中存储有所述遗留报文,则在下一次发送报文时,向所述接收队列发送所述遗留报文和所述缓存空间中相应数量的第二报文,其中,所述第二报文为在发送所述第一报文之后保存的报文。Optionally, the sending module is further configured to: if the legacy packet is stored in the buffer space, send the legacy packet and the cache to the receiving queue when the packet is sent next time A second number of packets in the space, wherein the second message is a message saved after the first message is sent.
可选地,所述发送模块设置为在下一次发送报文时,向所述接收队列发送所述遗留报文和所述缓存空间中相应数量的第二报文,包括:Optionally, the sending module is configured to: when the next time the message is sent, send the legacy message and the second number of the second message in the buffer space to the receiving queue, including:
在下一次发送报文时,根据所述第一报文对应的优先级和所述第二报文对应的优先级,向所述接收队列发送相应数量的所述遗留报文和/或所述第二报文。Sending, according to the priority corresponding to the first packet and the priority corresponding to the second packet, the corresponding number of the legacy packet and/or the first Two messages.
本发明实施例提供的报文发送方法和装置,在发送第一报文时,将所述第一报文保存在缓存空间中,向接收队列发起发送请求,在接收到接收队列同意发送的信息时,根据所述信息将所述缓存空间中相应数量的第一报文发送至所述接收队列,以使得所述接收队列发送相应数量的第一报文。通过上述方式,本发明实施例在发送报文时,先将报文保存在缓存空间中,然后向接收队列发送相应数量的报文,比如在报文数量比较大时,根据接收队列中可以接收报文的接收能力,发送与该接收队列接收能力相应数量的报文,遗留的报文在下一次发送,或者在报文数量比较小时,即报文数量没有超过接收队列接收能力时,将所有报文发送给接收队列,从而不会因为接收队列被填满,而丢弃其他的报文,保证了设备之间的正常通信。When the first packet is sent, the first packet is saved in the buffer space, and the packet is sent to the receiving queue to receive the information. Sending, according to the information, a corresponding number of first packets in the buffer space to the receiving queue, so that the receiving queue sends a corresponding number of first packets. In the foregoing manner, when sending a packet, the embodiment of the present invention first saves the packet in the buffer space, and then sends a corresponding number of packets to the receiving queue. For example, when the number of packets is relatively large, the receiving queue can receive the packet. The receiving capability of the packet, the number of packets corresponding to the receiving capability of the receiving queue is sent, and the legacy packet is sent next time, or when the number of packets is small, that is, the number of packets does not exceed the receiving capability of the receiving queue, all the packets are received. The text is sent to the receiving queue, so that the other packets are not discarded because the receiving queue is filled, which ensures normal communication between the devices.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1为相关技术中报文发送形象的示意图;1 is a schematic diagram of a message sending image in the related art;
图2为本发明实施例提供的一种报文发送方法的流程图; 2 is a flowchart of a method for sending a message according to an embodiment of the present invention;
图3为本发明实施例提供的另一种报文发送方法的流程图;FIG. 3 is a flowchart of another method for sending a packet according to an embodiment of the present invention;
图4为本发明实施例提供的又一种报文发送方法的流程图;FIG. 4 is a flowchart of still another method for sending a message according to an embodiment of the present invention;
图5为本发明实施例提供的一种报文发送装置的结构示意图;FIG. 5 is a schematic structural diagram of a message sending apparatus according to an embodiment of the present disclosure;
图6为本发明实施例提供的报文发送装置中一种保存模块的结构示意图;FIG. 6 is a schematic structural diagram of a saving module in a message sending apparatus according to an embodiment of the present disclosure;
图7为本发明实施例提供的另一种报文发送装置的结构示意图。FIG. 7 is a schematic structural diagram of another packet sending apparatus according to an embodiment of the present invention.
本发明的实施方式Embodiments of the invention
下文中将结合附图对本发明的实施方式进行详细说明。需要说明的是,在不冲突的情况下,本文中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments herein may be arbitrarily combined with each other.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps illustrated in the flowchart of the figures may be executed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
本发明提供一种报文发送方法。The invention provides a message sending method.
参照图2,图2为本发明实施例提供的一种报文发送方法的流程图。Referring to FIG. 2, FIG. 2 is a flowchart of a method for sending a message according to an embodiment of the present invention.
在本实施例中,该报文发送方法包括步骤10~步骤30:In this embodiment, the packet sending method includes steps 10 to 30:
步骤10,在发送第一报文时,将所述第一报文保存在缓存空间中。Step 10: When the first packet is sent, save the first packet in a cache space.
为了节省开辟缓存空间的时间,快速发送产生的报文,本发明实施例可以预先在设备内存或者存储空间中开辟缓存空间,在实际应用中,也可以不先预先开辟缓存空间。在发送报文时,例如在路由设备之间需要发送保活报文时,本发明实施例先将产生的报文保存在预先开辟的缓存空间中。In order to save time for opening the cache space and quickly transmitting the generated message, the embodiment of the present invention may open a buffer space in the device memory or the storage space in advance, and in actual applications, the cache space may not be opened in advance. When a message is sent, for example, when a keep-alive message needs to be sent between the routing devices, the embodiment of the present invention first saves the generated message in a pre-opened cache space.
步骤20,向接收队列发起发送请求。In step 20, a sending request is initiated to the receiving queue.
将上述报文保存在缓存空间中后,向接收队列发起发送缓存空间中报文的发送请求。接收队列接收到该发送请求时,判断当前接收队列是否已满,如果当前的接收队列已满,则反馈对应当前接收队列已满的信息,比如反馈信息为暂停发送的信息;如果当前的接收队列为空,则反馈对应当前接收队列为空的信息。然后执行步骤30。 After the foregoing packet is saved in the buffer space, a request for sending a packet in the buffer space is initiated to the receiving queue. When receiving the sending request, the receiving queue determines whether the current receiving queue is full. If the current receiving queue is full, the information corresponding to the current receiving queue is full, for example, the feedback information is suspended information; if the current receiving queue is current, the current receiving queue is received. If it is empty, the feedback corresponds to the information that the current receiving queue is empty. Then step 30 is performed.
步骤30,在接收到接收队列发送的指示发送信息时,根据该指示发送信息将缓存空间中相应数量的第一报文发送至接收队列,以使得该接收队列发送相应数量的第一报文。Step 30: When receiving the indication sending information sent by the receiving queue, send the information according to the indication to send a corresponding number of the first packet in the buffer space to the receiving queue, so that the receiving queue sends a corresponding number of the first packet.
发送报文的业务进程根据接收队列反馈的信息进行对应的处理,在接收到的暂停发送的反馈信息时,暂停发送所述缓存空间中报文。The service process of sending the message performs corresponding processing according to the information fed back by the receiving queue, and pauses the sending of the message in the buffer space when the received feedback information is suspended.
可选地,在本发明实施例中,在接收到接收队列反馈的指示发送信息时,发送报文的业务进程根据该接收队列反馈的指示发送信息,将缓存空间中保存的报文发送相应数量的报文至该接收队列,包括:在缓存空间中保存的报文的数量小于或等于接收队列可以接收的报文数量时,将缓存空间中保存的所有报文发送至接收队列;在缓存空间中保存的报文的数量大于接收队列可以接收的报文数量时,发送与该接收队列能够接收的报文数量对应数量的报文,在接收队列发送完本次发送的报文后,再发送之前发送时遗留的报文。实际应用中,在发送报文的过程中,发送报文的数量主要是以满足接收队列的接收能力为标准,即发送报文的数量不能大于接收队列可以接收的报文数量,在待发送的报文数量较多时,每次发送与接收队列的接收能力对应数量的报文,直到缓存空间中的报文全部发送。Optionally, in the embodiment of the present invention, when receiving the indication sending information of the feedback of the receiving queue, the service process of sending the packet sends the information according to the indication fed back by the receiving queue, and sends the packet saved in the buffer space to the corresponding quantity. The packet is sent to the receiving queue, and includes: when the number of the packets stored in the buffer space is less than or equal to the number of packets that can be received by the receiving queue, all the packets stored in the buffer space are sent to the receiving queue; If the number of packets to be received is greater than the number of packets that can be received by the receiving queue, the number of packets corresponding to the number of packets that can be received by the receiving queue is sent, and the packet is sent after the sending queue sends the packet. A message left before being sent. In the actual application, the number of sent packets is mainly based on the receiving capability of the receiving queue. The number of sent packets cannot be greater than the number of packets that can be received by the receiving queue. When the number of packets is large, the number of packets corresponding to the receiving capability of the receiving queue is sent each time until all the packets in the buffer space are sent.
本发明实施例提供的报文发送方法,在发送第一报文时,将该第一报文保存在缓存空间中,向接收队列发起发送请求,在接收到接收队列发送的指示发送信息时,根据该指示发送信息将缓存空间中相应数量的第一报文发送至接收队列,以使得该接收队列发送相应数量的第一报文。通过上述方式,本发明实施例在发送报文时,先将报文保存在缓存空间中,然后向接收队列发送相应数量的报文,比如在报文数量比较大时,根据接收队列中可以接收报文的接收能力,发送与该接收队列接收能力相应数量的报文,遗留的报文在下一次发送,或者在报文数量比较小时,即报文数量没有超过接收队列接收能力时,将所有报文发送给接收队列,从而不会因为接收队列被填满,而丢弃其他的报文,保证了设备之间的正常通信。When the first packet is sent, the first packet is saved in the buffer space, and the packet is sent to the receiving queue. When receiving the indication sending information sent by the receiving queue, Sending information according to the indication sends a corresponding number of first packets in the buffer space to the receiving queue, so that the receiving queue sends a corresponding number of first packets. In the foregoing manner, when sending a packet, the embodiment of the present invention first saves the packet in the buffer space, and then sends a corresponding number of packets to the receiving queue. For example, when the number of packets is relatively large, the receiving queue can receive the packet. The receiving capability of the packet, the number of packets corresponding to the receiving capability of the receiving queue is sent, and the legacy packet is sent next time, or when the number of packets is small, that is, the number of packets does not exceed the receiving capability of the receiving queue, all the packets are received. The text is sent to the receiving queue, so that the other packets are not discarded because the receiving queue is filled, which ensures normal communication between the devices.
可选地,图3为本发明实施例提供的另一种报文发送方法的流程图。图3中的步骤11~步骤12为在发送第一报文时,将该第一报文保存在缓存空间中 (即步骤10)的流程。Optionally, FIG. 3 is a flowchart of another method for sending a packet according to an embodiment of the present invention. Steps 11 to 12 in FIG. 3 are: when the first packet is sent, the first packet is saved in the cache space. (ie step 10) the process.
在上述图2所示实施例的基础上,本实施例中的步骤10可以包括:On the basis of the foregoing embodiment shown in FIG. 2, step 10 in this embodiment may include:
步骤11,在发送第一报文时,开辟缓存空间。In step 11, when the first message is sent, the cache space is opened.
步骤12,将该第一报文保存在该缓存空间中。In step 12, the first message is saved in the cache space.
为减轻内存或者存储模块的空间压力,本实施例也可以不预先在内存或者存储模块中开辟缓存空间,在发送报文时,在内存或者存储模块中开辟缓存空间,然后将需要发送的报文保存在该缓存空间中。In order to reduce the space pressure of the memory or the storage module, the embodiment may also not open a buffer space in the memory or the storage module in advance, and when the message is sent, the buffer space is opened in the memory or the storage module, and then the packet to be sent is sent. Saved in this cache space.
可选地,图4为本发明实施例提供的又一种报文发送方法的流程图。Optionally, FIG. 4 is a flowchart of still another method for sending a message according to an embodiment of the present invention.
在上述图1所示实施例的基础上,本实施例提供的方法还可以包括步骤40~步骤50:On the basis of the foregoing embodiment shown in FIG. 1, the method provided in this embodiment may further include steps 40 to 50:
步骤40,将缓存空间中相应数量的第一报文发送至接收队列时,判断该缓存空间中是否存储有第一报文的遗留报文。Step 40: When the first packet of the first packet in the buffer space is sent to the receiving queue, it is determined whether the legacy packet of the first packet is stored in the buffer space.
步骤50,如果该缓存空间中存储有遗留报文,则在下一次发送报文时,向接收队列发送相应数量的该遗留报文。Step 50: If the legacy message is stored in the buffer space, the corresponding number of the legacy message is sent to the receiving queue when the message is sent next time.
本实施例在将缓存空间中报文发送至接收队列后,还可以判断该缓存空间中是否存储有已发送报文的遗留报文,如果判断结果为该缓存空间中存储有遗留报文,则在下一次发送报文时,向接收队列发送相应数量的遗留报文。例如在缓存空间中一共保存有9个保活报文,接收队列的接收能力为5个报文,在向接收队列发送5个报文时,判断该缓存空间中还遗留有4个保活报文,则在下一次发送报文时,发送遗留的4个保活报文,再例如,在缓存空间中一共保存有11个保活报文,在向接收队列发送5个报文,判断该缓存空间中还遗留有6个保活报文,则在下一次发送报文时,再发送遗留的5个保活报文,再判断缓存空间中是否还遗留有报文,判断到该缓存空间中还有1个保活报文时,则在第三次发送报文时,发送遗留的这1个保活报文。In this embodiment, after the packet in the buffer space is sent to the receiving queue, it is also determined whether the legacy packet of the sent packet is stored in the buffer space. If the result of the determination is that the legacy space is stored in the buffer space, When the next message is sent, the corresponding number of legacy messages are sent to the receiving queue. For example, a total of 9 keep-alive messages are stored in the buffer space, and the receiving capability of the receiving queue is 5 packets. When 5 packets are sent to the receiving queue, it is determined that there are 4 keep-alive messages left in the buffer space. For example, when the next message is sent, the remaining 4 keep-alive messages are sent. For example, a total of 11 keep-alive messages are stored in the buffer space, and 5 messages are sent to the receiving queue to determine the cache. In the space, there are still 6 keep-alive messages. When the next message is sent, the remaining 5 keep-alive messages are sent, and then it is judged whether there are still messages in the cache space, and it is judged that the cache space is still in the cache space. When there is one keep-alive message, the remaining one keep-alive message is sent when the message is sent for the third time.
可选地,在本发明实施例中,如果缓存空间中还有遗留报文,则在下一次发送报文时,向接收队列发送遗留报文和缓存空间中相应数量的第二报文,其中该第二报文为在发送第一报文之后保存的报文。比如在设备中连续 产生有多种报文,每种报文中有多个,则会在该缓存空间中按先入先出原则保存有多个种类和数量的报文,在发送至接收队列时,按照先入先出的原则,发送至该接收队列,每次发送的数量为与该接收队列接收能力相应的数量,比如接收队列每次能接收5个报文,则发送报文的业务进程每次向接收队列发送5个报文,每次发送的数量以填满该接收队列为第一原则,在发送完第一个报文还有遗留时,发送对应数量的第二个报文。在实际应用中,还可以在缓存空间中保存有多种报文时,先按照进入所述缓存空间的时间,对多种报文进行排序,在发送报文时,先将最早进入缓存空间的报文拿出,以填满接收队列为准则,将拿出的报文中对应的数量发送到接收队列,在该拿出的报文没有发送完时,即拿出的报文有遗留报文时,将该遗留报文放在缓存空间中按照进入的时间进行排好序的多种报文之后的位置。以此类推,可以进行不断的循环。Optionally, in the embodiment of the present invention, if there is a legacy message in the buffer space, the next time the message is sent, the legacy message is sent to the receiving queue and the corresponding number of the second message in the buffer space, where The second packet is a packet that is saved after the first packet is sent. Such as continuous in the device A variety of packets are generated. If there are multiple packets in each packet, multiple types and quantities of packets are stored in the cache space on a first-in-first-out basis. When sent to the receive queue, they are first-in, first-out. The principle is sent to the receiving queue, and the quantity sent each time is the number corresponding to the receiving capability of the receiving queue. For example, the receiving queue can receive 5 messages each time, and the service process that sends the message is sent to the receiving queue each time. For the five messages, the number of each message is filled with the receiving queue as the first principle. When the first message is sent, the second message is sent. In an actual application, when multiple types of packets are stored in the cache space, a plurality of packets are first sorted according to the time of entering the cache space, and when the packets are sent, the earliest entry into the cache space is first performed. The message is taken out, and the corresponding number of the received message is sent to the receiving queue according to the criterion of filling the receiving queue. When the received message is not sent, the received message has a legacy message. When the legacy message is placed in the cache space, the position after the various messages are sorted according to the entered time. By analogy, you can continue to cycle.
可选地,在本发明实施例中,为提高报文发送的及时性和保证重要的报文优先发送,在下一次发送报文时,根据该第一报文对应的优先级和该第二报文对应的优先级,向接收队列发送相应数量的遗留报文和/或第二报文。Optionally, in the embodiment of the present invention, in order to improve the timeliness of the message transmission and ensure the priority transmission of the important message, the next time the message is sent, according to the priority corresponding to the first message and the second report. The priority corresponding to the text sends a corresponding number of legacy messages and/or second packets to the receiving queue.
其中,对应不同的报文可以预先设置优先级,当缓存空间中保存有多种报文时,该缓存空间每次都对保存的多种报文按照优先级别进行排序,比如,在第一次发送报文时,可以先将该缓存空间中保存的优先级别最高的报文,以填满接收队列为准则发送,每次发送与接收队列接收能力对应数量的优先级别最高的报文,直至缓存空间中的报文发送完;在实际应用中,当优先级别最高的报文的数量是接收队列接收能力的整数倍时,按照报文存入缓存空间的顺序进行发送,发送完后再发送缓存空间中优先级别第二高的报文,以此类推;当优先级别最高的报文的数量不是接收队列接收能力的整数倍时,先按照报文存入缓存空间的顺序进行发送,在最后一次发送报文时,由于该接收队列没有被填满,则在缓存空间发送相应数量的优先级别第二高的报文,以填满该接收队列,以此类推进行发送。在实际应用中,如果该缓存空间中保存两种或两种以上的报文的优先级别相同,则可以按照先入先出的原则进行发送。在更多的实施中也可以以其他的方式发送。 The priority can be set in advance for different packets. When multiple types of packets are saved in the cache space, the cache space sorts the saved multiple packets each time according to the priority level. For example, the first time When sending a packet, you can first send the packet with the highest priority in the cache space to fill the receiving queue. The maximum number of packets with the highest priority is sent to the receiving queue. The packets in the space are sent. In the actual application, when the number of packets with the highest priority is an integer multiple of the receiving capability of the receiving queue, the packets are sent in the order of the buffers, and then sent after the sending. The packet with the second highest priority in the space, and so on. When the number of packets with the highest priority is not an integer multiple of the receiving capability of the receiving queue, the packet is first sent in the order of the buffer, the last time. When the packet is sent, because the receiving queue is not filled, a corresponding number of packets with the second highest priority are sent in the buffer space to fill up. Receive queue, and so transmitted. In actual applications, if two or more types of packets are stored in the same cache with the same priority, they can be sent on a first-in, first-out basis. It can also be sent in other ways in more implementations.
本发明实施例还提供一种报文发送装置。The embodiment of the invention further provides a message sending device.
参照图5,图5为本发明实施例提供的一种报文发送装置的结构示意图。Referring to FIG. 5, FIG. 5 is a schematic structural diagram of a message sending apparatus according to an embodiment of the present invention.
在本实施例中,该报文发送装置包括:保存模块10,请求模块20和发送模块30。In this embodiment, the message sending apparatus includes: a saving module 10, a requesting module 20, and a sending module 30.
其中,保存模块10,设置为:在发送第一报文时,将该第一报文保存在缓存空间中。The saving module 10 is configured to save the first packet in the cache space when the first packet is sent.
为了节省开辟缓存空间的时间,快速发送产生的报文,本发明实施例可以预先在设备内存或者存储空间中开辟缓存空间,在实际应用中,也可以不先预先开辟缓存空间。在发送报文时,例如在路由设备之间需要发送保活报文时,本发明实施例先将产生的报文保存在预先开辟的缓存空间中。In order to save time for opening the cache space and quickly transmitting the generated message, the embodiment of the present invention may open a buffer space in the device memory or the storage space in advance, and in actual applications, the cache space may not be opened in advance. When a message is sent, for example, when a keep-alive message needs to be sent between the routing devices, the embodiment of the present invention first saves the generated message in a pre-opened cache space.
请求模块20,设置为:向接收队列发起发送请求。The requesting module 20 is configured to: initiate a sending request to the receiving queue.
将上述报文保存在缓存空间中后,向接收队列发起发送缓存空间中报文的发送请求。接收队列接收到该发送请求时,判断当前接收队列是否已满,如果当前的接收队列已满,则反馈对应当前接收队列已满的信息,比如反馈信息为暂停发送的信息;如果当前的接收队列为空,则反馈对应当前接收队列为空的信息。After the foregoing packet is saved in the buffer space, a request for sending a packet in the buffer space is initiated to the receiving queue. When receiving the sending request, the receiving queue determines whether the current receiving queue is full. If the current receiving queue is full, the information corresponding to the current receiving queue is full, for example, the feedback information is suspended information; if the current receiving queue is current, the current receiving queue is received. If it is empty, the feedback corresponds to the information that the current receiving queue is empty.
发送模块30,设置为:在接收到接收队列发送的指示发送信息时,根据该指示发送信息将保存模块10保存到缓存空间中相应数量的第一报文发送至接收队列,以使得该接收队列发送相应数量的第一报文。The sending module 30 is configured to: when receiving the indication sending information sent by the receiving queue, send, according to the indication sending information, the first number of the first packet saved by the saving module 10 to the buffer space to be sent to the receiving queue, so that the receiving queue Send the corresponding number of first messages.
发送报文的业务进程根据接收队列反馈的信息进行对应的处理,在接收到的暂停发送的反馈信息时,暂停发送所述缓存空间中报文。The service process of sending the message performs corresponding processing according to the information fed back by the receiving queue, and pauses the sending of the message in the buffer space when the received feedback information is suspended.
可选地,在本发明实施例中,在接收到接收队列反馈的指示发送信息时,发送报文的业务进程根据该接收队列反馈的指示发送信息,将缓存空间中保存的报文发送相应数量的报文至该接收队列,包括:在缓存空间中保存的报文的数量小于或等于接收队列可以接收的报文数量时,将缓存空间中保存的所有报文发送至接收队列;在缓存空间中保存的报文的数量大于接收队列可以接收的报文数量时,发送与该接收队列能够接收的报文数量对应数量的报文,在接收队列发送完本次发送的报文后,再发送之前发送时遗留的报文。 实际应用中,在发送报文的过程中,发送报文的数量主要是以满足接收队列的接收能力为标准,即发送报文的数量不能大于接收队列可以接收的报文数量,在待发送的报文数量较多时,每次发送与接收队列的接收能力对应数量的报文,直到缓存空间中的报文全部发送。该接收队列接收到缓存空间中报文时,将报文发送给对应的终端。Optionally, in the embodiment of the present invention, when receiving the indication sending information of the feedback of the receiving queue, the service process of sending the packet sends the information according to the indication fed back by the receiving queue, and sends the packet saved in the buffer space to the corresponding quantity. The packet is sent to the receiving queue, and includes: when the number of the packets stored in the buffer space is less than or equal to the number of packets that can be received by the receiving queue, all the packets stored in the buffer space are sent to the receiving queue; If the number of packets to be received is greater than the number of packets that can be received by the receiving queue, the number of packets corresponding to the number of packets that can be received by the receiving queue is sent, and the packet is sent after the sending queue sends the packet. A message left before being sent. In the actual application, the number of sent packets is mainly based on the receiving capability of the receiving queue. The number of sent packets cannot be greater than the number of packets that can be received by the receiving queue. When the number of packets is large, the number of packets corresponding to the receiving capability of the receiving queue is sent each time until all the packets in the buffer space are sent. When receiving the packet in the buffer space, the receiving queue sends the packet to the corresponding terminal.
本发明实施例提供的报文发送装置,在发送第一报文时,将该第一报文保存在缓存空间中,,向接收队列发起发送请求,在接收到接收队列发送的指示发送信息时,根据该指示发送信息将缓存空间中相应数量的第一报文发送至接收队列,以使得该接收队列发送相应数量的第一报文。通过上述方式,本发明实施例在发送报文时,先将报文保存在缓存空间中,然后向接收队列发送相应数量的报文,比如在报文数量比较大时,根据接收队列中可以接收报文的接收能力,发送与该接收队列接收能力相应数量的报文,遗留的报文在下一次发送,或者在报文数量比较小时,即报文数量没有超过接收队列接收能力时,将所有报文发送给接收队列,从而不会因为接收队列被填满,而丢弃其他的报文,保证了设备之间的正常通信。When the first packet is sent, the first packet is saved in the buffer space, and the packet sending device sends a request to the receiving queue, and receives the indication sending message sent by the receiving queue. Sending information according to the indication sends a corresponding number of first packets in the buffer space to the receiving queue, so that the receiving queue sends a corresponding number of first packets. In the foregoing manner, when sending a packet, the embodiment of the present invention first saves the packet in the buffer space, and then sends a corresponding number of packets to the receiving queue. For example, when the number of packets is relatively large, the receiving queue can receive the packet. The receiving capability of the packet, the number of packets corresponding to the receiving capability of the receiving queue is sent, and the legacy packet is sent next time, or when the number of packets is small, that is, the number of packets does not exceed the receiving capability of the receiving queue, all the packets are received. The text is sent to the receiving queue, so that the other packets are not discarded because the receiving queue is filled, which ensures normal communication between the devices.
可选地,图6为本发明实施例提供的报文发送装置中一种保存模块的结构示意图。本实施例中的保存模块10可以包括:Optionally, FIG. 6 is a schematic structural diagram of a save module in a message sending apparatus according to an embodiment of the present invention. The saving module 10 in this embodiment may include:
开辟单元11,设置为:在发送第一报文时,开辟缓存空间。The development unit 11 is configured to: when the first message is sent, the cache space is opened.
保存单元12,设置为:将第一报文保存在开辟单元11开辟的缓存空间中。The saving unit 12 is configured to save the first message in the cache space opened by the development unit 11.
为减轻内存或者存储模块的空间压力,本实施例也可以不预先在内存或者存储模块中开辟缓存空间,在发送报文时,在内存或者存储模块中开辟缓存空间,然后将需要发送的报文保存在该缓存空间中。In order to reduce the space pressure of the memory or the storage module, the embodiment may also not open a buffer space in the memory or the storage module in advance, and when the message is sent, the buffer space is opened in the memory or the storage module, and then the packet to be sent is sent. Saved in this cache space.
可选地,图7为本发明实施例提供另一种报文发送装置的结构示意图。Optionally, FIG. 7 is a schematic structural diagram of another apparatus for sending a message according to an embodiment of the present invention.
在上述图5所示报文发送装置的基础上,本实施例提供的装置还可以包括:暂停模块40,设置为:在接收到接收队列已满时发送的暂停发送信息时,根据该暂停发送信息暂停发送缓存空间中第一报文。 On the basis of the packet sending apparatus shown in FIG. 5, the apparatus provided in this embodiment may further include: a suspending module 40 configured to: when the suspended sending information sent when the receiving queue is full, is sent according to the pause The information pauses the first message in the buffer space.
可选地,本实施例还可以包括:判断模块50,设置为:将缓存空间中相应数量的第一报文发送至接收队列时,判断该缓存空间中是否存储有第一报文的遗留报文。Optionally, the embodiment may further include: a determining module 50, configured to: when the first number of the first packet in the buffer space is sent to the receiving queue, determine whether the legacy packet of the first packet is stored in the buffer space. Text.
相应地,发送模块30,还设置为:如果所述缓存空间中存储有遗留报文,则在下一次发送报文时,向接收队列发送相应数量的遗留报文。Correspondingly, the sending module 30 is further configured to: if a legacy message is stored in the buffer space, send a corresponding number of legacy messages to the receiving queue when the message is sent next time.
可选地,本实施例中的发送模块30,还设置为:如果所述缓存空间中存储有遗留报文,则在下一次发送报文时,向接收队列发送遗留报文和缓存空间中相应数量的第二报文。Optionally, the sending module 30 in this embodiment is further configured to: if the legacy packet is stored in the buffer space, send the legacy packet and the corresponding amount in the buffer space to the receiving queue when the packet is sent next time. Second message.
本实施例在将缓存空间中报文发送至接收队列后,还可以判断该缓存空间中是否存储有已发送报文的遗留报文,如果判断结果为该缓存空间中存储有遗留报文,则在下一次发送报文时,向接收队列发送相应数量的遗留报文。例如,在缓存空间中一共保存有9个保活报文,接收队列的接收能力为5个报文,在向接收队列发送5个报文时,判断该缓存空间中还遗留有4个保活报文,则在下一次发送报文时,发送遗留的4个保活报文,再例如,在缓存空间中一共保存有11个保活报文,在向接收队列发送5个报文,判断该缓存空间中还遗留有6个保活报文,则在下一次发送报文时,再发送遗留的5个保活报文,再判断缓存空间中是否还遗留有报文,判断到该缓存空间中还有1个保活报文时,则在第三次发送报文时,发送遗留的这1个保活报文。In this embodiment, after the packet in the buffer space is sent to the receiving queue, it is also determined whether the legacy packet of the sent packet is stored in the buffer space. If the result of the determination is that the legacy space is stored in the buffer space, When the next message is sent, the corresponding number of legacy messages are sent to the receiving queue. For example, a total of 9 keep-alive packets are stored in the buffer space, and the receiving capability of the receiving queue is 5 packets. When 5 packets are sent to the receiving queue, it is determined that there are 4 keep-alives left in the buffer space. The message is sent to the remaining 4 keep-alive messages when the next message is sent. For example, a total of 11 keep-alive messages are stored in the buffer space, and 5 messages are sent to the receiving queue to determine the message. In the cache space, there are still 6 keep-alive messages. When the next message is sent, the remaining 5 keep-alive messages are sent, and then it is determined whether there are still messages in the cache space, and the cache space is determined. When there is another keep-alive message, the remaining one keep-alive message is sent when the message is sent for the third time.
可选地,在本发明实施例中,如果缓存空间中还有遗留报文,则在下一次发送报文时,向接收队列发送遗留报文和缓存空间中相应数量的第二报文,其中该第二报文为在发送第一报文之后保存的报文。比如在设备中连续产生有多种报文,每种报文中有多个,则会在该缓存空间中按先入先出原则保存有多个种类和数量的报文,在发送至接收队列时,按照先入先出的原则,发送至该接收队列,每次发送的数量为与该接收队列接收能力相应的数量,比如接收队列每次能接收5个报文,则发送报文的业务进程每次向接收队列发送5个报文,每次发送的数量以填满该接收队列为第一原则,在发送完第一个报文还有遗留时,发送相应数量的第二个报文。在实际应用中,还可以在缓存空间中保存有多种报文时,先按照进入所述缓存空间的时间,对多种报文进行排序,在发送报文时,先将最早进入缓存空间的报文拿出,以填满 接收队列为准则,将拿出的报文中对应的数量发送到接收队列,在该拿出的报文没有发送完时,即拿出的报文有遗留报文时,将该遗留报文放在缓存空间中按照进入的时间进行排好序的多种报文之后的位置。以此类推,可以进行不断的循环。Optionally, in the embodiment of the present invention, if there is a legacy message in the buffer space, the next time the message is sent, the legacy message is sent to the receiving queue and the corresponding number of the second message in the buffer space, where The second packet is a packet that is saved after the first packet is sent. For example, if multiple packets are continuously generated in the device, and there are multiple packets in each device, multiple types and quantities of packets are stored in the cache space on a first-in-first-out basis, and are sent to the receiving queue. According to the principle of first-in first-out, the method is sent to the receiving queue, and the quantity sent each time is the number corresponding to the receiving capability of the receiving queue. For example, the receiving queue can receive 5 messages each time, and the service process of sending the message is The secondary receiving queue sends five packets, and the number of each transmission is to fill the receiving queue as the first principle. When the first packet is sent, the second packet is sent. In an actual application, when multiple types of packets are stored in the cache space, a plurality of packets are first sorted according to the time of entering the cache space, and when the packets are sent, the earliest entry into the cache space is first performed. The message is taken out to fill up The receiving queue is a criterion, and the corresponding quantity in the received message is sent to the receiving queue. When the received message is not sent, if the received message has a legacy message, the legacy message is placed. The position after sorting multiple messages in the cache space according to the time of entry. By analogy, you can continue to cycle.
可选地,在本发明实施例中,为提高报文发送的及时性和保证重要的报文优先发送,发送模块30设置为在下一次发送时,向接收队列发送遗留报文和述缓存空间中相应数量的第二报文的方式可以为:用于在下一次发送报文时,根据第一报文对应的优先级和第二报文对应的优先级,向接收队列发送相应数量的遗留报文和/或第二报文。Optionally, in the embodiment of the present invention, in order to improve the timeliness of the packet sending and ensure that the important packet is sent preferentially, the sending module 30 is configured to send the legacy packet to the receiving queue and the cache space in the next transmission. The corresponding number of the second packet may be used to: send the corresponding number of legacy packets to the receiving queue according to the priority corresponding to the first packet and the priority corresponding to the second packet when the packet is sent next time. And / or the second message.
其中,对应不同的报文可以预先设置优先级,当缓存空间中保存有多种报文时,该缓存空间每次都对保存的多种报文按照优先级别进行排序,比如,在第一次发送报文时,可以先将该缓存空间中保存的优先级别最高的报文,以填满接收队列为准则发送,每次发送与接收队列接收能力对应数量的优先级别最高的报文,直至缓存空间中的报文发送完;在实际应用中,当优先级别最高的报文的数量是接收队列接收能力的整数倍时,按照报文存入缓存空间的顺序进行发送,发送完后再发送缓存空间中优先级别第二高的报文,以此类推;当优先级别最高的报文的数量不是接收队列接收能力的整数倍时,先按照报文存入缓存空间的顺序进行发送,在最后一次发送报文时,由于该接收队列没有被填满,则在缓存空间发送相应数量的优先级别第二高的报文,以填满该接收队列,以此类推进行发送。在实际应用中,如果该缓存空间中保存两种或两种以上的报文的优先级别相同,则可以按照先入先出的原则进行发送。在更多的实施中也可以以其他的方式发送。The priority can be set in advance for different packets. When multiple types of packets are saved in the cache space, the cache space sorts the saved multiple packets each time according to the priority level. For example, the first time When sending a packet, you can first send the packet with the highest priority in the cache space to fill the receiving queue. The maximum number of packets with the highest priority is sent to the receiving queue. The packets in the space are sent. In the actual application, when the number of packets with the highest priority is an integer multiple of the receiving capability of the receiving queue, the packets are sent in the order of the buffers, and then sent after the sending. The packet with the second highest priority in the space, and so on. When the number of packets with the highest priority is not an integer multiple of the receiving capability of the receiving queue, the packet is first sent in the order of the buffer, the last time. When the packet is sent, because the receiving queue is not filled, a corresponding number of packets with the second highest priority are sent in the buffer space to fill up. Receive queue, and so transmitted. In actual applications, if two or more types of packets are stored in the same cache with the same priority, they can be sent on a first-in, first-out basis. It can also be sent in other ways in more implementations.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。 Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性Industrial applicability
本发明实施例通过在发送报文时,先将报文保存在缓存空间中,然后向接收队列发送相应数量的报文,比如在报文数量比较大时,根据接收队列中可以接收报文的接收能力,发送与该接收队列接收能力相应数量的报文,遗留的报文在下一次发送,或者在报文数量比较小时,即报文数量没有超过接收队列接收能力时,将所有报文发送给接收队列,从而不会因为接收队列被填满,而丢弃其他的报文,保证了设备之间的正常通信。 In the embodiment of the present invention, when the packet is sent, the packet is first stored in the buffer space, and then the corresponding number of packets are sent to the receiving queue. For example, when the number of packets is relatively large, the packet can be received according to the receiving queue. The receiving capability sends a packet corresponding to the receiving capability of the receiving queue, and the legacy packet is sent next time, or when the number of packets is small, that is, the number of packets does not exceed the receiving capability of the receiving queue, all the packets are sent to The queue is received so that the other packets are not discarded because the receiving queue is filled, ensuring normal communication between the devices.

Claims (12)

  1. 一种报文发送方法,所述方法包括:A message sending method, the method comprising:
    在发送第一报文时,将所述第一报文保存在缓存空间中;When the first packet is sent, the first packet is saved in the cache space;
    向接收队列发起发送请求;Initiating a send request to the receive queue;
    在接收到所述接收队列发送的指示发送信息时,根据所述指示发送信息将所述缓存空间中相应数量的所述第一报文发送至所述接收队列,以使得所述接收队列发送相应数量的所述第一报文。When receiving the indication sending information sent by the receiving queue, sending, according to the indication sending information, a corresponding number of the first packets in the buffer space to the receiving queue, so that the receiving queue sends corresponding The number of the first message.
  2. 根据权利要求1所述的方法,其中,所述在发送第一报文时,将所述第一报文保存在缓存空间中,包括:The method of claim 1, wherein the saving the first packet in the cache space when the first packet is sent comprises:
    在发送所述第一报文时,开辟所述缓存空间;Opening the cache space when the first message is sent;
    将所述第一报文保存在所述缓存空间中。Saving the first message in the cache space.
  3. 根据权利要求1所述的方法,其中,所述向接收队列发起发送请求之后,所述方法还包括:The method of claim 1, wherein after the initiating a sending request to the receiving queue, the method further comprises:
    在接收到所述接收队列已满时发送的暂停发送信息时,根据所述暂停发送信息暂停发送所述缓存空间中的所述第一报文。And when the suspended transmission information sent when the receiving queue is full, the first message in the buffer space is suspended according to the suspended sending information.
  4. 根据权利要求1所述的方法,其中,所述在接收到所述接收队列发送的指示发送信息时,根据所述指示发送信息将所述缓存空间中相应数量的所述第一报文发送至所述接收队列,以使得所述接收队列发送相应数量的所述第一报文之后,所述方法还包括:The method according to claim 1, wherein, when receiving the indication sending information sent by the receiving queue, sending, according to the indication sending information, a corresponding number of the first packets in the buffer space to After the receiving queue is configured to send the corresponding number of the first packet, the method further includes:
    将所述缓存空间中相应数量的所述第一报文发送至所述接收队列时,判断所述缓存空间中是否存储有所述第一报文的遗留报文;When the first number of the first packet in the buffer space is sent to the receiving queue, it is determined whether the legacy packet of the first packet is stored in the buffer space;
    如果所述缓存空间中存储有所述遗留报文,则在下一次发送报文时,向所述接收队列发送相应数量的所述遗留报文。If the legacy packet is stored in the buffer space, the corresponding number of the legacy packet is sent to the receiving queue when the packet is sent next time.
  5. 根据权利要求4所述的方法,其中,所述将所述缓存空间中相应数量的所述第一报文发送至所述接收队列时,判断所述缓存空间中是否存储有所述第一报文的遗留报文之后,所述方法还包括:The method according to claim 4, wherein, when the corresponding number of the first packets in the buffer space are sent to the receiving queue, determining whether the first report is stored in the cache space After the legacy message of the text, the method further includes:
    如果所述缓存空间中存储有所述遗留报文,则在下一次发送报文时,向 所述接收队列发送所述遗留报文和所述缓存空间中相应数量的第二报文,其中,所述第二报文为在发送所述第一报文之后保存的报文。If the legacy message is stored in the cache space, when the next time the message is sent, The receiving queue sends the legacy packet and a corresponding number of second packets in the buffer space, where the second packet is a packet that is saved after the first packet is sent.
  6. 根据权利要求5所述的方法,其中,所述在下一次发送报文时,向所述接收队列发送所述遗留报文和所述缓存空间中相应数量的第二报文,包括:The method according to claim 5, wherein the sending the legacy message and the corresponding number of second messages in the buffer space to the receiving queue when the message is sent next time comprises:
    在下一次发送报文时,根据所述第一报文对应的优先级和所述第二报文对应的优先级,向所述接收队列发送相应数量的所述遗留报文和/或所述第二报文。Sending, according to the priority corresponding to the first packet and the priority corresponding to the second packet, the corresponding number of the legacy packet and/or the first Two messages.
  7. 一种报文发送装置,包括:A message sending device includes:
    保存模块,设置为:在发送第一报文时,将所述第一报文保存在缓存空间中;The saving module is configured to: save the first packet in the cache space when the first packet is sent;
    请求模块,设置为:向接收队列发起发送请求;The requesting module is set to: initiate a sending request to the receiving queue;
    发送模块,设置为:在接收到所述接收队列发送的指示发送信息时,根据所述指示发送信息将所述保存模块保存在所述缓存空间中相应数量的所述第一报文发送至所述接收队列,以使得所述接收队列发送相应数量的所述第一报文。a sending module, configured to: when receiving the indication sending information sent by the receiving queue, send, according to the indication sending information, the saving module saves a corresponding number of the first packet in the buffer space to be sent to the The receiving queue is configured to enable the receiving queue to send a corresponding number of the first message.
  8. 根据权利要求7所述的装置,其中,所述保存模块包括:The apparatus of claim 7, wherein the saving module comprises:
    开辟单元,设置为:在发送所述第一报文时,开辟所述缓存空间;a development unit, configured to: when the first message is sent, open the cache space;
    保存单元,设置为:将所述第一报文保存在所述开辟单元开辟的所述缓存空间中。The saving unit is configured to: save the first message in the cache space opened by the development unit.
  9. 根据权利要求7所述的装置,还包括:The apparatus of claim 7 further comprising:
    暂停模块,设置为:在接收到所述接收队列已满时发送的暂停发送信息时,根据所述暂停发送信息暂停发送所述缓存空间中的所述第一报文。The suspension module is configured to: when receiving the suspended transmission information sent when the receiving queue is full, suspending transmitting the first packet in the buffer space according to the suspended sending information.
  10. 根据权利要求8所述的装置,还包括:The apparatus of claim 8 further comprising:
    判断模块,设置为:将所述缓存空间中相应数量的所述第一报文发送至所述接收队列时,判断所述缓存空间中是否存储有所述第一报文的遗留报文; The determining module is configured to: determine, when the corresponding number of the first packets in the buffer space are sent to the receiving queue, whether the legacy packet of the first packet is stored in the cache space;
    所述发送模块,还设置为:如果所述缓存空间中存储有所述遗留报文,则在下一次发送报文时,向所述接收队列发送相应数量的所述遗留报文。The sending module is further configured to: if the legacy message is stored in the buffer space, send a corresponding quantity of the legacy message to the receiving queue when the message is sent next time.
  11. 根据权利要求10所述的装置,其中,The device according to claim 10, wherein
    所述发送模块,还设置为:如果所述缓存空间中存储有所述遗留报文,则在下一次发送报文时,向所述接收队列发送所述遗留报文和所述缓存空间中相应数量的第二报文,其中,所述第二报文为在发送所述第一报文之后保存的报文。The sending module is further configured to: if the legacy message is stored in the buffer space, send the legacy message and the corresponding quantity in the cache space to the receiving queue when the next time the message is sent The second message, where the second message is a message saved after the first message is sent.
  12. 根据权利要求11所述的装置,其中,所述发送模块设置为在下一次发送报文时,向所述接收队列发送所述遗留报文和所述缓存空间中相应数量的第二报文,包括:The apparatus according to claim 11, wherein the sending module is configured to send the legacy message and a corresponding number of second messages in the buffer space to the receiving queue when the message is sent next time, including :
    在下一次发送报文时,根据所述第一报文对应的优先级和所述第二报文对应的优先级,向所述接收队列发送相应数量的所述遗留报文和/或所述第二报文。 Sending, according to the priority corresponding to the first packet and the priority corresponding to the second packet, the corresponding number of the legacy packet and/or the first Two messages.
PCT/CN2016/083341 2016-01-05 2016-05-25 Packet sending method and device WO2016197822A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610005462.1 2016-01-05
CN201610005462.1A CN106941460A (en) 2016-01-05 2016-01-05 File transmitting method and device

Publications (1)

Publication Number Publication Date
WO2016197822A1 true WO2016197822A1 (en) 2016-12-15

Family

ID=57502956

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/083341 WO2016197822A1 (en) 2016-01-05 2016-05-25 Packet sending method and device

Country Status (2)

Country Link
CN (1) CN106941460A (en)
WO (1) WO2016197822A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095433A (en) * 2021-11-25 2022-02-25 新华三技术有限公司合肥分公司 Message sending method, device, electronic equipment and medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109391559B (en) * 2017-08-10 2022-10-18 华为技术有限公司 Network device
CN109218206B (en) * 2018-09-04 2021-03-23 杭州迪普科技股份有限公司 Method and device for limiting link state advertisement quantity
CN110149552A (en) * 2019-05-08 2019-08-20 百度在线网络技术(北京)有限公司 A kind of processing method and terminal of video flowing frame data
CN112291165A (en) * 2019-07-24 2021-01-29 中兴通讯股份有限公司 Message processing method, switch and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621469A (en) * 2009-08-13 2010-01-06 杭州华三通信技术有限公司 Control device and control method for accessing data messages
CN104125168A (en) * 2013-04-27 2014-10-29 中兴通讯股份有限公司 A scheduling method and system for shared resources

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621469A (en) * 2009-08-13 2010-01-06 杭州华三通信技术有限公司 Control device and control method for accessing data messages
CN104125168A (en) * 2013-04-27 2014-10-29 中兴通讯股份有限公司 A scheduling method and system for shared resources

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095433A (en) * 2021-11-25 2022-02-25 新华三技术有限公司合肥分公司 Message sending method, device, electronic equipment and medium
CN114095433B (en) * 2021-11-25 2024-02-23 新华三技术有限公司合肥分公司 Message sending method and device, electronic equipment and medium

Also Published As

Publication number Publication date
CN106941460A (en) 2017-07-11

Similar Documents

Publication Publication Date Title
WO2016197822A1 (en) Packet sending method and device
CN109412964B (en) Message control method and network device
CN107547393B (en) Method for calculating forwarding path and network equipment
CN105812287B (en) Efficient circuit in packet switching network
JP6240248B2 (en) Transmission control protocol communication method and server
WO2018210117A1 (en) Congestion control method, network device, and network interface controller thereof
CN107959636B (en) Method and device for sending BGP (Border gateway protocol) message
US20200236052A1 (en) Improving end-to-end congestion reaction using adaptive routing and congestion-hint based throttling for ip-routed datacenter networks
US8942094B2 (en) Credit-based network congestion management
AU2011370439B2 (en) Method and apparatus for rapid data distribution
US10560383B2 (en) Network latency scheduling
CN108494817A (en) Data transmission method, relevant apparatus and system
WO2013042219A1 (en) Data communication apparatus, data transmission method, and computer system
WO2018036173A1 (en) Network load balancing method, device and system
CN113992588B (en) Data transmission method, device, electronic equipment and readable storage medium
WO2021143610A1 (en) Method, apparatus and system for controlling flow entry
US11218402B2 (en) Blockchain systems, and message transmission methods and apparatuses
WO2014094518A1 (en) Method and apparatus of managing a plurality of sessions in a multi-path routing based network
WO2016000170A1 (en) Data processing method executed by network apparatus, and associated device
JP5673057B2 (en) Congestion control program, information processing apparatus, and congestion control method
TWI465075B (en) Apparatus for processing packets and system for using the same
US11108697B2 (en) Technologies for controlling jitter at network packet egress
WO2016184012A1 (en) Method for preferentially transceiving hello message, and routing device
WO2022267937A1 (en) Protocol calculation method, switch, cross-device link aggregation system, and storage medium
WO2022183879A1 (en) Packet forwarding method, electronic device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16806720

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16806720

Country of ref document: EP

Kind code of ref document: A1