Dynamic load balancing port routing method, device and network equipment
By combining dual-dimensional evaluation and low-pass filtering with a random quality threshold sequence, the method solves the problems of insufficient accuracy and resource waste in dynamic load balancing routing in existing technologies, and achieves efficient and stable traffic distribution and resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-07
AI Technical Summary
Existing dynamic load balancing technologies suffer from insufficient routing accuracy and low port bandwidth utilization. They are particularly inefficient in distributing traffic in complex network scenarios and are prone to congestion caused by traffic concentrating on the same port.
The overall quality level of a port is determined by evaluating the load and queue depth at the egress point from two dimensions. Low-pass filtering is then applied, and candidate egress points are screened using a weighted random quality threshold sequence. Finally, the highest-level port is selected for traffic scheduling.
It achieves efficient and stable traffic distribution under dynamic load balancing, avoiding resource waste and instantaneous fluctuation interference caused by a single indicator, and improving the utilization rate of outbound resources and the stability of traffic allocation.
Smart Images

Figure CN121396908B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a dynamic load balancing port routing method, apparatus, and network device. Background Technology
[0002] In the field of network communication, Dynamic Load Balancing (DLB) technology is used to rationally distribute traffic to multiple exit points of network forwarding devices in order to achieve efficient utilization of port bandwidth, avoid congestion, and improve overall network performance.
[0003] In existing technologies, dynamic load balancing solutions are mostly based on the real-time status or historical average status of ports for routing: some only make decisions based on the current load or queue depth of the port, resulting in a single measurement dimension; some measurement results are easily affected by sudden traffic surges and are prone to fluctuations, and updates are delayed; some solutions are also prone to situations where multiple traffic streams concentrate on selecting the same "optimal" port in a short period of time, leading to congestion on that port and idle bandwidth on other ports.
[0004] The aforementioned problems result in existing dynamic load balancing technologies having shortcomings such as insufficient routing accuracy and low port bandwidth utilization, failing to meet the needs of efficient traffic distribution in complex network scenarios. Summary of the Invention
[0005] This application provides a dynamic load balancing port routing method, apparatus, and network device to improve the stability and efficiency of network load balancing.
[0006] In a first aspect, embodiments of this application provide a port routing method for dynamic load balancing, including:
[0007] Based on the load status and queue depth status of each egress port, determine the overall port quality level of the corresponding egress port;
[0008] The overall port quality level of each of the output terminals is subjected to low-pass filtering to obtain the smoothed port quality level of the output terminals;
[0009] The quality levels of all smoothed ports at the exit points are compared with the corresponding values in the random quality threshold sequence; if the smoothed port quality level is greater than the corresponding value at the position, the corresponding exit point is selected as a candidate exit point.
[0010] Select the highest-level exit point from all the candidate exit points as the final exit point to complete the traffic scheduling.
[0011] Secondly, embodiments of this application provide a port routing device for dynamic load balancing, comprising:
[0012] The grade calculation module is used to determine the overall port quality grade of the corresponding egress terminal based on the load status and queue depth status of each egress terminal.
[0013] The smoothing module performs low-pass filtering on the overall port quality level of each output end to obtain the smoothed port quality level of the output end.
[0014] The port selection module compares the smoothed port quality level of all outgoing ports with the corresponding values in the random quality threshold sequence; if the smoothed port quality level is greater than the corresponding value, the corresponding outgoing port is selected as a candidate outgoing port; the outgoing port with the highest quality level is selected from all the candidate outgoing ports as the final outgoing port to complete traffic scheduling.
[0015] Thirdly, embodiments of this application provide a network device that performs the method as described in any one of the first aspects above.
[0016] Fourthly, embodiments of this application provide a program product that, when executed by a processor, implements the method as described in any one of the first aspects above.
[0017] The technical solutions provided in the embodiments of this specification may include the following beneficial effects:
[0018] The embodiments of this specification provide a dynamic load balancing port routing method, apparatus, and network device. It determines the overall port quality level by evaluating the egress load and queue depth from two dimensions, adding an "early warning dimension" to performance and enabling differentiated routing through "on-demand matching," avoiding resource waste caused by a single indicator and improving egress resource utilization. A low-pass filter is then applied to smooth the port quality level, eliminating interference from instantaneous fluctuations in routing. Finally, a weighted random quality threshold sequence is used to filter candidate egress ports and select the highest-level port for scheduling. This ensures the routing priority of high-priority ports while preventing excessive traffic concentration on a single port, effectively solving the congestion and instability problems of traditional routing and achieving efficient and stable traffic distribution under dynamic load balancing.
[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the port routing method for dynamic load balancing in one embodiment of the present invention;
[0021] Figure 2 This is a flowchart illustrating a port routing method for dynamic load balancing in another embodiment of the present invention.
[0022] Figure 3 This is a flowchart illustrating a port routing method for dynamic load balancing in another embodiment of the present invention.
[0023] Figure 4 This is a flowchart illustrating a port routing method for dynamic load balancing in another embodiment of the present invention.
[0024] Figure 5 This is a flowchart illustrating a port routing method for dynamic load balancing in another embodiment of the present invention.
[0025] Figure 6 This is a flowchart illustrating a port routing method for dynamic load balancing in another embodiment of the present invention.
[0026] Figure 7 This is a schematic diagram of a port routing device for dynamic load balancing in one embodiment of the present invention;
[0027] Figure 8 This is a schematic diagram of a dynamic load balancing port routing device according to an embodiment of the present invention. Detailed Implementation
[0028] The exemplary embodiments will now be described in detail. When the description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification; they are merely exemplary embodiments of apparatuses and methods consistent with some aspects of this specification.
[0029] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “described,” and “the” as used herein are also intended to include the plural forms unless the context clearly indicates otherwise.
[0030] It should be understood that the terms "first," "second," "third," etc., may be used in this specification to describe various information or structural modules for the purpose of more clearly describing the solution. These terms should not be construed as indicating or implying relative importance or implicitly specifying the number, order, or position of the indicated technical features. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In the description of this specification, unless otherwise stated, "a plurality of" means two or more; "if" can be interpreted as "when," "when," or "in response to determination."
[0031] In this specification, "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship.
[0032] In existing technologies, DLB is used to balance and distribute workloads across multiple ports of a network device to improve performance, reliability, and scalability. It can dynamically adjust traffic distribution strategies based on real-time load conditions. There are three ways to implement this:
[0033] Fixed DLB: Distributes workload evenly across all available links, regardless of their current load. This method is simple and straightforward, suitable for scenarios where load balancing requirements are not stringent.
[0034] Spray Load Balancing (SprayDLB): Randomly distributes requests across all available links, regardless of their current load. This approach is suitable for scenarios requiring fast request processing, but may overload some links.
[0035] EligibleDLB load balancing: Only requests are sent to links that meet certain conditions. For example, only currently idle ports or those with the strongest forwarding capacity are selected. This method can better balance the load based on the current state of resources, but may require additional condition judgments and calculations.
[0036] Currently, when implementing DLB, forwarding devices select ports based on the status of their own egress ports. This selection has limitations, and there's a lag in egress quality measurement. This can lead to inaccurate port selection when traffic needs to choose a port, especially when multiple traffic streams are selecting ports simultaneously within a very short timeframe. In such cases, the same port that appears to have the best quality from a measurement perspective might be selected at the same time. This results in insufficient bandwidth capacity on that port, while the remaining bandwidth of the less optimal ports remains unutilized.
[0037] To address the aforementioned issues, this application provides a novel dynamic load balancing port routing mechanism that achieves a better balance between routing efficiency and traffic balancing. The core logic lies in combining a smoothed port quality rating with random port selection. This ensures the stability of port quality assessment through low-pass filtering, preventing instantaneous fluctuations from interfering with decision-making, while also preventing excessive traffic concentration on a single high-quality port through a random quality threshold sequence. Optionally, Figure 1 This is a flowchart illustrating a dynamic load balancing port routing method provided in an embodiment of the present invention. (See attached diagram.) Figure 1 The method includes:
[0038] Step 100: Determine the overall port quality level of the corresponding egress terminal based on the load status and queue depth status of each egress terminal.
[0039] Specifically, the load status reflects the current resource utilization intensity at the egress end, such as bandwidth and CPU utilization; the queue depth status reflects the backlog of port data processing, directly related to latency and packet loss risk. Obviously, compared to existing technologies that select based on a single indicator, incorporating queue depth into the comprehensive quality level assessment is equivalent to adding an "early warning dimension" to the egress end performance.
[0040] Furthermore, the dual-dimensional evaluation of "load and queue depth" allows the overall port quality level to better suit differentiated needs: for latency-sensitive traffic (such as live streaming and gaming), priority should be given to ports with smaller queue depths (shallow queue = low latency); for bandwidth-sensitive traffic (such as file downloads), priority should be given to ports with lower loads (low load = sufficient bandwidth).
[0041] This "on-demand matching" evaluation logic avoids the waste of resources caused by "all traffic crowding to the same type of port" under a single indicator, allowing ports with different performance characteristics to handle the appropriate traffic and improving the overall utilization rate of outbound resources.
[0042] Step 101: Perform low-pass filtering on the overall port quality level of each output end to obtain a smoothed port quality level.
[0043] Step 102: Compare the smooth port quality level of all exit terminals with the corresponding value in the random quality threshold sequence; if the smooth port quality level is greater than the corresponding value, then the corresponding exit terminal is selected as a candidate exit terminal.
[0044] Step 103: Select the highest-level exit point from all candidate exit points as the final exit point to complete traffic scheduling.
[0045] The port routing method for dynamic load balancing provided in this invention determines the overall quality level of a port by evaluating the load and queue depth at the egress end from two dimensions. This adds an "early warning dimension" to performance and enables differentiated routing for "on-demand matching," avoiding resource waste caused by a single indicator and improving the utilization rate of egress end resources. A low-pass filter is then applied to obtain a smooth port quality level, eliminating the interference of instantaneous fluctuations on routing. Finally, a weighted random quality threshold sequence is used to filter candidate egress ends and select the highest-level port for scheduling. This ensures the priority of high-quality port routing and avoids excessive traffic concentration on a single port, effectively solving the problems of congestion and poor stability in traditional routing, and achieving efficient and stable traffic distribution under dynamic load balancing.
[0046] Optionally, the following provides a possible implementation for calculating the overall port quality level. Specifically, in Figure 1 On this basis, Figure 2 A flowchart illustrating another dynamic load balancing port routing method provided in this embodiment of the invention is shown below. Figure 2 Step 100 includes:
[0047] Step 100-1: Collect the real-time load, real-time queue depth, average load of the previous time step, and average queue depth of the previous time step for each exit end.
[0048] Step 100-2: Determine the average load level and average queue depth level of each egress point based on its real-time load, real-time queue depth, average load at the previous time, and average queue depth at the previous time.
[0049] Step 100-3: Determine the corresponding port overall quality level in the level mapping table based on the average load level and average queue depth level at the export end.
[0050] The grade mapping table is used to maintain the mapping relationship between each average load grade, average queue depth grade, and port overall quality grade.
[0051] Optionally, taking time t+1 and time t as examples, the average load expression at time t+1 is as follows:
[0052] avgP =avgP +(P -avgP ) / (1)
[0053] Among them, avgP Let avgP be the average load at a certain output terminal at time t+1. Let P be the average load at the outlet at time t. Let n be the instantaneous load at the output end at time t+1, and n be the smoothing coefficient.
[0054] Similarly, taking time t+1 and time t as examples, the expression for the average queue depth at time t+1 is as follows:
[0055] avgQ =avgQ +(Q -avgQ ) / (2)
[0056] Among them, avgQ Let avgQ be the average queue depth at a certain exit end at time t+1. Let Q be the average queue depth at the exit end at time t. is the instantaneous queue depth at the exit end at time t+1, and n is the smoothing coefficient.
[0057] Optionally, the value of "n" can be set based on specific scenario requirements, as illustrated in formula (1) below:
[0058] If n=0, then formula (1) degenerates into avgP. =P This is equivalent to averaging the instantaneous measurements.
[0059] If n=1, formula (1) simplifies to: avgP =(P +avgP ) / 2 is equivalent to taking the average of two periods.
[0060] It is evident that as n increases, the proportion of real-time measurements decreases, changes more slowly, and is more influenced by previous measurement periods.
[0061] Optionally, the average load and average queue depth mentioned above can be normalized and tiered, for example, divided into 8 levels, from 0 to 7 from low to high. Moreover, this tiering is not uniform, but rather based on the growth characteristics of the network's outbound bandwidth and queues. Generally, bandwidth utilization of 60% or less is considered relatively safe, indicating sufficient bandwidth. Furthermore, when there are no bursts in the inbound packet volume, even at 90% queuing rates, the queue depth will not be very deep, maintaining a relatively low buffer usage.
[0062] Optionally, a level segmentation diagram is provided below, see Level Segmentation Diagram Table 1 for details.
[0063] Level Segmentation Diagram 1
[0064]
[0065] Optionally, based on the grading in Table 1, an 8-level system can be further constructed. A two-dimensional grade mapping table is used to calculate and reconcile the relationship between the two. The horizontal axis represents avgPL, and the vertical axis represents avgQL. The value at the corresponding position is the port comprehensive quality level (avgQuality). This is done for ease of implementation in chip circuits or software, and for logical simplicity. Example - Grade Mapping Table 2 is provided below.
[0066] Level Mapping Table 2
[0067]
[0068] Optionally, because the remaining bandwidth is significantly affected by sudden changes in traffic, it is prone to wide fluctuations within a short period. To make the measurement of the remaining bandwidth smoother, a low-pass filter can be used to reduce this jitter. A possible implementation method is provided below. Specifically, in... Figure 1 On this basis, Figure 3 A flowchart illustrating another dynamic load balancing port routing method provided in this embodiment of the invention is shown below. Figure 3 Step 101 includes:
[0069] Step 101-1: Determine the smooth adjustment processing cycle using a timer.
[0070] Step 101-2: Obtain the port comprehensive quality level of the previous moment at the export end as the initial level, and calculate the actual port comprehensive quality level at the current moment.
[0071] Step 101-3: If the difference between the actual port overall quality level and the initial level exceeds the preset fluctuation threshold, the output at the current moment will be the level value adjusted by a preset range based only on the initial level, and this will be used as the smoothed port quality level at the current moment.
[0072] Step 101-4: If the actual port overall quality level remains unchanged in subsequent time periods, then after each smoothing adjustment cycle, the output at the current time will be the level value adjusted by a preset range based only on the actual port overall quality level, which will be used as the smoothed port quality level at the current time.
[0073] Optionally, for the above-mentioned port overall quality level, taking the level range "0~8" as an example, the higher the level, the more sufficient the remaining bandwidth of the outgoing port.
[0074] Then, a timer is set, with a corresponding smooth adjustment processing period of T (e.g., T=100ms, the specific value can be adjusted according to the actual network scenario). The output level is specified to have a maximum preset amplitude of 1 within one period T (that is, the output level value can increase or decrease by a maximum of 1 after 1 T).
[0075] The following example assumes the initial state: at time t (initial time), the actual port integrated quality level is 4, and the output level is consistent with the actual level, denoted as Output(t)=4.
[0076] The following example is Scenario 1: The actual port overall quality level remains at a high level (actual port overall quality level = 7). If after time t, the actual port overall quality level jumps to 7 and remains there, the output smooth port quality level will gradually follow the rule of "increasing by a maximum of 1 per cycle T", see Scenario 1 illustration table 3.
[0077] Scenario 1 Illustration Table 3
[0078]
[0079] The following example is Scenario 2: The actual port overall quality level remains at a low level (actual level = 2). If the actual port overall quality level drops to 2 after time t and remains thereafter, the output smooth port quality level will gradually follow the rule of "decreasing by a maximum of 1 per cycle T". See Scenario 2 illustration table 4.
[0080] Scenario 2 Illustration Table 4
[0081]
[0082] Optionally, consider five equivalent egress ports A, B, C, D, and E, with smoothed port quality levels of 3-4-5-6-7 respectively. When a new traffic stream arrives, it needs to select the highest quality port, which will inevitably be egress port E (smoothed port quality level = 7). If multiple traffic streams select the highest quality egress port E within a very short time (before the measurement value has had time to change), this can easily cause congestion at E. However, other egress ports, such as C and D, which have decent quality, will not receive traffic, resulting in inappropriate scheduling. The following provides a possible implementation method to improve port quality during egress port selection. Specifically, in... Figure 1 On this basis, Figure 4 A flowchart illustrating another dynamic load balancing port routing method provided in this embodiment of the invention is shown below. Figure 4 Step 102 includes:
[0083] Step 102-1: Generate a random reference sequence.
[0084] Step 102-2: Determine the quality threshold for each position based on the value and corresponding selection weight in the random reference sequence, thus forming a random quality threshold sequence.
[0085] The selection weight represents the tendency for the corresponding export end to be selected.
[0086] Optionally, the above example uses five equivalent exit points A, B, C, D, and E as an illustration. Each exit point corresponds to a position in a random reference sequence. The value range of each bit in this random reference sequence is consistent with the value range of the "quality level" (e.g., 0~7). See Table 5 for a diagram illustrating the matching of the quality level value range and the selection weight:
[0087] Table 5 illustrates the matching of quality grade value ranges with selection weights.
[0088]
[0089] The probability ratio of each quality level is consistent with the selection weight ratio, namely 0:0:0:10:30:60:90:100. The weight of levels 0 to 2 is 0, which means that the exit end of the corresponding quality level will never be selected. The selection probability of levels 3 to 7 is allocated according to the weight ratio to achieve the preset goal of "higher quality level exit ends are more likely to be selected".
[0090] Suppose that a random reference sequence such as [30,10,9,13,10] can be generated using a Linear Feedback Shift Register (LFSR). Then, based on Table 5 above, the values of this sequence can be matched with the range of quality levels. The specific principle is: the value of each bit in the random reference sequence is compared with the selection weight of the corresponding bit, and the smallest selection weight greater than the value is found. For example, if 30 < 31 corresponding to selection weight (5), then the value of the corresponding position in the original random reference sequence is converted to 5; if 10 < 13 corresponding to selection weight (4), then the value of the corresponding position in the original random reference sequence is converted to 4; if 9 < 10 corresponding to selection weight (3), then the value of the corresponding position in the original random reference sequence is converted to 3; if 13 < 31 corresponding to selection weight (5), then the value of the corresponding position in the original random reference sequence is converted to 5; if 10 < 13 corresponding to selection weight (4), then the value of the corresponding position in the original random reference sequence is converted to 4.
[0091] Furthermore, based on the random reference sequence, the corresponding random quality threshold sequence is determined to be [5, 4, 3, 5, 4]. Since the range of random values is consistent with the "quality level" (0~7), and the generation probability strictly follows the selection weight ratio (i.e., random values are generated in a ratio of 0:0:0:10:30:60:90:100, with higher weight levels corresponding to higher random value generation probabilities), this ratio setting ensures that the output end of quality levels 0~2 will never be selected, while the selection ratio of 3~7 is based on the expected probability.
[0092] It should be noted that the random reference sequence generated by the LFSR is only 5 as an example, and this application does not limit the specific number of values contained in the sequence.
[0093] Step 102-3: Compare the quality levels of all smooth ports at the export end with the corresponding values in the random quality threshold sequence.
[0094] Optionally, if the port smoothing quality levels corresponding to the output end ABCDE in sequence are [3, 4, 5, 6, 7], then the comparison results between the port smoothing quality levels and the random quality threshold sequence are shown in Table 6 below:
[0095] Comparison Results Table 6
[0096]
[0097] Optionally, if the smooth port quality level is greater than the value at the corresponding position, then step 102-4 is executed; if the smooth port quality level is less than or equal to the value at the corresponding position, then step 102-5 is executed.
[0098] Step 102-4: Select the corresponding export terminal as a candidate export terminal.
[0099] Specifically, if the smooth port quality level of exit terminals C, D, and E is greater than the value at the corresponding position, it means that these three exit terminals meet the performance requirements, and their quality level can be raised to the highest level 7, thus being identified as candidate exit terminals.
[0100] Step 102-5: Designate the corresponding exit point as a non-candidate exit point.
[0101] Specifically, if the smooth port quality level of exit terminals A and B is less than or equal to the value at the corresponding position, then the value of the corresponding quality level remains unchanged, and the corresponding exit terminal is designated as a non-candidate exit terminal.
[0102] Based on the above process, the egress ports ABCDE have smoothed port quality levels of [3, 4, 7, 7, 7]. Then, from the candidate egress ports (C, D, E) with a quality level of 7 after the upgrade, an unbiased random selection algorithm is used to determine the final egress port (in this example, egress port C is selected in this round). This selection logic ensures that higher-quality ports participate in scheduling first, while random selection avoids excessive traffic concentration on a single optimal port (such as egress port E), achieving the dual goals of traffic balance and forwarding efficiency.
[0103] Optionally, to ensure the fairness of the random quality threshold sequence across all exits, a possible implementation method is provided below. Specifically, in Figure 4 On this basis, Figure 5 A flowchart illustrating another dynamic load balancing port routing method provided in this embodiment of the invention is shown below. Figure 5 Step 102 also includes:
[0104] Step 102-6: Generate random values.
[0105] Step 102-7: Take the random value as the tail position value in the random quality threshold sequence, and delete the head position value in the random quality threshold sequence to form the random quality threshold sequence for the next time step.
[0106] For example, the initial random quality threshold sequence is [5, 4, 3, 5, 4]. If the random number generated in the next time step is 6, then the new random sequence will be [4, 3, 5, 4, 6]. A random number is generated once per cycle, placed at the end of the queue, and removed from the queue when the correct number is at the beginning. This ensures fairness in the position of each generated random number across different sequences.
[0107] Optionally, since there can be one or more output terminals that ultimately meet the performance requirements, one possible selection method is provided below. Figure 1 On this basis, Figure 6 A flowchart illustrating another dynamic load balancing port routing method provided in this embodiment of the invention is shown below. Figure 6 Step 103 includes:
[0108] Step 103-1: Determine the number of the highest-level exit terminals.
[0109] If there are multiple highest-level exit terminals, proceed to step 103-2; if there is only one highest-level exit terminal, proceed to step 103-3.
[0110] Step 103-2: Randomly select one of the highest-level exit terminals as the final exit terminal.
[0111] Step 103-3: The corresponding exit end is used as the final exit end to ensure route selection efficiency.
[0112] It should be noted that the case of "only one highest-level egress port" does not contradict the problem it aims to solve. Taking egress port E as an example, even if multiple traffic flows into egress port E in a very short period of time (such as within 1-2 measurement periods), causing an increase in the utilization and latency of egress port E, the "smooth port quality level" of egress port E will decrease in the next measurement period. Once the level of egress port E is no longer "the only highest", the solution will trigger the routing logic of "multiple candidate egress ports" (such as fair screening combined with a random quality threshold sequence), naturally cutting off the concentration of subsequent traffic to egress port E and preventing the congestion from continuing to worsen.
[0113] In short, the "single highest level" is a short-term dynamic state, not a permanent state. The real-time updates of this application will become an automatic triggering mechanism for "congestion warning - level adjustment - traffic diversion".
[0114] Furthermore, the rule of "directly selecting the only highest-level egress terminal" usually implies "single routing based on traffic units (such as data packets or data streams)" rather than "one-time binding of batch traffic." This detail can further mitigate the risk of congestion: If traffic is routed single-time on a "data packet" basis: even if the first few data packets select egress terminal E, as long as the measurement value of egress terminal E is updated before subsequent data packets are routed (such as utilization exceeding the threshold), subsequent data packets will switch to other higher-level egress terminals; if traffic is bound to egress terminals on a "data stream" basis: the scheme usually limits the "duration of a single data stream" or periodically re-evaluates the quality level of the egress terminal during data stream transmission. Once egress terminal E shows signs of congestion, the data stream will be dynamically migrated to other egress terminals.
[0115] Clearly, this combination of "fine-grained routing and dynamic reassessment" can avoid the extreme situation where "multiple traffic flows indiscriminately toward the exit end in a very short period of time".
[0116] Optionally, in order to perform the steps in the above examples and achieve the corresponding technical effects, this application also provides a dynamic load balancing port routing device. A possible implementation is provided below. Figure 7 A schematic diagram of a dynamic load balancing port routing device provided in an embodiment of the present invention is shown below. Figure 7 The dynamic load balancing port routing device 20 includes: a level calculation module 200, a smoothing processing module 201, and a port selection module 202.
[0117] The grade calculation module 200 is used to determine the overall port quality grade of the corresponding egress terminal based on the load status and queue depth status of each egress terminal.
[0118] The smoothing module 201 performs low-pass filtering on the overall port quality level of each output end to obtain the smoothed port quality level of the output end.
[0119] The port selection module 202 compares the smoothed port quality level of all egress ports with the corresponding value in the random quality threshold sequence; if the smoothed port quality level is greater than the corresponding value, the corresponding egress port is selected as a candidate egress port; the egress port with the highest quality level is selected from all candidate egress ports as the final egress port to complete traffic scheduling.
[0120] Optionally, the port selection module 202 is specifically used to generate a random reference sequence; determine the quality threshold for each position based on the value of each position in the random reference sequence and the corresponding selection weight, thus forming a random quality threshold sequence; the selection weight represents the tendency of the corresponding exit end to be selected; compare the smoothed port quality level of all exit ends with the value of the corresponding position in the random quality threshold sequence; if the smoothed port quality level is greater than the value of the corresponding position, then the corresponding exit end is selected as a candidate exit end.
[0121] Optionally, the grade calculation module 200 is specifically used to collect the real-time load, real-time queue depth, average load of the previous time, and average queue depth of each egress terminal; determine the average load grade and average queue depth grade of each egress terminal based on the real-time load, real-time queue depth, average load of the previous time, and average queue depth of the previous time; determine the corresponding port comprehensive quality grade in the grade mapping table based on the average load grade and average queue depth grade of the egress terminal; the grade mapping table is used to maintain the mapping relationship between each average load grade, average queue depth grade, and port comprehensive quality grade.
[0122] Optionally, the smoothing module 201 is specifically used to determine the smoothing adjustment processing cycle through a timer; obtain the port comprehensive quality level of the previous moment at the output end as the initial level, calculate the actual port comprehensive quality level at the current moment; if the difference between the actual port comprehensive quality level and the initial level exceeds a preset fluctuation threshold, then the output at the current moment is the level value adjusted only on the basis of the initial level by a preset magnitude, which is used as the smoothed port quality level at the current moment; if the actual port comprehensive quality level at subsequent moments remains unchanged, then after each smoothing adjustment processing cycle, the output at the current moment is the level value adjusted only on the basis of the actual port comprehensive quality level by a preset magnitude, which is used as the smoothed port quality level at the current moment.
[0123] Optionally, the port selection module 202 is also used to generate a random value; use the random value as the tail position value in the random quality threshold sequence, and delete the head of the random quality threshold sequence.
[0124] Optionally, taking one inlet and five outlets (ABCDE) as an example, the above-mentioned dynamic load balancing port routing device is illustrated. Specifically, in Figure 7 On this basis, Figure 8 A schematic diagram of a dynamic load balancing port routing device provided in an embodiment of the present invention is shown below. Figure 8(Where solid lines represent data flow and dashed lines represent control flow), in this dynamic load balancing port routing device 20, each egress end is equipped with a port information acquisition unit 203-X, for example, egress end A is equipped with port information acquisition unit 203-1, egress end B is equipped with port information acquisition unit 203-2, etc.
[0125] This port information acquisition unit is used to collect the real-time load of the corresponding egress end and send it to the bandwidth collection unit 200-1.
[0126] See Figure 8 The quality level calculation module 200 includes a bandwidth collection unit 200-1, a queue information collection unit 200-2, and a quality level calculation unit 200-3.
[0127] Among them, the bandwidth collection unit 200-1 is used to receive the real-time load sent by each port information collection unit.
[0128] The queue information collection unit 200-2 is used to receive the real-time queue depth sent by the queue scheduling unit 202-2.
[0129] Quality rating calculation unit 200-3 is used to determine the overall port quality rating of each output terminal based on the load status and queue depth status of each output terminal.
[0130] See Figure 8 The smoothing module 201 includes a low-pass filter processing unit 201-1 and a quality level storage unit 201-2.
[0131] The low-pass filter processing unit 201-1 is used to perform low-pass filtering on the overall port quality level of each output end to obtain the smooth port quality level corresponding to each output end.
[0132] The quality level storage unit 201-2 is used to store the smooth port quality level corresponding to each output end.
[0133] See Figure 8 The port selection module 202 includes a quality level enhancement and routing calculation unit 202-1 and a queue scheduling unit 202-2.
[0134] The quality level enhancement and routing calculation unit 202-1 generates a weighted random quality threshold sequence based on the smooth port quality level corresponding to each exit end. It compares the smooth port quality level with the corresponding threshold in the random quality threshold sequence. If the smooth level is greater than the threshold, the port is enhanced to the highest level, and candidate exit ends are selected. The exit end with the highest level is selected from the candidate ends (if there are multiple highest levels, one is randomly selected) to determine the final exit end.
[0135] The queue scheduling unit 202-2 receives the "final output port" information and schedules the traffic at the ingress end to the corresponding output end.
[0136] Optionally, this application also provides a network device that can be deployed as shown in the examples above. Figure 7 or Figure 8 The port routing device for dynamic load balancing shown will execute the various functions of the corresponding example to achieve the corresponding technical effect.
[0137] The network device embodiments shown in this specification can be applied to computer devices, such as servers or terminal devices. The device embodiments can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor in which it is located reading the corresponding computer program instructions from non-volatile memory into memory and executing them. From a hardware perspective, this is a hardware structure diagram of a computer device where the file processing device of the embodiments of this specification is located. In addition to the processor, memory, network interface, and non-volatile memory, the server or electronic device where the network device is located in the embodiments may also include other hardware depending on the actual function of the computer device, which will not be described in detail here.
[0138] The implementation process of the functions and roles of each module in the above network device is detailed in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0139] For network device embodiments, since they basically correspond to method embodiments, relevant details can be found in the descriptions of the method embodiments. The network device embodiments described above are merely illustrative; the modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, meaning they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution described in this specification, depending on actual needs. Those skilled in the art can understand and implement this without any inventive effort.
[0140] The foregoing has described exemplary embodiments of this specification. It should be understood that in some cases, the modules described in this specification may be divided in a manner different from that in the embodiments, and the described actions or steps may be performed in a different order than that in the embodiments, while still achieving the desired result. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0141] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a program product. This program product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0142] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not illustrated herein.
[0143] The above are merely preferred embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification shall be included within the scope of protection of this specification.
Claims
1. A port routing method for dynamic load balancing, characterized in that, include: Collect the real-time load, real-time queue depth, average load of the previous time step, and average queue depth of the previous time step for each exit point. The average load level and average queue depth level of each egress terminal are determined based on the real-time load, the real-time queue depth, the average load of the previous time step, and the average queue depth of the previous time step. Based on the average load level and the average queue depth level at the export end, the corresponding port overall quality level is determined in the level mapping table; the level mapping table is used to maintain the mapping relationship between each average load level, the average queue depth level and the port overall quality level; The overall port quality level of each of the output terminals is subjected to low-pass filtering to obtain the smoothed port quality level of the output terminals; Generate a random reference sequence; Based on the value of each position in the random reference sequence and the corresponding selection weight, the quality threshold of each position is determined to form a random quality threshold sequence; the selection weight represents the tendency of the corresponding exit end to be selected. Compare the quality levels of all smoothed ports at the export end with the values at the corresponding positions in the random quality threshold sequence; If the quality level of the smooth port is greater than the value corresponding to the position, then the corresponding exit end will be selected as a candidate exit end. Select the highest-level exit point from all the candidate exit points as the final exit point to complete the traffic scheduling.
2. The method according to claim 1, characterized in that, The step of performing low-pass filtering on the overall port quality level of each output terminal to obtain the smoothed port quality level of the output terminal includes: The smoothing adjustment processing cycle is determined by a timer; The port's overall quality level at the previous moment is obtained as the initial level, and the actual port overall quality level at the current moment is calculated. If the difference between the actual port overall quality level and the initial level exceeds a preset fluctuation threshold, the output at the current moment is a level value that is adjusted by a preset magnitude based only on the initial level, and is used as the smoothed port quality level at the current moment. If the actual port overall quality level remains unchanged in subsequent time periods, then after each smoothing adjustment cycle, the output at the current time will be the level value adjusted by a preset range based only on the actual port overall quality level, which will be used as the smoothed port quality level at the current time.
3. The method according to claim 1, characterized in that, Also includes: Generate random values; The random value is used as the tail position value in the random quality threshold sequence, and the head position value in the random quality threshold sequence is deleted to form the random quality threshold sequence for the next time step.
4. The method according to claim 1, characterized in that, The step of selecting the highest-level exit point from all candidate exit points as the final exit point to complete traffic scheduling includes: Determine the number of the highest-level export terminals; If there are multiple highest-level exit terminals, then one of the multiple highest-level exit terminals will be randomly selected as the final exit terminal. If there is only one exit point of the highest level, then the corresponding exit point shall be used as the final exit point to ensure route selection efficiency.
5. A port routing device for dynamic load balancing, characterized in that, include: The ranking calculation module is used to collect the real-time load, real-time queue depth, average load of the previous time, and average queue depth of each exit end. Based on the real-time load, real-time queue depth, average load of the previous time step, and average queue depth of each egress terminal, the average load level and average queue depth level of the egress terminal are determined; based on the average load level and average queue depth level of the egress terminal, the corresponding port overall quality level is determined in the level mapping table; the level mapping table is used to maintain the mapping relationship between each average load level, the average queue depth level, and the port overall quality level. A smoothing module is used to perform low-pass filtering on the overall port quality level of each output end to obtain the smoothed port quality level of the output end. The port selection module generates a random reference sequence; based on the value of each position in the random reference sequence and the corresponding selection weight, it determines the quality threshold for each position, forming a random quality threshold sequence; the selection weight represents the tendency for the corresponding egress port to be selected; it compares the smoothed port quality level of all egress ports with the corresponding position value in the random quality threshold sequence; if the smoothed port quality level is greater than the corresponding position value, the corresponding egress port is selected as a candidate egress port; the egress port with the highest level is selected from all the candidate egress ports as the final egress port, completing traffic scheduling.
6. A network device, characterized in that, include: Memory, used to store one or more programs; processor; When the one or more programs are executed by the processor, the method as described in any one of claims 1-4 is implemented.
7. A program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Load balancing method and device and related equipment
CN120429113A
Traffic distribution method and device, network equipment and computer readable storage medium
CN120434190A
Technique for adaptively load balancing connections in multi-link trunks
US7787370B1