CN102404174A - Method for detecting network bandwidth - Google Patents
Method for detecting network bandwidth Download PDFInfo
- Publication number
- CN102404174A CN102404174A CN2011104452540A CN201110445254A CN102404174A CN 102404174 A CN102404174 A CN 102404174A CN 2011104452540 A CN2011104452540 A CN 2011104452540A CN 201110445254 A CN201110445254 A CN 201110445254A CN 102404174 A CN102404174 A CN 102404174A
- Authority
- CN
- China
- Prior art keywords
- bandwidth
- current
- average
- detects
- network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 19
- 238000012935 Averaging Methods 0.000 claims description 3
- 238000001514 detection method Methods 0.000 abstract description 9
- 230000000694 effects Effects 0.000 abstract description 4
- 238000005259 measurement Methods 0.000 description 2
- 238000011897 real-time detection Methods 0.000 description 2
- 101150012579 ADSL gene Proteins 0.000 description 1
- 102100020775 Adenylosuccinate lyase Human genes 0.000 description 1
- 108700040193 Adenylosuccinate lyases Proteins 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明涉及网络带宽检测的方法,包括:a.使用默认带宽从测速网站下载预定的数据量,得到初始带宽;b.负载均衡模块和流控模块将所述的初始带宽应用到控制中;c.根据数据流量得到现有带宽和当前最大带宽;d.将现有带宽和当前最大带宽均值进行平均值计算,根据计算出的带宽和当前带宽的变化量判断是否将计算出的平均值作为初始带宽进行带宽重置;e.间隔设定的时间从b步骤循环执行以进行带宽实时检测。本发明的方法,解决了外网带宽在动态变化的环境中,客户不便配置路由器的问题,并且通过自动进行网络带宽的检测,将检测到的带宽动态的应用到流控、负载均衡当中,极大改善检测带宽的准确性,提高流控和负载均衡效果。
The present invention relates to a method for detecting network bandwidth, comprising: a. using a default bandwidth to download a predetermined amount of data from a speed test website to obtain an initial bandwidth; b. a load balancing module and a flow control module apply the initial bandwidth to control; c. obtaining the existing bandwidth and the current maximum bandwidth according to the data flow; d. calculating the average value of the existing bandwidth and the current maximum bandwidth, and judging whether to use the calculated average value as the initial bandwidth to reset the bandwidth according to the calculated bandwidth and the change amount of the current bandwidth; e. looping from step b at intervals set to perform real-time bandwidth detection. The method of the present invention solves the problem that it is inconvenient for customers to configure routers in an environment where the external network bandwidth changes dynamically, and by automatically detecting the network bandwidth, the detected bandwidth is dynamically applied to flow control and load balancing, which greatly improves the accuracy of detecting the bandwidth and improves the flow control and load balancing effects.
Description
技术领域 technical field
本发明涉及一种对网络带宽检测的方法。The invention relates to a method for detecting network bandwidth.
背景技术 Background technique
在有路由器接入的网络环境中,由于存在ADSL、静态光纤等多种线路,在对路由器进行配置时,往往需要用户根据实际带宽情况对路由器进行设置后,才能够保证流控、负载均衡等功能的正常工作。但是通常由于部分客户不清楚实际带宽情况,或者实际带宽与标称带宽存在差距,往往导致流控、负载均衡出现问题。In the network environment with router access, due to the existence of various lines such as ADSL and static optical fiber, when configuring the router, users often need to set the router according to the actual bandwidth to ensure flow control, load balancing, etc. The function works normally. However, usually some customers do not know the actual bandwidth, or there is a gap between the actual bandwidth and the nominal bandwidth, which often leads to problems in flow control and load balancing.
发明内容 Contents of the invention
针对以上的问题,本发明提供了一种网络带宽检测的方法,自动进行网络带宽的检测,并将检测的带宽动态的应用到流控、负载均衡当中,极大改善检测带宽的准确性,提高流控和负载均衡效果。In view of the above problems, the present invention provides a method for network bandwidth detection, which automatically detects network bandwidth, and dynamically applies the detected bandwidth to flow control and load balancing, greatly improving the accuracy of bandwidth detection and improving Flow control and load balancing effects.
本发明网络带宽检测的方法,包括:The method for network bandwidth detection of the present invention comprises:
a.使用默认带宽从测速网站下载预定的数据量,根据所述数据量的大小和对应的下载时长的商得到初始带宽;a. Use the default bandwidth to download a predetermined amount of data from the speed measurement website, and obtain the initial bandwidth according to the quotient of the size of the data amount and the corresponding download time;
b.负载均衡模块和流控模块将所述的初始带宽应用到控制中,实现负载均衡和流控功能;b. The load balancing module and the flow control module apply the initial bandwidth to the control to realize load balancing and flow control functions;
c.记录至少1次当前1秒内的数据流量,根据所述的数据流量得到每次记录的当前带宽均值和当前最大带宽,对各次的当前带宽均值求平均得到现有带宽,对各次的当前最大带宽求平均的到当前最大带宽均值;c. Record the current data flow within 1 second at least once, obtain the current average bandwidth and the current maximum bandwidth of each record according to the data flow, average the current bandwidth averages of each time to obtain the existing bandwidth, and obtain the current bandwidth for each time The average of the current maximum bandwidth to the current maximum bandwidth;
d.将所述的现有带宽和当前最大带宽均值进行平均值计算,如果所述的平均值与当前系统配置的当前带宽的差>设定阈值,则将所述的平均值作为初始带宽进行带宽重置;d. Calculate the average value of the existing bandwidth and the current maximum bandwidth average value, if the difference between the average value and the current bandwidth configured by the current system > the set threshold, then use the average value as the initial bandwidth bandwidth reset;
e.间隔设定的时间从b步骤循环执行以进行带宽实时检测。e. The time set at intervals is executed cyclically from step b for real-time detection of bandwidth.
当路由器配置时通过对指定网址的测速,根据实际获取数据的情况计算初始外网的带宽,在后续路由器的使用过程中,定期对外网带宽进行采样,根据使用的平均带宽情况和持续峰值情况,不断对测试带宽进行检测,调整出最符合实际的带宽数值对路由器进行实时配置,由此极大改善检测带宽的准确性,提高流控和负载均衡效果。When the router is configured, the initial external network bandwidth is calculated according to the actual data obtained by measuring the speed of the specified website. During the subsequent use of the router, the external network bandwidth is regularly sampled. According to the average bandwidth used and the continuous peak value, Continuously detect the test bandwidth, adjust the most realistic bandwidth value and configure the router in real time, thereby greatly improving the accuracy of bandwidth detection and improving the effect of flow control and load balancing.
优选的,步骤c中连续记录5次当前1秒内的数据流量,并根据该5次的数据量计算每次记录的当前带宽均值和当前最大带宽。从概率角度采样值越多最后得到的值越准确,但同时兼顾效率,每执行一次该步骤,优选进行5次采样。Preferably, in step c, the current data traffic within 1 second is continuously recorded 5 times, and the current average bandwidth and the current maximum bandwidth of each record are calculated according to the data volume of the 5 times. From the perspective of probability, the more sampled values are, the more accurate the final value will be. However, taking into account the efficiency, it is preferable to perform 5 samples every time this step is performed.
优选的,步骤c重复执行5次后再进入步骤d。Preferably, step c is repeated 5 times before entering step d.
优选的,通过最近10次的当前带宽均值计算步骤c中所述的现有带宽;通过最近10次的当前最大带宽计算步骤c中所述的当前最大带宽均值,以得到更准确的现有带宽和当前最大带宽均值。Preferably, the existing bandwidth described in step c is calculated by the last 10 current bandwidth mean values; the current maximum bandwidth mean value described in step c is calculated by the last 10 current maximum bandwidth values to obtain a more accurate existing bandwidth and the current maximum bandwidth average.
进一步的,由于实际的带宽峰值和标准峰值有一定的差异,因此根据样本方差对步骤d中所述的最大带宽均值进行补偿,以使结果更符合实际带宽值。Further, since there is a certain difference between the actual bandwidth peak value and the standard peak value, the maximum average bandwidth value described in step d is compensated according to the sample variance, so that the result is more in line with the actual bandwidth value.
优选的,步骤d中所述的设定阈值为当前系统配置的当前带宽的10%,也可以根据实际情况对设定阈值进行调整。Preferably, the set threshold in step d is 10% of the current bandwidth configured by the current system, and the set threshold can also be adjusted according to actual conditions.
优选的,步骤e中所述的设定时间为300秒,每间隔300秒即重复一次本发明方法的各步骤,对当前的外网带宽进行实时检测,实现动态配置。Preferably, the setting time described in step e is 300 seconds, each step of the method of the present invention is repeated every 300 seconds, and the current external network bandwidth is detected in real time to realize dynamic configuration.
本发明的方法,解决了外网带宽在动态变化的环境中,客户不便配置路由器的问题,并且通过自动进行网络带宽的检测,将检测到的带宽动态的应用到流控、负载均衡当中,极大改善检测带宽的准确性,提高流控和负载均衡效果。The method of the present invention solves the problem that it is inconvenient for customers to configure routers in an environment where the bandwidth of the external network changes dynamically, and through automatic detection of network bandwidth, the detected bandwidth is dynamically applied to flow control and load balancing, which is very convenient Greatly improve the accuracy of bandwidth detection, and improve the effect of flow control and load balancing.
以下结合由附图所示实施例的具体实施方式,对本发明的上述内容再作进一步的详细说明。但不应将此理解为本发明上述主题的范围仅限于以下的实例。在不脱离本发明上述技术思想情况下,根据本领域普通技术知识和惯用手段做出的各种替换或变更,均应包括在本发明的范围内。The above content of the present invention will be further described in detail below in conjunction with the specific implementation manners of the embodiments shown in the accompanying drawings. However, this should not be construed as limiting the scope of the above-mentioned subject matter of the present invention to the following examples. Without departing from the above-mentioned technical idea of the present invention, various replacements or changes made according to common technical knowledge and customary means in this field shall be included in the scope of the present invention.
附图说明 Description of drawings
图1是本发明网络带宽检测的方法的流程图。Fig. 1 is a flow chart of the method for network bandwidth detection in the present invention.
具体实施方式 Detailed ways
如图1所示本发明网络带宽检测的方法,包括:As shown in Figure 1, the method for network bandwidth detection of the present invention includes:
a.当设备启动,初始化网络连接完成后,禁止内网数据连接避免数据干扰。使用默认的10M(兆)带宽从测速网站下载预定的数据量,根据所述数据量的大小和对应的下载时长T的商得到初始带宽B0,即初始带宽B0(bit/s)=下载数据量M(bit)/下载时长T(s),时长T=下载结束时间T2-下载起始时间T1;a. When the device is started and the initial network connection is completed, the intranet data connection is prohibited to avoid data interference. Use the default 10M (megabytes) bandwidth to download a predetermined amount of data from the speed measurement website, and obtain the initial bandwidth B 0 according to the quotient of the size of the data amount and the corresponding download time T, that is, the initial bandwidth B 0 (bit/s) = download Data volume M(bit)/download duration T(s), duration T=download end time T2-download start time T1;
b.负载均衡模块和流控模块将所述的初始带宽B0应用到控制中,实现负载均衡和流控功能;b. The load balancing module and the flow control module apply the initial bandwidth B0 to the control to realize load balancing and flow control functions;
c.连续记录5次当前1秒内的数据流量,分别记为M1、M2、M3、M4、M5,并根据该5次的数据量计算得到当前带宽均值Bn(bit/s)=(M1+M2+M3+M4+M5)/5,和当前最大带宽BMn=Max(M1,M2,M3,M4,M5)。重复执行5次后,通过最近10次的当前带宽均值Bn求平均得到现有带宽,再通过最近10次的当前最大带宽BMn求平均得到当前最大带宽均值。当前最大带宽均值BM=Average{BMn-0,BMn-1,BMn-2,BMn-3,BMn-4,BMn-5,BMn-6,BMn-7,BMn-8,BMn-9}。每记录一次,下标n的值递增1,并记录该计算值,作为历史数据;c. Continuously record 5 times the current data traffic within 1 second, which are recorded as M1, M2, M3, M4, M5 respectively, and calculate the current average bandwidth B n (bit/s)=(M1 +M2+M3+M4+M5)/5, and the current maximum bandwidth BM n =Max(M1, M2, M3, M4, M5). After repeated execution 5 times, the current bandwidth is obtained by averaging the last 10 current bandwidth averages B n , and then the current maximum bandwidth average is obtained by averaging the latest 10 current maximum bandwidth BM n . Current maximum bandwidth average BM=Average{BMn- 0 , BMn- 1 , BMn- 2 , BMn- 3 , BMn- 4 , BMn- 5 , BMn- 6 , BMn- 7 , BMn- 8 , BMn- 9 }. Every time it is recorded, the value of the subscript n is incremented by 1, and the calculated value is recorded as historical data;
d.根据样本方差对最大带宽均值BM进行补偿:样本方差S=[(Bn-0-X)^2+(Bn-1-X)^2....+(Bn-9-X)^2]/(10-1),X表示样本均值=(Bn-0+Bn-1+...+Bn-9)/10。将现有带宽和当前最大带宽均值BM进行平均值计算,如果所述的平均值与当前系统配置的带宽的差>当前系统配置的带宽的10%,即计算出的带宽和当前系统的带宽值变化量相差10%,则将所述的平均值作为初始带宽B0进行带宽重置;d. Compensate the maximum bandwidth mean BM according to the sample variance: sample variance S=[(Bn- 0 -X)^2+(Bn- 1 -X)^2....+(Bn- 9 -X)^ 2]/(10-1), X means sample mean=(Bn- 0 +Bn-1+...+Bn- 9 )/10. Calculate the average value of the existing bandwidth and the current maximum bandwidth mean value BM, if the difference between the average value and the bandwidth configured by the current system is > 10% of the bandwidth configured by the current system, that is, the calculated bandwidth and the bandwidth value of the current system If there is a difference of 10% in the amount of change, the average value is used as the initial bandwidth B 0 to reset the bandwidth;
e.间隔300秒从b步骤循环执行以进行带宽实时检测。e. Cycle through step b at intervals of 300 seconds for real-time detection of bandwidth.
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201110445254.0A CN102404174B (en) | 2011-12-27 | 2011-12-27 | Method of Network Bandwidth Detection |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201110445254.0A CN102404174B (en) | 2011-12-27 | 2011-12-27 | Method of Network Bandwidth Detection |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN102404174A true CN102404174A (en) | 2012-04-04 |
| CN102404174B CN102404174B (en) | 2014-02-12 |
Family
ID=45885987
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201110445254.0A Expired - Fee Related CN102404174B (en) | 2011-12-27 | 2011-12-27 | Method of Network Bandwidth Detection |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102404174B (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102932218A (en) * | 2012-11-21 | 2013-02-13 | 成都市迅电网络技术有限公司 | Method and system for acquiring maximum bandwidth of network physical line |
| CN104320336A (en) * | 2014-10-29 | 2015-01-28 | 福建星网锐捷网络有限公司 | MPLS TE link bandwidth information publishing processing method and device |
| CN111404766A (en) * | 2019-01-02 | 2020-07-10 | 中国移动通信有限公司研究院 | Dial testing method, system and equipment |
| CN111506425A (en) * | 2020-04-14 | 2020-08-07 | 星辰天合(北京)数据科技有限公司 | Method and device for processing quality of service data |
| CN116614393A (en) * | 2023-07-21 | 2023-08-18 | 中融云数(北京)技术有限公司 | Weak network scene bandwidth estimation method and system based on RTC communication |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101247291A (en) * | 2008-03-10 | 2008-08-20 | 建汉科技股份有限公司 | Network bandwidth detection method of network equipment |
| US7701884B2 (en) * | 2004-04-19 | 2010-04-20 | Insors Integrated Communications | Network communications bandwidth control |
| CN102098301A (en) * | 2011-01-06 | 2011-06-15 | 复旦大学 | Multilink self-adaptation data transmission method and system |
| US20110312283A1 (en) * | 2010-06-18 | 2011-12-22 | Skype Limited | Controlling data transmission over a network |
-
2011
- 2011-12-27 CN CN201110445254.0A patent/CN102404174B/en not_active Expired - Fee Related
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7701884B2 (en) * | 2004-04-19 | 2010-04-20 | Insors Integrated Communications | Network communications bandwidth control |
| CN101247291A (en) * | 2008-03-10 | 2008-08-20 | 建汉科技股份有限公司 | Network bandwidth detection method of network equipment |
| US20110312283A1 (en) * | 2010-06-18 | 2011-12-22 | Skype Limited | Controlling data transmission over a network |
| CN102098301A (en) * | 2011-01-06 | 2011-06-15 | 复旦大学 | Multilink self-adaptation data transmission method and system |
Non-Patent Citations (1)
| Title |
|---|
| 周健等: "远程实时视频传输的自适应技术", 《清华大学学报》 * |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102932218A (en) * | 2012-11-21 | 2013-02-13 | 成都市迅电网络技术有限公司 | Method and system for acquiring maximum bandwidth of network physical line |
| CN104320336A (en) * | 2014-10-29 | 2015-01-28 | 福建星网锐捷网络有限公司 | MPLS TE link bandwidth information publishing processing method and device |
| CN104320336B (en) * | 2014-10-29 | 2017-12-01 | 福建星网锐捷网络有限公司 | A kind of MPLS TE Links bandwidth information release processing method and apparatus |
| CN111404766A (en) * | 2019-01-02 | 2020-07-10 | 中国移动通信有限公司研究院 | Dial testing method, system and equipment |
| CN111404766B (en) * | 2019-01-02 | 2022-04-12 | 中国移动通信有限公司研究院 | Dialing test method, system and equipment |
| CN111506425A (en) * | 2020-04-14 | 2020-08-07 | 星辰天合(北京)数据科技有限公司 | Method and device for processing quality of service data |
| CN111506425B (en) * | 2020-04-14 | 2021-12-17 | 星辰天合(北京)数据科技有限公司 | Method and device for processing quality of service data |
| CN116614393A (en) * | 2023-07-21 | 2023-08-18 | 中融云数(北京)技术有限公司 | Weak network scene bandwidth estimation method and system based on RTC communication |
| CN116614393B (en) * | 2023-07-21 | 2023-11-28 | 中融云数(北京)技术有限公司 | Weak network scene bandwidth estimation method and system based on RTC communication |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102404174B (en) | 2014-02-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020253175A1 (en) | Formaldehyde concentration measurement method and apparatus, and air purifier | |
| CN102404174A (en) | Method for detecting network bandwidth | |
| KR101698732B1 (en) | Determining the signal quality of an electrical interconnect | |
| CN109167627B (en) | Modulation format and optical signal-to-noise ratio monitoring method and device | |
| JPWO2018146747A1 (en) | Information processing apparatus, information processing method, and information processing program | |
| TWI584611B (en) | Inspection device and method for powered devices in a Power over Ethernet system | |
| CN210863662U (en) | Formaldehyde concentration detection device and air purifier | |
| WO2012078316A1 (en) | Endpoint web monitoring system and method for measuring popularity of a service or application on a web server | |
| CN114705944A (en) | Cable defect positioning method, equipment and storage medium | |
| JP2014521982A5 (en) | ||
| CN105606501A (en) | Dust concentration detection method and apparatus | |
| CN113219296B (en) | An adaptive interception method for transmission line traveling wave fault data segment | |
| CN109873822B (en) | Device and method for detecting firewall rule change based on Beidou subnanosecond high-precision time service | |
| CN111064507A (en) | Optical fiber link length detection method, device and terminal equipment | |
| JP2012083134A (en) | Epicenter distance estimation method with improved immediate responsiveness | |
| CN105515649A (en) | Optical cable performance detection method and device | |
| CN115882944A (en) | A detection method, device, electronic equipment and storage medium | |
| CN107689970A (en) | A kind of method and device for selecting the optimal server that tests the speed | |
| CN106802836A (en) | A kind of method and device of detection BMC timing accuracies | |
| RU2660026C1 (en) | Method and device for measurement data receiver calibration | |
| CN105071980A (en) | Intercom voice communication delay measurement method | |
| US20120284361A1 (en) | Determination of the transmission capacity in data networks | |
| JP5759016B2 (en) | Method and system for calibrating a first loop feature value estimation method using a first locally measurable loop characteristic and a first set of parameters | |
| JP2010008205A (en) | Electromagnetic noise diagnostic apparatus, electromagnetic noise diagnostic system and electromagnetic noise diagnostic method | |
| CN113822258B (en) | Cable length metering method and device and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| C56 | Change in the name or address of the patentee |
Owner name: CHENGDU FEIYUXING TECHNOLOGY CO., LTD. Free format text: FORMER NAME: CHENGDU VOLANS TECHNOLOGY DEVELOPMENT CORPORATION. |
|
| CP01 | Change in the name or title of a patent holder |
Address after: 610041, No. 12-13, building 6, D zone, Tianfu Software Park, 216 century South Road, Tianfu District, Chengdu, Sichuan Patentee after: CHENGDU VOLANS TECHNOLOGY CO.,LTD. Address before: 610041, No. 12-13, building 6, D zone, Tianfu Software Park, 216 century South Road, Tianfu District, Chengdu, Sichuan Patentee before: Volans Technology Development Corp. |
|
| C56 | Change in the name or address of the patentee | ||
| CP02 | Change in the address of a patent holder |
Address after: The middle high tech Zone Yizhou road in Chengdu city of Sichuan province 610041 No. 1800 Tianfu Software Park G District 4 Building 7-8F Patentee after: CHENGDU VOLANS TECHNOLOGY CO.,LTD. Address before: 610041, No. 12-13, building 6, D zone, Tianfu Software Park, 216 century South Road, Tianfu District, Chengdu, Sichuan Patentee before: CHENGDU VOLANS TECHNOLOGY CO.,LTD. |
|
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140212 |