A data transmission method and network device

By using at least two queues in network devices and dynamically adjusting priority weights, the problem of multi-packet transmission collisions is solved, achieving efficient in-order forwarding and low packet loss rate.

CN122372518APending Publication Date: 2026-07-10HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-01-08
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In network devices, when multiple data packets share a transmission link, transmission collisions are prone to occur, leading to decreased communication efficiency and packet loss. Existing technologies cannot effectively utilize limited queue resources to achieve in-order forwarding.

Method used

At least two queues are used: high-priority data packets go into the high-priority queue, and low-priority data packets go into the low-priority queue. By dynamically adjusting the queue priority and weight, high-priority data packets are ensured to be forwarded first, avoiding out-of-order transmission.

Benefits of technology

It enables efficient, in-order forwarding of data packets under limited queue resources, avoiding transmission errors and improving communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122372518A_ABST
    Figure CN122372518A_ABST
Patent Text Reader

Abstract

This application provides a data transmission method and a network device, relating to the field of computer technology. Applied to a network device, the method allows the network device to forward received data packets using at least two queues; the at least two queues include a first queue and a second queue, where the queue priority of the first queue is higher than that of the second queue. First, the network device receives multiple first data packets arriving simultaneously. Second, the network device places the first data packets whose data priority is greater than or equal to the queue priority of the first queue into the first queue, and places the remaining first data packets into the second queue. Finally, the network device transmits the first data packets in the first queue until all the first data packets in the first queue have been transmitted, then adjusts the queue priority of the first queue to be lower than that of the second queue. Thus, multiple first data packets can be transmitted using only a small number of queues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data transmission method and network device. Background Technology

[0002] During the communication process of network devices, if multiple data packets are transmitted simultaneously, the multiple transmission links involved in the multiple data packets will share the transmission bandwidth of the network device, which can easily lead to transmission collisions. Consequently, the communication efficiency of the network device will be affected, and the transmission progress of multiple data packets will be slowed down.

[0003] To avoid transmission collisions caused by transmitting multiple data packets simultaneously, current practice typically involves placing multiple data packets into different transmission queues based on their data priority. This "staggered" scheduling of the transmission queues allows each data packet to "exclusively occupy" the transmission link during transmission, thereby preventing transmission collisions.

[0004] Here, the mapping between data packets and transmission queues is relatively fixed. That is, a data packet can only be placed in the transmission queue corresponding to its data priority. For a transmission task, the data priorities of the multiple data packets involved in the task are finely differentiated; the multiple data packets involved in a transmission task can be divided into 64 priorities. However, the queue resources in network devices are limited, providing only a small number of lossless queues. Consequently, it is impossible to provide a corresponding queue for every data priority. Therefore, packet loss is likely to occur during the transmission of multiple data packets. Summary of the Invention

[0005] This application provides a data transmission method and network device that can transmit multiple data packets using only a small number of queues, and can ensure that data packets are forwarded in order according to data priority during the forwarding process, so as to avoid transmission errors caused by "out-of-order" transmission of data packets.

[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0007] Firstly, a data processing method is provided, applied to a network device. The network device uses at least two queues to forward received data packets. The at least two queues include a first queue and a second queue, where the queue priority of the first queue is higher than that of the second queue. First, the network device receives multiple first data packets arriving simultaneously. Second, the network device places the first data packets whose data priority is greater than or equal to the queue priority of the first queue into the first queue, and places the remaining first data packets into the second queue. Thus, by placing the first data packets with higher data priority into the first queue, the higher-priority first data packets are prioritized for forwarding, thereby avoiding transmission errors caused by out-of-order forwarding of data packets during the forwarding process. Finally, the network device sends the first data packets in the first queue until all the first data packets in the first queue have been sent, and then adjusts the queue priority of the first queue to be lower than that of the second queue.

[0008] The first data packet in the second queue is sent during the sending of the first data packet in the first queue, or it is sent after the first data packet in the first queue has been sent.

[0009] In one possible implementation of the first aspect, during the process of the network device sending a first data packet placed in a first queue, if the network device receives multiple second data packets arriving simultaneously, the network device places the second data packets whose data priority is greater than or equal to the queue priority of the first queue into the first queue, and places the remaining second data packets into the second queue. In this way, if the network device receives a second data packet with a higher data priority in a subsequent process, the network device can still utilize the first queue with the higher current queue priority to complete the transmission of the second data packet first, thus achieving "ordered" transmission of data packets.

[0010] In one possible implementation of the first aspect, after the network device adjusts the queue priority of the first queue to be lower than the queue priority of the second queue, if the network device receives multiple third data packets arriving simultaneously, the network device places the third data packets with a data priority greater than or equal to the queue priority of the second queue into the second queue, and places the remaining third data packets into the first queue. Thus, if the network device subsequently receives a third data packet with a higher data priority, the network device can prioritize sending the third data packet to the second queue, which currently has the higher queue priority, thereby achieving "ordered" transmission of data packets.

[0011] In one possible implementation of the first aspect, when at least two queues also include a third queue, and the queue priority of the third queue is lower than the queue priority of the second queue, when the network device places the remaining first data packets from a plurality of first data packets into the second queue, it places the first data packets whose data priority is greater than or equal to the queue priority of the second queue into the second queue, and places the first data packets whose data priority is less than the queue priority of the second queue into the third queue. In this way, by additionally setting up a third queue, the data priority of the first data packets placed in the second queue can be standardized without significantly increasing the number of lossless queues required by the network device.

[0012] In one possible implementation of the first aspect, after placing first data packets with data priorities greater than or equal to the queue priority of the first queue into the first queue, the network device configures the queue priority of the first queue according to the data priorities of the first data packets in the first queue. This ensures that subsequently arriving data packets with data priorities lower than the first data packets can be placed into the second queue, thereby guaranteeing that first data packets with higher data priorities can be sent as quickly as possible with the help of the first queue.

[0013] In one possible implementation of the first aspect, during the comparison process of the first data packet in the first queue sent by the network device, the network device alternately sends the first data packet in the first queue and the first data packet in the second queue according to the first weight of the first queue and the second weight of the second queue, so that the first data packet placed in the second queue can also get a forwarding opportunity, and avoid the first data packet in the second queue not being forwarded for a long time.

[0014] The weights are positively correlated with the queue priorities, with the first weight of the first queue being greater than the second weight of the second queue.

[0015] In one possible implementation of the first aspect, the first data packet in the first queue occupies a first bandwidth when it is sent, and the first data packet in the second queue occupies a second bandwidth when it is sent. Here, bandwidth is positively correlated with weight (WEIGHT_CFG). That is, the higher the weight of a queue, the more bandwidth that queue occupies when sending the first data packet, thus avoiding waste of transmission bandwidth.

[0016] In one possible implementation of the first aspect, after adjusting the queue priority of the first queue to be lower than that of the second queue, the first data packet placed in the second queue has a higher data priority. Therefore, in order to forward the first data packet in the second queue as quickly as possible, the network device adjusts the first weight of the first queue to the third weight and the second weight of the second queue to the fourth weight. The third weight is lower than the fourth weight. By increasing the weight value of the second queue, the number of times the second queue can be invoked within a scheduling cycle is increased. This, in turn, increases the number of first data packets forwarded by the second queue within a scheduling cycle, thus prioritizing the forwarding of the first data packets in the second queue.

[0017] In one possible implementation of the first aspect, when a network device receives multiple first data packets for the first time, the network device places the first data packet with the highest data priority into a first queue, and places the remaining first data packets into a second queue. This allows the first data packet with the highest data priority to exclusively occupy the first queue, thereby obtaining approximately the entire transmission bandwidth and quickly completing the forwarding of the first data packet with the highest data priority.

[0018] In a second aspect, a network device is provided, the network device including a memory and one or more processors; the memory is coupled to the processors; wherein the memory stores computer program code, the computer program code including computer instructions, and when the computer instructions are executed by the processor, the network device performs a data transmission method as described in the first aspect and any implementation thereof.

[0019] Thirdly, a computer-readable storage medium is provided, including computer instructions that, when executed on a network device, cause the network device to perform a data transmission method as described in the first aspect and any implementation thereof.

[0020] Fourthly, a computer program product is provided that, when run on a network device, causes the network device to execute the data transmission method as described in the first aspect and any of its implementations.

[0021] The beneficial effects that the network equipment provided in the second aspect, the computer-readable storage medium provided in the third aspect, and the computer program product provided in the fourth aspect can achieve are similar to the beneficial effects that can be achieved in the first aspect and any of its implementations, and will not be repeated here. Attached Figure Description

[0022] Figure 1 This illustration shows a schematic diagram of transmission bandwidth usage provided in an embodiment of this application;

[0023] Figure 2 This illustration shows a schematic diagram of the hardware structure of a network device provided in an embodiment of this application;

[0024] Figure 3 A flowchart of a data transmission method provided in an embodiment of this application is shown;

[0025] Figure 4 This illustration shows one of the data packet queuing processes provided in an embodiment of this application;

[0026] Figure 5 This illustration shows one of the queue priority adjustment processes provided in an embodiment of this application;

[0027] Figure 6 This is a second schematic diagram of a queue priority adjustment process provided in an embodiment of this application;

[0028] Figure 7 This illustration shows a schematic diagram of a queue priority comparison process provided in an embodiment of this application;

[0029] Figure 8 This illustration shows a third schematic diagram of a queue priority adjustment process provided in an embodiment of this application;

[0030] Figure 9 This illustration shows one of the data packet transmission processes provided in an embodiment of this application;

[0031] Figure 10 This is a second schematic diagram of a data packet transmission process provided in an embodiment of this application;

[0032] Figure 11 This is a second schematic diagram of a data packet queuing process provided in an embodiment of this application;

[0033] Figure 12 This is shown as a third schematic diagram of a data packet queuing process provided in an embodiment of this application;

[0034] Figure 13 This illustration shows a fourth schematic diagram of a data packet queuing process provided in an embodiment of this application;

[0035] Figure 14 A schematic diagram of the hardware structure of another network device provided in an embodiment of this application is shown. Detailed Implementation

[0036] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone, where A and B can be singular or plural. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "At least one 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 of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" are not necessarily different. Meanwhile, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is being used as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0037] Furthermore, the business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0038] If a network device transmits multiple data packets simultaneously, these packets will share the network device's transmission links. In this case, the multiple transmission links involved in the data packets will share the network device's transmission bandwidth; that is, the multiple data packets will equally divide the transmission bandwidth of the transmission links. Figure 1As shown in (a), taking multiple data packets involving two transmission links as an example, transmission link 1 and transmission link 2 forward data packets simultaneously. In this case, a transmission collision occurs between transmission link 1 and transmission link 2, causing transmission link 1 and transmission link 2 to share the network device's 400GBps transmission bandwidth equally. That is, when transmission link 1 and transmission link 2 send data packets simultaneously, transmission link 1 occupies 200GBps of transmission bandwidth, and transmission link 2 occupies 200GBps of transmission bandwidth. Therefore, this affects the communication efficiency of the network device and slows down the transmission progress of multiple data packets.

[0039] To avoid transmission collisions caused by transmitting multiple data packets simultaneously, current methods typically place data packets into different transmission queues based on their data priority. These queues occupy different transmission links during transmission, thus avoiding collisions between transmission links 1 and 2 through staggered scheduling. This allows each data packet to exclusively occupy transmission bandwidth during transmission. Figure 1 As shown in (b), queue 1 occupies transmission link 1, and queue 2 occupies transmission link 2. During time period t1, data packets placed in queue 1 are transmitted, meaning that transmission link 1 occupies 400 GBps of transmission bandwidth during time period t1. During time period t2, data packets placed in queue 2 are transmitted, meaning that transmission link 2 occupies 400 GBps of transmission bandwidth during time period t2.

[0040] Building upon this, when a network device receives multiple data packets simultaneously, in order to send these packets "in order" (according to their data priority), each data packet is typically placed into a queue corresponding to its data priority. Then, each queue is scheduled sequentially according to its priority to achieve "in-order" forwarding of the data packets. Currently, available queue scheduling methods include at least strict priority (SP) and weighted round-robin (WRR).

[0041] Whether using strict priority queuing or weighted round-robin scheduling, each data packet must be placed into the queue corresponding to its data priority. When prioritizing data packets based on their Differentiated Services Code Points (DSCPs), multiple data packets in a transmission task can be divided into 64 priority levels. In this case, the network device needs to provide 64 queues to ensure a one-to-one correspondence between data packets of different priorities. However, network devices have limited queue resources and can only provide a small number of lossless queues, making it impossible to guarantee a corresponding queue for every data packet of every priority. Therefore, packet loss is prone to occur during the transmission of multiple data packets.

[0042] Based on the above, this application provides a data transmission method. When a network device receives multiple first data packets arriving simultaneously, the first data packets with a data priority greater than or equal to the queue priority of a first queue are placed into a first queue. This allows the first queue with a higher queue priority to prioritize the transmission of first data packets with higher data priorities. First data packets with lower data priorities are placed into a second queue with a lower queue priority, awaiting transmission. During the forwarding of the first data packets, the queue priorities of at least two queues are dynamically adjusted to ensure that the queue containing the first data packets with higher data priorities is prioritized for transmission. Therefore, multiple first data packets can be transmitted using only a small number of queues, and the method maximizes the guarantee that the first data packets are forwarded according to their data priority order, avoiding transmission errors caused by out-of-order data packet transmission.

[0043] This application provides a data transmission method applied to a network device, which may include switches, routers, etc. Taking a switch as an example, the above data transmission method can be implemented based on a switch processor (e.g., SCOP) or hardware logic. SCOP is a coprocessor in the switch responsible for packet processing, QoS management, and traffic management, and can implement specific functions through software programming. Furthermore, SCOP can also adjust the queue priority values ​​of each queue to place multiple first data packets with different data priorities into the corresponding queues, thereby enabling the transmission of the first data packets to exclusively occupy the network device's transmission bandwidth.

[0044] The network device 100 involved in the data transmission method described in this application embodiment can be found in [reference needed]. Figure 2As shown. Network device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, and wireless communication module 160.

[0045] It is understood that the structure illustrated in the embodiments of this application does not constitute a specific limitation on the network device 100. In other embodiments of this application, the network device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements.

[0046] Processor 110 may include one or more processing units, such as a switch processor, application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0047] The controller can serve as the nerve center and command center of the network device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control the fetching and execution of instructions.

[0048] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0049] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via a USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the network device 100. While charging the battery 142, the charging management module 140 can also supply power to the network device 100 via the power management module 141.

[0050] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to network equipment 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.

[0051] The wireless communication module 160 can provide solutions for wireless communication applications on the network device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0052] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the network device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage functions.

[0053] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of network device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of network device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0054] The following explanation uses the application of the above data transmission method to a network device as an example. The network device can provide at least two queues for forwarding received data packets.

[0055] like Figure 3 As shown, the method may include the following steps S301 to S303.

[0056] S301, The network device receives multiple first data packets that arrive simultaneously.

[0057] Here, "multiple first data packets" can refer to multiple data packets involved in the same communication task, or multiple data packets involved in different communication tasks. These multiple first data packets will have different data priorities due to varying Quality of Service (QoS) requirements. First data packets with higher data priority will be forwarded first. Conversely, first data packets with lower data priority will be forwarded later, thus ensuring that the multiple first data packets are sent "in order."

[0058] The communication task mentioned above can be a periodic communication task, such as an AI training task, which involves repeated communication at fixed time intervals.

[0059] S302. The network device places the first data packet with a data priority greater than or equal to the queue priority of the first queue into the first queue, and places the remaining first data packets into the second queue. In this way, by placing the first data packet with higher data priority into the first queue, a priority queue (PQ) mapping is achieved between data packets and queues. With the help of the first queue, which has a higher queue priority, the first data packet with higher data priority is forwarded first, thus avoiding transmission errors caused by out-of-order forwarding of data packets during data packet forwarding.

[0060] The priority of the first queue is higher than that of the second queue.

[0061] The network device obtains the data priority of the first data packet by identifying its DSCP or other fields. The DSCP or other fields can indicate the QoS requirements of the communication task to which the first data packet belongs.

[0062] As mentioned above, PQ mapping refers to the process by which network devices map received data packets into different queues according to certain rules in order to achieve different quality of service (QoS) requirements.

[0063] For example, the queue priority P of the first queue a The queue priority P of the second queue is 50. b The network device receives multiple first data packets, including a first data packet with a data priority of 50, a first data packet with a data priority of 30, and a first data packet with a data priority of 10. When placing the first data packets into the queue, the first data packet with a data priority of 50 is placed in the first queue, and the first data packets with data priorities of 30 and 10 are placed in the second queue, as shown below. Figure 4 As shown.

[0064] Here, for a first data packet, if the data priority of the first data packet is greater than the queue priorities of multiple queues, the first data packet is placed in the queue with the highest queue priority among the multiple queues. That is, if the data priority of the data packet is greater than the queue priorities of multiple queues, then the queue in which the data packet is placed is the queue with the highest queue priority among the multiple queues whose queue priorities are lower than the data priority of the data packet.

[0065] For example, the first queue has a priority of 50, the second queue has a priority of 30, and the data priority of the first data packet received by the network device is 60. In this case, the data priority of the first data packet is greater than both the priority of the first queue and the priority of the second queue. Since the priority of the first queue is greater than the priority of the second queue, the first data packet is placed in the first queue.

[0066] If the data priority of the first data packet is lower than the queue priority of each queue, then the first data packet is placed in the queue with the lowest queue priority. In other words, if the data priority of a data packet is lower than the queue priority of each queue, then the queue in which the data packet is placed is the queue with the lowest queue priority among multiple queues.

[0067] For example, the first queue has a priority of 50, the second queue has a priority of 30, and the data priority of the first data packet received by the network device is 10. In this case, the data priority of the first data packet is lower than both the priority of the first queue and the priority of the second queue. Since the second queue has the lowest priority among the two queues, the first data packet is placed in the second queue.

[0068] In some implementations, to ensure that a first data packet with a higher data priority can exclusively occupy the first queue, after placing the first data packets with a data priority greater than or equal to the queue priority of the first queue into the first queue, the network device configures the queue priority of the first queue according to the data priority of the first data packets in the first queue. This allows subsequently arriving data packets with a data priority lower than the first data packet to be placed into a second queue, thereby ensuring that the first data packets with higher data priority can be transmitted as quickly as possible with the help of the first queue.

[0069] If the first queue and / or the second queue contains multiple first data packets with different data priorities, the queue priority of the second queue is configured according to the first data packet with the highest data priority in the first queue and / or the second queue. In other words, when the second queue contains first data packets with different data priorities, the queue priority is configured using the data priority of the first data packet with the highest data priority in the queue. This ensures that subsequently arriving data packets with lower data priorities than the first data packet can be placed in other queues, further guaranteeing that the first data packet with a high data priority can be sent with an exclusive queue.

[0070] The queue priority is positively correlated with the data priority. In other words, the higher the data priority of the data packet placed in the queue, the higher the queue priority.

[0071] The process of implementing exclusive data packet queues and completing forwarding, as described above, can be obtained through the log information (log) in the network device that records the data packet queuing and processing status.

[0072] The following, combined with Figure 5 The process of adjusting queue priorities is illustrated below. When the first data packet arrives, for each first data packet, the DSCP of the first data packet is compared. date The queue priority P of the first queue max If DSCP date >=P max The first data packet is then placed in the first queue, and the queue priority of the first queue is configured using the data priority of the first data packet placed in the first queue. If DSCP... date <P max The first data packet is placed into the second queue, and the queue priority of the second queue is configured using the data priority of the first data packet placed into the second queue.

[0073] S303. The network device sends the first data packet in the first queue until the first data packet in the first queue is sent, and then adjusts the queue priority of the first queue to be lower than the queue priority of the second queue.

[0074] For example, the queue priority P of the first queue a Queue priority P greater than the second queue b (P a >P b At this point, the first queue, having the highest priority, sends the first data packet placed in it first. After the first data packet in the first queue has been sent, the queue priority P of the first queue is adjusted. a Queue priority P is less than that of the second queue b (P a <P b At this point, the second queue, as the queue with the highest priority, will send the first data packet placed in the second queue first, such as... Figure 6 As shown.

[0075] The following, combined with Figure 7 The scheduling process of the queue is illustrated below. Specifically, the queue priority of the first queue is configured to P using the first data packet with the highest data priority in the first queue. a Using the first data packet with the highest data priority in the second queue, configure the queue priority of the second queue to P. b Then, compare P a With P b If P a >P bIf the first queue has the highest priority, the first data packet placed in the first queue will be sent. At this time, the first data packet placed in the second queue will be in a waiting state.

[0076] Here, for the first queue, after the first data packet in the first queue has been sent, there is no longer a first data packet to be sent in the first queue. At this time, the first data packet put into the second queue should be regarded as the first data packet with higher data priority. Therefore, in order to speed up the forwarding efficiency of the first data packet in the second queue, the queue priority of the second queue is increased by performing queue swap so as to complete the forwarding of the first data packet put into the second queue as soon as possible.

[0077] Queue swap refers to changing the queue priority. For network devices (such as switches), a single port of a switch can provide multiple queues, each with different priorities. Queue swap specifically means either moving a queue with a higher priority to a queue with a lower priority, or vice versa.

[0078] For example, after the first data packet in the first queue has been sent, since there are no more first data packets to be sent in the first queue, the network device performs a queue swap, changing the queue priority P of the first queue. a Set to 0, such as Figure 8 As shown, the queue priority P of the second queue b The priority is still set to 30. This ensures that the priority of the first queue is lower than that of the second queue. Subsequently, if other data packets are received, these packets with a lower priority than the second queue can be placed in the first queue to await transmission, thus preventing low-priority data packets from being unable to be placed in the queue and causing data packet loss.

[0079] Regarding the first data packet placed in the second queue, the forwarding timing of this packet depends on the scheduling method between the first and second queues. There are at least two scheduling methods: Scheduling Method 1: SP scheduling. In this method, data packets are forwarded strictly according to priority between the first and second queues. That is, the forwarding of the first data packet in the second queue begins only after the first data packet in the first queue has been completely forwarded. Therefore, when using SP scheduling, the first data packet in the second queue is sent after the first data packet in the first queue has been sent.

[0080] Scheduling Method Two: WRR Scheduling. In this method, the first data packet placed in the first queue and the first data packet placed in the second queue are sent alternately. That is, while forwarding the first data packet in the first queue, the first data packet placed in the second queue can be forwarded as needed. Therefore, when using WRR scheduling, the first data packet in the second queue is sent during the transmission of the first data packet in the first queue. This avoids the problem of the first data packet in the second queue not being forwarded for a long time when the first data packet is always in the first queue.

[0081] In this embodiment, the data transmission method is specifically described in conjunction with SP scheduling and WRR scheduling. In other embodiments, the scheduling method may also include weighted fair queuing (WFQ) scheduling or other scheduling methods.

[0082] When a network device uses the WRR scheduling method, in some implementations, during the comparison process of sending the first data packet in the first queue, the network device alternately sends the first data packet in the first queue and the first data packet in the second queue according to the first weight of the first queue and the second weight of the second queue, so that the first data packet placed in the second queue can also get a forwarding opportunity, and avoid the first data packet in the second queue not being forwarded for a long time.

[0083] The weights are positively correlated with the queue priorities, with the first weight of the first queue being greater than the second weight of the second queue.

[0084] When network devices use WRR scheduling, the specific scheduling scheme for the first and second queues is as follows: The first and second queues are cyclically scheduled according to the first queue's first weight and the second queue's second weight, alternating the transmission of the first data packet from the first queue and the second data packet from the second queue. For each queue, after each scheduling cycle, the queue's weight is decremented by 1 until its weight reaches 0. At this point, the queue no longer participates in the current scheduling cycle; that is, when the queue's weight is 0, the first data packet placed in that queue will not be forwarded during the current scheduling cycle. This process continues until both the first weight of the first queue and the second weight of the second queue decrease to 0, at which point the next scheduling cycle begins. In the next scheduling cycle, the cyclic scheduling of the first and second queues restarts according to their respective weights.

[0085] For example, taking a first queue with a first weight of 9 and a second queue with a second weight of 1, the system first spends time Δt to send a first data packet placed in the first queue, reducing the first weight of the first queue to 8. Then, it spends time Δt to send a first data packet placed in the second queue, reducing the second weight of the second queue to 0. At this point, the second queue is no longer scheduled in the current scheduling cycle; that is, no more first data packets placed in the second queue are sent in the current scheduling cycle. Next, it spends time 8Δt to continuously send 8 first data packets placed in the first queue until the first weight of the first queue is reduced to 0. Then, the system enters the next scheduling cycle, and the network device repeats the above scheduling process. Figure 9 As shown.

[0086] In this context, the weight of a queue determines the number of data packets that queue forwards within a scheduling cycle. The number of the first data packets forwarded by each queue is proportional to its weight. The weight is typically an integer representing the service ratio of that queue relative to other queues. Network devices forward the first data packets placed in each queue sequentially, starting with the queue with the highest weight, according to their weights.

[0087] In some examples, the first data packet in the first queue occupies the first bandwidth when it is sent, and the first data packet in the second queue occupies the second bandwidth when it is sent. The bandwidth is positively correlated with the weight (WEIGHT_CFG). That is, the higher the weight of a queue, the more bandwidth that queue occupies when sending its first data packet.

[0088] In this way, even if the first queue, with its higher first weight, needs to forward a larger number of first data packets, the larger first bandwidth allocated to the first queue can be used to quickly complete the transmission of the first data packets, thus shortening the time it takes for the first queue to forward the first data packets. Conversely, for the second queue, with its lower second weight, since it needs to forward fewer first data packets, a relatively smaller bandwidth can be allocated to the second queue to avoid wasting transmission bandwidth.

[0089] The first bandwidth and the second bandwidth can be determined based on the weight ratio between the first weight and the second weight. For example, the bandwidth ratio between the first bandwidth and the second bandwidth can be equal to the weight ratio between the first weight and the second weight. For instance, taking a total network device transmission bandwidth of 400 GBps as an example, when the first weight is 9 and the second weight is 1, the weight ratio between the first weight and the second weight is 9:1. Therefore, based on the weight ratio between the first weight and the second weight, the first bandwidth occupied by the first queue sending the first data packet is determined to be 360 ​​GBps, and the first bandwidth occupied by the second queue sending the first data packet is determined to be 40 GBps.

[0090] Here, the queue swap mentioned above, besides changing queue priority, can also change both queue priority and weight. In this case, queue swap refers to changing the weight of each queue while altering its priority. Specifically, a high-priority queue can be moved to a lower-priority queue, and the original high-priority queue can be assigned a lower weight; or, a low-priority queue can be moved to a high-priority queue, and the original low-priority queue can be assigned a higher weight. This swaps the transmission priority and bandwidth used by the two queues.

[0091] In some implementations, after adjusting the priority of the first queue to be lower than that of the second queue, the first data packet placed in the second queue has a higher data priority. Therefore, in order to forward the first data packet in the second queue as quickly as possible, the network device adjusts the first weight of the first queue to the third weight and the second weight of the second queue to the fourth weight. The third weight is lower than the fourth weight. This increases the priority of the second queue and, by further increasing the weight value of the second queue, increases the number of times the second queue can be invoked within a scheduling cycle. Consequently, it increases the number of first data packets forwarded by the second queue within a scheduling cycle, thus prioritizing the forwarding of the first data packets in the second queue.

[0092] For example, if the priority of the first queue is greater than that of the second queue, the first queue is assigned a first weight of 9, and the second queue is assigned a second weight of 1. First, time Δt is spent sending a first data packet placed in the first queue, reducing the first weight of the first queue to 8. Then, time Δt is spent sending a first data packet placed in the second queue, reducing the second weight of the second queue to 0. Next, time 8Δt is spent sending eight more first data packets placed in the first queue until the first weight of the first queue is reduced to 0, at which point the next scheduling cycle begins.

[0093] After adjusting the priority of the first queue to be lower than that of the second queue, the first queue is adjusted to the third with a weight of 1, and the second queue is adjusted to the fourth with a weight of 9. Figure 10 As shown. At this point, time Δt is spent sending a first data packet placed in the second queue, and the fourth weight of the second queue is reduced to 8. Then, time Δt is spent sending a first data packet placed in the first queue, and the third weight of the first queue is reduced to 0. Next, time 8Δt is spent sending eight more first data packets placed in the second queue until the fourth weight of the second queue is reduced to 0, at which point the next scheduling cycle begins.

[0094] The queue swap process described above can be found in the development documentation.

[0095] In some implementations, if a network device receives multiple second data packets arriving simultaneously while sending a first data packet placed in a first queue, the network device will place the second data packets with a data priority greater than or equal to the queue priority of the first queue into the first queue, and place the remaining second data packets into the second queue. This way, if the network device receives a second data packet with a higher data priority in a subsequent process, the network device can still utilize the first queue with the higher current queue priority to prioritize the transmission of the second data packet, thus achieving "ordered" transmission of data packets.

[0096] For example, among the multiple first data packets received by the network device, there are first data packets with a data priority of 30 and first data packets with a data priority of 10. When placing the first data packets into the queue, the first data packet with a data priority of 30 is placed into the first queue, and the queue priority P of the first queue is set. a Configured to 30. The first data packet with a priority of 10 is placed into the second queue, and the queue priority P of the second queue is set. b The configuration is set to 10.

[0097] During the process of the network device sending the first data packet in the first queue, the network device receives multiple second data packets, including a second data packet with a data priority of 50, a second data packet with a data priority of 30, and a second data packet with a data priority of 10. At this time, the second data packet with a data priority of 50 is greater than the queue priority of the first queue (P). a =30), which is greater than the queue priority of the second queue (P). b =10), put the second data packet with a data priority of 50 into the first queue, and set the queue priority P of the first queue to 10. a Configured to 50. Place the second data packet with a data priority of 30 and the second data packet with a data priority of 10 into the second queue, and set the queue priority P of the second queue. b Configured to 30, such as Figure 11 As shown.

[0098] Until all data packets in the first queue have been sent, the queue priority P of the first queue is adjusted. a Configured to 0. If the network device receives multiple third data packets arriving simultaneously, including a third data packet with a data priority of 30 and a third data packet with a data priority of 10, the third data packet with a data priority of 30 is placed in the second queue, and the third data packet with a data priority of 10 is placed in the first queue.

[0099] In addition, combined Figure 11 It can also be seen that when multiple data packets (including the first and second data packets) are sent simultaneously without distinguishing their sending priorities, the multiple first data packets share the transmission bandwidth of the network device's transmission link. When multiple data packets (including the first and second data packets) are sent using the first and second queues, data packets with different data priorities are sent "at different times," thus, the transmission bandwidth of the transmission link can be approximately exclusively used during the transmission process. Furthermore, the second data packet with a data priority of 50 can be sent before the first data packet with a data priority of 10.

[0100] In some implementations, after the network device adjusts the queue priority of the first queue to be lower than that of the second queue, if the network device receives multiple third data packets arriving simultaneously, it places the third data packets with a data priority greater than or equal to the queue priority of the second queue into the second queue, and places the remaining third data packets into the first queue. In this way, if the network device subsequently receives a third data packet with a higher data priority, it can prioritize sending the third data packet from the second queue, which currently has the higher priority, thus achieving "ordered" data packet transmission.

[0101] For example, the network device receives multiple first data packets, including a first data packet with a data priority of 50, a first data packet with a data priority of 30, and a first data packet with a data priority of 10. When placing the first data packet into the queue, the first data packet with a data priority of 50 is placed into the first queue, and the queue priority P of the first queue is set. a Configured to 50. The first data packet with a data priority of 30 and the first data packet with a data priority of 10 are placed into the second queue, and the queue priority P of the second queue is set. b The configuration is set to 30.

[0102] Until all data packets in the first queue have been sent, the queue priority P of the first queue is adjusted. a Configured to 0. The queue priority P of the second queue. b The configuration remains at 30.

[0103] In the second queue, since the first data packet with a data priority of 10 was placed there first, when multiple third data packets arrive, the first data packet with a data priority of 10 already in the second queue will not be removed. At this time, the second queue is in a queuing period, and it still prioritizes sending the first data packet with a data priority of 10 before sending subsequent data packets.

[0104] At this point, if the network device receives multiple third data packets, including a third data packet with a data priority of 30 and a third data packet with a data priority of 10, the third data packet with a data priority of 30 is still placed in the second queue. Meanwhile, the first data packet with a data priority of 10, already placed in the second queue, is still forwarded using the second queue. At this time, for the second queue, the period of forwarding the already placed first data packet is considered a "clearing period." Figure 12 As shown. The second data packet with a data priority of 10 is placed into the first queue, and the queue priority P of the first queue is set. a The configuration is set to 10.

[0105] In addition, combined Figure 12 It can also be seen that when multiple data packets (including the first and third data packets) are sent simultaneously without distinguishing their sending priorities, the multiple first data packets share the transmission bandwidth of the network device's transmission link. When multiple data packets (including the first and third data packets) are sent using the first and second queues, data packets with different data priorities are sent "staggered". First, the first data packet with a data priority of 50 is sent; second, the first data packet with a data priority of 30 is sent; then, the first data packet with a data priority of 10 is sent; next, the third data packet with a data priority of 30 is sent; and finally, the third data packet with a data priority of 10 is sent. Therefore, data packets with different data priorities can approximately monopolize the transmission bandwidth of the transmission link during the transmission process.

[0106] In some implementations, when a network device receives multiple first data packets for the first time, it places the first data packet with the highest data priority into a first queue and places the remaining first data packets into a second queue. This allows the first data packet with the highest data priority to exclusively occupy the first queue, thereby obtaining almost all the transmission bandwidth and quickly completing the forwarding of the first data packet with the highest data priority.

[0107] Here, when adding data packets to the queues, to ensure "in-order" forwarding of first data packets according to their data priority while reducing the number of queues required, first data packets with higher data priority are placed in the first queue, allowing them to have exclusive access. The remaining first data packets with lower data priority are placed in the second queue to await forwarding. However, compared to the first queue, the data priorities of the first data packets in the second queue are more "disorderly," leading to potential "out-of-order" forwarding issues. Therefore, to "regulate" the data priorities of the first data packets in the second queue, a third queue can be added to "share" the load of data packets placed in the second queue.

[0108] When at least two queues include a third queue, and the priority of the third queue is lower than the priority of the second queue, in some implementations, when the network device places the remaining first data packets from a plurality of first data packets into the second queue, it places the first data packets whose data priority is greater than or equal to the priority of the second queue into the second queue, and places the first data packets whose data priority is less than the priority of the second queue into the third queue. In this way, by additionally setting up a third queue, the data priority of the first data packets placed in the second queue can be standardized without significantly increasing the number of lossless queues required by the network device. The more queues the network device can provide, the greater the space for performing queue swap scheduling.

[0109] For example, the network device receives multiple first data packets, including a first data packet with a data priority of 80, a first data packet with a data priority of 50, a first data packet with a data priority of 30, and a first data packet with a data priority of 10. When placing the first data packet into the queue, the first data packet with a data priority of 80 is placed into the first queue, and the queue priority P of the first queue is set. a Configured to 80. The first data packet with a priority of 50 is placed into the second queue, and the queue priority P of the first queue is set. b Configured to 50. The first data packet with a data priority of 30 and the first data packet with a data priority of 10 are placed into the second queue, and the queue priority P of the second queue is set. c The configuration is set to 30.

[0110] Until all data packets in the first queue have been sent, the queue priority P of the first queue is adjusted. aThe configuration is set to 0. At this time, if the network device receives multiple second data packets, including a second data packet with a data priority of 50, a second data packet with a data priority of 30, and a second data packet with a data priority of 10, then the second data packet with a data priority of 50 is placed in the second queue. The second data packet with a data priority of 30 is placed in the third queue. The second data packet with a data priority of 10 is placed in the first queue, and so on. Figure 13 As shown, the queue priority P of the first queue is set. a The configuration is set to 10.

[0111] Until all data packets placed in the second queue have been sent, the queue priority P of the second queue is adjusted. b The configuration is set to 0. At this point, if the network device receives multiple third data packets arriving simultaneously, including a third data packet with a data priority of 30 and a third data packet with a data priority of 10, the third data packet with a data priority of 30 is placed in the third queue, and the third data packet with a data priority of 10 is placed in the first queue.

[0112] In addition, combined Figure 13 It can also be seen that when multiple data packets (including the first data packet, the second data packet, and the third data packet) are sent simultaneously without distinguishing their sending priorities, the multiple data packets share the transmission bandwidth of the network device's transmission link; when multiple data packets (including the first data packet, the second data packet, and the third data packet) are sent with the help of the first queue, the second queue, and the third queue, the data packets with different data priorities are sent "at different times", so the transmission bandwidth of the transmission link can be almost exclusively occupied during the sending process.

[0113] In other implementations, if at least two queues also include a third queue, when a network device receives multiple first data packets for the first time, firstly, the network device places the first data packet with the first data priority into the first queue. Secondly, the network device places the first data packet with the second data priority into the second queue. Finally, the network device places the remaining first data packets into the third queue. This maximizes the standardization of the data priorities of the first data packets placed in each queue.

[0114] Among them, the first data priority is the highest data priority corresponding to multiple first data packets, the second data priority is lower than the first data priority, and higher than the data priority corresponding to the other first data packets.

[0115] In some solutions, multiple embodiments of this application can be combined, and the combined solution can be implemented. Optionally, some operations in the processes of each method embodiment may be combined, and / or the order of some operations may be changed. Furthermore, the execution order between the steps of each process is merely exemplary and does not constitute a limitation on the execution order between steps; other execution orders are also possible. It is not intended to indicate that the execution order is the only possible order in which these operations can be performed. Those skilled in the art will conceive of various ways to reorder the operations described in the embodiments of this application. In addition, it should be noted that the process details involved in one embodiment of this application are also applicable to other embodiments in a similar manner, or different embodiments may be combined.

[0116] Furthermore, some steps in the method embodiments can be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiments may be optional and can be deleted in certain use cases. Or, other possible steps may be added to the method embodiments.

[0117] Furthermore, the various method embodiments can be implemented individually or in combination.

[0118] It is understood that, in order to achieve the above functions, the aforementioned network device includes hardware and / or software modules corresponding to perform each function. Based on the algorithmic steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware 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 in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0119] This application embodiment can divide the network device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0120] This application also provides a network device, such as... Figure 14 As shown, the network device may include one or more processors 1401, memory 1402 and communication interfaces 1403.

[0121] The memory 1402, communication interface 1403, and processor 1401 are coupled together. For example, the memory 1402, communication interface 1403, and processor 1401 can be coupled together via bus 1404.

[0122] The communication interface 1403 is used for data transmission with other devices. The memory 1402 stores computer program code. The computer program code includes computer instructions, which, when executed by the processor 1401, cause the network device to perform the data transmission method described in this embodiment.

[0123] The processor 1401 may be a processor or controller, such as a central processing unit (CPU), 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, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with this disclosure. The processor may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0124] Bus 1404 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 1404 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 14 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0125] This application also provides a computer-readable storage medium storing computer program code. When the processor executes the computer program code, the network device executes the relevant method steps in the above method embodiments.

[0126] The network device and computer storage medium provided in this application are used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0128] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or 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 device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0129] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0130] Furthermore, 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. The integrated unit can be implemented in hardware or as a software functional unit.

[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, in essence, or the part that contributes, or all or part of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor 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.

[0132] 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 within the technical scope 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 transmission method, characterized in that, The method is applied to a network device that uses at least two queues to forward received data packets; the at least two queues include a first queue and a second queue, wherein the queue priority of the first queue is greater than the queue priority of the second queue; the method includes: Receive multiple first data packets that arrive simultaneously; The first data packet with a data priority greater than or equal to the queue priority of the first queue is placed into the first queue, and the remaining first data packets are placed into the second queue. Send the first data packet in the first queue until the first data packet in the first queue is sent completely, and adjust the queue priority of the first queue to be lower than the queue priority of the second queue; the first data packet in the second queue is sent during the sending of the first data packet in the first queue, or after the first data packet in the first queue is sent completely.

2. The method according to claim 1, characterized in that, During the process of sending the first data packet of the first queue, the method further includes: Receive multiple second data packets that arrive simultaneously; The second data packets whose data priority is greater than or equal to the queue priority of the first queue are placed into the first queue, and the remaining second data packets are placed into the second queue.

3. The method according to claim 1 or 2, characterized in that, After adjusting the queue priority of the first queue to be lower than that of the second queue, the method further includes: Receive multiple third data packets arriving simultaneously; The third data packets with a data priority greater than or equal to the queue priority of the second queue are placed into the second queue, and the remaining third data packets are placed into the first queue.

4. The method according to any one of claims 1-3, characterized in that, The at least two queues further include a third queue; the queue priority of the third queue is lower than the queue priority of the second queue; the step of placing the remaining first data packets from the plurality of first data packets into the second queue includes: Place the remaining first data packets whose data priority is greater than or equal to the queue priority of the second queue into the second queue, and place the remaining first data packets whose data priority is less than the queue priority of the second queue into the third queue.

5. The method according to any one of claims 1-4, characterized in that, After placing the first data packet with a data priority greater than or equal to the queue priority of the first queue into the first queue, the method further includes: The queue priority of the first queue is configured according to the data priority of the first data packet in the first queue; the queue priority is positively correlated with the data priority.

6. The method according to any one of claims 1-5, characterized in that, Sending the first data packet in the first queue includes: Based on the first weight of the first queue and the second weight of the second queue, the first data packet in the first queue and the first data packet in the second queue are sent alternately; if the first weight is greater than the second weight, the first data packet in the first queue is sent first.

7. The method according to claim 6, characterized in that, When the first data packet in the first queue is sent, it occupies the first bandwidth, and when the first data packet in the second queue is sent, it occupies the second bandwidth; the first bandwidth and the second bandwidth are determined according to the weight ratio between the first weight and the second weight.

8. The method according to claim 6 or 7, characterized in that, After adjusting the queue priority of the first queue to be lower than that of the second queue, the method further includes: The first weight of the first queue is adjusted to the third weight, and the second weight of the second queue is adjusted to the fourth weight; the third weight is less than the fourth weight.

9. The method according to any one of claims 1-8, characterized in that, When the network device receives the plurality of first data packets for the first time, the step of placing the first data packet with a data priority greater than or equal to the queue priority of the first queue into the first queue, and placing the remaining first data packets into the second queue, includes: The first data packet with the highest data priority among the plurality of first data packets is placed into the first queue, and the remaining first data packets among the plurality of first data packets are placed into the second queue.

10. A network device, characterized in that, The device includes a memory and one or more processors; the memory is coupled to the processors; the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the network device to perform the data transmission method as described in any one of claims 1-9.

11. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on a network device, cause the network device to perform the data transmission method as described in any one of claims 1-9.

12. A computer program product, characterized in that, When the computer program product is run on a network device, it causes the network device to perform the data transmission method as described in any one of claims 1-9.