[go: up one dir, main page]

WO2018120814A1 - Random load balancing method and apparatus, computer storage medium - Google Patents

Random load balancing method and apparatus, computer storage medium Download PDF

Info

Publication number
WO2018120814A1
WO2018120814A1 PCT/CN2017/094397 CN2017094397W WO2018120814A1 WO 2018120814 A1 WO2018120814 A1 WO 2018120814A1 CN 2017094397 W CN2017094397 W CN 2017094397W WO 2018120814 A1 WO2018120814 A1 WO 2018120814A1
Authority
WO
WIPO (PCT)
Prior art keywords
output
link
selectable
load balancing
planes
Prior art date
Application number
PCT/CN2017/094397
Other languages
French (fr)
Chinese (zh)
Inventor
常艳蕊
Original Assignee
深圳市中兴微电子技术有限公司
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 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2018120814A1 publication Critical patent/WO2018120814A1/en

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

Definitions

  • the present invention relates to the field of large-capacity data exchange, and in particular, to a method and apparatus for random load balancing, and a computer storage medium.
  • the switching network implements data exchange between switching access devices.
  • the networking of the switching chip becomes complicated, the capacity becomes larger, and the number of Serdes links also increases, and large-capacity switching chips such as 128 ⁇ 128, 168 ⁇ 168, 192 ⁇ 192, 256 ⁇ 256 appear.
  • the switch chip is made in a multi-plane form.
  • FIG. 1 is a schematic diagram of a conventional multi-plane load balancing method, as shown in FIG. It is assumed that the number of links of the switch chip is 96 ⁇ 96, and plane 0, plane 1, plane 2, and plane 3 can all reach the access device through links 0 to 23, and the four planes simultaneously perform load balancing.
  • the output link is 0.
  • embodiments of the present invention are directed to a method and apparatus for random load balancing, and a computer storage medium, so that all cells of multiple routing planes can be uniformly allocated on reachable links to ensure the entire network.
  • the purpose of traffic balancing is to improve bandwidth utilization and system performance.
  • An embodiment of the present invention provides a method for random load balancing, where the method includes:
  • the M-selectable output links of the current sub-load balancing are processed by using a two-choice selector and a unique pseudo-random number in all planes to obtain a current sub-load balancing.
  • Effective output link; the n, M are positive integers;
  • the link number of the valid output link of the current current load balancing is masked in the M selectable link number mask tables of the current secondary load balancing, and the M-1 of the next load balancing is determined.
  • the masked link number in the selectable link number mask table is restored for the next round of load balancing.
  • the M selectable output links of the current sub-load balancing are processed by using a second-selector and a unique pseudo-random number in all planes to obtain an effective output of the current sub-load balancing.
  • Links including:
  • the k-level output chain is performed on the M selectable output links by using a second-selector and a unique pseudo-random number in all planes in the current time and a plane.
  • the grouping of the roads obtains the effective output link of the current current load balancing, including:
  • the m output links of the kth stage are grouped into two groups of adjacent output links, and the selectors of the second selection and the unique ones in all planes are utilized.
  • the m-1 output links of the kth stage are grouped into two groups of adjacent output links, and the selectors are selected and the planes are used in all planes.
  • the M-selectable output link of the current sub-load balancing is processed by using a second-selector and a unique pseudo-random number in all planes, including:
  • the only one of the all planes is a binary number, and the bit width of the only one of the all planes is the selection The number of signals;
  • the signal bit corresponding to the selection signal is selected for the second selection
  • the two selectable output links corresponding to the two inputs of the selector are selected to obtain a selectable output link corresponding to one output, including:
  • the determining, according to a preset rule of the signal bit corresponding to the selection signal, a selectable output link corresponding to the output end including:
  • the selectable output link corresponding to the first input end of the second selection selector is determined as a selectable output chain corresponding to the output end. Or; when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the second input end of the second selection selector is determined as one corresponding to the output end; Selected output link.
  • the method further includes:
  • a unique one of all planes in one round of load balancing is generated according to a preset random function.
  • An embodiment of the present invention provides a device for random load balancing, where the device includes:
  • the processing module is configured to process the M selectable output links of the current sub-load balancing by using a second-selector and a unique pseudo-random number in all planes in one round of load balancing.
  • a determining module configured to block the link number of the valid output link of the current current load balancing in the M selectable link number mask tables of the current secondary load balancing, and determine M-1 selectable output links that are load balanced at a time; until all link numbers in the selectable link number mask table are masked;
  • the restoration module is configured to restore the blocked link number in the selectable link number mask table for the next round of load balancing.
  • the processing module is specifically configured to use the two selectors and a unique pseudo random number in all planes in the current time and a plane to the M selectable output chains.
  • the path performs a packet of the k-level output link to obtain the effective output link of the current current load balancing; the k is a positive integer.
  • the processing module is further configured to: in the current time and in a plane, use the two selectors and a unique pseudo random number in all planes to select the M outputs.
  • the link performs two-two packets of k-level adjacent output links;
  • the m output links of the kth stage are grouped into two groups of adjacent output links, and the selectors of the second selection and the unique ones in all planes are utilized.
  • the m-1 output links of the kth stage are grouped into two groups of adjacent output links, and the selectors are selected and the planes are used in all planes.
  • the processing module is further configured to generate a selection signal according to the unique one of the pseudo-random numbers in all planes; the only one of the all planes is a binary number, in all planes The bit width of the unique pseudo random number is the number of the selection signals;
  • the processing module is further configured to: if only one of the two selectable output links corresponding to the two inputs of the two-selector is valid, the effective output is The link serves as a selectable output link corresponding to the output;
  • the processing module is further configured to: when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the first input end of the second selection selector is determined as a selectable output link corresponding to the output; or, when the signal bit corresponding to the selection signal is 1, the selectable output corresponding to the second input of the second selector The link is determined to be a selectable output link corresponding to the output.
  • the device further includes:
  • a generating module is configured to generate a unique one of all planes in one round of load balancing according to a preset random function.
  • the processing module, the determining module, the restoring module, and the generating module may use a central processing unit (CPU), a digital signal processor (DSP, Digital Singnal Processor), or Field-Programmable Gate Array (FPGA) implementation.
  • CPU central processing unit
  • DSP digital signal processor
  • FPGA Field-Programmable Gate Array
  • the embodiment of the present invention further provides a computer storage medium storing computer executable instructions configured to perform the method of random load balancing according to any one of the foregoing aspects.
  • Method and device for random load balancing provided by embodiment of the present invention, and computer storage
  • the medium through a round of n load balancing, using a two-selection selector and a unique pseudo-random number in all planes, processing the M selectable output links of the current sub-load balancing to obtain a current An effective output link of the secondary load balancing;
  • the n, M are positive integers;
  • the link number of the effective output link of the current current load balancing is M selectable links of the current secondary load balancing Masked in the mask table and determine the M-1 selectable output links for the next load balancing; until all link numbers in the selectable link number mask table are masked;
  • the masked link number in the selectable link number mask table is restored, and the next round of load balancing is performed; all cells of multiple routing planes can be uniformly allocated on the reachable link, and guaranteed.
  • the purpose of traffic balancing across the entire network improves bandwidth utilization and system performance.
  • FIG. 1 is a schematic diagram of a conventional multi-plane load balancing method
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for random load balancing according to the present invention
  • Embodiment 3 is a flowchart of Embodiment 2 of a method for random load balancing according to the present invention
  • FIG. 4 is a schematic structural diagram of a second-selector of a method for random load balancing according to an embodiment 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 a method for random load balancing according to the present invention
  • FIG. 6 is a schematic diagram of a load balancing cell flow direction in Embodiment 2 of a method for random load balancing according to the present invention
  • FIG. 7 is a schematic structural diagram of an apparatus for random load balancing according to the present invention.
  • Embodiment 1 of a method for random load balancing according to the present invention
  • the method for random load balancing provided by the embodiment of the present invention may include the following steps:
  • Step 201 In a round of load balancing, using the two selectors and a unique pseudo random number in all planes, the M selectable output links of the current secondary load balancing are processed to obtain a current The effective output link of the secondary load balancing; the n and M are positive integers.
  • the M selectable output links of the current secondary load balancing are performed in the current time and in a plane by using a second selector and a unique pseudo random number in all planes.
  • the packets of the level output link get a valid output link of the current secondary load balancing; where k is a positive integer.
  • a unique one of all planes in one round of load balancing is first generated according to a preset random function, and a selection signal is generated according to the pseudo random number;
  • the pseudo random number is a binary number whose bit width is the number of the selection signals.
  • the number of routing planes in load balancing is a
  • the number of selection signals required for load balancing in each routing plane is b.
  • first A unique pseudo-random number Y in the period is generated according to the 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.
  • the K selectable output links of the current sub-load balancing are subjected to k-level phase by using a two-select selector and a selection signal generated based on a unique pseudo-random number in all planes.
  • the two-two packets of the adjacent output link get a valid output link of the current secondary load balancing.
  • the k-th output link is grouped according to the parity of the k-th output link number m, specifically :
  • a k-level phase is performed on the M selectable output links of the current sub-load balancing by using a two-select selector and a selection signal generated according to a unique pseudo-random number in all planes.
  • two selectable output links corresponding to the two input ends of the two-selection selector are selected according to the signal bits corresponding to the selection signal, and the selection process thereof for:
  • the predetermined rule is determined according to the signal bit corresponding to the selection signal.
  • a selectable output link corresponding to the output end specifically: when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the first input end of the second selection selector is determined as an output a selectable output link corresponding to the end; or, when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the second input end of the second selector is determined as the output end Corresponding to an optional output link.
  • Step 202 Shield the link number of the valid output link of the current current load balancing in the M selectable link number mask tables of the current secondary load balancing, and determine the next load. Equalized M-1 selectable output links; until all link numbers in the selectable link number mask table are masked.
  • the link number of the valid output link is masked in the M selectable link number mask table of the current secondary load balancing, unmasked
  • the link will act as the M-1 actually selectable output links for the next load balancing; until all link numbers in the selectable link number mask table are masked, a round of load balancing is completed.
  • Step 203 Restore the blocked link number in the selectable link number mask table, and perform the next round of load balancing.
  • the random load balancing method selects M of the current sub-load balancing by using a two-selection selector and a unique pseudo-random number in all planes in one round of load balancing.
  • the output link is processed to obtain a valid output link of the current secondary load balancing; the n and M are positive integers; the link number of the effective output link of the current current load balancing is in the current time Shielding of load-balanced M selectable link number mask tables and determining M-1 selectable output links for next load balancing; until all of the selectable link number mask tables
  • the link number is masked; the shielded link number in the selectable link number mask table is restored, and the next round of load balancing is performed; using a two-choice selector and a load balancing mask
  • All the cells of multiple routing planes can be evenly distributed on the reachable links to ensure the traffic balance of the entire network.
  • the bandwidth utilization and system performance can be improved and can be used in various modes. Net knot
  • Embodiment 3 is a flowchart of Embodiment 2 of a method for random load balancing according to the present invention; this embodiment is described by taking a processing manner of a routing plane of a 96 ⁇ 96 switching device as an example, and the switching device includes four Routing plane: plane 0, plane 1, plane 2 and plane 3; the selection signal (select signal) of the two selectors used by the four routing planes is generated by the same random function generator, and the selectable output link is 96.
  • the method for random load balancing provided by the embodiment of the present invention may include the following steps:
  • Step 301 The 96 selectable output links are grouped into two groups and divided into 48 groups. After the first level selection, 48 output links are generated.
  • the 96 selectable output links are grouped into two groups of adjacent links, which can be divided into 48 groups in total; after the 48 sets of selectable output links are selected by the first choice of 48 two-selectors, Get 48 output links.
  • the selector of two options includes two input terminals, one selection signal terminal, and one output terminal;
  • the inputs of the selected selector are link a and link b, respectively, and one of link a and link b is selected as the output link according to link a, link b and selection signal; specifically, when the link When a is valid and link b is invalid, link a is selected as the output link; when link a is invalid and link b is valid, link b is selected as the output link; when link a and link b are both When valid, the corresponding bit of the selection signal (select signal) is used to select link a or link b as an output link; for example, it may be preset to select a link when the corresponding bit of the selection signal (select signal) is 1.
  • a is used as an output link; or, it may be preset that the link b is selected as an
  • Step 302 The generated 48 output links are grouped into two groups and divided into 24 groups. After the second level is selected, 24 output links are generated.
  • the two output links of the adjacent output links are continued for the 48 output links, and the total can be divided into 24 groups, and then The 24 sets of output links use 24 two-select selectors for second-level selection, resulting in 24 output links.
  • Step 303 The generated 24 output links are grouped into two groups, and are divided into 12 groups. After the third level is selected, 12 output links are generated.
  • the 24 output links After two stages of selection of 96 selectable output links, after generating 24 output links, the 24 output links continue to be grouped into two groups of adjacent output links, divided into 12 groups, and then 12 groups The output link uses 12 two-select selectors for third-level selection, resulting in 12 output links.
  • Step 304 The generated 12 output links are grouped into two groups, and are divided into six groups. After the fourth level is selected, six output links are generated.
  • Step 305 The generated 6 output links are grouped into two groups, and are divided into three groups. After the fifth level is selected, three output links are generated.
  • the two output links After four selections of 96 selectable output links are generated, after six output links are generated, the two output links continue to be grouped into two groups of adjacent output links, and are divided into three groups, and then 3 The group output link uses three alternative selectors for the fifth level selection, resulting in three output links.
  • Step 306 Divide the generated three output links into two groups and one group, and perform a sixth level selection on the output chains of the two groups to generate one output link and one output remaining. link.
  • the first and second output links or the second and third output links of the three output links are divided. For the first group, the remaining one output link is the second group; then, the two output links of the first group are selected by the second selection selector for the sixth level, and one output link is generated. At the same time, there is one output link remaining.
  • Step 307 Performing a seventh-level selection of one output link generated by the sixth stage and one remaining output link of the fifth stage to obtain an effective output link.
  • the output link is the final payload balanced link.
  • Step 308 Shield the obtained link number of a valid output link in the link number mask table of the 96 selectable output links to generate a selectable output link for the next load balancing.
  • the link number of the load balancing link is masked in the link number mask table of the 96 selectable output links. , produces a selectable output link for the next load balancing.
  • the location corresponding to the payload equalization link may be 1 and fed back to the load balancing input end, and the link number is in 96 selectable link number masks. Shielded in the table to obtain the next output loadable selectable output link, so that the next blocked load will not be selected.
  • 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 a method for random load balancing according to the present invention; as shown in FIG. 5, 96 selectable output links are performed by using a selective selector. Two-two packets and selection of seven adjacent output links, and finally an output link is generated as a payload equalization link; and a corresponding mask is fed back to the input of the load balancing, and the payload is balanced. The link number is masked in the link number mask table of the 96 selectable output links, resulting in a selectable output link for the next load balancing.
  • each routing plane in the switching device is identical; that is, steps 301 to 308 are performed on plane 0, plane 1, plane 2, and plane 3, and each of the active load balancing links is synchronously generated. , the output link to the switching device.
  • a Y is generated, and the bit width is the number of selection signals (select signals), that is, 4 ⁇ 95.
  • preset random function can be set according to actual needs, which is not limited herein.
  • FIG. 6 is a schematic diagram of a load balancing cell flow direction in Embodiment 2 of a method for random load balancing according to the present invention; as shown in FIG. 6, after a load balancing is performed on a total of 96 selectable output links from 0 to 95, a plane is used.
  • the output link generated by 0 is the link 0
  • the output link generated by plane 1 is the link 1
  • the output link generated by plane 2 is the link 2
  • the output link generated by plane 3 is the link 3. That is, four planes can be load balanced to different links respectively, avoiding multi-plane resonance.
  • Step 309 Determine whether all link numbers in the selectable link number mask table are blocked.
  • Step 310 is performed. If all the link numbers in the selectable link number mask table are blocked, step 311 is performed.
  • Step 310 Perform the next load balancing.
  • Step 311 Restore the blocked link number in the selectable link number mask table, and perform the next round of load balancing.
  • the next load balancing is generated according to the mask table of the load balancing link and the selectable output link.
  • the output link can be selected, that is, the link number of the generated payload equalization link is shielded in the currently selectable link number mask table, which can avoid the same round of load balancing twice randomly to the same link;
  • the random selection signal select signal
  • the random load balancing method performs two-two grouping on 96 selectable output links, and after the first-stage selection, generates 48 output links; 48 output links to be generated are performed. Two or two groups, after the second level selection, generate 24 output links; the generated 24 output links are grouped into two groups, and after the third level is selected, 12 output links are generated; 12 will be generated.
  • the output link performs two-two grouping, and after the fourth-stage selection, six output links are generated; the six output links that are generated are grouped into two groups, and after the fifth-level selection, three output links are generated;
  • the generated three output links are divided into two groups and one group, and the second level of the output links of the two groups is selected to generate one output link and one output link remaining;
  • the first output link generated by the sixth stage and the remaining one output link of the fifth stage are subjected to the seventh level selection to obtain an effective output link; the link number of the obtained effective output link is 96.
  • FIG. 7 is a schematic structural diagram of an apparatus for random load balancing according to the present invention.
  • the random load balancing apparatus 07 provided by the embodiment of the present invention includes: a processing module 71, a determining module 72, and a restoring module 73;
  • the processing module 71 is configured to perform the current sub-load balanced M selectable output links by using a second-selector and a unique pseudo-random number in all planes in one round of load balancing. Processing, obtaining a valid output link of the current secondary load balancing; the n and M are positive integers;
  • the determining module 72 is configured to block the link number of the valid output link of the current current load balancing in the M selectable link number mask tables of the current secondary load balancing, and determine M-1 selectable output links that are load balanced at a time; until all link numbers in the selectable link number mask table are masked;
  • the restoration module 73 is configured to restore the blocked link number in the selectable link number mask table for the next round of load balancing.
  • the processing module 71 is configured to: in the current time and in a plane, use a second selector and a unique pseudo random number in all planes, and the M is used.
  • the selectable output links are grouped into k-level output links to obtain the effective output link of the current current load balancing; the k is a positive integer.
  • the processing module 71 is further configured to: in the current time and in a plane, use a second selector and a unique pseudo random number in all planes, M selectable output links for two-two packets of k-level adjacent output links;
  • the m output links of the kth stage are grouped into two groups of adjacent output links, and the selectors of the second selection and the unique ones in all planes are utilized.
  • the m-1 output links of the kth stage are grouped into two groups of adjacent output links, and the selectors are selected and the planes are used in all planes.
  • the processing module 71 is further configured to generate a selection signal according to the unique one of the pseudo-random numbers in all planes; the only one of the all planes is a binary number The bit width of the only one of the pseudo-random numbers in all the planes is the number of the selection signals;
  • the processing module 71 is further configured to: if only one of the two selectable output links corresponding to the two input ends of the two-selection selector is valid, Using the valid output link as a selectable output link corresponding to the output;
  • the processing module 71 is further configured to: when the signal bit corresponding to the selection signal is 1, select a corresponding one of the first input ends of the second selection selector The output link is determined as a selectable output link corresponding to the output end; or, when the signal bit corresponding to the selection signal is 1, the second input end of the second selector is selected Corresponding selectable output links are determined to be an alternative to the output Output link.
  • the device 07 further includes: a generating module 74;
  • the generating module 74 is configured to generate a unique one of all planes in one round of load balancing according to a preset random function.
  • the device of the random load balancing in this embodiment may be used to perform the technical solution of the foregoing method embodiment, and the implementation principle and the technical effect are similar, and details are not described herein again.
  • the processing module 71, the determining module 72, the restoring module 73, and the generating module 74 of the stochastic load balancing device 07 may each be a central processing unit (CPU) located in the random load balancing device 07. ), a microprocessor (Micro Processor Unit, MPU), a digital signal processor (DSP), or a Field Programmable Gate Array (FPGA).
  • CPU central processing unit
  • MPU Micro Processor Unit
  • DSP digital signal processor
  • FPGA Field Programmable Gate Array
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the M selectable output links of the current sub-load balancing are processed by using a two-selection selector and a unique pseudo-random number in all planes in one round of load balancing.

Landscapes

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

Abstract

Disclosed in the embodiments of the present invention is a random load balancing method, comprising: during a round of n load balances, using a two-in-one selector and a unique pseudo-random number on all the planes to process M selectable output links of the current load balance in order to obtain an effective output link of the current load balance; n and M are positive integers; masking the link number of the effective output link of the current load balancing in a mask code table of the M selectable link numbers of the current load balance, and determining M-1 selectable output links of the next load balance; continuing until all of the link numbers in the selectable link mask code table are masked; restoring the masked link numbers in the selectable link mask code table, and performing the next round of load balancing. Also disclosed in the embodiments of the present invention are a random load balancing apparatus and a computer storage medium.

Description

随机负载均衡的方法及装置、计算机存储介质Random load balancing method and device, computer storage medium
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201611215878.2、申请日为2016年12月26日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is filed on the basis of the Chinese Patent Application No. PCT Application No.
技术领域Technical field
本发明涉及大容量数据交换领域,尤其涉及一种随机负载均衡的方法及装置、计算机存储介质。The present invention relates to the field of large-capacity data exchange, and in particular, to a method and apparatus for random load balancing, and a computer storage medium.
背景技术Background technique
在交换系统中,交换网络实现了交换接入装置之间的数据交换。随着应用的发展,交换芯片的组网变复杂,容量变大,Serdes链路数也随之增多,出现了例如128×128,168×168,192×192,256×256等大容量交换芯片;为了满足芯片主频的要求,交换芯片都做成多平面的形式。In a switching system, the switching network implements data exchange between switching access devices. With the development of the application, the networking of the switching chip becomes complicated, the capacity becomes larger, and the number of Serdes links also increases, and large-capacity switching chips such as 128×128, 168×168, 192×192, 256×256 appear. In order to meet the requirements of the chip's main frequency, the switch chip is made in a multi-plane form.
在多级交换中,每个交换设备有多个路由平面,在进行数据交换时,不同平面需要同时做负载均衡;数据在交换系统中以信元为单位进行传输,同一个交换装置的不同输入链路接收发往不同接入装置的信元;若多条输出链路均可到达目的接入装置,按照传统的负载均衡方式,图1为传统多平面的负载均衡方法示意图,如图1所示,假设交换芯片的链路数为96×96,平面0、平面1、平面2、平面3均可以通过0~23号链路到达接入装置,4个平面同时做负载均衡时,产生的输出链路均为0;那么,发往接入装置的信元全部送往0号链路,导致链路0堵塞,1~23号链路带宽浪费;这样就会导致多平面共振,无法保证多个路由平面的信元均衡的分配在所有可 以到达的链路上,使到达某个装置的数据流一直在一条或某几条链路中传输,从而导致信元在某个交换装置的拥堵,使交换能力下降,同时导致了数据流的局部拥塞和带宽的浪费。In multi-level switching, each switching device has multiple routing planes. When data exchange is performed, different planes need to perform load balancing at the same time; data is transmitted in units of cells in the switching system, and different inputs of the same switching device. The link receives the cells sent to different access devices; if multiple output links can reach the destination access device, according to the traditional load balancing mode, FIG. 1 is a schematic diagram of a conventional multi-plane load balancing method, as shown in FIG. It is assumed that the number of links of the switch chip is 96×96, and plane 0, plane 1, plane 2, and plane 3 can all reach the access device through links 0 to 23, and the four planes simultaneously perform load balancing. The output link is 0. Then, all the cells sent to the access device are sent to link 0, causing link 0 to be blocked, and the link bandwidth of 1 to 23 is wasted; this will lead to multi-plane resonance and cannot be guaranteed. Cell equalization of multiple routing planes is available at all On the arriving link, the data stream arriving at a certain device is always transmitted in one or several links, thereby causing the cell to be congested in a switching device, causing the switching capability to decrease, and at the same time causing the data stream. Local congestion and waste of bandwidth.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种随机负载均衡的方法及装置、计算机存储介质,以实现多个路由平面的所有信元都能均衡的分配在可以到达的链路上、保证整个网络的流量均衡的目的,提高带宽的利用率和系统的性能。In view of this, embodiments of the present invention are directed to a method and apparatus for random load balancing, and a computer storage medium, so that all cells of multiple routing planes can be uniformly allocated on reachable links to ensure the entire network. The purpose of traffic balancing is to improve bandwidth utilization and system performance.
为达到上述目的,本发明的技术方案是这样实现的:In order to achieve the above object, the technical solution of the present invention is achieved as follows:
本发明实施例提供一种随机负载均衡的方法,所述方法包括:An embodiment of the present invention provides a method for random load balancing, where the method includes:
在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数;In a round of n-time load balancing, the M-selectable output links of the current sub-load balancing are processed by using a two-choice selector and a unique pseudo-random number in all planes to obtain a current sub-load balancing. Effective output link; the n, M are positive integers;
将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下一次负载均衡的M-1个可选择的输出链路;The link number of the valid output link of the current current load balancing is masked in the M selectable link number mask tables of the current secondary load balancing, and the M-1 of the next load balancing is determined. Selectable output link;
直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止;Until all link numbers in the selectable link number mask table are masked;
将所述可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡。The masked link number in the selectable link number mask table is restored for the next round of load balancing.
上述方案中,所述利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路,包括:In the above solution, the M selectable output links of the current sub-load balancing are processed by using a second-selector and a unique pseudo-random number in all planes to obtain an effective output of the current sub-load balancing. Links, including:
在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级输出链路的分组,得到所述一个当前次负载均衡的有效输出链路;所述k为正整数。 Performing k-level output link grouping on the M selectable output links in the current time and in a plane by using a second-selector and a unique one of the pseudo-random numbers in all planes Describe a valid output link for current secondary load balancing; the k is a positive integer.
上述方案中,所述在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级输出链路的分组,得到所述一个当前次负载均衡的有效输出链路,包括:In the above solution, the k-level output chain is performed on the M selectable output links by using a second-selector and a unique pseudo-random number in all planes in the current time and a plane. The grouping of the roads obtains the effective output link of the current current load balancing, including:
在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级相邻输出链路的两两分组;Performing, in the current time and in a plane, two pairs of k-level adjacent output links for the M selectable output links by using a two-select selector and a unique one of the pseudo-random numbers in all planes Grouping
若第k级的输出链路数m为偶数,则将第k级的m个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的m/2个输出链路,直到所述m/2=1为止,得到所述m/2=1所对应的一个有效输出链路;所述m小于等于M;If the number m of the output links of the kth stage is an even number, the m output links of the kth stage are grouped into two groups of adjacent output links, and the selectors of the second selection and the unique ones in all planes are utilized. a pseudo-random number obtains m/2 output links of the k+1th level until the m/2=1, obtaining an effective output link corresponding to the m/2=1; the m is smaller than Equal to M;
若第k级的输出链路数m为奇数,则将第k级的m-1个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的(m-1)/2个输出链路及第k级剩余的1个输出链路,直到所述m=3为止,得到(m-1)/2+1=2个输出链路,利用二选一选择器及在一次随机负载中的唯一一个伪随机数在所述(m-1)/2+1=2个输出链路中确定出对应的一个有效输出链路;所述m小于等于M。If the number m of output links of the kth stage is an odd number, the m-1 output links of the kth stage are grouped into two groups of adjacent output links, and the selectors are selected and the planes are used in all planes. The only one pseudo-random number obtains (m-1)/2 output links of the k+1th stage and the remaining 1 output link of the kth stage until the m=3, and (m-1) /2+1=2 output links, which are determined in the (m-1)/2+1=2 output links by using a binary selector and a unique pseudo random number in a random load Corresponding one effective output link; the m is less than or equal to M.
上述方案中,所述利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,包括:In the above solution, the M-selectable output link of the current sub-load balancing is processed by using a second-selector and a unique pseudo-random number in all planes, including:
根据所述在所有平面中的唯一一个伪随机数产生选择信号;所述所有平面中的唯一一个伪随机数为二进制数,所述所有平面中的唯一一个伪随机数的位宽为所述选择信号的个数;Generating a selection signal according to the unique one of the pseudo-random numbers in all planes; the only one of the all planes is a binary number, and the bit width of the only one of the all planes is the selection The number of signals;
根据所述选择信号所对应的信号位对所述二选一选择器的两个输入端所对应的两个可选择的输出链路进行选择,得到一个输出端所对应的一个可选择的输出链路。Selecting two selectable output links corresponding to the two inputs of the two selectors according to the signal bits corresponding to the selection signal, to obtain a selectable output chain corresponding to one output road.
上述方案中,所述根据所述选择信号所对应的信号位对所述二选一选 择器的两个输入端所对应的两个可选择的输出链路进行选择,得到一个输出端所对应的一个可选择的输出链路,包括:In the above solution, the signal bit corresponding to the selection signal is selected for the second selection The two selectable output links corresponding to the two inputs of the selector are selected to obtain a selectable output link corresponding to one output, including:
若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中只有一个有效时,则将所述有效的输出链路作为所述输出端所对应的一个可选择的输出链路;If only one of the two selectable output links corresponding to the two inputs of the two-select selector is valid, then the valid output link is selected as one of the outputs Output link;
若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中两个都有效或两个都无效时,则根据所述选择信号所对应的信号位的预设规则确定所述输出端所对应的一个可选择的输出链路。If two of the two selectable output links corresponding to the two inputs of the two selectors are valid or both are invalid, then according to the preset of the signal bits corresponding to the selection signal The rule determines a selectable output link corresponding to the output.
上述方案中,所述根据所述选择信号所对应的信号位的预设规则确定所述输出端所对应的一个可选择的输出链路,包括:In the above solution, the determining, according to a preset rule of the signal bit corresponding to the selection signal, a selectable output link corresponding to the output end, including:
所述选择信号所对应的信号位为1时,将所述二选一选择器的第一输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路;或,所述选择信号所对应的信号位为1时,将所述二选一选择器的第二输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路。When the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the first input end of the second selection selector is determined as a selectable output chain corresponding to the output end. Or; when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the second input end of the second selection selector is determined as one corresponding to the output end; Selected output link.
上述方案中,所述方法还包括:In the above solution, the method further includes:
根据预设随机函数产生在一轮负载均衡中的所有平面中的唯一一个伪随机数。A unique one of all planes in one round of load balancing is generated according to a preset random function.
本发明实施例提供一种随机负载均衡的装置,所述装置包括:An embodiment of the present invention provides a device for random load balancing, where the device includes:
处理模块,配置为在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数;The processing module is configured to process the M selectable output links of the current sub-load balancing by using a second-selector and a unique pseudo-random number in all planes in one round of load balancing. An effective output link of the current secondary load balancing; the n and M are positive integers;
确定模块,配置为将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下 一次负载均衡的M-1个可选择的输出链路;直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止;a determining module configured to block the link number of the valid output link of the current current load balancing in the M selectable link number mask tables of the current secondary load balancing, and determine M-1 selectable output links that are load balanced at a time; until all link numbers in the selectable link number mask table are masked;
还原模块,配置为将所述可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡。The restoration module is configured to restore the blocked link number in the selectable link number mask table for the next round of load balancing.
上述方案中,所述处理模块,具体配置为在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级输出链路的分组,得到所述一个当前次负载均衡的有效输出链路;所述k为正整数。In the above solution, the processing module is specifically configured to use the two selectors and a unique pseudo random number in all planes in the current time and a plane to the M selectable output chains. The path performs a packet of the k-level output link to obtain the effective output link of the current current load balancing; the k is a positive integer.
上述方案中,所述处理模块,还具体配置为在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级相邻输出链路的两两分组;In the above solution, the processing module is further configured to: in the current time and in a plane, use the two selectors and a unique pseudo random number in all planes to select the M outputs. The link performs two-two packets of k-level adjacent output links;
若第k级的输出链路数m为偶数,则将第k级的m个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的m/2个输出链路,直到所述m/2=1为止,得到所述m/2=1所对应的一个有效输出链路;所述m小于等于M;If the number m of the output links of the kth stage is an even number, the m output links of the kth stage are grouped into two groups of adjacent output links, and the selectors of the second selection and the unique ones in all planes are utilized. a pseudo-random number obtains m/2 output links of the k+1th level until the m/2=1, obtaining an effective output link corresponding to the m/2=1; the m is smaller than Equal to M;
若第k级的输出链路数m为奇数,则将第k级的m-1个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的(m-1)/2个输出链路及第k级剩余的1个输出链路,直到所述m=3为止,得到(m-1)/2+1=2个输出链路,利用二选一选择器及在一次随机负载中的唯一一个伪随机数在所述(m-1)/2+1=2个输出链路中确定出对应的一个有效输出链路;所述m小于等于M。If the number m of output links of the kth stage is an odd number, the m-1 output links of the kth stage are grouped into two groups of adjacent output links, and the selectors are selected and the planes are used in all planes. The only one pseudo-random number obtains (m-1)/2 output links of the k+1th stage and the remaining 1 output link of the kth stage until the m=3, and (m-1) /2+1=2 output links, which are determined in the (m-1)/2+1=2 output links by using a binary selector and a unique pseudo random number in a random load Corresponding one effective output link; the m is less than or equal to M.
上述方案中,所述处理模块,还具体配置为根据所述在所有平面中的唯一一个伪随机数产生选择信号;所述所有平面中的唯一一个伪随机数为二进制数,所述所有平面中的唯一一个伪随机数的位宽为所述选择信号的个数; In the above solution, the processing module is further configured to generate a selection signal according to the unique one of the pseudo-random numbers in all planes; the only one of the all planes is a binary number, in all planes The bit width of the unique pseudo random number is the number of the selection signals;
根据所述选择信号所对应的信号位对所述二选一选择器的两个输入端所对应的两个可选择的输出链路进行选择,得到一个输出端所对应的一个可选择的输出链路。Selecting two selectable output links corresponding to the two inputs of the two selectors according to the signal bits corresponding to the selection signal, to obtain a selectable output chain corresponding to one output road.
上述方案中,所述处理模块,还具体配置为若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中只有一个有效时,则将所述有效的输出链路作为所述输出端所对应的一个可选择的输出链路;In the above solution, the processing module is further configured to: if only one of the two selectable output links corresponding to the two inputs of the two-selector is valid, the effective output is The link serves as a selectable output link corresponding to the output;
若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中两个都有效或两个都无效时,则根据所述选择信号所对应的信号位的预设规则确定所述输出端所对应的一个可选择的输出链路。If two of the two selectable output links corresponding to the two inputs of the two selectors are valid or both are invalid, then according to the preset of the signal bits corresponding to the selection signal The rule determines a selectable output link corresponding to the output.
上述方案中,所述处理模块,还具体配置为所述选择信号所对应的信号位为1时,将所述二选一选择器的第一输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路;或,所述选择信号所对应的信号位为1时,将所述二选一选择器的第二输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路。In the above solution, the processing module is further configured to: when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the first input end of the second selection selector is determined as a selectable output link corresponding to the output; or, when the signal bit corresponding to the selection signal is 1, the selectable output corresponding to the second input of the second selector The link is determined to be a selectable output link corresponding to the output.
上述方案中,所述装置还包括:In the above solution, the device further includes:
产生模块,配置为根据预设随机函数产生在一轮负载均衡中的所有平面中的唯一一个伪随机数。A generating module is configured to generate a unique one of all planes in one round of load balancing according to a preset random function.
所述处理模块、所述确定模块、所述还原模块、所述产生模块在执行处理时,可以采用中央处理器(CPU,Central Processing Unit)、数字信号处理器(DSP,Digital Singnal Processor)或可编程逻辑阵列(FPGA,Field-Programmable Gate Array)实现。The processing module, the determining module, the restoring module, and the generating module may use a central processing unit (CPU), a digital signal processor (DSP, Digital Singnal Processor), or Field-Programmable Gate Array (FPGA) implementation.
本发明实施例还提供一种计算机存储介质,其中存储有计算机可执行指令,该计算机可执行指令配置执行上述方案中任一项所述的随机负载均衡的方法。The embodiment of the present invention further provides a computer storage medium storing computer executable instructions configured to perform the method of random load balancing according to any one of the foregoing aspects.
本发明实施例所提供的一种随机负载均衡的方法及装置、计算机存储 介质,通过在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数;将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下一次负载均衡的M-1个可选择的输出链路;直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止;将所述可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡;实现了多个路由平面的所有信元都能均衡的分配在可以到达的链路上、保证整个网络的流量均衡的目的,提高了带宽的利用率和系统的性能。Method and device for random load balancing provided by embodiment of the present invention, and computer storage The medium, through a round of n load balancing, using a two-selection selector and a unique pseudo-random number in all planes, processing the M selectable output links of the current sub-load balancing to obtain a current An effective output link of the secondary load balancing; the n, M are positive integers; the link number of the effective output link of the current current load balancing is M selectable links of the current secondary load balancing Masked in the mask table and determine the M-1 selectable output links for the next load balancing; until all link numbers in the selectable link number mask table are masked; The masked link number in the selectable link number mask table is restored, and the next round of load balancing is performed; all cells of multiple routing planes can be uniformly allocated on the reachable link, and guaranteed. The purpose of traffic balancing across the entire network improves bandwidth utilization and system performance.
附图说明DRAWINGS
图1为传统多平面的负载均衡方法示意图;1 is a schematic diagram of a conventional multi-plane load balancing method;
图2为本发明随机负载均衡的方法实施例一的流程图;2 is a flowchart of Embodiment 1 of a method for random load balancing according to the present invention;
图3为本发明随机负载均衡的方法实施例二的流程图;3 is a flowchart of Embodiment 2 of a method for random load balancing according to the present invention;
图4为本发明随机负载均衡的方法实施例的二选一选择器的结构示意图;4 is a schematic structural diagram of a second-selector of a method for random load balancing according to an embodiment of the present invention;
图5为本发明随机负载均衡的方法实施例的96×96交换装置的路由平面的随机负载均衡结构示意图;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 a method for random load balancing according to the present invention;
图6为使用本发明随机负载均衡的方法实施例二的负载均衡信元流向示意图;6 is a schematic diagram of a load balancing cell flow direction in Embodiment 2 of a method for random load balancing according to the present invention;
图7为本发明随机负载均衡的装置实施例的结构示意图。FIG. 7 is a schematic structural diagram of an apparatus for random load balancing according to the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described in the following with reference to the accompanying drawings.
实施例一 Embodiment 1
图2为本发明随机负载均衡的方法实施例一的流程图;如图2所示,本发明实施例提供的随机负载均衡的方法可以包括如下步骤:2 is a flowchart of Embodiment 1 of a method for random load balancing according to the present invention; as shown in FIG. 2, the method for random load balancing provided by the embodiment of the present invention may include the following steps:
步骤201:在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数。Step 201: In a round of load balancing, using the two selectors and a unique pseudo random number in all planes, the M selectable output links of the current secondary load balancing are processed to obtain a current The effective output link of the secondary load balancing; the n and M are positive integers.
在一轮n次负载均衡中,在当前次及一个平面中利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行k级输出链路的分组,得到一个当前次负载均衡的有效输出链路;其中,k为正整数。In a round of n load balancing, the M selectable output links of the current secondary load balancing are performed in the current time and in a plane by using a second selector and a unique pseudo random number in all planes. The packets of the level output link get a valid output link of the current secondary load balancing; where k is a positive integer.
具体的,在一轮n次负载均衡中,首先根据预设随机函数产生在一轮负载均衡中的所有平面中的唯一一个伪随机数,并根据该伪随机数产生选择信号;其中,所述伪随机数为二进制数,其位宽为所述选择信号的个数。Specifically, in a round of load balancing, a unique one of all planes in one round of load balancing is first generated according to a preset random function, and a selection signal is generated according to the pseudo random number; The pseudo random number is a binary number whose bit width is the number of the selection signals.
例如,负载均衡中的路由平面的个数为a,每个路由平面进行一次负载均衡所需要的选择信号的个数为b,则在a个路由平面均进行一次负载均衡的一个周期内,首先根据预设随机函数f(x)产生该周期内的唯一一个伪随机数Y,并根据Y产生a*b个选择信号,其中,伪随机数Y的位宽为a*b。For example, the number of routing planes in load balancing is a, and the number of selection signals required for load balancing in each routing plane is b. In a cycle in which load balancing is performed on a routing plane, first A unique pseudo-random number Y in the period is generated according to the 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.
然后,在当前次及一个平面中,利用二选一选择器及根据在所有平面中的唯一一个伪随机数产生的选择信号对当前次负载均衡的M个可选择的输出链路进行k级相邻输出链路的两两分组,得到一个当前次负载均衡的有效输出链路。Then, in the current time and in a plane, the K selectable output links of the current sub-load balancing are subjected to k-level phase by using a two-select selector and a selection signal generated based on a unique pseudo-random number in all planes. The two-two packets of the adjacent output link get a valid output link of the current secondary load balancing.
本发明实施例一实施方式中,在当前次负载均衡中,对一个路由平面进行负载均衡时,对于第k级输出链路,根据第k级输出链路数m的奇偶性进行分组,具体为:In the first embodiment of the present invention, in the current secondary load balancing, when load balancing is performed on one routing plane, the k-th output link is grouped according to the parity of the k-th output link number m, specifically :
若m为偶数,则将第k级的m个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1 级的m/2个输出链路,直到所述m/2=1为止,得到m/2=1所对应的一个有效输出链路;其中,所述m小于等于M;If m is an even number, the m output links of the kth stage are paired into two groups of adjacent output links, and the k+ is obtained by using a second selector and a unique pseudo random number in all planes. 1 Level m/2 output links until the m/2=1, obtaining an effective output link corresponding to m/2=1; wherein the m is less than or equal to M;
若m为奇数,则将第k级的m-1个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的(m-1)/2个输出链路及第k级剩余的1个输出链路,直到m=3为止,得到(m-1)/2+1=2个输出链路,利用二选一选择器及在一次随机负载中的唯一一个伪随机数在(m-1)/2+1=2个输出链路中确定出对应的一个有效输出链路;其中,所述m小于等于M。If m is an odd number, the m-1 output links of the kth stage are paired into two groups of adjacent output links, and the second selection selector and the unique pseudo random number in all planes are used to obtain the second (m-1)/2 output links of k+1 level and one output link of the kth stage until m=3, obtaining (m-1)/2+1=2 output links Determining a corresponding one of the effective output links in the (m-1)/2+1=2 output links by using a binary selector and a unique pseudo random number in a random load; wherein m is less than or equal to M.
本发明实施例一实施方式中,在利用二选一选择器及根据在所有平面中的唯一一个伪随机数产生的选择信号对当前次负载均衡的M个可选择的输出链路进行k级相邻输出链路的两两分组时,根据所述选择信号所对应的信号位对所述二选一选择器的两个输入端所对应的两个可选择的输出链路进行选择,其选择过程为:In an embodiment of the present invention, a k-level phase is performed on the M selectable output links of the current sub-load balancing by using a two-select selector and a selection signal generated according to a unique pseudo-random number in all planes. When two or two packets of the output link are adjacent to each other, two selectable output links corresponding to the two input ends of the two-selection selector are selected according to the signal bits corresponding to the selection signal, and the selection process thereof for:
若二选一选择器的两个输入端所对应的两个可选择的输出链路中只有一个有效时,则将有效的输出链路作为所述输出端所对应的一个可选择的输出链路;If only one of the two selectable output links corresponding to the two inputs of the two selectors is active, then the valid output link is used as a selectable output link corresponding to the output. ;
若二选一选择器的两个输入端所对应的两个可选择的输出链路中两个都有效或两个都无效时,则根据选择信号所对应的信号位的预设规则确定所述输出端所对应的一个可选择的输出链路;具体为:选择信号所对应的信号位为1时,将二选一选择器的第一输入端所对应的可选择的输出链路确定为输出端所对应的一个可选择的输出链路;或,选择信号所对应的信号位为1时,将二选一选择器的第二输入端所对应的可选择的输出链路确定为输出端所对应的一个可选择的输出链路。If two of the two selectable output links corresponding to the two inputs of the two selectors are valid or both are invalid, then the predetermined rule is determined according to the signal bit corresponding to the selection signal. A selectable output link corresponding to the output end; specifically: when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the first input end of the second selection selector is determined as an output a selectable output link corresponding to the end; or, when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the second input end of the second selector is determined as the output end Corresponding to an optional output link.
步骤202:将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下一次负载 均衡的M-1个可选择的输出链路;直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止。Step 202: Shield the link number of the valid output link of the current current load balancing in the M selectable link number mask tables of the current secondary load balancing, and determine the next load. Equalized M-1 selectable output links; until all link numbers in the selectable link number mask table are masked.
在得到一个当前次负载均衡的有效输出链路之后,将该有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,未被屏蔽的链路将作为下一次负载均衡的M-1个实际可选择的输出链路;直到可选择的链路号掩码表中的所有链路号都被屏蔽为止,完成一轮负载均衡。After obtaining a valid output link of the current secondary load balancing, the link number of the valid output link is masked in the M selectable link number mask table of the current secondary load balancing, unmasked The link will act as the M-1 actually selectable output links for the next load balancing; until all link numbers in the selectable link number mask table are masked, a round of load balancing is completed.
步骤203:将所述可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡。Step 203: Restore the blocked link number in the selectable link number mask table, and perform the next round of load balancing.
在完成一轮负载均衡后,将所述可选择的链路号掩码表中被屏蔽的链路号还原,重新执行步骤201至步骤202,进行下一轮负载均衡。After completing one round of load balancing, the blocked link number in the selectable link number mask table is restored, and steps 201 to 202 are performed again to perform the next round of load balancing.
本发明实施例提供的随机负载均衡的方法,通过在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数;将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下一次负载均衡的M-1个可选择的输出链路;直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止;将所述可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡;利用二选一选择器和负载均衡掩码的方式实现了多个路由平面的所有信元都能均衡的分配在可以到达的链路上、保证整个网络的流量均衡的目的,提高了带宽的利用率和系统的性能,可以用于各种方式的组网结构。The random load balancing method provided by the embodiment of the present invention selects M of the current sub-load balancing by using a two-selection selector and a unique pseudo-random number in all planes in one round of load balancing. The output link is processed to obtain a valid output link of the current secondary load balancing; the n and M are positive integers; the link number of the effective output link of the current current load balancing is in the current time Shielding of load-balanced M selectable link number mask tables and determining M-1 selectable output links for next load balancing; until all of the selectable link number mask tables The link number is masked; the shielded link number in the selectable link number mask table is restored, and the next round of load balancing is performed; using a two-choice selector and a load balancing mask All the cells of multiple routing planes can be evenly distributed on the reachable links to ensure the traffic balance of the entire network. The bandwidth utilization and system performance can be improved and can be used in various modes. Net knot .
实施例二Embodiment 2
图3为本发明随机负载均衡的方法实施例二的流程图;本实施例以96×96交换装置的路由平面的处理方式为例进行说明,该交换装置包含4个 路由平面:平面0、平面1、平面2和平面3;4个路由平面所使用的二选一选择器的选择信号(select信号)通过同一个随机函数产生器产生,可选择的输出链路为96条;如图3所示,本发明实施例提供的随机负载均衡的方法可以包括如下步骤:3 is a flowchart of Embodiment 2 of a method for random load balancing according to the present invention; this embodiment is described by taking a processing manner of a routing plane of a 96×96 switching device as an example, and the switching device includes four Routing plane: plane 0, plane 1, plane 2 and plane 3; the selection signal (select signal) of the two selectors used by the four routing planes is generated by the same random function generator, and the selectable output link is 96. As shown in FIG. 3, the method for random load balancing provided by the embodiment of the present invention may include the following steps:
步骤301:将96条可选择的输出链路进行两两分组,分成48组,经过第一级选择后,产生48个输出链路。Step 301: The 96 selectable output links are grouped into two groups and divided into 48 groups. After the first level selection, 48 output links are generated.
将96条可选择的输出链路进行相邻链路的两两分组,总共可分成48组;对这48组可选择的输出链路利用48个二选一选择器进行第一级选择之后,得到48个输出链路。The 96 selectable output links are grouped into two groups of adjacent links, which can be divided into 48 groups in total; after the 48 sets of selectable output links are selected by the first choice of 48 two-selectors, Get 48 output links.
图4为本发明随机负载均衡的方法实施例的二选一选择器的结构示意图;如图4所示,二选一选择器包括两个输入端、一个选择信号端和一个输出端;假设二选一选择器的输入分别为链路a和链路b,根据链路a、链路b和选择信号选择链路a和链路b中的一个作为输出链路输出;具体的,当链路a有效而链路b无效时,则选择链路a作为输出链路;当链路a无效而链路b有效时,则选择链路b作为输出链路;当链路a和链路b都有效时,则利用选择信号(select信号)的对应位来选择链路a或链路b作为输出链路;例如,可以预先设定当选择信号(select信号)的对应位为1时选择链路a作为输出链路;或者,也可以预先设定当选择信号(select信号)的对应位为1时选择链路b作为输出链路。4 is a schematic structural diagram of a selector of a method for random load balancing according to an embodiment of the present invention; as shown in FIG. 4, the selector of two options includes two input terminals, one selection signal terminal, and one output terminal; The inputs of the selected selector are link a and link b, respectively, and one of link a and link b is selected as the output link according to link a, link b and selection signal; specifically, when the link When a is valid and link b is invalid, link a is selected as the output link; when link a is invalid and link b is valid, link b is selected as the output link; when link a and link b are both When valid, the corresponding bit of the selection signal (select signal) is used to select link a or link b as an output link; for example, it may be preset to select a link when the corresponding bit of the selection signal (select signal) is 1. a is used as an output link; or, it may be preset that the link b is selected as an output link when the corresponding bit of the selection signal (select signal) is 1.
步骤302:将产生的48个输出链路进行两两分组,分成24组,经过第二级选择后,产生24个输出链路。Step 302: The generated 48 output links are grouped into two groups and divided into 24 groups. After the second level is selected, 24 output links are generated.
对96条可选择的输出链路进行第一级选择,产生48个输出链路之后,对这48个输出链路继续进行相邻输出链路的两两分组,总共可分成24组,然后对这24组输出链路利用24个二选一选择器进行第二级选择,得到24个输出链路。 After the first stage selection is performed on the 96 selectable output links, after 48 output links are generated, the two output links of the adjacent output links are continued for the 48 output links, and the total can be divided into 24 groups, and then The 24 sets of output links use 24 two-select selectors for second-level selection, resulting in 24 output links.
步骤303:将产生的24个输出链路进行两两分组,分成12组,经过第三级选择后,产生12个输出链路。Step 303: The generated 24 output links are grouped into two groups, and are divided into 12 groups. After the third level is selected, 12 output links are generated.
对96条可选择的输出链路进行两级选择,产生24个输出链路之后,对这24个输出链路继续进行相邻输出链路的两两分组,分成12组,然后对这12组输出链路利用12个二选一选择器进行第三级选择,得到12个输出链路。After two stages of selection of 96 selectable output links, after generating 24 output links, the 24 output links continue to be grouped into two groups of adjacent output links, divided into 12 groups, and then 12 groups The output link uses 12 two-select selectors for third-level selection, resulting in 12 output links.
步骤304:将产生的12个输出链路进行两两分组,分成6组,经过第四级选择后,产生6个输出链路。Step 304: The generated 12 output links are grouped into two groups, and are divided into six groups. After the fourth level is selected, six output links are generated.
对96条可选择的输出链路进行三级选择,产生12个输出链路之后,对这12个输出链路继续进行相邻输出链路的两两分组,共分成6组,然后对这6组输出链路利用6个二选一选择器进行第四级选择,得到6个输出链路。Performing three levels of selection on 96 selectable output links, after generating 12 output links, continuing to perform two-two grouping of adjacent output links for the 12 output links, which are divided into 6 groups, and then 6 The group output link uses six alternative selectors for the fourth level selection, resulting in six output links.
步骤305:将产生的6个输出链路进行两两分组,分成3组,经过第五级选择后,产生3个输出链路。Step 305: The generated 6 output links are grouped into two groups, and are divided into three groups. After the fifth level is selected, three output links are generated.
对96条可选择的输出链路进行四级选择,产生6个输出链路之后,对这6个输出链路继续进行相邻输出链路的两两分组,共分成3组,然后对这3组输出链路利用3个二选一选择器进行第五级选择,得到3个输出链路。After four selections of 96 selectable output links are generated, after six output links are generated, the two output links continue to be grouped into two groups of adjacent output links, and are divided into three groups, and then 3 The group output link uses three alternative selectors for the fifth level selection, resulting in three output links.
步骤306:将产生的3个输出链路分为2个一组和1个一组,并对2个一组的输出链路进行第六级选择,产生1个输出链路并剩余1个输出链路。Step 306: Divide the generated three output links into two groups and one group, and perform a sixth level selection on the output chains of the two groups to generate one output link and one output remaining. link.
在对96条可选择的输出链路进行五级选择,产生3个输出链路之后,将这3个输出链路中的第1、2个输出链路或第2、3个输出链路分为第一组,剩下的一个输出链路为第二组;然后对第一组的2个输出链路利用1个二选一选择器进行第六级选择,产生出1个输出链路,同时剩余1个输出链路。 After performing five levels of selection on 96 selectable output links, and generating three output links, the first and second output links or the second and third output links of the three output links are divided. For the first group, the remaining one output link is the second group; then, the two output links of the first group are selected by the second selection selector for the sixth level, and one output link is generated. At the same time, there is one output link remaining.
步骤307:将第六级产生的1个输出链路和第五级剩余的1个输出链路进行第七级选择,得到一个有效输出链路。Step 307: Performing a seventh-level selection of one output link generated by the sixth stage and one remaining output link of the fifth stage to obtain an effective output link.
将第六级选择产生的1个输出链路和第五级剩余的1个输出链路作为一组,利用1个二选一选择器进行第七级选择,产生1个有效输出链路,该输出链路即为最终的一个有效负载均衡链路。Taking one output link generated by the sixth level selection and the remaining one output link of the fifth level as one group, using one of the two selectors for the seventh level selection, generating one effective output link, The output link is the final payload balanced link.
步骤308:将得到的一个有效输出链路的链路号在96个可选择输出链路的链路号掩码表中屏蔽,产生下一次负载均衡的可选择输出链路。Step 308: Shield the obtained link number of a valid output link in the link number mask table of the 96 selectable output links to generate a selectable output link for the next load balancing.
从96个可选择的输出链路中选择出最终的一个有效负载均衡链路之后,将该负载均衡链路的链路号在96个可选择输出链路的链路号掩码表中进行屏蔽,产生出下一次负载均衡的可选择输出链路。After selecting the last payload equalization link from the 96 selectable output links, the link number of the load balancing link is masked in the link number mask table of the 96 selectable output links. , produces a selectable output link for the next load balancing.
例如,在得到一个有效负载均衡链路之后,可以将该有效负载均衡链路对应的位置为1,并反馈回负载均衡输入端,将该链路号在96条可选择的链路号掩码表中屏蔽,获得下一次负载均衡的可选择输出链路,这样,在进行下一次负载均衡时,被屏蔽掉的链路号将不会被选择到。For example, after obtaining a payload equalization link, the location corresponding to the payload equalization link may be 1 and fed back to the load balancing input end, and the link number is in 96 selectable link number masks. Shielded in the table to obtain the next output loadable selectable output link, so that the next blocked load will not be selected.
图5为本发明随机负载均衡的方法实施例的96×96交换装置的路由平面的随机负载均衡结构示意图;如图5所示,利用二选一选择器对96条可选择的输出链路进行七级相邻输出链路的两两分组和选择,最终产生一条输出链路作为有效负载均衡链路;同时产生相对应的掩码反馈回负载均衡的输入端,将该有效负载均衡链路的链路号在96个可选择输出链路的链路号掩码表中屏蔽,得到下一次负载均衡的可选择输出链路。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 a method for random load balancing according to the present invention; as shown in FIG. 5, 96 selectable output links are performed by using a selective selector. Two-two packets and selection of seven adjacent output links, and finally an output link is generated as a payload equalization link; and a corresponding mask is fed back to the input of the load balancing, and the payload is balanced. The link number is masked in the link number mask table of the 96 selectable output links, resulting in a selectable output link for the next load balancing.
负载均衡在交换装置中的每个路由平面的处理过程是完全相同的;即对平面0、平面1、平面2和平面3均执行步骤301至步骤308,同步产生各自的一个有效负载均衡链路,发往交换装置的输出链路。The process of load balancing in each routing plane in the switching device is identical; that is, steps 301 to 308 are performed on plane 0, plane 1, plane 2, and plane 3, and each of the active load balancing links is synchronously generated. , the output link to the switching device.
在上述过程中,每个路由平面需要48+24+12+6+3+1+1=95个选择信号(select信号),总共4个平面,则共需要4×95个选择信号;其中,选择 信号(select信号)由伪随机数Y产生,伪随机数Y则由预设随机函数产生,比如,由预设随机函数f(x)=x^31+x^28+1产生;4个平面每完成一次负载均衡产生一个Y,其位宽为选择信号(select信号)的个数,即为4×95。In the above process, each routing plane needs 48+24+12+6+3+1+1=95 selection signals (select signals), and a total of 4 planes require a total of 4×95 selection signals; Choose The signal (select signal) is generated by a pseudo-random number Y, and the pseudo-random number Y is generated by a preset random function, for example, generated by a preset random function f(x)=x^31+x^28+1; 4 planes Each time load balancing is completed, a Y is generated, and the bit width is the number of selection signals (select signals), that is, 4×95.
这里需要说明的是,预设随机函数可根据实际需求进行设置,此处并不加以限定。It should be noted that the preset random function can be set according to actual needs, which is not limited herein.
图6为使用本发明随机负载均衡的方法实施例二的负载均衡信元流向示意图;如图6所示,对于0~95号共96条可选择的输出链路,进行一次负载均衡之后,平面0产生的输出链路为0号链路,平面1产生的输出链路为1号链路,平面2产生的输出链路为2号链路,平面3产生的输出链路为3号链路,即4个平面可以分别负载均衡到不同的链路上,避免了多平面的共振。6 is a schematic diagram of a load balancing cell flow direction in Embodiment 2 of a method for random load balancing according to the present invention; as shown in FIG. 6, after a load balancing is performed on a total of 96 selectable output links from 0 to 95, a plane is used. The output link generated by 0 is the link 0, the output link generated by plane 1 is the link 1, the output link generated by plane 2 is the link 2, and the output link generated by plane 3 is the link 3. That is, four planes can be load balanced to different links respectively, avoiding multi-plane resonance.
步骤309:判断可选择的链路号掩码表中的所有链路号是否都被屏蔽。Step 309: Determine whether all link numbers in the selectable link number mask table are blocked.
在完成一次负载均衡之后,判断可选择的链路号掩码表中的所有链路号是否都被屏蔽,若可选择的链路号掩码表中的所有链路号未被全部屏蔽,则执行步骤310;若可选择的链路号掩码表中的所有链路号都已被屏蔽,则执行步骤311。After completing a load balancing, it is determined whether all link numbers in the selectable link number mask table are masked. If all the link numbers in the selectable link number mask table are not completely blocked, then Step 310 is performed. If all the link numbers in the selectable link number mask table are blocked, step 311 is performed.
步骤310:进行下一次负载均衡。Step 310: Perform the next load balancing.
当判断可选择的链路号掩码表中的所有链路号未被全部屏蔽时,本轮负载均衡未结束,则继续对平面0、平面1、平面2和平面3进行下一次负载均衡,即执行步骤301至步骤308。When it is determined that all the link numbers in the selectable link number mask table are not completely masked, the load balancing of the current round is not completed, and then the next load balancing is performed on plane 0, plane 1, plane 2, and plane 3, That is, steps 301 to 308 are performed.
步骤311:将可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡。Step 311: Restore the blocked link number in the selectable link number mask table, and perform the next round of load balancing.
当判断可选择的链路号掩码表中的所有链路号都已被屏蔽时,本轮负载均衡结束,这时,将可选择的链路号掩码表中被屏蔽的链路号还原,然后进行下一轮的负载均衡。 When it is judged that all link numbers in the selectable link number mask table have been masked, the current load balancing is ended, and at this time, the blocked link number in the selectable link number mask table is restored. Then proceed to the next round of load balancing.
在上述过程中,进行同一轮负载均衡时,在一次负载均衡完成产生一个有效负载均衡链路之后,会根据该负载均衡链路的掩码表和可选择的输出链路产生下一次负载均衡的可选择输出链路,即会将产生的有效负载均衡链路的链路号在当前可选择的链路号掩码表中屏蔽,能够避免同一轮负载均衡两次随机到同一条链路;同时,每次随机的选择信号(select信号)不一样,从而能够有效避免多个路由平面产生共振,减少多路由平面负载均衡到同一条链路上的概率,最终达到负载均衡的目的。In the above process, when the same round of load balancing is performed, after a load balancing is completed to generate a valid load balancing link, the next load balancing is generated according to the mask table of the load balancing link and the selectable output link. The output link can be selected, that is, the link number of the generated payload equalization link is shielded in the currently selectable link number mask table, which can avoid the same round of load balancing twice randomly to the same link; Each time the random selection signal (select signal) is different, it can effectively avoid resonance of multiple routing planes, reduce the probability of multi-route plane load balancing to the same link, and finally achieve the purpose of load balancing.
本发明实施例提供的随机负载均衡的方法,通过对96条可选择的输出链路进行两两分组,经过第一级选择后,产生48个输出链路;将产生的48个输出链路进行两两分组,经过第二级选择后,产生24个输出链路;将产生的24个输出链路进行两两分组,经过第三级选择后,产生12个输出链路;将产生的12个输出链路进行两两分组,经过第四级选择后,产生6个输出链路;将产生的6个输出链路进行两两分组,经过第五级选择后,产生3个输出链路;将产生的3个输出链路分为2个一组和1个一组,并对2个一组的输出链路进行第六级选择,产生1个输出链路并剩余1个输出链路;将第六级产生的1个输出链路和第五级剩余的1个输出链路进行第七级选择,得到一个有效输出链路;将得到的一个有效输出链路的链路号在96个可选择输出链路的链路号掩码表中屏蔽,产生下一次负载均衡的可选择输出链路;判断可选择的链路号掩码表中的所有链路号是否都被屏蔽,若未被全部屏蔽,则进行下一次负载均衡;若都已被屏蔽,则将可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡;避免了同一轮负载均衡两次随机到同一条链路,有效避免了多个路由平面产生共振,减少了多路由平面负载均衡到同一条链路上的概率,实现了多个路由平面的所有信元都能均衡的分配在可以到达的链路上、保证整个网络的流量均衡的目的,提高了带宽的利用率和系统的性能。 The random load balancing method provided by the embodiment of the present invention performs two-two grouping on 96 selectable output links, and after the first-stage selection, generates 48 output links; 48 output links to be generated are performed. Two or two groups, after the second level selection, generate 24 output links; the generated 24 output links are grouped into two groups, and after the third level is selected, 12 output links are generated; 12 will be generated The output link performs two-two grouping, and after the fourth-stage selection, six output links are generated; the six output links that are generated are grouped into two groups, and after the fifth-level selection, three output links are generated; The generated three output links are divided into two groups and one group, and the second level of the output links of the two groups is selected to generate one output link and one output link remaining; The first output link generated by the sixth stage and the remaining one output link of the fifth stage are subjected to the seventh level selection to obtain an effective output link; the link number of the obtained effective output link is 96. Select the mask in the link number mask table of the output link to generate the next time. a balanced output selectable output link; determine whether all link numbers in the selectable link number mask table are masked, and if not all masked, perform next load balancing; if both are masked, then The masked link number in the selectable link number mask table is restored, and the next round of load balancing is performed; the same round of load balancing is avoided to randomly go to the same link twice, which effectively avoids resonance of multiple routing planes. The probability of multi-route plane load balancing to the same link is reduced, and all the cells of multiple routing planes can be uniformly allocated on the reachable link to ensure the traffic balance of the entire network, and the purpose is improved. Bandwidth utilization and system performance.
实施例三 Embodiment 3
图7为本发明随机负载均衡的装置实施例的结构示意图;如图7所示,本发明实施例提供的随机负载均衡的装置07包括:处理模块71、确定模块72、还原模块73;其中,FIG. 7 is a schematic structural diagram of an apparatus for random load balancing according to the present invention; as shown in FIG. 7, the random load balancing apparatus 07 provided by the embodiment of the present invention includes: a processing module 71, a determining module 72, and a restoring module 73;
所述处理模块71,配置为在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数;The processing module 71 is configured to perform the current sub-load balanced M selectable output links by using a second-selector and a unique pseudo-random number in all planes in one round of load balancing. Processing, obtaining a valid output link of the current secondary load balancing; the n and M are positive integers;
所述确定模块72,配置为将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下一次负载均衡的M-1个可选择的输出链路;直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止;The determining module 72 is configured to block the link number of the valid output link of the current current load balancing in the M selectable link number mask tables of the current secondary load balancing, and determine M-1 selectable output links that are load balanced at a time; until all link numbers in the selectable link number mask table are masked;
所述还原模块73,配置为将所述可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡。The restoration module 73 is configured to restore the blocked link number in the selectable link number mask table for the next round of load balancing.
本发明实施例一实施方式中,所述处理模块71,具体配置为在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级输出链路的分组,得到所述一个当前次负载均衡的有效输出链路;所述k为正整数。In an embodiment of the present invention, the processing module 71 is configured to: in the current time and in a plane, use a second selector and a unique pseudo random number in all planes, and the M is used. The selectable output links are grouped into k-level output links to obtain the effective output link of the current current load balancing; the k is a positive integer.
本发明实施例一实施方式中,所述处理模块71,还具体配置为在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级相邻输出链路的两两分组;In an embodiment of the present invention, the processing module 71 is further configured to: in the current time and in a plane, use a second selector and a unique pseudo random number in all planes, M selectable output links for two-two packets of k-level adjacent output links;
若第k级的输出链路数m为偶数,则将第k级的m个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的m/2个输出链路,直到所述m/2=1为止,得到所述m/2=1所对应的一个有效输出链路;所述m小于等于M; If the number m of the output links of the kth stage is an even number, the m output links of the kth stage are grouped into two groups of adjacent output links, and the selectors of the second selection and the unique ones in all planes are utilized. a pseudo-random number obtains m/2 output links of the k+1th level until the m/2=1, obtaining an effective output link corresponding to the m/2=1; the m is smaller than Equal to M;
若第k级的输出链路数m为奇数,则将第k级的m-1个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的(m-1)/2个输出链路及第k级剩余的1个输出链路,直到所述m=3为止,得到(m-1)/2+1=2个输出链路,利用二选一选择器及在一次随机负载中的唯一一个伪随机数在所述(m-1)/2+1=2个输出链路中确定出对应的一个有效输出链路;所述m小于等于M。If the number m of output links of the kth stage is an odd number, the m-1 output links of the kth stage are grouped into two groups of adjacent output links, and the selectors are selected and the planes are used in all planes. The only one pseudo-random number obtains (m-1)/2 output links of the k+1th stage and the remaining 1 output link of the kth stage until the m=3, and (m-1) /2+1=2 output links, which are determined in the (m-1)/2+1=2 output links by using a binary selector and a unique pseudo random number in a random load Corresponding one effective output link; the m is less than or equal to M.
本发明实施例一实施方式中,所述处理模块71,还具体配置为根据所述在所有平面中的唯一一个伪随机数产生选择信号;所述所有平面中的唯一一个伪随机数为二进制数,所述所有平面中的唯一一个伪随机数的位宽为所述选择信号的个数;In an embodiment of the present invention, the processing module 71 is further configured to generate a selection signal according to the unique one of the pseudo-random numbers in all planes; the only one of the all planes is a binary number The bit width of the only one of the pseudo-random numbers in all the planes is the number of the selection signals;
根据所述选择信号所对应的信号位对所述二选一选择器的两个输入端所对应的两个可选择的输出链路进行选择,得到一个输出端所对应的一个可选择的输出链路。Selecting two selectable output links corresponding to the two inputs of the two selectors according to the signal bits corresponding to the selection signal, to obtain a selectable output chain corresponding to one output road.
本发明实施例一实施方式中,所述处理模块71,还具体配置为若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中只有一个有效时,则将所述有效的输出链路作为所述输出端所对应的一个可选择的输出链路;In an embodiment of the present invention, the processing module 71 is further configured to: if only one of the two selectable output links corresponding to the two input ends of the two-selection selector is valid, Using the valid output link as a selectable output link corresponding to the output;
若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中两个都有效或两个都无效时,则根据所述选择信号所对应的信号位的预设规则确定所述输出端所对应的一个可选择的输出链路。If two of the two selectable output links corresponding to the two inputs of the two selectors are valid or both are invalid, then according to the preset of the signal bits corresponding to the selection signal The rule determines a selectable output link corresponding to the output.
本发明实施例一实施方式中,所述处理模块71,还具体配置为所述选择信号所对应的信号位为1时,将所述二选一选择器的第一输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路;或,所述选择信号所对应的信号位为1时,将所述二选一选择器的第二输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的 输出链路。In an embodiment of the present invention, the processing module 71 is further configured to: when the signal bit corresponding to the selection signal is 1, select a corresponding one of the first input ends of the second selection selector The output link is determined as a selectable output link corresponding to the output end; or, when the signal bit corresponding to the selection signal is 1, the second input end of the second selector is selected Corresponding selectable output links are determined to be an alternative to the output Output link.
本发明实施例一实施方式中,所述装置07,还包括:产生模块74;其中,In an embodiment of the present invention, the device 07 further includes: a generating module 74;
所述产生模块74,配置为根据预设随机函数产生在一轮负载均衡中的所有平面中的唯一一个伪随机数。The generating module 74 is configured to generate a unique one of all planes in one round of load balancing according to a preset random function.
本实施例的随机负载均衡的装置,可以用于执行上述所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。The device of the random load balancing in this embodiment may be used to perform the technical solution of the foregoing method embodiment, and the implementation principle and the technical effect are similar, and details are not described herein again.
在实际应用中,所述随机负载均衡的装置07的处理模块71,确定模块72,还原模块73,产生模块74,均可由位于随机负载均衡的装置07中的中央处理器(Central Processing Unit,CPU)、微处理器(Micro Processor Unit,MPU)、数字信号处理器(Digital Signal Processor,DSP)或现场可编程门阵列(Field Programmable Gate Array,FPGA)等实现。In a practical application, the processing module 71, the determining module 72, the restoring module 73, and the generating module 74 of the stochastic load balancing device 07 may each be a central processing unit (CPU) located in the random load balancing device 07. ), a microprocessor (Micro Processor Unit, MPU), a digital signal processor (DSP), or a Field Programmable Gate Array (FPGA).
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。 The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
工业实用性Industrial applicability
采用本发明实施例,通过在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数;将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下一次负载均衡的M-1个可选择的输出链路;直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止;将所述可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡;实现了多个路由平面的所有信元都能均衡的分配在可以到达的链路上、保证整个网络的流量均衡的目的,提高了带宽的利用率和系统的性能。 According to the embodiment of the present invention, the M selectable output links of the current sub-load balancing are processed by using a two-selection selector and a unique pseudo-random number in all planes in one round of load balancing. Obtaining a valid output link of the current secondary load balancing; the n and M are positive integers; and the link number of the effective output link of the current current load balancing is equal to the M of the current secondary load balancing Masked in the selected link number mask table and determine the M-1 selectable output links for the next load balancing; until all link numbers in the selectable link number mask table are masked Upstream; the masked link number in the selectable link number mask table is restored, and the next round of load balancing is performed; all cells of multiple routing planes can be uniformly allocated in the reachable chain. On the road, to ensure the balance of traffic throughout the network, the utilization of bandwidth and the performance of the system are improved.

Claims (15)

  1. 一种随机负载均衡的方法,所述方法包括:A method of random load balancing, the method comprising:
    在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数;In a round of n-time load balancing, the M-selectable output links of the current sub-load balancing are processed by using a two-choice selector and a unique pseudo-random number in all planes to obtain a current sub-load balancing. Effective output link; the n, M are positive integers;
    将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下一次负载均衡的M-1个可选择的输出链路;The link number of the valid output link of the current current load balancing is masked in the M selectable link number mask tables of the current secondary load balancing, and the M-1 of the next load balancing is determined. Selectable output link;
    直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止;Until all link numbers in the selectable link number mask table are masked;
    将所述可选择的链路号掩码表中被屏蔽的链路号还原,进行下一轮负载均衡。The masked link number in the selectable link number mask table is restored for the next round of load balancing.
  2. 根据权利要求1所述的方法,其中,所述利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路,包括:The method of claim 1 wherein said processing the M selectable output links of the current sub-load balancing using a two-select selector and a unique one of the pseudo-random numbers in all planes results in a The effective output link for current sub-load balancing, including:
    在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级输出链路的分组,得到所述一个当前次负载均衡的有效输出链路;所述k为正整数。Performing k-level output link grouping on the M selectable output links in the current time and in a plane by using a second-selector and a unique one of the pseudo-random numbers in all planes Describe a valid output link for current secondary load balancing; the k is a positive integer.
  3. 根据权利要求2所述的方法,其中,所述在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级输出链路的分组,得到所述一个当前次负载均衡的有效输出链路,包括:The method of claim 2 wherein said M selectable outputs are selected in said current time and in a plane using a second selector and a unique pseudo random number in all planes The link performs a packet of the k-level output link to obtain the effective output link of the current current load balancing, including:
    在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级相邻输出链路的两两分组;Performing, in the current time and in a plane, two pairs of k-level adjacent output links for the M selectable output links by using a two-select selector and a unique one of the pseudo-random numbers in all planes Grouping
    若第k级的输出链路数m为偶数,则将第k级的m个输出链路进行 相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的m/2个输出链路,直到所述m/2=1为止,得到所述m/2=1所对应的一个有效输出链路;所述m小于等于M;If the number of output links m of the kth stage is even, the m output links of the kth stage are performed. Two or two packets of adjacent output links, using a two-select selector and the unique one of the pseudo-random numbers in all planes to obtain m/2 output links of the k+1th stage until the m/2 =1, an effective output link corresponding to the m/2=1 is obtained; the m is less than or equal to M;
    若第k级的输出链路数m为奇数,则将第k级的m-1个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的(m-1)/2个输出链路及第k级剩余的1个输出链路,直到所述m=3为止,得到(m-1)/2+1=2个输出链路,利用二选一选择器及在一次随机负载中的唯一一个伪随机数在所述(m-1)/2+1=2个输出链路中确定出对应的一个有效输出链路;所述m小于等于M。If the number m of output links of the kth stage is an odd number, the m-1 output links of the kth stage are grouped into two groups of adjacent output links, and the selectors are selected and the planes are used in all planes. The only one pseudo-random number obtains (m-1)/2 output links of the k+1th stage and the remaining 1 output link of the kth stage until the m=3, and (m-1) /2+1=2 output links, which are determined in the (m-1)/2+1=2 output links by using a binary selector and a unique pseudo random number in a random load Corresponding one effective output link; the m is less than or equal to M.
  4. 根据权利要求1所述的方法,其中,所述利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,包括:The method of claim 1 wherein said processing the M selectable output links of the current sub-load balancing using a two-select selector and a unique one of the pseudo-random numbers in all planes comprises:
    根据所述在所有平面中的唯一一个伪随机数产生选择信号;所述所有平面中的唯一一个伪随机数为二进制数,所述所有平面中的唯一一个伪随机数的位宽为所述选择信号的个数;Generating a selection signal according to the unique one of the pseudo-random numbers in all planes; the only one of the all planes is a binary number, and the bit width of the only one of the all planes is the selection The number of signals;
    根据所述选择信号所对应的信号位对所述二选一选择器的两个输入端所对应的两个可选择的输出链路进行选择,得到一个输出端所对应的一个可选择的输出链路。Selecting two selectable output links corresponding to the two inputs of the two selectors according to the signal bits corresponding to the selection signal, to obtain a selectable output chain corresponding to one output road.
  5. 根据权利要求4所述的方法,其中,所述根据所述选择信号所对应的信号位对所述二选一选择器的两个输入端所对应的两个可选择的输出链路进行选择,得到一个输出端所对应的一个可选择的输出链路,包括:The method according to claim 4, wherein said selecting two selectable output links corresponding to two inputs of said two selector selectors according to signal bits corresponding to said selection signal, Obtain an optional output link corresponding to an output, including:
    若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中只有一个有效时,则将所述有效的输出链路作为所述输出端所对应的 一个可选择的输出链路;If only one of the two selectable output links corresponding to the two inputs of the two-select selector is valid, the valid output link is used as the output end An optional output link;
    若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中两个都有效或两个都无效时,则根据所述选择信号所对应的信号位的预设规则确定所述输出端所对应的一个可选择的输出链路。If two of the two selectable output links corresponding to the two inputs of the two selectors are valid or both are invalid, then according to the preset of the signal bits corresponding to the selection signal The rule determines a selectable output link corresponding to the output.
  6. 根据权利要求5所述的方法,其中,所述根据所述选择信号所对应的信号位的预设规则确定所述输出端所对应的一个可选择的输出链路,包括:The method according to claim 5, wherein the determining, according to a preset rule of signal bits corresponding to the selection signal, a selectable output link corresponding to the output end, comprising:
    所述选择信号所对应的信号位为1时,将所述二选一选择器的第一输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路;或,所述选择信号所对应的信号位为1时,将所述二选一选择器的第二输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路。When the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the first input end of the second selection selector is determined as a selectable output chain corresponding to the output end. Or; when the signal bit corresponding to the selection signal is 1, the selectable output link corresponding to the second input end of the second selection selector is determined as one corresponding to the output end; Selected output link.
  7. 根据权利要求1-6任一项所述的方法,其中,所述方法还包括:The method of any of claims 1-6, wherein the method further comprises:
    根据预设随机函数产生在一轮负载均衡中的所有平面中的唯一一个伪随机数。A unique one of all planes in one round of load balancing is generated according to a preset random function.
  8. 一种随机负载均衡的装置,所述装置包括:A device for random load balancing, the device comprising:
    处理模块,配置为在一轮n次负载均衡中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对当前次负载均衡的M个可选择的输出链路进行处理,得到一个当前次负载均衡的有效输出链路;所述n、M为正整数;The processing module is configured to process the M selectable output links of the current sub-load balancing by using a second-selector and a unique pseudo-random number in all planes in one round of load balancing. An effective output link of the current secondary load balancing; the n and M are positive integers;
    确定模块,配置为将所述一个当前次负载均衡的有效输出链路的链路号在所述当前次负载均衡的M个可选择的链路号掩码表中屏蔽,并确定下一次负载均衡的M-1个可选择的输出链路;直到所述可选择的链路号掩码表中的所有链路号都被屏蔽为止;a determining module configured to mask the link number of the valid output link of the current current load balancing in the M selectable link number mask tables of the current secondary load balancing, and determine the next load balancing M-1 selectable output links; until all link numbers in the selectable link number mask table are masked;
    还原模块,配置为将所述可选择的链路号掩码表中被屏蔽的链路号 还原,进行下一轮负载均衡。a restore module configured to block the blocked link number in the selectable link number mask table Restore, the next round of load balancing.
  9. 根据权利要求8所述的装置,其中,所述处理模块,具体配置为:在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级输出链路的分组,得到所述一个当前次负载均衡的有效输出链路;所述k为正整数。The device according to claim 8, wherein the processing module is specifically configured to: in the current time and in a plane, use a second selector and a unique pseudo random number in all planes, The M selectable output links are grouped into k-level output links to obtain the effective output link of the current current load balancing; the k is a positive integer.
  10. 根据权利要求9所述的装置,其中,所述处理模块,还具体配置为:在所述当前次及一个平面中,利用二选一选择器及在所有平面中的唯一一个伪随机数,对所述M个可选择的输出链路进行k级相邻输出链路的两两分组;The apparatus according to claim 9, wherein the processing module is further configured to: in the current time and a plane, use a second selector and a unique pseudo random number in all planes, The M selectable output links perform two-two packets of k-level adjacent output links;
    若第k级的输出链路数m为偶数,则将第k级的m个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的m/2个输出链路,直到所述m/2=1为止,得到所述m/2=1所对应的一个有效输出链路;所述m小于等于M;If the number m of the output links of the kth stage is an even number, the m output links of the kth stage are grouped into two groups of adjacent output links, and the selectors of the second selection and the unique ones in all planes are utilized. a pseudo-random number obtains m/2 output links of the k+1th level until the m/2=1, obtaining an effective output link corresponding to the m/2=1; the m is smaller than Equal to M;
    若第k级的输出链路数m为奇数,则将第k级的m-1个输出链路进行相邻输出链路的两两分组,利用二选一选择器及所述在所有平面中的唯一一个伪随机数得到第k+1级的(m-1)/2个输出链路及第k级剩余的1个输出链路,直到所述m=3为止,得到(m-1)/2+1=2个输出链路,利用二选一选择器及在一次随机负载中的唯一一个伪随机数在所述(m-1)/2+1=2个输出链路中确定出对应的一个有效输出链路;所述m小于等于M。If the number m of output links of the kth stage is an odd number, the m-1 output links of the kth stage are grouped into two groups of adjacent output links, and the selectors are selected and the planes are used in all planes. The only one pseudo-random number obtains (m-1)/2 output links of the k+1th stage and the remaining 1 output link of the kth stage until the m=3, and (m-1) /2+1=2 output links, which are determined in the (m-1)/2+1=2 output links by using a binary selector and a unique pseudo random number in a random load Corresponding one effective output link; the m is less than or equal to M.
  11. 根据权利要求8所述的装置,其中,所述处理模块,还具体配置为:根据所述在所有平面中的唯一一个伪随机数产生选择信号;所述所有平面中的唯一一个伪随机数为二进制数,所述所有平面中的唯一一个伪随机数的位宽为所述选择信号的个数;The apparatus according to claim 8, wherein the processing module is further configured to: generate a selection signal according to the only one pseudo random number in all planes; a unique one of the all planes is a pseudo random number a binary number, a bit width of a unique one of the all planes being the number of the selection signals;
    根据所述选择信号所对应的信号位对所述二选一选择器的两个输入 端所对应的两个可选择的输出链路进行选择,得到一个输出端所对应的一个可选择的输出链路。Two inputs to the two selectors according to signal bits corresponding to the selection signal The two selectable output links corresponding to the end are selected to obtain a selectable output link corresponding to one output.
  12. 根据权利要求11所述的装置,其中,所述处理模块,还具体配置为:若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中只有一个有效时,则将所述有效的输出链路作为所述输出端所对应的一个可选择的输出链路;The apparatus according to claim 11, wherein the processing module is further configured to: if only one of the two selectable output links corresponding to the two inputs of the two-selector is valid And the effective output link is used as a selectable output link corresponding to the output end;
    若所述二选一选择器的两个输入端所对应的两个可选择的输出链路中两个都有效或两个都无效时,则根据所述选择信号所对应的信号位的预设规则确定所述输出端所对应的一个可选择的输出链路。If two of the two selectable output links corresponding to the two inputs of the two selectors are valid or both are invalid, then according to the preset of the signal bits corresponding to the selection signal The rule determines a selectable output link corresponding to the output.
  13. 根据权利要求12所述的装置,其中,所述处理模块,还具体配置为:所述选择信号所对应的信号位为1时,将所述二选一选择器的第一输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路;或,所述选择信号所对应的信号位为1时,将所述二选一选择器的第二输入端所对应的可选择的输出链路确定为所述输出端所对应的一个可选择的输出链路。The device according to claim 12, wherein the processing module is further configured to: when the signal bit corresponding to the selection signal is 1, the first input end of the second selection selector is corresponding to The selectable output link is determined as a selectable output link corresponding to the output terminal; or, when the signal bit corresponding to the selection signal is 1, the second input of the second selector is selected The selectable output link corresponding to the terminal is determined as a selectable output link corresponding to the output.
  14. 根据权利要求8-13任一项所述的装置,其中,所述装置还包括:The device of any of claims 8-13, wherein the device further comprises:
    产生模块,配置为根据预设随机函数产生在一轮负载均衡中的所有平面中的唯一一个伪随机数。A generating module is configured to generate a unique one of all planes in one round of load balancing according to a preset random function.
  15. 一种计算机存储介质,其中存储有计算机可执行指令,该计算机可执行指令配置执行上述权利要求1-7任一项所述的随机负载均衡的方法。 A computer storage medium having stored therein computer executable instructions configured to perform the method of random load balancing of any of the preceding claims 1-7.
PCT/CN2017/094397 2016-12-26 2017-07-25 Random load balancing method and apparatus, computer storage medium WO2018120814A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2018120814A1 true WO2018120814A1 (en) 2018-07-05

Family

ID=62705016

Family Applications (1)

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

Country Status (2)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113767597A (en) * 2020-04-03 2021-12-07 华为技术有限公司 Network device, system and method for cycle-based load balancing
CN116170449A (en) * 2023-02-24 2023-05-26 浪潮电子信息产业股份有限公司 Flow equalization method, system, device and computer readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111935029B (en) * 2020-09-18 2021-06-08 腾讯科技(深圳)有限公司 Gateway load balancing method and device, storage medium and electronic equipment

Citations (6)

* 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 packet switching method, system and device
US7480246B2 (en) * 2002-03-06 2009-01-20 Agere Systems Inc. Characterizing transmission of data segments within a switch fabric using multiple counters for each destination node
US7596135B1 (en) * 2003-05-23 2009-09-29 Cisco Technology, Inc. Method and apparatus for mixed-cast routing through a Clos-like network
CN102238072A (en) * 2010-05-06 2011-11-09 中兴通讯股份有限公司 Method for dynamically selecting routing and CLOS (Charles Clos) switching network system
CN105337883A (en) * 2015-08-20 2016-02-17 电子科技大学 Multi-business supporting network switching device and implementation method therefor

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227394B (en) * 2008-02-18 2011-07-13 中兴通讯股份有限公司 High-capacity non-jam route matrix
CN102065014B (en) * 2010-12-29 2014-12-31 中兴通讯股份有限公司 Data cell processing method and device
CN103152281B (en) * 2013-03-05 2014-09-17 中国人民解放军国防科学技术大学 Two-level switch-based load balanced scheduling method
CN105376168B (en) * 2014-08-25 2019-06-11 深圳市中兴微电子技术有限公司 A kind of method and apparatus of load balancing

Patent Citations (6)

* 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
US7480246B2 (en) * 2002-03-06 2009-01-20 Agere Systems Inc. Characterizing transmission of data segments within a switch fabric using multiple counters for each destination node
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 packet switching method, system and device
CN102238072A (en) * 2010-05-06 2011-11-09 中兴通讯股份有限公司 Method for dynamically selecting routing and CLOS (Charles Clos) switching network system
CN105337883A (en) * 2015-08-20 2016-02-17 电子科技大学 Multi-business supporting network switching device and implementation method therefor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113767597A (en) * 2020-04-03 2021-12-07 华为技术有限公司 Network device, system and method for cycle-based load balancing
CN116170449A (en) * 2023-02-24 2023-05-26 浪潮电子信息产业股份有限公司 Flow equalization method, system, device and computer readable storage medium
CN116170449B (en) * 2023-02-24 2025-08-26 浪潮电子信息产业股份有限公司 A flow balancing method, system, device and computer-readable storage medium

Also Published As

Publication number Publication date
CN108243113A (en) 2018-07-03
CN108243113B (en) 2020-06-16

Similar Documents

Publication Publication Date Title
US9246821B1 (en) Systems and methods for implementing weighted cost multi-path using two-level equal cost multi-path tables
Kim et al. Adaptive routing in high-radix clos network
US8819272B2 (en) Multiprocessor communication networks
CN111913749A (en) FPGA Implementation Method and System of SM3 Algorithm Based on Pipeline
Hu et al. DMesh: a diagonally-linked mesh network-on-chip architecture
WO2018120814A1 (en) Random load balancing method and apparatus, computer storage medium
CN109391547B (en) A network topology system and its topology establishment and routing table establishment method
Xu et al. Reliable service function chain provisioning in software-defined networking
CN107959642B (en) Method, device and system for measuring network path
Miura et al. An adaptive routing of the 2-D torus network based on turn model
Swaminathan et al. Enhanced Noxim simulator for performance evaluation of network on chip topologies
Bhaskar et al. A study of the effect of virtual channels on the performance of network-on-chip
Hu et al. A symmetric odd-even routing model in network-on-chip
CN115208769B (en) A Ring Communication Method Applicable to Dragonfly Topology
Tu et al. Design a simple and high performance switch using a two-stage architecture
Liang et al. Beyond the performance of three-tier fat-tree: equality topology with low diameter
Punhani et al. E-XY: an entropy based XY routing algorithm
Lei et al. Vertical-mesh-conscious-dynamic routing algorithm for 3D NoCs
Miura et al. The Static and Dynamic Performance of an Adaptive Routing Algorithm of 2-D Torus Network Based on Turn Model
Momeni et al. Improved-XY: A High Performance Wormhole-Switched Routing Algorithm for Irregular 2-D Mesh NoC
Chauhan et al. Comparative analysis of traffic patterns on centre connected topologies based on burton normal form
Dai et al. PDA-HyPAR: Path-diversity-aware hybrid planar adaptive routing algorithm for 3D NoCs
Menon et al. Adaptive look ahead algorithm for 2-D mesh NoC
CN104734995B (en) A kind of method to set up and network controller of link aggregation flow rate upper limit
Saravanakumar et al. Energy and throughput analysis of multicast routing algorithm for 2D mesh network on chip

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17887932

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17887932

Country of ref document: EP

Kind code of ref document: A1