Switch load balancing method and device, electronic equipment and storage medium

By balancing the directional flows on each equivalent edge in the switch cluster in the N-layer switch network, the problem of unbalanced switch load is solved, and data transmission efficiency and network throughput are improved.

CN119743432AActive Publication Date: 2025-04-01BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411856360.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-01
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

During data transmission, unbalanced switch load results in a decrease in data transmission efficiency and network throughput.

Method used

A switch load balancing method is adopted to ensure that the allocation of data flows between switches is more balanced by equalizing the directional flows on each equivalent edge in the switch cluster in the N-layer switch network.

Benefits of technology

The load balancing of switches in a multi-layer switch network is improved, thereby improving the load balancing effect of the overall switch network and improving data transmission efficiency and network throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743432A_ABST
    Figure CN119743432A_ABST
Patent Text Reader

Abstract

The invention discloses a switch load balancing method and device, electronic equipment and a storage medium, and relates to the technical field of computers, in particular to the field of artificial intelligence such as big data and cloud computing. The method is applied to an N-layer switch network, the N-layer switch network comprises a plurality of switch clusters and an Nth-layer switch, each switch cluster comprises first N-1-layer switches, and N is an integer greater than or equal to 3. According to the specific implementation scheme, balance adjustment is carried out on first direction flow of a first endpoint switch on each equivalent edge of the first endpoint switch and a second layer switch in a first layer switch in a first switch cluster; performing balance adjustment on the first direction flow of the ith layer switch on each equivalent edge of the ith layer switch and the (i + 1) th layer switch in the first switch cluster; and performing balance adjustment on the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer of switches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, in particular to artificial intelligence fields such as big data and cloud computing, and specifically to a switch load balancing method, device, electronic device and storage medium. Background Art

[0002] With the advent of the information age, the amount of data processing has shown an exponential growth. Therefore, in the process of data transmission, switches are often load balanced to improve data transmission efficiency and network throughput. Summary of the invention

[0003] The present application provides a switch load balancing method, device, electronic device and storage medium.

[0004] According to one aspect of the present application, a switch load balancing method is provided, which is applied to an N-layer switch network, wherein the N-layer switch network includes multiple switch clusters and an N-th layer switch, each switch cluster includes the first N-1 layers of switches, where N is an integer greater than or equal to 3, and the method includes:

[0005] Balance and adjust the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch in the first layer switch in the first switch cluster and the second layer switch;

[0006] Balance the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster; when N=3, i=2; when N>3, the value of i is 2,,,N-1 in sequence;

[0007] The first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch is balanced and adjusted; wherein the second switch cluster is a switch cluster to which the second endpoint switch of the first direction flow of the Nth layer switch belongs.

[0008] According to another aspect of the present application, a switch load balancing device is provided, which is applied to an N-layer switch network, wherein the N-layer switch network includes multiple switch clusters and an N-th layer switch, each switch cluster includes the first N-1 layers of switches, where N is an integer greater than or equal to 3, and the device includes:

[0009] A first adjustment module is used to balance and adjust the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch in the first layer switch in the first switch cluster;

[0010] The second adjustment module is used to balance the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster; when N=3, i=2; when N>3, the value of i is 2,,,N-1 in sequence;

[0011] The third adjustment module is used to balance the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch; wherein the second switch cluster is the switch cluster to which the second endpoint switch of the first direction flow of the Nth layer switch belongs.

[0012] According to another aspect of the present application, there is provided an electronic device, including:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can perform the method described in the above embodiment.

[0016] According to another aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to the above embodiment.

[0017] According to another aspect of the present application, a computer program product is provided, including a computer program, wherein the computer program implements the steps of the method described in the above embodiment when executed by a processor.

[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0020] Figure 1 A schematic diagram of a flow chart of a switch load balancing method provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of a four-layer switch network provided for an embodiment of the present application;

[0022] Figure 3 A schematic diagram of a three-layer switch network provided in an embodiment of the present application;

[0023] Figure 4 A flow chart of a switch load balancing method provided by another embodiment of the present application;

[0024] Figure 5 A flow chart of a switch load balancing method provided by another embodiment of the present application;

[0025] Figure 6 A flow chart of a switch load balancing method provided by another embodiment of the present application;

[0026] Figure 7 A schematic diagram of the structure of a switch load balancing device provided in an embodiment of the present application;

[0027] Figure 8 It is a block diagram of an electronic device used to implement the switch load balancing method of the embodiment of the present application. DETAILED DESCRIPTION

[0028] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0029] The following describes the switch load balancing method, device, electronic device and storage medium according to the embodiments of the present application with reference to the accompanying drawings.

[0030] Figure 1 A flow chart of a switch load balancing method provided in an embodiment of the present application.

[0031] The switch load balancing method of the embodiment of the present application may be executed by a switch load balancing device of the embodiment of the present application, and the device may be configured in an electronic device.

[0032] Among them, the electronic device can be any device with computing capabilities, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0033] Exemplarily, the switch load balancing method of the embodiment of the present application can be applied to an N-layer switch network, which may include multiple switch clusters and an N-th layer switch, each switch cluster includes the first N-1 layers of switches, and N is an integer greater than or equal to 3.

[0034] Among them, the Nth layer switch can be used to forward data flows between different switch clusters.

[0035] The first layer of switches in each switch cluster may include at least one top-of-cabinet switch group. The top-of-cabinet switch group may refer to a group of switches deployed on each server cabinet, and the server may be directly connected to the switch in the top-of-cabinet switch group to realize the interconnection between the server and the switch in the cabinet.

[0036] Exemplarily, when N is greater than or equal to 4, each switch cluster may include multiple top-of-cabinet switch groups; when N=3, each switch cluster may include one top-of-cabinet switch group.

[0037] For example, when N=4, Figure 2 The four-layer switch network shown includes two switch clusters and fourth-layer switches APG1 and APG2. The switches APG1 and APG2 can forward data flows between the two switch clusters.

[0038] Figure 2 In the example, one of the switch clusters includes the top switch group A1 and the top switch group A2 on the first layer, the switches LEG1, LEG2, LEG3, LEG4, LEG5, and LEG6 on the second layer, and the switches SPG1 and SPG2 on the third layer. Each switch in the top switch group A1 can be fully connected with LEG1, LEG2, and LEG3, each switch in the top switch group A2 can be fully connected with LEG4, LEG5, and LEG6, switches LEG1, LEG2, LEG3, LEG4, LEG5, and LEG6 can all be fully connected with SPG1 and SPG2, and switches SPG1 and SPG2 can all be fully connected with APG1 and APG2.

[0039] Figure 2 In the example, another switch cluster includes the top switch group B1 and the top switch group B2 on the first layer, the switches LEG7, LEG8, LEG9, LEG10, and LEG11 on the second layer, and the switches SPG3 and SPG4 on the third layer. Each switch in the top switch group B1 can be fully connected with LEG7, LEG8, and LEG9, each switch in the top switch group B2 can be fully connected with LEG10 and LEG11, switches LEG7, LEG8, LEG9, LEG10, and LEG11 can all be fully connected with SPG3 and SPG4, and switches SPG3 and SPG4 can all be fully connected with APG1 and APG2.

[0040] For example, N = 3, Figure 3The three-layer switch network shown includes three switch clusters and switches SPG_1, SPG_2, SPG_3, and SPG_4 at the Nth layer.

[0041] Figure 3 In the example, one of the switch clusters includes the top-of-cabinet switch group a1 on the first layer and switches LEG_1, LEG_2, and LEG_3 on the second layer. Each switch in the top-of-cabinet switch group a1 can be fully connected with LEG_1, LEG_2, and LEG_3, and LEG_1, LEG_2, and LEG_3 can be fully connected with SPG_1, SPG_2, SPG_3, and SPG_4.

[0042] Figure 3 In the example, another switch cluster includes the top switch group a2 on the first layer and switches LEG_4, LEG_5, and LEG_6 on the second layer. Each switch in the top switch group a2 can be fully connected with LEG_4, LEG_5, and LEG_6, and LEG_4, LEG_5, and LEG_6 can be fully connected with SPG_1, SPG_2, SPG_3, and SPG_4.

[0043] Figure 3 In the example, another switch cluster includes the top switch group a3 of the first layer and the switches LEG_7, LEG_8, and LEG_9 of the second layer. Each switch in the top switch group a3 can be fully connected with LEG_7, LEG_8, and LEG_9, and LEG_7, LEG_8, and LEG_9 can be fully connected with SPG_1, SPG_2, SPG_3, and SPG_4.

[0044] Figure 3 In the example, switches SPG_1, SPG_2, SPG_3, and SPG_4 can forward data flows between different switch clusters. Figure 3 In the switch cluster where the cabinet top switch group a1 is located, the data flow flowing out from the switch IBG_11 can flow through the switches LEG_2, SPG_1, and LEG_4 in sequence, and flow to the destination switch IBG_22 in other switch clusters. The data flow flowing out from the switch IBG_12 flows through the switches LEG_3, SPG_2, and LEG_7 in sequence, and flows to the switch IBG_32 in other switch clusters.

[0045] like Figure 1 As shown, the switch load balancing method includes:

[0046] Step 101 , balance adjustment is performed on a first direction flow of a first endpoint switch on each equivalent edge between a first endpoint switch in a first layer of switches in a first switch cluster and a second layer switch.

[0047] The first switch cluster is any switch cluster among multiple switch clusters.

[0048] The first layer switch can be a source switch or a destination switch. The source switch can be the switch that the data flow first passes through after being sent from the source server, and the destination switch can be the last switch that the data flow passes through before being transmitted from the source server to the destination server.

[0049] Exemplarily, the first endpoint switch in the first layer of switches in each switch cluster can be the source switch of the outgoing data flow flowing to the cabinet top switch group in other switch clusters. Exemplarily, the first endpoint switch in the first layer of switches can also be the destination switch of the data flow flowing from the cabinet top switch group in other switch clusters.

[0050] In the present application, switches in different cabinet top switching groups in each switch cluster can be switches that are fully connected with different switches in the second layer. Among them, the switches that are fully connected with the switches in the cabinet top switching group can be one or more, and the number of switches fully connected to different cabinet top switching groups can be the same or different, and there is no limitation on this.

[0051] for example, Figure 2 In the four-layer switch network shown in , taking the cabinet top switch groups A1 and A12 as examples, the cabinet top switch group A1 includes three switches, namely IBG1_1, IBG1_2, and IBG1_3, and the cabinet top switch group A2 includes three switches, namely IBG2_1, IBG2_2, and IBG2_3.

[0052] Among them, the switches in the cabinet top switch A1 can be fully connected with LEG1, LEG2, and LEG3 in the second-layer switches. There are three equivalent paths between the switches in the cabinet top switch A1 and LEG1, LEG2, and LEG3, which can be called equivalent edges; the switches in the cabinet top switch A2 can be fully connected with LEG4, LEG5, and LEG6. There are also three equivalent edges between the switches in the cabinet top switch A2 and LEG4, LEG5, and LEG6.

[0053] Exemplarily, for each switch cluster, the first direction flows on each equivalent edge between the first endpoint switch in each top-of-cabinet switch group and the fully connected switches in the second layer switches may be balanced and adjusted in turn.

[0054] In the present application, the first direction flow may refer to a data flow in the first direction, and the first direction may be inbound or outbound, where inbound and outbound are relative to the device. The inbound flow may refer to the data flow flowing into the device, and the outbound flow may refer to the data flow flowing out of the device.

[0055] Exemplarily, the first endpoint switch is a source switch, and the first directional flow is an outbound flow, then the outbound flow of the source switch refers to the data flow flowing out of the source switch. Exemplarily, the first endpoint switch is a destination switch, and the first directional flow is an inbound flow, then the inbound flow of the destination switch refers to the data flow flowing into the destination switch.

[0056] It should be noted that a switch can have both inbound and outbound flows. The outbound flow of a switch refers to the data flow that flows into the switch, and the outbound flow of a switch refers to the data flow that flows out of the switch.

[0057] Step 102 : Balance and adjust the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster.

[0058] Among them, when N=3, i=2; when N>3, the values ​​of i are 2,,,N-1. For example, when N=4, the values ​​of i are 2, 3; when N=5, the values ​​of i are 2, 3, 4; when N=6, the values ​​of i are 2, 3, 4, 5; when N=7, the values ​​of i are 2, 3, 4, 5, 6.

[0059] In the present application, in each switch cluster, starting from the second-layer switch, each switch in the lower-layer switch can be balanced and adjusted in turn on each equivalent edge of the fully connected switch in the adjacent higher-layer switch in the order of the switch layers from low to high.

[0060] For example, N=4, the first direction flow is the outbound flow, and for each switch cluster, the outbound flow of the second-layer switch on each equivalent edge between the second-layer switch and the third-layer switch can be balanced and adjusted, and then the outbound flow of the third-layer switch on each equivalent edge between the third-layer switch and the fourth-layer switch can be balanced and adjusted.

[0061] The outbound flow of the second-layer switch refers to the data flow flowing out of the second-layer switch, and the outbound flow of the third-layer switch refers to the data flow flowing out of the third-layer switch.

[0062] for example, Figure 2In one of the switch clusters, switches LEG1, LEG2, and LEG3 in the second layer can be fully connected with switches SPG1 and SPG2 in the third layer, and switches LEG4, LEG5, and LEG6 in the second layer can be fully connected with switches SPG3 and SPG4 in the third layer. Therefore, the first direction flow of switch LEG1 on the equivalent edge between switch LEG1 and switches SPG1 and SPG2 can be balanced, the first direction flow of switch LEG2 on the equivalent edge between switch LEG2 and switches SPG1 and SPG2 can be balanced, and the first direction flow of switch LEG3 on the equivalent edge between switch LEG3 and switches SPG1 and SPG2 can be balanced.

[0063] Similarly, the first direction flow of switch LEG4 on the equivalent edge between switch LEG4 and switches SPG3 and SPG4 is balanced and adjusted, the first direction flow of switch LEG5 on the equivalent edge between switch LEG5 and switches SPG3 and SPG4 is balanced and adjusted, and the first direction flow of switch LEG6 on the equivalent edge between switch LEG6 and switches SPG3 and SPG4 is balanced and adjusted. After that, the first direction flow on the equivalent edge between SPG1 and SPG2 in the second layer and APG1 and APG2 can be balanced and adjusted respectively.

[0064] Figure 2 In another switch cluster, switches LEG7, LEG8, and LEG9 in the second layer can be fully connected with switches SPG3 and SPG4 in the third layer, and switches LEG10 and LEG11 in the second layer can be fully connected with switches SPG3 and SPG4 in the third layer. Therefore, the first direction flow of switch LEG7 on the equivalent edge between switch LEG7 and switches SPG3 and SPG4 can be balanced and adjusted, the first direction flow of switch LEG8 on the equivalent edge between switch LEG8 and switches SPG3 and SPG4 can be balanced and adjusted, and the first direction flow of switch LEG9 on the equivalent edge between switch LEG9 and switches SPG3 and SPG4 can be balanced and adjusted; the first direction flow of switch LEG10 on the equivalent edge between switch LEG10 and switches SPG3 and SPG4 can be balanced and adjusted, and the first direction flow of switch LEG11 on the equivalent edge between switch LEG11 and switches SPG3 and SPG4 can be balanced and adjusted. Afterwards, the first direction flows on the equivalent edges between SPG3 and SPG4 in the second layer switch and APG1 and APG2 can be balanced and adjusted respectively.

[0065] Step 103 , balance and adjust the first direction flows corresponding to the second switch cluster in the first direction flows of the Nth layer switches.

[0066] Since the layer N switch is used to transfer data flows between different switch clusters, data flows flowing out of the layer N switch may flow to different switch clusters, or flow from different switch clusters to the layer N switch.

[0067] Based on this, in the present application, the second endpoint switch of the first direction flow of the Nth layer switch can be determined first, and the second switch cluster can be determined according to the switch cluster to which the second endpoint switch belongs, and then the first direction flow corresponding to the second switch cluster can be balanced and adjusted.

[0068] The first direction flow corresponding to the second switch cluster refers to the first direction flow of the Nth layer switch, in which the switch cluster to which the second endpoint switch belongs is the second switch cluster.

[0069] The second endpoint switch corresponds to the first endpoint switch. For example, if the first endpoint switch is a source switch, then the second endpoint switch is a destination switch; if the first endpoint switch is a destination switch, then the second endpoint switch is a source switch.

[0070] Exemplarily, the first direction flow of the Nth layer switch on the equivalent edge between the Nth layer switch and the N-1th switch in the second switch cluster can be balanced and adjusted, and the first direction flow of the N-1th layer switch on the equivalent edge between the N-1th layer switch in the second switch cluster and the N-2th switch in the second switch cluster can be balanced and adjusted, until the first direction flow of the fourth layer switch on the equivalent edge between the fourth layer switch in the second switch cluster and the third switch in the second switch cluster is balanced and adjusted. After that, in the second switch cluster, the first direction flow from the third layer switch to the first layer switch is adjusted.

[0071] For example, taking the first direction flow as the outgoing flow, Figure 2 In the process, the outgoing flows of the first endpoint switch in the first layer of switches in the two switch clusters and the first endpoint switch on each equivalent edge between the second layer switch and the second layer switch are balanced, the outgoing flows of the second layer on each equivalent edge between the second layer switch and the third layer switch are balanced, and the outgoing flows of the third layer on each equivalent edge between the third layer switch and the fourth layer switch are balanced. After that, the first direction flows of the fourth layer switch on the equivalent edge between the fourth layer switch and the third switch in each switch cluster are balanced. Then, the outgoing flows of the third layer switches in each switch cluster are balanced.

[0072] In the embodiment of the present application, for the first switch cluster, the first direction flow on each equivalent edge between the first endpoint switch in the first layer switch and the second layer switch in the first switch cluster is balanced and adjusted. In the first switch cluster, in order of the switch layers from low to high, starting from the second layer switch, the first direction flow on each equivalent edge between the lower layer switch and the adjacent higher layer switch is balanced and adjusted in sequence, and then the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch is balanced and adjusted, thereby improving the load balancing degree of the switches in the multi-layer switch network, and then improving the load balancing effect of the overall switch network.

[0073] Figure 4 A flow chart of a switch load balancing method provided in an embodiment of the present application.

[0074] like Figure 4 As shown, the switch load balancing method includes:

[0075] Step 401 : Balance and adjust the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch in the first layer switch in the first switch cluster.

[0076] Step 402 : Balance and adjust the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster.

[0077] In the present application, step 401-step 402 can be implemented in any of the embodiments of the present application, so they will not be described in detail here.

[0078] Step 403: In the Nth layer switch and the second switch cluster, a first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch is balanced and adjusted.

[0079] Among them, when N=4, j=4; when N>4, the values ​​of j are N,,,,4. For example, when N=5, the values ​​of j are 5,4; when N=6, the values ​​of j are 6,5,4; when N=7, the values ​​of j are 7,6,5,4; when N=8, the values ​​of j are 7,7,6,5,4.

[0080] In the present application, in the N-layer switch and the second switch cluster, starting from the N-layer switch, each switch in the higher-layer switch and each equivalent edge of the fully connected switch in the adjacent lower-layer switch are sequentially balanced and adjusted for the first direction flow of each switch in the higher-layer switch, until each switch in the fourth-layer switch and each equivalent edge of the fully connected switch in the third-layer switch are balanced and adjusted for the outgoing flow of each switch in the fourth-layer switch.

[0081] For example, N=5, the first direction flow is the outbound flow, and in the cluster of the fifth-layer switch and the second switch, the outbound flow of the fifth-layer switch on each equivalent edge between the fifth-layer switch and the fourth-layer switch can be balanced and adjusted, and then the outbound flow of the fourth-layer switch on each equivalent edge between the fourth-layer switch and the third-layer switch can be balanced and adjusted.

[0082] The outbound flow of the fifth layer switch refers to the data flow flowing out of the fifth layer switch, and the outbound flow of the fourth layer switch refers to the data flow flowing out of the fourth layer switch.

[0083] Taking the first direction flow as the outgoing flow as an example, Figure 2 In the example, the outbound flow from APG1 to the cabinet top switch groups B1 and B2 on the equivalent edge between APG1 and SPG3 and SPG4 in the fourth layer switch can be balanced and adjusted, and the outbound flow from APG2 to the cabinet top switch groups B1 and B2 on the equivalent edge between APG2 and SPG3 and SPG4 can be balanced and adjusted.

[0084] Step 404: group the first direction flow of the third layer switch according to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch belongs, to obtain at least one first group.

[0085] Taking the first direction flow as the outgoing flow as an example, since in a switch network of four layers and above, the cabinet-top switch group to which the outgoing flow of the third-layer switch in each switch cluster flows may be different, based on this, in the present application, in the second switch cluster, the second endpoint switch of the first direction flow of the third-layer switch can be determined, and then the first direction flow of the third-layer switch can be grouped according to the cabinet-top switch group to which the second endpoint switch corresponding to the first direction flow of the third-layer switch belongs, to obtain at least one first group.

[0086] Exemplarily, the first direction flows of the third layer switches belonging to the same top-of-cabinet switch group may be divided into the same group to obtain at least one first group.

[0087] The first direction flows of the third layer switches in each first group belong to the same cabinet top switch group.

[0088] For example, the first endpoint switch is the source switch, the second endpoint switch is the destination switch, and the first direction flow is the outbound flow. Then, the outbound flows of the third-layer switches whose destination switches correspond to the outbound flows of the third-layer switches belong to the same cabinet top switch group can be divided into the same group. Among them, the outbound flows of the third-layer switches in the same first group flow into the same cabinet top switch group.

[0089] For example, the first endpoint switch is the destination switch, the second endpoint switch is the source switch, and the first direction flow is the inbound flow. Then, the inbound flows of the third-layer switches whose source switches correspond to the inbound flows of the third-layer switches belong to the same cabinet top switch group can be divided into the same group. Among them, the inbound flows of the third-layer switches in the same first group flow out from the same cabinet top switch group.

[0090] For example, taking the first direction flow as the outgoing flow, Figure 2 In the figure, since the outgoing flows of SPG3 and SPG4 flow into the cabinet top switch group B1, the outgoing flows of SPG3 and SPG4 can be regarded as a first group; since the outgoing flows of SPG3 and SPG4 flow into the cabinet top switch group B2, the outgoing flows of SPG3 and SPG4 can be regarded as a first group.

[0091] Step 405: Balance and adjust the first direction flow of the third layer switch in the first group.

[0092] In the present application, the data flow in each first group is adjusted separately. The first direction flow of the third layer switch on each equivalent edge between the third layer switch in the first group and the switch corresponding to the first group in the second layer switch can be adjusted first, and then the second direction flow of the switch in the cabinet top switch group corresponding to the first group on each equivalent edge between the switch in the cabinet top switch group corresponding to the first group and the switch corresponding to the first group in the second layer switch can be adjusted.

[0093] The cabinet top switch group corresponding to the first group refers to the cabinet top switch group to which the first direction flow of the third layer switch in the first group belongs.

[0094] The switch corresponding to the first group in the second layer switch refers to a switch that is fully connected to the switches in the cabinet top switch group corresponding to the first group in the second layer switch.

[0095] for example, Figure 2In the example, if the outbound flow of a first group including SPG3 and SPG4 flows to the top switch group B1, the switches corresponding to the first group in the second layer switch are LEG7, LEG8, and LEG9. After adjustment, the outbound flow of the source switch IBG1_1 flows through the switches LEG2, SPG1, APG1, SPG3, and LEG7 in sequence, and flows to IBG3_2. The outbound flow of the source switch IBG2_1 flows through the switches LEG5, SPG2, APG1, SPG4, and LEG9 in sequence, and flows to IBG3_3.

[0096] The second direction flow refers to a data flow in a second direction, which is opposite to the first direction. For example, if the first direction flow is an outbound flow, the second direction is an inbound flow; if the first direction flow is an inbound flow, the second direction is an outbound flow.

[0097] for example, Figure 2 In the embodiment, for the source switches of the outgoing flows in each cabinet top switch group that flow to other cabinet top switch groups, the method of this embodiment can be used to balance the outgoing flows on each equivalent edge between the source switch in the first layer switch and the second layer switch in each switch cluster, and then balance the outgoing flows on each equivalent edge between the second layer switch and the third layer switch in each switch cluster, and then balance the outgoing flows on each equivalent edge between the third layer switch and the fourth layer switch in each switch cluster, and then balance the third layer switch in each switch cluster according to the outgoing flows of APG_1 and APG_2, and for each switch cluster, balance the outgoing flows of the third layer switches in the first group.

[0098] For example, the method for balancing the first direction flow of the third layer switch in the first group can be referred to as follows: Figure 5 The embodiments described above will not be described in detail here.

[0099] In the embodiment of the present application, by balancing and adjusting the first direction flow on each equivalent edge between the first endpoint switch and the second layer switch in the first layer switch, starting from the second layer switch in the order of the switch layers from low to high, balancing and adjusting the first direction flow on each equivalent edge between the lower layer switch and the adjacent higher layer switch in turn, and then starting from the Nth layer switch in the order of the switch layers from high to low, balancing and adjusting the first direction flow on each equivalent edge between the higher layer switch and the adjacent lower layer switch in turn, for the first direction flow from the third layer switch to the first layer switch, grouping is performed according to the cabinet top switch group to which the second endpoint switch of the first direction flow belongs, and balancing and adjusting each group individually, thereby improving the load balancing effect of the overall switch network.

[0100] Figure 5This is a flow chart of a switch load balancing method provided by another embodiment of the present application. This embodiment is described by taking a three-layer switch network as an example.

[0101] like Figure 5 As shown, the switch load balancing method includes:

[0102] Step 501 : Balance and adjust the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch in the first layer switch in the first switch cluster and the second layer switch.

[0103] Exemplarily, the switch cluster to which the second endpoint switch corresponding to the first direction flow of each endpoint switch in the first layer of switches belongs can be determined. If the switch cluster to which any endpoint switch belongs is different from the switch cluster to which the second endpoint switch corresponding to the first direction flow of the endpoint switch belongs, the endpoint switch is determined as the first endpoint switch.

[0104] Taking the first endpoint switch as the source switch as an example, the switch cluster to which the target switch corresponding to the outgoing flow of each source switch in the first layer of switches belongs can be determined. If the switch cluster to which any source switch belongs is different from the switch cluster to which the destination switch corresponding to the outgoing flow of the source switch belongs, the source switch is determined as the first endpoint switch.

[0105] for example, Figure 3 In the figure, the destination switch of the outgoing flow of switch IBG_11 is IBG_22. Then switch IBG_11 is in the switch cluster where the top switch group a1 is located, and IBG_22 is in the switch cluster where the top switch group a2 is located. Therefore, switch IBG_11 belongs to the first endpoint switch. Similarly, it can be determined that switch IBG_12 is also the first endpoint switch.

[0106] Therefore, based on the switch cluster to which the second endpoint switch corresponding to the first direction flow of each endpoint switch in the first layer switch belongs, it is determined which endpoint switches in the first layer switch are the first endpoint switches with high accuracy, which improves the basis for subsequent load balancing adjustment of the multi-layer switch network.

[0107] Step 502: Balance and adjust the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster.

[0108] Here, the value of i is 2.

[0109] Step 503: group the first direction flow of the third layer switch according to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch belongs, to obtain at least one first group.

[0110] In the present application, step 503 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.

[0111] Step 504: group the first direction flow of the third layer switch in the first group according to the second endpoint switch to obtain at least one second group.

[0112] In the present application, the first direction flow of the third layer switch in the first group can be grouped according to the second endpoint switch of the first direction flow of the third layer switch in the first group to obtain at least one second group.

[0113] The second endpoint switch is a switch of the cabinet top switch group corresponding to the first group.

[0114] The second endpoint switches to which the first direction flows of the third layer switches in the same second group belong are the same.

[0115] Exemplarily, the first endpoint switch is a source switch, the second endpoint switch is a destination switch, the first direction flow is an outbound flow, and the outbound flows of the third-layer switch in the same second group flow to the same destination switch. The outbound flows of the third-layer switch in the first group can be grouped according to the destination switch of the outbound flows of the third-layer switch in the first group to obtain at least one second group. The outbound flow of the third-layer switch refers to the data flow flowing out from the third-layer switch. In other words, the data flows in the first group flowing to the same destination switch can be divided into the same second group.

[0116] Exemplarily, the first endpoint switch is the destination switch, the second endpoint switch is the source switch, the first direction flow is the inbound flow, and the inbound direction flow of the third-layer switch in the same second group flows out from the same source switch. The inbound flow of the third-layer switch in the first group can be grouped according to the source switch of the inbound flow of the third-layer switch in the first group to obtain at least one second group. Among them, the inbound flow of the third-layer switch refers to the data flow flowing into the third-layer switch. In other words, the data flow flowing out from the same destination switch in the first group can be divided into the same second group.

[0117] Step 505, for the second group, according to the number of first-direction flows of the third-layer switch on each equivalent edge between the third-layer switch and the switch corresponding to the first group in the second-layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the third-layer switch and the switch corresponding to the first group.

[0118] In the present application, equalization adjustment can be performed individually for each second group.

[0119] Exemplarily, the number of first direction flows on each equivalent edge of the third layer switch and the switch corresponding to the first group in the second layer switch can be compared to determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows.

[0120] It should be noted that the equivalent edge with the largest number of first-directional flows may be one or more, and the equivalent edge with the smallest number of first-directional flows may be one or more.

[0121] Step 506, according to the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among the equivalent edges between the third layer switch and the switch corresponding to the first group, balance adjustment is performed on the first direction flows of the third layer switch on each equivalent edge between the third layer switch and the switch corresponding to the first group.

[0122] Exemplarily, the first equivalent edge can be determined from the equivalent edge with the largest number of flows in the first direction, and the second equivalent edge can be determined from the equivalent edge with the smallest number of flows in the first direction, and the second number of first-direction flows on the first equivalent edge can be scheduled to be transmitted on the second equivalent edge, and then the equivalent edge with the largest number of flows in the first direction and the equivalent edge with the smallest number of flows in the first direction can be re-determined until the data flow balance condition is met.

[0123] Take the example of grouping data streams according to the destination switch, for example, Figure 3 There is an outbound flow on SPG_3 flowing to the top-of-cabinet switch group a3. Assuming that the number of outbound flows of SPG_3 on the equivalent edges between SPG_3 and LEG_7, LEG_8, and LEG_9 are 8, 8, and 5 respectively, the equivalent edge between SPG_3 and LEG_7 is the first equivalent edge, and the equivalent edge between SPG_3 and LEG_9 is the second equivalent edge, then an outbound flow of SPG_3 on the first equivalent edge can be scheduled to the second equivalent edge for transmission.

[0124] The outbound flow of SPG_3 refers to the data flow flowing out of SPG_3.

[0125] Exemplarily, if there are multiple second groups, the first-direction flows of the third-layer switches in the multiple second groups on each equivalent edge of the switch corresponding to the first group in the second-layer switches can be balanced and adjusted in turn. In order to ensure that the balance of the first-direction flows in the adjusted second groups is not affected, for the third-layer switches in the second group currently being balanced, the seventh number of first-direction flows of the third-layer switches in the target group on each equivalent edge of the switch corresponding to the first group in the second-layer switches is determined, and the seventh number of first-direction flows on the same equivalent edge is added to the number of the third switches in the second group currently being balanced on the same equivalent edge to obtain the eighth number of first-direction flows on the same equivalent edge, and then the eighth number of first-direction flows on each equivalent edge is compared, and the equivalent edge with the largest eighth number is determined as the equivalent edge with the largest number of first-direction flows, and the equivalent edge with the smallest eighth number is determined as the equivalent edge with the smallest number of first-direction flows.

[0126] The target group may refer to a balanced and adjusted group in at least one second group obtained by grouping the first direction flow of the third layer switch in the second group according to the second endpoint switch.

[0127] It can be understood that the third number of first-direction flows of the third-layer switch in the target group on each equivalent edge of the switch corresponding to the first group in the second-layer switch is uniform.

[0128] It should be noted that the target group can be one or more, and there is no limitation on this.

[0129] Exemplarily, if there is one equivalent edge with the largest number of flows in the first direction, the equivalent edge with the largest number of flows in the first direction may be determined as the first equivalent edge.

[0130] Exemplarily, if there are multiple equivalent edges with the largest number of flows in the first direction, one of the multiple equivalent edges with the largest number of flows in the first direction may be randomly selected as the first equivalent edge.

[0131] Exemplarily, if there are multiple equivalent edges with the largest number of flows in the first direction, the number of data flows passing through each second-layer switch corresponding to the equivalent edge with the largest number of flows in the first direction is determined, and the equivalent edge corresponding to the second-layer switch corresponding to the largest number of data flows passing through can be determined as the first equivalent edge.

[0132] Exemplarily, if there is only one equivalent edge with the smallest number of flows in the first direction, the equivalent edge with the smallest number of flows in the first direction may be determined as the second equivalent edge.

[0133] Exemplarily, if there are multiple equivalent edges with the smallest number of flows in the first direction, one of the multiple equivalent edges with the smallest number of flows in the first direction may be randomly selected as the second equivalent edge.

[0134] Exemplarily, if there are multiple equivalent edges with the smallest number of flows in the first direction, the number of data flows passing through each second-layer switch corresponding to the equivalent edge with the smallest number of flows in the first direction is determined, and the equivalent edge corresponding to the second-layer switch corresponding to the smallest number of data flows can be determined as the second equivalent edge.

[0135] Optionally, if the second direction flow of the second endpoint switch corresponding to the second group on each equivalent edge of the switch corresponding to the first group is unbalanced, the equivalent edge with the largest number of second direction flows and the equivalent edge with the smallest number of second direction flows of the second endpoint switch corresponding to the second group can be determined among each equivalent edge between the second endpoint switch corresponding to the second group and the switch corresponding to the first group, and then, based on the equivalent edge with the largest number of second direction flows and the equivalent edge with the smallest number of second direction flows, the second direction flow of the second endpoint switch corresponding to the second group on each equivalent edge of the switch corresponding to the first group is balanced and adjusted.

[0136] The imbalance of the second directional flows on the equivalent edges may refer to that the difference between the numbers of the second directional flows on the equivalent edges is greater than 1.

[0137] Exemplarily, if the second direction flow of the second endpoint switch corresponding to the second group is unbalanced on each equivalent edge of the switch corresponding to the first group, determine whether the equivalent edge with the smallest number of second direction flows can be balanced based on the equivalent edge with the largest number of second direction flows. If so, a second direction flow on the equivalent edge with the largest number of second direction flows can be scheduled to the equivalent edge with the smallest number of second direction flows, and the equivalent edge with the largest number of second direction flows and the equivalent edge with the smallest number of second direction flows can be re-determined, and continue to determine whether the equivalent edge with the smallest number of second direction flows can be balanced based on the equivalent edge with the largest number of second direction flows.

[0138] Therefore, by performing balancing adjustment based on the equivalent edge with the largest number of second directional flows and the equivalent edge with the smallest number of second directional flows, the complexity of the adjustment can be reduced and the balancing efficiency and balance degree of the second directional flows on each equivalent edge of the second endpoint switch can be improved.

[0139] for example, Figure 3In the embodiment, for the source switch of the outgoing flow in each cabinet top switch group flowing to other cabinet top switch groups, the method of this embodiment can be used to balance the outgoing flow on each equivalent edge between the source switch and the second layer switch in the first layer switch in each switch cluster, and then balance the outgoing flow on each equivalent edge between the second layer switch and the third layer switch in each switch cluster, and then group the cabinet top switch groups according to the outgoing flow direction of the third layer switches SPG_1, SPG_2, SPG_3, and SPG_4 to obtain a first group, and after the outgoing flow of the third layer switch in the first group is grouped according to the destination switch, it is adjusted according to the grouping.

[0140] In an embodiment of the present application, for each first group, the first direction flow of the third layer switch in the first group is grouped according to the second endpoint switch to obtain a second group, and then the first direction flow of the third layer switch in the second group on each equivalent edge of the switch corresponding to the first group in the second layer switch is balanced. This can balance the first direction flow of the third layer switch in the second group on each equivalent edge, which can not only improve the load balancing efficiency, but also improve the data transmission efficiency.

[0141] Figure 6 A flow chart of a switch load balancing method provided in another embodiment of the present application.

[0142] like Figure 6 As shown, the switch load balancing method includes:

[0143] Step 601, in the first switch cluster, according to the number of first direction flows of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch, determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows from each equivalent edge between the first endpoint switch and the second layer switch.

[0144] In the present application, the first layer switch in the first switch cluster may include at least one cabinet top switch group. For the first endpoint switch in each cabinet top switch group, the number of first direction flows of the first endpoint switch on each equivalent edge of the fully connected switch between the first endpoint switch and the second layer switch is compared, and the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows are determined from each equivalent edge of the fully connected switch between the first endpoint switch and the second layer switch.

[0145] Step 602, in the first switch cluster, according to the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among the equivalent edges between the first endpoint switch and the second layer switch, balance the first direction flows of the second layer switch on each equivalent edge between the first endpoint switch and the second layer switch.

[0146] Exemplarily, in the first switch cluster, a first direction flow of the first endpoint switch on the equivalent edge with the largest number of first direction flows among each equivalent edge between the first endpoint switch and the second layer switch can be scheduled to be transmitted on the equivalent edge with the smallest number of first direction flows, and the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among each equivalent edge between the first endpoint switch and the second layer switch are re-determined, and scheduling is continued until the data flow difference between the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows is less than or equal to a preset threshold.

[0147] The preset threshold may be 1, or other integers greater than 1, and there is no limitation on this.

[0148] For example, the preset threshold is 1. When the difference in the number of data flows between the equivalent edge with the largest number of flows in the first direction and the equivalent edge with the smallest number of flows in the first direction is 0 or 1, it can be considered that the first direction flows of the first endpoint switch are balanced on each equivalent edge of the fully connected switch in the second layer switch.

[0149] Therefore, according to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among each equivalent edge between the first endpoint switch and the second layer switch, the first-direction flows of the second layer switch on each equivalent edge can be balanced and adjusted. This can not only balance the first-direction flows of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch, but also improve the load balancing efficiency.

[0150] Since there may be multiple equivalent edges with the largest number of first-direction flows among the equivalent edges of the fully connected switches between the first endpoint switch and the second-layer switch, and there may be multiple equivalent edges with the smallest number of first-direction flows, the above-mentioned method of selecting the first equivalent and second equivalent edges can be used to select an equivalent edge from the multiple equivalent edges with the largest number of first-direction flows, and select an equivalent edge from the multiple equivalent edges with the smallest number of first-direction flows, and then schedule the first-direction flow of the first endpoint switch from the selected equivalent edge with the largest number of first-direction flows to the selected equivalent edge with the smallest number of first-direction flows.

[0151] If there are multiple first endpoint switches in the same cabinet top switch group, the total number of first direction flows from the first endpoint switch through different switches in the second layer switch that are fully connected to the cabinet top switch group may be different.

[0152] Based on this, optionally, the number of first-direction flows from the first endpoint switch passing through the same switch in the second-layer switch can be accumulated to obtain the first total flow number corresponding to each switch in the second-layer switch, and the switch with the largest first total flow number and the switch with the smallest first total flow number can be determined from each switch in the second-layer switch. If the difference between the first total flow number corresponding to the switch with the largest first total flow number and the first total flow number corresponding to the switch with the smallest first total flow number is greater than a preset threshold, it means that the number of first-direction flows passing through the first endpoint switch on the second-layer switch is unbalanced, and the switch with the smallest first total flow number can be balanced based on the switch with the largest first total flow number.

[0153] Therefore, based on the first total number of first-direction flows passing through the first endpoint switch on the second-layer switch, the switch with the smallest first total number of flows is balanced and adjusted according to the switch with the largest first total number of flows, so that the number of first-direction flows passing through the second-layer switch in the cabinet top switch group is balanced, thereby improving the load balancing effect of the second-layer switch.

[0154] Exemplarily, the first number of first-direction flows flowing through the switch with the largest first total flow quantity and the second number of first-direction flows flowing through the switch with the smallest first total flow quantity can be determined for each switch in the first endpoint switches. If the first number corresponding to any switch in the first endpoint switches is greater than the second number, a first-direction flow of any switch in the first endpoint switches can be scheduled from the switch with the largest first total flow quantity to the switch with the smallest first total flow quantity, and the switch with the largest first total flow quantity and the switch with the smallest first total flow quantity can be re-determined.

[0155] If the difference between the first total flow quantity corresponding to the switch with the largest first total flow quantity and the first total flow quantity corresponding to the switch with the smallest first total flow quantity is greater than the preset threshold, it means that the number of first-direction flows flowing from the first endpoint switch through the second-layer switch is unbalanced, and the first number and the second number corresponding to each switch in the first endpoint switch are re-determined and judgment is continued until the difference between the first total flow quantities corresponding to each switch in the second-layer switch is less than or equal to the preset threshold.

[0156] The switches in the first endpoint switch may refer to all first endpoint switches in a cabinet top switch group.

[0157] Therefore, if the number of first-direction flows flowing through any switch among the first endpoint switches through the switch with the largest total number of flows is greater than the number of first-direction flows flowing through the switch with the smallest total number of flows, a first-direction flow of the switch is scheduled from the switch with the largest total number of flows to the switch with the smallest total number of flows, thereby further improving the load balancing effect of the second-layer switch without affecting the balance of the first endpoint switch on each equivalent edge.

[0158] for example, Figure 2 In the figure, the number of outgoing flows from switches IBG1_1, IBG1_2, and IBG1_3 flowing to LEG1 is added to obtain the first total flow number corresponding to LEG1, the number of outgoing flows from switches IBG1_1, IBG1_2, and IBG1_3 flowing to LEG2 is added to obtain the first total flow number corresponding to LEG2, and the number of outgoing flows from switches IBG1_1, IBG1_2, and IBG1_3 flowing to LEG3 is added to obtain the first total flow number corresponding to LEG3. If the first total flow numbers corresponding to LEG1, LEG2, and LEG3 are 5, 3, and 3 respectively, it means that the outgoing flows flowing through the three switches LEG1, LEG2, and LEG3 are uneven. If the number of outgoing flows from IBG1_1 flowing to LEG1 is greater than that flowing to LEG2, one outgoing flow of IBG1_1 can be adjusted from flowing to LEG1 to flowing to LEG2.

[0159] Step 603: In the first switch cluster, according to the number of first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the i-th layer switch and the i+1-th layer switch.

[0160] In the present application, in the first switch cluster, the number of first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch can be compared, and the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows are determined from each equivalent edge between the i-th layer switch and the i+1-th layer switch.

[0161] Among the equivalent edges between the i-th layer switch and the i+1-th layer switch, the equivalent edge with the largest number of flows in the first direction may be one or more, and the equivalent edge with the smallest number of flows in the first direction may be one or more, and there is no limitation on this.

[0162] Step 604, according to the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among the equivalent edges between the i-th layer switch and the i+1-th layer switch, balance the first direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch.

[0163] Exemplarily, in the first switch cluster, a first direction flow of the i-th layer switch on the equivalent edge with the largest number of first direction flows among the equivalent edges between the i-th layer switch and the i+1-th layer switch can be scheduled to be transmitted on the equivalent edge with the smallest number of first direction flows, and the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among the equivalent edges between the i-th layer switch and the i+1-th layer switch are re-determined, and scheduling is continued until the data flow difference between the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows is less than or equal to a preset threshold.

[0164] The preset threshold may be 1, or other integers greater than 1, and there is no limitation on this.

[0165] For example, the preset threshold is 1. When the difference in the number of data flows between the equivalent edge with the largest number of flows in the first direction and the equivalent edge with the smallest number of flows in the first direction is 0 or 1, it can be considered that the first direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch are balanced.

[0166] Therefore, according to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the i-th layer switch and the i+1-th layer switch, the first-direction flows of the second-layer switches on each equivalent edge can be balanced and adjusted. This can not only balance the first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch, but also improve the load balancing efficiency.

[0167] When the first direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch are balanced, the total number of first direction flows of the i-th layer switch passing through each switch in the i+1-th layer switch may be different.

[0168] Optionally, in the first switch cluster, the number of first-direction flows from the i-th layer switch passing through the same switch in the i+1-th layer switch can be accumulated to obtain the second total flow number corresponding to each switch in the i+1-th layer switch, and the switch with the largest second total flow number and the switch with the smallest second total flow number are determined from each switch in the i+1-th layer switch. If the difference between the second total flow number corresponding to the switch with the largest second total flow number and the second total flow number corresponding to the switch with the smallest second total flow number is greater than a preset threshold, it means that the number of first-direction flows of the i-th layer switch passing through the i+1-th layer switch is unbalanced, and the switch with the smallest second total flow number can be balanced according to the switch with the largest second total flow number.

[0169] Therefore, based on the second total number of first-direction flows passing through the i-th layer switch on the i+1-th layer switch, the switch with the smallest second total number of flows is balanced and adjusted according to the switch with the largest second total number of flows, so that the number of first-direction flows flowing through the i-th layer switch through the i+1-th layer switch is balanced, thereby improving the load balancing effect of the i+1-th layer switch.

[0170] Exemplarily, the third number of first-direction flows flowing through the switch with the largest second total number of flows and the fourth number of first-direction flows flowing through the switch with the smallest second total number of flows can be determined for each switch in the i-th layer of switches. If the third number corresponding to any switch in the i-th layer of switches is greater than the fourth number, a first-direction flow of the switch in the i-th layer of switches can be scheduled from the switch with the largest second total number of flows to the switch with the smallest second total number of flows, and the switch with the largest second total number of flows and the switch with the smallest second total number of flows can be re-determined.

[0171] If the difference between the second total flow quantity corresponding to the switch with the largest second total flow quantity and the second total flow quantity corresponding to the switch with the smallest second total flow quantity is greater than the preset threshold, it means that the number of first-direction flows flowing from the i-th layer switch through the i+1-th layer switch is unbalanced, and the third number and the fourth number corresponding to each switch in the i-th layer switch are re-determined and the judgment is continued until the difference between the second total flow quantities corresponding to each switch in the i+1-th layer switch is less than or equal to the preset threshold.

[0172] Therefore, if the number of first-direction flows flowing through any switch in the i-th layer through the second switch with the largest total number of flows is greater than the number of first-direction flows flowing through the second switch with the smallest total number of flows, a first-direction flow of the switch is dispatched from the switch with the largest second total number of flows to the switch with the smallest second total number of flows, thereby further improving the load balancing effect of the i+1-th layer switch without affecting the balance of the i-th layer switch on each equivalent edge.

[0173] Step 605, in the N-th layer switch and the second switch cluster, according to the number of first-direction flows of the j-th layer switch on each equivalent edge between the j-th layer switch and the j-1-th layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the j-th layer switch and the j-1-th layer switch.

[0174] In the present application, in the N-th layer switch and the second switch cluster, the number of first-direction flows of the j-th layer switch on each equivalent edge between the j-th layer switch and the j-1-th layer switch can be compared, and the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows are determined from each equivalent edge between the j-th layer switch and the j-1-th layer switch.

[0175] Among the equivalent edges between the j-th layer switch and the j-1-th layer switch, the equivalent edge with the largest number of first-direction flows may be one or more, and the equivalent edge with the smallest number of first-direction flows may be one or more, and there is no limitation on this.

[0176] Step 606, according to the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among the equivalent edges between the j-th layer switch and the j-1-th layer switch, balance the first direction flows on each equivalent edge between the j-th layer switch and the j-1-th layer switch.

[0177] Exemplarily, in the N-th layer switch and the second switch cluster, a first direction flow of the j-th layer switch on the equivalent edge with the largest number of first direction flows among the equivalent edges between the j-th layer switch and the j-1-th layer switch can be scheduled to be transmitted on the equivalent edge with the smallest number of first direction flows, and the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among the equivalent edges between the j-th layer switch and the j-1-th layer switch are re-determined, and scheduling is continued until the data flow difference between the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows is less than or equal to a preset threshold.

[0178] The preset threshold may be 1, or other integers greater than 1, and there is no limitation on this.

[0179] For example, the preset threshold is 1. When the difference in the number of data flows between the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows is 0 or 1, it can be considered that the first-direction flows of the j-th layer switch on each equivalent edge between the j-th layer switch and the j-1-th layer switch are balanced.

[0180] Therefore, according to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the j-th layer switch and the j-1-th layer switch, the first-direction flows of the second-layer switches on each equivalent edge can be balanced and adjusted. This can not only balance the first-direction flows of the j-th layer switch on each equivalent edge with the j-1-th layer switch, but also improve the load balancing efficiency.

[0181] When the first direction flows of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch are balanced, the total number of first direction flows of the jth layer switch passing through each switch in the j-1th layer may be different.

[0182] Optionally, in the N-th layer switch and the second switch cluster, the number of first-direction flows of the j-th layer switch passing through the same switch in the j-1-th layer switch can be accumulated to obtain the third total flow number corresponding to each switch in the j-1-th layer switch, and the switch with the largest third total flow number and the smallest third total flow number are determined from each switch in the j-1-th layer switch. If the difference between the third total flow number corresponding to the switch with the largest third total flow number and the third total flow number corresponding to the switch with the smallest third total flow number is greater than a preset threshold, it means that the number of first-direction flows of the j-th layer switch passing through the j-1-th layer switch is unbalanced, and the switch with the smallest third total flow number can be balanced according to the switch with the largest third total flow number.

[0183] Therefore, based on the third total number of first-direction flows passing through the j-th layer switch on the j-1-th layer switch, the switch with the smallest third total number of flows is balanced and adjusted according to the switch with the largest third total number of flows, so that the number of first-direction flows flowing through the j-th layer switch through the j-1-th layer switch is balanced, thereby improving the load balancing effect of the j-1-th layer switch.

[0184] Exemplarily, in the N-th layer switch and the second switch cluster, the fifth number of first-direction flows flowing through each switch in the j-th layer through the switch with the largest third total flow quantity and the sixth number of first-direction flows flowing through the switch with the smallest third total flow quantity can be determined. If the fifth number corresponding to any switch in the j-th layer switch is greater than the sixth number, a first-direction flow of the switch in the j-th layer switch can be scheduled from the switch with the largest third total flow quantity to the switch with the smallest third total flow quantity, and the switch with the largest third total flow quantity and the switch with the smallest third total flow quantity can be re-determined.

[0185] If the difference between the third total flow quantity corresponding to the switch with the largest third total flow quantity and the third total flow quantity corresponding to the switch with the smallest third total flow quantity is greater than the preset threshold, it means that the number of first-direction flows flowing through the j-th layer switch through the j-1-th layer switch is unbalanced, and the third number and the fourth number corresponding to each switch in the j-th layer switch are re-determined and the judgment is continued until the difference between the third total flow quantities corresponding to each switch in the j-1-th layer switch is less than or equal to the preset threshold.

[0186] Therefore, if the number of first-direction flows flowing through any switch in the j-th layer through the third switch with the largest total number of flows is greater than the number of first-direction flows flowing through the third switch with the smallest total number of flows, a first-direction flow of the switch is scheduled from the switch with the largest third total number of flows to the switch with the smallest third total number of flows, thereby further improving the load balancing effect of the j-1-th layer switch without affecting the balance of the j-th layer switch on each equivalent edge.

[0187] for example, Figure 2 In the figure, after balancing the outbound flows on the equivalent edges of APG1 and APG2 with SPG3 and SPG4 respectively, the number of outbound flows from switches APG1 and APG2 flowing to SPG3 can be added to obtain the third total flow number corresponding to SPG3, and the number of outbound flows from switches APG1 and APG2 flowing to SPG4 can be added to obtain the third total flow number corresponding to SPG4. If the third total flow numbers corresponding to SPG3 and SPG4 are 5 and 3 respectively, it means that the outbound flows passing through the three switches SPG3 and SPG4 are uneven. If the number of APG1 flowing to SPG3 is greater than that flowing to SPG4, one outbound flow of APG1 can be adjusted from flowing to SPG3 to flowing to SPG4.

[0188] Step 607: group the first direction flow of the third layer switch according to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch belongs, to obtain at least one first group.

[0189] Step 608: Balance and adjust the first direction flow of the third layer switch in the first group.

[0190] In the present application, steps 607 to 608 may be implemented in any of the embodiments of the present application, and are not limited thereto.

[0191] In the embodiment of the present application, the first direction flow of the first endpoint switch on each equivalent edge is balanced and adjusted according to the maximum equivalent edge of the number of first direction flows in each equivalent edge between the first endpoint switch in the first layer switch and the second layer switch and the maximum equivalent edge of the number of first direction flows. Then, the first direction flow of the i-th layer switch on each equivalent edge is balanced and adjusted according to the maximum equivalent edge of the number of first direction flows in each equivalent edge between the i-th layer switch and the i+1-th layer switch and the maximum equivalent edge of the number of first direction flows. And according to the maximum equivalent edge of the number of first direction flows in each equivalent edge between the j-th layer switch and the j-1-th layer switch and the maximum equivalent edge of the number of first direction flows, the first direction flow of the i-th layer switch on each equivalent edge is balanced and adjusted. Then, the first direction flow of the third layer switch is balanced and adjusted through grouping, thereby improving the overall load balancing effect.

[0192] In order to implement the above embodiment, the embodiment of the present application also proposes a switch load balancing device. The device is applied to an N-layer switch network, wherein the N-layer switch network includes multiple switch clusters and an N-th layer switch, each of the switch clusters includes the first N-1 layers of switches, and N is an integer greater than or equal to 3.

[0193] Figure 7 A schematic diagram of the structure of a switch load balancing device provided in one embodiment of the present application.

[0194] like Figure 7 As shown, the switch load balancing device 700 includes:

[0195] The first adjustment module 710 is used to balance the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch in the first layer switch in the first switch cluster;

[0196] The second adjustment module 720 is used to balance the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster; when N=3, i=2; when N>3, the value of i is 2,,,N-1 in sequence;

[0197] The third adjustment module 730 is used to balance the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch; wherein the second switch cluster is the switch cluster to which the second endpoint switch of the first direction flow of the Nth layer switch belongs;

[0198] Optionally, N is an integer greater than or equal to 4, and the third adjustment module 730 is configured to:

[0199] In the Nth layer switch and the second switch cluster, the first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch is balanced and adjusted; when N=4, j=4; when N>4, the value of j is N,,,4 in sequence;

[0200] According to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch in the second switch cluster belongs, the first direction flow of the third layer switch is grouped to obtain at least one first group;

[0201] Balance and adjust the first direction flow of the third layer switch in the first group.

[0202] Optionally, N is equal to 3, and the third adjustment module 730 is configured to:

[0203] According to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch in the second switch cluster belongs, the first direction flow of the third layer switch is grouped to obtain at least one first group;

[0204] Grouping the first direction flow of the third layer switch in the first group according to the second endpoint switch to obtain at least one second group;

[0205] For the second group, according to the number of first-direction flows of the third-layer switch on each equivalent edge between the third-layer switch and the switch corresponding to the first group in the second-layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the third-layer switch and the switch corresponding to the first group;

[0206] According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the third-layer switch and the switch corresponding to the first group, the first-direction flows of the third-layer switch on each equivalent edge between the third-layer switch and the switch corresponding to the first group are balanced and adjusted.

[0207] Optionally, the first adjustment module 710 is configured to:

[0208] In the first switch cluster, according to the number of first direction flows of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch, determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows from each equivalent edge between the first endpoint switch and the second layer switch;

[0209] According to the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among the equivalent edges between the first endpoint switch and the second layer switch, the first direction flows of the second layer switch on each equivalent edge between the first endpoint switch and the second layer switch are balanced and adjusted.

[0210] Optionally, the first adjustment module 710 is configured to:

[0211] In the first switch cluster, according to the number of first direction flows of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch, determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows from each equivalent edge between the first endpoint switch and the second layer switch;

[0212] According to the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows among the equivalent edges between the first endpoint switch and the second layer switch, the first direction flows of the second layer switch on each equivalent edge between the first endpoint switch and the second layer switch are balanced and adjusted.

[0213] Optionally, the first adjustment module 710 is further configured to:

[0214] Accumulate the number of first direction flows from the first endpoint switch through the same switch in the second layer switch to obtain a first total flow number corresponding to each switch in the second layer switch;

[0215] Determine, from the switches in the second layer of switches, a switch with the largest first total flow quantity and a switch with the smallest first total flow quantity;

[0216] In response to a difference between a first total flow quantity corresponding to a switch with a largest first total flow quantity and a first total flow quantity corresponding to a switch with a smallest first total flow quantity being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest first total flow quantity according to the switch with the largest first total flow quantity.

[0217] Optionally, the first adjustment module 710 is further configured to:

[0218] Determine a first quantity of first-direction flows flowing through each switch in the first endpoint switch through the switch with the largest first total flow-through quantity and a second quantity of first-direction flows flowing through the switch with the smallest first total flow-through quantity;

[0219] In response to the first number corresponding to any switch among the first endpoint switches being greater than the second number, a first direction flow of any switch among the first endpoint switches is scheduled from the switch with the largest first total flow-through number to the switch with the smallest first total flow-through number, and the switch with the largest first total flow-through number and the switch with the smallest first total flow-through number are re-determined;

[0220] In response to the difference between the first total flow number corresponding to the switch with the largest first total flow number and the first total flow number corresponding to the switch with the smallest first total flow number being greater than a preset threshold, the first number and the second number corresponding to each switch in the first endpoint switch are re-determined until the difference between the first total flow numbers corresponding to each switch in the second layer switch is less than or equal to the preset threshold.

[0221] Optionally, the second adjustment module 720 is configured to:

[0222] In the first switch cluster, according to the number of first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the i-th layer switch and the i+1-th layer switch;

[0223] According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the i-th layer switch and the i+1-th layer switch, the first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch are balanced and adjusted.

[0224] Optionally, the second adjustment module 720 is further configured to:

[0225] In the first switch cluster, the number of first-direction flows from the i-th layer switch through the same switch in the i+1-th layer switch is accumulated to obtain a second total number of flows corresponding to each switch in the i+1-th layer switch;

[0226] Determine the switch with the second largest total flow quantity and the switch with the second smallest total flow quantity from the switches in the i+1th layer of switches;

[0227] In response to a difference between a second total number of flows corresponding to the switch with the largest second total number of flows passing through and a second total number of flows corresponding to the switch with the smallest second total number of flows passing through being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest second total number of flows passing through according to the switch with the largest second total number of flows passing through.

[0228] Optionally, the second adjustment module 720 is further configured to:

[0229] Determine the third number of first-direction flows of each switch in the i-th layer flowing through the switch with the largest second total number of flows and the fourth number of first-direction flows flowing through the switch with the smallest second total number of flows;

[0230] In response to the third number corresponding to any switch in the i-th layer of switches being greater than the fourth number, a first direction flow of any switch in the i-th layer of switches is dispatched from the switch with the largest second total flow-through number to the switch with the smallest second total flow-through number, and the switch with the largest second total flow-through number and the switch with the smallest second total flow-through number are re-determined;

[0231] In response to the difference between the second total flow number corresponding to the switch with the largest second total flow number and the second total flow number corresponding to the switch with the smallest second total flow number being greater than a preset threshold, the third number and the fourth number corresponding to each switch in the i-th layer of switches are re-determined until the difference between the second total flow numbers corresponding to each switch in the i+1-th layer of switches is less than or equal to the preset threshold.

[0232] Optionally, the third adjustment module 730 is configured to:

[0233] In the Nth layer switch and the second switch cluster, according to the number of first direction flows of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch, determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows from each equivalent edge between the jth layer switch and the j-1th layer switch;

[0234] According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the j-th layer switch and the j-1-th layer switch, the first-direction flows of the j-th layer switch on each equivalent edge between the j-th layer switch and the j-1-th layer switch are balanced and adjusted.

[0235] Optionally, the third adjustment module 730 is further configured to:

[0236] In the Nth layer switch and the second switch cluster, the number of first direction flows from the jth layer switch passing through the same switch in the j-1th layer switch is accumulated to obtain the third total flow number corresponding to each switch in the j-1th layer switch;

[0237] Determine the switch with the largest third total flow quantity and the switch with the smallest third total flow quantity from the switches in the j-1th layer;

[0238] In response to a difference between a third total number of flows corresponding to the switch with the largest third total number of flows and a third total number of flows corresponding to the switch with the smallest third total number of flows being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest third total number of flows according to the switch with the largest third total number of flows.

[0239] Optionally, the third adjustment module 730 is further configured to:

[0240] In the Nth layer switch and the second switch cluster, the number of first direction flows from the jth layer switch passing through the same switch in the j-1th layer switch is accumulated to obtain the third total flow number corresponding to each switch in the j-1th layer switch;

[0241] Determine the switch with the largest third total flow quantity and the switch with the smallest third total flow quantity from the switches in the j-1th layer;

[0242] In response to a difference between a third total number of flows corresponding to the switch with the largest third total number of flows and a third total number of flows corresponding to the switch with the smallest third total number of flows being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest third total number of flows according to the switch with the largest third total number of flows.

[0243] It should be noted that the explanation of the aforementioned switch load balancing method embodiment is also applicable to the switch load balancing device of this embodiment, so it will not be repeated here.

[0244] In the embodiment of the present application, for the first switch cluster, the first direction flow on each equivalent edge between the first endpoint switch in the first layer switch and the second layer switch in the first switch cluster is balanced and adjusted. In the first switch cluster, in order of the switch layers from low to high, starting from the second layer switch, the first direction flow on each equivalent edge between the lower layer switch and the adjacent higher layer switch is balanced and adjusted in sequence, and then the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch is balanced and adjusted, thereby improving the load balancing degree of the switches in the multi-layer switch network, and then improving the load balancing effect of the overall switch network.

[0245] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0246] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0247] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 802 or a computer program loaded from a storage unit 808 to a RAM (Random Access Memory) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An I / O (Input / Output) interface 805 is also connected to the bus 804.

[0248] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0249] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the switch load balancing method. For example, in some embodiments, the switch load balancing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the switch load balancing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the switch load balancing method in any other appropriate manner (eg, by means of firmware).

[0250] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0251] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0252] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0253] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0254] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0255] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services (Virtual Private Server). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0256] According to an embodiment of the present application, the present application further provides a computer program product, which, when an instruction processor in the computer program product is executed, executes the switch load balancing method proposed in the above embodiment of the present application.

[0257] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0258] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A switch load balancing method, the method being applied to an N-layer switch network, the N-layer switch network comprising a plurality of switch clusters and an N-th layer switch, each of the switch clusters comprising the first N-1 layers of switches, wherein N is an integer greater than or equal to 3, the method comprising: Balance the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch in the first layer switch and the second layer switch in the first switch cluster; wherein the first switch cluster is any switch cluster among the multiple switch clusters; Balance the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster; when N=3, i=2; when N>3, the value of i is 2,,,N-1 in sequence; A first direction flow corresponding to a second switch cluster in a first direction flow of an N-th layer switch is balanced and adjusted; wherein the second switch cluster is a switch cluster to which a second endpoint switch of the first direction flow of the N-th layer switch belongs.

2. The method of claim 1, wherein: N is an integer greater than or equal to 4, and the balancing adjustment of the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch includes: In the Nth layer switch and the second switch cluster, on each equivalent edge between the jth layer switch and the j-1th layer switch, the first direction flow of the jth layer switch is balanced and adjusted; wherein, when N=4, j=4; when N>4, the values ​​of j are N,,,4 in sequence; According to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch in the second switch cluster belongs, the first direction flow of the third layer switch is grouped to obtain at least one first group; A first direction flow of the third layer switch in the first group is balanced and adjusted.

3. The method of claim 1, wherein: N is equal to 3, and balancing the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch includes: According to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch in the second switch cluster belongs, the first direction flow of the third layer switch is grouped to obtain at least one first group; Grouping the first direction flow of the third layer switch in the first group according to the second endpoint switch to obtain at least one second group; For the second group, according to the number of first-direction flows of the third-layer switch on each equivalent edge between the third-layer switch and the switch corresponding to the first group in the second-layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the third-layer switch and the switch corresponding to the first group; According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the third-layer switch and the switch corresponding to the first group, the first-direction flows of the third-layer switch on each equivalent edge between the third-layer switch and the switch corresponding to the first group are balanced and adjusted.

4. The method of claim 3, further comprising: In response to the second direction flow of the second endpoint switch corresponding to the second group being unbalanced on each equivalent edge of the switch corresponding to the first group, determining, among each equivalent edge of the second endpoint switch corresponding to the second group and the switch corresponding to the first group, an equivalent edge having the largest number of second direction flows and an equivalent edge having the smallest number of second direction flows of the second endpoint switch corresponding to the second group; According to the equivalent edge with the largest number of second directional flows and the equivalent edge with the smallest number of second directional flows, the second directional flows of the second endpoint switch corresponding to the second group on each equivalent edge of the switch corresponding to the first group are balanced and adjusted.

5. The method of claim 1, wherein: The step of balancing and adjusting the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch in the first layer switch in the first switch cluster and the second layer switch includes: In the first switch cluster, according to the number of first direction flows of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch, determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows from each equivalent edge between the first endpoint switch and the second layer switch; According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the first endpoint switch and the second layer switch, the first-direction flows of the second layer switch on each equivalent edge between the first endpoint switch and the second layer switch are balanced and adjusted.

6. The method of claim 5, further comprising: In the first switch cluster, the number of first direction flows from the first endpoint switch passing through the same switch in the second layer switch is accumulated to obtain a first total number of flows corresponding to each switch in the second layer switch; Determine, from the switches in the second layer of switches, a switch with the largest first total flow quantity and a switch with the smallest first total flow quantity; In response to a difference between a first total number of flows corresponding to the switch with the largest first total number of flows and a first total number of flows corresponding to the switch with the smallest first total number of flows being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest first total number of flows according to the switch with the largest first total number of flows.

7. The method of claim 6, wherein: The step of performing balancing adjustment on the switch with the smallest number of first total flows according to the switch with the largest number of first total flows includes: Determine a first quantity of first-direction flows flowing through each switch in the first endpoint switches through the switch with the largest first total flow-through quantity and a second quantity of first-direction flows flowing through the switch with the smallest first total flow-through quantity; In response to the first number corresponding to any switch among the first endpoint switches being greater than the second number, a first direction flow of any switch among the first endpoint switches is scheduled from the switch with the largest first total flow-through number to the switch with the smallest first total flow-through number, and the switch with the largest first total flow-through number and the switch with the smallest first total flow-through number are re-determined; In response to the difference between the first total flow number corresponding to the switch with the largest first total flow number and the first total flow number corresponding to the switch with the smallest first total flow number being greater than the preset threshold, the first number and the second number corresponding to each switch in the first endpoint switch are re-determined until the difference between the first total flow numbers corresponding to each switch in the second layer switch is less than or equal to the preset threshold.

8. The method of claim 1, wherein: The balancing adjustment of the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster includes: In the first switch cluster, according to the number of first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the i-th layer switch and the i+1-th layer switch; According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the i-th layer switch and the i+1-th layer switch, the first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch are balanced and adjusted.

9. The method of claim 8, further comprising: In the first switch cluster, the number of first-direction flows from the i-th layer switch passing through the same switch in the i+1-th layer switch is accumulated to obtain a second total number of flows corresponding to each switch in the i+1-th layer switch; Determine, from the switches in the i+1th layer of switches, the switch with the largest second total flow quantity and the switch with the smallest second total flow quantity; In response to a difference between a second total number of flows corresponding to the switch with the largest second total number of flows and a second total number of flows corresponding to the switch with the smallest second total number of flows being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest second total number of flows according to the switch with the largest second total number of flows.

10. The method of claim 9, wherein: The balancing adjustment of the switch with the smallest second total number of flows passing through according to the switch with the largest second total number of flows passing through includes: Determine a third number of first-direction flows flowing through the switch with the largest second total number of flows and a fourth number of first-direction flows flowing through the switch with the smallest second total number of flows; In response to the third number corresponding to any switch in the i-th layer of switches being greater than the fourth number, a first direction flow of any switch in the i-th layer of switches is dispatched from the switch with the largest second total flow-through number to the switch with the smallest second total flow-through number, and the switch with the largest second total flow-through number and the switch with the smallest second total flow-through number are re-determined; In response to the difference between the second total flow number corresponding to the switch with the largest second total flow number and the second total flow number corresponding to the switch with the smallest second total flow number being greater than the preset threshold, the third number and the fourth number corresponding to each switch in the i-th layer of switches are re-determined until the difference between the second total flow numbers corresponding to each switch in the i+1-th layer of switches is less than or equal to the preset threshold.

11. The method of claim 2, wherein: The step of balancing and adjusting the first direction flow of the j-th layer switch on each equivalent edge of the j-th layer switch and the j-1-th layer switch in the N-th layer switch and the second switch cluster includes: In the Nth layer switch and the second switch cluster, according to the number of first direction flows of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch, determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows from each equivalent edge between the jth layer switch and the j-1th layer switch; According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the j-th layer switch and the j-1-th layer switch, the first-direction flows of the j-th layer switch on each equivalent edge between the j-th layer switch and the j-1-th layer switch are balanced and adjusted.

12. The method of claim 11, further comprising: In the Nth layer switch and the second switch cluster, the number of first direction flows from the jth layer switch passing through the same switch in the j-1th layer switch is accumulated to obtain a third total number of flows corresponding to each switch in the j-1th layer switch; Determine, from the switches in the j-1th layer of switches, a switch having the largest third total flow quantity and a switch having the smallest third total flow quantity; In response to a difference between a third total number of flows corresponding to the switch with the largest third total number of flows and a third total number of flows corresponding to the switch with the smallest third total number of flows being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest third total number of flows according to the switch with the largest third total number of flows.

13. The method of claim 12, wherein: The step of performing a balancing adjustment on the switch having the smallest third total number of flows according to the switch having the largest third total number of flows passing through includes: Determine the fifth number of first-direction flows flowing through the third switch with the largest total number of flows and the sixth number of first-direction flows flowing through the third switch with the smallest total number of flows; In response to the sixth number corresponding to any switch in the j-th layer of switches being greater than the seventh number, a first direction flow of any switch in the j-th layer of switches is dispatched from the switch with the largest third total flow quantity to the switch with the smallest third total flow quantity, and the switch with the largest third total flow quantity and the switch with the smallest third total flow quantity are re-determined; In response to the difference between the third total flow number corresponding to the switch with the largest third total flow number and the third total flow number corresponding to the switch with the smallest third total flow number being greater than the preset threshold, the fifth number and the sixth number corresponding to each switch in the j-th layer of switches are re-determined until the difference between the third total flow numbers corresponding to each switch in the j-1-th layer of switches is less than or equal to the preset threshold.

14. A switch load balancing device, applied to an N-layer switch network, the N-layer switch network comprising a plurality of switch clusters and an N-th layer switch, each of the switch clusters comprising the first N-1 layers of switches, wherein N is an integer greater than or equal to 3, the device comprising: A first adjustment module is used to balance the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch in the first layer switch in the first switch cluster; wherein the first switch cluster is any switch cluster among the multiple switch clusters; The second adjustment module is used to balance the first direction flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster; wherein, when N=3, i=2; when N>3, the value of i is 2,,,N-1 in sequence; The third adjustment module is used to balance the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch; wherein the second switch cluster is the switch cluster to which the second endpoint switch of the first direction flow of the Nth layer switch belongs.

15. The device of claim 14, wherein: The N is an integer greater than or equal to 4, and the third adjustment module is used to: In the Nth layer switch and the second switch cluster, on each equivalent edge between the jth layer switch and the j-1th layer switch, the first direction flow of the jth layer switch is balanced and adjusted; wherein, when N=4, j=4; when N>4, the values ​​of j are N,,,4 in sequence; According to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch in the second switch cluster belongs, the first direction flow of the third layer switch is grouped to obtain at least one first group; A first direction flow of the third layer switch in the first group is balanced and adjusted.

16. The device of claim 14, wherein: The N is equal to 3, and the third adjustment module is used for: According to the cabinet top switch group to which the second endpoint switch corresponding to the first direction flow of the third layer switch in the second switch cluster belongs, the first direction flow of the third layer switch is grouped to obtain at least one first group; Grouping the first direction flow of the third layer switch in the first group according to the second endpoint switch to obtain at least one second group; For the second group, according to the number of first-direction flows of the third-layer switch on each equivalent edge between the third-layer switch and the switch corresponding to the first group in the second-layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the third-layer switch and the switch corresponding to the first group; According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the third-layer switch and the switch corresponding to the first group, the first-direction flows of the third-layer switch on each equivalent edge between the third-layer switch and the switch corresponding to the first group are balanced and adjusted.

17. The device of claim 16, wherein: The third adjustment module is used to: In response to the second direction flow of the second endpoint switch corresponding to the second group being unbalanced on each equivalent edge of the switch corresponding to the first group, determining, among each equivalent edge of the second endpoint switch corresponding to the second group and the switch corresponding to the first group, an equivalent edge having the largest number of second direction flows and an equivalent edge having the smallest number of second direction flows of the second endpoint switch corresponding to the second group; According to the equivalent edge with the largest number of second directional flows and the equivalent edge with the smallest number of second directional flows, the second directional flows of the second endpoint switch corresponding to the second group on each equivalent edge of the switch corresponding to the first group are balanced and adjusted.

18. The device of claim 14, wherein: The first adjustment module is used to: In the first switch cluster, according to the number of first direction flows of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch, determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows from each equivalent edge between the first endpoint switch and the second layer switch; According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the first endpoint switch and the second layer switch, the first-direction flows of the second layer switch on each equivalent edge between the first endpoint switch and the second layer switch are balanced and adjusted.

19. The device of claim 18, wherein: The first adjustment module is further used for: In the first switch cluster, the number of first direction flows from the first endpoint switch passing through the same switch in the second layer switch is accumulated to obtain a first total number of flows corresponding to each switch in the second layer switch; Determine, from the switches in the second layer of switches, a switch with the largest first total flow quantity and a switch with the smallest first total flow quantity; In response to a difference between a first total number of flows corresponding to the switch with the largest first total number of flows and a first total number of flows corresponding to the switch with the smallest first total number of flows being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest first total number of flows according to the switch with the largest first total number of flows.

20. The device of claim 19, wherein: The first adjustment module is further used for: Determine a first quantity of first-direction flows flowing through each switch in the first endpoint switches through the switch with the largest first total flow-through quantity and a second quantity of first-direction flows flowing through the switch with the smallest first total flow-through quantity; In response to the first number corresponding to any switch among the first endpoint switches being greater than the second number, a first direction flow of any switch among the first endpoint switches is scheduled from the switch with the largest first total flow-through number to the switch with the smallest first total flow-through number, and the switch with the largest first total flow-through number and the switch with the smallest first total flow-through number are re-determined; In response to the difference between the first total flow number corresponding to the switch with the largest first total flow number and the first total flow number corresponding to the switch with the smallest first total flow number being greater than the preset threshold, the first number and the second number corresponding to each switch in the first endpoint switch are re-determined until the difference between the first total flow numbers corresponding to each switch in the second layer switch is less than or equal to the preset threshold.

21. The apparatus of claim 14, wherein: The second adjustment module is used to: In the first switch cluster, according to the number of first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch, determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows from each equivalent edge between the i-th layer switch and the i+1-th layer switch; According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the i-th layer switch and the i+1-th layer switch, the first-direction flows of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch are balanced and adjusted.

22. The device of claim 21, wherein: The second adjustment module is further used for: In the first switch cluster, the number of first-direction flows from the i-th layer switch passing through the same switch in the i+1-th layer switch is accumulated to obtain a second total number of flows corresponding to each switch in the i+1-th layer switch; Determine, from the switches in the i+1th layer of switches, the switch with the largest second total flow-through quantity and the switch with the smallest second total flow-through quantity; In response to a difference between a second total number of flows corresponding to the switch with the largest second total number of flows and a second total number of flows corresponding to the switch with the smallest second total number of flows being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest second total number of flows according to the switch with the largest second total number of flows.

23. The device of claim 22, wherein: The second adjustment module is further used for: Determine a third number of first-direction flows flowing through the switch with the largest second total number of flows and a fourth number of first-direction flows flowing through the switch with the smallest second total number of flows; In response to the third number corresponding to any switch in the i-th layer of switches being greater than the fourth number, a first direction flow of any switch in the i-th layer of switches is dispatched from the switch with the largest second total flow-through number to the switch with the smallest second total flow-through number, and the switch with the largest second total flow-through number and the switch with the smallest second total flow-through number are re-determined; In response to the difference between the second total flow number corresponding to the switch with the largest second total flow number and the second total flow number corresponding to the switch with the smallest second total flow number being greater than the preset threshold, the third number and the fourth number corresponding to each switch in the i-th layer of switches are re-determined until the difference between the second total flow numbers corresponding to each switch in the i+1-th layer of switches is less than or equal to the preset threshold.

24. The apparatus of claim 15, wherein: The third adjustment module is used to: In the Nth layer switch and the second switch cluster, according to the number of first direction flows of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch, determine the equivalent edge with the largest number of first direction flows and the equivalent edge with the smallest number of first direction flows from each equivalent edge between the jth layer switch and the j-1th layer switch; According to the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows among the equivalent edges between the j-th layer switch and the j-1-th layer switch, the first-direction flows of the j-th layer switch on each equivalent edge between the j-th layer switch and the j-1-th layer switch are balanced and adjusted.

25. The device of claim 24, wherein: The third adjustment module is further used for: In the Nth layer switch and the second switch cluster, the number of first direction flows from the jth layer switch passing through the same switch in the j-1th layer switch is accumulated to obtain a third total number of flows corresponding to each switch in the j-1th layer switch; Determine, from the switches in the j-1th layer of switches, a switch having the largest third total flow quantity and a switch having the smallest third total flow quantity; In response to a difference between a third total number of flows corresponding to the switch with the largest third total number of flows and a third total number of flows corresponding to the switch with the smallest third total number of flows being greater than a preset threshold, a balancing adjustment is performed on the switch with the smallest third total number of flows according to the switch with the largest third total number of flows.

26. The device of claim 25, wherein: The third adjustment module is further used for: Determine the fifth number of first-direction flows flowing through the third switch with the largest total number of flows and the sixth number of first-direction flows flowing through the third switch with the smallest total number of flows; In response to the sixth number corresponding to any switch in the j-th layer of switches being greater than the seventh number, a first direction flow of any switch in the j-th layer of switches is dispatched from the switch with the largest third total flow quantity to the switch with the smallest third total flow quantity, and the switch with the largest third total flow quantity and the switch with the smallest third total flow quantity are re-determined; In response to the difference between the third total flow number corresponding to the switch with the largest third total flow number and the third total flow number corresponding to the switch with the smallest third total flow number being greater than the preset threshold, the fifth number and the sixth number corresponding to each switch in the j-th layer of switches are re-determined until the difference between the third total flow numbers corresponding to each switch in the j-1-th layer of switches is less than or equal to the preset threshold.

27. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 13.

28. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-13.

29. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Method and device for cross-cluster load balancing

    CN104243337A

  • System and method for load balancing in a data network

    CN107360092A

  • Virtualized network networking system and data packet sending method

    CN108768817A

  • Data flow load balancing method and device, network topology and data center

    CN115883469A

  • Layer 2 load balancing system

    US20200067838A1