Configuration method, load balancing method, computing device, and network system
Patent Information
- Application Number
- CN202510339984.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2026-09-22
AI Technical Summary
[0021]如此,能够方便地对数据流进行链路规划,并且避免使用哈希算法,从而能够将数据块均衡地分发到各条物理链路上,实现数据传输的负载均衡。而且,根据本公开实施例的配置方法,能够减少单个计算设备或交换机的负载压力,提高系统的处理速度、响应速度和可靠性,并且还可以通过灵活地添加更多的计算设备来实现负载均衡的水平扩展,满足不断增长的流量需求和负载需求。
Smart Images

Figure CN122802461A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of network technology, and more specifically, to configuration methods, load balancing methods, computing devices, network systems, computer-readable storage media, and data communication systems. Background Technology
[0002] In the fields of high-performance computing (HPC) and artificial intelligence (AI), distributed systems are frequently used to accomplish related tasks. For example, in deep learning, a distributed system comprises multiple computing devices (e.g., AI servers), each capable of running deep learning-related tasks. To enable data transfer between these devices within a distributed system, a network plane is typically used to move data from one device to another. This network plane usually employs a two- or more-layered network architecture. With the support of this two- or more-layered network architecture, data transfer and synchronization can be achieved between multiple computing devices. Summary of the Invention
[0003] This disclosure provides a configuration method for creating multiple flow channels. When sending communication data, the communication data can be divided into multiple data blocks, each data block being sent on a corresponding flow channel. Each flow channel has a flow identifier, and the flow identifier is mapped to multiple links between a first-level switch and its connected second-level switch. This facilitates link planning for data flows and avoids the use of hash algorithms, thereby enabling the even distribution of data blocks across physical links and achieving load balancing for data transmission. The configuration method according to this disclosure reduces the load on individual computing devices or switches, improves system processing speed, response speed, and reliability, and allows for flexible horizontal scaling of load balancing by adding more computing devices to meet ever-increasing traffic and load demands.
[0004] In a first aspect, a configuration method is provided, executed by a computing device connected to at least one first-level switch in a network system, the at least one first-level switch being connected to at least one second-level switch via multiple links. The method includes: acquiring configuration information, wherein the configuration information includes a number of channels and a list of flow identifiers; creating multiple flow channels matching the product of the number of channels and the number of processors in the computing device communicating with the network system, wherein the multiple flow channels are used for communication data transmission between the computing device and the network system; and assigning multiple flow identifiers from the list of flow identifiers to the multiple flow channels, wherein the multiple flow identifiers and multiple links have a mapping relationship.
[0005] This allows for convenient link planning of data flows and avoids the use of hash algorithms, enabling the even distribution of data blocks across physical links and achieving load balancing for data transmission. Furthermore, the configuration method according to embodiments of this disclosure reduces the load on individual computing devices or switches, improves system processing speed, response speed, and reliability, and allows for flexible horizontal scaling of load balancing by adding more computing devices to meet ever-increasing traffic and load demands.
[0006] In some embodiments of the first aspect, the mapping relationship includes at least one of the following: each flow identifier is directly mapped to a link identifier of each of the multiple links; or each flow identifier is mapped to a link identifier of each link based on the relative relationship between each flow identifier and the number of equivalent multipaths.
[0007] In this way, by configuring the relationship between flow identifiers and links, the use of hash algorithms can be avoided, thereby enabling data blocks to be evenly distributed to each physical link and achieving traffic balance in data transmission.
[0008] In some embodiments of the first aspect, the multiple links include multiple uplinks, multiple flow identifiers mapped to at least one of the following based on a mapping relationship: multiple uplinks; and multiple downlinks between a second-level switch and a first-level destination switch for routing communication data in at least one second-level switch.
[0009] Thus, the mapping relationship according to the embodiments of this disclosure can be mapped to both the uplink and the downlink, thereby significantly reducing the load pressure on a single computing device or switch during communication and improving the system's processing speed, response speed, and reliability.
[0010] In some embodiments of the first aspect, the method further includes: determining the number of links of the plurality of uplinks; determining the number of processors in the computing device that are directly connected to at least one first-level switch; and determining the number of channels based on the number of links and the number of processors, wherein the product of the number of channels and the number of processors is at least one times the number of links.
[0011] In some embodiments of the first aspect, the computing device is located in an artificial intelligence (AI) cluster, and the processor in the computing device is used to process AI tasks.
[0012] In some embodiments of the first aspect, the method further includes: determining, based on at least one of the following, that multiple stream channels are created for each processor in the computing device: the function of creating multiple stream channels is enabled; and the computing device is associated with different first-level switches for communicating with the computing device.
[0013] In some embodiments of the first aspect, the method further includes determining, based on at least one of the following, that it is not necessary to create multiple flow channels for each processor in the computing device: the function of creating multiple flow channels is disabled; or the computing device intended to communicate with the computing device is associated with the same first-level switch.
[0014] This avoids creating multiple stream channels under any circumstances, thus effectively preventing the occupation of excessive memory resources in the computing device and reserving more resources for subsequent business operations.
[0015] In some embodiments of the first aspect, for each of at least one processor communicating with a network system, the method further includes: splitting communication data sent by the processor into a plurality of data blocks equal to the number of channels; allocating the plurality of data blocks to a portion of the multiple stream channels corresponding to the processor; for each data block, assigning a stream identifier of the corresponding stream channel to a field of a data packet associated with the data block; and sending the plurality of data packets associated with the plurality of data blocks to a destination computing device via the corresponding stream channels.
[0016] In some embodiments of the first aspect, assigning the flow identifier of the corresponding flow channel to a field of the data packet associated with the data block includes: assigning the flow identifier to the UDP port number field of the data packet in response to the flow identifier being a UDP port number; or assigning the flow identifier to the queue pair number field of the data packet in response to the flow identifier being a queue pair number.
[0017] In this way, the flow identifier can be assigned to the data packet according to the communication protocol adopted by the network system, thereby better adapting to the data transmission in the network system.
[0018] In some embodiments of the first aspect, the computing device includes a network adapter, and wherein multiple data packets associated with multiple data blocks are sent to a destination computing device via corresponding flow channels, including: the network adapter acquiring multiple data packets on the corresponding flow channels; and the network adapter performing scheduling on the multiple data packets to sequentially send the multiple data packets to a first-level switch.
[0019] In some embodiments of the first aspect, the network system includes a leaf-spine network, at least one first-level switch includes a leaf switch, and at least one second-level switch includes a spine switch.
[0020] Secondly, a load balancing method is provided, executed by a network system including at least one first-level switch and at least one second-level switch. The at least one first-level switch is connected to the at least one second-level switch via multiple links. The method includes: the first-level switch receiving multiple data packets, each of which includes multiple flow identifiers, wherein the multiple flow identifiers are mapped to multiple links based on a mapping relationship; the first-level switch extracting the flow identifier from each of the received multiple data packets; the first-level switch determining the link mapped to the flow identifier based on the mapping relationship associated with the extracted flow identifier; and the first-level switch forwarding the data packet associated with the flow identifier to the link.
[0021] This allows for convenient link planning of data flows and avoids the use of hash algorithms, enabling the even distribution of data blocks across physical links and achieving load balancing for data transmission. Furthermore, the configuration method according to embodiments of this disclosure reduces the load on individual computing devices or switches, improves system processing speed, response speed, and reliability, and allows for flexible horizontal scaling of load balancing by adding more computing devices to meet ever-increasing traffic and load demands.
[0022] In some embodiments of the second aspect, determining the link to which the flow identifier is mapped includes: the first-level switch determining the link identifier to which the flow identifier is directly mapped; and the first-level switch determining the link indicated by the link identifier as the link to which the flow identifier is mapped.
[0023] In this way, by configuring the relationship between flow identifiers and links, the use of hash algorithms can be avoided, thereby enabling data blocks to be evenly distributed to each physical link and achieving traffic balance in data transmission.
[0024] In some embodiments of the second aspect, determining the link to which the flow identifier is mapped includes: a first-level switch determining the relative relationship between the flow identifier and the number of equivalent multipaths; based on the relative relationship, the first-level switch determining the link identifier to which the flow identifier is mapped; and the first-level switch determining the link indicated by the link identifier as the link to which the flow identifier is mapped.
[0025] In this way, by configuring the relationship between flow identifiers and links, the use of hash algorithms can be avoided, thereby enabling data blocks to be evenly distributed to each physical link and achieving traffic balance in data transmission.
[0026] In some embodiments of the second aspect, determining the link identifier mapped to the flow identifier based on the relative relationship includes: the first-level switch performing a modulo operation on the flow identifier and the number of equivalent multipaths; and the first-level switch determining the link identifier mapped to the flow identifier based on the result of the modulo operation.
[0027] In some embodiments of the second aspect, extracting the flow identifier from each of the received multiple data packets includes: in response to the flow identifier being a User Datagram Protocol (UDP) port number, the first-level switch extracts the flow identifier from the UDP port number field of the data packet; or in response to the flow identifier being a queue pair number, the first-level switch extracts the flow identifier from the queue pair number field of the data packet.
[0028] In some embodiments of the second aspect, the multiple links include multiple uplinks, and multiple flow identifiers are mapped to at least one of the following based on a mapping relationship: multiple uplinks; and multiple downlinks between the second-level switch and the first-level destination switch.
[0029] In some embodiments of the second aspect, multiple flow channels are used for communication data transmission between the computing device and the network system, and multiple flow identifiers correspond to multiple flow channels respectively.
[0030] In some embodiments of the second aspect, a first number of processors in the computing device are directly connected to at least one first-level switch, and the product of the number of channels for each processor and the first number is at least one times the number of links.
[0031] In some embodiments of the second aspect, the network system is located in an artificial intelligence (AI) cluster, and the processor in the computing device is used to process AI tasks.
[0032] In some embodiments of the second aspect, the network system includes a leaf-spine network, at least one first-level switch includes a leaf switch, and at least one second-level switch includes a spine switch.
[0033] Thirdly, a computing device is provided, connected to a network system including at least one first-level switch and at least one second-level switch. The computing device includes a processor and a memory, the memory storing a computer program. When the processor reads and executes the computer program, the computing device performs operations according to the configuration method described in the first aspect above.
[0034] Fourthly, a network system is provided, including at least one first-level switch and at least one second-level switch, the first-level switch being connected to the at least one second-level switch via multiple links, the network system being configured to perform operations according to the load balancing method described in the second aspect above.
[0035] Fifthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, performs operations according to the method described in the first or second aspect above.
[0036] A sixth aspect provides a data communication system comprising: a network system including at least one first-level switch and at least one second-level switch, the at least one first-level switch being connected to the at least one second-level switch via multiple links; and a computing device connected to the network system, the computing device being configured to: acquire configuration information, wherein the configuration information includes a number of channels and a list of flow identifiers; create multiple flow channels matching the product of the number of channels and the number of processors in the computing device communicating with the network system, wherein the multiple flow channels are used for communication data transmission between the computing device and the network system; and list the flow identifiers... The table lists multiple different flow identifiers assigned to multiple flow channels, with each flow identifier mapping to a specific link. The network system is configured as follows: a first-level switch receives multiple data packets, each containing multiple flow identifiers. These data packets are assigned to multiple flow channels, and each flow identifier corresponds to a specific flow channel. The first-level switch extracts the flow identifier from each of the received data packets. Based on the mapping associated with the extracted flow identifiers, the first-level switch determines the link to which each flow identifier is mapped. Finally, the first-level switch forwards the data packets associated with the flow identifiers to the corresponding links. Attached Figure Description
[0037] Figure 1 A schematic diagram of a distributed system is shown;
[0038] Figure 2 This diagram illustrates a system experiencing traffic imbalance between multi-spine switches.
[0039] Figure 3 A schematic diagram of an example system in which embodiments of the present disclosure can be implemented is shown;
[0040] Figure 4 An exemplary flowchart of a configuration method according to an embodiment of this disclosure is shown;
[0041] Figure 5 A schematic block diagram of a computing device and a first-level switch according to an embodiment of the present disclosure is shown;
[0042] Figure 6 A schematic block diagram illustrating a computing device processing communication data according to an embodiment of the present disclosure is shown.
[0043] Figure 7 An exemplary flowchart illustrating configuration operations performed by a computing device according to embodiments of the present disclosure is shown;
[0044] Figure 8 An exemplary flowchart illustrates the configuration operations performed by a first-level switch in a network system according to an embodiment of the present disclosure;
[0045] Figure 9 A schematic diagram of data transmission in a data communication system according to an embodiment of the present disclosure is shown; and
[0046] Figure 10 A schematic block diagram of an example device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0047] In the field of deep learning, with the rapid increase in the number of model parameters, the amount of input and output data, and the processing volume of AI tasks, the limited resources of a single computing device are no longer sufficient to meet the requirements of executing AI tasks (such as training tasks, application tasks, etc.). Therefore, distributed systems have been designed to solve the problem of limited resources on a single computing device. Distributed systems decompose AI processing tasks (e.g., training tasks, application tasks, etc.) into multiple sub-tasks and process them on multiple computing devices (e.g., in parallel). Computing devices can include devices such as computing servers, and each computing device can be deployed with one or more AI processors (e.g., neural network processing units (NPUs), graphics processing units (GPUs), etc.) to execute AI tasks.
[0048] Let's take training an AI model as an example. In distributed training, it's typically necessary to synchronize data generated during training, such as model parameters, gradient information, and intermediate calculation results, through aggregated communication. For example, data is sent from an AI processor A1 in one computing device (such as a server) S1 to an AI processor A2 in another computing device S2. Data synchronization allows training results to be aggregated within a single computing device, thus achieving the final training objective. For instance, a network plane exists to transmit data between AI processors to synchronize AI processing-related data, such as training data. This network plane usually employs a two- or more-layered network architecture (e.g., a two-layered spine-leaf network architecture). In this two- or more-layered network architecture, multiple links exist. Let's take a spine-leaf network as an example. In a spine-leaf network, a leaf switch and a spine switch can be connected via one or more links (e.g., physical links). A leaf switch can connect to multiple spine switches simultaneously; therefore, in a spine-leaf network architecture, multiple links (e.g., physical links) exist. In two- or more layer network architectures, these links typically employ Equal Cost Multipath (ECMP) routing for load balancing and routing. ECMP uses various hash algorithms to distribute data flows across different links.
[0049] Figure 1 A schematic diagram of a distributed system 100 is shown. Figure 1The distributed system 100 includes a computing device group 110 and a network system 150. The computing device group 100 includes multiple computing devices. Figure 1 The network system 150 is illustrated using a two-layer network architecture as an example. The two-layer network architecture includes first-layer network switches 121, 122, 123, and 124 (hereinafter referred to as "Level 1 switches") and second-layer network switches 132 and 134 (hereinafter referred to as "Level 2 switches"). Taking a leaf-spine network as an example, the Level 1 network switches may include leaf switches, and the Level 2 network switches may include spine switches. In the leaf-spine network 150, each leaf switch can be connected to multiple spine switches via one or more links. Figure 1 The leaf switch 121 can be connected to the spine switch 132 via one or more links 141. The spine switch 132 can be connected to the leaf switch 122 via one or more links 142. Figure 1 Other leaf switches and spine switches in the system can have similar link connections, which will not be elaborated here for the sake of simplicity.
[0050] In multi-layer network architectures, Equal Cost Multipath (ECMP) routing is typically used for load balancing and route selection of data flows. Figure 1 For example, in the actual operation of system 100, it frequently occurs that two data streams are hashed onto the same link. Let's take a leaf-spine network 150 as an example. This can happen on the uplink between the same leaf switch and the same spine switch, resulting in unbalanced leaf switch hashing. For example, two or more data streams may be hashed onto the same uplink 141 between leaf switch 121 and spine switch 132. Similarly, this can also happen on the downlink between the same spine switch and the same leaf switch, resulting in unbalanced spine switch hashing. For example, two or more data streams may be hashed onto the same downlink 142 between spine switch 132 and leaf switch 122. Unbalanced leaf switch hashing is caused by the information of the data streams and the hashing mechanism of the leaf switches. Unbalanced spine switch hashing is caused by the information of the data streams and the hashing mechanism of the spine switches.
[0051] In addition, another type of traffic imbalance occurs when multiple tasks run concurrently, leading to uneven distribution of concurrent data flows among multiple spine switches. This traffic imbalance between spine switches results from upstream data flows from multiple leaf switches being transmitted to the same spine switch, causing collisions in the downstream data flows of the spine switch. Figure 2 This diagram illustrates a system experiencing traffic imbalance between multi-spine switches. Figure 2For example, each leaf switch can connect to four computing devices. For simplicity, only the four computing devices connected to leaf switch 122 are shown. Furthermore, taking network 150 as an example, which includes two spine switches 132 and 134, each leaf switch connects to spine switches 132 and 134 in network 150. Each leaf switch is connected to a spine switch via two links. For example, leaf switch 121 is connected to spine switch 132 via two links. In multi-task concurrent scenarios, there may be traffic imbalances between multiple spine switches. For example, Figure 2 System 200 contains two concurrent tasks: Task 1 and Task 2. In Task 1, computing device 111 sends data streams to computing devices 113 and 161. In Task 2, computing device 117 sends data streams to computing devices 114 and 162. Since there are only two physical links between spine switch 132 and leaf switch 122, hash collisions are inevitable in this scenario, resulting in uneven traffic distribution among the multiple spine switches. Hash collisions typically have a significant impact on network communication performance and end-to-end performance.
[0052] Load balancing using hashing and ECMP is suitable for scenarios with a large number of relatively small data streams, and the more data streams there are, the more balanced the hashing results become. However, for the AI network plane in a distributed AI cluster, the data streams are few in number, periodically bursty, and usually synchronous large flows. Using traditional hashing algorithms, a single data stream can easily saturate the link bandwidth. Therefore, traditional hashing algorithms typically fail to achieve satisfactory load balancing results in AI network plane scenarios.
[0053] To achieve better hashing results, a multi-stream approach can be adopted for two- or multi-layer network architectures in the AI network plane (e.g., a two-layer leaf-spine network). This involves establishing multiple data streams between a pair of communicating nodes to increase the number of data streams and thus achieve better hashing results. However, despite this, hashing algorithms still cannot guarantee balanced traffic. Furthermore, research indicates that multi-stream hashing based on this method is not ideal, exhibiting a clustering effect in hash results; therefore, the marginal effect decreases as the number of streams increases. In addition, achieving better hashing results using this method often requires constructing numerous data streams, consuming significant computing resources (such as memory), resulting in a substantial reduction in resources available for business operations. Therefore, a load balancing solution suitable for the network plane scenario of AI clusters is urgently needed.
[0054] Figure 3 A schematic diagram of an example system 300 in which embodiments of the present disclosure can be implemented is shown. Figure 3 The example system 300 in the example has the same characteristics as... Figure 1 or Figure 2 A similar structure to the system in [the text]. For example, Figure 3 The system includes a computing device group 310 and a network system 350. Figure 3 In this configuration, each computing device can be connected to a first-level switch via one or more physical links. For ease of explanation, in the following text, the first-level switch connected to a computing device via a physical link (e.g., directly connected) will be referred to as the first-level associated switch of that computing device or the first-level switch associated with that computing device. For example, computing devices 311 and 312 are both connected to first-level switch 321; therefore, the first-level associated switch for computing devices 311 and 312 is first-level switch 321. Similarly, the first-level associated switch for computing devices 315 and 316 is first-level switch 323, and so on.
[0055] In addition, Figure 3 In system 300, the number of links between each computing device and the first-level associated switch is marked, for example, N. Furthermore, in Figure 3 In system 300, the number of links between each first-level switch and each second-level switch is further indicated, for example, M. Figure 3 In the network system 350, each second-level switch (e.g., 332, 334) is connected to a corresponding first-level switch (e.g., 321, 322, 323, 324) via M links. Furthermore, each computing device can be connected to its associated first-level switch via N links. For example, computing device 311 can be connected to its associated first-level switch 321 via N links.
[0056] In some embodiments, Figure 3System 300 may include an AI cluster. Each computing device in the AI cluster can be used to process AI tasks. Each computing device may be configured with multiple AI processors (e.g., neural processing units (NPUs), graphics processing units (GPUs), or combinations thereof) to perform AI tasks. In some embodiments, each AI processor may be connected to an associated first-level switch via a network interface and a link. Accordingly, if there are N links between the computing device and the associated first-level switch, the number of AI processors configured in the computing device may be N. In some embodiments, the network interface may be directly output from the corresponding AI processor (i.e., the AI processor controls the data communication from the AI processor to the first-level switch), or it may be output from the network card in the computing device (i.e., the central processing unit of the computing device controls the data communication from the AI processor to the first-level switch), thereby forming a cluster network plane. In some embodiments, the AI processor may run a collective communication algorithm and communicate data (e.g., gradient data) through the network system (or cluster network plane) 350.
[0057] like Figure 3 As shown, Figure 3 Each first-level switch in the network system 350 has multiple uplink interfaces and multiple downlink interfaces. In some embodiments, the number of uplink interfaces may be equal to the number of downlink interfaces. The uplink interfaces are used to connect to second-level switches in the network system 350, and the downlink interfaces are used to connect to computing devices in the computing device group 310. Figure 3 Taking the diagram as an example, assume Figure 3 Each Level 1 switch in the network system 350 is connected to one computing device via N links, and each Level 1 switch connects to four computing devices. Therefore, each Level 1 switch has 4N downlink interfaces and 4N uplink interfaces. Each Level 1 switch is connected to all Level 2 switches (Level 2 switches 332 and 334) in the network system 350 via 4N uplink interfaces. For example, if there are two Level 2 switches in the network system 350, each Level 1 switch is connected to one of the two Level 2 switches via 4N uplink interfaces. Therefore, the number of links between each Level 1 switch and each Level 2 switch is 2N, i.e., M = 2N.
[0058] In some embodiments, a processor in a computing device can be connected to a primary switch via a corresponding network interface, such as... Figure 3As shown in the illustration. Furthermore, in some embodiments, a processor in the computing device can also be connected to multiple first-level switches via corresponding network interfaces. For example, a processor in the computing device can be directly connected to both first-level switches 321 and 322 via links. In this case, computing device 311 is connected to both first-level switches 321 and 322, which are correspondingly first-level associated switches for computing device 311. In some embodiments, the processor in the computing device can be connected to an appropriate number of first-level switches as needed.
[0059] It is understood that the numbers described above are merely illustrative, and for illustrative purposes, this disclosure does not limit the number of AI processors in the computing device, the number of computing devices or processors connected to each first-level switch, the number of first-level switches connected to the computing devices or processors, or the number of first-level and second-level switches in the network system 350. Those skilled in the art can configure any number according to actual needs. Furthermore, although... Figure 3 The network system 350 shown includes two layers, but those skilled in the art will understand that the network system 350 may include more than two layers, and the first-level switch and the second-level switch may be the lowest-level and highest-level switches in the more layers, respectively. This disclosure does not limit the number of layers in the network system.
[0060] Each computing device in the computing device group 310 can execute a configuration method according to embodiments of the present disclosure to achieve load balancing in system 300. In some embodiments, the computing device (e.g., computing device 311 is described as an example) can obtain configuration information, and the configuration information may include a number of channels and a list of flow identifiers. Based on the product of the number of channels and the number of processors in computing device 311 communicating with network system 350, computing device 311 creates multiple flow channels matching the product, and the multiple flow channels are used for communication data transmission between computing device 311 and network system 350. Computing device 311 assigns multiple flow identifiers from the flow identifier list to the multiple flow channels, and the multiple flow identifiers are mapped to multiple links between first-level switch 321 and second-level switches 332 and 334.
[0061] The first-level switch in network system 350 (for example, a first-level switch 321 connected to computing device 311) can receive multiple data packets from computing device 311. Each data packet includes multiple flow identifiers, and these flow identifiers are mapped to multiple links between the first-level switch 321 and its connected second-level switches 332 and 334 based on mapping relationships. The first-level switch 321 can extract the flow identifier from each of the received data packets and determine the link mapped to that flow identifier based on the mapping relationship associated with the extracted flow identifier. The first-level switch 321 can then forward the data packet associated with that flow identifier to the determined link.
[0062] It is understandable that, although the above description uses the example computing device 311 and the first-level associated switch 321 associated with the computing device 311 as examples, it is also understandable that... Figure 3 Each computing device in the computing device group 310 and each first-level switch and second-level switch in the network system 350 can execute the above-described corresponding methods to achieve load balancing in the system 300.
[0063] In some embodiments, network system 350 may include a leaf-spine network. First-level switches may include leaf switches, and second-level switches may include spine switches. Furthermore, in other embodiments, network system 350 may include a fat-tree network. First-level switches may include leaf node switches, and second-level switches may include root node switches. In addition, the network system may include various other network structures, which are not limited herein.
[0064] The configuration method according to embodiments of this disclosure can create multiple flow channels. When sending communication data, the communication data can be divided into multiple data blocks, and each data block is sent on a corresponding flow channel. Each flow channel has a flow identifier, and the flow identifier and multiple links between the first-level switch and its connected second-level switch have a mapping relationship. Therefore, link planning for data flows can be easily performed, and the use of hash algorithms can be avoided, thereby enabling the data blocks to be evenly distributed across physical links, achieving load balancing for data transmission. The configuration method according to embodiments of this disclosure can reduce the load pressure on a single computing device or switch, improve the system's processing speed, response speed, and reliability, and can also achieve horizontal scaling of load balancing by flexibly adding more computing devices to meet ever-increasing traffic and load demands.
[0065] Figure 4 An exemplary flowchart of a configuration method 400 according to an embodiment of this disclosure is shown. The configuration method 400 can be used in any... Figure 3Executed on any computing device. In the following description, it will be referred to as Figure 3 The following explanation uses computing device 311 and first-level switch 321 as examples. Furthermore, the switches connected to the first-level switch 321 are second-level switches 332 and 334. However, it is understandable that this method can... Figure 3 This disclosure does not limit the scope of the application to any computing device and its associated first-level or second-level switches. Computing devices include, but are not limited to, desktop computers, mobile terminals, smart home devices, wearable devices, servers, and cloud servers. Although... Figure 4 The steps shown are performed in a specific order, but it is understandable that... Figure 4 The execution order of the steps in method 400 can be changed relative to the order shown. For example, two or more steps shown consecutively can be executed simultaneously, or some steps can be executed simultaneously. Furthermore, specific steps in method 400 can be omitted. Additionally, other steps can be added. Figure 4 The flowchart is shown. It is understood that all these changes are within the scope of this disclosure.
[0066] In step 402, computing device 311 can obtain configuration information, which in some embodiments may include a number of channels and a list of stream identifiers. In some embodiments, computing device 311 may include a server, such as an AI server, and the server may include N processors, for example, N AI processors, as described above. The computing device 311 may store configuration information, where the number of channels is the number of stream channels associated with each processor. In some embodiments, the number of stream channels associated with each processor in the computing device may be the same. For example, the computing device includes 8 processors, and the number of channels associated with each of the 8 processors may all be 4. When one or more of the 8 processors communicate with a network system, the computing device may create 4 stream channels for each processor used for communication. Accordingly, for S processors in computing device 311 used for communication, computing device 311 may create 4S stream channels.
[0067] Multiple flow identifiers in the flow identifier list in the configuration information can be assigned to the created multiple flow channels as flow identifiers for the corresponding flow channels. For example, taking two processors communicating with a network system, computing device 311 can create four flow channels for each processor as an example. Computing device 311 can create eight flow channels and assign eight flow identifiers from the flow identifier list to these eight flow channels respectively. The flow identifier assigned to each flow channel by computing device 311 can be different. For example, computing device 311 can sequentially select flow identifiers from the flow identifier list and assign them to each flow channel in turn.
[0068] In some embodiments, the first-level associated switch of the computing device 311 is connected to one or more second-level switches via multiple links, which can serve as associated links of the first-level associated switch. In some embodiments, these multiple associated links are uplink links. Figure 3 As shown, the first-level associated switch 321 of computing device 311 can be connected to the second-level switches 332 and 334 via two sets of M links. Accordingly, these two sets of M links are the associated links between the first-level switch 321 and the second-level switches 332 and 334. Multiple flow identifiers in the flow identifier list are mapped to these multiple associated links. This mapping relationship will be described below.
[0069] The number of channels associated with each processor in computing device 311 is related to the following factors: the number n1 of processors in computing device 311 directly connected to the first-level associated switches(multiple); and the number n2 of the multiple associated links of the first-level associated switches(multiple). In some embodiments, each processor in computing device 311 can be connected to one or more first-level associated switches via a corresponding physical link through a corresponding network interface. Therefore, the number n1 of processors directly connected to one or more first-level associated switches can be equal to the number of links between computing device 311 and one or more first-level associated switches.
[0070] The number of channels n associated with each processor can be calculated using the following formula (1). L :
[0071] n L = (n2 / n1)×k formula (1)
[0072] Where k is a positive integer greater than or equal to 1. n1 is the number of first links between computing device 311 and (multiple) first-level associated switches, or it can be equal to the number of processors in computing device 311 directly connected to (multiple) first-level associated switches. n2 is the number of associated links between (multiple) first-level associated switches and one or more second-level switches connected to them. According to this formula, the product of the number of channels and the number of processors is at least twice the number of associated links. Preferably, k = 1. That is, the multiple flow channels created by computing device 311 can respectively correspond to multiple physical links between (multiple) first-level associated switches of computing device 311 and (multiple) second-level switches connected to the (multiple) first-level associated switches. When k = 1, the number of flow channels created can be reduced, and correspondingly, the number of data flow segments can be reduced, thereby avoiding occupying the memory resources of computing device 311, so as to leave more memory resources for other service traffic, which is beneficial to the improvement of system performance and response.
[0073] by Figure 3 Let's take an example. Assume that computing device 311 includes 8 processors, and each processor is connected to a first-level associated switch 321 through a corresponding network interface. That is, the number of first links between computing device 311 and first-level associated switch 321 is 8. In addition, first-level switch 321 is connected to second-level switch 332 and second-level switch 334 through 16 physical links respectively. That is, the number of associated links of first-level associated switch 321 is 32. According to formula (1) and setting the value of k to 1, it can be determined that the number of channels corresponding to each processor in computing device 311 is 4. That is, computing device 311 can create 4 flow channels for each processor. Accordingly, for the 8 processors in computing device 311, computing device 311 can create 32 flow channels, which can correspond to the 32 links between first-level associated switch 321 and second-level switch 332 and second-level switch 334 respectively.
[0074] In some embodiments, the configuration information may also include a list of flow identifiers. This list of flow identifiers may include multiple flow identifiers. Each flow identifier is assigned to multiple flow channels created by the computing device. It is understood that, for illustrative purposes, although defined as a "list of flow identifiers," multiple flow identifiers may be stored in the configuration information in various suitable ways, and this disclosure does not limit this.
[0075] In some embodiments, the processor in the computing device may include a central processing unit (CPU), an AI processor, such as an NPU, a GPU, and various types of processors that will be developed in the future, and this disclosure does not limit it.
[0076] In step 404, multiple stream channels matching the product of the number of channels and the number of processors in computing device 311 communicating with network system 350 are created. In some embodiments, the multiple stream channels are used for communication data transmission between computing device 311 and network system 350. It is understood that, to avoid unnecessarily occupying the memory resources of computing device 311, computing device 311 does not create multiple stream channels in all cases. The process for determining the creation of multiple stream channels by computing device 311 will be described in detail below. Computing device 311 may create multiple stream channels for each communicating processor (e.g., n). L Therefore, when the number of processors communicating is L, the total number of stream channels created by computing device 311 is S, where S = L × n. L .
[0077] In configuration 406, computing device 311 can assign multiple flow identifiers from the flow identifier list to multiple flow channels, and a mapping relationship exists between the multiple flow identifiers in the flow identifier list and multiple associated links of the multiple first-level associated switches. In some embodiments, the multiple first-level associated switches of computing device 311 are connected to one or more second-level switches via multiple links, which can serve as associated links of the multiple first-level associated switches. In some embodiments, the multiple associated links are uplinks. In some embodiments, the multiple associated links are equivalent links, that is, the cost of reaching the same destination computing device via each link is the same. Based on this mapping relationship, each flow identifier in the multiple flow identifiers can be mapped to each of the multiple equivalent links.
[0078] In some embodiments, the multiple flow identifiers also have the aforementioned mapping relationship with multiple equivalent links in downlink data transmission. Computing device 311 transmits data to a destination computing device via network system 350. The multiple first-level associated switches (i.e., one or more first-level switches connected to the destination computing device via links) associated with the destination computing device are first-level destination switches. During uplink data transmission, the second-level switch that receives data from the first-level associated switch of the source computing device (i.e., computing device 311) is a second-level routing switch. Multiple links between the second-level routing switch and the first-level destination switch are considered as multiple downlinks, and these multiple downlinks are multiple equivalent links. Accordingly, the aforementioned mapping relationship also exists between the multiple flow identifiers and the multiple equivalent links in downlink data transmission. Based on this mapping relationship, each of the multiple flow identifiers can be mapped to each of the multiple equivalent links.
[0079] by Figure 3For example, there are 2M uplinks between the first-level switch 321 and the second-level switches 322 and 334. Taking the transmission of data from computing device 311 to computing device 316 as an example, where computing device 316 is the destination computing device of source computing device 311, the cost for computing device 311 to reach the destination computing device 316 through these 2M links is the same during uplink data transmission. Therefore, these 2M links can be considered as multiple equivalent links. Furthermore, these 2M links are associated links of the first-level associated switch 321. Multiple flow identifiers in the flow identifier list have a first mapping relationship with these 2M links.
[0080] In downlink data transmission, assuming the second-level switch for routing communication data is switch 332, when routing data to the destination computing device 316, the multiple links M between the second-level routing switch 332 and the first-level switch 323 (the first-level associated switch of the destination computing device 316) are considered as multiple equivalent links in the downlink data transmission. Multiple flow identifiers in the flow identifier list have a second mapping relationship with these M links, and the first mapping relationship is the same as the second mapping relationship. Switch 332, as a second-level routing switch, can perform similar operations; for simplicity, this will not be elaborated here.
[0081] In some embodiments, the mapping relationship between flow identifiers and links can be a direct mapping. That is, each flow identifier can be directly mapped to a corresponding link among multiple links. For example, the mapping relationship between each flow identifier and multiple links can be configured to map the flow identifier to the corresponding link. Taking four flow identifiers as an example, the four flow identifiers can be configured to correspond sequentially to the first, second, third, and fourth links among multiple links. Thus, a direct mapping relationship is formed between flow identifiers and links. In some embodiments, this mapping relationship can be pre-configured, for example, the mapping relationship can be pre-configured or specified by the user. In addition, the mapping relationship can also be pre-configured in other ways, which are not limited in this disclosure.
[0082] In some embodiments, the mapping between flow identifiers and links is related to the number of links (e.g., the number of links in a multi-cost multipath). In some embodiments, each flow identifier can be mapped to a link identifier for each link based on the relative relationship between each flow identifier and the number of multi-cost links (i.e., the number of equal-cost multipaths). The relative relationship between flow identifiers and the number of equal-cost multipaths can be determined by a first-level associated switch of the computing device. In some embodiments, the flow identifier can be an integer. The flow identifier is moduloed by the number of equal-cost multipaths, and the link to which the flow identifier is mapped is determined based on the result of the modulo operation. A similar operation can be performed for downlinks. For example, a second-level routing switch can perform a modulo operation between the flow identifier and the number of links (e.g., the number of downlink equal-cost multipaths), and determine the link to which the flow identifier is mapped based on the result of the modulo operation.
[0083] For example, regarding uplink data transmission, let's take a scenario with 16 links and a flow identifier of 65. After a modulo operation, the result is 1. The first-level associated switch can forward the data associated with this flow identifier to the first uplink among multiple uplinks (e.g., multiple uplinks between the first-level associated switch and all second-level switches in the network system). Similarly, for downlinks with 8 links, the second-level routing switch can perform a modulo operation between the flow identifier and the link number 8. After the modulo operation, the result is 1. Accordingly, the second-level routing switch can forward the data associated with this flow identifier to the first downlink. It is understood that the above examples are merely illustrative, and this disclosure does not limit the specific values of the link number or the flow identifier.
[0084] The configuration method of this disclosure allows for the creation of multiple flow channels. When sending communication data, the data can be divided into multiple data blocks, each of which is sent on a corresponding flow channel. Each flow channel has a flow identifier, and the flow identifier is mapped to multiple links between the first-level switch and its connected second-level switch. This facilitates link planning for data flows and avoids the use of hash algorithms, enabling the even distribution of data blocks across physical links and achieving load balancing for data transmission. The configuration method according to embodiments of this disclosure reduces the load on individual computing devices or switches, improves system processing speed, response speed, and reliability, and allows for flexible horizontal scaling of load balancing by adding more computing devices to meet ever-increasing traffic and load demands.
[0085] Figure 5 A schematic block diagram 500 showing a computing device and a first-level switch according to an embodiment of the present disclosure is shown. Figure 5The computing devices 510 and 520 shown in the figure
[0086] and Figure 3 Similar to any computing device, and, Figure 5 The first-level switch shown in the figure and Figure 3 Similar to any Level 1 switch. Refer to... Figure 3 The system diagram in the middle Figure 5 A description will follow. Please refer to the description above for understanding; for the sake of brevity, it will not be repeated here.
[0087] like Figure 5 As shown, computing device 510 may include a communication module 513, a network adapter driver 515, and a network adapter 517. Similarly, computing device 520 may include a communication module 523, a network adapter driver 525, and a network adapter 527. Similar components have similar functions or roles; for simplicity, computing device 510 will be used as an example for detailed explanation below. Computing devices 510 and 520 are connected to a first-level switch 530, which can be a first-level associated switch for computing devices 510 and 520. The first-level switch 530 includes a receiving unit 532, a processing unit 534, and a transmitting unit 535. It is understood that, in conjunction with... Figure 5 The description of computing device 510 can be applied Figure 5 The computing device 520 and Figure 3 Any computing device, and the description of the first-level switch 530 can be applied to Figure 3 Any first-level switch.
[0088] In some embodiments, the communication module 513 in the computing device 510 may determine whether it is necessary to create multiple flow channels for the computing device 510 (e.g., for each processor in the computing device 510). That is, the communication module 513 may determine whether it is necessary to create multiple flow channels for each of one or more processors in the computing device 510 that communicate with the network system. In some embodiments, in response to the function of creating multiple flow channels being enabled, the communication module 513 may determine to create multiple flow channels for each processor. In some embodiments, in response to the destination computing device communicating with the computing device 510 being associated with a different first-level switch (i.e., the computing device 510 and the destination computing device are respectively connected to different first-level switches), the communication module 513 may determine to create multiple flow channels for each processor. In some embodiments, in response to the activation of the function to create multiple stream channels, and the destination computing device communicating with computing device 510 is associated with computing device 510 on a different first-level switch (i.e., computing device 510 and the destination computing device are connected to different first-level switches), communication module 513 can determine to create multiple stream channels for each processor. Figure 3 Taking the example of computing device 510, it can correspond to... Figure 3 The computing device 311 and computing device 313 can be the destination computing device of computing device 311. Computing device 311 and computing device 313 are connected to different first-level switches 321 and 322 respectively via physical links. Therefore, in response to the function of creating multiple flow channels being enabled, communication module 513 can determine the creation of multiple flow channels.
[0089] In some embodiments, in response to the function of creating multiple stream channels being disabled, the communication module 513 can determine that it is not necessary to create multiple stream channels for each processor. In some embodiments, in response to the destination computing device communicating with computing device 510 being associated with the same first-level switch as computing device 510 (i.e., computing device 510 and the destination computing device are connected to the same first-level switch), the communication module 513 can determine that it is not necessary to create multiple stream channels for each processor. Figure 3 Taking the example of computing device 510, it can correspond to... Figure 3 The computing device 311 is used in the communication module 513. When the computing device 311 communicates with the computing device 312, the computing device 312 can be the destination computing device of the computing device 311. The computing devices 311 and 312 are connected to the same first-level switch 321 via a physical link. Therefore, the communication module 513 can determine that it is not necessary to create multiple flow channels for each processor.
[0090] When multiple flow channels need to be created, the communication module 513 can obtain configuration information and further obtain the number of channels and the list of flow identifiers from the configuration information. The number of channels can represent the number of flow channels created for each processor in the computing device 510. The network adapter driver 515 can, based on the number of channels in the configuration information, create multiple flow channels matching the number of channels for each of one or more processors communicating with the network system. Accordingly, the network adapter driver 515 can create multiple flow channels for all processors communicating in the computing device 510. See also... Figure 4 The process of creating multiple flow channels is described in the previous section and will not be repeated here. The network adapter driver 515 can also assign multiple flow identifiers from the flow identifier list in the configuration information to the created multiple flow channels. A mapping relationship exists between the multiple flow identifiers and the multiple uplinks associated with the first-level associated switch 530, and this mapping relationship can also be applied to the multiple downlink equivalent links associated with the second-level routing switch, as described above.
[0091] Communication module 513 can receive communication data from one or more processors. For each processor, communication module 513 can divide the communication data into multiple data blocks matching the number of channels corresponding to that processor. Network adapter driver 515 can allocate the multiple data blocks divided by the communication module for all processors to the corresponding stream channels. For each data block, network adapter driver 515 can assign the stream identifier of the stream channel to which the data block is allocated to a field of the data packet associated with that data block. In some embodiments, in response to the stream identifier being a User Datagram Protocol (UDP) port number, network adapter driver 515 can assign the stream identifier to the UDP port number field of the data packet. Alternatively, in response to the stream identifier being a queue pair number, network adapter driver 515 can assign the stream identifier to the queue pair number field of the data packet.
[0092] After assigning values to the data packets, network adapter 517 can send multiple data packets associated with multiple data blocks to the first-level switch 530 via the corresponding flow channels. Network adapter 517 can schedule multiple data blocks to send them sequentially, thereby achieving flow balancing. The first-level switch 530 sequentially receives and stores multiple data packets through receiving unit 532. Each data packet includes a flow identifier, which can be mapped to a corresponding link among multiple equivalent links associated with the first-level switch 530 based on a mapping relationship. That is, based on the mapping relationship, the flow identifier can be mapped to the first-level switch 530 and the corresponding link among the multiple links connected to it. Processing unit 534 can extract the flow identifier from each data packet and determine the link mapped to the flow identifier based on the mapping relationship associated with the extracted flow identifier. Sending unit 535 can forward the data packet associated with the flow identifier to the mapped link to forward the data packet to the second-level routing switch.
[0093] In some embodiments, when the mapping relationship is a direct mapping, the processing unit 534 in the first-level switch 530 can determine the link identifier directly mapped to by the flow identifier based on the correspondence between the flow identifier and the link, and determine the link indicated by the link identifier as the link mapped to by the flow identifier. The sending unit 535 in the first-level switch 530 can forward the data packet to the determined link to forward the data packet to the second-level routing switch.
[0094] In some embodiments, processing unit 534 may further determine the link mapped to the flow identifier based on the relative relationship between the flow identifier and the number of equivalent multipaths associated with the first-level switch 530. Processing unit 534 may determine the relative relationship between the flow identifier and the number of equivalent multipaths, and based on this relative relationship, determine the link identifier mapped to the flow identifier. Processing unit 534 may determine the link indicated by the link identifier as the link mapped to the flow identifier. Sending unit 535 in the first-level switch 530 may forward the data packet to the determined link to forward the data packet to the second-level routing switch. In some embodiments, when determining the relative relationship, processing unit 534 may perform a modulo operation between the flow identifier and the number of equivalent multipaths. Processing unit 534 may determine the link identifier mapped to the flow identifier based on the result of the modulo operation. Furthermore, processing unit 534 may perform other operations besides the modulo operation to determine the relative relationship between the flow identifier and the number of equivalent multipaths, which are not limited in this disclosure.
[0095] In some embodiments, data blocks forwarded by the sending unit 535 in the first-level switch 530 to the link are received by the second-level switch. This second-level switch can be considered a second-level routing switch. The second-level routing switch performs operations similar to those of the first-level switch 530 on the received data blocks. For example, the second-level routing switch can sequentially receive and store multiple data packets via the receiving unit 532, and each data packet includes a flow identifier. This flow identifier can be mapped to a corresponding equivalent link among multiple equivalent links associated with the second-level routing switch based on a mapping relationship. In some embodiments, the multiple equivalent links associated with the second-level routing switch include multiple links between the second-level routing switch and the first-level destination switch. Furthermore, the first-level destination switch is connected to the destination computing device of the computing device 510 (i.e., the destination address to which the communication data in the computing device 510 is to be transmitted) via multiple physical links.
[0096] In some embodiments, the processing unit in the second-level routing switch can extract the flow identifier from each received data packet and determine the forwarding link associated with the flow identifier based on the mapping relationship associated with the extracted flow identifier. In some embodiments, when the mapping relationship is a direct mapping, the processing unit in the second-level routing switch can determine the link identifier directly mapped to by the flow identifier based on the correspondence between the flow identifier and the link, and determine the link indicated by the link identifier as the link mapped to by the flow identifier. The sending unit in the second-level routing switch can forward the data packet to the determined link to send the data packet to the destination computing device via the first-level destination switch. In some embodiments, the processing unit in the second-level switch can also determine the link mapped to by the flow identifier based on the relative relationship between the flow identifier and the number of equivalent multipaths associated with the second-level routing switch. The processing unit can determine the relative relationship between the flow identifier and the number of equivalent multipaths, and determine the link identifier mapped to by the flow identifier based on the relative relationship. The processing unit can determine the link indicated by the link identifier as the link mapped to by the flow identifier. The sending unit in the second-level switch can forward the data packet to the determined link to send the data packet to the destination computing device via the first-level destination switch. In some embodiments, when determining the relative relationship, the processing unit in the second-level switch can perform a modulo operation between the flow identifier and the number of equivalent multipaths. The processing unit can determine the link identifier mapped to the flow identifier based on the result of the modulo operation. In addition, the processing unit can also perform other operations besides the modulo operation to determine the relative relationship between the flow identifier and the number of equivalent multipaths, which are not limited in this disclosure.
[0097] The above Figure 5The description assumes that the communication module 513, network adapter driver 515, and network adapter 517 are controlled by the central processing unit in the computing device 510. In some embodiments, the communication module 513, network adapter driver 515, and network adapter 517 may also be controlled by an AI processor in the computing device 510. In this case, the communication module 513, network adapter driver 515, and network adapter 517 can perform configuration operations for the AI processor. Accordingly, multiple groups consisting of multiple communication modules 513, network adapter driver 515, and network adapter 517 can each be configured by multiple AI processors. The configuration operation process is similar to the process described above, and will not be repeated here for the sake of brevity.
[0098] Figure 6 A schematic block diagram 600 is shown illustrating a computing device 610 processing communication data according to an embodiment of the present disclosure. Figure 1 The computing device 610 shown is Figure 3 It is similar to any computing device. You can refer to the description above for understanding; for the sake of brevity, it will not be repeated here.
[0099] In some embodiments, the communication module 613 in the computing device 610 can determine whether to create multiple stream channels for each processor. The process by which the computing device 610 determines whether to create multiple stream channels for each processor can be referred to the above in conjunction with... Figure 5 The description will be presented in a concise manner, and will not be repeated here.
[0100] In response to the communication module 613 determining to create multiple stream channels, the network adapter driver 615 creates multiple stream channels for each processor, matching the number of channels in the configuration information. For example, the channel data in the configuration information is n. L This means that n can be created for each processor. L Flow channels. For one or more processors, computing device 610 creates a corresponding number of flow channels. Network adapter driver 615 can assign multiple flow identifiers from the flow identifier list in the configuration information to the created flow channels. In some embodiments, computing device 610 has one or more first-level associated switches, and the one or more first-level associated switches are connected to one or more second-level switches (e.g., all switches in the network system) via multiple physical links. A mapping relationship exists between the multiple flow identifiers and the multiple physical links. The mapping relationship can be understood with reference to the description above; for simplicity, it will not be repeated here.
[0101] The communication module 613 can receive data from one or more processors. Figure 6Let's take the example of performing operations on communication data from a processor. It's understandable that... Figure 6 The same explanation can be applied to any other processor in a computing device. Multiple stream channels created for this processor... Figure 6 The channels shown are flow channels 640-1, 640-2, ..., 640-n. L For the communication data 660 from the processor, the communication module 613 can divide the communication data into segments corresponding to the number of channels n. L Matching multiple data blocks 660-1, 660-2, ..., 660-n L The communication module 613 further divides the data into multiple data blocks 660-1, 660-2, ..., 660-n. L They were respectively assigned to flow channels 640-1, 640-2, ..., 640-n L For example, data block 660-1 is assigned to stream channel 640-1, data block 660-2 is assigned to stream channel 640-2, and so on, data block 660-n L Assigned to flow channel 640-n L Each data block 660-i is transmitted via a corresponding datagram. In some embodiments, the network adapter driver 615 may assign the flow identifier of the flow channel to which the data block 660-i is allocated to the corresponding field of the datagram of that data block 660-i. In some embodiments, in response to the flow identifier being a User Datagram Protocol (UDP) port number, the network adapter driver 615 may assign the flow identifier to the UDP port number field of the datagram. Alternatively, in response to the flow identifier being a queue pair number, the network adapter driver 615 may assign the flow identifier to the queue pair number field of the datagram.
[0102] Network adapter driver 615 can send multiple data packets, after assignment, to network adapter 617. Network adapter 617 can perform flow balancing scheduling. In some embodiments, network adapter 617 can perform scheduling operations on multiple data packets. For example, network adapter 617 can sequentially send multiple data packets to the first-level associated switch of the computing device 610. The first-level associated switch can perform forwarding operations on the received multiple data packets based on the mapping relationship between flow identifiers and links, to forward them to the second-level routing switch. The second-level routing switch can similarly forward the received data packets to the first-level destination switch based on the mapping relationship between flow identifiers and links, to send the data packets to the destination computing device. The forwarding operations performed by the first-level switch and the second-level switch can be understood with reference to the description above; for the sake of simplicity, they will not be repeated here.
[0103] Figure 7An exemplary flowchart 700 illustrates a configuration operation performed by a computing device according to an embodiment of the present disclosure. The configuration method 700 can be implemented in... Figure 3 Executed on any computing device. In the following description, it will be referred to as Figure 3 The method will be illustrated using computing device 311 as an example. However, it is understandable that this method can... Figure 3 This disclosure does not limit the scope of the application to any computing device. Computing devices include, but are not limited to, desktop computers, mobile terminals, smart home devices, wearable devices, servers, cloud servers, etc. Although Figure 7 The steps shown are performed in a specific order, but it is understandable that... Figure 7 The execution order of the steps in method 700 can be changed relative to the order shown. For example, two or more steps shown consecutively can be executed simultaneously, or some steps can be executed simultaneously. Furthermore, specific steps in method 700 can be omitted. Additionally, other steps can be added. Figure 7 The flowchart is shown. It is understood that all these changes are within the scope of this disclosure.
[0104] At 710, computing device 311 may determine whether to create multiple stream channels for each processor in computing device 311. In some embodiments, step 710 may be performed by a communication module in computing device 311. In some embodiments, in response to the function of creating multiple stream channels being enabled, the communication module may determine at step 720 that multiple stream channels are to be created. In some embodiments, in response to the target computing device communicating with computing device 311 being associated with a different first-level switch, the communication module may determine at step 720 that multiple stream channels are to be created for each processor. In some embodiments, in response to the function of creating multiple stream channels being enabled and the target computing device communicating with computing device 311 being associated with a different first-level switch, the communication module may determine at step 720 that multiple stream channels are to be created for each processor. In some embodiments, in response to the function of creating multiple stream channels being disabled, the communication module may determine that multiple stream channels do not need to be created for each processor. In some embodiments, in response to the fact that the target computing device communicating with the computing device 311 is associated with the same first-level switch as the computing device 311, the communication module can determine that it is not necessary to create multiple flow channels for each processor. At 730, the communication module can determine that a single flow channel is created for each processor.
[0105] After determining that multiple stream channels need to be created for each processor, the communication module can obtain configuration information at 740. In some embodiments, the configuration information may include the number of channels and a list of stream identifiers. The number of channels indicates the number of stream channels that need to be created for each processor; for example, 4 means that 4 stream channels can be created for each processor.
[0106] At 750, computing device 311 can create flow channels for each processor. In response to the communication module determining that multiple flow channels are to be created for each processor, the network adapter driver in computing device 311 can create multiple flow channels for each processor based on configuration information. The network adapter driver creates multiple flow channels matching the number of channels in the configuration information. The network adapter driver can create multiple flow channels for multiple processors in computing device 311. The number of flow channels that can be created for multiple processors in computing device 311 is the product of the number of channels and the number of processors. In some embodiments, the network adapter driver further assigns multiple flow identifiers from a flow identifier list to the created multiple flow channels. In some embodiments, multiple flow identifiers and multiple links between the first-level associated switch and one or more second-level switches of computing device 311 exist in a mapping relationship. In some embodiments, in response to the communication module determining that multiple flow channels do not need to be created for each processor, the network adapter driver will not create multiple flow channels, but instead creates only a single flow channel for each processor.
[0107] In some embodiments, the communication module can acquire communication data from one or more processors. For communication data from one processor, the communication module can divide the received communication data into multiple data blocks matching the number of channels. The communication module can perform a partitioning operation on the communication data for each processor in the computing device 311 to obtain multiple data blocks. The communication module can allocate the partitioned multiple data blocks to multiple created flow channels. For each data block, the network adapter driver can assign the flow identifier of the flow channel to which the data block is assigned to a field of the data packet associated with the data block. In some embodiments, in response to the flow identifier being a User Datagram Protocol (UDP) port number, the network adapter driver can assign the flow identifier to the UDP port number field of the data packet. Alternatively, in response to the flow identifier being a queue pair number, the network adapter driver can assign the flow identifier to the queue pair number field of the data packet.
[0108] The network adapter driver can send multiple data packets, after assignment, to the network adapter 617 in the computing device. At 760, the network adapter 617 can perform flow balancing scheduling. For example, the network adapter 617 can sequentially send multiple data packets to the first-level associated switch of the computing device 610.
[0109] Figure 8 An exemplary flowchart 800 illustrates configuration operations performed by a first-level switch in a network system according to an embodiment of the present disclosure. Configuration method 800 can be performed in... Figure 3 This is executed at any first-level switch. In the following description, it will be referred to as... Figure 3 The method will be illustrated using computing device 321 as an example. However, it is understandable that this method can be applied to... Figure 3 This disclosure does not limit the scope of the application to any first-level switch. Although Figure 8 The steps shown are performed in a specific order, but it is understandable that... Figure 8 The execution order of the steps in method 800 can be changed relative to the order shown. For example, two or more steps shown consecutively can be executed simultaneously, or some steps can be executed simultaneously. Furthermore, specific steps in method 800 can be omitted. Additionally, other steps can be added. Figure 8 The flowchart is shown. It is understood that all these changes are within the scope of this disclosure.
[0110] In 802, the first-level switch 321 can receive multiple data packets, and each of the multiple data packets includes multiple flow identifiers. In some embodiments, the multiple flow identifiers are mapped to multiple links associated with the first-level switch based on a mapping relationship. In some embodiments, the multiple links associated with the first-level switch may include multiple physical links between the first-level switch and one or more second-level switches. In some embodiments, the first-level switch may be connected to all second-level switches in the network system, and correspondingly, the multiple links associated with the first-level switch include physical links between the first-level switch and all second-level switches in the network system.
[0111] by Figure 3 For example, the first-level switch 321 can be connected to the second-level switch 332 through M physical links, and can also be connected to the second-level switch 334 through M physical links. Accordingly, the links associated with the first-level switch 321 include the M links between the first-level switch 321 and the second-level switch 332, and the M links between the first-level switch 321 and the second-level switch 334.
[0112] Multiple flow identifiers in multiple data packets received by the first-level switch 321 can be mapped to multiple links associated with the first-level switch 321 based on a mapping relationship. This mapping relationship can include each flow identifier being directly mapped to the link identifier of each of the multiple links. Alternatively, the mapping relationship can include mapping each flow identifier to the link identifier of each link based on the relative relationship between each flow identifier and the number of equivalent multipaths. The mapping relationship can be understood by referring to the relevant description above; for the sake of simplicity, it will not be repeated here.
[0113] In 804, the first-level switch 321 can extract the flow identifier from each of a plurality of received data packets. In some embodiments, in response to the flow identifier being a User Datagram Protocol (UDP) port number, the first-level switch 321 can extract the flow identifier from the UDP port number field of the data packet. Alternatively, in response to the flow identifier being a queue pair number, the first-level switch 321 can extract the flow identifier from the queue pair number field of the data packet.
[0114] In 806, the first-level switch 321 can determine the link to which a flow identifier is mapped based on a mapping relationship associated with the extracted flow identifier. In some embodiments, where the mapping relationship includes a link identifier that each flow identifier can be directly mapped to each of multiple links, the first-level switch 321 can determine the link identifier to which the flow identifier is directly mapped and identify the link indicated by the link identifier as the link to which the flow identifier is mapped. In other embodiments, where the mapping relationship includes a link identifier that each flow identifier maps to each link based on a relative relationship between each flow identifier and the number of equivalent multipaths, the first-level switch 321 can determine the relative relationship between the flow identifier and the number of equivalent multipaths and, based on the determined relative relationship, determine the link identifier to which the flow identifier is mapped. The first-level switch 321 can identify the link indicated by the link identifier as the link to which the flow identifier is mapped. In some embodiments, the first-level switch 321 can determine the relative relationship by performing a modulo operation on the flow identifier and the number of equivalent multipaths, and determine the link identifier to which the flow identifier is mapped based on the result of the modulo operation.
[0115] In 808, the first-level switch 321 can forward data packets associated with the flow identifier to the link determined in 806. The data packets associated with the flow identifier are then sent through the determined link to the second-level switch (hereinafter referred to as the "second-level routing switch") that routes the data packets.
[0116] by Figure 3For example, assuming that for data packet P1, the first-level switch 321 determines that the link mapped to the flow identifier in data packet P1 is link M1 between the first-level switch 321 and the second-level switch 332. The first-level switch 321 can forward the data packet P1 to link M1, and then send the data packet P1 to the second-level routing switch 332 via link M1.
[0117] In some embodiments, after receiving multiple data packets, the second-level routing switch can perform load balancing operations similar to those of the first-level switch. The second-level routing switch can determine the link mapped to the flow identifier based on the flow identifier in the received data packets and the mapping relationship between the second-level routing switch and the first-level destination switch, and then send the data packets to the first-level destination switch via the determined link to reach the destination computing device. In some embodiments, the destination computing device can be connected to the first-level destination switch. The following description uses the second-level switch 332 as an example to illustrate the operations performed by the second-level routing switch after receiving multiple data packets.
[0118] The second-level switch 332 can receive multiple data packets (e.g., data packets from first-level switches 321 and 322), and each data packet includes multiple flow identifiers. In some embodiments, the multiple flow identifiers are mapped to multiple links (e.g., multiple downlinks) associated with the second-level routing switch based on a mapping relationship. The multiple links associated with the second-level routing switch may include multiple physical links between the second-level routing switch and the first-level destination switch. In some embodiments, the first-level destination switch may be connected to the destination computing device of the data packet. For example, with Figure 3 Let's take an example. The second-level switch 332 can be connected to the first-level switch 323 via M physical links, and also to the first-level switch 324 via M physical links. When the first-level destination switch is switch 323, the links associated with the second-level switch 332 include the M links between the second-level switch 332 and the first-level switch 323; when the first-level destination switch is switch 324, the links associated with the second-level switch 332 include the M links between the second-level switch 332 and the first-level switch 324.
[0119] The flow identifiers in the data packets received by the second-level switch 332 can be mapped to links between the second-level switch and the first-level destination switch based on a mapping relationship. This mapping relationship can include each flow identifier being directly mapped to the link identifier of each of multiple links. Alternatively, the mapping relationship can include mapping each flow identifier to the link identifier of each link based on the relative relationship between each flow identifier and the number of equivalent multipaths. The mapping relationship can be understood by referring to the relevant descriptions above; for simplicity, it will not be repeated here.
[0120] The second-level switch 332 can extract the flow identifier from each of the multiple received data packets. In some embodiments, in response to the flow identifier being a User Datagram Protocol (UDP) port number, the second-level switch 332 can extract the flow identifier from the UDP port number field of the data packet. Alternatively, in response to the flow identifier being a queue pair number, the second-level switch 332 can extract the flow identifier from the queue pair number field of the data packet.
[0121] The second-level switch 332 can determine the link to which a flow identifier is mapped based on a mapping relationship associated with the extracted flow identifier. In some embodiments, where the mapping relationship includes a link identifier that each flow identifier can be directly mapped to each of multiple links, the second-level switch 332 can determine the link identifier to which the flow identifier is directly mapped and identify the link indicated by the link identifier as the link to which the flow identifier is mapped. In other embodiments, where the mapping relationship includes a link identifier that each flow identifier maps to each link based on a relative relationship between each flow identifier and the number of equivalent multipaths, the second-level switch 332 can determine the relative relationship between the flow identifier and the number of equivalent multipaths and, based on the determined relative relationship, determine the link identifier to which the flow identifier is mapped. The second-level switch 332 can identify the link indicated by the link identifier as the link to which the flow identifier is mapped. In some embodiments, the first-level switch 332 can determine the relative relationship by performing a modulo operation on the flow identifier and the number of equivalent multipaths, and determine the link identifier to which the flow identifier is mapped based on the result of the modulo operation. In some embodiments, the number of equivalent multipaths for the second-level switch to perform the modulo operation is half the number of equivalent multipaths for the first-level switch to perform the modulo operation.
[0122] The second-level switch 332 can forward data packets associated with the flow identifier to the determined link. Through this forwarding operation, the data packets associated with the flow identifier are sent to the first-level destination switch via the determined link. Figure 3For example, assuming that for data packet P1, the second-level switch 332 determines that the link mapped to the flow identifier in data packet P1 is link M2 between the second-level switch 332 and the first-level switch 323. The second-level switch 332 can forward the data packet P1 to link M2, and then send the data packet P1 to the first-level switch 323 via link M2, so as to further send the data packet P1 to the destination computing device.
[0123] The load balancing method according to embodiments of this disclosure can conveniently plan data flows and avoid using hash algorithms, thereby evenly distributing data blocks to each physical link and achieving load balancing for data transmission. The configuration method according to embodiments of this disclosure can reduce the load on individual computing devices or switches, improve system processing speed, response speed, and reliability, and can also flexibly add more computing devices to achieve horizontal scaling of load balancing, meeting ever-increasing traffic and load demands.
[0124] Figure 9 A schematic diagram of data transmission in a system according to an embodiment of the present disclosure is shown. Figure 9 The schematic diagram of System 900 in the middle and Figure 3 The schematic diagram of system 300 is similar. For simplicity, only... Figure 9 The diagram shows some computing devices, such as computing devices 911, 912, 915, and 916, and some first-level switches, such as first-level switches 921 and 923. Furthermore, Figure 9 The diagram only shows a portion of the link.
[0125] exist Figure 9 The following description uses the example of a processor in computing device 911 sending data to computing device 915. Taking a channel count of 4 as an example, four flow channels are created for each processor. The communication data from a processor in computing device 911 is divided into four data blocks, for example, data blocks 901, 902, 903, and 904. Each data block is sent via a message, and each data message includes a flow identifier of the flow channel associated with that data block. A first-level switch 921 can execute the load balancing method according to embodiments of this disclosure to evenly distribute each data block to the uplink. For example, the first-level switch 921 can send the first data block 901 to link L1, the second data block 902 to link L2, the third data block 903 to link L3, and the fourth data block 904 to link L4.
[0126] First data block 901 and second data block 902 are received by second-level switch 932, and third data block 903 and fourth data block 904 are received by second-level switch 934. In some embodiments, second-level switches 932 and 934 may continue to execute the load balancing method according to embodiments of this disclosure and transmit each data block to the corresponding downlink for delivery to first-level destination switch 923. For example, second-level switch 932 may send first data block 901 to link L5 and second data block 902 to link L6. Second-level switch 934 may send third data block 903 to link L7 and fourth data block 904 to link L8. Thus, load balancing is achieved in system 900.
[0127] Figure 10 A schematic block diagram of an example device 1000 that can be used to implement embodiments of the present disclosure is shown. Device 1000 can be implemented as any of a computing device, a first-level switch, or a second-level switch.
[0128] As shown in the figure, device 1000 includes a processor 1001, a read-only memory (ROM) 1002, and a random access memory (RAM) 1003. The processor 1001 can perform various appropriate actions and processes according to computer program instructions stored in RAM 1002 and / or RAM 1003, or computer program instructions loaded from storage unit 1008 into ROM 1002 and / or RAM 1003. Various programs and data required for the operation of device 1000 can also be stored in ROM 1002 and / or RAM 1003. The processor 1001 and ROM 1002 and / or RAM 1003 are interconnected via bus 1004. Input / output (I / O) interface 1005 is also connected to bus 1004.
[0129] Multiple components in device 1000 are connected to I / O interface 1005, including: input unit 1006, such as keyboard, mouse, etc.; output unit 1007, such as various types of monitors, speakers, etc.; storage unit 1008, such as disk, optical disk, etc.; and communication unit 1009, such as network card, modem, wireless transceiver, etc. Communication unit 1009 allows device 1200 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0130] Processor 1001 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Examples of such implementations include, but are not limited to, a Graphics Processing Unit (GPU), various special-purpose Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc., which may accordingly be referred to as a computing unit. Processor 1001 performs the various methods and processes described above. For example, in some embodiments, the processes described above may be implemented as computer software programs tangibly contained in a computer-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1200 via ROM 1002 and / or RAM 1003 and / or communication unit 1009. When the computer program is loaded into ROM 1002 and / or RAM 1003 and executed by processor 1001, one or more steps of the processes described above may be performed. Alternatively, in other embodiments, the processor 1001 may be configured to perform the training or prediction process described above by any other suitable means (e.g., by means of firmware).
[0131] For example, Figure 10 The device 1000 can be implemented as a computing device, or as a chip or chip system within a computing device; the embodiments disclosed herein are not limited in this respect. For example, Figure 10 The device 1000 can be implemented as a first-level switch, or as a chip or chip system in a first-level switch, and the embodiments disclosed herein are not limited thereto. Figure 10 The device 1000 can also be implemented as a second-level switch, or as a chip or chip system within a second-level switch; the embodiments disclosed herein are not limited in this respect.
[0132] Embodiments of this disclosure also provide a chip, which may include an input interface, an output interface, and a processing circuit. In embodiments of this disclosure, the input and output interfaces can be used to complete the interaction of signaling or data, and the processing circuit can be used to generate and process signaling or data information to implement the configuration method or load balancing method involved in any of the above embodiments.
[0133] Embodiments of this disclosure also provide a chip system including a processor for supporting user equipment to implement the functions involved in any of the foregoing embodiments. In one possible design, the chip system may further include a memory for storing necessary program instructions and data, which, when executed by the processor, cause a device on which the chip system is installed to implement the configuration method or load balancing method involved in any of the foregoing embodiments. Exemplarily, the chip system may consist of one or more chips, or may include chips and other discrete devices.
[0134] Embodiments of this application also provide a processor for coupling with a memory storing instructions that, when executed by the processor, cause the processor to perform the configuration method or load balancing method involved in any of the above embodiments.
[0135] Embodiments of this application also provide a computer-readable storage medium storing computer instructions or program code thereon, which, when executed by a processor, cause the processor to perform the training or prediction methods involved in any of the above embodiments. The computer-readable medium can be any tangible medium that contains or stores a program for or relating to an instruction execution system, apparatus, or device. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination thereof. The computer-readable storage medium can be any available medium accessible to a computer or a data storage system such as a server or data center that integrates one or more available media. More detailed examples of computer-readable storage media include electrical connections with one or more wires, magnetic media (e.g., disks, floppy disks, hard disks, magnetic tapes, magnetic storage devices), optical media (e.g., optical storage devices, DVDs), semiconductor media (e.g., solid-state drives), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), or any suitable combination thereof.
[0136] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. Embodiments of this application also provide at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. This computer program product includes one or more computer-executable instructions, such as instructions included in a program module, which execute in a device on a target's real or virtual processor to perform the processes, methods, and functions involved in any of the above embodiments. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is 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 transferred from one computer-readable storage medium to another. For example, the computer instructions can be transferred 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) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0137] According to the configuration method or load balancing method provided in the embodiments of this application, this application also provides a computer program product, which includes: computer program code, which, when run on a computer, causes the computer to perform the processes, methods, and functions described in the above embodiments. Typically, a program module includes routines, programs, libraries, objects, classes, components, data structures, etc., that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of program modules can be combined or divided as needed. The machine-executable instructions for the program module can be executed locally or in a distributed device. In a distributed device, the program module can reside in local and remote storage media.
[0138] Computer program code used to implement the methods of this disclosure may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the computer or other programmable data processing apparatus, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be performed. The program code may be executed entirely on a computer, partially on a computer, as a stand-alone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server. In the context of this disclosure, the computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, etc. Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.
[0139] Generally, the various embodiments of this application can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects can be implemented in hardware, while others can be implemented in firmware or software, which can be executed by a controller, microprocessor, or other user equipment. Although various aspects of the embodiments of this disclosure are shown and described as block diagrams, flowcharts, or represented using some other illustration, it should be understood that the blocks, apparatuses, systems, techniques, or methods described herein can be implemented as, as non-limiting examples, in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other user equipment, or some combination thereof.
[0140] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0141] The various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to well explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein. Specific internal implementations may vary depending on the type of electronic device, the operating system it runs, the program used, and the interfaces called. The embodiments of this application are not limited in any way; any implementation that achieves the functional features described in the embodiments of this application is sufficient. The various embodiments of this application can be arbitrarily combined to achieve different technical effects.
[0142] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.
[0143] It should be noted that although embodiments of this application have been described above with reference to the accompanying drawings, these embodiments are not independent of each other, and they can be combined to obtain other embodiments. The methods, situations, categories, and classifications of embodiments in this application are only for the convenience of description and should not constitute a special limitation. Various methods, categories, situations, and features in embodiments can be combined with each other if logically consistent. The various embodiments of this application can be arbitrarily combined to achieve different technical effects. The embodiments of this application will not list various combinations.
[0144] Furthermore, although the operation of the methods of this disclosure is described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps. It should also be noted that the features and functions of two or more devices according to this disclosure may be embodied in one device. Conversely, the features and functions of one device described above may be further divided and embodied by multiple devices.
[0145] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to well explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.
Claims
1. A configuration method, executed by a computing device connected to at least one first-level switch in a network system, the at least one first-level switch being connected to at least one second-level switch via multiple links, characterized in that, The method includes: Obtain configuration information, wherein the configuration information includes the number of channels and a list of stream identifiers; Based on the product of the number of channels and the number of processors in the computing device communicating with the network system, multiple stream channels matching the product are created, wherein the multiple stream channels are used for communication data transmission between the computing device and the network system; and The multiple flow identifiers in the flow identifier list are assigned to the multiple flow channels respectively, wherein there is a mapping relationship between the multiple flow identifiers and the multiple links.
2. The method according to claim 1, characterized in that, The mapping relationship includes at least one of the following: Each flow identifier is directly mapped to the link identifier of each of the multiple links; or Based on the relative relationship between each flow identifier and the number of equivalent multipaths, each flow identifier is mapped to the link identifier of each link.
3. The method according to claim 1, characterized in that, The multiple links include multiple uplink links, and the multiple flow identifiers are mapped to at least one of the following items based on the mapping relationship: The aforementioned multiple uplinks; and The at least one second-level switch is used to route multiple downlinks between the second-level switch and the first-level destination switch for routing the communication data.
4. The method according to claim 3, characterized in that, The method further includes: Determine the number of links in the multiple uplink links; Determine the number of processors in the computing device that are directly connected to the at least one first-level switch; and The number of channels is determined based on the number of links and the number of processors, wherein the product of the number of channels and the number of processors is at least one times the number of links.
5. The method according to claim 1, characterized in that, The computing device is located in an artificial intelligence (AI) cluster, and the processor in the computing device is used to process AI tasks.
6. The method according to claim 1, characterized in that, The method further includes: Based on at least one of the following, determine that multiple stream channels are to be created for each processor in the computing device: The ability to create multiple stream channels is enabled; and The computing device is associated with different first-level switches and is used to communicate with the computing device.
7. The method according to claim 1, characterized in that, The method further includes: It is determined that it is unnecessary to create multiple stream channels for each processor in the computing device based on at least one of the following: The ability to create multiple stream channels is disabled; or The purpose of communicating with the computing device is to associate the computing device with the same first-level switch.
8. The method according to claim 1, characterized in that, For each of at least one processor communicating with the network system, the method further includes: The communication data sent by the processor is split into multiple data blocks, the same number as the number of channels; The plurality of data blocks are respectively assigned to a portion of the plurality of stream channels corresponding to the processor; For each data block, the flow identifier of the corresponding flow channel is assigned to a field in the data packet associated with that data block; and Multiple data packets associated with the multiple data blocks are sent to the destination computing device via corresponding stream channels.
9. The method according to claim 8, characterized in that, Assigning the flow identifier of the corresponding flow channel to a field in the data packet associated with that data block includes: In response to the flow identifier being a User Datagram Protocol (UDP) port number, the flow identifier is assigned to the UDP port number field of the datagram; or In response to the flow identifier being a queue pair number, the flow identifier is assigned to the queue pair number field of the data packet.
10. The method of claim 8, wherein the computing device includes a network adapter, and wherein sending a plurality of data packets associated with the plurality of data blocks to a destination computing device via respective stream channels comprises: The network adapter acquires the plurality of data packets on the corresponding flow channel; The network adapter performs scheduling on the plurality of data packets to send the plurality of data packets sequentially to the first-level switch.
11. The method according to any one of claims 1 to 10, characterized in that, The network system includes a leaf-spine network, the at least one first-level switch includes a leaf switch, and the at least one second-level switch includes a spine switch.
12. A load balancing method, executed by a network system, the network system comprising at least one first-level switch and at least one second-level switch, the at least one first-level switch being connected to the at least one second-level switch via multiple links, characterized in that, The method includes: The first-level switch receives multiple data packets, each of which includes multiple flow identifiers, and the multiple flow identifiers are mapped to the multiple links based on a mapping relationship. The first-level switch extracts the flow identifier from each of the multiple received data packets; Based on the mapping relationship associated with the extracted flow identifier, the first-level switch determines the link to which the flow identifier is mapped; and The first-level switch forwards the data packets associated with the flow identifier to the link.
13. The method according to claim 12, characterized in that, Determining the link mapped to the flow identifier includes: The first-level switch determines the link identifier directly mapped to the flow identifier; and The first-level switch identifies the link indicated by the link identifier as the link mapped to by the flow identifier.
14. The method according to claim 12, characterized in that, Determining the link mapped to the flow identifier includes: The first-level switch determines the relative relationship between the flow identifier and the number of equivalent multipaths; Based on the relative relationship, the first-level switch determines the link identifier mapped to the flow identifier; and The first-level switch identifies the link indicated by the link identifier as the link mapped to by the flow identifier.
15. The method according to claim 14, characterized in that, Based on the aforementioned relative relationship, determining the link identifier mapped to the flow identifier includes: The first-level switch performs a modulo operation between the flow identifier and the number of equivalent multipaths; and The first-level switch determines the link identifier to which the flow identifier is mapped based on the result of the remainder operation.
16. The method according to claim 12, characterized in that, Extracting the flow identifier from each of the received multiple data packets includes: In response to the flow identifier being a User Datagram Protocol (UDP) port number, the first-level switch extracts the flow identifier from the UDP port number field of the datagram; or In response to the flow identifier being a queue pair number, the first-level switch extracts the flow identifier from the queue pair number field of the data packet.
17. The method according to claim 12, characterized in that, The multiple links include multiple uplink links, and the multiple flow identifiers are mapped to at least one of the following items based on the mapping relationship: The aforementioned multiple uplinks; and Multiple downlinks between the second-level switch and the first-level destination switch.
18. The method according to claim 17, characterized in that, The multiple flow channels are used for communication data transmission between the computing device and the network system, and the multiple flow identifiers correspond to the multiple flow channels respectively.
19. The method according to claim 18, characterized in that, A first number of processors in the computing device are directly connected to the at least one first-level switch, and the product of the number of channels for each processor and the first number is at least one times the number of the plurality of links.
20. The method according to claim 18, characterized in that, The network system is located in an artificial intelligence (AI) cluster, and the processor in the computing device is used to process AI tasks.
21. The method according to claim 12, characterized in that, The network system includes a leaf-spine network, the at least one first-level switch includes a leaf switch, and the at least one second-level switch includes a spine switch.
22. A computing device connected to a network system, the network system including at least one first-level switch and at least one second-level switch, the computing device including a processor and a memory, the memory storing a computer program that, when the processor reads and executes the computer program, causes the computing device to perform the method according to any one of claims 1 to 11.
23. A network system comprising at least one first-level switch and at least one second-level switch, wherein the at least one first-level switch is connected to the at least one second-level switch via multiple links, characterized in that, The network system is configured to perform the method according to any one of claims 12 to 21.
24. A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the method according to any one of claims 1 to 11 or 12 to 21.
25. A data communication system, characterized in that, The data communication system includes: A network system comprising at least one primary switch and at least one secondary switch, wherein the at least one primary switch is connected to the at least one secondary switch via multiple links; and A computing device, connected to the network system, is configured to: Obtain configuration information, wherein the configuration information includes the number of channels and a list of stream identifiers; Based on the product of the number of channels and the number of processors in the computing device communicating with the network system, multiple stream channels matching the product are created, wherein the multiple stream channels are used for communication data transmission between the computing device and the network system; and The multiple different flow identifiers in the flow identifier list are assigned to the multiple flow channels, wherein there is a mapping relationship between the multiple flow identifiers and the multiple links. The network system is configured as follows: The first-level switch receives multiple data packets, wherein each of the multiple data packets includes multiple flow identifiers, wherein the multiple data packets are respectively assigned to multiple flow channels, and the multiple flow identifiers respectively correspond to the multiple flow channels; The first-level switch extracts the flow identifier from each of the multiple received data packets; Based on the mapping relationship associated with the extracted flow identifier, the first-level switch determines the link to which the flow identifier is mapped; and The first-level switch forwards the data packets associated with the flow identifier to the link.