Summary of the invention
Based on this, to solve the technical issues of increasing the power consumption of terminal in the prior art, spy proposes a kind of WIFI hair
Penetrate performance number adjusting method.
A kind of WIFI transmission power value adjusting method, comprising:
Obtain the signal transmission rate to WIFI hot spot transmission data;
According to the mapping relations of preset signal transmission rate and WIFI transmission power value, obtain and signal transmission speed
The set of the corresponding WIFI transmission power value of rate;
Detect the signal quality parameter to WIFI hot spot transmission data;
The smallest WIFI transmission power value for making the signal quality parameter be greater than threshold value is chosen in the set, according to
The smallest WIFI transmission power value transmits data to the WIFI hot spot.
Further, described detect to the step of signal quality parameter of WIFI hot spot transmission data includes
The signal-to-noise ratio to WIFI hot spot transmission data is detected, transmits data using the signal-to-noise ratio as to the WIFI hot spot
Signal quality parameter.
It is further, described to detect the step of transmitting the signal quality parameter of data to the WIFI hot spot further include:
Detect the frame losing number of the signal to WIFI hot spot transmission data;
The signal quality parameter to WIFI hot spot transmission data is generated according to the frame losing number.
It is further, described to detect the step of transmitting the signal quality parameter of data to the WIFI hot spot further include:
Multiple sampling detects the signal quality parameter to WIFI hot spot transmission data;
The average value for calculating the signal quality parameter transmits number to the WIFI hot spot using the average value as described
According to signal quality parameter.
Further, the minimum WIFI for making the signal quality parameter be greater than threshold value that chooses in the set emits
The step of performance number further include:
The WIFI transmission power value in the set is traversed according to WIFI transmission power value size order, is traversed described
WIFI transmission power value as target power value, using the target power value as the function to WIFI hot spot transmission data
Rate value judges whether the signal quality parameter is greater than threshold value according to the target power value;
If so, continue to traverse, if it is not, then using the upper WIFI transmission power value traversed as to described
The performance number of WIFI hot spot transmission data.
In addition, the technical issues of to solve the power consumption for increasing terminal in the prior art mentioned above, spy proposes one
Kind WIFI transmission power value adjusting device.
A kind of WIFI transmission power value adjusting device, comprising:
Signal transmission rate obtains module, for obtaining the signal transmission rate to WIFI hot spot transmission data;
WIFI transmission power value set obtains module, for according to preset signal transmission rate and WIFI transmission power value
Mapping relations, obtain the set of corresponding with signal transmission rate WIFI transmission power value;
Signal quality parameter detection module, for detecting the signal quality parameter to WIFI hot spot transmission data;
WIFI transmission power value chooses module, so that the signal quality parameter is greater than threshold value for choosing in the set
The smallest WIFI transmission power value, according to the smallest WIFI transmission power value to the WIFI hot spot transmit data.
Further, the signal quality parameter detection module is also used to detect the noise to WIFI hot spot transmission data
Than using the signal-to-noise ratio as the signal quality parameter to WIFI hot spot transmission data.
Further, the signal quality parameter detection module is also used to:
Detect the frame losing number of the signal to WIFI hot spot transmission data;
The signal quality parameter to WIFI hot spot transmission data is generated according to the frame losing number.
Further, the signal quality parameter detection module is also used to:
Multiple sampling detects the signal quality parameter to WIFI hot spot transmission data;
The average value for calculating the signal quality parameter transmits number to the WIFI hot spot using the average value as described
According to signal quality parameter.
Further, the WIFI transmission power value is chosen module and is also used to:
The WIFI transmission power value in the set is traversed according to WIFI transmission power value size order, is traversed described
WIFI transmission power value as target power value, using the target power value as the function to WIFI hot spot transmission data
Rate value judges whether the signal quality parameter is greater than threshold value according to the target power value;
If so, continue to traverse, if it is not, then using the upper WIFI transmission power value traversed as to described
The performance number of WIFI hot spot transmission data.
After above-mentioned WIFI transmission power value adjusting method and device, mobile terminal is obtained first to WIFI hot spot
The signal transmission rate of data is transmitted, then according to the mapping relations of preset signal transmission rate and WIFI transmission power value,
The set of the WIFI transmission power value of preset multiple grades corresponding with the signal transmission rate is searched, then is detected to WIFI
Hot spot transmits the signal quality parameter of data, and finally choosing in set makes the signal quality parameter be greater than or equal to threshold value
Minimum WIFI transmission power value, using this WIFI transmission power value as the optimal power to WIFI hot spot transmission data.Work as movement
After terminal detects the WIFI signal of WIFI hot spot, data are imparted to by WIFI hot spot with certain transmission rate, then need end
End is carried out data transmission with corresponding transmission power.And existing transmission power control mechanism is that a transmission rate is one corresponding
Fixed transmission power, and under same protocol rate, the transmission power of terminal maintains higher level.That is, right
In the transmission rate that rate size is 6Mbps, terminal is carried out data transmission with the transmission power of 15dBm, and for rate size
For the transmission rate of 54Mbps, terminal is still carried out data transmission with identical transmission power, in fact the bigger meaning of transmission rate
Network environment it is more preferable, loss of signal is smaller, therefore required transmission power is smaller, is sent out using the transmission power of 15dBm
It send and increases the power consumption of terminal.Compared to the prior art, the adjusting of this method and device dynamic and reduce terminal to WIFI heat
The transmission power level of point transmission data, reduces the power consumption of terminal, to reduce calorific value, promotes user experience.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
After mobile terminal detects the WIFI signal of WIFI hot spot, data are imparted to by WIFI with certain transmission rate
Hot spot then needs terminal to carry out data transmission with corresponding transmission power.And existing transmission power control mechanism is a biography
The corresponding fixed transmission power of defeated rate, and under same protocol rate, the transmission power of terminal maintains higher water
Flat, as shown in table 1, table 1 is signal transmission rate in the prior art and WIFI transmission power value mapping table:
Table 1
Binary numeral |
Rate |
Power |
2(802.11b) |
1Mbps |
18dBm |
4(802.11b) |
2Mbps |
18dBm |
11(802.11b) |
5.5Mbps |
18dBm |
12(802.11g) |
6Mbps |
15dBm |
18(802.11g) |
9Mbps |
15dBm |
22(802.11b) |
11Mbps |
18dBm |
24(802.11g) |
12Mbps |
15dBm |
36(802.11g) |
18Mbps |
15dBm |
44(802.11g) |
22Mbps |
15dBm |
48(802.11g) |
24Mbps |
15dBm |
66(802.11g) |
33Mbps |
15dBm |
72(802.11g) |
36Mbps |
15dBm |
96(802.11g) |
48Mbps |
15dBm |
108(802.11g) |
54Mbps |
15dBm |
That is, the transmission rate for being 6Mbps for 1 medium-rate size of table, terminal is carried out with the transmission power of 15dBm
Data transmission, and the transmission rate for being 54Mbps for rate size, terminal are still carried out data transmission with identical transmission power,
In fact transmission rate means that more greatly network environment is more preferable, and loss of signal is smaller, therefore required transmission power is smaller, uses
The transmission power of 15dBm is sent, and the power consumption of terminal is increased.
The technical issues of to solve the power consumption for increasing terminal in the prior art mentioned above, in one embodiment,
Spy proposes a kind of WIFI transmission power value adjusting method, and this method can be dependent on computer program realization, can run on and be based on
In the computer system of von Neumann system.The computer program can integrate in the application, also can be used as independent tool-class and answer
With operation.The computer system can be the mobile devices such as smart phone, laptop, tablet computer, PC.
Specifically, as shown in Figure 1, the WIFI transmission power value adjusting method includes:
Step S102: the signal transmission rate to WIFI hot spot transmission data is obtained.
How much signal transmission rate refers to the unit time interior data volume transmitted, and there are two types of the units of transmission rate.
One is chip rate, i.e. the he number of transmitted per unit time, and unit is baud (Baud, abbreviation B), so
Also referred to as baud rate.One digit pulse is a symbol.If the width of symbol is T seconds, B=1/T.
Secondly being message transmission rate, i.e., the information content transmitted in each second, unit is bps (b/s or bps), institute
To be also referred to as bit rate.If the number of the desirable discrete value of symbol is M, T=Ts*log2M, rate of information throughput R=Rs/
log2M, Rs=1/Ts, wherein Ts is the time required for one binary character of hair.And maximum data transfer rate R=Wlog2
(1+S/N).Wherein, W is channel width, and S/N is signal-to-noise ratio.
In the present embodiment, signal transmission rate uses the unit of message transmission rate, can be straight by the APP for the rate of testing the speed
Connect rate of the detection terminal to WIFI hot spot transmission data.As 360 security guards can directly detect current network speed value.
Step S104: according to the mapping relations of preset signal transmission rate and WIFI transmission power value, obtain with it is described
The set of the corresponding WIFI transmission power value of signal transmission rate.
In one embodiment, the mapping relations of signal transmission rate and WIFI transmission power value can be by between the two
Mapping table indicate, as shown in table 2, under agreement 802.11, the corresponding performance number of a rate is classified in advance, is obtained
Signal transmission rate and WIFI transmission power value mapping table in phase one embodiment:
Table 2
In the present embodiment, user is in advance classified WIFI transmission power value, and computer is reflected according to as shown in Table 2
The signal transmission rate value for penetrating relationship and aforementioned detection finds the set of corresponding multiple performance numbers in the mapping table.Also
It is to say, if the signal transmission rate of aforementioned acquisition is 2Mbps, corresponding set includes 18dBm, 16dBm, 14dBm tri- etc.
The performance number of grade.
Step S106: the signal quality parameter to WIFI hot spot transmission data is detected.
Optionally, described detect to the step of signal quality parameter of WIFI hot spot transmission data includes
The signal-to-noise ratio to WIFI hot spot transmission data is detected, transmits data using the signal-to-noise ratio as to the WIFI hot spot
Signal quality parameter.
Signal-to-noise ratio (SNR or S/N:Signal-Noise Ratio) is one for measuring communication system communication reliability
The key technical indexes refers to the ratio of signal and noise in an electronic equipment or system.
Its measurement unit is dB, be can be calculated by formula 10lg (Ps/Pn), wherein Ps and Pn is respectively signal and noise
Effective power.Can be converted into the ratio of voltage magnitude in electronic system: 20lg (Vs/Vn), Vs and Vn respectively believe
Number and noise voltage " virtual value ".By above-mentioned two formula it is found that signal-to-noise ratio the higher the better.
In the present embodiment, pass through signal-to-noise ratio gauge signal quality.Terminal obtains the signal to WIFI hot spot transmission data
Intensity value and detection noise intensity (generally white noise), the ratio of the two be signal-to-noise ratio.
It is optionally, described to detect the step of transmitting the signal quality parameter of data to the WIFI hot spot further include:
Detect the frame losing number of the signal to WIFI hot spot transmission data;
The signal quality parameter to WIFI hot spot transmission data is generated according to the frame losing number.
It is that unit is transmitted that data, which are with frame (Frame) on network,." frame " data are by frame head and frame data two
It is grouped as.Wherein, frame head includes the positioning and other network informations of recipient's host-physical address, and region frame data is then contained
One data volume.For the data volume in read data frame, identical communication protocol must be used between two communication equipments.
For example, the communication protocol that internet uses is Internet protocol (IP agreement).IP data volume includes data volume head
With data field two parts of data volume.Data volume head includes IP source address, IP destination address and other information, and data
The data field of body then includes User Data Protocol (UDP), transmission control protocol (TCP), and contains progress information and reality
The other informations such as the data packet of data.Therefore the equipment in internet can be in communication with each other by IP agreement.
In one embodiment, mobile terminal is using in the frame scan region probe requests thereby (Probe Request)
802.11 networks, the work station for receiving Probe Request frame can first judge that can other side be added network.When mobile terminal is supported
When all data rates required by the network, show to be intended to add with service set (SSID:Service Set Identity)
Enter the network.The work station for receiving Probe Request frame will be with Probe Response frame response, wherein SSID is used to
The MAC Address of belonging network is indicated, i.e. our access point name for seeing before Wi-Fi connection.
In the present embodiment, mobile terminal receives the spy to one Probe Request frame of surrounding broadcast, WIFI hot spot
It surveys after claim frame and returns a Probe Respon frame to mobile terminal, terminal transmission is got by the Probe Respon frame
The frame losing number of Probe Request frame, but due to mobile terminal to WIFI hot spot transmission data signal quality parameter lost with this
The inversely proportional relationship of frame number, therefore, when frame losing number is bigger, signal quality is poorer, and corresponding signal quality parameter is smaller.Work as end
After end detects the signal quality parameter at a certain moment, the optimal of this moment is chosen according to the size relation of the parameter and preset value
WIFI transmission power value.In subsequent time, terminal detects again and obtains new signal quality parameter, further according to the new signal
Mass parameter and the size relation of preset value choose the optimal WIFI transmission power value at current time.That is, terminal to
During WIFI hot spot transmits data, terminal persistently detects signal quality parameter.
It is optionally, described to detect the step of transmitting the signal quality parameter of data to the WIFI hot spot further include:
Multiple sampling detects the signal quality parameter to WIFI hot spot transmission data;
The average value for calculating the signal quality parameter transmits number to the WIFI hot spot using the average value as described
According to signal quality parameter.
Signal quality parameter such as signal-to-noise ratio etc. is influenced by factors such as environment, that is to say, that the signal quality detected every time
The value of parameter can be variant, but may change within the scope of one.In the present embodiment, it is detected under identical transmission rate more
A signal quality parameter calculates average value.
For example, getting 5 letters changed in a certain range by 5 signal quality parameters detected under same rate
Number mass parameter a, b, c, d, e, by average value f=(a+b+c+d+e)/5 as the signal quality parameter under the rate.
Step S108: the smallest WIFI transmitting function for making the signal quality parameter be greater than threshold value is chosen in the set
Rate value transmits data to the WIFI hot spot according to the smallest WIFI transmission power value.Further, described in the collection
The step of minimum WIFI transmission power value for making the signal quality parameter be greater than threshold value is chosen in conjunction further include:
The WIFI transmission power value in the set is traversed according to WIFI transmission power value size order, is traversed described
WIFI transmission power value as target power value, using the target power value as the function to WIFI hot spot transmission data
Rate value judges whether the signal quality parameter is greater than threshold value according to the target power value;
If so, continue to traverse, if it is not, then using the upper WIFI transmission power value traversed as to described
The performance number of WIFI hot spot transmission data.So-called traversal refers to along certain search pattern, successively does to node each in tree
Once and only do primary access.In the present embodiment, search pattern is the sequence route of WIFI transmission power value from big to small,
In each WIFI transmission power value be node.
If performance number is followed successively by A > B > C > D from big to small in the corresponding power value set of certain rate.Terminal successively traverse A,
B, if C, D judge whether the signal quality parameter is greater than or equal to threshold value according to B, in signal quality parameter traverse B
When greater than threshold value, it is further continued for traversal C;When signal quality parameter is equal to threshold value, using B as the hair to WIFI hot spot transmission rate
Penetrate performance number;When signal quality parameter is less than threshold value, then using A as the transmission power level to WIFI hot spot transmission rate.
For example, the corresponding power of rate 2Mbps is divided into 5 grades, from big to small according to performance number, be followed successively by 17dBm,
16dBm,14dBm,12dBm,10dBm.Judge whether signal quality parameter is greater than preset value according to 17dBm first, if it is not, believing
When number mass parameter is less than preset value, then the corresponding performance number 18dBm of rate is chosen before power classification to WIFI hot spot and emits number
According to, make signal quality parameter be equal to preset value in 17dBm, then data is emitted to WIFI hot spot with 17dBm performance number, if
17dBm makes signal quality parameter be greater than preset value, illustrates that this power is bigger than normal, and performance number 17dBm is cached in memory and selected
It selects and judges whether signal quality parameter is greater than preset value according to 16dBm, if it is not, when signal quality parameter is less than preset value, then
The 17dBm performance number of caching in memory will be called as the transmission power to WIFI hot spot transmitting data, if 16dBm makes letter
Number mass parameter is equal to preset value, then emits data to WIFI hot spot with 16dBm performance number, if 16dBm joins signal quality
Number is greater than preset value, illustrates that this power is bigger than normal, removes the caching in memory at this time, and in memory by performance number 16dBm caching,
Then judge whether signal quality parameter is greater than preset value according to 14dBm performance number, judged with identical step, final choice with
Optimal power emits data.
In addition, the technical issues of to solve the power consumption for increasing terminal in the prior art mentioned above, implement at one
In example, spy proposes a kind of WIFI transmission power value adjusting device.
Specifically, the WIFI transmission power value adjusting device is as shown in Figure 2, comprising: signal emission rate obtains module
102, WIFI transmission power value set obtains module 104, signal quality parameter detection module 106, WIFI transmission power value and chooses
Module 108, in which:
Signal transmission rate obtains module 102, for obtaining the signal transmission rate to WIFI hot spot transmission data;
WIFI transmission power value set obtains module 104, for emitting function according to preset signal transmission rate and WIFI
The mapping relations of rate value obtain the set of WIFI transmission power value corresponding with the signal transmission rate;
Signal quality parameter detection module 106, for detecting the signal quality parameter to WIFI hot spot transmission data;
WIFI transmission power value chooses module 108, is greater than the signal quality parameter for choosing in the set
The smallest WIFI transmission power value of threshold value transmits number to the WIFI hot spot according to the smallest WIFI transmission power value
According to.
Optionally, the signal quality parameter detection module 106 is also used to detect the noise to WIFI hot spot transmission data
Than using the signal-to-noise ratio as the signal quality parameter to WIFI hot spot transmission data.
Optionally, the signal quality parameter detection module 106 is also used to:
Detect the frame losing number of the signal to WIFI hot spot transmission data;
The signal quality parameter to WIFI hot spot transmission data is generated according to the frame losing number.
Optionally, the signal quality parameter detection module 106 is also used to:
Multiple sampling detects the signal quality parameter to WIFI hot spot transmission data;
The average value for calculating the signal quality parameter transmits number to the WIFI hot spot using the average value as described
According to signal quality parameter.
Further, the WIFI transmission power value is chosen module 108 and is also used to:
The WIFI transmission power value in the set is traversed according to WIFI transmission power value size order, is traversed described
WIFI transmission power value as target power value, using the target power value as the function to WIFI hot spot transmission data
Rate value judges whether the signal quality parameter is greater than threshold value according to the target power value;
If so, continue to traverse, if it is not, then using the upper WIFI transmission power value traversed as to described
The performance number of WIFI hot spot transmission data.
In conclusion implementing the embodiment of the present invention, will have the following beneficial effects:
After above-mentioned WIFI transmission power value adjusting method and device, mobile terminal is obtained first to WIFI hot spot
The signal transmission rate of data is transmitted, then according to the mapping relations of preset signal transmission rate and WIFI transmission power value,
The set of the WIFI transmission power value of preset multiple grades corresponding with the signal transmission rate is searched, then is detected to WIFI
Hot spot transmits the signal quality parameter of data, and finally choosing in set makes the signal quality parameter be more than or equal to threshold value most
Small WIFI transmission power value, using this WIFI transmission power value as the optimal power to WIFI hot spot transmission data.When mobile whole
After end detects the WIFI signal of WIFI hot spot, data are imparted to by WIFI hot spot with certain transmission rate, then need terminal
Carried out data transmission with corresponding transmission power.And existing transmission power control mechanism is a transmission rate corresponding one solid
Fixed transmission power, and under same protocol rate, the transmission power of terminal maintains higher level.That is, for
Rate size is the transmission rate of 6Mbps, and terminal is carried out data transmission with the transmission power of 15dBm, and is for rate size
The transmission rate of 54Mbps, terminal are still carried out data transmission with identical transmission power, and in fact transmission rate means more greatly
Network environment is more preferable, and loss of signal is smaller, therefore required transmission power is smaller, is sent using the transmission power of 15dBm
Increase the power consumption of terminal.Compared to the prior art, the adjusting of this method and device dynamic and terminal is reduced to WIFI hot spot
The transmission power level for transmitting data, reduces the power consumption of terminal, to reduce calorific value, promotes user experience.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously
Limitations on the scope of the patent of the present invention therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art
For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to guarantor of the invention
Protect range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.