A kind of method detecting each channel wifi signal qualityTechnical field
The invention belongs to the technical field of wireless communication, relate to a kind of method detecting each channel wifi signal quality particularly.
Background technology
WLAN channel list is the wireless channel that IEEE 802.11 (or being called WiFi) wireless network of law defined should use.802.11 working groups have divided 4 independently frequency ranges: 2.4GHz, 3.6GHz, 4.9GHz and 5.8GHz, and each frequency range is divided into again some channels.Each country oneself has formulated policy and has drawn up how to use these frequency ranges.
A lot of country has law to regulate the use of these channels, such as, maximal power level etc. within the scope of certain frequency.Virtual network operator should seek advice from local authorities, because these regulations may be out-of-date, overwhelming majority of countries all allows not need licensing in the world, uses the 1st channel to the 13rd channel.
Based on above feature, the transmitting wifi frequency of the network equipments such as most routers is all in 1-13 range of channels.Such as TP-Link 703N initial channel is 6 channels.The channel frequency that the most router of further investigation dispatches from the factory is 1,6,11 these 3 channels, reason is as follows: China supports 1-13 channel, and 1-13 channel is supported in Europe, and the U.S. supports 1-11 channel, Japan supports 1-14 channel, and as a whole, subset is 1-11 channel.Therefore, the automatic channel of equipment is set to these three channels of 1-6-11, is safer way.The probability of channel disturbance is minimum, even like this, along with the development of time, the increasing of wifi hotspot quantity in unit space, also can cause signal disturbing between the different wifi hotspot of same channel.Below illustratively channel interference problem:
Realize the frequency difference (as shown in Figure 1) that agreement needs 16.25MHz to 22MHz, otherwise adjacent channel overlap will produce interference each other.The clearly reasonable solution of suggestion of standard leaves 3 spacing to 4 channels to avoid interference.Actual frequency difference definite when using, depends on the selection of channel and the electromagnetic environment residing for equipment and data rate.
When the 802.11b reflectors of 2 or more are at identical spatial operation, its signal must be attenuated to be less than-50dBr simultaneously/or frequency have the spacing of 22MHz at least with anti-tampering.And in fact, when DSSS algorithm transmits data, using 20MHz bandwidth, the gap of remaining 2MHz is used as guard band, allows the electromagnetic wave attenuation of the frequency edges used avoid interference adjacent channel.
Attention: the frequency range indicating 40MHz in upper figure, 20MHz band spreading part can be identified as in the administration interface of many WiFi equipment, use channel number+expansion display: Channel 3=Channel 1+Upper or Channel5+Lower and Channel 11=Channel9+Upper or Channel 13+Lower.
In brief: the equipment in same channel is more, disturb larger, in close two channels, the quantity of equipment is more, affects more secondary than the impact of same channel, by that analogy.
Summary of the invention
The technology that the present invention will solve is dealt with problems and is: overcome the deficiencies in the prior art, a kind of method detecting each channel wifi signal quality is provided, it obtains the network channel situation around a certain spatial point objectively, thus instruct the network equipment in this spatial point to be switched to the good channel of quality objectively, speed up Web searches, reduce the packet loss of present networks equipment, reduce ping value.
Technical solution of the present invention is: the method for each channel WiFi signal quality of this detection, comprises the following steps:
(1) collect the WiFi information around Designated Router, WiFi information comprises focus number and the signal strength signal intensity of each channel;
(2) congestion index of each channel is calculated according to formula (1)
Channel n congestion index=(channel n focus number × all signal strength signal intensities of 200+ channel n and × 0.2)+(channel n adjacent channel focus number × 200+ channel n closes on focus signal strength signal intensity and × 0.2) × 0.5+ (1, channel n interval channel focus number × 1,200+ channel n interval channel focus signal strength signal intensity and × 0.2) × 0.25 (1)
Wherein n is the integer of 1-13, represents the number of channel;
(3) Designated Router is placed in the minimum channel of congestion index.
The present invention is by collecting the WiFi information around Designated Router, calculate the congestion index of each channel, Designated Router is placed in the channel that congestion index is minimum, obtain the network channel situation around a certain spatial point objectively, thus instruct the network equipment in this spatial point to be switched to the good channel of quality objectively, speed up Web searches, reduce the packet loss of present networks equipment, reduce ping value.
Accompanying drawing explanation
Fig. 1 is the frequency range schematic diagram of 2.4G WiFi.
Fig. 2 shows the flow chart of the method according to each channel WiFi signal quality of detection of the present invention.
Embodiment
As shown in Figure 2, the method for each channel WiFi signal quality of this detection, comprises the following steps:
(1) collect the WiFi information around Designated Router, WiFi information comprises focus number and the signal strength signal intensity of each channel;
(2) congestion index of each channel is calculated according to formula (1)
Channel n congestion index=(channel n focus number × all signal strength signal intensities of 200+ channel n and × 0.2)+(channel n adjacent channel focus number × 200+ channel n closes on focus signal strength signal intensity and × 0.2) × 0.5+ (1, channel n interval channel focus number × 1,200+ channel n interval channel focus signal strength signal intensity and × 0.2) × 0.25 (1)
Wherein n is the integer of 1-13, represents the number of channel;
(3) Designated Router is placed in the minimum channel of congestion index.
The present invention is by collecting the WiFi information around Designated Router, calculate the congestion index of each channel, Designated Router is placed in the channel that congestion index is minimum, obtain the network channel situation around a certain spatial point objectively, thus instruct the network equipment in this spatial point to be switched to the good channel of quality objectively, speed up Web searches, reduce the packet loss of present networks equipment, reduce ping value.
Preferably, described channel is in 2.4G frequency range, and n is the integer of 1-11.
Preferably, the method also comprises step (4) and the congestion index of each channel is carried out large minispread, and Designated Router selects the channel that congestion index is little.Adjustment router channels is generally on router backstage, and WIFI signal, adjustment channel, national channel range of choices is 2.4G 1-13 channel.After selecting, WIFI module will restart.
Concrete example is as follows:
(1) WiFi information is around collected
Router-A initiates WiFi equipment data around WiFi scanning search as table 1, and the focus number of certain channel, directly obtains from list, if following table is 2 in the focus number of 11 channels.
Table 1
(2) channel quality is calculated
Channel n congestion index=(channel n focus number × all signal strength signal intensities of 200+ channel n and × 0.2)+(channel n adjacent channel focus number × 200+ channel n closes on focus signal strength signal intensity and × 0.2) × 0.5+ (1, channel n interval channel focus number × 1,200+ channel n interval channel focus signal strength signal intensity and × 0.2) × 0.25 (1)
The congestion index calculating channel 1-13 is thus
Channel 1:421
Channel 2:158
Channel 3:104
Channel 4:81
Channel 5:105
Channel 6:106
Channel 7:107
Channel 8:78
Channel 9:66
Channel 10:107
Channel 11:51
Above result value larger expression congestion index is higher, and the crowding of channel 11 is minimum, and therefore its signal quality is best.
It is 60ms that router-A is placed in channel 1, ping baidu.com average delay; Router-A is placed in 11 channels, ping baidu.com average delay is 32ms, and signal disturbing is fewer, and time delay lower expression online quality is better.
Provide now an application scenarios:
User need install mobile phone A PP, opens mobile phone A PP, registration router official account, and after binding router, mobile phone A PP networks, and by the API of router, just can inquire about each channel crowding of this router place environment.
The above; it is only preferred embodiment of the present invention; not any pro forma restriction is done to the present invention, every above embodiment is done according to technical spirit of the present invention any simple modification, equivalent variations and modification, all still belong to the protection range of technical solution of the present invention.