CN108243113B - Random load balancing method and device - Google Patents

Random load balancing method and device Download PDF

Info

Publication number
CN108243113B
CN108243113B CN201611215878.2A CN201611215878A CN108243113B CN 108243113 B CN108243113 B CN 108243113B CN 201611215878 A CN201611215878 A CN 201611215878A CN 108243113 B CN108243113 B CN 108243113B
Authority
CN
China
Prior art keywords
output
link
selectable
load balancing
output links
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611215878.2A
Other languages
Chinese (zh)
Other versions
CN108243113A (en
Inventor
常艳蕊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sanechips Technology Co Ltd
Original Assignee
Sanechips Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanechips Technology Co Ltd filed Critical Sanechips Technology Co Ltd
Priority to CN201611215878.2A priority Critical patent/CN108243113B/en
Priority to PCT/CN2017/094397 priority patent/WO2018120814A1/en
Publication of CN108243113A publication Critical patent/CN108243113A/en
Application granted granted Critical
Publication of CN108243113B publication Critical patent/CN108243113B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a random load balancing method, which comprises the following steps: in a round of n-time load balancing, processing M selectable output links of the first-time load balancing by using an alternative selector and a unique pseudo-random number in all planes to obtain an effective output link of the first-time load balancing; n and M are positive integers; masking the link number of the effective output link with the first current load balancing in the mask table of the M selectable link numbers with the first current load balancing, and determining M-1 selectable output links with the first next load balancing; until all link numbers in the selectable link number mask table are masked; and restoring the shielded link numbers in the selectable link number mask table to carry out next round of load balancing. The embodiment of the invention also discloses a device for random load balancing.

Description

Random load balancing method and device
Technical Field
The invention relates to the field of high-capacity data exchange, in particular to a random load balancing method and device.
Background
In the switching system, the switching network realizes data exchange between the switching access devices. With the development of application, the networking of the switching chips becomes complex, the capacity becomes larger, the number of Serdes links increases, and high-capacity switching chips such as 128 × 128, 168 × 168, 192 × 192, 256 × 256 and the like appear; in order to meet the requirement of the main frequency of the chip, the exchange chip is made into a multi-plane form.
In the multi-stage exchange, each exchange device has a plurality of routing planes, and when data exchange is carried out, different planes need to carry out load balancing simultaneously; the data is transmitted in the switching system by taking cells as units, and different input links of the same switching device receive the cells sent to different access devices; if multiple output links can reach the target access device, according to a traditional load balancing mode, fig. 1 is a schematic diagram of a traditional multi-plane load balancing method, as shown in fig. 1, assuming that the number of links of a switch chip is 96 × 96, a plane 0, a plane 1, a plane 2, and a plane 3 can reach the access device through links 0 to 23, and when 4 planes simultaneously perform load balancing, the generated output links are all 0; then, all cells sent to the access device are sent to the link No. 0, which causes the link No. 0 to be blocked and the bandwidth of the link No. 1-23 to be wasted; this results in multi-plane resonance, which cannot guarantee that cells of multiple routing planes are distributed uniformly on all reachable links, so that data streams arriving at a certain device are transmitted in one or several links, which results in congestion of cells at a certain switching device, reduced switching capability, and local congestion of data streams and waste of bandwidth.
Disclosure of Invention
In view of this, embodiments of the present invention are expected to provide a method and an apparatus for random load balancing, so as to achieve the purpose that all cells of multiple routing planes can be uniformly distributed on reachable links, ensure the flow balance of the entire network, and improve the utilization rate of bandwidth and the performance of the system.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention provides a random load balancing method, which comprises the following steps:
in a round of n-time load balancing, processing M selectable output links of the first-time load balancing by using an alternative selector and a unique pseudo-random number in all planes to obtain an effective output link of the first-time load balancing; n and M are positive integers;
masking the link number of the effective output link with the first current load balancing in the mask table of the M selectable link numbers with the first current load balancing, and determining M-1 selectable output links with the first next load balancing;
until all link numbers in the selectable link number mask table are masked;
and restoring the shielded link numbers in the selectable link number mask table to carry out next round of load balancing.
In the above solution, the processing, by using the alternative selector and the only one pseudo random number in all planes, the M selectable output links for the first time of load balancing to obtain an effective output link for the first time of load balancing includes:
in the first current time and one plane, grouping k-level output links of the M selectable output links by using an alternative selector and a unique pseudo random number in all planes to obtain an effective output link with balanced load at the first current time; and k is a positive integer.
In the above solution, the grouping k-level output links for the M selectable output links by using an alternative selector and a unique pseudo random number in all planes in the first current time and a plane to obtain the effective output link with the first current load balancing includes:
in the current time and one plane, performing pairwise grouping on k-level adjacent output links on the M selectable output links by using an alternative selector and a unique pseudo-random number in all planes;
if the number m of output links of the kth level is an even number, performing pairwise grouping on m output links of the kth level on adjacent output links, and obtaining m/2 output links of the (k + 1) th level by using an alternative selector and the only one pseudo random number in all planes until m/2 equals to 1, so as to obtain an effective output link corresponding to m/2 equals to 1; m is less than or equal to M;
if the number m of output links of the kth stage is an odd number, performing pairwise grouping on m-1 output links of the kth stage on adjacent output links, obtaining (m-1)/2 output links of the (k + 1) th stage and the remaining 1 output links of the kth stage by using an alternative selector and the unique pseudo random number in all planes until m is 3, obtaining (m-1)/2+ 1-2 output links, and determining a corresponding effective output link in the (m-1)/2+ 1-2 output links by using the alternative selector and the unique pseudo random number in a primary random load; and M is less than or equal to M.
In the above solution, the processing the M selectable output links for the first time of load balancing by using the alternative selector and the only one pseudo random number in all planes includes:
generating a selection signal based on said unique one of the pseudo random numbers in all of the planes; the only one pseudo random number in all the planes is binary number, and the bit width of the only one pseudo random number in all the planes is the number of the selection signals;
and selecting two selectable output links corresponding to two input ends of the alternative selector according to the signal bit corresponding to the selection signal to obtain one selectable output link corresponding to one output end.
In the foregoing solution, the selecting two selectable output links corresponding to two input ends of the alternative selector according to a signal bit corresponding to the selection signal to obtain one selectable output link corresponding to one output end includes:
if only one of the two selectable output links corresponding to the two input ends of the alternative selector is valid, taking the valid output link as the selectable output link corresponding to the output end;
and if both of the two selectable output links corresponding to the two input ends of the alternative selector are valid or both of the two selectable output links are invalid, determining one selectable output link corresponding to the output end according to a preset rule of a signal bit corresponding to the selection signal.
In the foregoing solution, the determining a selectable output link corresponding to the output end according to the preset rule of the signal bit corresponding to the selection signal includes:
when the signal bit corresponding to the selection signal is 1, determining a selectable output link corresponding to a first input end of the alternative selector as a selectable output link corresponding to the output end; or, when the signal bit corresponding to the selection signal is 1, determining the selectable output link corresponding to the second input end of the alternative selector as one selectable output link corresponding to the output end.
In the above scheme, the method further comprises:
and generating a unique pseudo-random number in all planes in a round of load balancing according to a preset random function.
The invention provides a random load balancing device, comprising:
the processing module is used for processing the M selectable output links of the first load balancing in a round of n-time load balancing by using the alternative selector and the only one pseudo random number in all planes to obtain an effective output link of the first load balancing; n and M are positive integers;
a determining module, configured to mask the link number of the effective output link in the first current load balancing from the mask table of M selectable link numbers in the first current load balancing, and determine M-1 selectable output links in the first next load balancing; until all link numbers in the selectable link number mask table are masked;
and the restoring module is used for restoring the shielded link numbers in the selectable link number mask table to carry out next round of load balancing.
In the foregoing solution, the processing module is specifically configured to perform grouping of k-level output links on the M selectable output links by using an alternative selector and a unique pseudo random number in all planes in the first time and a plane, so as to obtain an effective output link with balanced load at the first time; and k is a positive integer.
In the foregoing solution, the processing module is further specifically configured to perform pairwise grouping of k-level adjacent output links on the M selectable output links by using an alternative selector and a unique pseudo random number in all planes in the first time and in one plane;
if the number m of output links of the kth level is an even number, performing pairwise grouping on m output links of the kth level on adjacent output links, and obtaining m/2 output links of the (k + 1) th level by using an alternative selector and the only one pseudo random number in all planes until m/2 equals to 1, so as to obtain an effective output link corresponding to m/2 equals to 1; m is less than or equal to M;
if the number m of output links of the kth stage is an odd number, performing pairwise grouping on m-1 output links of the kth stage on adjacent output links, obtaining (m-1)/2 output links of the (k + 1) th stage and the remaining 1 output links of the kth stage by using an alternative selector and the unique pseudo random number in all planes until m is 3, obtaining (m-1)/2+ 1-2 output links, and determining a corresponding effective output link in the (m-1)/2+ 1-2 output links by using the alternative selector and the unique pseudo random number in a primary random load; and M is less than or equal to M.
In the foregoing solution, the processing module is further specifically configured to generate a selection signal according to the unique one of the pseudo random numbers in all the planes; the only one pseudo random number in all the planes is binary number, and the bit width of the only one pseudo random number in all the planes is the number of the selection signals;
and selecting two selectable output links corresponding to two input ends of the alternative selector according to the signal bit corresponding to the selection signal to obtain one selectable output link corresponding to one output end.
In the foregoing solution, the processing module is further specifically configured to, if only one of two selectable output links corresponding to two input ends of the one-of-two selector is valid, use the valid output link as one selectable output link corresponding to the output end;
and if both of the two selectable output links corresponding to the two input ends of the alternative selector are valid or both of the two selectable output links are invalid, determining one selectable output link corresponding to the output end according to a preset rule of a signal bit corresponding to the selection signal.
In the foregoing solution, the processing module is further specifically configured to determine, when the signal bit corresponding to the selection signal is 1, a selectable output link corresponding to a first input end of the alternative selector as a selectable output link corresponding to the output end; or, when the signal bit corresponding to the selection signal is 1, determining the selectable output link corresponding to the second input end of the alternative selector as one selectable output link corresponding to the output end.
In the above scheme, the apparatus further comprises:
and the generating module is used for generating a unique pseudo-random number in all planes in a round of load balancing according to a preset random function.
According to the method and the device for random load balancing provided by the embodiment of the invention, in a round of n-time load balancing, an alternative selector and a unique pseudo random number in all planes are utilized to process M selectable output links for the first time of load balancing, so that an effective output link for the first time of load balancing is obtained; n and M are positive integers; masking the link number of the effective output link with the first current load balancing in the mask table of the M selectable link numbers with the first current load balancing, and determining M-1 selectable output links with the first next load balancing; until all link numbers in the selectable link number mask table are masked; restoring the shielded link numbers in the selectable link number mask table, and carrying out next round of load balancing; the aim of uniformly distributing all cells of a plurality of routing planes on reachable links and ensuring the flow balance of the whole network is fulfilled, and the utilization rate of bandwidth and the performance of a system are improved.
Drawings
FIG. 1 is a diagram illustrating a conventional multi-plane load balancing method;
FIG. 2 is a flowchart of a first embodiment of a random load balancing method of the present invention;
FIG. 3 is a flowchart of a second embodiment of a random load balancing method of the present invention;
FIG. 4 is a schematic structural diagram of an alternative selector according to an embodiment of the random load balancing method of the present invention;
fig. 5 is a schematic diagram of a random load balancing structure of a routing plane of a 96 × 96 switching device according to an embodiment of the random load balancing method of the present invention;
FIG. 6 is a schematic diagram illustrating a cell flow of load balancing according to a second embodiment of the random load balancing method of the present invention;
fig. 7 is a schematic structural diagram of an embodiment of a random load balancing apparatus according to the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Example one
FIG. 2 is a flowchart of a first embodiment of a random load balancing method of the present invention; as shown in fig. 2, the method for random load balancing according to an embodiment of the present invention may include the following steps:
step 201: in a round of n-time load balancing, processing M selectable output links of the first-time load balancing by using an alternative selector and a unique pseudo-random number in all planes to obtain an effective output link of the first-time load balancing; and n and M are positive integers.
In a round of n-time load balancing, grouping K-level output links of M selectable output links of the first-time load balancing in a current time and a plane by using an alternative selector and a unique pseudo-random number in all planes to obtain an effective output link of the first-time load balancing; wherein k is a positive integer.
Specifically, in a round of n-time load balancing, firstly, a unique pseudo random number in all planes in a round of load balancing is generated according to a preset random function, and a selection signal is generated according to the pseudo random number; the pseudo-random number is binary number, and the bit width of the pseudo-random number is the number of the selection signals.
For example, the number of routing planes in load balancing is a, and the number of selection signals required by each routing plane for load balancing is b, then in a period in which a routing planes perform load balancing once, firstly, a unique pseudo-random number Y in the period is generated according to a preset random function f (x), and a b selection signals are generated according to Y, wherein the bit width of the pseudo-random number Y is a × b.
Then, in the current time and one plane, the two-by-two grouping of k-level adjacent output links is carried out on the M selectable output links of the current time load balancing by using an alternative selector and a selection signal generated according to a unique pseudo random number in all planes, and an effective output link of the current time load balancing is obtained.
Further, in the current load balancing, when load balancing is performed on one routing plane, for the kth-level output link, grouping is performed according to the parity of the number m of the kth-level output links, specifically:
if m is an even number, performing pairwise grouping on m output links of the kth level on adjacent output links, and obtaining m/2 output links of the (k + 1) th level by using an alternative selector and the unique pseudo-random number in all planes until m/2 is equal to 1, so as to obtain an effective output link corresponding to m/2 being equal to 1; wherein M is less than or equal to M;
if m is an odd number, performing pairwise grouping on m-1 output links of the kth stage on adjacent output links, obtaining (m-1)/2 output links of the (k + 1) th stage and the remaining 1 output links of the kth stage by using an alternative selector and the unique pseudo random number in all planes until m is 3 to obtain (m-1)/2+ 1-2 output links, and determining a corresponding effective output link in the (m-1)/2+ 1-2 output links by using the alternative selector and the unique pseudo random number in the primary random load; wherein M is less than or equal to M.
Further, when the two-by-two selector and the selection signal generated according to the only one pseudo random number in all planes are used for pairwise grouping of k-level adjacent output links on the M selectable output links of the current load balancing, the two selectable output links corresponding to the two input ends of the two-by-one selector are selected according to the signal bit corresponding to the selection signal, and the selection process is as follows:
if only one of the two selectable output links corresponding to the two input ends of the alternative selector is valid, the valid output link is used as the selectable output link corresponding to the output end;
if both of two selectable output links corresponding to two input ends of the alternative selector are valid or both of the two selectable output links are invalid, determining a selectable output link corresponding to the output end according to a preset rule of a signal bit corresponding to a selection signal; the method specifically comprises the following steps: when the signal bit corresponding to the selection signal is 1, determining a selectable output link corresponding to a first input end of the alternative selector as a selectable output link corresponding to an output end; or when the signal bit corresponding to the selection signal is 1, determining the selectable output link corresponding to the second input end of the alternative selector as one selectable output link corresponding to the output end.
Step 202: masking the link number of the effective output link with the first current load balancing in the mask table of the M selectable link numbers with the first current load balancing, and determining M-1 selectable output links with the first next load balancing; until all link numbers in the selectable link number mask table are masked.
After obtaining an effective output link with the current load balance, shielding the link number of the effective output link in the M selectable link number mask tables with the current load balance, wherein the link which is not shielded is used as the M-1 actual selectable output links with the next load balance; and completing a round of load balancing until all the link numbers in the selectable link number mask table are shielded.
Step 203: and restoring the shielded link numbers in the selectable link number mask table to carry out next round of load balancing.
After one round of load balancing is completed, the masked link numbers in the selectable link number mask table are restored, and step 201 to step 202 are executed again to perform the next round of load balancing.
In the method for random load balancing provided by the embodiment of the invention, in a round of n times of load balancing, an alternative selector and a unique pseudo-random number in all planes are utilized to process M selectable output links for the first time of load balancing, so as to obtain an effective output link for the first time of load balancing; n and M are positive integers; masking the link number of the effective output link with the first current load balancing in the mask table of the M selectable link numbers with the first current load balancing, and determining M-1 selectable output links with the first next load balancing; until all link numbers in the selectable link number mask table are masked; restoring the shielded link numbers in the selectable link number mask table, and carrying out next round of load balancing; the method of the alternative selector and the load balancing mask is utilized to realize the purposes that all cells of a plurality of routing planes can be uniformly distributed on reachable links and the flow balance of the whole network is ensured, the utilization rate of the bandwidth and the performance of the system are improved, and the method can be used for networking structures of various modes.
Example two
FIG. 3 is a flowchart of a second embodiment of a random load balancing method of the present invention; this embodiment takes as an example the processing method of the routing plane of a 96 × 96 switching device, which includes 4 routing planes: plane 0, plane 1, plane 2, and plane 3; the selection signal (select signal) of the alternative selector used by the 4 routing planes is generated by the same random function generator, and the number of selectable output links is 96; as shown in fig. 3, the method for random load balancing according to an embodiment of the present invention may include the following steps:
step 301: and grouping every 96 selectable output links into 48 groups, and generating 48 output links after the first-stage selection.
Grouping every two of 96 selectable output links into adjacent links, wherein the total number of the output links can be divided into 48 groups; after the first level selection of the 48 selectable sets of output links using the 48 alternative selectors, 48 output links result.
FIG. 4 is a schematic structural diagram of an alternative selector according to an embodiment of the random load balancing method of the present invention; as shown in fig. 4, the one-of-two selector includes two input terminals, a selection signal terminal and an output terminal; assuming that the input of the alternative selector is a link a and a link b respectively, selecting one of the link a and the link b as an output link according to the link a, the link b and the selection signal; specifically, when the link a is valid and the link b is invalid, the link a is selected as an output link; when the link a is invalid and the link b is valid, selecting the link b as an output link; when both link a and link b are active, then link a or link b is selected as the output link using the corresponding bit of the select signal (select signal); for example, it may be preset to select link a as the output link when the corresponding bit of the select signal (select signal) is 1; alternatively, it may be preset to select link b as the output link when the corresponding bit of the select signal (select signal) is 1.
Step 302: and grouping the generated 48 output links into 24 groups in pairs, and generating 24 output links after second-stage selection.
After the 96 selectable output links are subjected to first-stage selection to generate 48 output links, the 48 output links are continuously subjected to pairwise grouping of adjacent output links, the total number of the 48 output links can be divided into 24 groups, and then the 24 groups of output links are subjected to second-stage selection by utilizing 24 alternative selectors to obtain 24 output links.
Step 303: and grouping the generated 24 output links into 12 groups in pairs, and generating 12 output links after third-stage selection.
After the 96 selectable output links are selected in two stages to generate 24 output links, pairwise grouping of adjacent output links is continuously carried out on the 24 output links to divide the 24 output links into 12 groups, and then the 12 groups of output links are selected in a third stage by utilizing 12 alternative selectors to obtain 12 output links.
Step 304: and grouping the generated 12 output links into 6 groups in pairs, and generating 6 output links after fourth-stage selection.
And performing three-level selection on 96 selectable output links to generate 12 output links, then continuously grouping every two of the 12 output links into 6 groups, and performing fourth-level selection on the 6 groups of output links by using 6 alternative selectors to obtain 6 output links.
Step 305: and grouping the generated 6 output links into 3 groups in pairs, and generating 3 output links after the selection of the fifth stage.
And performing four-stage selection on 96 selectable output links to generate 6 output links, then continuously performing pairwise grouping on the 6 output links to obtain 3 groups, and then performing fifth-stage selection on the 3 groups of output links by using 3 alternative selectors to obtain 3 output links.
Step 306: the generated 3 output links are divided into 2 groups and 1 group, and the sixth-level selection is performed on the output links of the 2 groups, resulting in 1 output link and the remaining 1 output link.
After the 96 selectable output links are selected in five levels to generate 3 output links, dividing the 1 st output link and the 2 nd output link or the 3 rd output link in the 3 output links into a first group, and dividing the rest output links into a second group; a sixth level of selection is then made on the first set of 2 output links using 1 alternative selector, resulting in 1 output link, while the remaining 1 output link.
Step 307: and performing seventh-level selection on the 1 output link generated by the sixth level and the remaining 1 output link of the fifth level to obtain an effective output link.
And taking 1 output link generated by the sixth-level selection and the remaining 1 output link of the fifth level as a group, and performing seventh-level selection by using 1 alternative selector to generate 1 effective output link, wherein the output link is a final effective load balancing link.
Step 308: and masking the obtained link number of one effective output link in a link number mask table of 96 selectable output links to generate the selectable output link with next load balancing.
After a final effective load balancing link is selected from the 96 selectable output links, the link number of the load balancing link is shielded in the link number mask table of the 96 selectable output links, and a selectable output link with next load balancing is generated.
For example, after an effective load balancing link is obtained, the corresponding position of the effective load balancing link may be 1, and the effective load balancing link is fed back to the load balancing input end, the link number is masked in the 96 selectable link number mask tables, and the selectable output link for next load balancing is obtained, so that the masked link number will not be selected when next load balancing is performed.
Fig. 5 is a schematic diagram of a random load balancing structure of a routing plane of a 96 × 96 switching device according to an embodiment of the random load balancing method of the present invention; as shown in fig. 5, a two-out-of-two selector is used to perform pairwise grouping and selection of seven levels of adjacent output links on 96 selectable output links, and finally an output link is generated as an effective load balancing link; and simultaneously generating corresponding masks and feeding back the masks to the input end of the load balance, and shielding the link numbers of the effective load balance link in a link number mask table of 96 selectable output links to obtain the selectable output link of the next load balance.
The processing procedure of load balancing in each routing plane in the switching device is identical; i.e. steps 301 to 308 are performed for plane 0, plane 1, plane 2 and plane 3, respectively, and a respective payload balancing link is synchronously generated to the output link of the switching means.
In the above process, each routing plane needs 48+24+12+6+3+1+1 to 95 selection signals (select signals), and 4 planes in total need 4 × 95 selection signals; wherein the selection signal (select signal) is generated by a pseudo-random number Y, which is generated by a predetermined random function, for example, a predetermined random function f (x) x ^31+ x ^28+ 1; each time the 4 planes perform load balancing, one Y is generated, and the bit width thereof is the number of the select signals (select signals), i.e. 4 × 95.
It should be noted that the preset random function can be set according to actual requirements, and is not limited herein.
FIG. 6 is a schematic diagram illustrating a cell flow of load balancing according to a second embodiment of the random load balancing method of the present invention; as shown in fig. 6, after load balancing is performed on 96 selectable output links from 0 to 95 once, the output link generated by plane 0 is link No. 0, the output link generated by plane 1 is link No. 1, the output link generated by plane 2 is link No. 2, and the output link generated by plane 3 is link No. 3, that is, 4 planes can be respectively load balanced to different links, thereby avoiding multi-plane resonance.
Step 309: a determination is made whether all link numbers in the selectable link number mask table are masked.
After completing the load balancing, determining whether all the link numbers in the selectable link number mask table are masked, if not, executing step 310; if all link numbers in the optional link number mask table have been masked, step 311 is performed.
Step 310: and carrying out next load balancing.
When it is determined that all the link numbers in the selectable link number mask table are not completely masked and load balancing is not finished in the current round, next load balancing is continuously performed on the plane 0, the plane 1, the plane 2, and the plane 3, that is, steps 301 to 308 are performed.
Step 311: and restoring the shielded link numbers in the selectable link number mask table to carry out next round of load balancing.
When all the link numbers in the selectable link number mask table are judged to be shielded, the load balancing of the round is finished, at this time, the shielded link numbers in the selectable link number mask table are restored, and then the load balancing of the next round is carried out.
In the process, when the same round of load balancing is performed, after one effective load balancing link is generated after one load balancing is completed, the selectable output link for next load balancing is generated according to the mask table of the load balancing link and the selectable output link, namely, the link number of the generated effective load balancing link is shielded in the current selectable link number mask table, so that the situation that the same round of load balancing randomly reaches the same link twice can be avoided; meanwhile, random selection signals (select signals) are different every time, so that resonance of multiple routing planes can be effectively avoided, the probability that multiple routing planes are load balanced to the same link is reduced, and the purpose of load balancing is finally achieved.
In the method for random load balancing provided by the embodiment of the invention, every two of 96 selectable output links are grouped, and 48 output links are generated after first-stage selection; grouping the generated 48 output links in pairs, and generating 24 output links after second-level selection; grouping the generated 24 output links in pairs, and generating 12 output links after third-level selection; grouping the generated 12 output links in pairs, and generating 6 output links after fourth-stage selection; grouping the generated 6 output links in pairs, and generating 3 output links after fifth-level selection; dividing the generated 3 output links into 2 groups and 1 group, and performing sixth-level selection on the output links of the 2 groups to generate 1 output link and remaining 1 output link; performing seventh-level selection on the 1 output link generated by the sixth level and the remaining 1 output link of the fifth level to obtain an effective output link; screening the obtained link number of one effective output link in a link number mask table of 96 selectable output links to generate a selectable output link with next load balance; judging whether all the link numbers in the selectable link number mask table are masked, and if not, carrying out next load balancing; if the link numbers are shielded, restoring the shielded link numbers in the selectable link number mask table, and carrying out next round of load balancing; the method avoids that the same round of load balancing randomly reaches the same link twice, effectively avoids resonance generated by a plurality of routing planes, reduces the probability of load balancing of a plurality of routing planes to the same link, realizes the purpose that all cells of the plurality of routing planes can be uniformly distributed on the reachable links, ensures the flow balance of the whole network, and improves the utilization rate of bandwidth and the performance of the system.
EXAMPLE III
FIG. 7 is a schematic structural diagram of an embodiment of a random load balancing apparatus according to the present invention; as shown in fig. 7, an apparatus 07 for random load balancing according to an embodiment of the present invention includes: a processing module 71, a determining module 72, a restoring module 73; wherein the content of the first and second substances,
the processing module 71 is configured to, in a round of n-time load balancing, process the M selectable output links in the first time of load balancing by using the one-out-of-two selector and the only one pseudo random number in all planes, so as to obtain an effective output link in the first time of load balancing; n and M are positive integers;
the determining module 72 is configured to mask the link number of the effective output link in the first current load balancing in the M selectable link number mask tables in the first current load balancing, and determine M-1 selectable output links in the first next load balancing; until all link numbers in the selectable link number mask table are masked;
the restoring module 73 is configured to restore the masked link numbers in the selectable link number mask table, and perform next round of load balancing.
Further, the processing module 71 is specifically configured to perform grouping of k-level output links on the M selectable output links by using an alternative selector and a unique pseudo random number in all planes in the first time and one plane, so as to obtain the effective output link with the first time load balancing; and k is a positive integer.
Further, the processing module 71 is further specifically configured to perform pairwise grouping of k-level adjacent output links on the M selectable output links in the first plane and in one plane by using an alternative selector and a unique pseudo random number in all planes;
if the number m of output links of the kth level is an even number, performing pairwise grouping on m output links of the kth level on adjacent output links, and obtaining m/2 output links of the (k + 1) th level by using an alternative selector and the only one pseudo random number in all planes until m/2 equals to 1, so as to obtain an effective output link corresponding to m/2 equals to 1; m is less than or equal to M;
if the number m of output links of the kth stage is an odd number, performing pairwise grouping on m-1 output links of the kth stage on adjacent output links, obtaining (m-1)/2 output links of the (k + 1) th stage and the remaining 1 output links of the kth stage by using an alternative selector and the unique pseudo random number in all planes until m is 3, obtaining (m-1)/2+ 1-2 output links, and determining a corresponding effective output link in the (m-1)/2+ 1-2 output links by using the alternative selector and the unique pseudo random number in a primary random load; and M is less than or equal to M.
Further, the processing module 71 is further specifically configured to generate a selection signal according to the unique one of the pseudo random numbers in all the planes; the only one pseudo random number in all the planes is binary number, and the bit width of the only one pseudo random number in all the planes is the number of the selection signals;
and selecting two selectable output links corresponding to two input ends of the alternative selector according to the signal bit corresponding to the selection signal to obtain one selectable output link corresponding to one output end.
Further, the processing module 71 is further specifically configured to, if only one of two selectable output links corresponding to two input ends of the alternative selector is valid, take the valid output link as one selectable output link corresponding to the output end;
and if both of the two selectable output links corresponding to the two input ends of the alternative selector are valid or both of the two selectable output links are invalid, determining one selectable output link corresponding to the output end according to a preset rule of a signal bit corresponding to the selection signal.
Further, the processing module 71 is further specifically configured to determine, when the signal bit corresponding to the selection signal is 1, a selectable output link corresponding to the first input end of the alternative selector as a selectable output link corresponding to the output end; or, when the signal bit corresponding to the selection signal is 1, determining the selectable output link corresponding to the second input end of the alternative selector as one selectable output link corresponding to the output end.
Further, the apparatus 07 further includes: a generation module 74; wherein the content of the first and second substances,
the generating module 74 is configured to generate a unique pseudo random number in all planes in a round of load balancing according to a preset random function.
The random load balancing apparatus of this embodiment may be configured to implement the technical solutions of the above-described method embodiments, and the implementation principles and technical effects thereof are similar, and are not described herein again.
In practical applications, the processing module 71, the determining module 72, the restoring module 73, and the generating module 74 of the random load balancing device 07 may be implemented by a Central Processing Unit (CPU), a microprocessor Unit (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like in the random load balancing device 07.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (12)

1. A method of random load balancing, the method comprising:
in a round of n-time load balancing, processing M selectable output links of the first-time load balancing by using an alternative selector and a unique pseudo-random number in all planes to obtain an effective output link of the first-time load balancing; n and M are positive integers;
masking the link number of the effective output link with the first current load balancing in the mask table of the M selectable link numbers with the first current load balancing, and determining M-1 selectable output links with the first next load balancing;
until all link numbers in the selectable link number mask table are masked;
restoring the shielded link numbers in the selectable link number mask table, and carrying out next round of load balancing;
the processing of the M selectable output links for the first current load balancing by using the alternative selector and the only one pseudo random number in all planes to obtain an effective output link for the first current load balancing includes:
in the first current time and one plane, grouping k-level output links of the M selectable output links by using an alternative selector and a unique pseudo random number in all planes to obtain an effective output link with balanced load at the first current time; and k is a positive integer.
2. The method according to claim 1, wherein said grouping said M selectable output links into k-level output links in said first current time and one plane using an alternative selector and a unique pseudo random number in all planes to obtain said one first current time load balanced effective output link comprises:
in the current time and one plane, performing pairwise grouping on k-level adjacent output links on the M selectable output links by using an alternative selector and a unique pseudo-random number in all planes;
if the number m of output links of the kth level is an even number, performing pairwise grouping on m output links of the kth level on adjacent output links, and obtaining m/2 output links of the (k + 1) th level by using an alternative selector and the only one pseudo random number in all planes until m/2 equals to 1, so as to obtain an effective output link corresponding to m/2 equals to 1; m is less than or equal to M;
if the number m of output links of the kth stage is an odd number, performing pairwise grouping on m-1 output links of the kth stage on adjacent output links, obtaining (m-1)/2 output links of the (k + 1) th stage and the remaining 1 output links of the kth stage by using an alternative selector and the unique pseudo random number in all planes until m is 3, obtaining (m-1)/2+ 1-2 output links, and determining a corresponding effective output link in the (m-1)/2+ 1-2 output links by using the alternative selector and the unique pseudo random number in a primary random load; and M is less than or equal to M.
3. The method of claim 1, wherein processing the M selectable output links for the first current load balancing using an alternative selector and a unique pseudo random number in all planes comprises:
generating a selection signal based on said unique one of the pseudo random numbers in all of the planes; the only one pseudo random number in all the planes is binary number, and the bit width of the only one pseudo random number in all the planes is the number of the selection signals;
and selecting two selectable output links corresponding to two input ends of the alternative selector according to the signal bit corresponding to the selection signal to obtain one selectable output link corresponding to one output end.
4. The method according to claim 3, wherein the selecting two selectable output links corresponding to two input ends of the alternative selector according to the signal bit corresponding to the selection signal to obtain one selectable output link corresponding to one output end comprises:
if only one of the two selectable output links corresponding to the two input ends of the alternative selector is valid, taking the valid output link as the selectable output link corresponding to the output end;
and if both of the two selectable output links corresponding to the two input ends of the alternative selector are valid or both of the two selectable output links are invalid, determining one selectable output link corresponding to the output end according to a preset rule of a signal bit corresponding to the selection signal.
5. The method of claim 4, wherein determining a selectable output link corresponding to the output according to the predetermined rule of the signal bit corresponding to the selection signal comprises:
when the signal bit corresponding to the selection signal is 1, determining a selectable output link corresponding to a first input end of the alternative selector as a selectable output link corresponding to the output end; or, when the signal bit corresponding to the selection signal is 1, determining the selectable output link corresponding to the second input end of the alternative selector as one selectable output link corresponding to the output end.
6. The method according to any one of claims 1-5, further comprising:
and generating a unique pseudo-random number in all planes in a round of load balancing according to a preset random function.
7. An apparatus for random load balancing, the apparatus comprising:
the processing module is used for processing the M selectable output links of the first load balancing in a round of n-time load balancing by using the alternative selector and the only one pseudo random number in all planes to obtain an effective output link of the first load balancing; n and M are positive integers;
a determining module, configured to mask the link number of the effective output link in the first current load balancing from the mask table of M selectable link numbers in the first current load balancing, and determine M-1 selectable output links in the first next load balancing; until all link numbers in the selectable link number mask table are masked;
the restoring module is used for restoring the shielded link numbers in the selectable link number mask table to carry out next round of load balancing;
the processing module is specifically configured to: in the first current time and one plane, grouping k-level output links of the M selectable output links by using an alternative selector and a unique pseudo random number in all planes to obtain an effective output link with balanced load at the first current time; and k is a positive integer.
8. The apparatus of claim 7, wherein the processing module is further specifically configured to: in the current time and one plane, performing pairwise grouping on the k-level adjacent output links on the M selectable output links by using an alternative selector and a unique pseudo-random number in all planes;
if the number m of output links of the kth level is an even number, performing pairwise grouping on m output links of the kth level on adjacent output links, and obtaining m/2 output links of the (k + 1) th level by using an alternative selector and the only one pseudo random number in all planes until m/2 equals to 1, so as to obtain an effective output link corresponding to m/2 equals to 1; m is less than or equal to M;
if the number m of output links of the kth stage is an odd number, performing pairwise grouping on m-1 output links of the kth stage on adjacent output links, obtaining (m-1)/2 output links of the (k + 1) th stage and the remaining 1 output links of the kth stage by using an alternative selector and the unique pseudo random number in all planes until m is 3, obtaining (m-1)/2+ 1-2 output links, and determining a corresponding effective output link in the (m-1)/2+ 1-2 output links by using the alternative selector and the unique pseudo random number in a primary random load; and M is less than or equal to M.
9. The apparatus of claim 7, wherein the processing module is further specifically configured to: generating a selection signal based on said unique one of the pseudo random numbers in all of the planes; the only one pseudo random number in all the planes is binary number, and the bit width of the only one pseudo random number in all the planes is the number of the selection signals;
and selecting two selectable output links corresponding to two input ends of the alternative selector according to the signal bit corresponding to the selection signal to obtain one selectable output link corresponding to one output end.
10. The apparatus of claim 9, wherein the processing module is further specifically configured to: if only one of the two selectable output links corresponding to the two input ends of the alternative selector is valid, taking the valid output link as the selectable output link corresponding to the output end;
and if both of the two selectable output links corresponding to the two input ends of the alternative selector are valid or both of the two selectable output links are invalid, determining one selectable output link corresponding to the output end according to a preset rule of a signal bit corresponding to the selection signal.
11. The apparatus of claim 10, wherein the processing module is further specifically configured to: when the signal bit corresponding to the selection signal is 1, determining a selectable output link corresponding to a first input end of the alternative selector as a selectable output link corresponding to the output end; or, when the signal bit corresponding to the selection signal is 1, determining the selectable output link corresponding to the second input end of the alternative selector as one selectable output link corresponding to the output end.
12. The apparatus according to any one of claims 7-11, further comprising:
and the generating module is used for generating a unique pseudo-random number in all planes in a round of load balancing according to a preset random function.
CN201611215878.2A 2016-12-26 2016-12-26 Random load balancing method and device Active CN108243113B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201611215878.2A CN108243113B (en) 2016-12-26 2016-12-26 Random load balancing method and device
PCT/CN2017/094397 WO2018120814A1 (en) 2016-12-26 2017-07-25 Random load balancing method and apparatus, computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611215878.2A CN108243113B (en) 2016-12-26 2016-12-26 Random load balancing method and device

Publications (2)

Publication Number Publication Date
CN108243113A CN108243113A (en) 2018-07-03
CN108243113B true CN108243113B (en) 2020-06-16

Family

ID=62705016

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611215878.2A Active CN108243113B (en) 2016-12-26 2016-12-26 Random load balancing method and device

Country Status (2)

Country Link
CN (1) CN108243113B (en)
WO (1) WO2018120814A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2023521027A (en) * 2020-04-03 2023-05-23 ホアウェイ・テクノロジーズ・カンパニー・リミテッド Network device, system and method for cycle-based load balancing
CN111935029B (en) * 2020-09-18 2021-06-08 腾讯科技(深圳)有限公司 Gateway load balancing method and device, storage medium and electronic equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1426211A (en) * 2001-12-06 2003-06-25 富士通株式会社 Server load sharing system
CN101217476A (en) * 2008-01-07 2008-07-09 华为技术有限公司 A multi-plane package switching method, system and device
CN101227394A (en) * 2008-02-18 2008-07-23 中兴通讯股份有限公司 High-capacity non-jam route matrix
US7596135B1 (en) * 2003-05-23 2009-09-29 Cisco Technology, Inc. Method and apparatus for mixed-cast routing through a Clos-like network
CN102065014A (en) * 2010-12-29 2011-05-18 中兴通讯股份有限公司 Data cell processing method and device
CN102238072A (en) * 2010-05-06 2011-11-09 中兴通讯股份有限公司 Method for dynamically selecting routing and CLOS (Charles Clos) switching network system
CN103152281A (en) * 2013-03-05 2013-06-12 中国人民解放军国防科学技术大学 Two-level switch-based load balanced scheduling method
CN105337883A (en) * 2015-08-20 2016-02-17 电子科技大学 Multi-business supporting network switching device and implementation method therefor
CN105376168A (en) * 2014-08-25 2016-03-02 深圳市中兴微电子技术有限公司 Load balancing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7319695B1 (en) * 2002-03-06 2008-01-15 Agere Systems Inc. Deficit-based striping algorithm

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1426211A (en) * 2001-12-06 2003-06-25 富士通株式会社 Server load sharing system
US7596135B1 (en) * 2003-05-23 2009-09-29 Cisco Technology, Inc. Method and apparatus for mixed-cast routing through a Clos-like network
CN101217476A (en) * 2008-01-07 2008-07-09 华为技术有限公司 A multi-plane package switching method, system and device
CN101227394A (en) * 2008-02-18 2008-07-23 中兴通讯股份有限公司 High-capacity non-jam route matrix
CN102238072A (en) * 2010-05-06 2011-11-09 中兴通讯股份有限公司 Method for dynamically selecting routing and CLOS (Charles Clos) switching network system
CN102065014A (en) * 2010-12-29 2011-05-18 中兴通讯股份有限公司 Data cell processing method and device
CN103152281A (en) * 2013-03-05 2013-06-12 中国人民解放军国防科学技术大学 Two-level switch-based load balanced scheduling method
CN105376168A (en) * 2014-08-25 2016-03-02 深圳市中兴微电子技术有限公司 Load balancing method and device
CN105337883A (en) * 2015-08-20 2016-02-17 电子科技大学 Multi-business supporting network switching device and implementation method therefor

Also Published As

Publication number Publication date
CN108243113A (en) 2018-07-03
WO2018120814A1 (en) 2018-07-05

Similar Documents

Publication Publication Date Title
EP3657684B1 (en) Path sorting for list decoding for example for polar code decoding
US8447954B2 (en) Parallel pipelined vector reduction in a data processing system
US20180212899A1 (en) Fast scheduling and optmization of multi-stage hierarchical networks
US10965618B1 (en) Automatic multi-stage fabric generation for FPGAs
US9374322B2 (en) Optimization of multi-stage hierarchical networks for practical routing applications
CN108243113B (en) Random load balancing method and device
CN111475250A (en) Network optimization method and device in cloud environment
CN111404555A (en) Cyclic shift network control method, system, storage medium and decoder
CN104281636A (en) Concurrent distributed processing method for mass report data
Shi et al. An enhanced multiway sorting network based on n-sorters
Dobai et al. Evolutionary design of hash function pairs for network filters
Kurokawa et al. Xy based fault-tolerant routing with the passage of faulty nodes
Liang et al. Beyond the performance of three-tier fat-tree: equality topology with low diameter
KR100255728B1 (en) Method for allocating identifier to nodes of network permutation
Shamaei et al. Higher dimensional Gaussian networks
Wu et al. Fault-driven reconfiguration algorithm for processor arrays
CN103020203B (en) Method and device for processing data
CN114286368B (en) Method and device for realizing cyclic shift
US11860814B1 (en) Scalable distributed computing system with deterministic communication
CN113783806B (en) Shunt route jump method, device, medium, equipment and multi-core system applied by same
Farrag Developing fault-tolerant distributed loops
CN114095289B (en) Data multicast circuit, method, electronic device, and computer-readable storage medium
WO2022183789A1 (en) Data exchange system and method, and storage medium
EP4072025A1 (en) Decoding method and device, apparatus, and storage medium
Shamaei et al. Adaptive routing in hexagonal torus interconnection networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant