Data forwarding and scheduling method and apparatus

CN116686259BActive Publication Date: 2026-06-05HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2021-04-27
Publication Date
2026-06-05

Smart Images

  • Figure CN116686259B_ABST
    Figure CN116686259B_ABST
Patent Text Reader

Abstract

The application provides a data forwarding and scheduling method and device. The method comprises: obtaining control information to be forwarded and a target output port; when the target output port is not congested and there is no control information sent to the target output port on an LL path, copying the control information to be forwarded to obtain shadow control information; sending the control information to be forwarded to the target output port through the LL path and sending the shadow control information to the target output port through a store-and-forward SAF path; when the last scheduled and output control information is from a SAF path cache queue, scheduling the first control information in the queue head from the SAF path cache queue; when the first control information is the shadow control information, scheduling and outputting the control information in the queue head from an LL path cache queue; and when the first control information is not the shadow control information, outputting the first control information. The application can more accurately adapt to traffic congestion and ensure that the control information is output in a correct order.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to communication technology, and more particularly to a data forwarding and scheduling method and apparatus. Background Technology

[0002] With the continuous development of networks, the latency requirements for communication equipment are becoming increasingly stringent. Typically, after receiving data at the input port of a communication device, the data is first stored in a shared buffer. During forwarding, the data is moved from one address in the shared buffer to another, thus exchanging the data to the target output port. The process of data moving from the input port to the target output port may involve one or more store-and-forward operations. Each store-and-forward operation introduces a certain delay; the more store-and-forward operations are performed, the greater the delay.

[0003] To address the aforementioned issues, related technologies employ solutions including: when the target output port is not congested, data does not need to undergo a store-and-forward process in the shared buffer; instead, the data is directly written into the buffer corresponding to the target output port, thereby reducing the latency of data from the input port to the target output port; when the target output port is congested, the data is exchanged to the target output port after undergoing store-and-forward in the shared buffer.

[0004] However, since packets written directly to the buffer corresponding to the target output port arrive at the target output port faster, there may be a situation at the target output port where packets that are ordered later arrive before packets that are synchronously ordered earlier via store-and-forward. The target output port cannot distinguish the order of the packets, which ultimately leads to out-of-order packet output. Summary of the Invention

[0005] This application provides a data forwarding and scheduling method and apparatus to more accurately adapt to traffic congestion and ensure that control information is output in the correct order.

[0006] In a first aspect, this application provides a data scheduling method, comprising: obtaining control information to be forwarded and the target output port of the control information to be forwarded; determining whether the target output port is congested and determining whether there is control information to be sent to the target output port on the LL path; when the target output port is not congested and there is no control information to be sent to the target output port on the LL path, copying the control information to be forwarded to obtain shadow control information, sending the control information to be forwarded to the target output port through the LL path, and sending the shadow control information to the target output port through the SAF path. When the control information previously scheduled and output comes from the SAF path buffer queue corresponding to the target output port, scheduling the first control information at the head of the queue from the SAF path buffer queue; when the first control information is shadow control information, scheduling and outputting the control information at the head of the queue from the LL path buffer queue corresponding to the target output port; when the first control information is not shadow control information, outputting the first control information.

[0007] This application avoids situations where it's difficult to switch the forwarding path back to the LL path. When both conditions are met—no congestion at the target output port and no control information to be sent to the target output port on the LL path—it's confirmed that no control information is being sent to the target output port on the LL path. However, the absence of congestion at the target output port doesn't necessarily mean there's no control information being sent to the target output port on the SAF path; the SAF path may still contain control information intended for the target output port. At this point, the data forwarding device already has the capability to send control information via the LL path. According to related technologies, the forwarding path for control information cannot be switched from the SAF path to the LL path. However, according to the embodiments of this application, the forwarding path for control information can be switched from the SAF path to the LL path. Therefore, this application can more accurately adapt to traffic congestion conditions and switch the forwarding path for control information from the SAF path to the LL path. The LL path can reduce data forwarding latency, meeting low-latency requirements.

[0008] The first control information not being shadow control information indicates that the first control information is not M'. Therefore, the data forwarding device outputs this first control information without switching the scheduling buffer queue. The next time, it will still schedule and output SPKTs from the SAF path buffer queue. In this way, even if LPKTs are already stored in the LL path buffer queue, as long as the condition of step 306 (the first control information is shadow control information) is not met, the data forwarding device will not switch to scheduling the LL path buffer queue because the priority of the LL path buffer queue is higher than that of the SAF path buffer queue. This prevents the situation where the order of SPKTs precedes the order of LPKTs, but the LPKTs sent through the LL path arrive at the corresponding buffer queue before the SPKTs sent through the SAF path, and are then scheduled ahead of the SPKTs based on priority.

[0009] This application enables more precise adaptive traffic congestion management by setting new judgment criteria to switch the forwarding path of control information from the SAF path to the LL path. Furthermore, by copying the first control message marked LPKT and sending it on both the LL and SAF paths, the target output port can determine whether to switch from the SAF path buffer queue to the LL path buffer queue based on this control information, ensuring that the control information is output in the correct order.

[0010] In one possible implementation, the method further includes: when the control information previously scheduled and output comes from the LL path cache queue, determining whether the LL path cache queue is empty; when the LL path cache queue is not empty, scheduling and outputting the control information at the head of the queue from the LL path cache queue; when the LL path cache queue is empty, scheduling and outputting the control information at the head of the queue from the SAF path cache queue.

[0011] In one possible implementation, the control information that was previously scheduled and output from the SAF path buffer queue corresponding to the target output port refers to the SAF path indicated by the scheduling state machine corresponding to the target output port, wherein the SAF path indicated by the scheduling state machine refers to the control information that was previously scheduled and output from the SAF path buffer queue.

[0012] In one possible implementation, after scheduling and outputting the control information at the head of the queue from the LL path buffer queue corresponding to the target output port, the method further includes: setting the scheduling state machine to indicate the LL path, wherein the scheduling state machine indicates that the LL path refers to the last time control information was scheduled and output from the LL path buffer queue.

[0013] In one possible implementation, after scheduling and outputting the control information at the head of the queue from the SAF path cache queue, the method further includes setting the scheduling state machine to indicate the SAF path.

[0014] In one possible implementation, the absence of congestion at the target output port means that the count value of the SAF path counter corresponding to the target output port is less than a set threshold.

[0015] In one possible implementation, the absence of control information sent to the target output port on the LL path means that the count value of the LL path counter corresponding to the target output port is 0.

[0016] In one possible implementation, the method further includes: when the target output port becomes congested, sending the control information to be forwarded to the target output port through the SAF path.

[0017] In one possible implementation, congestion at the target output port means that the count value of the SAF path counter corresponding to the target output port is greater than or equal to a set threshold.

[0018] In one possible implementation, the method further includes: when a control message is sent to the target output port via the SAF path, incrementing the count value of the SAF path counter corresponding to the target output port by 1; or, when a control message is sent to the target output port via the LL path, incrementing the count value of the LL path counter corresponding to the target output port by 1.

[0019] In one possible implementation, the method further includes: when a control message is scheduled and output from the SAF path buffer queue, decrementing the count value of the SAF path counter corresponding to the target output port by 1; or,

[0020] When a control message is scheduled and output from the LL path buffer queue, the count value of the LL path counter corresponding to the target output port is decremented by 1.

[0021] Secondly, this application provides a data forwarding device, comprising: an input module, configured to obtain control information to be forwarded and a target output port of the control information to be forwarded; determine whether the target output port is congested, and determine whether there is control information to be sent to the target output port on a low-latency (LL) path; when the target output port is not congested and there is no control information to be sent to the target output port on the LL path, copying the control information to be forwarded to obtain shadow control information; a forwarding module, configured to send the control information to be forwarded to the target output port through the LL path, and send the shadow control information to the target output port through a store-and-forward (SAF) path; and an output module, configured to schedule first control information at the head of the queue from the SAF path cache queue when the control information previously scheduled and output comes from the SAF path cache queue corresponding to the target output port; when the first control information is the shadow control information, scheduling and outputting the control information at the head of the queue from the LL path cache queue corresponding to the target output port; and outputting the first control information when the first control information is not the shadow control information.

[0022] In one possible implementation, the output module is further configured to: determine whether the LL path cache queue is empty when the control information previously scheduled and output comes from the LL path cache queue; when the LL path cache queue is not empty, schedule and output the control information at the head of the queue from the LL path cache queue; and when the LL path cache queue is empty, schedule and output the control information at the head of the queue from the SAF path cache queue.

[0023] In one possible implementation, the control information that was previously scheduled and output from the SAF path buffer queue corresponding to the target output port refers to the SAF path indicated by the scheduling state machine corresponding to the target output port, wherein the SAF path indicated by the scheduling state machine refers to the control information that was previously scheduled and output from the SAF path buffer queue.

[0024] In one possible implementation, the output module is further configured to set the scheduling state machine to indicate the LL path, wherein the scheduling state machine indicates the LL path as the last time control information was scheduled and output from the LL path buffer queue.

[0025] In one possible implementation, the output module is further configured to set the scheduling state machine to indicate the SAF path.

[0026] In one possible implementation, the absence of congestion at the target output port means that the count value of the SAF path counter corresponding to the target output port is less than a set threshold.

[0027] In one possible implementation, the absence of control information sent to the target output port on the LL path means that the count value of the LL path counter corresponding to the target output port is 0.

[0028] In one possible implementation, the input module is further configured to send the control information to be forwarded to the target output port via the SAF path when the target output port becomes congested.

[0029] In one possible implementation, congestion at the target output port means that the count value of the SAF path counter corresponding to the target output port is greater than or equal to a set threshold.

[0030] In one possible implementation, the input module is further configured to increment the count value of the SAF path counter corresponding to the target output port by 1 when a control message is sent to the target output port through the SAF path; or, when a control message is sent to the target output port through the LL path, increment the count value of the LL path counter corresponding to the target output port by 1.

[0031] In one possible implementation, the output module is further configured to decrement the count value of the SAF path counter corresponding to the target output port by 1 when a control message is scheduled and output from the SAF path buffer queue; or, when a control message is scheduled and output from the LL path buffer queue, decrement the count value of the LL path counter corresponding to the target output port by 1.

[0032] Thirdly, this application provides a data forwarding device, comprising: one or more processors; a memory for storing one or more programs; and when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the method as described in any one of the first or second aspects above.

[0033] Fourthly, this application provides a computer-readable storage medium including a computer program that, when executed on a computer, causes the computer to perform the method described in any one of the first to second aspects above.

[0034] Fifthly, this application provides a computer program that, when executed by a computer, performs the method described in any one of the first or second aspects above. Attached Figure Description

[0035] Figure 1 This is an exemplary forwarding diagram of a data forwarding device;

[0036] Figure 2 This is an exemplary forwarding diagram of a data forwarding device;

[0037] Figure 3 An exemplary flowchart of the data forwarding and scheduling method 300 of this application;

[0038] Figure 4 An exemplary flowchart of the data forwarding and scheduling method 400 of this application;

[0039] Figure 5 An exemplary flowchart of the data forwarding and scheduling method 500 of this application;

[0040] Figure 6 This is an exemplary schematic diagram of the data forwarding and scheduling method of this application;

[0041] Figure 7 This is an exemplary structural diagram of the data forwarding device 700 of this application. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0043] The terms "first," "second," etc., used in the specification, embodiments, claims, and drawings of this application are for distinguishing purposes only and should not be construed as indicating or implying relative importance or order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as including a series of steps or units. A method, system, product, or apparatus is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0044] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0045] Figure 1 An exemplary forwarding diagram of a data forwarding device, such as... Figure 1As shown, the data forwarding device includes N+1 input ports (input0 to inputN) and N+1 output ports (output0 to outputN). Multiple data slices (slices of the packets to be forwarded, each data slice can contain bytes carried in cycles) enter a certain input port (e.g., input0), and then after being cross-connected by the input crossbar (IXB), the data in the data slices is evenly written to the queue manager. At the same time, the control information containing the data buffer address in the data slices is sent to the store and forward (SAF) module. The output crossbar (OXB) in the SAF module retrieves the control information from the buffer, performs cross-connection processing, and then exchanges the control information to the reorder module. The reorder module stores control information in the SAF buffer. Then, the scheduler (SCH) reorders the SAF buffer, reads the queue manager to extract data based on the reordered control information, and outputs the data to the target output port (e.g., output1). For data forwarding devices that require multiple storage and transmissions, the control information in the data slice needs to pass through multiple levels of SAF before the data can be exchanged to the target output port.

[0046] However, in this scheme, all data slice control information needs to be forwarded through the SAF module. Within the SAF module, the control information undergoes a series of operations, including packet assembly, Quality of Service (QoS) scheduling, and multicast cell replication. Each store-and-forward operation introduces hundreds of clock cycles. Figure 1 The delay in SAF DLY is insufficient to meet the performance requirements for low latency.

[0047] Figure 2 An exemplary forwarding diagram of a data forwarding device, such as... Figure 2 As shown, in order to solve Figure 1To address latency issues in the technical solution, and minimize the latency introduced by store-and-forward, a low-latency (LL) path is added parallel to the SAF path. When the target output port is not congested, multiple control messages are written one by one directly to the buffer queue corresponding to the target output port (e.g., output1) via the LL path. At the target output port, the control messages at the head of the queue are scheduled and output according to their order in the LL path buffer queue. This ensures QoS performance while reducing data forwarding latency, meeting the low-latency requirement. When the target output port is congested, to maintain QoS performance, the control messages are still forwarded to the buffer queue corresponding to the target output port (e.g., output1) via the SAF path. This scheme can be called low-latency store-and-forward.

[0048] For example, a packet to be forwarded is sliced ​​into 12 data slices and enters the same input port (e.g., input0). After IXB cross-connection, the data in the data slices is evenly written to the queue manager. Simultaneously, for the control information containing the data buffer address within the data slice, its forwarding path is determined: when the target output port is congested, the control information is forwarded to the target output port via the SAF path; when the target output port is not congested, the control information is forwarded to the target output port via the LL path. For instance, of the 12 control messages mentioned above, the first four are forwarded via the SAF path, the middle four via the LL path, and the last four via the SAF path. For ease of understanding, this paper refers to the first four control messages forwarded via the SAF path as SPKT1, the middle four via the LL path as LPKT, and the last four via the SAF path as SPKT2.

[0049] Because control information forwarded on the LL path may arrive at the Reorder module faster, LPKT may arrive before SPKT1 or LPKT and SPKT1 may arrive at the same time. However, the sorting logic of the Reorder module cannot distinguish the order of control information, which ultimately leads to LPKT and SPKT1 being output out of order.

[0050] To address the aforementioned out-of-order output issue, one possible solution is to ensure that there is no SPKT (control information forwarded via the SAF path) before the LPKT (control information forwarded via the LL path). In other words, before switching the forwarding path to the LL path, it is first confirmed that there is no forwarding control information on the SAF path. This solution can be called two-stage low-latency. However, because two-stage low-latency does not support forwarding SPKT before the LPKT, when the traffic at the target output port is not congested, the LL path can effectively reduce data forwarding latency. When the traffic at the target output port is congested, switching the forwarding path to the SAF path can guarantee QoS performance. However, when the traffic at the target output port becomes uncongested again, due to the continuity of service traffic, it is impossible to guarantee that there is no SPKT on the SAF path, making it difficult to switch the forwarding path back to the LL path.

[0051] To address the aforementioned technical problems, this application provides a data forwarding and scheduling method.

[0052] Figure 3 An exemplary flowchart of the data forwarding and scheduling method 300 of this application is shown below. Figure 3 As shown, process 300 can be executed by a data forwarding device. Process 300 is described as a series of steps or operations, and it should be understood that process 300 can be executed in various orders and / or occur simultaneously, and is not limited to... Figure 3 The execution sequence is shown. Assuming a packet is forwarded from the input port to the target output port in a data forwarding device, a packet is sliced ​​into multiple data slices, and process 300, which includes the following steps, is executed to forward the control information in the data slice of the currently processed packet (i.e., the current packet).

[0053] Step 301: Obtain the control information to be forwarded and the target output port of the control information to be forwarded.

[0054] As described above, the current message refers to the message that the data forwarding device is currently processing. After the message is sliced, multiple data slices are forwarded from the input port of the data forwarding device to the target output port of the message. The control information of the data slices can be sent to the target output port through the SAF path or the LL path. This application can determine the path of the control information by adopting the steps below.

[0055] Step 302: Determine whether the target output port is congested, and determine whether there is control information to be sent to the target output port on the LL path.

[0056] In an alternative embodiment, whether the target output port is congested can be indicated by the value of the SAF path counter corresponding to the target output port.

[0057] This application sets up multiple SAF path counters for each SAF path, and these multiple SAF path counters correspond one-to-one with multiple output ports. For the target output port of the current packet, each time a control message is sent to the target output port through the SAF path, the count value of the corresponding SAF path counter for the target output port is incremented by 1; each time a control message is scheduled and output from the SAF path buffer queue of the target output port, the count value of the corresponding SAF path counter for the target output port is decremented by 1. As the multiple control messages of the current packet are forwarded one by one from the input port to the target output port, the increment and decrement operations of the count value are performed according to the above-mentioned counting rules for the SAF path counters corresponding to the target output ports. Therefore, the count value of the SAF path counter corresponding to the target output port is dynamically changing. Therefore, before forwarding control information to be sent, the data forwarding device can compare the count value of the SAF path counter corresponding to the target output port with a set threshold. When the count value of the SAF path counter corresponding to the target output port is less than the set threshold, it indicates that the number of control information to be scheduled and output in the SAF path buffer queue of the target output port is less than the set threshold. This number is insufficient to cause traffic congestion at the target output port, and in this case, the target output port is considered not congested. When the count value of the SAF path counter corresponding to the target output port is greater than or equal to the set threshold, it indicates that the number of control information to be scheduled and output in the SAF path buffer queue of the target output port is greater than or equal to the set threshold. This number may cause traffic congestion at the target output port, and in this case, the target output port is considered congested. The set threshold can be a criterion for judging whether the traffic at the target output port is congested, and can be determined based on historical data or experience. It should be noted that comparing the count value of the SAF path counter corresponding to the target output port with the set threshold, even if they are equal, can also indicate that the target output port is not congested. This application does not specifically limit this.

[0058] In an alternative embodiment, the presence of control information sent to the target output port on the LL path can be indicated by the value of the LL path counter corresponding to the target output port.

[0059] This application also sets up multiple LL path counters for the LL path, each corresponding to a specific output port. For the target output port of the current message, each time a control message is sent to the target output port via the LL path, the count value of the corresponding LL path counter for the target output port is incremented by 1; each time a control message is scheduled and output from the LL path buffer queue of the target output port, the count value of the corresponding LL path counter for the target output port is decremented by 1. As multiple control messages in the current message are forwarded one by one from the input port to the target output port, the increment and decrement operations are performed according to the counting rules of the LL path counters corresponding to the target output ports. Therefore, the count value of the LL path counters corresponding to the target output ports is dynamically changing. Therefore, before forwarding the control information to be sent, the data forwarding device can compare the count value of the LL path counter corresponding to the target output port with 0. When the count value of the LL path counter corresponding to the target output port is 0, it means that there is no control information to be sent to the target output port on the LL path. That is, before sending the control information to be forwarded, there is no control information to be sent to the target output port on the LL path. The previous control information is sent to the target output port through the SAF path. The previous control information refers to the control information sent only before the control information to be forwarded in the current message. In other words, the order of the previous control information in the message is only before the control information to be forwarded. It should be noted that the absence of control information to be sent to the target output port on the LL path does not mean that there is no control information on the LL path. There may be control information to be sent to other output ports on the LL path. For example, if the target output port of the current message is output1, and there is no control information to be sent to output1 on the current LL path, the count value of the LL path counter corresponding to output1 is 0. However, there is control information to be sent to output2 and output3 on the LL path, and the count values ​​of the LL path counters corresponding to output2 and output3 are not 0, respectively.

[0060] Step 303: When the target output port is not congested and there is no control information sent to the target output port on the LL path, copy the control information to be forwarded to obtain shadow control information.

[0061] Provided that the target output port is not congested and there is no control information to be sent to the target output port on the LL path, it can be determined that the control information to be forwarded should be switched to be sent through the LL path.

[0062] For ease of understanding, this application refers to all control information forwarded via the SAF path as SPKT and all control information forwarded via the LL path as LPKT. The control information to be forwarded that is switched from being sent via the SAF path to being sent via the LL path (the previous control information for this control information was SPKT, and this control information is LPKT; therefore, it can be considered the first control information switching from SPKT to LPKT. For ease of description, the first control information switching from SPKT to LPKT will be referred to as the first LPKT below. It should be noted that the first LPKT is not defined by the message; that is, the first LPKT can be either a control information that is not the first in a message or the first in a message, without specific limitations) performs the function of maintaining order, which will be explained below.

[0063] The control information to be forwarded (the first LPKT) is copied to obtain shadow control information. For example, M represents the control information to be forwarded (the first LPKT), and M' represents the shadow control information. Optionally, identification information can be filled in one of the fields of M and M' (the position and length of this field are not limited in this application). This allows the aforementioned field in the control information to be parsed at the target output port, thereby determining whether the control information is M or M', or neither M nor M', but rather a non-first LPKT or SPKT, based on the value in that field.

[0064] Step 304: Send the control information to be forwarded to the target output port through the LL path, and send the shadow control information to the target output port through the SAF path.

[0065] In an alternative embodiment, the current control information is sent to the target output port via the LL path, and the shadow control information is sent to the target output port via the SAF path.

[0066] In this application, when it is determined that the control information to be forwarded is the first LPKT(M), the control information to be forwarded can be copied to obtain shadow control information (M'). Then, the first LPKT(M) is sent to the target output port through the LL path, and the shadow control information (M') is sent to the target output port through the SAF path. M' is an SPKT. In other words, the LL path buffer queue and the SAF path buffer queue corresponding to the target output port receive a control information containing the same content, where the LL path buffer queue receives M and the SAF path buffer queue receives M'.

[0067] Through the processing described in steps 301 to 304 above, the following can be avoided: Figure 2In the illustrated embodiment, it is difficult for the forwarding path to switch back to the LL path. When both conditions are met—no congestion at the target output port and no control information to be sent to the target output port on the LL path—it is confirmed that no control information is being sent to the target output port on the LL path. However, the absence of congestion at the target output port does not necessarily mean that no control information is being sent to the target output port on the SAF path; there may still be control information being sent to the target output port on the SAF path. But at this point, the data forwarding device already possesses the conditions to send control information via the LL path, and according to… Figure 2 The illustrated embodiment cannot switch the control information forwarding path from the SAF path to the LL path, but according to the embodiments of this application, it is possible to switch the control information forwarding path from the SAF path to the LL path. Therefore, compared to Figure 2 As shown in the embodiment, this application can more accurately adapt to traffic congestion by switching the forwarding path of control information from the SAF path to the LL path. The LL path can reduce the latency of data forwarding and meet the requirements of low latency.

[0068] At the target output port, the data forwarding device has an important function: control information ordering. This ensures that the order of multiple control messages output through the target output port matches the order of those control messages in the original message. The most crucial aspect of control information ordering is the first control message marked with LPKT, which will be explained below.

[0069] It should be noted that this application pre-sets the LL path buffer queue to have a higher priority than the SAF path buffer queue. That is, as long as there is control information (LPKT) to be scheduled in the LL path buffer queue, and the data forwarding device has started scheduling and outputting control information from the LL path buffer queue, all control information in the LL path buffer queue will be scheduled and output until the LL path buffer queue is empty. Only then will control information (SPKT) be scheduled and output from the SAF path buffer queue. It should be understood that scheduling control information from the buffer queue can be understood as reading the control information at the head of the queue from the corresponding buffer queue; outputting control information from the buffer queue can be understood as outputting the scheduled control information from the corresponding buffer queue to the target output port of the data forwarding device; and scheduling and outputting control information from the buffer queue can be understood as reading the control information at the head of the queue from the corresponding buffer queue and outputting it to the target output port of the data forwarding device. It is evident that if the data forwarding device previously scheduled and output LPKTs from the LL path buffer queue, it will not switch to scheduling and outputting SPKTs from the SAF path buffer queue as long as the LL path buffer queue is not empty. However, once the LL path buffer queue is empty, the data forwarding device will automatically switch to scheduling and outputting SPKTs from the SAF path buffer queue (assuming the SAF path buffer queue is not empty). Regarding the case where the data forwarding device schedules and outputs SPKTs from the SAF path buffer queue, this application can perform the following steps to determine whether to switch to scheduling and outputting LPKTs from the LL path buffer queue.

[0070] Step 305: When the control information that was previously scheduled and output comes from the SAF path buffer queue corresponding to the target output port, schedule the first control information at the head of the queue from the SAF path buffer queue.

[0071] The destination output port corresponds to one SAF path buffer queue and one LL path buffer queue. The SAF path buffer queue stores control information (marked as SPKT) transmitted via the SAF path to the destination output port, and the LL path buffer queue stores control information (marked as LPKT) transmitted via the LL path to the destination output port. Other output ports are similar and will not be described further. The destination output port is the output port to which the current packet is destined.

[0072] For the current control information (the control information to be processed by the data forwarding device; before the data forwarding device determines whether to schedule control information from the LL path buffer queue, it schedules control information from the SAF path buffer queue (the SAF path buffer queue is not empty), and this control information is the current control information), first determine whether the control information scheduled and output in the last time came from the SAF path buffer queue corresponding to the target output port. If so, it indicates that the control information scheduled and output in the last time was SPKT; if not, it indicates that the control information scheduled and output in the last time was LPKT.

[0073] Therefore, when the condition that the control information previously scheduled and output was from the SAF path buffer queue is met, it means that the data forwarding device last scheduled and output SPKT from the SAF path buffer queue, and has not yet switched to scheduling and output LPKT from the LL path buffer queue.

[0074] In one possible implementation, the control information that was last scheduled and output from the SAF path buffer queue corresponding to the target output port refers to the SAF path indicated by the scheduling state machine corresponding to the target output port, where the SAF path indicated by the scheduling state machine refers to the control information that was last scheduled and output from the SAF path buffer queue.

[0075] The target output port corresponds to a forwarding state machine and a scheduling state machine. The forwarding state machine is used to indicate whether the data forwarding device last sent control information to the target output port via the LL path or the SAF path. The scheduling state machine is used to indicate whether the data forwarding device last scheduled and output control information from the LL path buffer queue corresponding to the target output port or the SAF path buffer queue corresponding to the target output port.

[0076] Based on this, the aforementioned forwarding state machine indicating the LL path means that the data forwarding device last sent LPKT to the target output port through the LL path, and the forwarding state machine indicating the SAF path means that the data forwarding device last sent SPKT to the target output port through the SAF path; the scheduling state machine indicating the SAF path means that the data forwarding device last scheduled and output SPKT from the SAF path buffer queue corresponding to the target output port, and the scheduling state machine indicating the LL path means that the data forwarding device last scheduled and output LPKT from the LL path buffer queue corresponding to the target output port.

[0077] Assume the forwarding state machine has two values. When it's the first value (e.g., 0), the forwarding state machine indicates the LL path, meaning the data forwarding device last sent the LPKT via the LL path. When it's the second value (e.g., 1), the forwarding state machine indicates the SAF path, meaning the data forwarding device last sent the SPKT via the SAF path. The values ​​of the forwarding state machine are globally visible within the data forwarding device. Therefore, by obtaining the value of the forwarding state machine, it's possible to determine which path the data forwarding device last used to forward control information.

[0078] Assume the scheduling state machine also has two values. When it's the first value (e.g., 0), the scheduling state machine indicates the LL path, meaning the data forwarding device last scheduled and output the LPKT from the LL path buffer queue. When it's the second value (e.g., 1), the scheduling state machine indicates the SAF path, meaning the data forwarding device last scheduled and output the SPKT from the SAF path buffer queue. The values ​​of the scheduling state machine are globally visible within the data forwarding device. Therefore, by obtaining the values ​​of the scheduling state machine, it's possible to determine which path buffer queue the data forwarding device last scheduled control information from.

[0079] Therefore, when the determination condition of the SAF path indicated by the scheduling state machine corresponding to the target output port is met, it can be determined that the data forwarding device last scheduled and output SPKT from the SAF path buffer queue, while for LPKT received in the LL path buffer queue, scheduling has not yet started.

[0080] Therefore, when the scheduling state machine corresponding to the target output port indicates the SAF path, the data forwarding device last time schedules and outputs the SPKT from the SAF path buffer queue. At this time, the data forwarding device still schedules the control information (SPKT) at the head of the queue from the SAF path buffer queue, which is called the first control information.

[0081] Step 306: When the first control information is shadow control information, schedule and output the control information at the head of the queue from the LL path buffer queue corresponding to the target output port.

[0082] As described in step 303, the data forwarding device copies the first LPKT to obtain shadow control information. M represents the first LPKT, and M' represents the shadow control information. M is sent to the target output port through the LL path, and M' is sent to the target output port through the SAF path. The previous control information of M is the SPKT, which is also the switching control information from SPKT to LPKT.

[0083] Therefore, at the target output port, the data forwarding device attempts to find M' in the SAF path buffer queue and uses this as an opportunity to switch to scheduling and outputting LPKT from the LL path buffer queue. The data forwarding device parses the first control information scheduled from the SAF path buffer queue and checks whether information indicating M' is written in its relevant fields (see the description of step 301). If the information in the field indicates M', it means that the first control information is shadow control information. If the information in the field does not indicate M', it means that the first control information is SPKT and there is no need to switch to scheduling and outputting LPKT from the LL path buffer queue.

[0084] Once the first control information is determined to be M', the data forwarding device can switch from scheduling and outputting SPKTs from the SAF path buffer queue to scheduling and outputting LPKTs from the LL path buffer queue. Among the multiple LPKTs in the LL path buffer queue, M is the first LPKT. Based on the order of transmission and the fact that there is no out-of-order situation for control information transmitted on the same path, the control information scheduled by the data forwarding device from the LL path buffer queue at the head of the queue is M.

[0085] Starting from M, the data forwarding device may continuously send multiple LPKTs to the target output port through the LL path. Therefore, at the target output port, after recognizing M', the data forwarding device switches to scheduling and outputting LPKTs starting from M from the LL path buffer queue. The order in which LPKTs are scheduled and output from the LL path buffer queue is consistent with the order in which LPKTs are sent through the LL path, ensuring that the order of the multiple output LPKTs is consistent with the order of those multiple LPKTs in the current message.

[0086] Step 307: When the first control information is not the shadow control information, output the first control information.

[0087] The first control information not being shadow control information indicates that the first control information is not M'. Therefore, the data forwarding device outputs this first control information without switching the scheduling buffer queue. The next time, it will still schedule and output SPKTs from the SAF path buffer queue. In this way, even if LPKTs are already stored in the LL path buffer queue, as long as the condition of step 306 (the first control information is shadow control information) is not met, the data forwarding device will not switch to scheduling the LL path buffer queue because the priority of the LL path buffer queue is higher than that of the SAF path buffer queue. This prevents the situation where the order of SPKTs precedes the order of LPKTs, but the LPKTs sent through the LL path arrive at the corresponding buffer queue before the SPKTs sent through the SAF path, and are then scheduled ahead of the SPKTs based on priority.

[0088] This application enables more precise adaptive traffic congestion management by setting new judgment criteria to switch the forwarding path of control information from the SAF path to the LL path. Furthermore, by copying the first control message marked LPKT and sending it on both the LL and SAF paths, the target output port can determine whether to switch from the SAF path buffer queue to the LL path buffer queue based on this control information, ensuring that the control information is output in the correct order.

[0089] Figure 4 An exemplary flowchart of the data forwarding and scheduling method 400 of this application is shown below. Figure 4 As shown, process 400 can be executed by a data forwarding device, specifically by an input module (located at the input) and an output module (located at the output) within the data forwarding device. Process 400 is described as a series of steps or operations; it should be understood that process 400 can be executed in various orders and / or occur simultaneously, and is not limited to... Figure 4 The execution order is shown. Assuming a packet is forwarded from the input port to the target output port in a data forwarding device, a packet is sliced ​​into multiple data slices. The process 400, which includes the following steps, forwards the control information in the data slice of the currently processed packet (i.e., the current packet).

[0090] Step 401: Determine if the target output port is congested.

[0091] If not, proceed to step 402; if yes, proceed to step 406.

[0092] Step 401 can be referred to step 302 above, and will not be repeated here.

[0093] Step 402: Determine if an LPKT exists on the LL path and is sent to the target output port.

[0094] If not, proceed to step 403; if yes, proceed to step 405.

[0095] Step 402 can be referred to step 302 above, and will not be repeated here.

[0096] Step 403: Copy the control information to be forwarded to obtain shadow control information.

[0097] Step 403 can be referred to step 303 above, and will not be repeated here.

[0098] Step 404: Send the control information to be forwarded to the target output port through the LL path, and send the shadow control information to the target output port through the SAF path.

[0099] Step 404 can be referred to step 304 above, and will not be repeated here.

[0100] Step 405: Send the control information to be forwarded to the target output port through the LL path.

[0101] If there is no congestion at the target output port, and there is an LPKT on the LL path that is sent to the target output port, the data forwarding device can send control information to be forwarded to the target output port through the LL path.

[0102] Step 406: Send the control information to be forwarded to the target output port through the SAF path.

[0103] If the target output port becomes congested, control information cannot be sent to the target output port through the LL path. In order to ensure QoS performance, the data forwarding device can send the control information to be forwarded to the target output port through the SAF path.

[0104] Step 407: Determine whether the control information that was previously scheduled and output comes from the SAF path buffer queue corresponding to the target output port.

[0105] If yes, proceed to step 408; otherwise, proceed to step 412.

[0106] Step 407 can be referred to step 305 above, and will not be repeated here.

[0107] Step 408: Schedule the first control information at the head of the queue from the SAF path cache queue.

[0108] Step 408 can be referred to step 305 above, and will not be repeated here.

[0109] Step 409: Determine whether the first control information is shadow control information.

[0110] If yes, proceed to step 410; otherwise, proceed to step 411.

[0111] Step 410: Schedule and output the LPKT at the head of the LL path cache queue.

[0112] Step 410 can be referred to step 306 above, and will not be repeated here.

[0113] Step 411: Output the first control information.

[0114] Step 411 can be referred to step 307 above, and will not be repeated here.

[0115] Step 412: Determine if the LL path cache queue is empty.

[0116] If not, proceed to step 413; if yes, proceed to step 414.

[0117] The control information that the data forwarding device last scheduled and output came from the LL path buffer queue, indicating that the last time it was scheduling and outputting LPKT from the LL path buffer queue. Therefore, according to the priority of the LL path buffer queue and the SAF path buffer queue, it will give priority to scheduling and outputting LPKT from the LL path buffer queue. Only when the LL path buffer queue is empty will it switch to scheduling and outputting SPKT from the SAF path buffer queue.

[0118] Step 413: Schedule and output the LPKT at the head of the LL path cache queue.

[0119] If the LL path cache queue is not empty, the data forwarding device continues to schedule and output the control information at the head of the queue from the LL path cache queue.

[0120] Step 414: Schedule and output the SPKT at the head of the SAF path cache queue.

[0121] When the LL path buffer queue is empty, the data forwarding device switches to scheduling and outputting SPKTs from the SAF path buffer queue. This ensures that SPKTs following LPKTs in the current packet are scheduled and output only after LPKTs have been scheduled and output, avoiding situations where SPKTs are output before LPKTs, and guaranteeing the order of control information.

[0122] Figure 5 An exemplary flowchart of the data forwarding and scheduling method 500 of this application is shown below. Figure 5 As shown, process 500 can be executed by a data forwarding device, specifically by an input module (located at the input) and an output module (located at the output) within the data forwarding device. Process 500 is described as a series of steps or operations; it should be understood that process 500 can be executed in various orders and / or occur simultaneously, and is not limited to... Figure 5 The execution sequence is shown. Assuming a packet is forwarded from the input port to the target output port in a data forwarding device, a packet is sliced ​​into multiple data slices, and process 500, which includes the following steps, is executed to forward the control information in the data slice of the currently processed packet (i.e., the current packet).

[0123] Step 501: Determine if the target output port is congested.

[0124] If not, proceed to step 502; if yes, proceed to step 506.

[0125] Step 501 can be referred to step 302 above, and will not be repeated here.

[0126] Step 502: Determine if an LPKT exists on the LL path and is sent to the target output port.

[0127] If not, proceed to step 503; if yes, proceed to step 505.

[0128] Step 502 can be referred to step 302 above, and will not be repeated here.

[0129] Step 503: Copy the control information to be forwarded to obtain shadow control information.

[0130] Step 503 can be referred to step 303 above, and will not be repeated here.

[0131] Step 504: Send the control information to be forwarded to the target output port through the LL path, and send the shadow control information to the target output port through the SAF path.

[0132] Step 504 can be referred to step 304 above, and will not be repeated here.

[0133] Step 505: Send the control information to be forwarded to the target output port through the LL path.

[0134] If there is no congestion at the target output port, and there is an LPKT on the LL path that is sent to the target output port, the data forwarding device can send control information to be forwarded to the target output port through the LL path.

[0135] Step 506: Send the control information to be forwarded to the target output port through the SAF path.

[0136] If the target output port becomes congested, control information cannot be sent to the target output port through the LL path. In order to ensure QoS performance, the data forwarding device can send the control information to be forwarded to the target output port through the SAF path.

[0137] During the process of sending control information to the target output port via the LL path or SAF path, the forwarding state machine corresponding to the target output port can be set according to the path through which the control information to be forwarded is sent. For example, if the control information to be forwarded is sent to the target output port via the LL path, the forwarding state machine corresponding to the target output port can be set to indicate the LL path; if the control information to be forwarded is sent to the target output port via the SAF path, the forwarding state machine corresponding to the target output port can be set to indicate the SAF path.

[0138] Step 507: Determine whether the forwarding state machine indicates the LL path and whether the scheduling state machine indicates the SAF path.

[0139] During the scheduling process of the buffer queue corresponding to the target output port, the data forwarding device can set the scheduling state machine corresponding to the target output port according to whether the control information to be forwarded comes from the LL path buffer queue or the SAF path buffer queue. For example, if the control information to be forwarded is scheduled from the LL path buffer queue, the data forwarding device can set the scheduling state machine corresponding to the target output port to indicate the LL path; if the control information to be forwarded is scheduled from the SAF path buffer queue, the data forwarding device can set the scheduling state machine corresponding to the target output port to indicate the SAF path.

[0140] If the forwarding state machine indicates the LL path and the scheduling state machine indicates the SAF path, then proceed to step 508; if the forwarding state machine indicates the LL path and the scheduling state machine indicates the LL path, then proceed to step 512; if the forwarding state machine indicates the SAF path and the scheduling state machine indicates the LL path, then proceed to step 513; if the forwarding state machine indicates the SAF path and the scheduling state machine indicates the SAF path, then proceed to step 516.

[0141] Step 508: Schedule the first control information at the head of the queue from the SAF path cache queue.

[0142] The forwarding state machine indicates the LL path and the scheduling state machine indicates the SAF path, meaning that the last time control information was sent via the LL path, the control information was scheduled from the SAF path buffer queue. Refer to step 305 above.

[0143] Step 509: Determine whether the first control information is shadow control information.

[0144] If yes, proceed to step 510; otherwise, proceed to step 511.

[0145] Step 510: Schedule and output the LPKT at the head of the queue from the LL path cache queue, and set the scheduling state machine to indicate the LL path.

[0146] Step 510 can be referred to step 306 above, and will not be repeated here.

[0147] Step 511: Output the first control information.

[0148] Step 511 can be referred to step 307 above, and will not be repeated here.

[0149] Step 512: Schedule and output the LPKT at the head of the LL path cache queue.

[0150] The forwarding state machine and the scheduling state machine both indicate the LL path, meaning that control information was last sent via the LL path and was previously scheduled from the LL path buffer queue. Since the data forwarding device is still sending control information via the LL path, it can be assumed that LPKTs will continue to enter the LL path buffer queue. Therefore, the LL path buffer queue is not empty at this time. Because control information was previously scheduled from the LL path buffer queue, and given that the LL path buffer queue has a higher priority than the SAF path buffer queue, the LPKT at the head of the queue will continue to be scheduled from the LL path buffer queue and output.

[0151] Step 513: Determine if the LL path cache queue is empty.

[0152] If not, proceed to step 514; if yes, proceed to step 515.

[0153] The forwarding state machine indicates the SAF path, and the scheduling state machine indicates the LL path, meaning that the last time control information was sent via the SAF path, control information was scheduled from the LL path buffer queue. The data forwarding device has switched to sending SPKTs via the SAF path, but since the LL path buffer queue is not empty, it is still scheduling and outputting LPKTs from the LL path buffer queue. Based on the higher priority of the LL path buffer queue compared to the SAF path buffer queue, it needs to first determine if the LL path buffer queue is empty. If it is not empty, it continues to schedule and output the LPKT at the head of the queue from the LL path buffer queue; otherwise, it switches to scheduling and outputting the SPKT at the head of the queue from the SAF path buffer queue.

[0154] Step 514: Schedule and output the LPKT at the head of the LL path cache queue.

[0155] Step 515: Schedule and output the SPKT at the head of the queue from the SAF path cache queue, and set the scheduling state machine to indicate the SAF path.

[0156] Step 516: Schedule and output the SPKT at the head of the SAF path cache queue.

[0157] Figure 6 This is an exemplary schematic diagram of the data forwarding and scheduling method of this application, such as... Figure 6 As shown in the diagram, the schematic diagram is... Figure 2 Based on the structure shown, the message to be forwarded is sliced ​​into 12 data slices and enters the same input port (e.g., input0). For ease of understanding, in this paper, the first 4 control messages forwarded through the SAF path are called SPKT1, the middle 4 control messages forwarded through the LL path are called LPKT, and the last 4 control messages forwarded through the SAF path are called SPKT2.

[0158] As can be seen, after the first LPKT(M) is copied, shadow control information (M') is obtained. M is sent through the LL path, and M' is sent through the SAF path. It can be seen that on the SAF path, M' is placed between SPKT1 and SPKT2.

[0159] The Reorder module first schedules and outputs 4 SPKT1s from the SAF path buffer queue. When M' is detected, it switches to scheduling and outputting 4 LPKTs from the LL path buffer queue. Finally, it schedules and outputs 4 SPKT2s from the SAF path buffer queue. The output order is consistent with the original order of the control information in the message.

[0160] Figure 7 This is an exemplary structural diagram of the data forwarding device 700 of this application, as shown below. Figure 7 As shown, the data forwarding device 700 of this embodiment can be applied to the aforementioned data forwarding device. The data forwarding device 700 includes: an input module 701, a forwarding module 702, and an output module 703, wherein...

[0161] Input module 701 is used to obtain control information to be forwarded and the target output port of the control information to be forwarded; determine whether the target output port is congested and whether there is control information to be sent to the target output port on the low-latency LL path; when the target output port is not congested and there is no control information to be sent to the target output port on the LL path, copy the control information to be forwarded to obtain shadow control information; forwarding module 702 is used to send the control information to be forwarded to the target output port through the LL path and send the shadow control information to the target output port through the store-and-forward (SAF) path; output module 703 is used to schedule the first control information at the head of the queue from the SAF path cache queue when the control information previously scheduled and output comes from the SAF path cache queue corresponding to the target output port; when the first control information is the shadow control information, schedule and output the control information at the head of the queue from the LL path cache queue corresponding to the target output port; when the first control information is not the shadow control information, output the first control information.

[0162] In one possible implementation, the output module 703 is further configured to: determine whether the LL path cache queue is empty when the control information previously scheduled and output comes from the LL path cache queue; when the LL path cache queue is not empty, schedule and output the control information at the head of the queue from the LL path cache queue; when the LL path cache queue is empty, schedule and output the control information at the head of the queue from the SAF path cache queue.

[0163] In one possible implementation, the control information that was previously scheduled and output from the SAF path buffer queue corresponding to the target output port refers to the SAF path indicated by the scheduling state machine corresponding to the target output port, wherein the SAF path indicated by the scheduling state machine refers to the control information that was previously scheduled and output from the SAF path buffer queue.

[0164] In one possible implementation, the output module 703 is further configured to set the scheduling state machine to indicate the LL path, wherein the scheduling state machine indicates the LL path as the last time control information was scheduled and output from the LL path buffer queue.

[0165] In one possible implementation, the output module 703 is further configured to set the scheduling state machine to indicate the SAF path.

[0166] In one possible implementation, the absence of congestion at the target output port means that the count value of the SAF path counter corresponding to the target output port is less than a set threshold.

[0167] In one possible implementation, the absence of control information sent to the target output port on the LL path means that the count value of the LL path counter corresponding to the target output port is 0.

[0168] In one possible implementation, the input module 701 is further configured to send the control information to be forwarded to the target output port through the SAF path when the target output port becomes congested.

[0169] In one possible implementation, congestion at the target output port means that the count value of the SAF path counter corresponding to the target output port is greater than or equal to a set threshold.

[0170] In one possible implementation, the input module 701 is further configured to increment the count value of the SAF path counter corresponding to the target output port by 1 when a control message is sent to the target output port through the SAF path; or, when a control message is sent to the target output port through the LL path, increment the count value of the LL path counter corresponding to the target output port by 1.

[0171] In one possible implementation, the output module 703 is further configured to decrement the count value of the SAF path counter corresponding to the target output port by 1 when a control message is scheduled and output from the SAF path buffer queue; or, when a control message is scheduled and output from the LL path buffer queue, decrement the count value of the LL path counter corresponding to the target output port by 1.

[0172] The apparatus of this embodiment can be used to perform Figure 3-6 The technical solutions of any of the method embodiments shown are similar in implementation principle and technical effect, and will not be described again here.

[0173] In implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this application can be directly implemented by a hardware encoding processor, or implemented by a combination of hardware and software modules in the encoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0174] The memory mentioned in the above embodiments can be volatile memory or non-volatile memory, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0175] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0176] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0177] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0178] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0179] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0180] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0181] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data forwarding and scheduling method, characterized in that, include: Obtain the control information to be forwarded, and the target output port of the control information to be forwarded; Determine whether the target output port is congested, and determine whether there is control information to be sent to the target output port on the low-latency LL path; When the target output port is not congested and there is no control information sent to the target output port on the LL path, the control information to be forwarded is copied to obtain shadow control information; The control information to be forwarded is sent to the target output port through the LL path, and the shadow control information is sent to the target output port through the store-and-forward (SAF) path. When the control information that was previously scheduled and output comes from the SAF path buffer queue corresponding to the target output port, the first control information at the head of the queue is scheduled from the SAF path buffer queue. When the first control information is the shadow control information, the control information at the head of the queue is scheduled and output from the LL path buffer queue corresponding to the target output port; When the first control information is not the shadow control information, the first control information is output.

2. The method according to claim 1, characterized in that, Also includes: When the control information previously scheduled and output comes from the LL path cache queue, determine whether the LL path cache queue is empty; When the LL path cache queue is not empty, the control information at the head of the queue is scheduled and output from the LL path cache queue. When the LL path cache queue is empty, the control information at the head of the queue is scheduled and output from the SAF path cache queue.

3. The method according to claim 2, characterized in that, The control information that was previously scheduled and output from the SAF path cache queue corresponding to the target output port refers to the SAF path indicated by the scheduling state machine corresponding to the target output port, wherein the SAF path indicated by the scheduling state machine refers to the control information that was previously scheduled and output from the SAF path cache queue.

4. The method according to claim 3, characterized in that, After scheduling and outputting the control information at the head of the queue from the LL path buffer queue corresponding to the target output port, the process further includes: The scheduling state machine is set to indicate the LL path, whereby the scheduling state machine indicates the LL path as the last time control information was scheduled and output from the LL path buffer queue.

5. The method according to claim 3, characterized in that, After scheduling and outputting the control information at the head of the queue from the SAF path cache queue, the process further includes: Set the scheduling state machine to indicate the SAF path.

6. The method according to any one of claims 1-5, characterized in that, The absence of congestion at the target output port means that the count value of the SAF path counter corresponding to the target output port is less than a set threshold.

7. The method according to any one of claims 1-5, characterized in that, The absence of control information sent to the target output port on the LL path means that the count value of the LL path counter corresponding to the target output port is 0.

8. The method according to any one of claims 1-5, characterized in that, Also includes: When the target output port becomes congested, the control information to be forwarded is sent to the target output port through the SAF path.

9. The method according to claim 8, characterized in that, The congestion of the target output port is defined as the count value of the SAF path counter corresponding to the target output port being greater than or equal to a set threshold.

10. The method according to any one of claims 1-5 and 9, characterized in that, Also includes: When a control message is sent to the target output port through the SAF path, the count value of the SAF path counter corresponding to the target output port is incremented by 1; or, When a control message is sent to the target output port through the LL path, the count value of the LL path counter corresponding to the target output port is incremented by 1.

11. The method according to any one of claims 1-5 and 9, characterized in that, Also includes: When a control message is scheduled and output from the SAF path buffer queue, the count value of the SAF path counter corresponding to the target output port is decremented by 1; or, When a control message is scheduled and output from the LL path buffer queue, the count value of the LL path counter corresponding to the target output port is decremented by 1.

12. A data forwarding device, characterized in that, include: The input module is used to obtain the control information to be forwarded, and the target output port of the control information to be forwarded; Determine whether the target output port is congested, and determine whether there is control information to be sent to the target output port on the low-latency LL path; When the target output port is not congested and there is no control information sent to the target output port on the LL path, the control information to be forwarded is copied to obtain shadow control information; The forwarding module is used to send the control information to be forwarded to the target output port through the LL path, and to send the shadow control information to the target output port through the store-and-forward (SAF) path; The output module is configured to schedule the first control information at the head of the SAF path cache queue when the control information previously scheduled and output comes from the SAF path cache queue corresponding to the target output port; when the first control information is the shadow control information, schedule and output the control information at the head of the LL path cache queue corresponding to the target output port; and when the first control information is not the shadow control information, output the first control information.

13. The apparatus according to claim 12, characterized in that, The output module is further configured to determine whether the LL path cache queue is empty when the control information previously scheduled and output comes from the LL path cache queue; when the LL path cache queue is not empty, schedule and output the control information at the head of the queue from the LL path cache queue; when the LL path cache queue is empty, schedule and output the control information at the head of the queue from the SAF path cache queue.

14. The apparatus according to claim 13, characterized in that, The control information that was previously scheduled and output from the SAF path cache queue corresponding to the target output port refers to the SAF path indicated by the scheduling state machine corresponding to the target output port, wherein the SAF path indicated by the scheduling state machine refers to the control information that was previously scheduled and output from the SAF path cache queue.

15. The apparatus according to claim 14, characterized in that, The output module is further configured to set the scheduling state machine to indicate the LL path, wherein the scheduling state machine indicates the LL path as the last time control information was scheduled and output from the LL path buffer queue.

16. The apparatus according to claim 14, characterized in that, The output module is also used to set the scheduling state machine to indicate the SAF path.

17. The apparatus according to any one of claims 12-16, characterized in that, The absence of congestion at the target output port means that the count value of the SAF path counter corresponding to the target output port is less than a set threshold.

18. The apparatus according to any one of claims 12-16, characterized in that, The absence of control information sent to the target output port on the LL path means that the count value of the LL path counter corresponding to the target output port is 0.

19. The apparatus according to any one of claims 12-16, characterized in that, The input module is also used to send the control information to be forwarded to the target output port through the SAF path when the target output port is congested.

20. The apparatus according to claim 19, characterized in that, The congestion of the target output port is defined as the count value of the SAF path counter corresponding to the target output port being greater than or equal to a set threshold.

21. The apparatus according to any one of claims 12-16, 20, characterized in that, The input module is further configured to increment the count value of the SAF path counter corresponding to the target output port by 1 when a control message is sent to the target output port through the SAF path; or, increment the count value of the LL path counter corresponding to the target output port by 1 when a control message is sent to the target output port through the LL path.

22. The apparatus according to any one of claims 12-16, 20, characterized in that, The output module is further configured to decrement the count value of the SAF path counter corresponding to the target output port by 1 when a control message is scheduled and output from the SAF path buffer queue; or, when a control message is scheduled and output from the LL path buffer queue, decrement the count value of the LL path counter corresponding to the target output port by 1.

23. A data forwarding device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-11.

24. A computer-readable storage medium, characterized in that, Includes a computer program, which, when executed on a computer, causes the computer to perform the method of any one of claims 1-11.

25. A computer program product, characterized in that, When the computer program product is executed by a computer, it is used to perform the method according to any one of claims 1-11.