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

By performing layer-by-layer load balancing adjustments on an N-layer switch network, the problem of load imbalance in multi-layer switch networks is solved, improving data transmission efficiency and network throughput.

CN119743432BActive Publication Date: 2025-11-04BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

During data transmission, existing technologies struggle to effectively achieve load balancing in multi-layer switch networks, resulting in insufficient data transmission efficiency and network throughput.

Method used

By performing layer-by-layer load balancing adjustments on the switch clusters in the N-layer switch network, including balancing the equivalence edges between the first-layer and second-layer switches, the equivalence edges between the i-th and (i+1)-th layer switches, and the equivalence edges of the N-th layer switches, the load balancing of data flow across the switches at each layer is ensured.

Benefits of technology

It improves the load balancing of multi-layer switch networks, thereby enhancing overall data transmission efficiency and network throughput.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743432B_ABST
    Figure CN119743432B_ABST
Patent Text Reader

Abstract

The application discloses a switch load balancing method and device, electronic equipment and a storage medium, relates to the technical field of computers, and particularly relates 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 an N-1th-layer switch, N is an integer greater than or equal to 3, and the specific implementation scheme is as follows: the first direction flow of a first end-point switch in a first-layer switch in a first switch cluster is balanced and adjusted on each equivalent edge between the first end-point switch and a second-layer switch; the first direction flow of an ith-layer switch in the first switch cluster is balanced and adjusted on each equivalent edge between the ith-layer switch and an (i+1)th-layer switch; and the first direction flow corresponding to a second switch cluster in the first direction flow of the Nth-layer switch is balanced and adjusted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, in particular to the field of artificial intelligence such as big data and cloud computing, and specifically relates to a switch load balancing method and device, an electronic device, and a storage medium. BACKGROUND

[0002] With the advent of the information age, the amount of data processing is growing exponentially, so in the process of data transmission, the switch is often load balanced to improve data transmission efficiency and network throughput. SUMMARY

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

[0004] According to an aspect of the present application, a switch load balancing method is provided, which is applied to an N-layer switch network, the N-layer switch network comprising a plurality of switch clusters and an Nth-layer switch, each switch cluster comprising a first N-1-layer switch, and N being an integer greater than or equal to 3, the method comprising:

[0005] balancing and adjusting the first-direction flow of the first end-point switch in the first layer switch in the first switch cluster on each equivalent edge between the first end-point switch and the second layer switch;

[0006] balancing and adjusting the first-direction flow of the i-th layer switch in the first switch cluster on each equivalent edge between the i-th layer switch and the i+1-th layer switch; when N=3, i=2; when N>3, the values of i are 2, 3, …, N-1 in turn;

[0007] balancing and adjusting the first-direction flow of the second switch cluster in the first-direction flow of the Nth-layer switch; the second switch cluster is the switch cluster to which the second end-point 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, the N-layer switch network comprising a plurality of switch clusters and an Nth-layer switch, each switch cluster comprising a first N-1-layer switch, and N being an integer greater than or equal to 3, the device comprising:

[0009] a first adjusting module, configured to balance and adjust the first-direction flow of the first end-point switch in the first layer switch in the first switch cluster on each equivalent edge between the first end-point switch and the second layer switch;

[0010] The second adjusting module is configured to perform balanced adjustment on 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, i is 2, 3, …, N-1 in turn.

[0011] The third adjusting module is configured to perform balanced adjustment on the first direction flow corresponding to the second switch cluster in the first direction flow of the N-th layer switch; wherein, the second switch cluster is a switch cluster to which the second end point switch of the first direction flow of the N-th layer switch belongs.

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

[0013] at least one processor; and

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

[0015] The memory stores instructions executable 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 described in the above embodiments.

[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 make the computer perform the method described in the above embodiments.

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

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

[0019] The accompanying drawings are used to better understand the present application, and do not limit the present application. Among them:

[0020] Figure 1 A flowchart of a switch load balancing method provided by an embodiment of the present application is shown;

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

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

[0023] Figure 4 A flowchart of a method for load balancing of switches according to another embodiment of the present application is shown in FIG. 3.

[0024] Figure 5 A flowchart of a method for load balancing of switches according to another embodiment of the present application is shown in FIG. 3.

[0025] Figure 6 A flowchart of a method for load balancing of switches according to another embodiment of the present application is shown in FIG. 3.

[0026] Figure 7 A structure diagram of a device for load balancing of switches according to an embodiment of the present application is shown in FIG. 4.

[0027] Figure 8 A structure diagram of a device for load balancing of switches according to an embodiment of the present application is shown in FIG. 4. DETAILED DESCRIPTION

[0028] The exemplary embodiments of the present application will be described hereinafter with reference to the accompanying drawings, in which the various details of the embodiments of the present application are set forth in order to provide a thorough understanding of the embodiments of the present application. It should be understood to those skilled in the art that the embodiments of the present application can be varied and modified without departing from the scope and spirit of the present application. Also, for the purpose of clarity and a concise description, the description below omits the description of well-known functions and structures.

[0029] The method, device, electronic device and storage medium for load balancing of switches according to the embodiments of the present application will be described below with reference to the accompanying drawings.

[0030] Figure 1 A flowchart of a method for load balancing of switches according to an embodiment of the present application is shown in FIG. 2.

[0031] The method for load balancing of switches according to the embodiments of the present application can be executed by the device for load balancing of switches according to the embodiments of the present application, which can be configured in an electronic device.

[0032] The electronic device can be any device with computing capability, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal can be a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, etc. with various operating systems, touch screens and / or display screens.

[0033] For example, the method for load balancing of switches according to the embodiments of the present application can be applied to an N-layer switch network, which can include a plurality of switch clusters and an Nth-layer switch, each of the switch clusters including a first to an N-1th-layer switch, N being an integer greater than or equal to 3.

[0034] The Nth layer switch can be used to forward data flow between different switch clusters.

[0035] The first layer switch in each switch cluster can include at least one cabinet top switch group. The cabinet top switch group can refer to a group of switches deployed on the upper part of each server cabinet. The server can directly access the switches in the cabinet top switch group to realize the interconnection of the server and the switch in the cabinet.

[0036] For example, when N is greater than or equal to 4, each switch cluster can include a plurality of cabinet top switch groups; when N = 3, each switch cluster can include one cabinet top 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, which can forward data flow between the two switch clusters.

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

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

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

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

[0042] Figure 3 In the middle, another switch cluster includes the first-layer cabinet-top switch group a2, the second-layer switches LEG_4, LEG_5, LEG_6. Among them, each switch in the cabinet-top switch group a2 can be fully connected with LEG_4, LEG_5, LEG_6, and LEG_4, LEG_5, LEG_6 can be fully connected with SPG_1, SPG_2, SPG_3, SPG_4.

[0043] Figure 3 In the middle, another switch cluster includes the first-layer cabinet-top switch group a2, the second-layer switches LEG_4, LEG_5, LEG_6. Among them, each switch in the cabinet-top switch group a2 can be fully connected with LEG_4, LEG_5, LEG_6, and LEG_4, LEG_5, LEG_6 can be fully connected with SPG_1, SPG_2, SPG_3, SPG_4.

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

[0045] As shown in Figure 1 The switch load balancing method includes:

[0046] Step 101, for each equivalent edge on the first end-point switch and the second-layer switch in the first-layer switch in the first switch cluster, the first direction flow of the first end-point switch is balanced and adjusted.

[0047] The first switch cluster is any of a plurality of switch clusters.

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

[0049] For example, the first endpoint switch in the first layer switch in each switch cluster can be a source switch of a data stream flowing to a top-of-rack switch group in another switch cluster. For example, the first endpoint switch in the first layer switch can also be a destination switch of a data stream flowing from a top-of-rack switch group in another switch cluster.

[0050] In this application, the switches in different top-of-rack switch groups in each switch cluster can be fully connected to different switches in the second layer. The switches fully connected to the switches in the top-of-rack switch group can be one or more, and the number of switches fully connected to the switches in different top-of-rack switch groups can be the same or different, which is not limited.

[0051] For example, Figure 2 In the four-layer switch network shown in FIG. 1, for example, the top-of-rack switch group A1 includes three switches IBG1_1, IBG1_2, and IBG1_3, and the top-of-rack switch group A2 includes three switches IBG2_1, IBG2_2, and IBG2_3.

[0052] The switches in the top-of-rack switch A1 can be fully connected to the LEG1, LEG2, and LEG3 in the second layer switch. There are three equivalent paths between the switches in the top-of-rack switch A1 and the LEG1, LEG2, and LEG3, which can be referred to as equivalent edges. The switches in the top-of-rack switch A2 can be fully connected to the LEG4, LEG5, and LEG6. There are also three equivalent edges between the switches in the top-of-rack switch A2 and the LEG4, LEG5, and LEG6.

[0053] For example, for each switch cluster, the first direction flow on each equivalent edge between the first endpoint switch in each top-of-rack switch group and the fully connected switch in the second layer switch can be balanced and adjusted in turn.

[0054] In the present application, the first direction flow can refer to the data flow in the first direction, and the first direction can be the incoming direction or the outgoing direction, which are relative to the device. The incoming flow can refer to the data flow flowing into the device, and the outgoing flow can refer to the data flow flowing out of the device.

[0055] For example, the first endpoint switch is the source switch, and the first direction flow is the outgoing flow. The outgoing flow of the source switch refers to the data flow flowing out of the source switch. For example, the first endpoint switch is the destination switch, and the first direction flow is the incoming flow. The incoming 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 incoming flow and outgoing flow. The outgoing flow of the switch refers to the data flow flowing into the switch, and the outgoing flow of the switch refers to the data flow flowing out of the switch.

[0057] Step 102, for each equivalent edge between the i-th layer switch and the i+1-th layer switch in the first switch cluster, the first direction flow of the i-th layer switch is balanced and adjusted.

[0058] When N=3, i=2; when N>3, the values of i are 2, 3, …, N-1 in turn. For example, when N=4, the values of i are 2, 3 in turn; when N=5, the values of i are 2, 3, 4 in turn; when N=6, the values of i are 2, 3, 4, 5 in turn; when N=7, the values of i are 2, 3, 4, 5, 6 in turn.

[0059] In the present application, in each switch cluster, the first direction flow of each switch in a lower layer switch and the full-connection switch in an adjacent higher layer switch can be balanced and adjusted in order from the second layer switch to the higher layer switch.

[0060] For example, N=4, the first direction flow is the outgoing flow, and for each switch cluster, the outgoing 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 outgoing 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] For example, the outgoing flow of the second layer switch refers to the data flow flowing out of the second layer switch, and the outgoing flow of the third layer switch refers to the data flow flowing out of the third layer switch.

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

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

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

[0065] In step 103, the first direction flow corresponding to the second switch cluster in the first direction flow of the Nth layer switch is balanced and adjusted.

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

[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 then the second switch cluster is 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 is balanced and adjusted.

[0068] Among them, 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] Among them, the second endpoint switch corresponds to the first endpoint switch. For example, if the first endpoint switch is the source switch, then the second endpoint switch is the destination switch, and if the first endpoint switch is the destination switch, then the second endpoint switch is the source switch.

[0070] For example, the first direction flow of the Nth layer switch on the equivalent edge between the Nth layer switch and the N-1th layer 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 and the N-2th layer switch in the second switch cluster can be balanced and adjusted, and so on, until the first direction flow of the fourth layer switch on the equivalent edge between the fourth layer switch and the third layer switch in the second switch cluster is balanced and adjusted. Then, 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 Among them, the outgoing flow of the first endpoint switch on each equivalent edge between the first layer switch in the first switch cluster and the second layer switch, the outgoing flow of the second layer on each equivalent edge between the second layer switch and the third layer switch, and the outgoing flow of the third layer on each equivalent edge between the third layer switch and the fourth layer switch are balanced and adjusted. Then, the first direction flow of the fourth layer switch on the equivalent edge between the fourth layer switch and the third layer switch in each switch cluster is balanced and adjusted. Then, the outgoing flow of the third layer switch in each switch cluster is balanced and adjusted.

[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, the first direction flow on each equivalent edge between the lower layer switch and the adjacent higher layer switch is balanced and adjusted in turn from the second layer switch according to the order from low to high of the switch layer, and 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 switch in the multi-layer switch network, and further improving the load balancing effect of the whole switch network.

[0073] Figure 4 The flowchart of the switch load balancing method provided by the embodiment of the present application is shown.

[0074] As shown in Figure 4 , the switch load balancing method comprises:

[0075] Step 401, 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 and the second layer switch in the first switch cluster.

[0076] Step 402, balancing and adjusting the first direction flow of the ith layer switch on each equivalent edge between the ith layer switch and the ith+1 layer switch in the first switch cluster.

[0077] In the present application, steps 401-402 can adopt any one of the implementation manners in the embodiments of the present application, and thus will not be described here.

[0078] Step 403, balancing and adjusting the first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the jth-1 layer switch in the second switch cluster.

[0079] Wherein, when N=4, j=4; when N>4, the value of j is N, 4 in turn. For example, when N=5, the value of j is 5, 4 in turn; when N=6, the value of j is 6, 5, 4 in turn; when N=7, the value of j is 7, 6, 5, 4 in turn; when N=8, the value of j is 8, 7, 6, 5, 4 in turn.

[0080] In the present application, in the Nth layer switch and the second switch cluster, from the Nth layer switch, the first direction flow of each switch in the higher layer switch and each equivalent edge of the switch in the adjacent lower layer switch are balanced and adjusted, until the outflow of each switch in the fourth layer switch and each equivalent edge of the switch in the third layer switch are balanced and adjusted.

[0081] For example, N=5, the first direction flow is outflow, in the fifth layer switch and the second switch cluster, the outflow of the fifth layer switch and each equivalent edge of the fourth layer switch are balanced and adjusted, and then the outflow of the fourth layer switch and each equivalent edge of the third layer switch are balanced and adjusted.

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

[0083] Taking the outflow as the first direction flow as an example, Figure 2 In the present application, the outflow of APG1 in the fourth layer switch to the cabinet top switch group B1 and B2 between APG1 and SPG3, SPG4 in the equivalent edge is balanced and adjusted, and the outflow of APG2 to the cabinet top switch group B1 and B2 between APG2 and SPG3, SPG4 in the equivalent edge is balanced and adjusted.

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

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

[0086] For example, the first direction flow of the third layer switch belonging to the same cabinet top switch group can be divided into the same group to obtain at least one first group.

[0087] Wherein, the first direction flow of the third layer switch in each first group belongs to the same cabinet top switch group.

[0088] For example, the first end-point switch is the source switch, the second end-point switch is the destination switch, and the first direction flow is the out-going flow. In this case, the out-going flows of the third-layer switches corresponding to the destination switches belonging to the same cabinet-top switch group can be divided into the same group. The out-going flows of the third-layer switches in the same first group flow into the same cabinet-top switch group.

[0089] For example, the first end-point switch is the destination switch, the second end-point switch is the source switch, and the first direction flow is the in-coming flow. In this case, the in-coming flows of the third-layer switches corresponding to the source switches belonging to the same cabinet-top switch group can be divided into the same group. The in-coming flows of the third-layer switches in the same first group flow out of the same cabinet-top switch group.

[0090] For example, the first direction flow is the out-going flow, Figure 2 For example, the out-going flows of the SPG3 and the SPG4 flow into the cabinet-top switch group B1, and the out-going flows of the SPG3 and the SPG4 can be divided into the same first group. The out-going flows of the SPG3 and the SPG4 flow into the cabinet-top switch group B2, and the out-going flows of the SPG3 and the SPG4 can be divided into the same first group.

[0091] In step 405, the first direction flows of the third-layer switches in the first group are balanced and adjusted.

[0092] In this application, the data flows in each first group are adjusted individually. The first direction flows of the third-layer switches on the equivalent edges between the third-layer switches and the switches corresponding to the first group in the second-layer switches can be adjusted first. Then, the second direction flows of the switches in the cabinet-top switch group corresponding to the first group on the equivalent edges between the switches in the cabinet-top switch group corresponding to the first group and the switches corresponding to the first group in the second-layer switches 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 flows of the third-layer switches in the first group belong.

[0094] The switches corresponding to the first group in the second-layer switches refer to the switches in the second-layer switches that are fully connected to the switches in the cabinet-top switch group corresponding to the first group.

[0095] For example, Figure 2In the embodiment, a first group includes the outflow of SPG3 and SPG4 to the cabinet switch group B1, and the corresponding switches of the second layer switch for the first group are LEG7, LEG8 and LEG9. After adjustment, the outflow of the source switch IBG1_1 flows through the switches LEG2, SPG1, APG1, SPG3 and LEG7 in turn and flows to IBG3_2, and the outflow of the source switch IBG2_1 flows through the switches LEG5, SPG2, APG1, SPG4 and LEG9 in turn and flows to IBG3_3.

[0096] In the embodiment, the second direction flow refers to the data flow in the second direction, and the second direction is opposite to the first direction. For example, if the first direction flow is outflow, the second direction is inflow, and if the first direction flow is inflow, the second direction is outflow.

[0097] For example, Figure 2 In the embodiment, for the source switch of each cabinet switch group whose outflow flows to other cabinet switch groups, the method of the embodiment can be used to balance and adjust the outflow on the equivalent edges between the source switch in the first layer switch and the second layer switch in each switch cluster, and then balance and adjust the outflow on the equivalent edges between the second layer switch and the third layer switch in each switch cluster, and then balance and adjust the outflow on the equivalent edges between the third layer switch and the fourth layer switch in each switch cluster, and then balance and adjust the third layer switch in each switch cluster according to the outflow of APG_1 and APG_2, and balance and adjust the outflow of the third layer switch in each switch cluster in the first group.

[0098] For example, the method of balancing and adjusting the first direction flow of the third layer switch in the first group can be seen from the following Figure 5 The embodiments are not described here again.

[0099] In the embodiment, by balancing and adjusting the first direction flow on the equivalent edges between the first endpoint switch in the first layer switch and the second layer switch, starting from the second layer switch, the first direction flow on the equivalent edges between the lower layer switch and the adjacent higher layer switch is balanced and adjusted in order from low to high, and then starting from the Nth layer switch, the first direction flow on the equivalent edges between the higher layer switch and the adjacent lower layer switch is balanced and adjusted in order from high to low, and for the first direction flow of the third layer switch to the first layer switch, the first direction flow is grouped according to the cabinet switch group to which the second endpoint switch belongs, and each group is balanced and adjusted separately, which can improve the load balancing effect of the overall switch network.

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

[0101] As shown in the figure, the switch load balancing method comprises the following steps. Figure 5

[0102] Step 501: For each equivalent edge between a first endpoint switch in a first layer switch and a second layer switch in a first switch cluster, the first direction flow of the first endpoint switch is balanced and adjusted.

[0103] For example, 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 can be determined, and 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] For example, the switch cluster to which the target switch corresponding to the outflow of each source switch in the first layer switch belongs can be determined, and if the switch cluster to which any source switch belongs is different from the switch cluster to which the target switch corresponding to the outflow of the source switch belongs, the source switch is determined as the first endpoint switch.

[0105] For example, Figure 3 In the figure, the target switch of the outflow of the switch IBG_11 is IBG_22, so the switch IBG_11 is in the switch cluster in which the cabinet-top switch group a1 is located, and the IBG_22 is in the switch cluster in which the cabinet-top switch group a2 is located. Therefore, the switch IBG_11 is the first endpoint switch, and the switch IBG_12 is also the first endpoint switch by the same reasoning.

[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, which endpoint switches in the first layer switch are the first endpoint switches can be determined, which is highly accurate and improves the basis for subsequent load balancing adjustment of the multi-layer switch network.

[0107] Step 502: For each equivalent edge between an i-th layer switch and an (i+1)-th layer switch in the first switch cluster, the first direction flow of the i-th layer switch is balanced and adjusted.

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

[0109] Step 503: 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, the first direction flow of the third layer switch is grouped to obtain at least one first group. ​

[0110] In the present application, step 503 can adopt any of the implementation manners of the embodiments of the present application, and thus will not be described here again.

[0111] Step 504, grouping the first direction flow of the third layer switch in the first group according to the second end point 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 end point switch of the first direction flow of the third layer switch in the first group to obtain at least one second group.

[0113] Among them, the second end point switch is the switch of the cabinet top switch group corresponding to the first group.

[0114] Among them, the second end point 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 end point switch is the source switch, the second end point switch is the destination switch, and the first direction flow is the outflow. The outflows of the third layer switches in the same second group flow to the same destination switch, and the outflows of the third layer switches in the first group can be grouped according to the destination switches of the outflows of the third layer switches in the first group to obtain at least one second group. Among them, the outflow of the third layer switch refers to the data flow flowing out of the third layer switch. That is, the data flows flowing to the same target switch in the first group can be divided into the same second group.

[0116] Exemplarily, the first end point switch is the destination switch, the second end point switch is the source switch, and the first direction flow is the inflow. The inflows of the third layer switches in the same second group are outflows from the same source switch, and the inflows of the third layer switches in the first group can be grouped according to the source switches of the inflows of the third layer switches in the first group to obtain at least one second group. Among them, the inflow of the third layer switch refers to the data flow flowing into the third layer switch. That is, the data flows flowing out of the same target switch in the first group can be divided into the same second group.

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

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

[0119] Exemplarily, the third layer switch can compare the first direction flow quantity of the third layer switch on each equivalent edge of the second layer switch corresponding to the first packet to determine the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity.

[0120] It should be noted that the equivalent edge with the maximum first direction flow quantity can be one or more, and the equivalent edge with the minimum first direction flow quantity can be one or more.

[0121] Step 506, according to the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity of the third layer switch and the first packet corresponding switch, the first direction flow of the third layer switch on each equivalent edge of the third layer switch and the first packet corresponding switch is balanced and adjusted.

[0122] Exemplarily, the first equivalent edge can be determined from the equivalent edge with the maximum first direction flow quantity, the second equivalent edge can be determined from the equivalent edge with the minimum first direction flow quantity, and the second quantity of the first direction flow on the first equivalent edge is scheduled to be transmitted on the second equivalent edge, and then the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity are re-determined until the data flow balancing condition is met.

[0123] Taking the data flow grouping according to the destination switch as an example, for example, Figure 3 There are outflow flows on the SPG_3 to the cabinet top switch group a3, assuming that the outflow quantity of SPG_3 on the equivalent edge between SPG_3, LEG_7, LEG_8, LEG_9 is 8, 8, 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 one outflow of SPG_3 on the first equivalent edge can be scheduled to be transmitted on the second equivalent edge.

[0124] Among them, the outflow of SPG_3 refers to the data flow flowing out of SPG_3.

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

[0126] The target group can be a group in which the first direction flow of the third layer switch in the second group is balanced and adjusted according to the second endpoint switch.

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

[0128] It should be noted that the target group can be one or more, which is not limited.

[0129] Exemplarily, if the equivalent edge with the largest first direction flow is one, the equivalent edge with the largest first direction flow can be determined as the first equivalent edge.

[0130] Exemplarily, if the equivalent edge with the largest first direction flow is multiple, a random one can be selected from the multiple equivalent edges with the largest first direction flow to be determined as the first equivalent edge.

[0131] Exemplarily, if the equivalent edge with the largest first direction flow is multiple, the corresponding second layer switch with the largest data flow quantity flowing through each equivalent edge with the largest first direction flow can be determined as the first equivalent edge.

[0132] Exemplarily, if the equivalent edge with the smallest first direction flow is one, the equivalent edge with the smallest first direction flow can be determined as the second equivalent edge.

[0133] Exemplarily, if the equivalent edge with the smallest first direction flow is multiple, a random one can be selected from the multiple equivalent edges with the smallest first direction flow to be determined as the second equivalent edge.

[0134] For example, if the first direction flow quantity minimum equivalent edges are multiple, determining the data flow quantity of the second layer switch corresponding to each first direction flow quantity minimum equivalent edge, the corresponding equivalent edge of the second layer switch corresponding to the minimum data flow quantity can be determined as the second equivalent edge.

[0135] Optionally, if the second direction flow of the second group corresponding second endpoint switch on each equivalent edge of the switch corresponding to the first group is unbalanced, the second direction flow quantity maximum equivalent edge and the second direction flow quantity minimum equivalent edge of the second group corresponding second endpoint switch among each equivalent edge of the switch corresponding to the first group can be determined, and then the second direction flow of the second group corresponding second endpoint switch on each equivalent edge of the switch corresponding to the first group is balanced and adjusted according to the second direction flow quantity maximum equivalent edge and the second direction flow quantity minimum equivalent edge.

[0136] Wherein, the second direction flow unbalance on each equivalent edge can mean that the difference between the quantity of the second direction flow on each equivalent edge is greater than 1.

[0137] For example, if the second direction flow of the second group corresponding second endpoint switch on each equivalent edge of the switch corresponding to the first group is unbalanced, it is judged whether the second direction flow quantity minimum equivalent edge can be balanced and adjusted according to the second direction flow quantity maximum equivalent edge, if yes, one second direction flow on the second direction flow quantity maximum equivalent edge can be scheduled to the second direction flow quantity minimum equivalent edge, and the second direction flow quantity maximum equivalent edge and the second direction flow quantity minimum equivalent edge are re determined, and it is continued to judge whether the second direction flow quantity minimum equivalent edge can be balanced and adjusted according to the second direction flow quantity maximum equivalent edge.

[0138] Therefore, the second direction flow of the second endpoint switch on each equivalent edge can be balanced and adjusted according to the second direction flow quantity maximum equivalent edge and the second direction flow quantity minimum equivalent edge, which can reduce the complexity of adjustment, improve the balancing efficiency and balancing degree of the second direction flow of the second endpoint switch on each equivalent edge.

[0139] For example, Figure 3In this embodiment, for each source switch in each cabinet top switch group, the method of this embodiment can be used to balance and adjust the outgoing flows on the equivalent edges between the source switch in the first layer switch and the second layer switch in each switch cluster, and then balance and adjust the outgoing flows on the equivalent edges 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 directions of the third layer switches SPG_1, SPG_2, SPG_3 and SPG_4 to obtain a first group, and then group the outgoing flows of the third layer switches in the first group according to the destination switches, and then adjust according to the grouping.

[0140] In this embodiment, for each first group, the first direction flows of the third layer switches in the first group are grouped according to the second endpoint switches to obtain a second group, and then the first direction flows of the third layer switches on the equivalent edges of the switches corresponding to the first group in the second layer switches in the second group are balanced, so that the first direction flows of the third layer switches on the equivalent edges in the second group are balanced, which can not only improve the load balancing efficiency, but also improve the data transmission efficiency.

[0141] Figure 6 The flowchart of the switch load balancing method provided by another embodiment of the application is shown.

[0142] As shown in Figure 6 , the switch load balancing method comprises the following steps.

[0143] In step 601, in the first switch cluster, the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity are determined from the equivalent edges between the first endpoint switches and the second layer switches according to the first direction flow quantities of the first endpoint switches on the equivalent edges between the first endpoint switches and the second layer switches.

[0144] In this application, the first layer switches in the first switch cluster can include at least one cabinet top switch group, and for each first endpoint switch in each cabinet top switch group, the first direction flow quantities of the first endpoint switches on the equivalent edges between the first endpoint switches and the switches in the second layer switches that are fully connected are compared, and the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity are determined from the equivalent edges between the first endpoint switches and the switches in the second layer switches that are fully connected.

[0145] In step 602, in the first switch cluster, the first direction flows of the second layer switches on the equivalent edges between the first endpoint switches and the second layer switches are balanced and adjusted according to the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity in the equivalent edges between the first endpoint switches and the second layer switches.

[0146] For example, in the first switch cluster, a first direction flow of the first endpoint switch on the first direction flow largest equivalence edge between the first endpoint switch and the equivalence edges of the second layer switch can be scheduled to be transmitted on the first direction flow smallest equivalence edge, and the first direction flow largest equivalence edge and the first direction flow smallest equivalence edge between the first endpoint switch and the equivalence edges of the second layer switch are re-determined, and the scheduling is continued until the difference between the first direction flow largest equivalence edge and the first direction flow smallest equivalence edge is less than or equal to the preset threshold.

[0147] The preset threshold can be 1 or other integers greater than 1, which is not limited.

[0148] For example, when the difference between the first direction flow largest equivalence edge and the first direction flow smallest equivalence edge is 0 or 1, it can be considered that the first direction flow of the first endpoint switch on the equivalence edges of the switches between the first endpoint switch and the second layer switch is balanced.

[0149] Therefore, according to the first direction flow largest equivalence edge and the first direction flow smallest equivalence edge between the first endpoint switch and the equivalence edges of the second layer switch, the first direction flow of the second layer switch on each equivalence edge can be balanced and adjusted, which not only can balance the first direction flow of the first endpoint switch on each equivalence edge between the first endpoint switch and the second layer switch, but also can improve the load balancing efficiency.

[0150] Since the first direction flow largest equivalence edge between the equivalence edges of the switches between the first endpoint switch and the second layer switch can be multiple, and the number of the first direction flow smallest equivalence edge can be multiple, the above method of selecting the first equivalence edge and the second equivalence edge can be used to select one equivalence edge from the multiple first direction flow largest equivalence edges and one equivalence edge from the multiple first direction flow smallest equivalence edges, and then the first direction flow of the first endpoint switch is scheduled from the selected first direction flow largest equivalence edge to the selected first direction flow smallest equivalence edge.

[0151] If there are multiple first endpoint switches in the same cabinet top switch group, the total number of the first direction flow of the first endpoint switch through different switches between the first endpoint switch and the second layer switch which are fully connected with the cabinet top switch group can be different.

[0152] Based on this, optionally, the first direction flow quantity of the first endpoint switch flowing through the same switch in the second layer switch can be accumulated to obtain the first total flow quantity corresponding to each switch in the second layer switch, and the switch with the maximum first total flow quantity and the switch with the minimum first total flow quantity are determined from each switch in the second layer switch. If the difference between the first total flow quantity corresponding to the switch with the maximum first total flow quantity and the first total flow quantity corresponding to the switch with the minimum first total flow quantity is greater than a preset threshold value, it indicates that the first direction flow quantity of the first endpoint switch flowing through the second layer switch is unbalanced, and the switch with the minimum first total flow quantity can be balanced and adjusted according to the switch with the maximum first total flow quantity.

[0153] Therefore, based on the first total flow quantity of the first direction flow of the first endpoint switch flowing through the second layer switch, the switch with the minimum first total flow quantity is balanced and adjusted according to the switch with the maximum first total flow quantity, so that the first direction flow quantity of the second layer switch in the cabinet top switch group is balanced, and the load balancing effect of the second layer switch is improved.

[0154] For example, the first quantity of the first direction flow of each switch in the first endpoint switch flowing through the switch with the maximum first total flow quantity and the second quantity of the first direction flow of each switch in the first endpoint switch flowing through the switch with the minimum first total flow quantity can be determined. If the first quantity corresponding to any switch in the first endpoint switch is greater than the second quantity, one first direction flow of any switch in the first endpoint switch can be scheduled from the switch with the maximum first total flow quantity to the switch with the minimum first total flow quantity, and the switch with the maximum first total flow quantity and the switch with the minimum first total flow quantity are re-determined.

[0155] If the difference between the first total flow quantity corresponding to the switch with the maximum first total flow quantity and the first total flow quantity corresponding to the switch with the minimum first total flow quantity is greater than a preset threshold value, it indicates that the first direction flow quantity of the first endpoint switch flowing through the second layer switch is unbalanced, and the first quantity and the second quantity corresponding to each switch in the first endpoint switch are re-determined for judgment until the difference between the first total flow quantity corresponding to each switch in the second layer switch is less than or equal to the preset threshold value.

[0156] Among them, each switch in the first endpoint switch can refer to all first endpoint switches in a cabinet top switch group.

[0157] Thus, if the number of first direction flows through the switch with the largest first total flow amount is greater than the number of first direction flows through the switch with the smallest first total flow amount in the first endpoint switch, one first direction flow of the switch is scheduled from the switch with the largest first total flow amount to the switch with the smallest first total flow amount, so that the load balancing effect of the second layer switch can be further improved without affecting the balance of the first endpoint switch on each equivalent edge.

[0158] For example, Figure 2 In the embodiment, the number of first direction flows of the switch IBG1_1, IBG1_2 and IBG1_3 flowing to the LEG1 is added to obtain the first total flow amount corresponding to the LEG1, the number of first direction flows of the switch IBG1_1, IBG1_2 and IBG1_3 flowing to the LEG2 is added to obtain the first total flow amount corresponding to the LEG2, and the number of first direction flows of the switch IBG1_1, IBG1_2 and IBG1_3 flowing to the LEG3 is added to obtain the first total flow amount corresponding to the LEG3. If the first total flow amounts corresponding to the LEG1, LEG2 and LEG3 are 5, 3 and 3 respectively, it indicates that the first direction flows flowing through the three switches LEG1, LEG2 and LEG3 are uneven, and if the number of first direction flows of the switch IBG1_1 flowing to the LEG1 is greater than the number of first direction flows flowing to the LEG2, one first direction flow of the switch IBG1_1 can be adjusted from flowing to the LEG1 to flowing to the LEG2.

[0159] In step 603, in the first switch cluster, the first direction flow with the largest amount and the first direction flow with the smallest amount are determined from the equivalent edges between the i-th layer switch and the (i+1)-th layer switch according to the number of first direction flows of the i-th layer switch on the equivalent edges between the i-th layer switch and the (i+1)-th layer switch.

[0160] In the embodiment, in the first switch cluster, the number of first direction flows of the i-th layer switch on the equivalent edges between the i-th layer switch and the (i+1)-th layer switch can be compared, and the first direction flow with the largest amount and the first direction flow with the smallest amount are determined from the equivalent edges between the i-th layer switch and the (i+1)-th layer switch.

[0161] The equivalent edge with the largest amount of first direction flows and the equivalent edge with the smallest amount of first direction flows can be one or more, and are not limited.

[0162] In step 604, the first direction flows of the i-th layer switch on the equivalent edges between the i-th layer switch and the (i+1)-th layer switch are balanced and adjusted according to the equivalent edge with the largest amount of first direction flows and the equivalent edge with the smallest amount of first direction flows between the i-th layer switch and the (i+1)-th layer switch.

[0163] For example, in the first switch cluster, a first-direction flow of the i th switch on an equivalent edge with the largest number of first-direction flows among the equivalent edges between the i th switch and the i + 1 th switch can be scheduled to be transmitted on an 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 are re-determined, and the scheduling is continued until the difference between the largest number of first-direction flows and the smallest number of first-direction flows is less than or equal to a preset threshold.

[0164] The preset threshold can be 1 or an integer greater than 1, and is not limited in this regard.

[0165] For example, when the difference between the largest number of first-direction flows and the smallest number of first-direction flows is 0 or 1, it can be considered that the first-direction flows of the i th switch on the equivalent edges between the i th switch and the i + 1 th switch are balanced.

[0166] Thus, the first-direction flows of the i th switch on the equivalent edges between the i th switch and the i + 1 th switch can be balanced and adjusted 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, which not only balances the first-direction flows of the i th switch on the equivalent edges between the i th switch and the i + 1 th switch, but also improves the load balancing efficiency.

[0167] In the case where the first-direction flows of the i th switch on the equivalent edges between the i th switch and the i + 1 th switch are balanced, the total number of the first-direction flows of the i th switch flowing through the switches in the i + 1 th switch can be different.

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

[0169] Thus, based on the second total flow-through quantity of the first direction flow of the i-layer switch flowing through the i+1-layer switch, the second total flow-through quantity of the switch with the largest second total flow-through quantity is adjusted to balance the switch with the smallest second total flow-through quantity, so that the quantity of the first direction flow of the i-layer switch flowing through the i+1-layer switch is balanced, thereby improving the load balancing effect of the i+1-layer switch.

[0170] For example, the third quantity of the first direction flow of each switch in the i-layer switch flowing through the switch with the largest second total flow-through quantity and the fourth quantity of the first direction flow of each switch in the i-layer switch flowing through the switch with the smallest second total flow-through quantity can be determined. If the third quantity corresponding to any switch in the i-layer switch is greater than the fourth quantity, one first direction flow of the switch in the i-layer switch can be scheduled from the switch with the largest second total flow-through quantity to the switch with the smallest second total flow-through quantity, and the switch with the largest second total flow-through quantity and the switch with the smallest second total flow-through quantity are re-determined.

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

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

[0173] In step 605, in the N-layer switch and the second switch cluster, the equivalent edge with the largest first direction flow quantity and the equivalent edge with the smallest first direction flow quantity are determined from the equivalent edges between the j-layer switch and the j-1-layer switch according to the first direction flow quantity of the j-layer switch on each equivalent edge between the j-layer switch and the j-1-layer switch.

[0174] In the Nth layer switch and the second switch cluster, the first direction flow quantity of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch can be compared, and the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity can be determined from each equivalent edge between the jth layer switch and the j-1th layer switch.

[0175] The equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity can be one or more, and are not limited.

[0176] In step 606, the first direction flow on each equivalent edge between the jth layer switch and the j-1th layer switch can be balanced and adjusted according to the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity.

[0177] For example, in the Nth layer switch and the second switch cluster, one first direction flow of the jth layer switch on the equivalent edge with the maximum first direction flow quantity between the jth layer switch and the j-1th layer switch can be scheduled to be transmitted on the equivalent edge with the minimum first direction flow quantity, and the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity between the jth layer switch and the j-1th layer switch can be determined again, and the scheduling can be continued until the data flow difference between the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity is less than or equal to a preset threshold.

[0178] The preset threshold can be 1 or other integers greater than 1, and is not limited.

[0179] For example, when the data flow quantity difference between the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity is 0 or 1, it can be considered that 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.

[0180] Therefore, the first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch can be balanced and adjusted according to the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity, which not only balances the first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch, but also improves the load balancing efficiency.

[0181] In the case of the first direction flow balance of the jth layer switch on each equivalent edge between the jth layer switch and the (j-1)th layer switch, the total number of the first direction flow of the jth layer switch flowing through each switch in the (j-1)th layer switch can be different.

[0182] Optionally, in the Nth layer switch and the second switch cluster, the number of the first direction flow of the jth layer switch flowing 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 maximum third total flow number and the switch with the minimum third total flow number in the (j-1)th layer switch can be determined. If the difference between the third total flow number corresponding to the switch with the maximum third total flow number and the third total flow number corresponding to the switch with the minimum third total flow number is greater than a preset threshold, it indicates that the number of the first direction flow of the jth layer switch flowing through the (j-1)th layer switch is unbalanced, and the switch with the minimum third total flow number can be balanced and adjusted according to the switch with the maximum third total flow number.

[0183] Therefore, based on the third total flow number of the first direction flow of the jth layer switch flowing through the (j-1)th layer switch, the switch with the minimum third total flow number can be balanced and adjusted according to the switch with the maximum third total flow number, so that the number of the first direction flow of the jth layer switch flowing through the (j-1)th layer switch is balanced, thereby improving the load balancing effect of the (j-1)th layer switch.

[0184] For example, in the Nth layer switch and the second switch cluster, the fifth number of the first direction flow of each switch in the jth layer switch flowing through the switch with the maximum third total flow number and the sixth number of the first direction flow of each switch in the jth layer switch flowing through the switch with the minimum third total flow number can be determined. If the fifth number corresponding to any switch in the jth layer switch is greater than the sixth number, one first direction flow of the switch in the jth layer switch can be scheduled from the switch with the maximum third total flow number to the switch with the minimum third total flow number, and the switch with the maximum third total flow number and the switch with the minimum third total flow number can be re-determined.

[0185] If the difference between the third total flow number corresponding to the switch with the maximum third total flow number and the third total flow number corresponding to the switch with the minimum third total flow number is greater than a preset threshold, it indicates that the number of the first direction flow of the jth layer switch flowing through the (j-1)th layer switch is unbalanced, and the third number and the fourth number corresponding to each switch in the jth layer switch are re-determined for further judgment until the difference between the third total flow numbers 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 the first direction flow of any switch in the jth layer of switches flowing through the third switch with the largest total flow number is greater than the number of the first direction flow of the third switch with the smallest total flow number, one first direction flow of the switch is scheduled from the third switch with the largest total flow number to the third switch with the smallest total flow number, so that the load balancing effect of the j-1th layer of switches can be further improved without affecting the balance of the jth layer of switches on the equivalent edges.

[0187] For example, Figure 2 In the method, after the outgoing flows on the equivalent edges of APG1 and APG2 and SPG3 and SPG4 are balanced and adjusted respectively, the number of the outgoing flows of APG1 and APG2 flowing to SPG3 is added to obtain the third total flow number corresponding to SPG3, and the number of the outgoing flows of APG1 and APG2 flowing to SPG4 is 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 indicates that the outgoing flows flowing through the three switches of SPG3 and SPG4 are uneven. If the number of the outgoing flows of APG1 flowing to SPG3 is greater than that flowing to SPG4, one outgoing flow of APG1 is adjusted from flowing to SPG3 to flowing to SPG4.

[0188] In step 607, the first direction flows of the third layer of switches are grouped according to the cabinet top switch group to which the second end point switch corresponding to the first direction flow of the third layer of switches belongs, to obtain at least one first group.

[0189] In step 608, the first direction flows of the third layer of switches in the first group are balanced and adjusted.

[0190] In the method, steps 607-608 can be implemented by any of the embodiments of the method.

[0191] In the method, the first direction flows of the first end point switch on the equivalent edges are balanced and adjusted according to the maximum equivalent edge of the first direction flow and the maximum equivalent edge of the first direction flow between the first end point switch in the first layer of switches and the second layer of switches, the first direction flows of the ith layer of switches on the equivalent edges are balanced and adjusted according to the maximum equivalent edge of the first direction flow and the maximum equivalent edge of the first direction flow between the ith layer of switches and the ith+1 layer of switches, the first direction flows of the ith layer of switches on the equivalent edges are balanced and adjusted according to the maximum equivalent edge of the first direction flow and the maximum equivalent edge of the first direction flow between the jth layer of switches and the j-1th layer of switches, and the first direction flows of the third layer of switches are balanced and adjusted by grouping, so that the overall load balancing effect is improved.

[0192] To achieve the above-mentioned embodiments, the embodiments of the present application further provide a switch load balancing device. The device is applied to an N-layer switch network, the N-layer switch network comprising a plurality of switch clusters and an Nth-layer switch, each of the switch clusters comprising a front N-1-layer switch, and the N being an integer greater than or equal to 3.

[0193] Figure 7 A structural schematic diagram of the switch load balancing device provided by an embodiment of the present application is shown in the figure.

[0194] As shown in the figure, the switch load balancing device 700 comprises: Figure 7 A first adjusting module 710, configured to balance and adjust a first-direction flow of a first end-point switch in a first-layer switch in a first switch cluster on each equivalent edge of the first end-point switch and a second-layer switch;

[0195] A second adjusting module 720, configured to balance and adjust a first-direction flow of an i-layer switch in the first switch cluster on each equivalent edge of the i-layer switch and an i+1-layer switch; when N=3, i=2; when N>3, the value of i is 2, 3, …, N-1 in turn;

[0196] A third adjusting module 730, configured to balance and adjust a first-direction flow of a second switch cluster in a first-direction flow of the Nth-layer switch; the second switch cluster is a switch cluster to which a second end-point switch belonging to the first-direction flow of the Nth-layer switch belongs;

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

[0198] balance and adjust a first-direction flow of a j-layer switch in the second switch cluster on each equivalent edge of the j-layer switch and a j-1-layer switch; when N=4, j=4; when N>4, the value of j is N, 4, …, 4 in turn;

[0199] group the first-direction flow of the third-layer switch according to a cabinet-top switch group to which a second end-point switch corresponding to the first-direction flow of the third-layer switch in the second switch cluster belongs, to obtain at least one first group;

[0200] balance and adjust the first-direction flow of the third-layer switch in the first group.

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

[0202] balance and adjust a first-direction flow of a third-layer switch in the second switch cluster on each equivalent edge of the third-layer switch and a second-layer switch;

[0203] group the first direction flows of the third layer switches according to the second endpoint switches corresponding to the second direction flows of the third layer switches in the second switch cluster, to obtain at least one first group;

[0204] group the first direction flows of the third layer switches in the first group according to the second endpoint switches, to obtain at least one second group;

[0205] For the second group, determine the equivalence edge with the maximum number of first direction flows and the equivalence edge with the minimum number of first direction flows from the equivalence edges of the third layer switches and the switches corresponding to the first group in the second layer switches according to the number of first direction flows of the third layer switches on each equivalence edge of the third layer switches and the switches corresponding to the first group in the second layer switches;

[0206] According to the equivalence edge with the maximum number of first direction flows and the equivalence edge with the minimum number of first direction flows in the equivalence edges of the third layer switches and the switches corresponding to the first group in the second layer switches, balance and adjust the first direction flows of the third layer switches on each equivalence edge of the third layer switches and the switches corresponding to the first group in the second layer switches.

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

[0208] In the first switch cluster, determine the equivalence edge with the maximum number of first direction flows and the equivalence edge with the minimum number of first direction flows from the equivalence edges of the first endpoint switches and the second layer switches according to the number of first direction flows of the first endpoint switches on each equivalence edge of the first endpoint switches and the second layer switches;

[0209] According to the equivalence edge with the maximum number of first direction flows and the equivalence edge with the minimum number of first direction flows in the equivalence edges of the first endpoint switches and the second layer switches, balance and adjust the first direction flows of the second layer switches on each equivalence edge of the first endpoint switches and the second layer switches.

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

[0211] In the first switch cluster, determine the equivalence edge with the maximum number of first direction flows and the equivalence edge with the minimum number of first direction flows from the equivalence edges of the first endpoint switches and the second layer switches according to the number of first direction flows of the first endpoint switches on each equivalence edge of the first endpoint switches and the second layer switches;

[0212] According to the equivalence edge with the maximum number of first direction flows and the equivalence edge with the minimum number of first direction flows in the equivalence edges of the first endpoint switches and the second layer switches, balance and adjust the first direction flows of the second layer switches on each equivalence edge of the first endpoint switches and the second layer switches.

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

[0214] accumulate the first direction flow quantity of the first end-point switch flowing through the same switch in the second layer switch to obtain a first total flow quantity corresponding to each switch in the second layer switch;

[0215] determine the switch with the maximum first total flow quantity and the switch with the minimum first total flow quantity from each switch in the second layer switch;

[0216] in response to a difference between the first total flow quantity corresponding to the switch with the maximum first total flow quantity and the first total flow quantity corresponding to the switch with the minimum first total flow quantity being greater than a preset threshold, perform balanced adjustment on the switch with the minimum first total flow quantity according to the switch with the maximum first total flow quantity.

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

[0218] determine a first quantity of the first direction flow of each switch in the first end-point switch flowing through the switch with the maximum first total flow quantity and a second quantity of the first direction flow of each switch in the first end-point switch flowing through the switch with the minimum first total flow quantity;

[0219] in response to the first quantity corresponding to any switch in the first end-point switch being greater than the second quantity, schedule one first direction flow of any switch in the first end-point switch from the switch with the maximum first total flow quantity to the switch with the minimum first total flow quantity, and redetermine the switch with the maximum first total flow quantity and the switch with the minimum first total flow quantity;

[0220] in response to a difference between the first total flow quantity corresponding to the switch with the maximum first total flow quantity and the first total flow quantity corresponding to the switch with the minimum first total flow quantity being greater than a preset threshold, redetermine the first quantity and the second quantity corresponding to each switch in the first end-point switch until a difference between the first total flow quantity corresponding to each switch in the second layer switch is less than or equal to the preset threshold.

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

[0222] in the first switch cluster, determine the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity from each equivalent edge between the i-th layer switch and the i+1-th layer switch according to the first direction flow quantity of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch;

[0223] 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 is balanced and adjusted according to the equivalent edge with the maximum first direction flow quantity and the equivalent edge with the minimum first direction flow quantity in each equivalent edge between the i th layer switch and the i+1 th layer switch.

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

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

[0226] The switch with the maximum second total flow quantity and the switch with the minimum second total flow quantity are determined from each switch in the i+1 th layer switch;

[0227] In response to a difference between the second total flow quantity corresponding to the switch with the maximum second total flow quantity and the second total flow quantity corresponding to the switch with the minimum second total flow quantity being greater than a preset threshold, the switch with the minimum second total flow quantity is balanced and adjusted according to the switch with the maximum second total flow quantity.

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

[0229] The third quantity of the first direction flow of each switch in the i th layer switch flowing through the switch with the maximum second total flow quantity and the fourth quantity of the first direction flow of each switch in the i th layer switch flowing through the switch with the minimum second total flow quantity are determined;

[0230] In response to the third quantity corresponding to any switch in the i th layer switch being greater than the fourth quantity, one first direction flow of any switch in the i th layer switch is scheduled from the switch with the maximum second total flow quantity to the switch with the minimum second total flow quantity, and the switch with the maximum second total flow quantity and the switch with the minimum second total flow quantity are re-determined;

[0231] In response to a difference between the second total flow quantity corresponding to the switch with the maximum second total flow quantity and the second total flow quantity corresponding to the switch with the minimum second total flow quantity being greater than a preset threshold, the third quantity and the fourth quantity corresponding to each switch in the i th layer switch are re-determined until a 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.

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

[0233] 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 according to the maximum first direction flow and the minimum first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch.

[0234] 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 according to the maximum first direction flow and the minimum first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch.

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

[0236] 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 according to the maximum first direction flow and the minimum first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch.

[0237] 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 according to the maximum first direction flow and the minimum first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch.

[0238] In response to a difference between the third total flow-through quantity corresponding to the third total flow-through quantity maximum switch and the third total flow-through quantity corresponding to the third total flow-through quantity minimum switch being greater than a preset threshold value, the third total flow-through quantity minimum switch is balanced and adjusted according to the third total flow-through quantity maximum switch.

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

[0240] 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 according to the maximum first direction flow and the minimum first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch.

[0241] 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 according to the maximum first direction flow and the minimum first direction flow of the jth layer switch on each equivalent edge between the jth layer switch and the j-1th layer switch.

[0242] In response to a difference between the third total flow-through quantity corresponding to the third total flow-through quantity maximum switch and the third total flow-through quantity corresponding to the third total flow-through quantity minimum switch being greater than a preset threshold value, the third total flow-through quantity minimum switch is balanced and adjusted according to the third total flow-through quantity maximum switch.

[0243] It should be noted that the foregoing explanation of the switch load balancing method embodiment is also applicable to the switch load balancing device of the embodiment, and thus will not be described again here.

[0244] In the embodiments of the present application, for the first switch cluster, the first direction flow on each equivalent edge between the first end-point switch and the second layer switch in the first layer switch in the first switch cluster is balanced and adjusted, in the first switch cluster, the first direction flow on each equivalent edge between the low-layer switch and the adjacent high-layer switch is balanced and adjusted in turn from the second layer switch according to the order from low to high of the switch layer, and 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 switch in the multi-layer switch network, and further improving the load balancing effect of the whole switch network.

[0245] According to the embodiments of the present application, the present application further 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 embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.

[0247] As shown in Figure 8 The device 800 includes a computing unit 801 that can perform various appropriate actions and processes in accordance with a computer program stored in a ROM (Read-Only Memory) 802 or a computer program loaded from a storage unit 808 into a RAM (Random Access Memory) 803. Various programs and data required for the operation of the device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other through 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 magnetic 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 computer networks, such as the Internet, and / or various telecommunication networks.

[0249] The computing unit 801 can be various general and / or special purpose 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 special-purpose 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 various methods and processes described above, such as the switch load balancing method. For example, in some embodiments, the switch load balancing method can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can 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 can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the switch load balancing method by other any appropriate means, such as by means of firmware.

[0250] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a Field Programmable Gate Array (FPGA), an Application-Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a System on a Chip (SOC), a Complex Programmable Logic Device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0251] Program code for carrying out methods of the present application can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0252] In the context of this application, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include a linearly-programmed electronic storage, a portable computer diskette, a hard disk, a RAM, a ROM, an EPROM (Electrically Programmable Read-Only-Memory), or a flash memory, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0253] To provide for interaction with a user, the systems and techniques described here 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 a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, 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, speech, or tactile input.

[0254] The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a LAN (Local Area Network), a WAN (Wide Area Network), the Internet, and a blockchain network.

[0255] The computer system can include clients and servers. This relationship can be between two computers, or between computers and servers located throughout the network, depending on the context in which the term is used. Servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are a host product in the cloud computing service system to solve the defects of large management difficulty and weak business scalability in traditional physical hosts and VPS services (Virtual Private Server, Virtual Private Server). The server can also be a server of a distributed system, or a server combined with a blockchain.

[0256] According to the embodiments of the present application, the present application also provides a computer program product, when the instruction processor in the computer program product executes, executes the switch load balancing method proposed in the above embodiments of the present application.

[0257] It should be understood that the steps shown above can be reordered, added or deleted using various forms of flow. For example, the steps described in the present application can be executed in parallel, sequentially or in different order, as long as the desired results of the technical solutions disclosed in the present application can be achieved, which is not limited herein.

[0258] The above specific embodiments do not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent replacement and improvement within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for load balancing of a switch, the method being applied to an N-layer switch network, the N-layer switch network comprising a plurality of switch clusters and an Nth-layer switch, each of the switch clusters comprising a first N-1-layer switch, and N being an integer greater than or equal to 3, the method comprising: balancing the first-direction flow of a first end-point switch in a first-layer switch in a first switch cluster on each equivalent edge between the first end-point switch and a second-layer switch, wherein the first switch cluster is any one of the plurality of switch clusters; balancing the first-direction flow of an i-layer switch in the first switch cluster on each equivalent edge between the i-layer switch and an i+1-layer switch, wherein i is 2 when N is 3, and i is 2...N-1 in turn when N is greater than 3; and balancing the first-direction flow of the second-layer switch in the first-direction flow of the Nth-layer switch corresponding to a second switch cluster, wherein the second switch cluster is a switch cluster to which a second end-point switch corresponding to the first-direction flow of the Nth-layer switch belongs. When N is an integer greater than or equal to 4, the balancing the first-direction flow of the second-layer switch in the first-direction flow of the Nth-layer switch corresponding to the second switch cluster comprises: balancing the first-direction flow of a j-layer switch in the second switch cluster on each equivalent edge between the j-layer switch and a j-1-layer switch, wherein j is 4 when N is 4, and j is N...4 in turn when N is greater than 4; grouping the first-direction flow of a third-layer switch in the second switch cluster according to a top-of-rack switch group to which a second end-point switch corresponding to the first-direction flow of the third-layer switch belongs, to obtain at least one first group; and balancing the first-direction flow of the third-layer switch in the first group. When N is 3, the balancing the first-direction flow of the second-layer switch in the first-direction flow of the Nth-layer switch corresponding to the second switch cluster comprises: grouping the first-direction flow of a third-layer switch in the second switch cluster according to a top-of-rack switch group to which a second end-point switch corresponding to the first-direction flow of the third-layer switch belongs, 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 end-point switch, to obtain at least one second group; determining, for the second group, a maximum first-direction flow and a minimum first-direction flow from each equivalent edge between the third-layer switch and a switch corresponding to the first group in the second-layer switch, according to a number of the first-direction flow 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. ​ 2. The method of claim 1, wherein, ​ ​ ​ ​ 3. The method of claim 1, wherein, ​ ​ ​ ​ According to the maximum first direction flow and the minimum first direction flow of each equivalent edge between the third layer switch and the switch corresponding to the first packet, the first direction flow of the third layer switch on each equivalent edge between the third layer switch and the switch corresponding to the first packet is 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 packet on each equivalent edge of the switch corresponding to the first packet being unbalanced, determining the maximum second direction flow and the minimum second direction flow of the second endpoint switch corresponding to the second packet on each equivalent edge between the second endpoint switch corresponding to the second packet and the switch corresponding to the first packet; according to the maximum second direction flow and the minimum second direction flow, balancing and adjusting the second direction flow of the second endpoint switch corresponding to the second packet on each equivalent edge of the switch corresponding to the first packet.

5. The method of claim 1, wherein, The balancing and adjusting of the first direction flow of the first endpoint switch in the first layer switch in the first switch cluster includes: in the first switch cluster, determining the maximum first direction flow and the minimum first direction flow of each equivalent edge between the first endpoint switch and the second layer switch according to the first direction flow of the first endpoint switch on each equivalent edge between the first endpoint switch and the second layer switch; according to the maximum first direction flow and the minimum first direction flow of each equivalent edge between the first endpoint switch and the second layer switch, balancing and adjusting the first direction flow of the second layer switch on each equivalent edge between the first endpoint switch and the second layer switch.

6. The method of claim 5, further comprising: in the first switch cluster, accumulating the first direction flow of the first endpoint switch through the same switch in the second layer switch to obtain a first total flow corresponding to each switch in the second layer switch; determining the maximum first total flow and the minimum first total flow of each switch in the second layer switch; in response to the difference between the first total flow corresponding to the maximum first total flow and the first total flow corresponding to the minimum first total flow being greater than a preset threshold, balancing and adjusting the minimum first total flow according to the maximum first total flow.

7. The method of claim 6, wherein, The balancing and adjusting of the minimum first total flow according to the maximum first total flow includes: determining the first quantity of the first direction flow of each switch in the first endpoint switch through the maximum first total flow switch and the second quantity of the first direction flow of each switch in the first endpoint switch through the minimum first total flow switch; in response to the first quantity corresponding to any of the first endpoint switches being greater than the second quantity, scheduling a first directional flow of any of the first endpoint switches from a first total flow-through quantity maximum switch to a first total flow-through quantity minimum switch, and re-determining the first total flow-through quantity maximum switch and the first total flow-through quantity minimum switch; in response to a difference between the first total flow-through quantity corresponding to the first total flow-through quantity maximum switch and the first total flow-through quantity corresponding to the first total flow-through quantity minimum switch being greater than the preset threshold, re-determining the first quantity and the second quantity corresponding to each of the first endpoint switches until a difference between the first total flow-through quantities corresponding to each of the second layer switches is less than or equal to the preset threshold.

8. The method of claim 1, wherein, the balancing adjustment of the first directional 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 comprises: in the first switch cluster, determining a first directional flow quantity maximum equivalent edge and a first directional flow quantity minimum equivalent edge from each equivalent edge between the i-th layer switch and the i+1-th layer switch according to the first directional flow quantity of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch; balancing adjusting the first directional flow of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch according to the first directional flow quantity maximum equivalent edge and the first directional flow quantity minimum equivalent edge from each equivalent edge between the i-th layer switch and the i+1-th layer switch.

9. The method of claim 8, further comprising: in the first switch cluster, accumulating the first directional flow quantity of the i-th layer switch through a same switch in the i+1-th layer switch to obtain a second total flow-through quantity corresponding to each of the i+1-th layer switches; determining a second total flow-through quantity maximum switch and a second total flow-through quantity minimum switch from each of the i+1-th layer switches; in response to a difference between the second total flow-through quantity corresponding to the second total flow-through quantity maximum switch and the second total flow-through quantity corresponding to the second total flow-through quantity minimum switch being greater than a preset threshold, balancing adjusting the second total flow-through quantity minimum switch according to the second total flow-through quantity maximum switch.

10. The method of claim 9, wherein, the balancing adjusting of the second total flow-through quantity minimum switch according to the second total flow-through quantity maximum switch comprises: determining a third quantity of the first directional flow of each of the i-th layer switches through the second total flow-through quantity maximum switch and a fourth quantity of the first directional flow of each of the i-th layer switches through the second total flow-through quantity minimum switch; in response to the third quantity corresponding to any of the i-layer switches being greater than the fourth quantity, scheduling a first-direction flow of any of the i-layer switches from a second total flow-through quantity maximum switch to a second total flow-through quantity minimum switch, and re-determining the second total flow-through quantity maximum switch and the second total flow-through quantity minimum switch; in response to a difference between the second total flow-through quantity corresponding to the second total flow-through quantity maximum switch and the second total flow-through quantity corresponding to the second total flow-through quantity minimum switch being greater than the preset threshold value, re-determining the third quantity and the fourth quantity corresponding to each of the i-layer switches until a difference between the second total flow-through quantities corresponding to each of the i+1-layer switches is less than or equal to the preset threshold value.

11. The method of claim 2, wherein, the balancing adjustment of the first-direction flow of the j-layer switch on each equivalent edge between the j-layer switch and the j-1-layer switch in the N-layer switch and the second switch cluster comprises: in the N-layer switch and the second switch cluster, determining a first-direction flow quantity maximum equivalent edge and a first-direction flow quantity minimum equivalent edge from each equivalent edge between the j-layer switch and the j-1-layer switch according to the first-direction flow quantity of the j-layer switch on each equivalent edge between the j-layer switch and the j-1-layer switch; the balancing adjustment of the first-direction flow of the j-layer switch on each equivalent edge between the j-layer switch and the j-1-layer switch according to the first-direction flow quantity maximum equivalent edge and the first-direction flow quantity minimum equivalent edge.

12. The method of claim 11, further comprising: in the N-layer switch and the second switch cluster, accumulating the first-direction flow quantity of the j-layer switch through the same switch in the j-1-layer switch to obtain a third total flow-through quantity corresponding to each of the j-1-layer switches; determining a third total flow-through quantity maximum switch and a third total flow-through quantity minimum switch from each of the j-1-layer switches; in response to a difference between the third total flow-through quantity corresponding to the third total flow-through quantity maximum switch and the third total flow-through quantity corresponding to the third total flow-through quantity minimum switch being greater than a preset threshold value, balancing adjusting the third total flow-through quantity minimum switch according to the third total flow-through quantity maximum switch.

13. The method of claim 12, wherein, the balancing adjusting of the third total flow-through quantity minimum switch according to the third total flow-through quantity maximum switch comprises: determining a fifth quantity of the first-direction flow of each of the j-layer switches through the third total flow-through quantity maximum switch and a sixth quantity of the first-direction flow of each of the j-layer switches through the third total flow-through quantity minimum switch; and determining a fifth quantity of the first-direction flow of each of the j-layer switches through the third total flow-through quantity maximum switch and a sixth quantity of the first-direction flow of each of the j-layer switches through the third total flow-through quantity minimum switch. in response to the sixth quantity corresponding to any of the jth layer switches being greater than the seventh quantity, scheduling a first direction flow of any of the jth layer switches from a third total flow-per-quantity-maximum switch to a third total flow-per-quantity-minimum switch, and re-determining the third total flow-per-quantity-maximum switch and the third total flow-per-quantity-minimum switch; in response to a difference between the third total flow-per-quantity corresponding to the third total flow-per-quantity-maximum switch and the third total flow-per-quantity corresponding to the third total flow-per-quantity-minimum switch being greater than the preset threshold, re-determining the fifth quantity and the sixth quantity corresponding to each of the jth layer switches until a difference between the third total flow-per-quantities corresponding to each of the j-1th layer switches is less than or equal to the preset threshold.

14. A switch load balancing apparatus, applied to an N-layer switch network, the N-layer switch network comprising a plurality of switch clusters and an Nth layer switch, each of the switch clusters comprising a front N-1th layer switch, and N being an integer greater than or equal to 3, the apparatus comprising: a first adjusting module, configured to balance and adjust a first direction flow of a first end-point switch in a first layer switch in a first switch cluster on each equivalent edge of the first end-point switch and a second layer switch, wherein the first switch cluster is any of the plurality of switch clusters; a second adjusting module, configured to balance and adjust the first direction flow of an i-th layer switch in the first switch cluster on each equivalent edge of the i-th layer switch and an i+1-th layer switch, wherein i=2 when N=3, and i=2...N-1 in turn when N>3; a third adjusting module, configured to balance and adjust a second direction flow corresponding to a second switch cluster in the first direction flow of the Nth layer switch, wherein the second switch cluster is a switch cluster to which a second end-point switch of the first direction flow of the Nth layer switch belongs.

15. The apparatus of claim 14, wherein, N being an integer greater than or equal to 4, the third adjusting module is configured to: balance and adjust the first direction flow of a jth layer switch in the second switch cluster on each equivalent edge of the jth layer switch and a j-1th layer switch, wherein j=4 when N=4, and j=N...4 in turn when N>4; grouping the first direction flow of a third layer switch in the second switch cluster according to a top-of-rack switch group to which a second end-point switch corresponding to the first direction flow of the third layer switch belongs, to obtain at least one first group; balance and adjust the first direction flow of the third layer switch in the first group.

16. The apparatus of claim 14, wherein, N being equal to 3, the third adjusting module is configured to: grouping the first direction flow of a third layer switch in the second switch cluster according to a top-of-rack switch group to which a second end-point switch corresponding to the first direction flow of the third layer switch belongs, 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 end point switch to obtain at least one second group; determining, for the second group, the equivalence edge with the maximum first direction flow quantity and the equivalence edge with the minimum first direction flow quantity from the equivalence edges between the third layer switch and the switch corresponding to the first group in the second layer switch according to the first direction flow quantity of the third layer switch on each equivalence edge between the third layer switch and the switch corresponding to the first group in the second layer switch; performing balanced adjustment on the first direction flow of the third layer switch on each equivalence edge between the third layer switch and the switch corresponding to the first group according to the equivalence edge with the maximum first direction flow quantity and the equivalence edge with the minimum first direction flow quantity.

17. The apparatus of claim 16, wherein, The third adjustment module is configured to: determining the equivalence edge with the maximum second direction flow quantity and the equivalence edge with the minimum second direction flow quantity of the second end point switch corresponding to the second group from the equivalence edges between the second end point switch corresponding to the second group and the switch corresponding to the first group in response to the unbalanced second direction flow of the second end point switch corresponding to the second group on each equivalence edge between the second end point switch corresponding to the second group and the switch corresponding to the first group; performing balanced adjustment on the second direction flow of the second end point switch corresponding to the second group on each equivalence edge between the second end point switch corresponding to the second group and the switch corresponding to the first group according to the equivalence edge with the maximum second direction flow quantity and the equivalence edge with the minimum second direction flow quantity.

18. The apparatus of claim 14, wherein, The first adjustment module is configured to: determining the equivalence edge with the maximum first direction flow quantity and the equivalence edge with the minimum first direction flow quantity from the equivalence edges between the first end point switch and the second layer switch according to the first direction flow quantity of the first end point switch on each equivalence edge between the first end point switch and the second layer switch in the first switch cluster; performing balanced adjustment on the first direction flow of the second layer switch on each equivalence edge between the first end point switch and the second layer switch according to the equivalence edge with the maximum first direction flow quantity and the equivalence edge with the minimum first direction flow quantity.

19. The apparatus of claim 18, wherein, The first adjustment module is further configured to: accumulating the first direction flow quantity of the first end point switch flowing through the same switch in the second layer switch to obtain a first total flow quantity corresponding to each switch in the second layer switch in the first switch cluster; determining the switch with the maximum first total flow quantity and the switch with the minimum first total flow quantity from each switch in the second layer switch; performing balanced adjustment on the switch with the minimum first total flow quantity according to the switch with the maximum first total flow quantity in response to the difference between the first total flow quantity corresponding to the switch with the maximum first total flow quantity and the first total flow quantity corresponding to the switch with the minimum first total flow quantity being greater than a preset threshold.

20. The apparatus of claim 19, wherein, The first adjustment module is further configured to: determining a first quantity of the first direction flow of each of the first end-point switches through a first switch with a largest total flow-through quantity and a second quantity of the first direction flow of each of the first end-point switches through a first switch with a smallest total flow-through quantity; in response to the first quantity of any of the first end-point switches being greater than the second quantity, scheduling a first direction flow of any of the first end-point switches from the first switch with the largest total flow-through quantity to the first switch with the smallest total flow-through quantity, and re-determining the first switch with the largest total flow-through quantity and the first switch with the smallest total flow-through quantity; in response to a difference between the first total flow-through quantity of the first switch with the largest total flow-through quantity and the first total flow-through quantity of the first switch with the smallest total flow-through quantity being greater than the preset threshold, re-determining the first quantity and the second quantity of each of the first end-point switches until a difference between the first total flow-through quantity of each of the second layer switches is less than or equal to the preset threshold.

21. The apparatus of claim 14, wherein, The second adjusting module is configured to: in the first switch cluster, determining a first direction flow quantity maximum equivalent edge and a first direction flow quantity minimum equivalent edge from each equivalent edge between the i-th layer switch and the i+1-th layer switch according to the first direction flow quantity of the i-th layer switch on each equivalent edge between the i-th layer switch and the i+1-th layer switch; performing balanced adjustment on 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 according to the first direction flow quantity maximum equivalent edge and the first direction flow quantity minimum equivalent edge from each equivalent edge between the i-th layer switch and the i+1-th layer switch.

22. The apparatus of claim 21, wherein, The second adjusting module is further configured to: in the first switch cluster, accumulating the first direction flow quantity of the i-th layer switch through a same switch in the i+1-th layer switch to obtain a second total flow-through quantity corresponding to each of the i+1-th layer switches; determining a second total flow-through quantity maximum switch and a second total flow-through quantity minimum switch from each of the i+1-th layer switches; in response to a difference between the second total flow-through quantity of the second total flow-through quantity maximum switch and the second total flow-through quantity of the second total flow-through quantity minimum switch being greater than a preset threshold, performing balanced adjustment on the second total flow-through quantity minimum switch according to the second total flow-through quantity maximum switch.

23. The apparatus of claim 22, wherein, The second adjusting module is further configured to: determining a third quantity of the first direction flow of each of the i-th layer switches through the second total flow-through quantity maximum switch and a fourth quantity of the first direction flow of each of the i-th layer switches through the second total flow-through quantity minimum switch; in response to the third quantity corresponding to any of the i-layer switches being greater than the fourth quantity, scheduling a first-direction flow of any of the i-layer switches from a second total-flow-through-quantity-maximum switch to a second total-flow-through-quantity-minimum switch, and re-determining the second total-flow-through-quantity-maximum switch and the second total-flow-through-quantity-minimum switch; in response to a difference between the second total-flow-through-quantity corresponding to the second total-flow-through-quantity-maximum switch and the second total-flow-through-quantity corresponding to the second total-flow-through-quantity-minimum switch being greater than the preset threshold, re-determining the third quantity and the fourth quantity corresponding to each of the i-layer switches until a difference between the second total-flow-through-quantities corresponding to each of the i+1-layer switches is less than or equal to the preset threshold.

24. The apparatus of claim 15, wherein, The third adjustment module is configured to: in the N-layer switch and the second switch cluster, determining a first-direction flow quantity maximum equivalent edge and a first-direction flow quantity minimum equivalent edge from each equivalent edge between the j-layer switch and the j-1-layer switch according to the first-direction flow quantity of the j-layer switch on each equivalent edge between the j-layer switch and the j-1-layer switch; performing balanced adjustment on the first-direction flow of the j-layer switch on each equivalent edge between the j-layer switch and the j-1-layer switch according to the first-direction flow quantity maximum equivalent edge and the first-direction flow quantity minimum equivalent edge.

25. The apparatus of claim 24, wherein, The third adjustment module is further configured to: in the N-layer switch and the second switch cluster, accumulating the first-direction flow quantity of the j-layer switch through a same switch in the j-1-layer switch to obtain a third total-flow-through-quantity corresponding to each switch in the j-1-layer switch; determining a third total-flow-through-quantity-maximum switch and a third total-flow-through-quantity-minimum switch from each switch in the j-1-layer switch; in response to a difference between the third total-flow-through-quantity corresponding to the third total-flow-through-quantity-maximum switch and the third total-flow-through-quantity corresponding to the third total-flow-through-quantity-minimum switch being greater than a preset threshold, performing balanced adjustment on the third total-flow-through-quantity-minimum switch according to the third total-flow-through-quantity-maximum switch.

26. The apparatus of claim 25, wherein, The third adjustment module is further configured to: determining a fifth quantity of the first-direction flow of each switch in the j-layer switch through the third total-flow-through-quantity-maximum switch and a sixth quantity of the first-direction flow of each switch in the j-layer switch through the third total-flow-through-quantity-minimum switch; in response to the sixth quantity corresponding to any of the j-layer switches being greater than the seventh quantity, scheduling a first-direction flow of any of the j-layer switches from the third total-flow-through-quantity-maximum switch to the third total-flow-through-quantity-minimum switch, and re-determining the third total-flow-through-quantity-maximum switch and the third total-flow-through-quantity-minimum switch. In response to a difference between the third total flow-through quantity corresponding to the third total flow-through quantity largest switch and the third total flow-through quantity corresponding to the third total flow-through quantity smallest switch being greater than the preset threshold value, the fifth quantity and the sixth quantity corresponding to each switch in the jth layer switch are re-determined until a difference between the third total flow-through quantities corresponding to each switch in the j-1th layer switch is less than or equal to the preset threshold value. 27.An electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-13.

28. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, the computer instructions are for causing the computer to perform the method of 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 of any one of claims 1-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