A congestion handling method and related apparatus

By acquiring congestion information from data center boundary devices and adjusting the next-hop network devices of the data flow, the congestion problem of data flow in cross-data center collaborative training is solved, and data transmission efficiency is improved.

CN122137787APending Publication Date: 2026-06-02HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2024-11-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

When training AI models collaboratively across data centers, data flow can easily become congested after entering the data center, affecting training efficiency.

Method used

By acquiring data flow congestion information through the first network device and changing the next-hop network device of the target data flow, the forwarding path of the data flow can be adjusted to resolve the congestion problem.

Benefits of technology

It improves data transmission efficiency, ensures normal data flow within the data center, and avoids the impact of path adjustments on data flows that are not congested.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122137787A_ABST
    Figure CN122137787A_ABST
Patent Text Reader

Abstract

A congestion handling method is disclosed to resolve data flow congestion and improve data transmission efficiency. In this method, when a first network device forwards a data flow to other network devices within a first network domain, it can obtain information about congestion occurring within that domain. Furthermore, based on this congestion information, the first network device can change the next-hop network device for forwarding the data flow, thereby altering the data flow forwarding path. In this way, by sensing data flow congestion and modifying the forwarding path, the first network device can adjust the forwarding path of congested data flows, thus resolving the congestion problem and improving data transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data transmission technology, and in particular to a congestion handling method and related apparatus. Background Technology

[0002] With the rapid development of artificial intelligence (AI) technology, the computing power required for AI model training is increasing daily. Given that the computing resources of a single data center (DC) are insufficient to meet the demands of AI model training, cross-data center collaborative training technology has become a hot topic.

[0003] Currently, AI model training tasks involve the collaboration of tens of thousands of computing nodes. Therefore, the training efficiency of AI models often depends on the data transmission efficiency between computing nodes. When AI model training tasks are executed within a single data center, by properly orchestrating data transmission paths, load balancing within the data center can often be achieved, ensuring congestion-free data transmission.

[0004] However, in scenarios where AI models are trained collaboratively across data centers, during the training of AI models, the data flow from outside the data center to inside the data center often easily causes congestion inside the data center, thus affecting the training efficiency of the model. Summary of the Invention

[0005] This application provides a congestion handling method to solve the congestion problem of data streams and improve data transmission efficiency.

[0006] In a first aspect, a congestion handling method is provided, comprising: a first network device acquiring data flow congestion information, the data flow congestion information being used to indicate that at least one data flow forwarded by the first network device is congested within a first network domain, the first network device being located outside the first network domain. For example, the first network device is a boundary device of the first network domain, and the first network device forwards data flows to network devices within the first network domain.

[0007] Then, the first network device changes the next-hop network device for forwarding the target data flow in at least one data flow, and the changed next-hop network device is located within the first network domain. The target data flow includes one or more data flows. Furthermore, the target data flow is either a portion of the at least one data flow experiencing congestion, or all of the at least one data flow experiencing congestion.

[0008] In this scheme, during the process of the first network device forwarding data streams to network devices within the first network domain, the first network device can obtain information about congestion in the data streams it is forwarding within the first network domain. Furthermore, based on the congestion information, the first network device can change the next-hop network device for forwarding the data stream, thereby altering the data stream forwarding path. In this way, by sensing the congestion status of the data stream and modifying the forwarding path, the first network device can adjust the forwarding path of congested data streams, thereby resolving the data stream congestion problem and improving data transmission efficiency.

[0009] In one possible implementation, to modify the next-hop network device of the target data flow, the first network device first determines multiple data flows based on the target data flow, and these multiple data flows include the target data flow. Furthermore, all multiple data flows are data flows forwarded by the first network device to multiple network devices within the first network domain; that is, the multiple data flows belong to the data flows forwarded by the first network device to multiple network devices within the first network domain.

[0010] Then, the first network device changes the next-hop network device for each of the multiple data streams, and the next-hop network devices after the multiple data streams are changed are located in the target device range, which includes the next-hop network devices before the multiple data streams were changed.

[0011] In other words, the first network device is equivalent to reallocating a new next-hop network device for multiple data streams, thereby adjusting the forwarding path of multiple data streams and helping to resolve the congestion of the target data stream in the first network domain.

[0012] In one possible implementation, the target data flow includes at least two data flows, and the multiple data flows requiring modification of the next-hop network device only include the target data flow. That is, when the target data flow includes at least two data flows, the first network device only modifies the next-hop network device for the data flows included in the target data flow, without modifying the next-hop network device for other data flows that are not congested.

[0013] In this scheme, by adjusting only the next-hop network devices of the congested data streams and limiting the adjustment scope of the next-hop network devices of the congested data streams to the original next-hop network devices of these data streams, the impact on other non-congested data streams can be minimized. Thus, the congested data streams can be adjusted without affecting other non-congested data streams, ensuring the normal transmission of data streams as much as possible.

[0014] In one possible implementation, the multiple data flows requiring modification of the next-hop network device also include data flows forwarded by the first network device that are not congested within the first network domain. That is, in addition to the target data flows that are already congested, the first network device also determines that data flows that are not congested also require next-hop network device adjustments.

[0015] In one possible implementation, during the process of the first network device changing the next-hop network device for each data flow in multiple data flows, the first network device changes the next-hop network device of the first data flow from the second network device to the third network device based on the ring sorting result among network devices in the target device range. Here, the target data flow includes the first data flow, and in the ring sorting result, the second network device and the third network device are adjacent.

[0016] In this scheme, the first network device performs a circular sorting of network devices within the target device range, thereby determining the next-hop network device after the data flow change based on the circular sorting result between network devices, thus achieving rapid determination of the next-hop network device after the data flow change.

[0017] In one possible implementation, the first network device sends a first message to the target network device. This first message is used to obtain the transmission quality of the target path, which is the path from the target network device to the destination address of the target data stream. In other words, if the next-hop network device of the target data stream changes to the target network device, then the forwarding path of the target data stream becomes the target path. Therefore, the first network device determines the expected transmission effect of the target data stream after changing its next-hop network device by obtaining the transmission quality of the target path.

[0018] Thus, based on the transmission quality of the target path, the first network device determines to change the next-hop network device for forwarding the target data stream to the target network device.

[0019] In this scheme, for a target data stream that is congested, the first network device obtains the expected transmission effect of the target data stream on other forwarding paths in advance. This allows the first network device to know in advance whether the target data stream will still be congested after changing the next-hop network device, thereby ensuring that the target data stream will no longer be congested after changing the next-hop network device, and realizing the one-time adjustment of the next-hop network device of the target data stream.

[0020] In one possible implementation, the first network device obtains the transmission quality of the target data stream's transmission path before changing the next-hop network device; then, in response to the target path's transmission quality being better than the transmission path's transmission quality, the first network device determines to change the next-hop network device when forwarding the target data stream to the target network device.

[0021] The transmission quality of a path can be measured by metrics such as path transmission latency, path packet loss rate, and link utilization rate within the path.

[0022] In one possible implementation, in response to the transmission quality of the target path meeting preset conditions, the first network device determines that the next-hop network device when forwarding the target data stream should be changed to the target network device.

[0023] That is, if the transmission quality of the target path meets the preset conditions, the first network device considers the expected transmission effect of the target path to be good, and therefore the first network device can determine to change the next-hop network device when forwarding the target data stream to the target network device.

[0024] In one possible implementation, in order to find the optimal forwarding path for the target data stream, the first network device forwards multiple quality acquisition messages. The multiple quality acquisition messages are forwarded to different network devices among multiple network devices in the first network domain. The multiple quality acquisition messages are used to obtain the transmission quality of multiple paths, which include paths from multiple network devices to the destination address of the target data stream. The multiple network devices include the target network device.

[0025] Furthermore, based on the transmission quality of the multiple paths obtained, the first network device determines to change the next-hop network device for forwarding the target data stream to the target network device. For example, the path corresponding to the target network device is the path with the highest transmission quality among the multiple paths.

[0026] In this scheme, the first network device can select one of the paths as the subsequent forwarding path for the congested data flow by acquiring and comparing the expected transmission effect of the congested data flow on multiple paths. This allows it to determine how to change the next-hop network device of the congested data flow, ensuring that changing the next-hop network device can effectively alleviate the congestion problem and improve the transmission speed of the data flow.

[0027] In one possible implementation, after the first network device changes the next-hop network device for forwarding at least one target data flow in a data flow, the first network device sends a first notification message to the fourth network device. This first notification message instructs the fourth network device to begin adjusting the next-hop network device for the data flow. The fourth network device is located outside the first network domain, while the destination address of the data flow forwarded by the fourth network device is located within the first network domain.

[0028] In other words, after the first network device completes the adjustment of the next-hop network device for the congested data flow, it notifies another network device outside the first network domain (i.e., the fourth network device) to start adjusting the next-hop network device for the data flow. This allows multiple network devices outside the first network domain to take turns adjusting the next-hop network device for the data flow, avoiding the phenomenon of invalid data flow adjustment.

[0029] In one possible implementation, the first network device is the next-hop network device that triggers a change in the forwarding target data flow when the data flow adjustment conditions are met.

[0030] In one possible implementation, the data flow adjustment conditions include the first network device performing data flow adjustment in the first set of devices in the order of first, or the first network device receiving a second notification message; wherein the first set of devices includes multiple network devices outside the first network domain; and the second notification message is used to instruct the first network device to begin performing next-hop network device adjustment of the data flow.

[0031] In one possible implementation, the first network device obtains data flow congestion information by: the first network device receiving a first notification message from a fifth network device, the first notification message being used to indicate that the first data flow is congested; wherein the fifth network device is located within a first network domain, and at least one data flow includes the first data flow.

[0032] In one possible implementation, the first network device obtains data flow congestion information by: the first network device receiving a second notification message from a fifth network device, the second notification message indicating that the data flow received by the fifth network device from the target port of the first network device is congested; wherein the fifth network device is located within a first network domain, and at least one data flow includes the data flow received by the fifth network device from the target port of the first network device.

[0033] In one possible implementation, at least one data flow is multiple data flows. When the first network device changes the next-hop network device for forwarding the target data flow in at least one data flow, the first network device determines a range of forwarding ports. This range includes multiple ports used by the first network device to forward the multiple data flows. The first network device changes the forwarding port of the target data flow, and the changed forwarding port of the target data flow falls within the range of forwarding ports.

[0034] In one possible implementation, at least one data stream is a data stream for an AI task, and the first network device is the next-hop network device that changes the forwarding of the target data stream during an interruption of the target data stream.

[0035] In a second aspect, a congestion processing apparatus is provided, which is deployed on a first network device and includes: a transceiver module for acquiring data flow congestion information, the data flow congestion information being used to indicate that at least one data flow forwarded by the first network device is congested within a first network domain, the first network device being located outside the first network domain; and a processing module for changing the next-hop network device for forwarding a target data flow in at least one data flow, the next-hop network device after the target data flow has been changed being located within the first network domain.

[0036] In one possible implementation, the processing module is further configured to: determine multiple data flows based on the target data flow, the multiple data flows including the target data flow; modify the next-hop network device for forwarding each of the multiple data flows, and the modified next-hop network devices for the multiple data flows are located within the target device range, the target device range including the next-hop network devices for the multiple data flows before the modification.

[0037] In one possible implementation, the target data stream includes at least two data streams, while multiple data streams include only the target data stream.

[0038] In one possible implementation, the multiple data streams also include data streams forwarded by the first network device that are not congested within the first network domain.

[0039] In one possible implementation, the processing module is further configured to: change the next-hop network device of the first data stream from the second network device to the third network device based on the ring sorting result among network devices in the target device range; wherein the target data stream includes the first data stream, and in the ring sorting result, the second network device and the third network device are adjacent.

[0040] In one possible implementation, the transceiver module is further configured to send a first message to the target network device, the first message being used to obtain the transmission quality of the target path, the target path being the path from the target network device to the destination address of the target data stream; the processing module is further configured to determine, based on the obtained transmission quality of the target path, to change the next-hop network device for forwarding the target data stream to the target network device.

[0041] In one possible implementation, the transceiver module is further configured to acquire the transmission quality of the transmission path of the target data stream before changing the next-hop network device; the processing module is further configured to determine, in response to the transmission quality of the target path being better than the transmission quality of the transmission path, to change the next-hop network device when forwarding the target data stream to the target network device.

[0042] In one possible implementation, the processing module is further configured to: determine, in response to the transmission quality of the target path meeting preset conditions, change the next-hop network device when forwarding the target data stream to the target network device.

[0043] In one possible implementation, the transceiver module is further configured to forward multiple quality acquisition messages, which are respectively forwarded to different network devices among multiple network devices in the first network domain. The multiple quality acquisition messages are used to acquire the transmission quality of multiple paths, which include paths from multiple network devices to the destination address of the target data stream, and the multiple network devices include the target network device. The processing module is further configured to determine, based on the acquired transmission quality of the multiple paths, to change the next-hop network device for forwarding the target data stream to the target network device.

[0044] In one possible implementation, the transceiver module is further configured to send a first notification message to a fourth network device after the processing module changes the next-hop network device of the target data stream in at least one data stream. The first notification message is used to instruct the fourth network device to start performing next-hop network device adjustment for the data stream. The fourth network device is located outside the first network domain, and the destination address of the data stream forwarded by the fourth network device is located within the first network domain.

[0045] In one possible implementation, the processing module is the next-hop network device that triggers a change in the forwarding target data flow when the data flow adjustment conditions are met.

[0046] In one possible implementation, the data flow adjustment conditions include the first network device performing data flow adjustment in the first set of devices in the order of first, or the first network device receiving a second notification message; wherein the first set of devices includes multiple network devices outside the first network domain; and the second notification message is used to instruct the first network device to begin performing next-hop network device adjustment of the data flow.

[0047] In one possible implementation, the transceiver module is further configured to receive a first notification message from a fifth network device, the first notification message being used to indicate that congestion has occurred in the first data stream; wherein the fifth network device is located within a first network domain, and at least one data stream includes the first data stream.

[0048] In one possible implementation, the transceiver module is further configured to receive a second notification message from the fifth network device, the second notification message being used to indicate that the data stream received by the fifth network device from the target port of the first network device is congested; wherein the fifth network device is located within the first network domain, and at least one data stream includes the data stream received by the fifth network device from the target port of the first network device.

[0049] In one possible implementation, at least one data stream is multiple data streams, and the processing module is further configured to: determine a forwarding port range, the forwarding port range including multiple ports of the first network device that forward multiple data streams; change the forwarding port of the target data stream, and the changed forwarding port of the target data stream belongs to the forwarding port range.

[0050] In one possible implementation, at least one data stream is the data stream for the AI ​​task, and the processing module changes the next-hop network device that forwards the target data stream during an interruption of the target data stream.

[0051] A third aspect of this application provides a network device including a processor and a memory. The memory stores program code, and the processor invokes the program code in the memory to cause the network device to perform a method as described in any embodiment of the first aspect.

[0052] A fourth aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform a method as described in any of the embodiments of the first aspect.

[0053] The fifth aspect of this application provides a computer program product that, when run on a computer, causes the computer to perform a method as described in any of the embodiments of the first aspect.

[0054] A sixth aspect of this application provides a chip including one or more processors. Part or all of the processors are used to read and execute computer instructions stored in a memory to perform the methods in any possible implementation of any of the above aspects. Optionally, the chip also includes a memory. Optionally, the chip also includes a communication interface, with the processor connected to the communication interface. The communication interface is used to receive data and / or information to be processed, the processor obtains the data and / or information from the communication interface, processes the data and / or information, and outputs the processing results through the communication interface. Optionally, the communication interface is an input / output interface or a bus interface. The methods provided in this application are implemented by one chip or by multiple chips working together.

[0055] The solutions provided in the second to sixth aspects above are used to implement or cooperate with the methods provided in the first aspect above, and therefore can achieve the same or corresponding beneficial effects as the first aspect, which will not be elaborated here. Attached Figure Description

[0056] Figure 1 A schematic diagram illustrating how a router forwards data streams to a switch within a data center, as provided in this application;

[0057] Figure 2 A schematic diagram of a system architecture provided for this application;

[0058] Figure 3 A flowchart illustrating a congestion handling method provided in this application;

[0059] Figure 4 A schematic diagram of a next-hop network device for modifying data flow provided in this application;

[0060] Figure 5 A schematic diagram illustrating how to adjust data flow within the scope of a next-hop network device where data flow congestion has occurred, as provided in this application;

[0061] Figure 6 A schematic diagram illustrating the adjustment of data flow within a specified next-hop network device range, as provided in this application;

[0062] Figure 7 A schematic diagram illustrating a forwarding path for rearranging congested data streams, as provided in this application;

[0063] Figure 8 A schematic diagram illustrating a method for rearranging the forwarding path of a congested data stream based on path delay, as provided in this application;

[0064] Figure 9 A schematic diagram of a forwarding port for reorganizing data streams based on a graph model, as provided in this application;

[0065] Figure 10 A schematic diagram of a system architecture provided for this application;

[0066] Figure 11 This application provides a schematic diagram illustrating the transition between rearranged states.

[0067] Figure 12 A schematic diagram illustrating how routers 1 through 3 take turns performing data flow rearrangement, as provided in this application;

[0068] Figure 13 A schematic diagram of a congestion handling device provided in this application;

[0069] Figure 14 This is a schematic diagram of the structure of a network device provided in this application. Detailed Implementation

[0070] The embodiments of this application are described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. As those skilled in the art will understand, with the development of technology and the emergence of new scenarios, the technical solutions provided by this application are also applicable to similar technical problems.

[0071] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In the embodiments of this application, the term "at least one" refers to one or more, and "more than one" refers to two or more.

[0072] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0073] For ease of understanding, some technical terms used in this application will be introduced below.

[0074] (1) Priority-based flow control (PFC)

[0075] Priority-based flow control (PFC) is a flow control mechanism in the Ethernet protocol. When a network device implements PFC, if the receive buffer of a port on the network device becomes congested, it will send a backpressure message to the peer port to instruct the peer to suspend sending packets in the corresponding priority queue.

[0076] (2) Display Explicit Congestion Notification (ECN)

[0077] ECN is an improved congestion control method. Instead of relying on packet loss to indicate congestion, ECN marks the packet header with a signal that congestion has occurred. Specifically, ECN is implemented by adding a special flag bit to the IP header of the packet. For example, when a router's buffer begins to become congested, the router marks the ECN bit on the packet to inform the sender that network congestion has occurred.

[0078] Specifically, the working principle of ECN can be divided into three main stages: tagging, transmission, and response.

[0079] Flag: When a router's buffer begins to become congested, the router examines incoming packets. If the buffer exceeds a certain threshold, the router modifies the IP header of the packet, setting the ECN bit to indicate that network congestion has occurred.

[0080] Transmission: Data packets marked with the ECN bit continue to be transmitted in the network without being dropped, so that the receiver can receive all data packets without waiting for retransmission.

[0081] Response: Upon receiving a data packet with the ECN tag, the receiver sends a special notification to the sender, informing them that network congestion has occurred. Upon receiving the notification, the sender adjusts its transmission rate accordingly, as instructed by the receiver, to reduce the degree of network congestion.

[0082] In this way, ECN can indicate network congestion more promptly and avoid the additional overhead caused by packet loss, thereby improving network performance and efficiency.

[0083] Currently, in scenarios where AI models are trained collaboratively across data centers, during the training period, data flow from outside the data center into the data center often easily causes congestion within the data center, thus affecting the training efficiency of the model.

[0084] The applicant's research revealed that, since different data centers often belong to different network domains, the boundary devices of the data center cannot know the network topology and data transmission situation inside the data center. Therefore, when the boundary devices of the data center forward data into the data center, it is difficult to plan the optimal forwarding path for each data flow, which can easily lead to data flow congestion in the data center and affect the training efficiency of the model.

[0085] For example, please refer to Figure 1 , Figure 1 This is a schematic diagram illustrating how a router forwards data streams to a switch within a data center, as provided in this application. Figure 1 As shown, the data center includes Spine Switch 1, Spine Switch 2, Leaf Switch 1, and Leaf Switch 2, with Leaf Switch 1 and Leaf Switch 2 each connected to one or more servers. Spine Switch 1 and Spine Switch 2 within the data center are both connected to routers outside the data center, and they are also connected to Leaf Switch 1 and Leaf Switch 2.

[0086] When the router receives data streams 1-32 destined for servers inside the data center, the router performs load balancing on data streams 1-32, thereby forwarding data streams 1-16 to Spine switch 1 and data streams 17-32 to Spine switch 2.

[0087] However, since the router cannot know the network topology within the data center, there may be a situation where data streams 1-16 forwarded by the router to Spine switch 1 all have destination addresses of servers connected to Leaf switch 1. In this case, Spine switch 1 can only forward data streams 1-16 to Leaf switch 1. Given that the link between Spine switch 1 and Leaf switch 1 can only carry 8 data streams, congestion will occur when Spine switch 1 forwards data streams 1-16 to Leaf switch 1.

[0088] Similarly, if the destination addresses of data streams 17-32 are all servers connected to Leaf switch 2, Spine switch 2 can only forward data streams 17-32 to Leaf switch 1. Therefore, if the link between Spine switch 2 and Leaf switch 2 can only carry 8 data streams, congestion will occur when Spine switch 2 forwards data streams 17-32 to Leaf switch 2.

[0089] In view of this, this application provides a congestion handling method. During the forwarding of a data stream from a first network device to other network devices within a first network domain, the first network device can obtain information about congestion occurring in the forwarded data stream within the first network domain. Furthermore, based on the congestion information, the first network device can change the next-hop network device when forwarding the data stream, thereby altering the data stream forwarding path. In this way, by sensing the congestion status of the data stream and modifying the forwarding path, the first network device can adjust the forwarding path of congested data streams, thereby resolving the data stream congestion problem and improving data transmission efficiency.

[0090] Please see Figure 2 , Figure 2 This is a schematic diagram of a system architecture provided for this application. (For example...) Figure 2 As shown, the system architecture includes multiple data centers (e.g. Figure 2 The network comprises data centers 1-3, located in different network domains, and each data center is connected to routers outside the data centers. These routers are interconnected to enable data transmission between the data centers. When these routers need to send data streams to network devices within the data centers, they can employ the congestion handling method provided in this application to resolve congestion issues within the data centers.

[0091] It should be noted that, in Figure 2In the example shown, the network architecture within the data center is a Layer 2 network architecture consisting of Spine switches and Leaf switches. In practical applications, the network architecture within a data center can also be a Layer 3 network architecture consisting of core switches, aggregation switches, and access switches, or other types of network architectures; this application does not specifically limit this. Furthermore, Figure 2 This paper uses a data center as an example to introduce the system architecture. In some embodiments, the system architecture may also be composed of multiple other network domains. This application does not limit the specific type of network domain.

[0092] Please see Figure 3 , Figure 3 This is a flowchart illustrating a congestion handling method provided in this application. Figure 3 As shown, the congestion handling method includes the following steps 301-302.

[0093] Step 301: The first network device obtains data flow congestion information. The data flow congestion information is used to indicate that at least one data flow forwarded by the first network device is congested within the first network domain. The first network device is located outside the first network domain.

[0094] In this application, the first network device is located outside the first network domain, and the first network device forwards data streams into the first network domain. For example, the first network device is a boundary device of the first network domain, and the first network device forwards data streams to network devices within the first network domain. In the actual data forwarding process, the first network device may forward multiple data streams into the first network domain. When congestion occurs in the data streams forwarded by the first network device within the first network domain, the first network device can obtain data stream congestion information to indicate that at least one data stream forwarded by the first network device is congested within the first network domain. A data stream can be identified by a source address and a destination address. That is, if the source address and destination address of different data packets match the source address and destination address corresponding to a certain data stream, these data packets can be considered to belong to that data stream. Of course, a data stream can also be identified by a 5-tuple (i.e., source address, destination address, source port number, destination port, and transport layer protocol); this application does not limit the identification method of data streams.

[0095] There are multiple ways for the first network device to obtain data flow congestion information.

[0096] In one possible implementation, other network devices notify the first network device which specific data streams are congested.

[0097] Specifically, when data flow becomes congested, other network devices (such as the next-hop network device of the first network device) can notify the first network device of the congested data flow, so that the first network device can know which data flows it forwards are congested in the first network domain.

[0098] For example, a first network device may receive a first notification message from a fifth network device, wherein the first notification message is used to indicate that congestion has occurred in a first data flow. The first notification message may be, for example, an ECN message, the fifth network device is located within a first network domain, and the aforementioned at least one data flow includes the first data flow.

[0099] In another possible implementation, the next-hop network device of the first network device notifies the data stream received from the port of the first network device that there is congestion.

[0100] Specifically, if the next-hop network device of the first network device experiences congestion while forwarding data streams, the next-hop network device can send a feedback signal to the first network device, indicating that the data stream received from a certain port of the first network device is congested. In this way, the first network device can know which port it is forwarding the data stream from which congestion has occurred.

[0101] For example, a first network device receives a second notification message from a fifth network device. The second notification message indicates that congestion has occurred in the data stream received by the fifth network device from the target port of the first network device. The fifth network device is located within a first network domain, and at least one data stream includes the data stream received by the fifth network device from the target port of the first network device.

[0102] For example, the second notification message might be a PFC message, which indicates that the data flow of one or more priority queues received by the fifth network device from the target port of the first network device is congested. Therefore, by combining the PFC message with the data flow forwarded by the first network device from the target port, the first network device can determine which data flows are congested.

[0103] In general, the first network device can obtain data flow congestion information through various means, such as obtaining feedback from other network devices, and this application does not make specific limitations on this.

[0104] Step 302: The first network device changes the next-hop network device of the target data flow in at least one data flow, and the next-hop network device of the target data flow after the change is located in the first network domain.

[0105] After determining that at least one data flow is congested within the first network domain, the first network device may change the next-hop network device for forwarding the target data flow, thereby changing the forwarding path of the target data flow.

[0106] The target data flow may include one or more data flows. Furthermore, the target data flow may be a portion of the data flow in at least one congested data flow, or it may be all of the data flows in at least one congested data flow. That is, the first network device may be a next-hop network device that modifies a portion of the data flow in at least one congested data flow, or it may be a next-hop network device that modifies all of the data flows in at least one congested data flow.

[0107] For example, if the target data stream includes a first data stream, the first network device can change the next-hop network device of the first data stream from the second network device to the third network device. That is, the first network device originally forwarded the first data stream to the second network device, but after changing the next-hop network device of the first data stream, the first network device will forward the first data stream to the third network device.

[0108] Optionally, at least one of the aforementioned data flows experiencing congestion is a data flow from an Artificial Intelligence (AI) task (such as a model training task). The first network device changes the next-hop network device for forwarding the target data flow during the interruption of the target data flow. Generally, during the execution of an AI task, data flows between different network domains (such as different data centers) are sent intermittently. For example, a data center might train a model for a period of time before sending the obtained data to other data centers. Therefore, to reduce data packet loss when the target data flow changes its next-hop network device, the first network device can change the next-hop network device of the target data flow during the interruption of the target data flow. For example, if the first network device detects that it has not received any data packets belonging to the target data flow for a preset duration (such as 5 seconds or 1 minute), the first network device considers the target data flow to be interrupted, thereby triggering the change of the next-hop network device of the target data flow.

[0109] In this application, a first network device located outside the first network domain can connect to multiple network devices within the first network domain. Furthermore, to ensure that the load among the multiple network devices is as balanced as possible, the first network device typically forwards the received data streams to the multiple network devices as evenly as possible. That is, the multiple network devices connected to the first network device are used to distribute the load of the data streams forwarded by the first network device.

[0110] Therefore, when multiple network devices within the first network domain are responsible for load sharing of the first network device, there are two scenarios in which the first network device determines how to change the next-hop network device for the data flow.

[0111] In one possible scenario, the first network device directly determines the next-hop network device after the target data flow has been modified, based on the range of next-hop network devices that the target data flow can change.

[0112] In another possible scenario, the first network device determines the next-hop network device after the target data stream is changed by acquiring the expected transmission effect after the target data stream changes to the next-hop network device.

[0113] In other words, the first network device can first obtain the expected transmission effect of the target data stream after changing the next-hop network device, and then change the next-hop network device for the target data stream to one with a better expected transmission effect. Alternatively, the first network device may not need to obtain the expected transmission effect of the target data stream after changing the next-hop network device, but can directly adjust the next-hop network device of the target data stream to change the forwarding path of the target data stream.

[0114] Of course, if the first network device does not obtain the expected transmission effect after the target data stream changes the next-hop network device, the first network device may need to change the next-hop network device of the target data stream multiple times until the target data stream no longer experiences congestion in the first network domain.

[0115] For ease of understanding, the following will describe in detail how the first network device determines the next-hop network device after the target data flow is modified, based on the range of next-hop network devices that the target data flow can change.

[0116] Specifically, for a target data flow that experiences congestion within the first network domain, the first network device determines multiple data flows based on the target data flow, and these multiple data flows include the target data flow. Furthermore, all multiple data flows are data flows forwarded by the first network device to other network devices within the first network domain; that is, the multiple data flows belong to the data flows forwarded by the first network device to other network devices within the first network domain.

[0117] Then, based on the next-hop network devices before the changes to multiple data flows, the first network device changes the next-hop network device for each data flow in the multiple data flows, and the next-hop network devices after the changes to multiple data flows are located in the target device range, which includes the next-hop network devices before the changes to multiple data flows.

[0118] In other words, the first network device modifies the next-hop network device for each of the multiple data flows, thereby changing the forwarding paths of all data flows. Furthermore, the modification of the next-hop network device for each data flow is limited to the target device range comprised of the original next-hop network devices of the multiple data flows.

[0119] In this way, the first network device is equivalent to reallocating a new next-hop network device for multiple data streams, thereby adjusting the forwarding path of multiple data streams and helping to resolve the congestion of the target data stream in the first network domain.

[0120] It should be noted that if the first network device is already forwarding the received data streams to multiple network devices in the first network domain as evenly as possible, and the first network device simply forwards the congested target data stream to other next-hop network devices without changing the next-hop network devices of other data streams, it is easy to cause an imbalance in the data streams among the next-hop network devices connected to the first network device, which often makes it difficult to solve the data stream congestion problem.

[0121] However, in this application, by simultaneously adjusting the next-hop network devices of multiple data streams, it is equivalent to reallocating the forwarding paths of multiple data streams, rather than simply switching the congested target data stream to certain forwarding paths, which can effectively solve the problem of data stream congestion.

[0122] For example, please refer to Figure 4 , Figure 4 This is a schematic diagram of a next-hop network device for modifying data flow, as provided in this application. Figure 4 As shown, taking the data center as the first network domain and the router outside the data center as the first network device mentioned above, the router is connected to Spine switch 1 and Spine switch 2 inside the data center. Assume that the router receives data streams 1-10 that need to be sent to the server connected to Leaf1 inside the data center. At this time, the router forwards data streams 1-5 to Spine switch 1 and data streams 6-10 to Spine switch 2.

[0123] With data flows 1-4 occupying a total bandwidth of 8 gigabytes per second (Gbps) and data flow 5 occupying a total bandwidth of 3 Gbps, data flow 5 experiences congestion when forwarding data flows 1-5 to Leaf switch 1 because the maximum bandwidth of the link between Spine switch 1 and Leaf switch 1 is 10 Gbps. Furthermore, with data flows 6-10 occupying a total bandwidth of 9 Gbps, no data flow experiences congestion when forwarding data flows 6-10 to Leaf switch 1 because the maximum bandwidth of the link between Spine switch 2 and Leaf switch 1 is 10 Gbps.

[0124] At this point, if the router simply changes the next-hop network device for data flow 5 from Spine switch 1 to Spine switch 2, then Spine switch 2 will need to forward data flow 5-10 to Leaf switch 1. Since the total bandwidth occupied by data flow 5-10 is 12Gbps, while the maximum bandwidth of the link between Spine switch 2 and Leaf switch 1 is 10Gbps, data flow congestion will still occur when Spine switch 2 forwards data flow 5-10 to Leaf switch 1.

[0125] However, when performing the change of the next-hop network device based on the scheme described above in this application, the router can select data flow 5 and data flow 6 as the data flows for which the next-hop network device needs to be changed based on data flow 5. This changes the next-hop network device of data flow 5 from Spine switch 1 to Spine switch 2, and the next-hop network device of data flow 6 from Spine switch 2 to Spine switch 1. After completing the change of the next-hop network device, Spine switch 1 needs to forward data flows 1-4 and data flow 6 to Leaf switch 1, and Spine switch 2 needs to forward data flows 5 and data flows 7-10 to Leaf switch 1. Furthermore, since the total bandwidth occupied by data flows 1-4 and data flow 6 is 10Gbps, and the total bandwidth occupied by data flows 5 and 7-10 is also 10Gbps, data flow congestion no longer occurs within the data center.

[0126] Furthermore, there are multiple ways to determine the multiple data flows that need to be changed in the next-hop network device based on the target data flow that is experiencing congestion.

[0127] In one possible implementation, the target data flow comprises at least two data flows, and the multiple data flows requiring changes to the next-hop network device only include the target data flow. That is, when the target data flow comprises at least two data flows, the first network device only modifies the next-hop network device for the data flows included in the target data flow, without modifying the next-hop network devices for other data flows that are not congested. In this way, the first network device effectively swaps the next-hop network device for the congested data flows, thereby alleviating data flow congestion.

[0128] In this scheme, by adjusting only the next-hop network devices of the congested data streams and limiting the adjustment scope of the next-hop network devices of the congested data streams to the original next-hop network devices of these data streams, the impact on other non-congested data streams can be minimized. Thus, the congested data streams can be adjusted without affecting other non-congested data streams, ensuring the normal transmission of data streams as much as possible.

[0129] For example, please refer to Figure 5 , Figure 5 This application provides a schematic diagram illustrating how to adjust data flow within the scope of a next-hop network device where data flow congestion has occurred. For example... Figure 5 As shown, routers outside the data center are connected to Spine switches 1 through 4 within the data center. The routers send data streams 1 through 5 to Spine switch 1, data streams 6 through 10 to Spine switch 2, data streams 11 through 15 to Spine switch 3, and data streams 16 through 20 to Spine switch 4. In this scenario, congestion occurs when Spine switch 1 sends data stream 5 to Leaf switch 1, and when Spine switch 2 sends data stream 6 to Leaf switch 2. However, the data streams forwarded by Spine switches 3 and 4 do not experience congestion.

[0130] Based on the congested data flows 5 and 6, the router can determine the next-hop network device adjustment range (i.e., the target device range mentioned above) as Spine switch 1 and Spine switch 2. Thus, the router can change the next-hop network device for data flow 5 from Spine switch 1 to Spine switch 2, and change the next-hop network device for data flow 6 from Spine switch 2 to Spine switch 1. For Spine switches 3 and 4, which are not experiencing data flow congestion, the router will not adjust the data flows forwarded by these two Spine switches, thereby avoiding congestion in the data flows forwarded by Spine switches 3 and 4 after adjustment.

[0131] In another possible implementation, the multiple data flows that need to be modified in the next-hop network device may include the target data flow that is congested and the data flow forwarded by the first network device that is not congested in the first network domain.

[0132] In other words, in addition to the target data flow that has already experienced congestion, the first network device also determines that data flows that have not experienced congestion also require next-hop network device adjustment. For example, the first network device groups multiple network devices connected to it and located within the first network domain. When a data flow forwarded by a network device in any group becomes congested, then the network devices in the same group constitute the scope of next-hop network device adjustment for the data flow.

[0133] For example, please refer to Figure 6 , Figure 6 This application provides a schematic diagram illustrating the adjustment of data flow within a specified next-hop network device range. For example... Figure 6 As shown, the router is connected to Spine switches 1 through 6 within the data center. Furthermore, the router groups Spine switches 1 through 3 into one group and Spine switches 4 through 6 into another group.

[0134] The router sends data streams 1-5 to Spine switch 1, data streams 6-10 to Spine switch 2, and data streams 11-15 to Spine switch 3. In this scenario, congestion occurs when Spine switch 1 sends data stream 5 to Leaf switch 1, and congestion occurs when Spine switch 2 sends data stream 6 to Leaf switch 2. However, the data streams forwarded by Spine switch 3 do not experience congestion.

[0135] Based on the congested data flows 5 and 6, the router can determine that the next-hop network device adjustment range (i.e., the target device range mentioned above) is Spine switch 1, Spine switch 2, and Spine switch 3 within the same group. Thus, the router can change the next-hop network device for data flow 5 from Spine switch 1 to Spine switch 2, change the next-hop network device for data flow 6 from Spine switch 2 to Spine switch 3, and change the next-hop network device for data flow 11 from Spine switch 3 to Spine switch 1.

[0136] In other words, for Spine switch 3, which did not experience data flow congestion, the data flow forwarded by Spine switch 3 also underwent adjustments to the next-hop network device.

[0137] In summary, once the adjustment range of the next-hop network device (i.e., the target device range mentioned above) is determined, the modified next-hop network device can be selected for the data flow within the adjustment range, thereby realizing the change of the next-hop network device for the data flow.

[0138] Optionally, in order to quickly determine the next-hop network device after the data flow change, the first network device can be a circular sort of network devices within the target device range, thereby determining the next-hop network device after the data flow change based on the circular sorting result among the network devices.

[0139] For example, the first network device changes the next-hop network device of the first data stream from the second network device to the third network device based on the ring sorting result among network devices in the target device range. Here, the target data stream includes the first data stream, and in the ring sorting result, the second network device and the third network device are adjacent.

[0140] In other words, by performing a circular sort on the network devices within the target device range, the first network device can ensure that each network device within the target device range has two adjacent network devices. Thus, when it is necessary to change the next-hop network device of a data stream forwarded by any network device within the target device range, the next-hop network device of that data stream can be changed to the next network device adjacent to the current network device.

[0141] For example, suppose the target device range includes network devices 1 through 3. And in the circular sorting result, the next network device after network device 1 is network device 2, the next network device after network device 2 is network device 3, and the next network device after network device 3 is network device 1. Then, if the next-hop network device before the data flow change is network device 1, the next-hop network device of the data flow can be changed to network device 2; if the next-hop network device before the data flow change is network device 2, the next-hop network device of the data flow can be changed to network device 3; and if the next-hop network device before the data flow change is network device 3, the next-hop network device of the data flow can be changed to network device 1.

[0142] For example, please refer to Figure 7 , Figure 7 This is a schematic diagram illustrating a forwarding path for rearranging congested data streams, as provided in this application. Figure 7As shown, the router is connected to Spine switches 1 through 4 in the data center, and each of these switches is connected to Leaf switches 1 and 2. During router operation, the router forwards data streams to Spine switches 1 through 4. Congestion occurs in the data streams sent from Spine switch 1 to Leaf switch 1, from Spine switch 2 to Leaf switch 2, from Spine switch 3 to Leaf switch 1, and from Spine switch 4 to Leaf switch 2.

[0143] First, in the event of data flow congestion, Spine switches 1 through 4 respectively send congestion signals to the router to indicate that the data flows they are forwarding are congested. For example, Spine switches 1 through 4 may send PFC messages or ECN messages to the router to indicate the congested data flows.

[0144] Then, based on the congestion signals fed back by Spine switches 1 through 4, the router includes the congested data flows in the reordering set. The reordering set records data flows whose forwarding paths need to be rearranged; that is, all data flows in the reordering set require a change to their next-hop network device.

[0145] Secondly, for the data flows in the rearrangement set, the router forms a congestion flow-port mapping table based on the ring sorting result between Spine switches 1-4 and the outgoing ports of the forwarding data flows. In the congestion flow-port mapping table, the column identifiers in the table header (i.e., the Spine switches 1-4 represented by the first column) indicate the next-hop network device of the congested data flow, and the row identifiers in the table header (i.e., 1, 2, 3) indicate the number of the data flow heading to the specified next-hop network device. For example, in Figure 7 In the data flow-port mapping table shown, there are two congested data flows to Spine switch 1, which are forwarded from port 1 and port 2 respectively; there are two congested data flows to Spine switch 2, which are forwarded from port 3 and port 4 respectively; there are three congested data flows to Spine switch 3, which are forwarded from port 5, port 6 and port 7 respectively; and there are three congested data flows to Spine switch 4, which are forwarded from port 7, port 8 and port 8 respectively.

[0146] Given the established congestion flow-port mapping table, the router can use a round-robin algorithm based on the ring sorting results between Spine Switch 1 and Spine Switch 4 to rearrange the next-hop network device for the data flow. Specifically, the execution process of the round-robin algorithm can follow the following three principles.

[0147] (1) For the i-th flow destined for different Spine switches, a round-robin swap is performed in the congestion flow-port mapping table: the i-th flow originally destined for Spine switch j has its output port switched to the output port corresponding to the i-th flow originally destined for Spine switch j+1. Furthermore, the output port of the data flow originally destined for the last Spine switch is switched to the output port of the first Spine switch. For example, the first data flow originally destined for Spine switch 1 has its output port switched from port 1 to port 3, thus changing the next-hop network device of this data flow from Spine switch 1 to Spine switch 2. The first data flow originally destined for Spine switch 2 has its output port switched from port 3 to port 5, thus changing the next-hop network device of this data flow from Spine switch 2 to Spine switch 3. The first data flow originally destined for Spine switch 4 has its output port switched from port 7 to port 1, thus changing the next-hop network device of this data flow from Spine switch 4 to Spine switch 1.

[0148] (2) If there is an i-th flow going to Spine switch j, but no i-th flow going to Spine switch j+1, then skip Spine switch j+1 and continue to search for the i-th flow going to Spine switch j+2 to achieve round-robin switching.

[0149] (3) If there exists an i-th flow that only goes to a certain Spine switch j, and there are no other interchangeable objects, then first perform swapping and orchestration on the other data flows, and then randomly select one of the data flows going to other Spine switches to swap the output port with the current i-th flow. For example, in Figure 7 In the congestion flow-port mapping table shown, assuming that the third data flow to Spine switch 3 does not exist, then only the third data flow to Spine switch 4 exists. At this time, the third data flow to Spine switch 4 can wait for the first and second data flows to different Spine switches to complete their orchestration before swapping ports with one of the data flows.

[0150] Finally, after completing the port swapping of all congested data flows, the router has rearranged the forwarding paths of the data flows. This allows the router to distribute the rearranged data flow results to the forwarding plane, where the outgoing ports of the data flows can be changed. Specifically, for each congested data flow, the ports before and after the data flow change can be found in [reference needed]. Figure 7 The port switching strategy is shown below. Spine switch 1-1 represents the first data flow to Spine switch 1, Spine switch 1-2 represents the second data flow to Spine switch 1, Spine switch 2-1 represents the first data flow to Spine switch 2, and so on…

[0151] It should be noted that when using a round-robin algorithm to rearrange the next-hop network devices of a data flow, if data flow congestion still occurs after the changes to the next-hop network devices, the round-robin algorithm can be used to continue rearranging the next-hop network devices for the congested data flow. In other words, as long as data flow congestion persists, the router iteratively executes... Figure 7 The four steps shown continue until the congested data flow is cleared or the number of iterations reaches an upper limit, where the upper limit can be the number of Spine switches connected to the router.

[0152] The above describes how the first network device directly determines the next-hop network device after the target data stream has been modified, based on the range of next-hop network devices that can be changed according to the target data stream. The following will detail how the first network device determines the next-hop network device after the target data stream has been modified by obtaining the expected transmission effect.

[0153] Specifically, after detecting a congested data flow, the first network device can obtain the expected transmission effect of the congested data flow on other forwarding paths based on the destination address of the congested data flow, and then decide how to change the next-hop network device of the congested data flow.

[0154] For example, for a target data stream that requires a change in its next-hop network device, the first network device sends a first message to the target network device. This first message is used to obtain the transmission quality of the target path, which is the path from the target network device to the destination address of the target data stream. In other words, if the next-hop network device of the target data stream is changed to the target network device, then the forwarding path of the target data stream becomes the target path. Therefore, the first network device determines the expected transmission effect of the target data stream after changing its next-hop network device by obtaining the transmission quality of the target path.

[0155] Furthermore, based on the transmission quality of the acquired target path, the first network device determines to change the next-hop network device for forwarding the target data stream to the target network device. Specifically, if the transmission quality of the target path meets the preset transmission requirements, it means that the expected transmission effect after changing the next-hop network device of the target data stream to the target network device is better. Therefore, the first network device can change the next-hop network device of the target data stream to the target network device.

[0156] In this scheme, for a target data stream that is congested, the first network device obtains the expected transmission effect of the target data stream on other forwarding paths in advance. This allows the first network device to know in advance whether the target data stream will still be congested after changing the next-hop network device, thereby ensuring that the target data stream will no longer be congested after changing the next-hop network device, and realizing the one-time adjustment of the next-hop network device of the target data stream.

[0157] Specifically, based on the transmission quality of the acquired target path, the first network device determines that the next-hop network device for forwarding the target data stream can be changed to the target network device in two possible ways.

[0158] In one possible scenario, the first network device acquires the transmission quality of the target data stream along its path before the next-hop network device is changed. In response to the fact that the transmission quality of the target path is superior to that of the target data stream along its path before the next-hop network device is changed, the first network device determines that the next-hop network device for forwarding the target data stream should be changed to the target network device.

[0159] The transmission quality of a path can be measured by metrics such as path transmission delay, path packet loss rate, and link utilization within the path. This application does not specify how to measure path transmission quality. Taking path transmission delay as an example, to obtain the transmission quality of a target path, the first message sent by the first network device to the target network device can be a delay probe message, the destination address of which is the same as the destination address of the target data stream. Based on the delay probe message, the first network device can obtain the transmission delay from the delay probe message to the destination address, thereby obtaining the transmission quality of the target path.

[0160] In other words, if the transmission quality of the target data flow is better after the target data flow changes its next-hop network device than the transmission path before the target data flow changes its next-hop network device, then the first network device can determine to change the next-hop network device of the target data flow, thereby alleviating the congestion problem after the target data flow changes its next-hop network device.

[0161] In another possible scenario, in response to the transmission quality of the target path meeting preset conditions, the first network device determines to change the next-hop network device when forwarding the target data stream to the target network device.

[0162] Specifically, if the transmission quality of the target path meets the preset conditions, the first network device believes that the expected transmission effect of the target path is good (i.e., the target data stream will not be congested after the next-hop network device is changed). Therefore, the first network device can determine to change the next-hop network device when forwarding the target data stream to the target network device.

[0163] The aforementioned preset conditions are determined based on the method of measuring the transmission quality of the target path, and this application does not limit the specific implementation of the preset conditions. For example, when the transmission quality of the target path is determined by the transmission delay of the target path, the preset condition is that the transmission delay of the target path is not greater than a preset delay value. As another example, when the transmission quality of the target path is determined by the packet loss rate of the target path, the preset condition is that the packet loss rate of the target path is not greater than a preset packet loss rate. Yet another example, when the transmission quality of the target path is determined by the utilization rate of the links in the target path, the preset condition is that the utilization rate of the links in the target path is not greater than a preset utilization rate.

[0164] Optionally, in order to find the optimal forwarding path for the target data stream, the first network device can obtain the expected transmission effect of the target data stream on multiple paths, and then select one of the paths as the new forwarding path for the target data stream to determine the next-hop network device after the target data stream is changed.

[0165] For example, based on the destination address of the target data stream, a first network device forwards multiple quality acquisition messages. These multiple quality acquisition messages are forwarded to different network devices among multiple network devices in a first network domain, and are used to acquire the transmission quality of multiple paths. The multiple paths include paths from the multiple network devices to the destination address of the target data stream, and the multiple network devices include the target network device. That is, the first network device acquires the transmission quality of the target data stream when it is forwarded on multiple different paths by forwarding multiple quality acquisition messages.

[0166] Thus, based on the transmission quality of multiple paths obtained, the first network device determines to change the next-hop network device for forwarding the target data stream to the target network device. For example, the path corresponding to the target network device is the path with the best transmission quality among multiple paths.

[0167] In this scheme, the first network device can select one of the paths as the subsequent forwarding path for the congested data flow by acquiring and comparing the expected transmission effect of the congested data flow on multiple paths. This allows it to determine how to change the next-hop network device of the congested data flow, ensuring that changing the next-hop network device can effectively alleviate the congestion problem and improve the transmission speed of the data flow.

[0168] Optionally, in the above embodiments, the at least one data flow experiencing congestion in the first network domain can specifically be multiple data flows. Before changing the next-hop network device of the data flows, the first network device first determines a range of forwarding ports, wherein the range of forwarding ports includes multiple ports used by the first network device to forward multiple data flows.

[0169] When changing the next-hop network device of the target data flow, the first network device changes the forwarding port of the target data flow, thereby changing the next-hop network device of the target data flow. Furthermore, the forwarding port of the target data flow after the change falls within the aforementioned range of forwarding ports. Additionally, the network device connected to the forwarding port of the target data flow after the change is different from the network device connected to the forwarding port before the change.

[0170] For example, suppose the first network device has ports 1 through 8, and multiple data streams experiencing congestion are forwarded through ports 1 through 4. Then, the first network device can determine that ports 1 through 4 are the range of forwarding ports, and then select a new forwarding port for the target data stream from among ports 1 through 4.

[0171] Specifically, for the same network device in the first network domain, the first network device may send data streams through multiple ports, but only some of these ports experience congestion. Therefore, to avoid affecting other data streams forwarded by non-congested ports, the first network device first determines the range of forwarding ports where data streams are congested, and then changes the forwarding ports of the data streams based on this range, thereby reducing the impact of changing the forwarding ports on other non-congested data streams.

[0172] For example, please refer to Figure 8 , Figure 8 This application provides a schematic diagram of a forwarding path reordering method for congested data streams based on path delay. (See diagram below.) Figure 8As shown, the router is connected to Spine switches 1 through 4 in the data center, and each of these switches is connected to Leaf switches 1 and 2. During router operation, the router forwards data streams to Spine switches 1 through 4. Congestion occurs in the data stream sent from Spine switch 1 to Leaf switch 1, and in the data stream sent from Spine switch 2 to Leaf switch 2.

[0173] First, in the event of data flow congestion, Spine Switch 1 and Spine Switch 2 respectively send congestion signals to the router to indicate that the data flow they are forwarding is congested.

[0174] Then, based on the congestion signals fed back by Spine Switch 1 to Spine Switch 2, the router includes the congested data streams into the rearrangement set.

[0175] Secondly, for each data flow in the rearranged set, the router constructs a latency probe message and sends it to the corresponding next-hop network device within the forwarding port range. For example... Figure 8 As shown, data flows 1 and 2 sent by the router to Spine switch 1 via port 1 experience congestion, and data flows 3 and 4 sent by the router to Spine switch 2 via port 4 experience congestion. Therefore, the router can determine that the forwarding port range is port 1 and port 4. For data flow 1, the router can construct delay probe packets 1-1 and 1-2. Compared to data flow 1, the source port number, destination address, destination port number, and transport layer protocol of delay probe packets 1-1 and 1-2 remain unchanged. The source address of delay probe packet 1-1 is the router's address; the source address of delay probe packet 1-2 is also the router's address. Furthermore, delay probe packet 1-1 is sent to Spine switch 1 via port 1 to obtain the round-trip time 1 (i.e., the time from the router to the destination address of data flow 1 via Spine switch 1) from the router. Figure 8 The round-trip time (RTT) is 20 microseconds. Since the return latency from the destination address of data stream 1 to the router is very low, the RTT 1 can be considered equivalent to the transmission latency from the router to the destination address of data stream 1. Similarly, latency probe packets 1-2 are sent to Spine switch 2 via port 4 to obtain the RTT 2 from the router through Spine switch 2 to the destination address of data stream 1 (i.e., the RTT 2). Figure 8 (10 microseconds in the middle).

[0176] Similarly, for data streams 2-4, the router can construct corresponding latency probe packets based on the above method to obtain the transmission latency when the router forwards data streams 2-4 through Spine switch 1 and Spine switch 2.

[0177] Finally, after obtaining the transmission latency of each data stream as it is forwarded through each port, the router uses a pre-set reordering algorithm to determine the changed forwarding port for each data stream, thereby changing the next-hop network device for the data stream.

[0178] The following section will use a graph-based reordering algorithm as an example to illustrate how to determine the changed forwarding port for each data stream based on the transmission latency when the data stream is forwarded through each port.

[0179] Specifically, the execution process of the graph model-based reordering algorithm requires the initial establishment of the graph model. In the process of establishing the graph model, it consists of nodes and directed edges. Each node in the graph model represents a congested data flow forwarded on a port of the router, and the weight of the node represents the original transmission delay of the data flow. The directed edges between nodes represent the switching of the data flow from one port to another, and the weight of the directed edge represents the transmission delay of the data flow after the port switch.

[0180] When implementing data flow reordering based on a pre-established graph model, the following constraints must be met: the out-degree and in-degree of each node are equal and do not exceed 1. Here, the out-degree of a node represents the number of directed edges emanating from the node, and the in-degree represents the number of directed edges pointing to the node. In other words, when a data flow forwarded by one port on a router is redirected to another port, another data flow must be swapped in to fill the port vacancy originally occupied by the current data flow. That is, the number of data flows forwarded by each port remains unchanged.

[0181] Furthermore, the optimization objective of the graph-based reordering algorithm is: Min(∑ directed edge weights + ∑ node weights with in-degree and out-degree of 0). That is, the optimization objective is to minimize the total transmission delay after the data stream switches ports.

[0182] Based on the established graph model, constraints, and optimization objectives, the router can use a graph-based greedy search algorithm (i.e., traversing every possible combination) to search for data flow reordering schemes, thereby determining the forwarding port for each data flow after modification.

[0183] For example, please refer to Figure 9 , Figure 9 This application provides a schematic diagram of a forwarding port for reorganizing data streams based on a graph model. For example... Figure 9As shown in Figure 8, based on the data flow congestion scenario, the graph model includes nodes 1-1, 1-2, 4-3, and 4-4. Node 1-1 represents data flow 1 forwarded from router port 1, node 1-2 represents data flow 2 forwarded from router port 2, node 4-3 represents data flow 3 forwarded from router port 4, and node 4-4 represents data flow 4 forwarded from router port 4. Furthermore, the weight of each node in nodes 1-1, 1-2, 4-3, and 4-4 is 20, representing that the original transmission delay of data flows 1 through 4 is 20 milliseconds. After performing re-arrangement based on the above re-arrangement algorithm, the optimal re-arrangement scheme is as follows: Node 1-1 points to Node 4-3 (i.e., data flow 1 switches from port 1 to port 4); Node 4-3 points to Node 1-2 (i.e., data flow 3 switches from port 4 to port 1); Node 1-2 points to Node 4-4 (i.e., data flow 2 switches from port 1 to port 4); Node 4-4 points to Node 1-1 (i.e., data flow 4 switches from port 4 to port 1). Before re-arrangement, the original total transmission delay of the data flow was 20 + 20 + 20 + 20 = 80; after re-arrangement, the total transmission delay of the re-arranged data flow is 5 + 5 + 10 + 10 = 30. Clearly, by re-arranging the forwarding ports of the data flow using the above re-arrangement algorithm, the transmission delay of the data flow can be effectively shortened, resolving the data flow congestion problem.

[0184] The above describes how the first network device determines the next-hop network device for a congested target data stream. However, in some scenarios, besides the first network device, other network devices outside the first network domain may connect to network devices within the first network domain, thus sending data streams to those devices. When these other network devices outside the first network domain send data streams to network devices within the first network domain, these data streams may also become congested within the first network domain. Therefore, these other network devices often need to change the next-hop network device for the congested data stream. To avoid distributed convergence oscillations caused by multiple network devices outside the first network domain simultaneously adjusting the next-hop network device of a data stream, this application proposes that multiple network devices outside the first network domain use synchronous notification messages to take turns adjusting the next-hop network device of the data stream.

[0185] For example, please refer to Figure 10 , Figure 10 This is a schematic diagram of a system architecture provided for this application. (For example...) Figure 10As shown, the data center includes Spine switches 1-4 and Leaf switches 1 and 2, while the area outside the data center includes routers 1-3. Routers 1-3 are all connected to and send data streams to Spine switches 1-4. In this system architecture, data streams sent by routers 1-3 into the data center may experience congestion, requiring routers 1-3 to adjust their next-hop network devices. In this case, routers 1-3 can take turns adjusting the next-hop network devices to avoid continued congestion even after adjusting the next-hop network devices.

[0186] Optionally, after the first network device changes the next-hop network device for forwarding the target data flow, the first network device sends a first notification message to the fourth network device. The first notification message instructs the fourth network device to begin adjusting the next-hop network device for the data flow. Here, the fourth network device is located outside the first network domain, while the destination address of the data flow forwarded by the fourth network device is located within the first network domain.

[0187] In other words, after the first network device completes the adjustment of the next-hop network device for the congested data flow, it notifies another network device outside the first network domain (i.e., the fourth network device) to start adjusting the next-hop network device for the data flow. This allows multiple network devices outside the first network domain to take turns adjusting the next-hop network device for the data flow, avoiding the phenomenon of invalid data flow adjustment.

[0188] Optionally, the first network device triggers the change of the next-hop network device when the data flow adjustment conditions are met.

[0189] The data flow adjustment conditions include either the first network device performing data flow adjustment in the first set of devices being the first in the order, or the first network device receiving a second notification message. The first set of devices includes multiple network devices outside the first network domain that require data flow adjustment as the next-hop network device (such as the first network device and the fourth network device mentioned above). The second notification message instructs the first network device to begin performing next-hop network device adjustment for the data flow.

[0190] In other words, for multiple network devices outside the first network domain that need to adjust the data flow, there is a pre-defined data flow adjustment order among these network devices. If the data flow adjustment order of the first network device is first, then the first network device can directly trigger the next-hop network device to adjust the data flow; if the data flow adjustment order of the first network device is not first, then the first network device will trigger the next-hop network device to adjust the data flow only after receiving a notification message from other network devices.

[0191] Specifically, in order to facilitate the rotation of the next-hop network device for data flow among multiple network devices, each network device can maintain its own local congestion flow reordering state (hereinafter referred to as reordering state) and determine whether to trigger the adjustment of the next-hop network device for data flow based on the migration between reordering states.

[0192] For example, please refer to Figure 11 , Figure 11 This is a schematic diagram illustrating the transition between rearranged states provided in this application. Figure 11 As shown, the reordering state maintained by the network device includes three states, represented by 0, 1, and 2 respectively. 0 indicates flow reordering is in progress; 1 indicates flow reordering is active and awaiting execution; and 2 indicates flow reordering is inactive. The transition relationships between the three states are described below.

[0193] 1. All network devices outside the first network domain are initialized and rearranged to state 2.

[0194] 2. If the network device obtains data flow congestion information (i.e., the data flow forwarded by the network device is congested in the first network domain), then the network device will update the reordering state from state 2 to state 1, thereby entering the flow reordering active state, but will not perform task flow reordering actions.

[0195] 3. After the network device's reordering state is updated from state 2 to state 1, if the network device is the first device to adjust the data flow (e.g., the network device's identifier is the smallest among all network devices outside the first network domain), or if the network device receives a signal from another network device to start adjusting the data flow, then the network device will update its reordering state from state 1 to state 0, thereby starting to change the next-hop network device for the congested data flow.

[0196] 4. After the next-hop network device of the data flow has been modified (for example, the network device has changed the forwarding port of the data flow in the forwarding plane), the network device will update the rearrangement state from state 0 to state 1.

[0197] 5. After the network device's rearrangement state is updated from state 0 to state 1, if the network device is the last device to adjust the data flow (for example, the network device's identifier is the largest among all network devices outside the first network domain), or if the network device receives a signal from other network devices to end the data flow adjustment, then the network device will update its rearrangement state from state 1 to state 2, thereby ending this round of collaborative turn-based data flow adjustment.

[0198] For example, please refer to Figure 12 , Figure 12 This is a schematic diagram illustrating how routers 1 through 3 take turns performing data flow rearrangement, as provided in this application. Figure 12 As shown, the process of data flow rearrangement performed alternately by routers 1 to 3 includes the following steps 1-5.

[0199] Step 1: Router 1 to Router 3 detects data flow congestion and sets the rearrangement state to state 1.

[0200] Specifically, routers 1 through 3 are initially in state 2. When routers 1 through 3 detect data flow congestion, they reset their reordering state to state 1. Furthermore, after detecting data flow congestion, routers 1 through 3 can synchronize their own data flow congestion status, allowing each router to identify which routers need to perform data flow reordering.

[0201] Step 2: The router with the smallest router identifier sets the rearranged state to state 0.

[0202] After the rearrangement state is set to state 1 and the routers have synchronized the data flow congestion, the router with the smallest router identifier (such as router 1) can confirm that it is the first device to adjust the data flow, and thus set the rearrangement state to 0.

[0203] This embodiment uses the router with the smallest router identifier as the first device to adjust the data flow. In practical applications, the order in which routers adjust the data flow can also be determined based on other methods.

[0204] Step 3: The router in state 0 performs data flow rearrangement and sends a start signal to the next router after completion.

[0205] In addition, after a router in state 0 completes the data flow rearrangement, it sets the rearrangement state to state 1.

[0206] For example, in Figure 12 In the process, after router 1 completes the data flow rearrangement, it sends a notification message (i.e., a start signal) to router 2. This notification message is used to instruct router 2 to start performing data flow rearrangement.

[0207] Step 4: After receiving the start signal, the router in state 1 performs data flow rearrangement and sends the start signal to the next router after completion.

[0208] For example, in Figure 12 In this process, after receiving the start signal from router 1, router 2 begins to perform data flow rearrangement. Furthermore, after completing the data flow rearrangement, router 2 sends a start signal to router 3 to instruct router 3 to begin performing data flow rearrangement.

[0209] Step 5: After the router with the largest router identifier completes the data flow rearrangement, it sends an end signal to the other routers so that all routers set the rearrangement state to state 2.

[0210] For example, after completing the data flow rearrangement, router 3 sends an end signal to routers 1 and 2 to indicate that the data flow rearrangement for the current round is complete. In this way, routers 1 through 3 will all set their rearrangement state to state 2.

[0211] In addition, after the router switches the reordering state from state 1 to state 2, it increments the flow reordering round count by 1, and starts a count update interval timer (e.g., every 5 minutes) after each update. If the timer expires and the count has not been updated, the count is reset to 0, indicating that all congested data flows have been eliminated before the reordering round limit was reached. If the flow reordering round count reaches the limit, a flow reordering interval timer (e.g., every 15 minutes) is started. No flow reordering operations are performed before the timer expires, and the flow reordering round count is reset to 0 after the timer expires.

[0212] In summary, during each round of reordering, the routers that detect data flow congestion perform flow reordering in turn according to steps 1-5 above, until all congested data flows are eliminated or the maximum number of flow reordering rounds is reached.

[0213] The congestion handling method provided in this application has been described in detail above. The following section will introduce the device used to perform the congestion handling method.

[0214] Please see Figure 13 , Figure 13 This is a schematic diagram of a congestion handling device provided in this application. Figure 13As shown, the congestion processing device is deployed on the first network device, and the congestion processing device includes: a transceiver module 1301, used to acquire data flow congestion information, the data flow congestion information being used to indicate that at least one data flow forwarded by the first network device is congested within the first network domain, the first network device being located outside the first network domain; and a processing module 1302, used to change the next-hop network device for forwarding the target data flow in at least one data flow, and the next-hop network device after the target data flow is changed is located within the first network domain.

[0215] In one possible implementation, the processing module 1302 is further configured to: determine multiple data flows based on the target data flow, the multiple data flows including the target data flow; modify the next-hop network device of each data flow in the multiple data flows, and the modified next-hop network device of the multiple data flows is located within the target device range, the target device range including the next-hop network device of the multiple data flows before the modification.

[0216] In one possible implementation, the target data stream includes at least two data streams, while multiple data streams include only the target data stream.

[0217] In one possible implementation, the multiple data streams also include data streams forwarded by the first network device that are not congested within the first network domain.

[0218] In one possible implementation, the processing module 1302 is further configured to: change the next-hop network device of the first data stream from the second network device to the third network device according to the ring sorting result among network devices in the target device range; wherein the target data stream includes the first data stream, and in the ring sorting result, the second network device and the third network device are adjacent.

[0219] In one possible implementation, the transceiver module 1301 is further configured to send a first message to the target network device, the first message being used to obtain the transmission quality of the target path, the target path being the path from the target network device to the destination address of the target data stream; the processing module 1302 is further configured to determine, based on the obtained transmission quality of the target path, to change the next-hop network device for forwarding the target data stream to the target network device.

[0220] In one possible implementation, the transceiver module 1301 is further configured to acquire the transmission quality of the transmission path of the target data stream before changing the next-hop network device; the processing module 1302 is further configured to determine, in response to the transmission quality of the target path being better than the transmission quality of the transmission path, to change the next-hop network device when forwarding the target data stream to the target network device.

[0221] In one possible implementation, the processing module 1302 is further configured to: in response to the transmission quality of the target path meeting preset conditions, determine to change the next-hop network device when forwarding the target data stream to the target network device.

[0222] In one possible implementation, the transceiver module 1301 is further configured to forward multiple quality acquisition messages, which are respectively forwarded to different network devices among multiple network devices in the first network domain. The multiple quality acquisition messages are used to acquire the transmission quality of multiple paths, which include paths from multiple network devices to the destination address of the target data stream, and the multiple network devices include the target network device. The processing module 1302 is further configured to determine, based on the acquired transmission quality of the multiple paths, to change the next-hop network device for forwarding the target data stream to the target network device.

[0223] In one possible implementation, the transceiver module 1301 is further configured to send a first notification message to a fourth network device after the processing module 1302 changes the next-hop network device of the target data stream in at least one data stream. The first notification message is used to instruct the fourth network device to start performing next-hop network device adjustment for the data stream. The fourth network device is located outside the first network domain, and the destination address of the data stream forwarded by the fourth network device is located within the first network domain.

[0224] In one possible implementation, the processing module 1302 is the next-hop network device that triggers a change in the forwarding target data flow when it is determined that the data flow adjustment conditions are met.

[0225] In one possible implementation, the data flow adjustment conditions include the first network device performing data flow adjustment in the first set of devices in the order of first, or the first network device receiving a second notification message; wherein the first set of devices includes multiple network devices outside the first network domain; and the second notification message is used to instruct the first network device to begin performing next-hop network device adjustment of the data flow.

[0226] In one possible implementation, the transceiver module 1301 is further configured to receive a first notification message from a fifth network device, the first notification message being used to indicate that a first data stream is congested; wherein the fifth network device is located within a first network domain, and at least one data stream includes the first data stream.

[0227] In one possible implementation, the transceiver module 1301 is further configured to receive a second notification message from the fifth network device, the second notification message being used to indicate that the data stream received by the fifth network device from the target port of the first network device is congested; wherein the fifth network device is located within the first network domain, and at least one data stream includes the data stream received by the fifth network device from the target port of the first network device.

[0228] In one possible implementation, at least one data stream is multiple data streams, and the processing module 1302 is further configured to: determine a forwarding port range, the forwarding port range including multiple ports of the first network device that forward multiple data streams; change the forwarding port of the target data stream, and the changed forwarding port of the target data stream belongs to the forwarding port range.

[0229] In one possible implementation, at least one data stream is a data stream for an AI task, and the processing module 1302 changes the next-hop network device that forwards the target data stream during an interruption of the target data stream.

[0230] Please see Figure 14 , Figure 14 This is a schematic diagram of the structure of a network device provided in this application. The network device is equipped with the above-mentioned... Figure 13 The congestion handling device, network equipment is implemented using a general bus architecture.

[0231] The network device includes at least one processor 1401, a communication bus 1402, a memory 1403, and at least one communication interface 1404.

[0232] Optionally, the processor 1401 is a general-purpose CPU, NP, microprocessor, or one or more integrated circuits for implementing the solutions of this application, such as application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0233] The communication bus 1402 is used to transmit information between the aforementioned components. The communication bus 1402 includes an address bus, a data bus, and a control bus. For ease of representation, only one thick line is used in the figure, but this does not indicate that there is only one bus or one type of bus.

[0234] Optionally, memory 1403 is read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions. Alternatively, memory 1403 is random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions. Alternatively, memory 1403 is electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but not limited to these. Optionally, memory 1403 exists independently and is connected to processor 1401 via communication bus 1402. Optionally, memory 1403 and processor 1401 are integrated together.

[0235] Communication interface 1404 uses any transceiver-like device for communicating with other devices or communication networks. Communication interface 1404 includes a wired communication interface. Optionally, communication interface 1404 also includes a wireless communication interface. The wired communication interface is, for example, an Ethernet interface. The Ethernet interface is an optical interface, an electrical interface, or a combination thereof. The wireless communication interface is a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof, etc.

[0236] In a specific implementation, as one example, the processor 1401 includes one or more CPUs, such as... Figure 14 CPU0 and CPU1 are shown in the diagram.

[0237] In a specific implementation, as one example, the network device includes multiple processors, such as... Figure 14 The processors 1401 and 1405 shown are examples of processors. Each of these processors is either a single-core processor (CPU) or a multi-core processor (CPU). Here, a processor refers to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0238] In some embodiments, memory 1403 is used to store program code 1406 that executes the scheme of this application, and processor 1401 executes the program code 1406 stored in memory 1403. That is, the network device implements the above-described method embodiments through processor 1401 and program code 1406 in memory 1403.

[0239] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. Wherein, "A refers to B" means that A is the same as B or A is a simple variation of B.

[0240] The terms "first" and "second," etc., used in the specification and claims of this application are used to distinguish different objects, not to describe a specific order of objects, and should not be construed as indicating or implying relative importance. For example, "first speed limit lane" and "second speed limit lane" are used to distinguish different speed limit lanes, not to describe a specific order of speed limit lanes, and should not be construed as the first speed limit lane being more important than the second speed limit lane.

[0241] In the embodiments of this application, unless otherwise stated, "at least one" means one or more, and "multiple" means two or more.

[0242] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0243] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A congestion handling method, characterized in that, include: The first network device acquires data flow congestion information, which is used to indicate that at least one data flow forwarded by the first network device is congested within a first network domain, and the first network device is located outside the first network domain. The first network device changes the next-hop network device that forwards the target data stream in the at least one data stream, and the next-hop network device after the target data stream is changed is located within the first network domain.

2. The method according to claim 1, characterized in that, The first network device modifies the next-hop network device that forwards the target data stream in the at least one data stream, including: The first network device determines multiple data streams based on the target data stream, and the multiple data streams include the target data stream; The first network device changes the next-hop network device for each of the plurality of data flows, and the next-hop network devices after the changes are located within the target device range, which includes the next-hop network devices before the changes.

3. The method according to claim 2, characterized in that, The target data stream includes at least two data streams, and the plurality of data streams include only the target data stream.

4. The method according to claim 2, characterized in that, The plurality of data streams also includes data streams forwarded by the first network device that are not congested within the first network domain.

5. The method according to any one of claims 2-4, characterized in that, The first network device modifies the next-hop network device for forwarding each of the plurality of data streams, including: The first network device changes the next-hop network device of the first data stream from the second network device to the third network device based on the circular sorting result among network devices in the target device range; The target data stream includes the first data stream, and in the circular sorting result, the second network device is adjacent to the third network device.

6. The method according to claim 1, characterized in that, The method further includes: The first network device sends a first message to the target network device. The first message is used to obtain the transmission quality of the target path, where the target path is the path from the target network device to the destination address of the target data stream. Based on the obtained transmission quality of the target path, the first network device determines to change the next-hop network device for forwarding the target data stream to the target network device.

7. The method according to claim 6, characterized in that, Based on the obtained transmission quality of the target path, the first network device determines to change the next-hop network device for forwarding the target data stream to the target network device, including: The first network device acquires the transmission quality of the target data stream along the transmission path before changing the next-hop network device; In response to the fact that the transmission quality of the target path is better than that of the transmission path, the first network device determines to change the next-hop network device when forwarding the target data stream to the target network device.

8. The method according to claim 6, characterized in that, Based on the obtained transmission quality of the target path, the first network device determines to change the next-hop network device for forwarding the target data stream to the target network device, including: In response to the transmission quality of the target path meeting preset conditions, the first network device determines to change the next-hop network device when forwarding the target data stream to the target network device.

9. The method according to claim 1, characterized in that, The method further includes: The first network device forwards multiple quality acquisition messages, which are respectively forwarded to different network devices among multiple network devices in the first network domain. The multiple quality acquisition messages are used to acquire the transmission quality of multiple paths, which include paths from the multiple network devices to the destination address of the target data stream, and the multiple network devices include the target network device. Based on the transmission quality of the multiple paths obtained, the first network device determines to change the next-hop network device for forwarding the target data stream to the target network device.

10. The method according to any one of claims 1-9, characterized in that, After the first network device changes the next-hop network device that forwards the target data flow in the at least one data flow, the method further includes: The first network device sends a first notification message to the fourth network device, the first notification message being used to instruct the fourth network device to begin performing next-hop network device adjustment of the data flow; The fourth network device is located outside the first network domain, and the destination address of the data stream forwarded by the fourth network device is located within the first network domain.

11. The method according to claim 10, characterized in that, The first network device is the next-hop network device that triggers a change when forwarding the target data flow, provided that the data flow adjustment conditions are met.

12. The method according to claim 11, characterized in that, The data flow adjustment conditions include the first network device performing data flow adjustment in the first device set in the first order, or the first network device receiving a second notification message; The first set of devices includes multiple network devices outside the first network domain; the second notification message is used to instruct the first network device to begin performing next-hop network device adjustments for the data flow.

13. The method according to any one of claims 1-12, characterized in that, The at least one data stream may be multiple data streams, and the next-hop network device when the first network device changes the forwarding of the target data stream in the at least one data stream includes: The first network device determines a range of forwarding ports, which includes multiple ports on the first network device that forward the multiple data streams; The first network device changes the forwarding port of the target data stream, and the changed forwarding port of the target data stream is within the range of forwarding ports.

14. The method according to any one of claims 1-13, characterized in that, The at least one data stream is a data stream for an artificial intelligence (AI) task, and the first network device is the next-hop network device that changes the forwarding of the target data stream during the interruption of the target data stream.

15. A congestion handling apparatus, characterized in that, The device is deployed on a first network device, and the device includes: The transceiver module is used to acquire data flow congestion information, which is used to indicate that at least one data flow forwarded by the first network device is congested within a first network domain, and the first network device is located outside the first network domain. The processing module is configured to change the next-hop network device that forwards the target data flow in the at least one data flow, wherein the changed next-hop network device is located within the first network domain.

16. The apparatus according to claim 15, characterized in that, The processing module is further configured to: Multiple data streams are determined based on the target data stream, and the multiple data streams include the target data stream; The next-hop network device for forwarding each of the multiple data flows is changed, and the changed next-hop network device for the multiple data flows is located within the target device range, which includes the next-hop network device before the multiple data flows were changed.

17. The apparatus according to claim 16, characterized in that, The target data stream includes at least two data streams, and the plurality of data streams include only the target data stream.

18. The apparatus according to claim 16, characterized in that, The plurality of data streams also includes data streams forwarded by the first network device that are not congested within the first network domain.

19. The apparatus according to any one of claims 16-18, characterized in that, The processing module is further configured to: Based on the circular sorting result among network devices in the target device range, the next-hop network device of the first data stream is changed from the second network device to the third network device; The target data stream includes the first data stream, and in the circular sorting result, the second network device is adjacent to the third network device.

20. The apparatus according to claim 15, characterized in that, The transceiver module is further configured to send a first message to the target network device, the first message being used to obtain the transmission quality of the target path, the target path being the path from the target network device to the destination address of the target data stream; The processing module is further configured to determine, based on the acquired transmission quality of the target path, to change the next-hop network device for forwarding the target data stream to the target network device.

21. The apparatus according to claim 20, characterized in that, The transceiver module is also used to obtain the transmission quality of the target data stream along the transmission path before changing the next-hop network device; The processing module is further configured to, in response to the fact that the transmission quality of the target path is better than the transmission quality of the transmission path, determine to change the next-hop network device when forwarding the target data stream to the target network device.

22. The apparatus according to claim 20, characterized in that, The processing module is further configured to: In response to the transmission quality of the target path meeting preset conditions, it is determined that the next-hop network device for forwarding the target data stream will be changed to the target network device.

23. The apparatus according to claim 15, characterized in that, The transceiver module is further configured to forward multiple quality acquisition messages, which are respectively forwarded to different network devices among multiple network devices in the first network domain. The multiple quality acquisition messages are used to acquire the transmission quality of multiple paths, which include paths from the multiple network devices to the destination address of the target data stream, and the multiple network devices include the target network device. The processing module is further configured to determine, based on the acquired transmission quality of the multiple paths, to change the next-hop network device that forwards the target data stream to the target network device.

24. The apparatus according to any one of claims 15-23, characterized in that, The transceiver module is further configured to send a first notification message to a fourth network device after the processing module changes the next-hop network device that forwards the target data stream in the at least one data stream. The first notification message is used to instruct the fourth network device to start performing next-hop network device adjustment for the data stream. The fourth network device is located outside the first network domain, and the destination address of the data stream forwarded by the fourth network device is located within the first network domain.

25. A network device comprising a processor and a memory, the memory for storing program code, the processor for calling the program code in the memory to cause the network device to perform the method as described in any one of claims 1-14.

26. A computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-14.

27. A computer program product, characterized in that, Includes program code that, when a computer runs the computer program product, causes the computer to perform the method as described in any one of claims 1-14.