Message forwarding method and device, electronic equipment and computer readable storage medium

By using queueMaxSDU function in TSN, the queueMaxSDU value of the forwarding queue is determined and adjusted, and the problems of data frame transmission delay and queue blockage are solved, and the efficiency of packet forwarding and zero packet loss characteristics are achieved.

CN119155261APending Publication Date: 2024-12-17SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411242140.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In a time-sensitive network (TSN), since the node duration setting cannot fully guarantee the transmission delay of data frames, the data frame is truncated or blocked in the forwarding queue, affecting subsequent data transmission and normal operation of services.

Method used

When the queueMaxSDU function is turned on, determine the protection band running status of the target forwarding queue, calculate the queueMaxSDU value, judge the queue congestion status, and adjust the queueMaxSDU value to avoid queue blockage and ensure packet forwarding efficiency.

Benefits of technology

It effectively avoids abnormal packet discarding, improves packet forwarding efficiency, prevents queue blockage and subsequent data frame discarding, and ensures the zero packet loss characteristic of TSN stream forwarding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155261A_ABST
    Figure CN119155261A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message forwarding method and device, electronic equipment and a computer readable storage medium, and relates to the field of message forwarding, and the method comprises the steps: determining the operation state of a protection band of a target forwarding queue in a current node in the process of starting the function of a queueMaxSDU and forwarding a to-be-forwarded message, under the condition that the running state of the guard band of the target forwarding queue is an open state, calculating a corresponding first queueMaxSDU value of the target forwarding queue in the current node; the method comprises the following steps of: calculating each second queueMaxSDU value of a target forwarding queue in other nodes except a current node, acquiring a minimum queueMaxSDU value as a target queueMaxSDU value of the target forwarding queue, determining a congestion state of the target forwarding queue, and forwarding a message based on the target queueMaxSDU value when the congestion state of the target forwarding queue is non-congestion. According to the method, the functional characteristics of the queueMaxSDU are utilized, the queueMaxSDU is flexibly deployed, and the method is used for protecting the forwarding queue from being blocked abnormally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of message forwarding, and in particular to a message forwarding method, device, electronic equipment and computer-readable storage medium. Background Art

[0002] TSN (Time Sensitive Network) is a new generation of network standards based on Ethernet. It provides a set of universal time-sensitive mechanisms for the MAC layer of the Ethernet protocol to achieve low-latency, high-reliability deterministic transmission of key data such as voice, video, and industrial automation instructions in Ethernet. The TSN standard mainly includes clock synchronization, flow control, reliability, and security.

[0003] Based on the key services running in the network, users analyze the flow characteristics and running time of these key services. Through the 802.1Qbv function, the specified key services are allowed to enter the specified interface forwarding queues, and then these queues are flexibly and periodically scheduled to achieve zero congestion and packet loss when the device forwards these key service flows.

[0004] Normally, each interface has 8 forwarding queues, with queue numbers ranging from 0 to 7. When an interface needs to send a message, it first allows the message to enter the corresponding queue according to certain rules. For messages in the same queue, the first message to enter is forwarded first. The forwarding scheduling of different queues is based on different scheduling control linked lists, which include multiple nodes.

[0005] Since Ethernet transmits data in frames, and from the perspective of node duration setting, it is impossible to completely guarantee that the duration is exactly equal to the transmission delay of data frames of different lengths, there will be a situation where a data frame is sent halfway. The duration of the forwarding queue switch state has been reached. At this time, if you choose to continue to send the data frame, it will occupy the next node threshold switching and data transmission time, affecting the data transmission of subsequent nodes, or turn on the protection band and immediately execute the next node. The content of the data frame currently being sent is truncated, and the remaining content may be discarded, or it needs to wait until the next polling cycle before it can be sent.

[0006] When the guard band is turned on, if the remaining duration of the node is not enough to send the data frame completely, the message will be cached in the buffer and wait for the next threshold-opened node to try to send the data frame. However, if the duration of subsequent threshold-opened nodes is not enough to transmit the data frame completely, the data frame will be stuck in the queue. Even if the subsequent data frames in the queue meet the complete transmission conditions, they will not be sent out because the queue is blocked. When the chip buffer is not enough to store the blocked data frame, all subsequent messages entering the queue will be discarded, affecting normal business. Summary of the invention

[0007] The object of the present invention is to provide a message forwarding method, device, electronic device and computer-readable storage medium, which can avoid abnormal discarding of messages and improve message forwarding efficiency.

[0008] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0009] In a first aspect, an embodiment of the present application provides a message forwarding method, the method comprising:

[0010] When the queueMaxSDU function is enabled and in the process of forwarding the message to be forwarded, determining the running state of the protection band of the target forwarding queue in the current node, wherein the target forwarding queue is a forwarding queue whose threshold state is enabled, and the threshold state of the target forwarding queue is controlled by a control linked list, and the control linked list includes a plurality of nodes, each node corresponding to the threshold state of each forwarding queue;

[0011] When the running state of the guard band of the target forwarding queue is in the on state, calculating a first queueMaxSDU value corresponding to the target forwarding queue in the current node;

[0012] Calculate each second queueMaxSDU value of the target forwarding queue in other nodes excluding the current node;

[0013] Obtaining a minimum queueMaxSDU value from the first queueMaxSDU value and each of the second queueMaxSDU values ​​as a target queueMaxSDU value of the target forwarding queue;

[0014] Determining a congestion state of the target forwarding queue;

[0015] When the congestion state of the target forwarding queue is non-congested, message forwarding is performed based on the target queueMaxSDU value.

[0016] In an optional embodiment, the method further comprises:

[0017] When the congestion state of the target forwarding queue is congested, starting timing and determining the timing duration;

[0018] Determine whether the timing duration reaches a preset duration;

[0019] When the timing duration reaches a preset duration, the congested message in the target forwarding queue is deleted.

[0020] In an optional embodiment, the method further comprises:

[0021] Determining the frame length of the congested message;

[0022] Comparing the frame length of the congested message with the target queueMaxSDU value;

[0023] When the frame length of the congested message is greater than the target queueMaxSDU value, the target queueMaxSDU value is adjusted to a first target queueMaxSDU value, wherein the first target queueMaxSDU value is smaller than the target queueMaxSDU value.

[0024] In an optional embodiment, the method further comprises:

[0025] In a case where the operating state of the guard band of the target forwarding queue is a closed state, determining a preset queueMaxSDU value set for the target forwarding queue;

[0026] The queueMaxSDU value of the target forwarding queue is set to a preset queueMaxSDU value.

[0027] In an optional implementation, when the congestion state of the target forwarding queue is not congested, the step of forwarding the message based on the target queueMaxSDU value includes:

[0028] Determine the frame length of each message to be forwarded;

[0029] Compare each of the frame lengths with the target queueMaxSDU value in turn;

[0030] When the frame length is greater than the target queueMaxSDU value, discarding the message to be forwarded corresponding to the frame length;

[0031] When the frame length is less than the target queueMaxSDU value, the to-be-forwarded message corresponding to the frame length is allowed to enter the target forwarding queue.

[0032] In an optional implementation, when the running state of the protection band of the target forwarding queue is in an on state, the step of calculating the first queueMaxSDU value corresponding to the target forwarding queue in the current node includes:

[0033] Determining a forwarding duration of the target forwarding queue;

[0034] Determining a forwarding rate of the message to be forwarded;

[0035] Based on the forwarding duration and the forwarding rate, a first queueMaxSDU value corresponding to the target forwarding queue in the current node is calculated.

[0036] In an optional embodiment, the method further comprises:

[0037] When the running state of the protection band of the target forwarding queue is in the on state, determining the transmission time of the message to be forwarded;

[0038] Determine the duration of the node to which the target forwarding queue belongs;

[0039] When the transmission time is greater than the duration of the node to which the target forwarding queue belongs, the message to be forwarded is stored in a buffer.

[0040] In a second aspect, an embodiment of the present application provides a message forwarding device, the device comprising:

[0041] A determination module, used to determine the operating state of the protection band of the target forwarding queue in the current node when the queueMaxSDU function is turned on and in the process of forwarding the message to be forwarded, wherein the target forwarding queue is a forwarding queue with a threshold state in an on state, and the threshold state of the target forwarding queue is controlled by a control linked list, and the control linked list includes multiple nodes, each node corresponding to the threshold state of each forwarding queue;

[0042] A calculation module, configured to calculate, when the running state of the protection band of the target forwarding queue is in the on state, a first queueMaxSDU value corresponding to the target forwarding queue in the current node; and calculate each second queueMaxSDU value of the target forwarding queue in other nodes excluding the current node;

[0043] an acquisition module, configured to acquire a minimum queueMaxSDU value from the first queueMaxSDU value and each of the second queueMaxSDU values ​​as a target queueMaxSDU value of the target forwarding queue;

[0044] The determination module is also used to: determine the congestion state of the target forwarding queue;

[0045] The message forwarding module is used to forward the message based on the target queueMaxSDU value when the congestion state of the target forwarding queue is non-congested.

[0046] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the message forwarding method when executing the computer program.

[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the message forwarding method when executed by a processor.

[0048] This application has the following beneficial effects:

[0049] The present application determines the operating state of the protection band of the target forwarding queue in the current node when the queueMaxSDU function is turned on and during the forwarding process of the message to be forwarded, wherein the target forwarding queue is a forwarding queue with a threshold state in an on state, the threshold state of the target forwarding queue is controlled by a control linked list, the control linked list includes multiple nodes, each node corresponds to the threshold state of each forwarding queue, and when the operating state of the protection band of the target forwarding queue is in an on state, calculates the first queueMaxSDU value corresponding to the target forwarding queue in the current node; calculates each second queueMaxSDU value of the target forwarding queue in other nodes excluding the current node, obtains the minimum queueMaxSDU value from the first queueMaxSDU value and each second queueMaxSDU value, and uses it as the target queueMaxSDU value of the target forwarding queue, determines the congestion state of the target forwarding queue, and when the congestion state of the target forwarding queue is not congested, forwards the message based on the target queueMaxSDU value. By utilizing the functional characteristics of queueMaxSDU (queueMax ervice Data Uni, maximum service data unit value), queueMaxSDU can be flexibly deployed to protect the forwarding queue from being blocked by abnormalities. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0051] Figure 1Provide a control chain representation diagram for an embodiment of the present invention;

[0052] Figure 2 A block diagram of an electronic device provided by an embodiment of the present invention;

[0053] Figure 3 One of the flow diagrams of a message forwarding method provided in an embodiment of the present invention;

[0054] Figure 4 A second flow chart of a message forwarding method provided by an embodiment of the present invention;

[0055] Figure 5 A third flow chart of a message forwarding method provided by an embodiment of the present invention;

[0056] Figure 6 A fourth flow chart of a message forwarding method provided in an embodiment of the present invention;

[0057] Figure 7 A schematic structural diagram of a message forwarding device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0059] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0061] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0062] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0063] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0064] After extensive research, the inventors found that when TSN stream forwarding, when the setting angle of the node duration cannot guarantee the transmission of the message, it will occupy the next node threshold switching and data transmission time.

[0065] The TSN flow forwarding scheduling control linked list is used to implement the scheduling of the interface forwarding queue and the forwarding of the message. The TSN flow forwarding scheduling control linked list contains multiple nodes, each of which defines three attributes, through which the execution operation of a node is completed:

[0066] (1) Node number: If a maximum of 16 nodes can be defined in the control linked list, the corresponding node numbers are 1 to 16. Messages are dispatched in order of node numbers from small to large.

[0067] (2) Queue switch status: The switch status of the interface forwarding queue is represented by an 8-bit binary string. From right to left, the first bit on the right represents the switch status of queue 0, the second bit on the right represents the switch status of queue 1, and so on. When a bit is 0, it means off, that is, the packets in the queue are not allowed to be sent; when a bit is 1, it means on, that is, the packets in the queue are allowed to be sent.

[0068] (3) Duration of the switch state: the duration of the switch state of the interface forwarding queue in the node. When this time is reached, the next node is executed and the switch state of the queue in the next node is switched.

[0069] like Figure 1 As shown, a schematic diagram of a custom 3-node control linked list is as follows, which implements the alternating traffic scheduling of queues 7, 6, 3, 2 and queues 5, 4, 1, 0.

[0070] When the duration of node 1 is unable to forward the current message, the current message will occupy the threshold switching and data transmission time of node 2.

[0071] When the guard band is turned on, during the current message transmission, if the duration of node 1 is reached, node 2 will be executed immediately, and the data frame content of the message currently being sent will be truncated, and the remaining content may be discarded, or if the threshold of the corresponding queue of node 1 is in the open state, the chip will make a judgment before transmitting the data frame. If the remaining duration of node 1 is not enough to send the data frame of the message completely, the message will be cached in the buffer and wait for the next node with the threshold turned on. Trying to send the data frame will need to wait until the next polling cycle before it can be sent.

[0072] However, if the duration of subsequent threshold-opened nodes is not sufficient to completely transmit the data frame, the data frame will be blocked in the forwarding queue. Even if the subsequent data frames in the forwarding queue meet the complete transmission conditions, they will not be able to be sent out because the queue is blocked. When the chip buffer is not sufficient to store the blocked data frames, when the corresponding forwarding queue reaches the time set by the aging mechanism, all subsequent messages entering the forwarding queue will be discarded, affecting normal business.

[0073] It should be noted that the aging mechanism is to count down when the queue is blocked. When the timing reaches the set time, the message of the blocked queue is deleted from the forwarding queue to ensure the normal operation of subsequent services.

[0074] Existing technologies rely on timeout aging solutions to take measures after problems occur to clear congested data frames to ensure the normal operation of subsequent services. However, TSN characteristic traffic has a low tolerance for packet loss. Using the timeout aging mechanism to clear congested data frames will result in packet loss before the set time arrives. If the congested data frames have exceeded the storage capacity of the buffer, packet loss will occur. In addition, the queue flush usually clears all data frames in the queue, which will also cause some unnecessary traffic to be accidentally lost. This does not meet the expectation of zero packet loss for characteristic traffic. On the other hand, after the queue is flushed, there are no subsequent safeguards, and problems may still occur repeatedly, which does not meet the expected standards of the protocol.

[0075] In view of the discovery of the above problems, the present embodiment provides a message forwarding method, device, electronic device and computer-readable storage medium, which can determine the operating status of the protection band of the target forwarding queue in the current node when the queueMaxSDU function is turned on and in the process of forwarding the message to be forwarded, wherein the target forwarding queue is a forwarding queue with a threshold state in the turned-on state, the threshold state of the target forwarding queue is controlled by a control linked list, the control linked list includes multiple nodes, each node corresponds to the threshold state of each forwarding queue, and when the operating state of the protection band of the target forwarding queue is in the turned-on state, the first queueMaxSDU value corresponding to the target forwarding queue in the current node is calculated; the second queueMaxSDU values ​​of the target forwarding queue in other nodes excluding the current node are calculated, and the minimum queueMaxSDU value is obtained from the first queueMaxSDU value and the second queueMaxSDU values ​​as the target queueMaxSDU value of the target forwarding queue, and the congestion state of the target forwarding queue is determined. When the congestion state of the target forwarding queue is not congested, the message is forwarded based on the target queueMaxSDU value. By utilizing the functional characteristics of queueMaxSDU (queueMax ervice Data Uni, maximum service data unit value), queueMaxSDU is flexibly deployed to protect the forwarding queue from being blocked by abnormalities. The solution provided by this embodiment is described in detail below.

[0076] This embodiment provides an electronic device that can forward messages. In a possible implementation, the electronic device can be a user terminal, for example, the electronic device can be, but is not limited to, a server, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), etc.

[0077] Please refer to Figure 2 , Figure 2 1 is a schematic diagram of the structure of the electronic device 100 provided in the embodiment of the present application. The electronic device 100 may also include Figure 2 More or fewer components as shown, or with Figure 2 Different configurations shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0078] The electronic device 100 includes a message forwarding device 110 , a memory 120 and a processor 130 .

[0079] The memory 120 and the processor 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The message forwarding device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the message forwarding device 110.

[0080] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.

[0081] Please refer to Figure 3 , Figure 3 For application Figure 2 A flowchart of a message forwarding method of an electronic device 100 is provided, and the method including each step is described in detail below.

[0082] S201: When the queueMaxSDU function is enabled and during the forwarding process of the message to be forwarded, the running state of the protection band of the target forwarding queue in the current node is determined.

[0083] The target forwarding queue is a forwarding queue whose threshold state is an open state. The threshold state of the target forwarding queue is controlled by a control linked list. The control linked list includes multiple nodes, and each node corresponds to the threshold state of each forwarding queue.

[0084] S202: When the running state of the guard band of the target forwarding queue is in the on state, a first queueMaxSDU value corresponding to the target forwarding queue in the current node is calculated.

[0085] S203: Calculate the second queueMaxSDU values ​​of the target forwarding queue in other nodes except the current node.

[0086] S204: Obtain a minimum queueMaxSDU value from the first queueMaxSDU value and each second queueMaxSDU value as a target queueMaxSDU value of the target forwarding queue.

[0087] S205: Determine the congestion status of the target forwarding queue.

[0088] S206: When the congestion state of the target forwarding queue is not congested, forward the message based on the target queueMaxSDU value.

[0089] The queueMaxSDU queue maximum service data unit value usually refers to the parameter in the network device or protocol stack used to limit the maximum SDU size in the queue. This parameter is in the network device or protocol stack, thereby limiting the maximum size of the data packet in the forwarding queue to avoid network congestion or packet loss caused by sending too large data packets. In the process of forwarding packets to be forwarded in this application, if the queueMaxSDU queue maximum service data unit value function is turned on, it means that the data frame packet length is greater than the queueMaxSDU queue maximum service data unit value. The message to be forwarded is not allowed to enter the forwarding queue.

[0090] The queueMaxSDU queue maximum service data unit value function can be configured manually, or the queueMaxSDU queue maximum service data unit value can be set in adaptive mode.

[0091] When the queueMaxSDU function is in manual mode, data frames within the frame length range supported by the forwarding interface are allowed to enter the forwarding queue by default. If there is a user configuration of the queueMaxSDU value, the queueMaxSDU value is changed to the value manually set by the user.

[0092] When the function of queueMaxSDU is in adaptive mode, the value of queueMaxSDU is calculated based on each node in the control linked list.

[0093] It should be noted that the function of the guard band is that if the threshold of the corresponding forwarding queue of the current node is in the open state, the chip will make a judgment before transmitting the data frame of the message to be forwarded. If the remaining duration of the node is not enough to completely send out the data frame of the message to be forwarded, the message to be forwarded will be cached in the buffer. Specifically: when the operating state of the guard band of the target forwarding queue is in the open state, the transmission time of the message to be forwarded can be determined, and the duration of the node to which the target forwarding queue belongs can be determined; when the transmission time is greater than the duration of the node to which the target forwarding queue belongs, the message to be forwarded is stored in the buffer.

[0094] When the running state of the guard band of the target forwarding queue is the closed state, a preset queueMaxSDU value set for the target forwarding queue is determined; and the queueMaxSDU value of the target forwarding queue is set to the preset queueMaxSDU value.

[0095] The control linked list is a linked list for controlling the threshold status of each forwarding queue. The control linked list contains multiple nodes, each node is configured with a different duration, and each node contains the threshold status of different forwarding queues. The entire control linked list corresponds to a cycle time, that is, when the first node of the control linked list starts to be executed, the timing is performed, and the control linked list is executed in the order of each node in the control linked list. When the cycle time of the control linked list is reached, the control linked list will be automatically re-executed from the first node. The cycle time is the duration of executing the control linked list once in the system.

[0096] For example, when the forwarding queue contains 8 forwarding queues, the forwarding queues are numbered 0-7, and the control linked list contains a certain node, the threshold state of each queue contained in the node is 11001100, and the duration set by the node is 200ns, that is, the threshold state of the forwarding queues numbered 7, 6, 3, and 2 is open, allowing the messages in the forwarding queues to be sent, and the time for allowing the forwarding queues numbered 7, 6, 3, and 2 to send messages is 200ns. The threshold state of the forwarding queues numbered 5, 4, and 0 is closed, and the messages in the forwarding queues are not allowed to be sent.

[0097] If the control linked list contains three nodes, the duration of the first node, the duration of the second node and the duration of the third node are set respectively. The first node, the second node and the third node contain the threshold status of each forwarding queue. When executing the control linked list, it can be executed in the order of small to large node numbers, that is, the first node is executed first, then the second node, and finally the third node. When the execution of the first node begins, the timing is performed, and each node is executed in sequence. After reaching the cycle time of the control linked list, the control linked list is automatically restarted from the first node.

[0098] In the present application, when the queueMaxSDU function is turned on and the operating state of the protection band is turned on, and the queueMaxSDU is set to adaptive mode, in an implementation method of calculating the value of queueMaxSDU based on each node in the control linked list, the first queueMaxSDU value corresponding to the target forwarding queue in the current node and the second queueMaxSDU values ​​of the target forwarding queue in other nodes in the control linked list are determined, and the minimum queueMaxSDU value is obtained from the first queueMaxSDU value and the second queueMaxSDU values ​​as the target queueMaxSDU value of the target forwarding queue.

[0099] For example: the control linked list contains 3 nodes, namely node 1, node 2 and node 3, and the target forwarding queue is the forwarding queue numbered 7. During the forwarding process of the message to be forwarded, when the control linked list executes to node 2, the first queueMaxSDU value of the forwarding queue numbered 7 in node 2 is determined, the second queueMaxSDU value of the forwarding queue numbered 7 in node 1 and the second queueMaxSDU value in node 3 are determined, the minimum queueMaxSDU value is determined from the first queueMaxSDU value and the second queueMaxSDU values, and the queueMaxSDU value is used as the target queueMaxSDU value of the target forwarding queue.

[0100] In another implementation method of calculating the queueMaxSDU value based on each node in the control linked list, since a certain node of the control linked list contains the threshold states of multiple forwarding queues, and when forwarding a forwarded message, it will only be forwarded from a forwarding queue with multiple threshold states in the open state. Therefore, the first queueMaxSDU value of the target forwarding queue corresponding to the current node and the second queueMaxSDU values ​​of other nodes in the control linked list can be determined, and the minimum queueMaxSDU value is obtained from the first queueMaxSDU value and the second queueMaxSDU values ​​as the target queueMaxSDU value of the target forwarding queue.

[0101] The method for calculating the first queueMaxSDU value corresponding to the target forwarding queue in the current node can be: the forwarding duration of the target forwarding queue; determining the forwarding rate of the message to be forwarded; based on the forwarding duration and the forwarding rate, calculating the first queueMaxSDU value corresponding to the target forwarding queue in the current node. When the target forwarding queue is in a non-congested state, forwarding the message is performed based on the target queueMaxSDU value.

[0102] When the length of a data frame is greater than the data capacity that a node can transmit within a certain period of time, the queue may be blocked. The function of queueMaxSDU is to prevent data frames with a packet length greater than queueMaxSDU from entering the queue. Therefore, by flexibly deploying the value of queueMaxSDU so that it is not greater than the theoretical data frame length that a node can transmit, the queue can be prevented from being abnormally blocked at the source, thereby protecting the characteristic traffic of the forwarding queue from abnormal packet loss.

[0103] The method of the present invention can avoid the queue blocking problem caused by imperfect network planning from the source, and avoid the traffic loss caused by the timeout aging mechanism. In addition, the timeout aging scheme is supplemented, so that after the subsequent business returns to normal after the timeout aging mechanism is triggered, the traffic with the same frame length is received again without queue blocking, which effectively protects the Qbv queue so that it can always perform normal traffic scheduling.

[0104] That is, the data frame corresponding to the message to be forwarded that is larger than the target queueMaxSDU value cannot enter the target forwarding queue. The target forwarding queue can be guaranteed to forward messages that are less than or equal to the target queueMaxSDU value, and will not cause congestion in the target forwarding queue.

[0105] To ensure message forwarding, Figure 4 As shown, the following steps are included:

[0106] S301: When the congestion state of the target forwarding queue is congested, start timing and determine the timing duration.

[0107] S302: Determine whether the timing duration reaches a preset duration.

[0108] S303: When the timing duration reaches a preset duration, the congested message in the target forwarding queue is deleted.

[0109] In order to ensure that forwarded messages can be forwarded normally, it is necessary to periodically detect the congestion status of each forwarding queue in the forwarding port. When the congestion status of the forwarding queue is detected to be congested, the relevant timing device starts to operate, that is, it starts timing and determines the timing duration, and compares the timing duration with the preset duration. When the preset duration is reached, in order to ensure the normal forwarding of subsequent messages, the messages in the blocked forwarding queue are deleted from the forwarding queue, thereby ensuring the normal operation of subsequent services.

[0110] It should be noted that the preset time length can be set to 10ns, 20ns, 30ns, etc., and the embodiment of the present invention does not impose any specific limitation on this.

[0111] In order to ensure the continuity of the subsequent message forwarding process, such as Figure 5 As shown, the following steps are included:

[0112] S401: When the queueMaxSDU function is enabled and during the forwarding process of the message to be forwarded, the running state of the protection band of the target forwarding queue in the current node is determined.

[0113] S402: When the running state of the guard band of the target forwarding queue is in the on state, a first queueMaxSDU value corresponding to the target forwarding queue in the current node is calculated.

[0114] S403: Calculate the second queueMaxSDU values ​​of the target forwarding queue in other nodes except the current node.

[0115] S404: Obtain a minimum queueMaxSDU value from the first queueMaxSDU value and each second queueMaxSDU value as a target queueMaxSDU value of the target forwarding queue.

[0116] S405: Determine the congestion status of the target forwarding queue.

[0117] S406: When the congestion state of the target forwarding queue is not congested, forward the message based on the target queueMaxSDU value.

[0118] S407: When the congestion state of the target forwarding queue is congested, determine the frame length of the congested message.

[0119] S408: Compare the frame length of the congested message with the target queueMaxSDU value.

[0120] S409: When the frame length of the congested message is greater than the target queueMaxSDU value, the target queueMaxSDU value is adjusted to the first target queueMaxSDU value.

[0121] The first target queueMaxSDU value is smaller than the target queueMaxSDU value.

[0122] When the queueMaxSDU function is enabled, the protection band of the current forwarding queue is enabled, and the mode of the queueMaxSDU function is the adaptive mode, the queueMaxSDU value is flexibly deployed according to the duration of the node, so that the deployed queueMaxSDU value is not greater than the theoretical data frame length that can be transmitted. That is, the first queueMaxSDU value corresponding to the target forwarding queue in the current node is calculated, and the second queueMaxSDU values ​​of the target forwarding queue in other nodes excluding the current node are calculated, and the minimum queueMaxSDU value is obtained from the first queueMaxSDU value and the second queueMaxSDU values ​​as the target queueMaxSDU value of the target forwarding queue.

[0123] Due to the opening of the guard band, before the data frame is transmitted, a judgment will be made. If the remaining duration of the node is not enough to send the data frame completely, the data frame of the message to be forwarded will be cached in the buffer, waiting for the next node with a threshold to be opened, and trying to send the data frame. Therefore, when the guard band is in the open state, the target forwarding queue may be congested, so it is necessary to determine the congestion state of the target forwarding queue. When the congestion state of the target forwarding queue is congested, the target queueMaxSDU value of the target forwarding queue is adjusted, that is, the target queueMaxSDU value is adjusted to the first target queueMaxSDU value that is less than the target queueMaxSDU value, and the message is forwarded based on the first target queueMaxSDU value. When the congestion state of the target forwarding queue is not congested, the message is forwarded based on the currently set target queueMaxSDU value.

[0124] When it is detected that the target forwarding queue is blocked, the timeout aging mechanism is triggered, that is, the congested message in the target forwarding queue is deleted after the timing reaches the preset time, and the abnormal information is reported. The upper-layer CPU obtains the frame length of the congested message in the target forwarding queue, and compares the frame length of the congested message with the target queueMaxSDU value. When the frame length of the congested message is greater than the target queueMaxSDU value, the target queueMaxSDU value is reduced, that is, the target queueMaxSDU value is adjusted to the first target queueMaxSDU value, and other configurations remain unchanged. The traffic is continued to be scheduled, which can ensure that subsequent traffic is no longer discarded due to blockage by the frame length.

[0125] When the congestion state of the target forwarding queue is not congested, there are multiple ways to implement message forwarding based on the target queueMaxSDU value. In one implementation, for example Figure 6 As shown, the following steps are included:

[0126] S501: Determine the frame length of each message to be forwarded.

[0127] S502: Compare the length of each frame with the target queueMaxSDU value in turn.

[0128] S503: When the frame length is greater than the target queueMaxSDU value, the to-be-forwarded message corresponding to the frame length is discarded.

[0129] S504: When the frame length is less than the target queueMaxSDU value, the to-be-forwarded message corresponding to the frame length is allowed to enter the target forwarding queue.

[0130] When the guard band function is enabled, the to-be-forwarded message with a frame length greater than the target queueMaxSDU value can be stored in the buffer. When the guard band function is not enabled, when the frame length is greater than the target queueMaxSDU value, the to-be-forwarded message corresponding to the frame length is discarded.

[0131] Please refer to Figure 7 The present application embodiment also provides an application Figure 1 The message forwarding device 110 of the electronic device 100 includes:

[0132] A determination module 111 is used to determine the operating state of the protection band of the target forwarding queue in the current node when the queueMaxSDU function is turned on and in the process of forwarding the message to be forwarded, wherein the target forwarding queue is a forwarding queue with a threshold state in an turned-on state, and the threshold state of the target forwarding queue is controlled by a control linked list, and the control linked list includes multiple nodes, each node corresponding to the threshold state of each forwarding queue;

[0133] The calculation module 112 is used to calculate the first queueMaxSDU value corresponding to the target forwarding queue in the current node when the running state of the protection band of the target forwarding queue is in the on state; calculate each second queueMaxSDU value of the target forwarding queue in other nodes excluding the current node;

[0134] An acquisition module 113, configured to acquire a minimum queueMaxSDU value from the first queueMaxSDU value and each of the second queueMaxSDU values ​​as a target queueMaxSDU value of the target forwarding queue;

[0135] The determination module 111 is further used to: determine the congestion state of the target forwarding queue;

[0136] The message forwarding module 114 is configured to forward messages based on the target queueMaxSDU value when the congestion state of the target forwarding queue is non-congested.

[0137] The present application also provides an electronic device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer executable instructions, and when the computer executable instructions are executed by the processor 130, the message forwarding method is implemented.

[0138] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor 130, the message forwarding method is implemented.

[0139] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0140] In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.

[0141] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0142] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A message forwarding method, characterized in that: The method comprises: When the queueMaxSDU function is enabled and in the process of forwarding the message to be forwarded, determining the running state of the protection band of the target forwarding queue in the current node, wherein the target forwarding queue is a forwarding queue whose threshold state is enabled, and the threshold state of the target forwarding queue is controlled by a control linked list, and the control linked list includes a plurality of nodes, each node corresponding to the threshold state of each forwarding queue; When the running state of the guard band of the target forwarding queue is in the on state, calculating a first queueMaxSDU value corresponding to the target forwarding queue in the current node; Calculate each second queueMaxSDU value of the target forwarding queue in other nodes excluding the current node; Obtaining a minimum queueMaxSDU value from the first queueMaxSDU value and each of the second queueMaxSDU values ​​as a target queueMaxSDU value of the target forwarding queue; Determining a congestion state of the target forwarding queue; When the congestion state of the target forwarding queue is non-congested, message forwarding is performed based on the target queueMaxSDU value.

2. The method according to claim 1, characterized in that: The method further comprises: When the congestion state of the target forwarding queue is congested, starting timing and determining the timing duration; Determine whether the timing duration reaches a preset duration; When the timing duration reaches a preset duration, the congested message in the target forwarding queue is deleted.

3. The method according to claim 2, characterized in that The method further comprises: Determining the frame length of the congested message; Comparing the frame length of the congested message with the target queueMaxSDU value; When the frame length of the congested message is greater than the target queueMaxSDU value, the target queueMaxSDU value is adjusted to a first target queueMaxSDU value, wherein the first target queueMaxSDU value is smaller than the target queueMaxSDU value.

4. The method according to claim 1, characterized in that: The method further comprises: In a case where the operating state of the guard band of the target forwarding queue is a closed state, determining a preset queueMaxSDU value set for the target forwarding queue; The queueMaxSDU value of the target forwarding queue is set to a preset queueMaxSDU value.

5. The method according to claim 1, characterized in that The step of forwarding a message based on the target queueMaxSDU value when the congestion state of the target forwarding queue is non-congested includes: Determine the frame length of each message to be forwarded; Compare each of the frame lengths with the target queueMaxSDU value in turn; When the frame length is greater than the target queueMaxSDU value, discarding the message to be forwarded corresponding to the frame length; When the frame length is less than the target queueMaxSDU value, the to-be-forwarded message corresponding to the frame length is allowed to enter the target forwarding queue.

6. The method according to claim 1, characterized in that The step of calculating a first queueMaxSDU value corresponding to the target forwarding queue in the current node when the running state of the guard band of the target forwarding queue is in the on state comprises: Determining a forwarding duration of the target forwarding queue; Determining a forwarding rate of the message to be forwarded; Based on the forwarding duration and the forwarding rate, a first queueMaxSDU value corresponding to the target forwarding queue in the current node is calculated.

7. The method according to claim 1, characterized in that The method further comprises: When the running state of the protection band of the target forwarding queue is in the on state, determining the transmission time of the message to be forwarded; Determine the duration of the node to which the target forwarding queue belongs; When the transmission time is greater than the duration of the node to which the target forwarding queue belongs, the message to be forwarded is stored in a buffer.

8. A message forwarding device, characterized in that: The device comprises: A determination module, used to determine the operating state of the protection band of the target forwarding queue in the current node when the queueMaxSDU function is turned on and in the process of forwarding the message to be forwarded, wherein the target forwarding queue is a forwarding queue with a threshold state in an turned-on state, and the threshold state of the target forwarding queue is controlled by a control linked list, and the control linked list includes multiple nodes, each node corresponding to the threshold state of each forwarding queue; A calculation module, configured to calculate, when the running state of the protection band of the target forwarding queue is in the on state, a first queueMaxSDU value corresponding to the target forwarding queue in the current node; and calculate each second queueMaxSDU value of the target forwarding queue in other nodes excluding the current node; an acquisition module, configured to acquire a minimum queueMaxSDU value from the first queueMaxSDU value and each of the second queueMaxSDU values ​​as a target queueMaxSDU value of the target forwarding queue; The determination module is also used to: determine the congestion state of the target forwarding queue; The message forwarding module is used to forward the message based on the target queueMaxSDU value when the congestion state of the target forwarding queue is non-congested.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.