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

By dividing the data flow in the switch according to the time period of the data flow and accumulating the number of streams, the balanced adjustment of the data flow during the overlapping time period in the multi-task data transmission scenario is achieved, and the problems of data transmission efficiency and network throughput are solved.

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

Patent Information

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

AI Technical Summary

Technical Problem

In multi-task data transmission scenarios, how to improve the equalization of data flows during the overlapping time period to ensure data transmission efficiency and network throughput.

Method used

By determining multiple time periods according to the start time and end time of the data flow in the cluster, a plurality of time periods are determined; an equalization adjustment is made to any first end point switch in each time period on the first direction flow on the equivalent edge of the upper-linked switch; accumulating the number of first direction flows in multiple time periods to obtain the total number of flows; further equalization adjustment is made to the first direction flow according to the total number of flows.

Benefits of technology

Load balancing of switches in each time period is realized, data transmission efficiency and network throughput are improved, and data flow equalization is improved during the overlapping time period.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743434A_ABST
    Figure CN119743434A_ABST
Patent Text Reader

Abstract

The invention discloses a switch load balancing method and device, electronic equipment and a storage medium, and relates to the technical field of computers, in particular to the field of artificial intelligence such as big data and cloud computing. According to the specific implementation scheme, a plurality of time periods are determined according to starting time and ending time of data streams in a cluster; wherein the starting time and the ending time of the data streams in each time period are the same; performing balance adjustment on the first direction flow of any first endpoint switch on each equivalent edge of the uplink switch in each time period; accumulating the first direction flow quantity of any first endpoint switch on the same equivalent edge in the plurality of time periods to obtain the total flow quantity on the same equivalent edge; and according to the total flow number corresponding to each equivalent edge, carrying out balance adjustment on the first direction flow of any first endpoint switch on each equivalent edge.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

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

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

[0004] According to one aspect of the present application, a switch load balancing method is provided, comprising:

[0005] Determine multiple time periods according to the start time and end time of the data stream in the cluster; wherein the start time and end time of the data stream in each time period are the same;

[0006] Performing a balancing adjustment on the first direction flow of any first endpoint switch on each equivalent edge with the upstream switch in each of the time periods;

[0007] Accumulate the number of first-direction flows of any first endpoint switch on the same equivalent edge in the multiple time periods to obtain the total number of flows on the same equivalent edge;

[0008] According to the total number of flows corresponding to the equivalent edges, a first direction flow of any first endpoint switch on each equivalent edge is balanced and adjusted.

[0009] According to another aspect of the present application, a switch load balancing device is provided, comprising:

[0010] A determination module, used to determine multiple time periods according to the start time and end time of the data stream in the cluster; wherein the start time and end time of the data stream in each of the time periods are the same;

[0011] An adjustment module, used for balancing and adjusting the first direction flow of any first endpoint switch on each equivalent edge with the upstream switch in each time period;

[0012] An acquisition module, configured to accumulate the number of first-direction flows of any first endpoint switch on the same equivalent edge in the multiple time periods to obtain a total number of flows on the same equivalent edge;

[0013] The adjustment module is further configured to balance the first direction flows of any first endpoint switch on each of the equivalent edges according to the total number of flows corresponding to each of the equivalent edges.

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

[0015] at least one processor; and

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

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

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

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

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

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

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

[0023] Figure 2 A schematic diagram of data flows in different time periods provided in an embodiment of the present application;

[0024] Figure 3 A flow chart of a switch load balancing method provided in another embodiment of the present application

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

[0026] Figure 5 A schematic diagram of data flow in a two-layer fully connected switch in which an IBG is connected to a LEG according to an embodiment of the present application;

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

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

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

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

[0031] In order to meet the transmission requirements of large amounts of data, a two-layer fully connected switch network can be used to forward data to improve data forwarding efficiency and transmission efficiency. Among them, a two-layer fully connected switch network is a switch network with a two-layer architecture and supports full connectivity. That is, each switch in one of the two layers is connected to all switches in the other layer, that is, each switch has an equal-cost path with all switches in the other layer, which can be called an equal-cost edge.

[0032] In a multi-task data transmission scenario, the time periods of different data transmission tasks may be different, and the time periods of different data transmission tasks may overlap. How to improve the balance of data flow in the overlapping time period is an urgent problem to be solved.

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

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

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

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

[0037] Step 101, determining multiple time periods according to the start time and end time of the data flow in the cluster.

[0038] Exemplarily, the start time and end time of a data stream may be determined according to the task to which the data stream belongs. For example, if the time period of a data transmission task is 0 to 300 ms, the start time of the data stream of the data transmission task may be 0 ms and the end time may be 300 ms.

[0039] In a multi-task data transmission scenario, the time periods of different data transmission tasks may be the same or different. Therefore, data streams of one or more data transmission tasks may be transmitted simultaneously in the same time period.

[0040] Exemplarily, multiple time periods may be determined according to the start time and end time of the data transmission task in the cluster, wherein the start time of a time period is the start time of the data flow in the time period, and the end time of the time period is also the end time of the data flow in the time period.

[0041] for example, Figure 2 In the example, four time periods can be determined according to the start time and end time of the data transmission task, namely 0~700ms, 300ms~700ms, 500ms~700ms, and 300ms~1.2s.

[0042] Step 102: Balance and adjust the first direction flow of any first endpoint switch on each equivalent edge with the upstream switch in each time period.

[0043] The first endpoint switch may be a source switch or a target switch.

[0044] In the present application, the source device in the cluster can send the transmission data to the destination device through the two-layer switch. Exemplarily, the data flow can be transmitted from the source device to the destination device through the source switch, the uplink switch, and the destination switch in sequence.

[0045] The source switch may be the switch that the data flow first passes through after being sent from the source device, and the destination switch may be the last switch that the data flow passes through before being transmitted from the source device to the destination device.

[0046] As a possible implementation manner, the first endpoint switch of the data flow may be determined according to the transmission path of the data flow in the cluster.

[0047] As another possible implementation manner, the first endpoint switch may be determined based on a destination device of the data flow and a connection relationship between the device and the switch.

[0048] Exemplarily, the first endpoint switch is a source switch, which can parse the data flow to determine the source device of the data flow, and determine the switch to which the source device is connected based on the connection relationship between the device and the switch, and then determine the switch to which the source device is connected as the first endpoint switch.

[0049] Exemplarily, the first endpoint switch is the destination switch, which can parse the data flow to determine the destination device of the data flow, and determine the switch connected to the destination device based on the connection relationship between the device and the switch, and then determine the switch connected to the destination device as the first endpoint switch.

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

[0051] For example, if the first endpoint switch is the source switch and the first directional flow is the outbound flow, then the outbound flow of the source switch refers to the data flow flowing out of the source switch. For another example, if the first endpoint switch is the destination switch and the first directional flow is the inbound flow, then the inbound flow of the destination switch refers to the data flow flowing into the destination switch.

[0052] In the present application, the data flow in each time period can be adjusted separately. For each time period, the number of first-direction flows of any first endpoint switch on each equivalent edge with the upstream switch in the time period can be determined, and according to the number of first-direction flows on each equivalent edge, the first-direction flows of any first endpoint switch on each equivalent edge can be balanced and adjusted to make the first-direction flows on each equivalent edge uniform. Here, uniformity can mean that the difference in the number of data flows between the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows is 0 or 1.

[0053] Take the first endpoint switch as the source switch and the first direction flow as the outgoing flow as an example. The source switches of the outgoing data flow within a certain time period of 0-100ms are the source switch A1, the source switch A2, and the source switch A3, and there are 4 upstream switches. Then, the outgoing flow of the source switch A1 on the equivalent edges with the 4 upstream switches within 0-100ms is balanced and adjusted, the outgoing flow of the source switch A2 on the equivalent edges with the 4 upstream switches within 0-100ms is balanced and adjusted, and the outgoing flow of the source switch A3 on the equivalent edges with the 4 upstream switches within 0-100ms is balanced and adjusted. Among them, the outgoing flow of the source switch A1 refers to the data flow flowing out from the source switch A1.

[0054] for example, Figure 2In the example, the outgoing flows of the source switch on each equivalent edge can be balanced in the four time periods of 0-700ms, 300ms-900ms, 500ms-700ms, and 300ms-1.2s.

[0055] It should be noted that the first endpoint switches in different time periods may be the same or different, and this is not limited.

[0056] Step 103: Accumulate the number of first-direction flows of any first endpoint switch on the same equivalent edge in multiple time periods to obtain the total number of flows on the same equivalent edge.

[0057] In the present application, for any first endpoint switch, the number of first-direction flows of the first endpoint switch on the same equivalent edge in multiple time periods can be used to obtain the total number of flows on the same equivalent edge.

[0058] It is understandable that, since the first endpoint switch in different time periods may be the same or different, there may be a first endpoint switch without data flow in one or more time periods. In this case, the number of first unidirectional flows of the first endpoint switch on each equivalent edge with the upstream switch in these time periods is 0.

[0059] Taking the first endpoint switch as the source switch and the first direction flow as the outbound flow as an example, assuming that there are three time periods, 0-100ms, 50-100ms, and 100ms-200ms, the number of outbound flows of the source switch A1 on the four equivalent edges s1, s2, s3, and s4 with the upstream switch within 0-100ms are 4, 4, 3, and 3 respectively. The number of outbound flows of the source switch A1 on the four equivalent edges s1, s2, s3, and s4 with the upstream switch within 50-100ms is 5, 4, 4, and 4 respectively. The source switch A1 has no outbound flow within 100ms-200ms, so the number of outbound flows on each equivalent edge is 0. Then, the number of outbound flows on the same equivalent edge in the three time periods is added up, and the total number of flows on the four equivalent edges s1, s2, s3, and s4 is 9, 8, 7, and 7 respectively. The outbound flow of the source switch A1 refers to the data flow flowing out from the source switch A1.

[0060] Step 104: adjust the first direction flow of any first endpoint switch on each equivalent edge according to the total number of flows corresponding to each equivalent edge.

[0061] In the present application, whether the first-direction flows on each equivalent edge are balanced can be determined based on the total number of flows corresponding to each equivalent edge. If unbalanced, the first-direction flows on each equivalent edge can be adjusted based on the total number of flows corresponding to each equivalent edge, so that the first-direction flows of the first endpoint switch on each equivalent edge are as balanced as possible.

[0062] Exemplarily, if the difference between the maximum value and the minimum value in the total number of flows corresponding to each equivalent edge is equal to 0 or 1, it can be determined that the first-direction flows on each equivalent edge are balanced.

[0063] In the embodiment of the present application, multiple time periods are determined according to the start time and end time of the data flow, and the outgoing flow of any first endpoint switch on each equivalent edge with the upstream switch in each time period is balanced and adjusted, and the number of first direction flows of the first endpoint switch on the same equivalent edge in multiple time periods is accumulated to obtain the total number of flows on the same equivalent edge, and then the first direction flows of the first endpoint switch on each equivalent edge are balanced and adjusted according to the total number of flows corresponding to each equivalent edge. Thus, the first direction flow of each first endpoint switch in each time period is balanced and adjusted separately, and then the number of first direction flows on the same equivalent edge in each time period is accumulated for each first endpoint switch, and the first direction flow of the first endpoint switch on each equivalent edge is balanced and adjusted based on the accumulated total number of flows, so that not only the balance of the first direction flows of the first endpoint switch on each equivalent edge in each time period can be ensured, but also the balance of the first direction flows in the time period where the time periods overlap can be improved.

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

[0065] like Figure 3 As shown, the switch load balancing method includes:

[0066] Step 301, determining multiple time periods according to the start time and end time of the data flow in the cluster.

[0067] Step 302: Balance and adjust the first direction flow of any first endpoint switch on each equivalent edge with the upstream switch in each time period.

[0068] Step 303: Accumulate the number of first-direction flows on the same equivalent edge of any first endpoint switch in multiple time periods to obtain the total number of flows on the same equivalent edge.

[0069] In the present application, steps 301 to 303 may be implemented in any of the embodiments of the present application, and therefore will not be described in detail here.

[0070] Step 304, determining the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number among the equivalent edges.

[0071] In the present application, the total flow numbers on each equivalent edge can be compared, and the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number can be determined from the equivalent edges.

[0072] Step 305, in response to the difference in the number of first-direction flows between the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows being greater than a preset threshold, the first-direction flows of any first endpoint switch on each equivalent edge are adjusted according to the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows.

[0073] In the present application, if the difference in the number of first-direction flows between the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows is greater than a preset threshold, it can be considered that the total number of flows on each equivalent edge is uneven, and the first-direction flow of the first endpoint switch on each equivalent edge can be adjusted based on the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows.

[0074] For example, the preset threshold may be 1 or other values ​​greater than 1, and there is no limitation on this.

[0075] As a possible implementation method, it can be determined whether each time period supports balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows. If multiple time periods support it, balancing adjustment is performed on the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows, and the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows are re-determined, and it is continued to be determined whether each time period supports balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows.

[0076] If any time period does not support it, determine whether each time period supports the equivalent edge according to the second largest number of total flows, and balance the equivalent edge with the smallest number of total flows, until it is determined that there is a time period in multiple time periods that does not support the equivalent edge according to the second smallest number of total flows, and balance the equivalent edge with the smallest number of total flows, continue to determine whether each time period supports the equivalent edge according to the largest number of total flows, and balance the equivalent edge with the second smallest number of total flows. If any time period does not support it, continue to determine whether each time period supports the equivalent edge according to the second largest number of total flows, and balance the equivalent edge with the second smallest number of total flows, until it is determined that any time period does not support the equivalent edge according to the largest number of total flows, and balance the equivalent edge with the second largest number of total flows.

[0077] Among them, the equivalent edge with the second largest total flow number may refer to the equivalent edge ranked second in the sorting result from large to small according to the total flow number on each equivalent edge, and the equivalent edge with the second smallest total flow number may be the equivalent edge ranked second to last in the sorting result.

[0078] For example, the number of equivalent edges is M, where M is an integer greater than 1. Then the equivalent edge with the second smallest total flow number may be the equivalent edge at the M-1th position in the sorting result, that is, the equivalent edge at the second to last position in the sorting result.

[0079] For example, assuming that the number of equivalent edges is M, where M is an integer greater than 1, the total number of flows on each equivalent edge can be sorted from large to small, and it can be determined first whether each time period supports balancing adjustment of the equivalent edge with the largest total flow number for the equivalent edge with the smallest total flow number. If any time period does not support it, continue to determine whether each time period supports balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge located in the second position in the sorting result, until it is determined that any time period does not support balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge located in the M-1th position in the sorting result.

[0080] Continue to determine whether each time period supports balancing adjustment of the equivalent edge at the M-1th position in the sorting result according to the equivalent edge with the largest total flow number. If any time period does not support it, continue to determine whether each time period supports balancing adjustment of the equivalent edge at the M-1th position in the sorting result according to the equivalent edge at the second position in the sorting result, until it is determined that any time period does not support balancing adjustment of the equivalent edge at the M-2th position in the sorting result, and continue to determine whether each time period supports balancing adjustment of the equivalent edge at the M-2th position in the sorting result according to the equivalent edge with the largest total flow number, until it is determined that any time period does not support balancing adjustment of the equivalent edge at the second position in the sorting result according to the equivalent edge with the largest total flow number.

[0081] For determining whether each time period supports balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows, illustratively, the first number and the second number of first-direction flows of the first endpoint switch on the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows, respectively, can be determined in each time period, and based on the first number and the second number, it is determined whether each time period supports balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows.

[0082] Therefore, based on the first number and the second number, it is determined whether each time period supports balancing the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number. The method is simple and can improve the determination efficiency.

[0083] Exemplarily, if the first number is greater than the second number, it means that the equivalent edge with the largest number of first-direction flows among the equivalent edges between the first endpoint switch and the upstream switch in the time period is the same as the equivalent edge with the largest number of total flows, and the equivalent edge with the smallest number of first-direction flows is the same as the equivalent edge with the smallest number of total flows. Since the number of first-direction flows on the equivalent edge with the largest number of first-direction flows is larger than the number of first-direction flows on the equivalent edge with the smallest number of first-direction flows in the time period, if the outgoing flow of the first endpoint switch on the equivalent edge with the largest number of total flows in the time period is adjusted to the equivalent edge with the smallest number of total flows, it will not affect the balance of the equivalent edges of the first endpoint switch in the time period. Therefore, it can be determined that the time period supports balancing adjustment of the equivalent edge with the smallest number of total flows based on the equivalent edge with the largest number of total flows.

[0084] If the first number is equal to the second number, it means that the number of first-direction flows on the equivalent edge with the largest total number of flows of the first endpoint switch in the time period is the same as the number of first-direction flows on the equivalent edge with the smallest total number of flows, which also means that the number of the first endpoint switch on each equivalent edge is the same in the time period. Then, scheduling the outgoing flow on the equivalent edge with the largest total number of flows of the first endpoint switch in the time period to the equivalent edge with the smallest total number of flows will affect the balance of each equivalent edge of the first endpoint switch in the time period. Therefore, it can be determined that the time period does not support adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows.

[0085] Exemplarily, if the data flow of the first endpoint switch on each equivalent edge is balanced within a time period, it can be explained that the difference between the number of first-direction flows of the first endpoint switch on each equivalent edge within the time period is 0 or 1. If the first number is greater than the second number, the difference between the first number and the second number is 1.

[0086] Therefore, by judging whether each time period supports balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows without affecting the balance of the first endpoint switch on each equivalent edge in the time period, based on the relationship between the number of first-direction flows on the equivalent edge with the largest total number of flows and the number of first-direction flows on the equivalent edge with the smallest total number of flows in each time period, so as to achieve balancing adjustment without affecting the balance of the first endpoint switch on each equivalent edge in each time period.

[0087] For determining whether each time period supports balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the second largest total number of flows, illustratively, the third number of first-direction flows of the first endpoint switch on the equivalent edge with the second largest total number of flows in each time period can be determined, and based on the third number and the second number, it can be determined whether each time period supports balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the second largest total number of flows.

[0088] Exemplarily, if the third number is greater than the second number, it means that the number of first-direction flows on the equivalent edge with the second largest number of total flows of the first endpoint switch in the time period is greater than the number of first-direction flows on the equivalent edge with the smallest number of total flows. If the first-direction flows on the equivalent edge with the second largest number of total flows of the first endpoint switch in the time period are adjusted to the equivalent edge with the smallest number of total flows, it will not affect the balance of the equivalent edges of the first endpoint switch in the time period. Therefore, it can be determined that the time period supports balancing adjustment of the equivalent edge with the smallest number of total flows based on the equivalent edge with the second largest number of total flows.

[0089] If the third number is equal to the second number, it means that the number of first-direction flows on the equivalent edge with the second largest number of total flows of the first endpoint switch in the time period is the same as the number of first-direction flows on the equivalent edge with the smallest number of total flows. Then, scheduling the outgoing flow on the equivalent edge with the second largest number of total flows of the first endpoint switch in the time period to the equivalent edge with the smallest number of total flows will affect the balance of the equivalent edges of the first endpoint switch in the time period. Therefore, it can be determined that the time period does not support adjustment of the equivalent edge with the smallest number of total flows based on the equivalent edge with the second largest number of total flows.

[0090] Therefore, based on the third number and the second number, it is determined whether each time period supports balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the second largest total flow number. The method is simple and can improve the determination efficiency.

[0091] It can be understood that the method of judging whether each time period supports balancing the equivalent edge with the largest total flow number and adjusting the equivalent edge with the second smallest total flow number is similar to the above method and will not be repeated here.

[0092] Exemplarily, if all time periods support balancing adjustment of the equivalent edge with the smallest total number of flows based on the equivalent edge with the largest total number of flows, a first direction flow of the first endpoint switch in any time period can be scheduled from the equivalent edge with the largest total number of flows to the equivalent edge with the smallest total number of flows for transmission.

[0093] Therefore, when all time periods are supported, a first-direction flow is scheduled from the equivalent edge with the largest total flow number to the equivalent edge with the smallest total flow number, thereby improving the balance of the total number of flows on each equivalent edge without affecting the balance of the first-direction flows of the first endpoint switch on each equivalent edge in each time period.

[0094] It can be understood that if all time periods support balancing adjustment of the equivalent edge with the smallest total number of flows based on the equivalent edge with the second largest total number of flows, a first-direction flow of the first endpoint switch in any time period can be scheduled from the equivalent edge with the second largest total number of flows to the equivalent edge with the smallest total number of flows for transmission.

[0095] Therefore, if all time periods support adjustment and then balance adjustment is performed, it is possible to improve the overall load balance while reducing the impact on the balance in each time period.

[0096] Moreover, after each balancing adjustment, the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number are re-determined and the judgment is continued. If any time period does not support balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number, then it is judged whether each time period supports the equivalent edge with the second largest total flow number, and the equivalent edge with the smallest total flow number is balanced adjusted until the equivalent edge with the second largest total flow number can no longer be balanced adjusted according to the equivalent edge with the largest total flow number. This not only ensures the balance of the first-direction flow in each time period, but also makes the first-direction flow in the time periods overlapping with each other as balanced as possible.

[0097] For example, we can Figure 2 After the source switch performs balanced adjustment on the outgoing flows on each equal-cost edge in the four time periods of 0-700ms, 300ms-900ms, 500ms-700ms, and 300ms-1.2s, the total number of flows on each equal-cost edge is balanced by using the above method. Figure 2 In the example, there are 4 data streams from 0 to 300ms, 12 data streams from 300ms to 500ms, 14 data streams from 500ms to 700ms, 8 data streams from 700ms to 900ms, and 5 data streams from 900ms to 1200ms. It can be seen that in the time period of 0 to 1.2s, the number of data streams at the time points of 300ms, 500ms, 700ms, and 900ms has changed. The above method can not only ensure the It ensures that the outgoing flow of the source switch on each equivalent edge is balanced within the four time periods of 0-700ms, 300ms-900ms, 500ms-700ms, and 300ms-1.2s, and can also ensure that the outgoing flow of the source switch on each equivalent edge is as balanced as possible within the overlapping time periods of 300ms-500ms, 500ms-700ms, 700ms-900ms and the non-overlapping time periods of 0-300ms and 900ms-1.2s.

[0098] In an embodiment of the present application, by determining the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows among each equivalent edge, and when it is determined that the total number of flows on each equivalent edge is unbalanced based on the difference in the number of first-direction flows between the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows, the first-direction flows of the first endpoint switch on each equivalent edge are adjusted, thereby improving the balance of the total number of flows on each equivalent edge, so that the first-direction flows in the time periods where the time periods overlap are as balanced as possible.

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

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

[0101] Step 401, determining multiple time periods according to the start time and end time of the data flow in the cluster.

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

[0103] Step 402: determine the second endpoint switch of the data flow in each time period.

[0104] The second endpoint switch corresponds to the first endpoint switch.

[0105] For example, if the first endpoint switch is the source switch, the second endpoint switch is the destination switch; if the first endpoint switch is the destination switch, the second endpoint switch is the source switch.

[0106] As a possible implementation manner, the second endpoint switch of the data flow may be determined according to the transmission path of the data flow in the cluster.

[0107] As another possible implementation manner, the second endpoint switch may be determined based on the destination device of the data flow and the connection relationship between the device and the switch.

[0108] Exemplarily, the second endpoint switch is the destination switch, which can parse the data flow to determine the destination device of the data flow, and determine the switch connected to the destination device based on the connection relationship between the device and the switch, and then determine the switch connected to the destination device as the second endpoint switch.

[0109] Exemplarily, the second endpoint switch is a source switch, which can parse the data flow to determine the source device of the data flow, and determine the switch to which the source device is connected based on the connection relationship between the device and the switch, and then determine the switch to which the source device is connected as the second endpoint switch.

[0110] Step 403: group the data flow in each time period according to the second endpoint switch to obtain at least one group.

[0111] In the present application, the data flow in each time period is grouped. Exemplarily, the data flow in each time period can be grouped according to the second endpoint switch to obtain at least one group.

[0112] Exemplarily, the second endpoint switch is the destination switch, and the same data flow of the destination switch within a time period can be regarded as a group to obtain at least one group. It can be seen that the data flow in each group flows to the same destination switch.

[0113] The following is an example of a two-layer fully connected switch network with an IBG (Internal Backbone Gateway) connected to a LEG (Local Edge Gateway). Figure 5 Provide explanation. Figure 5 In the figure, IBG1, IBG2, ..., IBG8 have four equivalent edges with LEG1, LEG2, LEG3, LEG4. Since the destination IBG of one outbound flow of IBG4, one outbound flow of IBG7, and one outbound flow of IBG8 are all IBG1 at a certain time, these three data flows belong to one group, and the source IBGs of the data flows in the group are IBG4, IBG7, and IBG8. Among them, the outbound flow of IBG4 refers to the data flow flowing out from IBG4, the outbound flow of IBG7 refers to the data flow flowing out from IBG7, and the outbound flow of IBG8 refers to the data flow flowing out from IBG8.

[0114] Exemplarily, the second endpoint switch is a source switch, and the same data flow of the source switch within a time period can be regarded as a group to obtain at least one group. It can be seen that the data flow in each group flows out from the same source switch.

[0115] Step 404: for any group in the at least one group, balance and adjust the first direction flow of the first endpoint switch in any group on each equivalent edge with the upstream switch.

[0116] In the present application, for any first endpoint switch in any group, the fourth number of first-direction flows of the first endpoint switch on each equivalent edge between the first endpoint switch and the upstream switch can be determined, and the first-direction flows of the first endpoint switch on the equivalent edge with a larger fourth number can be scheduled to the equivalent edge with a smaller fourth number. In this way, the number of first-direction flows of each first endpoint switch on each equivalent edge in the group can be uniform.

[0117] Exemplarily, the fourth quantity of the first-direction flow of the first endpoint switch on each equivalent edge can be compared to determine the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows of any first endpoint switch, and then the first equivalent edge is determined from the equivalent edge with the largest number of first-direction flows, and the second equivalent edge is determined from the equivalent edge with the smallest number of first-direction flows, and the second quantity of first-direction flows on the first equivalent edge is scheduled to be transmitted on the second equivalent edge, and then 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 until the data flow balancing condition is met.

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

[0119] Taking the grouping of data streams according to the destination switch as an example, Figure 5 In the figure, IBG2 is the source switch in a group within a time period. Assume that the number of outbound flows on the equivalent edges between IBG2 and LEG1, LEG2, LEG3, and LEG4 are 8, 8, 5, and 5 respectively, the equivalent edge between IBG2 and LEG2 is the first equivalent edge, and the equivalent edge between IBG2 and LEG4 is the second equivalent edge. Then, an outbound flow of IBG2 on the first equivalent edge can be scheduled to be transmitted on the second equivalent edge.

[0120] The outbound flow of IBG2 refers to the data flow flowing out of IBG2.

[0121] Exemplarily, if there are multiple groups, the first-direction flows of the first endpoint switches in the multiple groups on each equivalent edge can be balanced and adjusted in turn. In order to ensure that the balance of the first-direction flows of the first endpoint switches in the adjusted groups on each equivalent edge is not affected, for any first endpoint switch in any group currently being balanced, the fifth number of first-direction flows of any first endpoint switch in the target group on each equivalent edge can be determined, and the fourth number and the fifth number of first-direction flows on the same equivalent edge can be added to obtain the sixth number of first-direction flows on the same equivalent edge, and then the sixth number of first-direction flows on each equivalent edge can be compared, and the equivalent edge with the largest number of first-direction flows and the equivalent edge with the smallest number of first-direction flows can be determined from each equivalent edge.

[0122] The target group may refer to a balanced and adjusted group in at least one group obtained by grouping the data stream according to the second endpoint switch.

[0123] It can be understood that the fifth number of first-direction flows of any second endpoint switch in the target group on each equivalent edge with the upstream switch is uniform.

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

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

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

[0127] When balancing and adjusting the first direction flow of a first endpoint switch, when the first endpoint switch flows through a certain upstream switch, there may be data flows from other first endpoint switches that also flow through the upstream switch, taking into account the load balancing of the upstream switch. Exemplarily, if there are multiple equivalent edges with the largest number of first direction flows, the number of data flows flowing through the upstream switch corresponding to each equivalent edge with the largest number of first direction flows is determined, and the equivalent edge corresponding to the upstream switch with the largest number of data flows flowing through can be determined as the first equivalent edge.

[0128] Therefore, if there are multiple equivalent edges with the largest number of flows in the first direction, the equivalent edge with the largest number of data flows flowing through the upstream switch corresponding to these equivalent edges can be used as the first equivalent edge, so as to perform load balancing based on the data flow on the first equivalent edge, which can improve the load balancing effect of the upstream switch.

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

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

[0131] Taking into account the load balancing of the upstream switch, exemplarily, if there are multiple equivalent edges with the smallest number of flows in the first direction, the number of data flows passing through each upstream switch corresponding to the equivalent edge with the smallest number of flows in the first direction is determined, and the equivalent edge corresponding to the upstream switch with the smallest number of data flows can be determined as the second equivalent edge.

[0132] Optionally, after balancing and adjusting the first direction flows of each first point switch of any group on each equivalent edge, when the second direction flows of the second endpoint switch corresponding to the group on each equivalent edge with the upstream switch are unbalanced and can be adjusted, balancing and adjusting the second direction flows of the second endpoint switch on each equivalent edge is performed, thereby improving the balance of the second direction flows of the second endpoint switch on each equivalent edge.

[0133] The second direction flow may refer to a data flow in a second direction, which is opposite to the first direction. Exemplarily, if the first direction is outgoing, then the second direction is incoming, that is, the first direction flow is an outgoing flow, and the second direction flow is an incoming flow; if the first direction is incoming, then the second direction is outgoing, that is, the first direction flow is an incoming flow, and the second direction flow is an outgoing flow.

[0134] For example, the second endpoint switch is the destination switch, the second direction is the inbound flow, and the inbound flow of the destination switch may refer to the data flow flowing into the destination switch.

[0135] Step 405: Accumulate the number of first-direction flows on the same equivalent edge of any first endpoint switch in multiple time periods to obtain the total number of flows on the same equivalent edge.

[0136] Step 406: Balance and adjust the first direction flows of any first endpoint switch on each equivalent edge according to the total number of flows corresponding to each equivalent edge.

[0137] In the present application, steps 405 and 406 may be implemented in any of the embodiments of the present application, and therefore will not be described in detail here.

[0138] In the embodiment of the present application, for the data flow in each time period, the data flow is grouped according to the second endpoint switch, and then the first direction flow of each first endpoint switch in the group on each equivalent edge with the upstream switch is balanced, so that the first direction flow of each first endpoint switch on each equivalent edge in each time period can be balanced, which can not only improve the load balancing efficiency, but also improve the data transmission efficiency.

[0139] In order to implement the above embodiment, the embodiment of the present application also proposes a switch load balancing device. Figure 6 A schematic diagram of the structure of a switch load balancing device provided in one embodiment of the present application.

[0140] like Figure 6 As shown, the switch load balancing device 600 includes:

[0141] A determination module 610, configured to determine a plurality of time periods according to a start time and an end time of a data stream in a cluster; wherein the start time and the end time of the data stream in each of the time periods are the same;

[0142] An adjustment module 620, configured to balance the first direction flow of any first endpoint switch on each equivalent edge with the upstream switch in each time period;

[0143] An acquisition module 630 is configured to accumulate the number of first-direction flows of any first endpoint switch on the same equivalent edge in the multiple time periods to obtain a total number of flows on the same equivalent edge;

[0144] The adjustment module 620 is further configured to balance the first direction flows of any first endpoint switch on each equivalent edge according to the total number of flows corresponding to each equivalent edge.

[0145] Optionally, the adjustment module 620 is used to:

[0146] Determine the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number among the equivalent edges;

[0147] In response to the difference in the number of first-direction flows between the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows being greater than a preset threshold, the first-direction flows of any first endpoint switch on each equivalent edge are adjusted according to the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows.

[0148] Optionally, the adjustment module 620 is used to:

[0149] Determine whether each of the time periods supports balancing the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number;

[0150] In response to the multiple time periods all supporting, according to the equivalent edge with the largest total flow number, the equivalent edge with the smallest total flow number is balanced adjusted, and the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number are re-determined, and each of the time periods is further judged whether it supports the balanced adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number;

[0151] In response to any time period not being supported, determining whether each of the time periods supports balancing the equivalent edge with the second largest number of total flows, and adjusting the equivalent edge with the smallest number of total flows in a balanced manner, until it is determined that there is a time period in the multiple time periods that does not support balancing the equivalent edge with the second smallest number of total flows, and adjusting the equivalent edge with the smallest number of total flows in a balanced manner;

[0152] Continue to determine whether each time period supports balancing the equivalent edge with the largest total flow number and adjusting the equivalent edge with the second smallest total flow number;

[0153] In response to any time period not being supported, continue to determine whether each time period supports balancing adjustments to the equivalent edges with the second largest number of total flows according to the equivalent edges with the second largest number of total flows, until it is determined that balancing adjustments to the equivalent edges with the second largest number of total flows cannot be performed according to the equivalent edges with the largest number of total flows.

[0154] Optionally, the adjustment module 620 is used to:

[0155] Determine a first quantity and a second quantity of first-direction flows on an equivalent edge with the largest total number of flows and an equivalent edge with the smallest total number of flows for any first endpoint switch in each of the time periods;

[0156] According to the first number and the second number, it is determined whether each of the time periods supports balancing adjustment of the equivalent edges with the smallest total number of flows according to the equivalent edges with the largest total number of flows.

[0157] Optionally, the adjustment module 620 is used to:

[0158] In response to the first number being greater than the second number, determining to support balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number;

[0159] In response to the first number being equal to the second number, it is determined that balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows is not supported.

[0160] Optionally, the adjustment module 620 is used to:

[0161] Determine a third number of first-direction flows on an equivalent edge with the second largest total flow number of any first endpoint switch in each of the time periods;

[0162] According to the third number and the second number, it is determined whether each of the time periods supports balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the second largest total flow number.

[0163] Optionally, the adjustment module 620 is used to:

[0164] A first direction flow of any first endpoint switch in any time period is scheduled from an equivalent edge with the largest total flow number to an equivalent edge with the smallest total flow number for transmission.

[0165] Optionally, the adjustment module 620 is used to:

[0166] Determine a second endpoint switch of the data flow within each of the time periods;

[0167] Grouping the data flow in each of the time periods according to the second endpoint switch to obtain at least one group; wherein the data flow in each group flows to the same second endpoint switch;

[0168] For any group in the at least one group, a first direction flow of a first endpoint switch in the any group on each equivalent edge with the upstream switch is balanced and adjusted.

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

[0170] In the embodiment of the present application, multiple time periods are determined according to the start time and end time of the data flow, and the outgoing flow of any first endpoint switch on each equivalent edge with the upstream switch in each time period is balanced and adjusted, and the number of first direction flows of the first endpoint switch on the same equivalent edge in multiple time periods is accumulated to obtain the total number of flows on the same equivalent edge, and then the first direction flows of the first endpoint switch on each equivalent edge are balanced and adjusted according to the total number of flows corresponding to each equivalent edge. Thus, the first direction flow of each first endpoint switch in each time period is balanced and adjusted separately, and then the number of first direction flows on the same equivalent edge in each time period is accumulated for each first endpoint switch, and the first direction flow of the first endpoint switch on each equivalent edge is balanced and adjusted based on the accumulated total number of flows, so that not only the balance of the first direction flows of the first endpoint switch on each equivalent edge in each time period can be ensured, but also the balance of the first direction flows in the time period where the time periods overlap can be improved.

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

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

[0173] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 702 or a computer program loaded from a storage unit 708 to a RAM (Random Access Memory) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An I / O (Input / Output) interface 705 is also connected to the bus 704.

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

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

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

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

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

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

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

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

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

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

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

Claims

1. A switch load balancing method, comprising: Determine multiple time periods according to the start time and end time of the data stream in the cluster; wherein the start time and end time of the data stream in each time period are the same; Performing a balancing adjustment on the first direction flow of any first endpoint switch on each equivalent edge with the upstream switch in each of the time periods; Accumulate the number of first-direction flows of any first endpoint switch on the same equivalent edge in the multiple time periods to obtain the total number of flows on the same equivalent edge; According to the total number of flows corresponding to the equivalent edges, a first direction flow of any first endpoint switch on each equivalent edge is balanced and adjusted.

2. The method of claim 1, wherein: The adjusting the first direction flow of any first endpoint switch on each equivalent edge according to the total number of flows corresponding to each equivalent edge includes: Determine the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number among the equivalent edges; In response to the difference in the number of first-direction flows between the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows being greater than a preset threshold, the first-direction flows of any first endpoint switch on each equivalent edge are adjusted according to the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows.

3. The method of claim 2, wherein: The adjusting the first direction flow of any first endpoint switch on each equivalent edge according to the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number includes: Determine whether each of the time periods supports balancing the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number; In response to the multiple time periods all supporting, according to the equivalent edge with the largest total flow number, the equivalent edge with the smallest total flow number is balanced adjusted, and the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number are re-determined, and each of the time periods is further judged whether it supports the balanced adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number; In response to any time period not being supported, determining whether each of the time periods supports balancing the equivalent edge with the second largest number of total flows, and adjusting the equivalent edge with the smallest number of total flows in a balanced manner, until it is determined that there is a time period in the multiple time periods that does not support balancing the equivalent edge with the second smallest number of total flows, and adjusting the equivalent edge with the smallest number of total flows in a balanced manner; Continue to determine whether each time period supports balancing the equivalent edge with the largest total flow number and adjusting the equivalent edge with the second smallest total flow number; In response to any time period not being supported, continue to determine whether each time period supports balancing adjustments to the equivalent edges with the second largest number of total flows according to the equivalent edges with the second largest number of total flows, until it is determined that balancing adjustments to the equivalent edges with the second largest number of total flows cannot be performed according to the equivalent edges with the largest number of total flows.

4. The method of claim 3, wherein: The determining whether each of the time periods supports balancing the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number includes: Determine a first quantity and a second quantity of first-direction flows on an equivalent edge with the largest total number of flows and an equivalent edge with the smallest total number of flows for any first endpoint switch in each of the time periods; According to the first number and the second number, it is determined whether each of the time periods supports balancing adjustment of the equivalent edges with the smallest total number of flows according to the equivalent edges with the largest total number of flows.

5. The method of claim 4, wherein: The determining, based on the first number and the second number, whether each of the time periods supports balancing the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows includes: In response to the first number being greater than the second number, determining to support balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number; In response to the first number being equal to the second number, it is determined that balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows is not supported.

6. The method of claim 3, wherein: The determining whether each time period supports balancing the equivalent edge with the smallest total flow number according to the equivalent edge with the second largest total flow number includes: Determine a third number of first-direction flows on an equivalent edge with the second largest total flow number of any first endpoint switch in each of the time periods; According to the third number and the second number, it is determined whether each of the time periods supports balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the second largest total flow number.

7. The method of claim 3, wherein: The step of balancing and adjusting the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number includes: A first direction flow of any first endpoint switch in any time period is scheduled from an equivalent edge with the largest total flow number to an equivalent edge with the smallest total flow number for transmission.

8. The method according to any one of claims 1 to 7, wherein: The balancing adjustment of the first direction flow of any first endpoint switch on each equivalent edge with the upstream switch in each time period includes: Determine a second endpoint switch of the data flow within each of the time periods; Grouping the data flow in each of the time periods according to the second endpoint switch to obtain at least one group; wherein the data flow in each group flows to the same second endpoint switch; For any group in the at least one group, a first direction flow of a first endpoint switch in the any group on each equivalent edge with the upstream switch is balanced and adjusted.

9. A switch load balancing device, comprising: A determination module, used to determine multiple time periods according to the start time and end time of the data stream in the cluster; wherein the start time and end time of the data stream in each of the time periods are the same; An adjustment module, used for balancing and adjusting the first direction flow of any first endpoint switch on each equivalent edge with the upstream switch in each time period; An acquisition module, configured to accumulate the number of first-direction flows of any first endpoint switch on the same equivalent edge in the multiple time periods to obtain a total number of flows on the same equivalent edge; The adjustment module is further configured to balance the first direction flows of any first endpoint switch on each of the equivalent edges according to the total number of flows corresponding to each of the equivalent edges.

10. The device of claim 9, wherein: The adjustment module is used for: Determine the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number among the equivalent edges; In response to the difference in the number of first-direction flows between the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows being greater than a preset threshold, the first-direction flows of any first endpoint switch on each equivalent edge are adjusted according to the equivalent edge with the largest total number of flows and the equivalent edge with the smallest total number of flows.

11. The device of claim 10, wherein: The adjustment module is used for: Determine whether each of the time periods supports balancing the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number; In response to the multiple time periods all supporting, according to the equivalent edge with the largest total flow number, the equivalent edge with the smallest total flow number is balanced adjusted, and the equivalent edge with the largest total flow number and the equivalent edge with the smallest total flow number are re-determined, and each of the time periods is further judged whether it supports the balanced adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number; In response to any time period not being supported, determining whether each of the time periods supports balancing the equivalent edge with the second largest number of total flows, and adjusting the equivalent edge with the smallest number of total flows in a balanced manner, until it is determined that there is a time period in the multiple time periods that does not support balancing the equivalent edge with the second smallest number of total flows, and adjusting the equivalent edge with the smallest number of total flows in a balanced manner; Continue to determine whether each time period supports balancing the equivalent edge with the largest total flow number and adjusting the equivalent edge with the second smallest total flow number; In response to any time period not being supported, continue to determine whether each time period supports balancing adjustments to the equivalent edges with the second largest number of total flows according to the equivalent edges with the second largest number of total flows, until it is determined that balancing adjustments to the equivalent edges with the second largest number of total flows cannot be performed according to the equivalent edges with the largest number of total flows.

12. The device of claim 11, wherein: The adjustment module is used for: Determine a first quantity and a second quantity of first-direction flows on an equivalent edge with the largest total number of flows and an equivalent edge with the smallest total number of flows for any first endpoint switch in each of the time periods; According to the first number and the second number, it is determined whether each of the time periods supports balancing adjustment of the equivalent edges with the smallest total number of flows according to the equivalent edges with the largest total number of flows.

13. The device of claim 12, wherein: The adjustment module is used for: In response to the first number being greater than the second number, determining to support balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the largest total flow number; In response to the first number being equal to the second number, it is determined that balancing adjustment of the equivalent edge with the smallest total number of flows according to the equivalent edge with the largest total number of flows is not supported.

14. The device of claim 11, wherein: The adjustment module is used for: Determine a third number of first-direction flows on an equivalent edge with the second largest total flow number of any first endpoint switch in each of the time periods; According to the third number and the second number, it is determined whether each of the time periods supports balancing adjustment of the equivalent edge with the smallest total flow number according to the equivalent edge with the second largest total flow number.

15. The device of claim 11, wherein: The adjustment module is used for: A first direction flow of any first endpoint switch in any time period is scheduled from an equivalent edge with the largest total flow number to an equivalent edge with the smallest total flow number for transmission.

16. The method according to any one of claims 9 to 15, wherein: The adjustment module is used for: Determine a second endpoint switch of the data flow within each of the time periods; Grouping the data flow in each of the time periods according to the second endpoint switch to obtain at least one group; wherein the data flow in each group flows to the same second endpoint switch; For any group in the at least one group, a first direction flow of a first endpoint switch in the any group on each equivalent edge with the upstream switch is balanced and adjusted.

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

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

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