A method for dynamically switching routing functions
Patent Information
- Application Number
- CN202610801417.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-04
- Publication Date
- 2026-09-01
AI Technical Summary
然而,该方案仅依赖CPU使用率一项指标,未考虑网络负载的多维特征;由于CPU采样存在瞬时性,当采样时刻恰好遇到动态主机配置协议(DHCP)请求、地址解析协议(ARP)报文处理或后台固件升级等短时运算任务时,即使实际转发面负载并未饱和,也会触发附加功能的误关闭,反而造成用户体验的频繁波动
(1)本发明通过同时采集软件转发PPS、软中断占用率及conntrack连接数构建多维负载向量,并引入终端侧体验反馈向量(延迟、丢包率、接收信号强度指示及重传率)构建设备-终端体验偏差因子,实现了设备端转发面负载与终端实际网络体验的关联比对。当设备端负载指标与终端体验状态出现正向偏差(假性高负载)或负向偏差(感知盲区)时,自动对迟滞回环阈值对进行动态校准,从而避免了现有技术中仅依赖单一CPU使用率指标导致的瞬时运算任务误判,以及设备端负载感知与终端实际体验脱节的问题,提升了负载状态判定的准确性与可靠性;
Smart Images

Figure CN122679080A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of dynamic switch technology, and in particular to a method for a dynamic switch with routing function. Background Technology
[0002] With the widespread adoption of home network products such as optical modems, routers, and customer premises equipment (CPE), features like dual-band WiFi hotspots, Quality of Service (QoS) guarantees, and wireless roaming have become standard features for enhancing user experience. However, these additional features consume significant CPU resources during operation. When basic routing and forwarding functions already result in high CPU usage, continuing to run additional features like QoS queue scheduling and proactive roaming scanning will significantly reduce the device's actual service capabilities, manifesting as noticeable latency, packet loss, or even connection interruptions for accessing terminals.
[0003] Existing solutions to the above problems mainly fall into two categories. The first type of solution only provides a manual hard switch, allowing users or maintenance personnel to manually enable or disable additional functions based on experience. This method cannot detect the real-time load status of the device. When network traffic suddenly increases, the additional functions continuously consume CPU resources, causing users to directly perceive a deterioration in network quality. The second type of solution employs an automatic background monitoring mechanism. By periodically sampling CPU utilization, it automatically disables QoS or roaming functions to release computing power when CPU utilization exceeds a single fixed threshold. However, this solution relies solely on CPU utilization and does not consider the multidimensional characteristics of network load. Due to the transient nature of CPU sampling, if the sampling time coincides with short-duration computational tasks such as Dynamic Host Configuration Protocol (DHCP) requests, Address Resolution Protocol (ARP) packet processing, or background firmware upgrades, even if the actual forwarding plane load is not saturated, it can trigger the erroneous shutdown of additional functions, causing frequent fluctuations in user experience.
[0004] Furthermore, existing technology for function switch control often employs a binary state (full function enabled or full function disabled), lacking an intermediate transition state near the load threshold. This leads to frequent transitions between enabled and disabled states, causing switch oscillations. Additionally, existing technology lacks a cool-down period latch after each state switch, causing additional functions to be repeatedly started and stopped within a short period, further exacerbating the jitter in terminal service flows. Because existing technology only considers the device's own load for judgment, failing to incorporate the actual network experience of the accessing terminal (such as latency, packet loss rate, signal strength, and retransmission rate) into the decision-making loop, a discrepancy arises between the device's perceived load and the terminal's actual experience. Summary of the Invention
[0005] The purpose of this invention is to provide a method for dynamically switching routing functions to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for dynamically switching routing functions, comprising the following steps: Obtain multi-dimensional load metrics for the routing device, including software forwarding percentages (PPS), etc. Soft interrupt utilization and conntrack connection count; Based on the multidimensional load index, a recursive determination window is constructed, and the recursive consistency factor and recursive trend factor are calculated. Based on the recursive consistency factor, recursive trend factor, recursive confirmation count M, and the preset hysteresis loopback threshold of the multi-level load ladder, it is determined whether to generate a ladder switching intention. Each ladder in the multi-level load ladder corresponds to a different additional function activation configuration. Establish a ladder-additional function mapping table, which records the activation configuration relationship between each ladder level and additional functions; When the ladder switching intention is generated, the corresponding additional function is gradually stripped or restored according to the ladder-additional function mapping relationship between the current ladder level and the target ladder level. After the step switching intention is executed, an adaptive cooling period latch is initiated, and the duration of the adaptive cooling period is dynamically adjusted according to the historical step oscillation frequency.
[0007] Preferably, constructing a recursive decision window based on the multidimensional load index includes: Maintain a time-series sliding window of length N to store the multidimensional load vectors of the most recent N sampling periods; The recursive consistency factor is calculated as the ratio of the number of samples that continuously fall into the target step interval within the time-series sliding window to the total length of the window. The recursive trend factor is calculated as the weighted first-order rate of change of the multidimensional load vector within the time-series sliding window.
[0008] Preferably, the determination of whether a tiered switching intention is generated includes: When the current position is at level k, if the multidimensional load index exceeds the entry threshold of level (k+1) for M consecutive times... When the recursive consistency factor is not lower than the first preset value and the recursive trend factor is positive, a step-by-step switching intention to upgrade from level k to level k+1 is generated. When the multidimensional load index falls below the exit threshold of the k-th step for M consecutive times... When the recursive consistency factor is not lower than the first preset value and the recursive trend factor is negative, a step-by-step switching intention from level k to level k-1 is generated. When the multidimensional load index is in the hysteresis dead zone of the k-th step. During this period, no staircase switching intent is generated.
[0009] Preferably, constructing a recursive decision window based on the multidimensional load index further includes: Obtain the terminal-side experience feedback vector accessing the routing device. The terminal-side experience feedback vector includes the latency, packet loss rate, received signal strength indication, and retransmission rate periodically reported by the terminal. The terminal-side experience feedback vector is correlated and compared with the multi-dimensional load index to construct a device-terminal experience deviation factor; Based on the deviation direction of the device-terminal experience deviation factor, the hysteresis loop threshold of the multi-level load ladder is dynamically calibrated. The calculation of the recursive trend factor incorporates the historical statistical values of the device-terminal experience deviation factor to drive the continuous adaptive drift of the hysteresis loop threshold pair.
[0010] Preferably, the hysteresis loopback threshold pair of the multi-level load ladder is dynamically calibrated according to the deviation direction of the device-terminal experience deviation factor, including: When the device-terminal experience deviation factor is positive (i.e., the multidimensional load index is higher than the load benchmark value corresponding to the current step and the terminal-side experience feedback vector is in the normal range), it is determined to be a false high load on the device side. This suppresses the currently generated upgrade step switching intention and raises the entry threshold of the current step. ; When the device-terminal experience deviation factor is negative, meaning the multidimensional load index is not higher than the load benchmark value corresponding to the current step and the terminal-side experience feedback vector is in the deterioration range, it is determined to be a device-side perception blind spot, and the entry threshold of the current step is lowered. In order to trigger the intention of switching upgrade tiers in advance; When the device-terminal experience deviation factor is zero, the current configuration of the hysteresis loopback threshold pair is maintained.
[0011] Preferably, the number of recursive confirmations M is an adaptive confirmation parameter, and the method further includes: Obtain the terminal-side experience feedback vectors reported by each of the multiple terminals connected to the routing device; The terminal weight is determined based on the priority of each terminal's service type, current traffic share, and access duration. Based on the terminal weights, the terminal-side experience feedback vectors of the multiple terminals are weighted and aggregated to generate an aggregated experience deviation factor. The M value is dynamically adjusted based on the degree of experience degradation of high-weight terminals in the aggregated experience deviation factor.
[0012] Preferably, the M value is dynamically adjusted based on the degree of experience degradation of high-weight terminals in the aggregated experience deviation factor, including: When the experience feedback vector of a high-weight terminal enters the deterioration range, the M value is lowered to shorten the recursive confirmation cycle. When the experience feedback vector of only low-weight terminals enters the deterioration range, the M value is increased to extend the recursive confirmation period; When the experience feedback vectors of the multiple terminals are in the same direction, the baseline M value is maintained.
[0013] Preferably, during the adaptive cooling period latch duration, the current tier level and corresponding additional function enabling configuration remain unchanged, and the following steps are performed: Calculate the remaining load margin between the entry threshold of the next level of the current ladder level and the real-time multidimensional load evaluation value calculated based on the multidimensional load index; The pulsation rhythm factor is calculated based on the rate of change of the remaining load margin and the recursive trend factor. Based on the pulse rhythm factor, the execution intensity of the currently enabled additional functions is adjusted slightly by non-uniform time intervals.
[0014] Preferably, based on the pulse rhythm factor, the execution intensity of the currently enabled additional functions is adjusted slightly over non-uniform time intervals, including: When the rate at which the remaining load margin narrows is greater than a preset rate threshold, the execution interval of the micro-adjustment is shortened, and the execution intensity of the additional function is reduced within the range allowed by the current step level to perform pre-stripping pulses. When the remaining load margin stabilizes and recovers, the execution interval of the micro-adjustment is extended, and the pre-stripping pulses that have been executed are gradually rolled back to restore the execution intensity of the additional function.
[0015] Preferably, the method further includes: Establish a stepped oscillation trajectory log to record the trigger time, time period, multi-dimensional load fingerprint before switching, and switching direction sequence of each stepped switching event; Periodic clustering of historical trajectories in the stepped oscillation trajectory log is performed to identify high-frequency recurring oscillation patterns; When the current multidimensional load metric matches a known periodic oscillation pattern with the switching direction sequence, a ladder dwell lock is triggered. During the period when the tiered dwell lock is in effect, the response to a tiered switching intention that is opposite to the direction of the most recent tiered switching is blocked, and the current tiered level is forcibly maintained for one dwell cycle. During the dwell period, the current tier level and corresponding additional function activation configuration remain unchanged, and internal fine-tuning is performed on the currently activated additional functions according to the pulse control mechanism during the adaptive cooling period latch. The length of the dwell period is adaptively determined based on the historical average oscillation period duration of the periodic oscillation pattern. When the terminal-side experience feedback vector continues to deteriorate during the dwell period, the tiered dwell lock is forcibly released, and the tiered switching intention is responded to normally.
[0016] The technical effects and advantages of this invention are as follows: (1) This invention obtains PPS data simultaneously by forwarding it through software. A multi-dimensional load vector is constructed using soft interrupt utilization and conntrack connection count. A terminal-side experience feedback vector (latency, packet loss rate, received signal strength indication, and retransmission rate) is introduced to construct a device-terminal experience deviation factor, enabling a correlation comparison between the device-side forwarding plane load and the actual network experience of the terminal. When there is a positive deviation (false high load) or a negative deviation (perception blind spot) between the device-side load indicators and the terminal experience status, the hysteresis loopback threshold is automatically dynamically calibrated. This avoids the problem of instantaneous computational task misjudgment caused by relying solely on a single CPU utilization indicator in existing technologies, as well as the disconnect between device-side load perception and the actual terminal experience, thus improving the accuracy and reliability of load status determination. (2) This invention calculates the recursive consistency factor and weighted trend factor by maintaining a time-series sliding window of length N, and combines the recursive confirmation number M and the hysteresis loop threshold of the multi-level load ladder to determine the ladder switching, thus avoiding the noise defect of triggering state jumps by a single instantaneous sampling; at the same time, the ladder-additional function mapping table decomposes the additional functions into sub-function modules for gradual stripping or restoration (such as only turning off roaming active scanning while retaining BSS switching), instead of the binary all-on and all-off of the prior art, so as to smoothly release CPU resources at the sub-function granularity when the load approaches the critical point, ensuring the continuity of basic routing forwarding and key additional services; (3) After the intention to switch steps is executed, the present invention starts the adaptive cooling period latch with the start duration dynamically adjusted according to the historical step oscillation frequency. During the cooling period, the remaining load margin and pulsation rhythm factor are calculated to perform a slight adjustment of the non-uniform time interval of the execution intensity of the currently enabled additional functions (such as pre-stripping pulsation or back-off pulsation). This suppresses the frequent reciprocating oscillations of the step level while avoiding the response rigidity problem caused by the complete freezing of function adjustment during the cooling period, thus achieving a balance between oscillation suppression and dynamic load tracking. (4) This invention determines the terminal weight based on the terminal service type priority, traffic ratio and access duration, and generates an aggregated experience deviation factor by weighting and aggregating the multi-terminal experience feedback vectors. Then, it dynamically adjusts the recursive confirmation number M value (shortening the confirmation period when the experience of high-weight terminals deteriorates and extending the confirmation period when the experience of low-weight terminals fluctuates), so that the routing device can prioritize responding to the experience deterioration of high-priority terminals such as voice and video, while avoiding interference from occasional fluctuations of background downloads or IoT devices with global judgment. Thus, it realizes the differentiated protection of key business terminals and the adaptive optimization of the confirmation threshold. (5) This invention establishes a ladder oscillation trajectory log and performs periodic clustering to identify high-frequency recurring oscillation patterns (such as repeated switching during a specific period), thereby triggering ladder dwell lock to forcibly maintain the current ladder level, and performing internal micro-adjustment according to the pulse control mechanism during the dwell period. At the same time, the continuous deterioration of the terminal experience is used as a safety valve for forced unlocking, thereby actively avoiding predictable oscillation paths and avoiding the inherent defects of repeated jumps at the threshold boundary in the prior art. It achieves a technological leap from passively shortening the cooling period after oscillation to actively identifying and avoiding oscillation, thereby improving the stability of network services and the consistency of user experience. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the dynamic switching method of the present invention; Figure 2 This is a logic diagram for constructing the recursive decision window and determining the intention of the step-by-step switching in this invention; Figure 3 This is a logic diagram for closed-loop calibration and dynamic threshold adjustment of the terminal experience in this invention. Detailed Implementation
[0018] The following will refer to the appendices in the embodiments of the present invention. Figure 1-3 The technical solutions in the embodiments of the present invention are clearly and completely described herein. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0019] Example 1: A specific implementation method for a public routing device to construct a recursive decision window based on multi-dimensional load indicators and generate tiered switching intentions.
[0020] S1, obtain the multi-dimensional load indicators of the routing device and determine the real-time multi-dimensional load evaluation value.
[0021] In this example, the router collects the following three multi-dimensional load metrics from the device forwarding plane once per second: software forwarding PPS (number of packets forwarded per second). The metrics include soft interrupt utilization (the percentage of total CPU time spent on network receive soft interrupts) and conntrack connections (the number of active connections in the current NAT connection tracking table). After data collection, these three metrics are compared with their respective historical maximum values, and the highest percentage among them is taken as the real-time multidimensional load evaluation value for the current period, also known as the load score. For example, if the PPS collected in a certain second is 85% of the historical maximum, soft interrupts are 70%, and connections are 60%, then the real-time multidimensional load evaluation value for that period is recorded as 85 points.
[0022] S2, constructs a recursive decision window based on multi-dimensional load indicators.
[0023] In this example, a first-in-first-out (FIFO) queue of length 5 is maintained in the router's memory, storing real-time multidimensional load assessment values for a maximum of the last 5 sampling periods. Every second, a newly calculated load score is added to the tail of the queue; if the queue is full, the earliest added record is removed from the head of the queue, ensuring that the queue always contains the 5 most recent results.
[0024] The recursive consistency factor ratio is calculated as follows: The router determines the target step interval based on the current step switching direction to be determined, and divides the number of samples that continuously fall into the target step interval by the total window length to obtain the recursive consistency factor.
[0025] When determining the intention to upgrade from Level 1 to Level 2, the target step interval is the load interval of Level 2 (i.e., a load score between 70 and 100). If at least 3 out of 5 samples in the queue fall consecutively within this target step interval, the recursive consistency factor is 3 divided by 5, which is 0.6. This ratio is compared with a first preset value of 0.6. If it is greater than or equal to 0.6, the recursive consistency factor is considered to meet the requirements and is recorded as valid; if it is less than 0.6, it is considered not to meet the requirements.
[0026] When determining the intention to downgrade from Level 1 to Level 0, the target step interval is the load interval of Level 0 (i.e., the load score is between 0 and 80). If at least 3 out of 5 samples in the queue fall consecutively into this target step interval, the recursive consistency factor is also 0.6, which is used to determine whether the requirement is met.
[0027] Weighted Calculation of Recursive Trend Factor: When comparing trends, the router assigns time weights to each sample within a time-series sliding window, with more recent samples having higher weights. For example, the weights of 5 samples within the window in chronological order are 1, 2, 3, 4, and 5. The weighted sum of load scores is calculated and compared with the sum of the equally weighted simple average. If the difference between the weighted upward trend and the simple average trend is greater than 5% of the simple average score, the recursive trend factor is considered positive; if the difference is less than -5%, it is considered negative; if the difference is between +5% and -5%, it is considered to have no obvious trend. For example, if the scores of the 5 samples are 70, 72, 75, 78, and 80, and the simple average trend is from 70 to 80 (an increase of 10 points), the weighted recent samples have higher weights, and the difference between the weighted sum and the simple average upward trend exceeds 5%, therefore it is considered positive.
[0028] It should be noted that the queue length of 5, the weight sequence of 1 to 5, the first preset value of 0.6, and the 5% difference range are all preferred values. In actual deployment, they can be adjusted according to the router's memory capacity and the degree of fluctuation in the network environment.
[0029] S3 determines whether to generate a ladder switching intention based on the recursive consistency factor, recursive trend factor, recursive confirmation count M, and the preset hysteresis loop threshold of the multi-level load ladder.
[0030] In this example, corresponding load entry and exit thresholds are pre-configured for each level of the ladder, as shown in the table below:
[0031] If, in the current situation of being at level 1, the real-time multidimensional load evaluation value of 5 consecutive samples (M=5) is higher than 90 points, and the recursive consistency factor is in a valid state and the recursive trend factor is positive, then a ladder switching intention to upgrade from level 1 to level 2 will be generated.
[0032] If, in the current situation of being at level 1, the real-time multidimensional load evaluation value of five consecutive samples is below 60 points, and the recursive consistency factor is in a valid state and the recursive trend factor is negative, then a ladder switching intention to downgrade from level 1 to level 0 is generated.
[0033] If the real-time multidimensional load evaluation value is between 60 and 90 points, it is within the hysteresis dead zone of the first tier and no tier switching intention is generated.
[0034] It should be noted that the baseline value of 5 for the above-mentioned number of recursive confirmations M is an initial setting value. This value will be dynamically adjusted in subsequent embodiments based on terminal experience feedback. The threshold values of each level can also be configured to fluctuate up or down according to the device hardware performance and the target network scenario.
[0035] S4, establish a tiered-additional function mapping table, and perform progressive stripping or restoration operations according to the tiered switching intention.
[0036] In this example, the following ladder-additional function mapping table is pre-established:
[0037] When a tiered handover intention to upgrade from Level 0 to Level 1 is generated, QoS deep packet inspection and roaming active scanning are turned off according to the table above, while other functions remain on; when a tiered handover intention to downgrade from Level 1 to Level 0 is generated, QoS deep packet inspection and roaming active scanning are turned on again according to the table above.
[0038] It should be noted that the above-mentioned gradual stripping or recovery operations are executed one by one in the priority order of the mapping table. After each sub-function is closed or opened, wait 2 seconds to observe the changes in the real-time multi-dimensional load evaluation value before continuing to execute the next sub-function, so as to avoid the impact of batch state jumps on the business flow.
[0039] S5, initiate adaptive cooldown period latch.
[0040] In this example, an adaptive cooldown period is initiated after each tiered handover intent is executed. The base duration of the cooldown period is 5 seconds. The router checks the most recent 10 tiered handover records for any reverse handovers (e.g., an upgrade followed immediately by a downgrade). If a reverse handover is found, 3 seconds are added to the base duration; if two or more reverse handovers are found, 6 seconds are added; the maximum cooldown period is 30 seconds. During the cooldown period, no new tiered handover intents are responded to.
[0041] Example 2: A detailed implementation method for obtaining terminal experience feedback and dynamically calibrating the tiered switching threshold using a public router.
[0042] S1, obtain the terminal-side experience feedback vector.
[0043] In this example, the router receives experience data reported by the access terminal every 2 seconds, including the following four items: latency (round-trip time to the gateway measured by the terminal), packet loss rate (percentage of packets lost in the last 2 seconds), Received Signal Strength Indicator (RSSI, in dBm), and retransmission rate (proportion of packets that need to be retransmitted in the last 2 seconds). The reporting method is that the terminal sends periodic UDP heartbeat messages to the router's management plane.
[0044] S2, Construct the device-terminal experience deviation factor.
[0045] In this example, the router compares the current real-time multi-dimensional load evaluation value on the device with the experience status reported by the terminal within a range to construct a three-state deviation judgment: If the device load score is higher than 80 points, and the terminal reports a latency of less than 50 milliseconds, a packet loss rate of less than 1%, and a retransmission rate of less than 2%, then it is determined to be a false high load on the device, and the device-terminal experience deviation factor is a positive deviation. If the device load score is not higher than 60 points, and the latency reported by the terminal is higher than 100 milliseconds, or the packet loss rate is higher than 3%, or the retransmission rate is higher than 5%, it is determined to be a device perception blind spot, and the device-terminal experience deviation factor is a negative deviation. If the device load score and the terminal experience status are in the same range (e.g., the load score is higher than 80 points and the terminal latency is also higher than 100 milliseconds, or the load score is lower than 60 points and the terminal latency is also lower than 50 milliseconds), it is judged as zero deviation.
[0046] It should be noted that the above-mentioned latency of 50 milliseconds and 100 milliseconds, packet loss rate of 1% and 3%, and retransmission rate of 2% and 5% are all preferred thresholds set based on the tolerance of common home broadband services. In actual deployment, these thresholds can be adjusted according to the target user group and service type.
[0047] S3, dynamically calibrate the hysteresis loop threshold according to the deviation direction.
[0048] In this example, when a positive deviation is detected, the router suppresses the currently generated upgrade ladder switching intention and raises the upgrade entry threshold of the current ladder by a fixed step size of 5 points. For example, the upgrade entry threshold from level 1 to level 2, originally set at 90 points, is raised to 95 points to avoid misjudgment caused by instantaneous computing tasks on the device side.
[0049] When a negative deviation is detected, the router lowers the upgrade entry threshold of the current tier by a fixed step of 5 points. For example, the upgrade entry threshold from tier 1 to tier 2, which was originally set at 90 points, is lowered to 85 points to trigger the upgrade earlier and ensure a better user experience for end users.
[0050] When the deviation is determined to be zero, the threshold is not adjusted.
[0051] It should be noted that the adjustment step size of 5 points mentioned above is a fixed step size. In actual deployment, it can be adjusted to a fixed value between 3 and 8 points depending on the severity of network fluctuations. The calculation of the recursive trend factor also incorporates the historical statistical values of the device-terminal experience deviation factor in the most recent 10 periods. If the frequency of negative deviation is higher than that of positive deviation in the historical statistics, an additional downward weighting tendency will be added to the trend factor determination.
[0052] Example 3: Specific implementation method of dynamically adjusting the number of recursive acknowledgments M based on the priority of multi-terminal services in a public router.
[0053] S1: Obtain multi-terminal experience feedback and determine terminal weights.
[0054] In this example, the router determines the service type priority for each currently connected terminal, as shown in the table below:
[0055] Real-time detection of terminal weight: The router counts the downlink traffic bytes of each terminal every 5 seconds and calculates the percentage of that terminal's traffic to the router's total outbound traffic. If a terminal's traffic percentage exceeds 50% for two consecutive statistical periods (i.e., within 10 seconds), a weight increase is triggered. Access duration is calculated from the moment the terminal completes 802.11 association authentication. The router maintains an online duration counter, and a weight increase is triggered every 30 minutes.
[0056] The router determines the current weight level of each terminal based on the table above and real-time detection results. For example, a terminal that is making a voice call and accounts for more than 50% of the data traffic has the highest weight level; a terminal that is only downloading files in the background has a low weight level.
[0057] S2 generates the aggregate experience deviation factor and dynamically adjusts the M value.
[0058] The weighted calculation of the aggregated experience deviation factor: The router assigns a weight coefficient to the experience deviation state of each terminal: the highest weight level corresponds to a coefficient of 3, high to 2, medium to 1, low to 0.5, and the lowest to 0.2. The current experience deviation state of each terminal (normal is recorded as 0, deterioration as 1) is multiplied by its corresponding weight coefficient, summed, and then divided by the sum of the weight coefficients of all connected terminals to obtain the aggregated experience deviation factor. For example, if there are 3 connected terminals, at the highest level (deterioration), medium level (normal), and low level (normal), the aggregated experience deviation factor is (3×1+1×0+0.5×0) divided by (3+1+0.5), which is 3 divided by 4.5, approximately equal to 0.67.
[0059] Dynamic adjustment of the number of recursive acknowledgments M: The router performs a double check to determine the direction of M value adjustment. If the aggregated experience deviation factor is greater than 0.5, and at least one of the terminals with the highest or highest weight level is in a deteriorating state, it is determined that there is a concentrated deterioration trend in high-weight terminals. The number of recursive confirmations M is reduced from the baseline value of 5 to 2 to shorten the recursive confirmation cycle and respond quickly. If the aggregated experience deviation factor is greater than 0.5, but the terminals with the highest or highest weight level are all in normal condition, it is determined that a large number of low-weight terminals are deteriorating in a concentrated manner. M is increased from the baseline value of 5 times to 8 times to avoid misjudgment. If the aggregated experience deviation factor is no greater than 0.5, and the experience changes of all terminals are in the same direction (all deteriorate or all remain normal), then M is maintained as the baseline value for 5 times.
[0060] The linkage between the M value and the recursive decision window: When the number of recursive confirmations M is reduced, the length N of the recursive decision window is shortened synchronously to maintain a matching relationship between N and M. For example, when M is reduced to 2 times, N is shortened to 3 times synchronously, and the first preset value is adjusted to 0.5 synchronously to ensure that the determination of the consistency factor is always effective; when M is restored to the baseline value of 5 times, N is restored to 5 times synchronously, and the first preset value is restored to 0.6.
[0061] It should be noted that the above 2 and 8 times are the upper and lower limits of the M value. In actual deployment, it can be adjusted according to the router's CPU processing capacity and network real-time requirements, but the M value must always be a positive integer.
[0062] Example 4: A specific implementation method for non-uniform micro-adjustment of the execution intensity of additional functions during the cooling-off period latching period is disclosed.
[0063] S1, calculate the remaining load margin.
[0064] In this example, during the adaptive cooldown latch period, the router recalculates the remaining load margin every second. The remaining load margin equals the upgrade threshold for the next tier minus the current real-time multidimensional load assessment value. For example, if the router is currently at tier 1, the upgrade threshold for the next tier is 90 points, and the current real-time multidimensional load assessment value is 85 points, then the remaining load margin is 5 points.
[0065] S2 calculates the pulsation rhythm factor and performs non-uniform micro-adjustment.
[0066] The pulsation rhythm factor level is determined as follows: Based on the remaining load margin calculated in the last three calculations and the direction of the recursive trend factor, the router determines the pulsation rhythm factor level and execution interval using the following two-dimensional judgment matrix:
[0067] In this example, if the remaining load margin has continuously narrowed in the last three observations, with each narrowing exceeding 2 points, and the recursive trend factor is positive, then the pulsation rhythm factor is set to the emergency level, and the micro-adjustment execution interval is 1 second. Simultaneously, within the current tier's allowable range, the execution intensity of additional functions is reduced: for example, switching QoS queue scheduling from fine-grained mode (per packet classification) to coarse-grained mode (per flow classification), or reducing the roaming active scan frequency from 10 times per second to 3 times per second, performing pre-stripping pulsation.
[0068] If the remaining load margin steadily increases in the last three observations, and the recursive trend factor is negative, then the pulsation rhythm factor is set to a moderate level, with an execution interval of 12 seconds. Simultaneously, the previously executed frequency reduction operation is gradually rolled back, restoring the QoS fine-grained mode or roaming scan frequency, and the rollback pulsation is executed.
[0069] It should be noted that the above execution interval is a preferred value. In actual deployment, it can be adjusted according to the startup overhead of the router's additional functions and the sensitivity of the services. The frequency reduction amplitude of the pre-stripping pulse can also be limited according to the mapping table corresponding to the current tier level to ensure that it does not exceed the functional range allowed by that tier.
[0070] Example 5: Specific implementation method of public router identifying periodic oscillation patterns and triggering residency lock.
[0071] S1, establish a step oscillation trajectory log.
[0072] In this example, the router records a log entry each time a tiered handover occurs, containing the following fields: the day of the week (Monday to Sunday) during which the handover occurs, the specific hour (each hour is a time period, such as 20:00 to 21:00), the real-time multidimensional load evaluation value range before the handover (high / medium / low levels), and the handover direction (such as 0→1 for upgrading from level 0 to level 1, and 1→0 for downgrading from level 1 to level 0).
[0073] S2 performs periodic clustering of historical trajectories and identifies oscillation patterns.
[0074] The binning comparison logic for periodic clustering: The router categorizes the ladder oscillation trajectory logs into several log buckets based on the day of the week and hour. The switching direction sequences within each log bucket are compared: if a bucket contains at least 3 log records with the same switching direction sequence (e.g., all repeating 0→1→0), then the bucket is classified as an oscillation pattern cluster.
[0075] Calculation of the historical average oscillation period: For log buckets marked as periodic oscillation patterns, extract the trigger time of each log record in the bucket, and calculate the time interval between two adjacent 0→1→0 switching in the same direction as the duration of a single oscillation period. For example, if the trigger times of three 0→1→0 repeating logs in a bucket are 20:05, 20:35, and 21:10 respectively, then the time interval between the first 0→1 and the second 0→1 is 30 minutes, the time interval between the second 0→1 and the third 0→1 is 35 minutes, and the historical average oscillation period is (30+35) divided by 2, which is 32.5 minutes.
[0076] For example, if statistics show that within the past four weeks, from 8:00 PM to 10:00 PM every Monday to Friday, there are at least three records of repeated 0→1→0 switching in the log bucket, then that bucket is marked as a known periodic oscillation pattern. The key characteristics of this pattern are: the triggering period is from 8:00 PM to 10:00 PM Monday to Friday, the switching direction sequence is 0→1→0, and the real-time multidimensional load evaluation value is in the medium to high range.
[0077] It should be noted that the above-mentioned 4-week statistical period, 3 records in the same bucket, and time limit from Monday to Friday are all preferred values. In actual deployment, the statistical period can be adjusted to 2 to 8 weeks and the judgment threshold of 2 to 5 records, depending on the user's work and rest patterns and network usage habits.
[0078] S3 triggers stairwell dwell lock.
[0079] In this example, when the router detects that the current time is between 20:00 and 22:00 from Monday to Friday, and the current real-time multidimensional load evaluation value range matches the marked oscillation pattern (such as the load score being between 60 and 90 points), and the most recent ladder switching direction is from level 0 to level 1, a ladder dwell lock is triggered.
[0080] During the period when the resident lockout is in effect, even if the subsequent real-time multidimensional load evaluation value is lower than the level 1 degrade exit threshold (60 points), the router will block the step-up switching intention that is opposite to the direction of the most recent step-up switching (i.e., block the degrade intention) and forcibly maintain the current level 1 step-up.
[0081] If the most recent tier switch direction was from tier 1 to tier 0, then after the camp lock is triggered, the router blocks the response to the tier switch intention (i.e., blocks the upgrade intention) and forcibly maintains the current tier 0 level until the camp period ends or the forced unlock condition is triggered.
[0082] The duration of the dwell lock is set to 1.5 times the historical average oscillation period. For example, if the historical average oscillation period is 32.5 minutes, the dwell lock will last for approximately 49 minutes.
[0083] During the dwell period, the router maintains the current tier level and corresponding additional function enablement configuration unchanged, and performs internal fine-tuning on the currently enabled additional functions (such as reducing the roaming scan frequency or switching the QoS scheduling granularity) according to the pulse control mechanism in Embodiment 4, but does not perform tier level switching.
[0084] S4, forcefully unlock the resident lock.
[0085] In this example, if a terminal with the highest or higher weight level reports a deterioration in experience (i.e., continuously increasing latency, packet loss rate, or retransmission rate) three times consecutively during the tiered ...
[0086] It should be noted that the preferred criterion for mandatory unlocking after three consecutive deteriorations can be adjusted to an integer between two and five times in actual deployment, depending on the urgency of the business. If an upgrade intention is generated after unlocking, the standard tiered switching process of Example 1 will be entered, and the adaptive cooldown period latch will be restarted.
[0087] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method of routing function dynamic switching, the method comprising: Includes the following steps: acquiring a multi-dimensional load indicator of a routing device, the multi-dimensional load indicator comprising software forwarding PPS, softirq occupancy and conntrack connection count; Based on the multidimensional load index, a recursive determination window is constructed, and the recursive consistency factor and recursive trend factor are calculated. Based on the recursive consistency factor, recursive trend factor, recursive confirmation count M, and the preset hysteresis loopback threshold of the multi-level load ladder, it is determined whether to generate a ladder switching intention. Each ladder in the multi-level load ladder corresponds to a different additional function activation configuration. Establish a ladder-additional function mapping table, which records the activation configuration relationship between each ladder level and additional functions; When the ladder switching intention is generated, the corresponding additional function is gradually stripped or restored according to the ladder-additional function mapping relationship between the current ladder level and the target ladder level. After the step switching intention is executed, an adaptive cooling period latch is initiated, and the duration of the adaptive cooling period is dynamically adjusted according to the historical step oscillation frequency.
2. The method for dynamically switching routing functions according to claim 1, characterized in that, Based on the aforementioned multidimensional load metrics, a recursive decision window is constructed, including: Maintain a time-series sliding window of length N to store the multidimensional load vectors of the most recent N sampling periods; The recursive consistency factor is calculated as the ratio of the number of samples that continuously fall into the target step interval within the time-series sliding window to the total length of the window. The recursive trend factor is calculated as the weighted first-order rate of change of the multidimensional load vector within the time-series sliding window.
3. The method for dynamically switching routing functions according to claim 2, characterized in that, The determination of whether a tiered switching intention has been generated includes: When the current position is at level k, if the multidimensional load index exceeds the entry threshold of level (k+1) for M consecutive times... When the recursive consistency factor is not lower than the first preset value and the recursive trend factor is positive, a step-by-step switching intention to upgrade from level k to level k+1 is generated. When the multidimensional load index falls below the exit threshold of the k-th step for M consecutive times... When the recursive consistency factor is not lower than the first preset value and the recursive trend factor is negative, a step-by-step switching intention from level k to level k-1 is generated. When the multidimensional load index is in the hysteresis dead zone of the k-th step. During this period, no staircase switching intent is generated.
4. The method for dynamically switching routing functions according to claim 1, characterized in that, The recursive decision window constructed based on the multidimensional load metrics also includes: Obtain the terminal-side experience feedback vector accessing the routing device. The terminal-side experience feedback vector includes the latency, packet loss rate, received signal strength indication, and retransmission rate periodically reported by the terminal. The terminal-side experience feedback vector is correlated and compared with the multi-dimensional load index to construct a device-terminal experience deviation factor; Based on the deviation direction of the device-terminal experience deviation factor, the hysteresis loop threshold of the multi-level load ladder is dynamically calibrated. The calculation of the recursive trend factor incorporates the historical statistical values of the device-terminal experience deviation factor to drive the continuous adaptive drift of the hysteresis loop threshold pair.
5. The method for dynamically switching routing functions according to claim 4, characterized in that, Based on the deviation direction of the device-terminal experience deviation factor, the hysteresis loopback thresholds of the multi-level load ladder are dynamically calibrated, including: When the device-terminal experience deviation factor is positive (i.e., the multidimensional load index is higher than the load benchmark value corresponding to the current step and the terminal-side experience feedback vector is in the normal range), it is determined to be a false high load on the device side. This suppresses the currently generated upgrade step switching intention and raises the entry threshold of the current step. ; When the device-terminal experience deviation factor is negative, meaning the multidimensional load index is not higher than the load benchmark value corresponding to the current step and the terminal-side experience feedback vector is in the deterioration range, it is determined to be a device-side perception blind spot, and the entry threshold of the current step is lowered. In order to trigger the intention of switching upgrade tiers in advance; When the device-terminal experience deviation factor is zero, the current configuration of the hysteresis loopback threshold pair is maintained.
6. The method for dynamically switching routing functions according to claim 4, characterized in that, The number of recursive confirmations M is an adaptive confirmation parameter, and the method further includes: Obtain the terminal-side experience feedback vectors reported by each of the multiple terminals connected to the routing device; The terminal weight is determined based on the priority of each terminal's service type, current traffic share, and access duration. Based on the terminal weights, the terminal-side experience feedback vectors of the multiple terminals are weighted and aggregated to generate an aggregated experience deviation factor. The M value is dynamically adjusted based on the degree of experience degradation of high-weight terminals in the aggregated experience deviation factor.
7. The method for dynamically switching routing functions according to claim 6, characterized in that, The M value is dynamically adjusted based on the degree of experience degradation of high-weight terminals in the aggregated experience deviation factor, including: When the experience feedback vector of a high-weight terminal enters the deterioration range, the M value is lowered to shorten the recursive confirmation cycle. When the experience feedback vector of only low-weight terminals enters the deterioration range, the M value is increased to extend the recursive confirmation period; When the experience feedback vectors of the multiple terminals are in the same direction, the baseline M value is maintained.
8. The method for dynamically switching routing functions according to claim 1, characterized in that, During the adaptive cooling period latch duration, the current tier level and corresponding additional function enable configuration remain unchanged, and the following steps are performed: Calculate the remaining load margin between the entry threshold of the next level of the current ladder level and the real-time multidimensional load evaluation value calculated based on the multidimensional load index; The pulsation rhythm factor is calculated based on the rate of change of the remaining load margin and the recursive trend factor. Based on the pulse rhythm factor, the execution intensity of the currently enabled additional functions is adjusted slightly by non-uniform time intervals.
9. A method for dynamically switching routing functions according to claim 8, characterized in that, Based on the aforementioned pulsation rhythm factor, the execution intensity of currently enabled additional functions is adjusted slightly over non-uniform time intervals, including: When the rate at which the remaining load margin narrows is greater than a preset rate threshold, the execution interval of the micro-adjustment is shortened, and the execution intensity of the additional function is reduced within the range allowed by the current step level to perform pre-stripping pulses. When the remaining load margin stabilizes and recovers, the execution interval of the micro-adjustment is extended, and the pre-stripping pulses that have been executed are gradually rolled back to restore the execution intensity of the additional function.
10. The method for dynamically switching routing functions according to claim 1, characterized in that, The method further includes: Establish a stepped oscillation trajectory log to record the trigger time, time period, multi-dimensional load fingerprint before switching, and switching direction sequence of each stepped switching event; Periodic clustering of historical trajectories in the stepped oscillation trajectory log is performed to identify high-frequency recurring oscillation patterns; When the current multidimensional load metric matches a known periodic oscillation pattern with the switching direction sequence, a ladder dwell lock is triggered. During the period when the tiered dwell lock is in effect, the response to a tiered switching intention that is opposite to the direction of the most recent tiered switching is blocked, and the current tiered level is forcibly maintained for one dwell cycle. During the dwell period, the current tier level and corresponding additional function activation configuration remain unchanged, and internal fine-tuning is performed on the currently activated additional functions according to the pulse control mechanism during the adaptive cooling period latch. The length of the dwell period is adaptively determined based on the historical average oscillation period duration of the periodic oscillation pattern. When the terminal-side experience feedback vector continues to deteriorate during the dwell period, the tiered dwell lock is forcibly released, and the tiered switching intention is responded to normally.