A dynamic bandwidth adjustment method
Through the dynamic bandwidth adjustment method, the actual bandwidth value is gradually approached and the rapid adjustment mechanism is introduced, which solves the problems of wasted bandwidth acquisition and setting and poor user experience in the existing technology, and achieves efficient bandwidth adjustment and stability of QoS functions.
Patent Information
- Application Number
- CN202011056433.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2040-09-30
AI Technical Summary
When obtaining and setting bandwidth, other clients are required to stop high-traffic applications or rely on CPU-intensive speed measurement tools, resulting in waste of bandwidth and poor user experience, and the classification rectification failure of the HTB algorithm.
Dynamic bandwidth adjustment method is adopted, the initial bandwidth value is preset to be smaller than the actual value, and the actual bandwidth value is approximate through gradual adjustment, and the QoS packet loss is adjusted. A rapid adjustment mechanism is introduced to avoid the initial value bottleneck, periodically statistical bandwidth and loss. Package, use 95% threshold to determine the adjustment steps.
It effectively avoids the problems of bandwidth waste and poor user experience, ensures that the QoS function takes effect in a short period of time, and avoids long-term packet loss, improving bandwidth usage efficiency.
Smart Images

Figure CN112217741B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of dynamic bandwidth adjustment methods, and more specifically to a dynamic bandwidth adjustment method. Background Technology
[0002] The HTB (Hierarchical Token Bucket) algorithm is the most commonly used QoS algorithm, supporting bandwidth control for different types of data flows and allowing for the reservation and limitation of maximum bandwidth. HTB's hierarchical structure supports flexible bandwidth allocation strategies.
[0003] In the HTB algorithm, to achieve flexible bandwidth sharing rather than simple rate limiting, uplink and downlink bandwidth are crucial parameters that must be set. If the bandwidth parameter is smaller than the actual value, it will result in bandwidth waste; if the parameter is larger than the actual value, it will cause the classification and rectification of HTB to fail.
[0004] There are generally two ways to obtain uplink and downlink bandwidth parameters: speed test tools, such as Speedtest, to test the speed, which requires other clients to stop high-bandwidth applications; and manual settings, where users manually set the bandwidth value, which requires users to have basic network knowledge and have already obtained the bandwidth value from the operator.
[0005] The first method (speed test tool) is used to obtain uplink and downlink bandwidth. First, other clients are required to stop high-traffic applications, otherwise the test results will be affected (too low), resulting in bandwidth waste. Second, the speed test tool built into the device has certain requirements for CPU performance. If the speed test is limited by the CPU performance, it will also cause bandwidth waste.
[0006] The second method (manual setup) requires users to have some network knowledge and to obtain the actual bandwidth value from the operator, resulting in a poor user experience. Summary of the Invention
[0007] The technical problem this invention aims to solve is requiring other clients to stop high-traffic applications, otherwise the test results will be affected (too low), resulting in bandwidth waste. Secondly, the built-in speed test tool in the device has certain requirements for CPU performance. If the speed test is limited by the CPU performance, it will also cause bandwidth waste. This invention provides a dynamic bandwidth adjustment method. When the QoS function is enabled, a small initial bandwidth value B(0) is preset, or a fast speed test is performed to make a conservative estimate, that is, to make the initial value as small as possible compared to the actual bandwidth value of the WAN port, so as to ensure that the QoS function can take effect. When the actual traffic approaches the set bandwidth value or when QoS packet loss is triggered, the bandwidth value is adjusted so that the bandwidth value continuously approaches the actual bandwidth value from the initial small value in a short period of time, in order to solve the defects caused by the existing technology.
[0008] To solve the above-mentioned technical problems, the present invention provides the following technical solutions:
[0009] In a first aspect, this application provides a dynamic bandwidth adjustment method, which includes the following steps:
[0010] Step A1: Obtain the initial bandwidth value, denoted as B(0);
[0011] Step A2: When enabling QoS, set the bandwidth value as B(i), where i = 1, 2, 3…N, indicating the nth time;
[0012] Step A3: Record the actual WAN port speed as W(i) and the number of QoS packet losses as D(i), where i=1,2,3…N, indicating the nth time;
[0013] Step A4: Determine whether the actual WAN port speed W(i) is close to the set bandwidth value B(i). If it is close, or if QoS packet loss is triggered (i.e., D(i)>0), adjust the bandwidth value and then return to step A3. If it is not close, proceed to step A5.
[0014] Step A5: If the actual WAN port speed W(i) exceeds or equals the previously set bandwidth value B(i-1) multiple times, but QoS packet loss is not triggered, i.e. D(i)=0, then the bandwidth value is called back and the bandwidth value B(i-1) is locked; otherwise, return to step A3.
[0015] QoS packet loss indicates that the current set bandwidth value B(i) is less than or equal to the actual bandwidth value of the WAN port. In order to make the set bandwidth value B(i) closer to the actual bandwidth value, the set bandwidth value needs to be increased tentatively until the WAN port statistical rate is greater than or equal to the previous set bandwidth value B(i-1) multiple times without triggering QoS packet loss. Then it is considered that the current set bandwidth value B(i) is larger than the actual value, and B(i-1) is locked.
[0016] After adjusting the bandwidth value, two possibilities exist:
[0017] 1. The current bandwidth value is still less than the actual bandwidth value;
[0018] 2. The current bandwidth value has exceeded the actual bandwidth value;
[0019] In the first scenario, if the real-time traffic of the WAN port can be increased, thus continuing to trigger QoS packet loss, then you can continue to try increasing the bandwidth value.
[0020] In the second scenario, the real-time traffic of the WAN port may increase slightly. However, no matter what, QoS packet loss will not be triggered again. In order to avoid QoS being in a state of failure for a long time, a callback is performed and the final bandwidth value is locked. The callback judgment condition is: the real-time traffic of the WAN port continues to approach the current bandwidth value for a period of time but does not trigger QoS packet loss.
[0021] In the aforementioned dynamic bandwidth adjustment method, the initial bandwidth value B(0) is obtained through automatic and rapid speed testing of the WAN port. When some clients are using high-traffic applications, the initial value may become a serious bottleneck. Adjusting according to the gradually increasing algorithm will be slow, resulting in a poor user experience. To avoid this situation, this invention introduces a rapid adjustment mechanism into the algorithm. If the adjustment is triggered multiple times in a short period of time, QoS will be temporarily disabled, allowing the actual traffic to directly increase to the maximum value. When QoS is temporarily disabled, the WAN port rate is statistically analyzed, and the statistically obtained value is set as the target value for rapid adjustment.
[0022] The aforementioned dynamic bandwidth adjustment method requires periodically calculating the actual WAN port speed W(i) and periodically calculating the number of QoS packet losses D(i).
[0023] In the aforementioned dynamic bandwidth adjustment method, the step of determining whether the bandwidth value B(i) set for the WAN port has been adjusted is as follows:
[0024] Step B1: Calculate the value A by multiplying the set bandwidth value B(i) by 95%, where the threshold of 95% can be determined experimentally;
[0025] Step B2: Determine the difference between the actual WAN port speed W(i) and the value A, or determine whether packet loss has occurred in the QoS settings;
[0026] Step B3: If the actual WAN port speed W(i) is greater than or equal to the value A or packet loss occurs in QoS, then adjust the bandwidth setting value B(i);
[0027] If the actual WAN port speed W(i) is less than the value A and no packet loss occurs in QoS, then proceed to step A5.
[0028] The aforementioned dynamic bandwidth adjustment method includes adjusting the set bandwidth value B(i) by increasing a fixed size or increasing a fixed percentage.
[0029] In the aforementioned dynamic bandwidth adjustment method, in step A5, the WAN port rate W(i) needs to exceed or be equal to the previously set bandwidth value B(i-1) for multiple consecutive periods.
[0030] Secondly, this application provides a dynamic bandwidth adjustment device, comprising:
[0031] The acquisition module is used to acquire the initial bandwidth value, denoted as B(0);
[0032] The configuration module is used to set the bandwidth value, denoted as B(i), when the QoS function is enabled, where i = 1, 2, 3…N, indicating the nth time;
[0033] The statistics module is used to count the actual WAN port speed as W(i) and the number of QoS packet losses as D(i), where i=1,2,3…N, indicating the nth time;
[0034] The judgment module is used to determine whether the actual WAN port speed W(i) is close to the set bandwidth value B(i) or QoS packet loss, i.e. D(i)>0. If it is close, the bandwidth value is adjusted and then the process returns to step A3. If it is not close, the process proceeds to step A5.
[0035] The setting module is also used to call back the bandwidth value and lock the bandwidth value B(i-1) if the actual WAN port speed W(i) exceeds or equals the previously set bandwidth value B(i-1) multiple times in a row, but QoS packet loss is not triggered, i.e. D(i)=0; otherwise, return to step A3.
[0036] In a second embodiment of the second aspect, the dynamic bandwidth adjustment device of this application includes a statistics module for periodically calculating the actual WAN port rate W(i) and periodically calculating the number of QoS packet losses D(i).
[0037] In a second aspect, a third embodiment of the present application provides a dynamic bandwidth adjustment device, wherein the determination module includes:
[0038] The calculation unit is used to calculate the value A obtained by multiplying the set bandwidth value B(i) by 95%.
[0039] The judgment unit is used to determine the magnitude of the actual WAN port rate W(i) and the value A, or to determine whether packet loss has occurred in QoS.
[0040] The adjustment unit is used to adjust the bandwidth value B(i) if the actual WAN port rate W(i) is greater than or equal to the value A or if packet loss occurs in QoS; and to proceed to step A5 if the actual WAN port rate W(i) is less than the value A and no packet loss occurs in QoS.
[0041] Thirdly, embodiments of this application also provide an electronic device, including: a processor and a memory;
[0042] The memory is used to store the computer program of the processor;
[0043] The processor is configured to implement any one of the possible dynamic bandwidth adjustment methods in the first aspect by executing the computer program.
[0044] Fourthly, embodiments of this application also provide a machine-readable storage medium having executable instructions stored thereon, which, when executed by a machine, cause the dynamic bandwidth adjustment method provided in the first aspect to be implemented.
[0045] The technical solution provided by the dynamic bandwidth adjustment method of the present invention, as described above, has the following technical effects:
[0046] When the QoS function is enabled, a small initial bandwidth value B(0) will be preset, or a fast speed test will be performed to make a conservative estimate. That is, the initial value should be as small as possible compared to the actual bandwidth value of the WAN port to ensure that the QoS function can take effect. When the actual traffic approaches the set bandwidth value or when QoS packet loss is triggered, the bandwidth value will be adjusted so that the bandwidth value will gradually approach the actual bandwidth value from the initial small value in a short period of time. Attached Figure Description
[0047] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. However, those skilled in the art should understand that the drawings described below are merely some examples of this application and do not limit its scope.
[0048] Figure 1 This is a flowchart illustrating a dynamic bandwidth adjustment method according to an exemplary embodiment of this application;
[0049] Figure 2 This is a flowchart illustrating the determination step in the dynamic bandwidth adjustment method according to another exemplary embodiment of this application;
[0050] Figure 3 This is a schematic diagram of the structure of a dynamic bandwidth adjustment device according to an exemplary embodiment of this application;
[0051] Figure 4 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of this application. Detailed Implementation
[0052] To make the technical means, inventive features, objectives and effects of the invention easier to understand, the invention will be further explained below with reference to specific illustrations.
[0053] It should be noted that the structures, proportions, sizes, etc., illustrated in the accompanying drawings of this specification are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0054] Furthermore, the terms such as "upper," "lower," "left," "right," "middle," and "one" used in this specification are merely for clarity of description and are not intended to limit the scope of the invention. Any changes or adjustments to their relative relationships, without substantially altering the technical content, should also be considered within the scope of the invention.
[0055] A preferred embodiment of the present invention provides a dynamic bandwidth adjustment method. The purpose is to preset a small initial bandwidth value B(0) after the QoS function is enabled, or to perform a fast speed test and conservative estimate, that is, to make the initial value as small as possible compared with the actual bandwidth value of the WAN port, so as to ensure that the QoS function can take effect. When the actual traffic approaches the set bandwidth value or when QoS packet loss is triggered, the bandwidth value is adjusted so that the bandwidth value continuously approaches the actual bandwidth value from the initial small value in a short period of time.
[0056] Figure 1 This is a flowchart illustrating a dynamic bandwidth adjustment method according to an exemplary embodiment of this application. Figure 1 As shown, this application discloses a dynamic bandwidth adjustment method, which includes the following steps:
[0057] Step A1: Obtain the initial bandwidth value, denoted as B(0);
[0058] Step A2: When enabling QoS, set the bandwidth value as B(i), where i = 1, 2, 3…N, indicating the nth time;
[0059] Step A3: Record the actual WAN port speed as W(i) and the number of QoS packet losses as D(i), where i=1,2,3…N, indicating the nth time;
[0060] Step A4: Determine whether the actual WAN port speed W(i) is close to the set bandwidth value B(i). If it is close, or if QoS packet loss is triggered (i.e., D(i)>0), adjust the bandwidth value and then return to step A3. If it is not close, proceed to step A5.
[0061] Step A5: If the actual WAN port speed W(i) exceeds or equals the previously set bandwidth value B(i-1) multiple times, but QoS packet loss is not triggered, i.e. D(i)=0, then the bandwidth value is called back and the bandwidth value B(i-1) is locked; otherwise, return to step A3.
[0062] QoS packet loss indicates that the current set bandwidth value B(i) is less than or equal to the actual bandwidth value of the WAN port. In order to make the set bandwidth value B(i) closer to the actual bandwidth value, the set bandwidth value needs to be increased tentatively until the WAN port statistical rate is greater than or equal to the previous set bandwidth value B(i-1) multiple times without triggering QoS packet loss. Then it is considered that the current set bandwidth value B(i) is larger than the actual value, and B(i-1) is locked.
[0063] After adjusting the bandwidth value, two possibilities exist:
[0064] 1. The current bandwidth value is still less than the actual bandwidth value;
[0065] 2. The current bandwidth value has exceeded the actual bandwidth value;
[0066] In the first scenario, if the real-time traffic of the WAN port can be increased, thus continuing to trigger QoS packet loss, then you can continue to try increasing the bandwidth value.
[0067] In the second scenario, the real-time traffic of the WAN port may increase slightly. However, no matter what, QoS packet loss will not be triggered again. In order to avoid QoS being in a state of failure for a long time, a callback is performed and the final bandwidth value is locked. The callback judgment condition is: the real-time traffic of the WAN port continues to approach the current bandwidth value for a period of time but does not trigger QoS packet loss.
[0068] The initial bandwidth value B(0) is obtained through automatic and fast speed testing of the WAN port. When some clients are using high-traffic applications, the initial value may become a serious bottleneck. Adjusting it according to the gradually increasing algorithm will be slow, resulting in a poor user experience. In order to avoid this situation, this invention introduces a fast adjustment mechanism into the algorithm. If the adjustment is triggered multiple times in a short period of time, QoS will be temporarily disabled, so that the actual traffic will be directly increased to the maximum value. When QoS is temporarily disabled, the WAN port rate is statistically analyzed, and then the statistically obtained value is set as the target value for fast adjustment.
[0069] This requires periodically calculating the actual WAN port speed W(i) and periodically calculating the number of QoS packet losses D(i).
[0070] Figure 2This is a flowchart illustrating the determination step in the dynamic bandwidth adjustment method according to another exemplary embodiment of this application, wherein the step of determining whether the bandwidth value B(i) set by the WAN port has been adjusted is as follows:
[0071] Step B1: Calculate the value A by multiplying the set bandwidth value B(i) by 95%, where the threshold of 95% can be determined experimentally;
[0072] Step B2: Determine the difference between the actual WAN port speed W(i) and the value A, or determine whether packet loss has occurred in the QoS settings;
[0073] Step B3: If the actual WAN port speed W(i) is greater than or equal to the value A or packet loss occurs in QoS, then adjust the bandwidth setting value B(i);
[0074] If the actual WAN port speed W(i) is less than the value A and no packet loss occurs in QoS, then proceed to step A5.
[0075] The methods for adjusting the bandwidth value B(i) include increasing the fixed size or increasing the fixed percentage.
[0076] In step A5, the WAN port rate W(i) must exceed or be equal to the previously set bandwidth value B(i-1) for multiple consecutive cycles.
[0077] In summary, the dynamic bandwidth adjustment method of the present invention, when the QoS function is enabled, will preset a small initial bandwidth value B(0), or perform a fast speed test conservative estimate, that is, try to make the initial value smaller than the actual bandwidth value of the WAN port, to ensure that the QoS function can take effect. When the actual traffic approaches the set bandwidth value or when QoS packet loss is triggered, the bandwidth value is adjusted so that the bandwidth value continuously approaches the actual bandwidth value from the initial small value in a short period of time.
[0078] Secondly, this application provides a dynamic bandwidth adjustment device. Figure 3 This is a schematic diagram of a dynamic bandwidth adjustment device according to an exemplary embodiment of this application. The dynamic bandwidth adjustment device includes:
[0079] The acquisition module 301 is used to acquire the initial bandwidth value, denoted as B(0);
[0080] The setting module 302 is used to set the bandwidth value, denoted as B(i), when the QoS function is enabled, where i = 1, 2, 3…N, representing the nth time;
[0081] The statistics module 303 is used to count the actual WAN port speed as W(i) and the number of QoS packet losses as D(i), where i=1,2,3…N, indicating the nth time;
[0082] The judgment module 304 is used to determine whether the actual WAN port speed W(i) is close to the set bandwidth value B(i) or QoS packet loss, i.e. D(i)>0. If it is close, the bandwidth value is adjusted and then the process returns to step A3. If it is not close, the process proceeds to step A5.
[0083] The setting module 302 is also used to call back the bandwidth value and lock the bandwidth value B(i-1) if the actual WAN port speed W(i) exceeds or equals the previously set bandwidth value B(i-1) multiple times in a row, but does not trigger QoS packet loss, i.e. D(i)=0; otherwise, return to step A3.
[0084] This invention introduces a rapid adjustment mechanism. If the adjustment is triggered multiple times in a short period of time, QoS will be temporarily disabled, allowing the actual traffic to be directly increased to the maximum value. When QoS is temporarily disabled, the WAN port rate is statistically analyzed, and the statistical value is set as the target value for rapid adjustment.
[0085] In a second embodiment of the dynamic bandwidth adjustment device of the second invention of this application, the statistics module is used to periodically count the actual WAN port rate W(i) and periodically count the number of QoS packet losses D(i).
[0086] In a third embodiment of the dynamic bandwidth adjustment device of the second invention of this application, the judgment module 303 includes:
[0087] The calculation unit is used to calculate the value A obtained by multiplying the set bandwidth value B(i) by 95%.
[0088] The judgment unit is used to determine the magnitude of the actual WAN port rate W(i) and the value A, or to determine whether packet loss has occurred in QoS.
[0089] The adjustment unit is used to adjust the bandwidth value B(i) if the actual WAN port rate W(i) is greater than or equal to the value A or if packet loss occurs in QoS; and to proceed to step A5 if the actual WAN port rate W(i) is less than the value A and no packet loss occurs in QoS.
[0090] Figure 4 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of this application. Figure 4 As shown, the electronic device 700 provided in this embodiment includes:
[0091] Processor 701 and memory 702;
[0092] The memory 702 is used to store the computer program of the processor;
[0093] The processor 701 is configured to implement the steps in any of the above method embodiments by executing the computer program.
[0094] Alternatively, the memory 702 can be either standalone or integrated with the processor 701.
[0095] When the memory 702 is a device independent of the processor 701, the electronic device 700 may further include:
[0096] Bus 703 is used to connect the processor 701 and the memory 702.
[0097] Furthermore, embodiments of this application also provide a machine-readable storage medium. This machine-readable storage medium may store executable instructions, which, when executed by a machine, cause the machine to implement the specific processes of the above-described method embodiments.
[0098] The machine-readable storage medium described in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0099] Furthermore, those skilled in the art will understand that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can implement the described functions in different ways for each specific application, but such implementation should not be considered beyond the scope of this application.
[0100] The specific embodiments of the invention have been described above. It should be understood that the invention is not limited to the specific embodiments described above, and the devices and structures not described in detail should be understood to be implemented in a manner common to the art; those skilled in the art can make various modifications or alterations within the scope of the claims, and make several simple deductions, variations or substitutions, which do not affect the substantive content of the invention.
Claims
1. A dynamic bandwidth adjustment method, characterized in that: The following steps are involved: Step A1: Obtain the initial value of bandwidth and record it as B(0); Step A2: When the QoS function is enabled, the bandwidth value is set as B(i), where i = 1, 2, 3 ... N, indicating the number of times; Step A3: Count the actual WAN port rate and record it as W(i), and count the number of QoS packet losses and record it as D(i), where i = 1, 2, 3...N, indicating the number of times; Step A4: Determine whether the actual WAN port rate W(i) reaches the set bandwidth value B(i). If so, or QoS packet loss occurs, that is, D(i)>0, adjust the bandwidth value and then return to step A3. If not, proceed to step A5. The steps to determine whether the bandwidth value B(i) set for the WAN port is adjusted are as follows: Step B1: Calculate the set bandwidth value B(i)*95% to obtain the value A; Step B2: Determine the difference between the actual WAN port rate W(i) and the value A or determine whether QoS has packet loss; Step B3: If the actual WAN port rate W(i) is greater than or equal to the value A or QoS packet loss occurs, adjust the set bandwidth value B(i); If the actual rate W(i) of the WAN port is less than the value A and there is no packet loss in QoS, proceed to step A5; Step A5: If the actual WAN port rate W(i) exceeds or equals the last set bandwidth value B(i-1) for multiple times in a row, but does not trigger QoS packet loss, that is, D(i)=0, then the bandwidth value is called back and locked, otherwise return to step A3; A fast adjustment mechanism is introduced into the dynamic bandwidth adjustment method. In the fast adjustment mechanism, if the adjustment is triggered multiple times in a short period of time, the QoS is temporarily closed to directly increase the actual traffic to the maximum value. During the period when the QoS is temporarily invalid, the rate of the WAN port is counted, and then the value obtained by the statistics is set as the target value of the fast adjustment.
2. A dynamic bandwidth adjustment method as claimed in claim 1, characterized in that: The bandwidth initial value B(0) is obtained through automatic and rapid speed measurement of the WAN port.
3. A dynamic bandwidth adjustment method as claimed in claim 1, characterized in that: The bandwidth initial value B(0) is a smaller default value.
4. A dynamic bandwidth adjustment method according to any one of claims 1 to 3, characterized in that: It is necessary to periodically count the actual WAN port rate W(i) and the number of QoS packet losses D(i).
5. A dynamic bandwidth adjustment method as claimed in claim 4, characterized in that: Methods for adjusting the bandwidth value B(i) include increasing a fixed size or increasing a fixed ratio.
6. A dynamic bandwidth adjustment method as claimed in claim 5, characterized in that: In step A5, the WAN port rate W(i) must exceed or be equal to the last set bandwidth value B(i-1) for multiple consecutive cycles.
7. A dynamic bandwidth adjustment device, characterized in that: Include: An acquisition module is used to obtain an initial value of bandwidth, which is recorded as B(0); A setting module is used to set the bandwidth value when the QoS function is turned on, which is recorded as B(i), where i=1,2,3...N, indicating the number of times; Statistics module, used to count the actual rate of WAN port as W(i), and count the number of QoS packet loss as D(i), where i = 1, 2, 3...N, indicating the number of times; The judgment module is used to judge whether the actual rate W(i) of the WAN port reaches the set bandwidth value B(i). If it reaches it, or QoS packet loss occurs, that is, D(i)>0, the bandwidth value is adjusted and then the process returns to step A3. Otherwise, the process goes to step A5. The judging module comprises: A calculation unit, used for calculating the set bandwidth value B(i)*95% to obtain a value A; A judgment unit, used to judge the size of the actual rate W(i) of the WAN port and the value A and to judge whether packet loss occurs in QoS; An adjustment unit is used to adjust the set bandwidth value B(i) if the actual rate W(i) of the WAN port is greater than or equal to the value A or the QoS has packet loss; and if the actual rate W(i) of the WAN port is less than the value A and the QoS has no packet loss, then enter step A5; a fast adjustment mechanism is introduced in the adjustment unit, in which if the adjustment is triggered multiple times in a short period of time, the QoS is temporarily closed so that the actual traffic is directly increased to the maximum value, and the rate statistics of the WAN port are performed during the period when the QoS is temporarily invalid, and then the statistical value is set as the target value of the fast adjustment; The setting module is also used to callback the bandwidth value and lock the bandwidth value B(i-1) if the actual rate W(i) of the WAN port exceeds or is equal to the bandwidth value B(i-1) set last time for multiple times in a row, but does not trigger QoS packet loss, that is, D(i)=0, otherwise return to step A3.
8. The dynamic bandwidth adjustment device according to claim 7, characterized in that: The statistical module is used to periodically count the actual rate W(i) of the WAN port and the number of QoS packet losses D(i).
