WO2021047337A1 - wifi连接建立方法及相关设备 - Google Patents

wifi连接建立方法及相关设备 Download PDF

Info

Publication number
WO2021047337A1
WO2021047337A1 PCT/CN2020/108171 CN2020108171W WO2021047337A1 WO 2021047337 A1 WO2021047337 A1 WO 2021047337A1 CN 2020108171 W CN2020108171 W CN 2020108171W WO 2021047337 A1 WO2021047337 A1 WO 2021047337A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
frequency band
parameter value
value
interference
Prior art date
Application number
PCT/CN2020/108171
Other languages
English (en)
French (fr)
Inventor
林进全
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2021047337A1 publication Critical patent/WO2021047337A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B17/00Monitoring; Testing
    • H04B17/30Monitoring; Testing of propagation channels
    • H04B17/309Measuring or estimating channel quality parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Definitions

  • This application relates to the field of electronic technology, and in particular to a method for establishing a wifi connection and related equipment.
  • a frequency band can be divided into multiple channels. There are 14 channels under the 2.4G frequency band in my country, and 13 channels are allowed to be used. There are two frequency band bandwidths in the 2.4G frequency band: 20MHz and 40MHz. At present, most manufacturers of electronic devices (such as smart phones, tablets, etc.) usually directly fix the frequency band bandwidth of the electronic devices at 20 MHz. This method may limit the data transmission speed of the electronic devices in some cases.
  • the embodiments of the present application provide a wifi connection establishment method and related equipment, which are used to increase the data transmission speed when the communication environment is good.
  • an embodiment of the present application provides a method for establishing a wifi connection, which is applied to an electronic device, and the method includes:
  • the frequency band bandwidth of the electronic device is set to the first frequency band bandwidth, the first frequency band bandwidth is greater than the second frequency band bandwidth, and the second frequency band bandwidth is the The frequency band bandwidth set when the first parameter value is in the second range, the first parameter value characterizes the quality of the first communication environment in the first range, and the first parameter value characterizes the first communication environment quality in the second range. 2.
  • the quality of the communication environment, the quality of the first communication environment is better than the quality of the second communication environment, and the frequency band bandwidth currently used by the first AP is the first frequency band bandwidth;
  • an embodiment of the present application provides a wifi connection establishment device, which is applied to an electronic device, and the device includes:
  • a parameter determining unit configured to perform a Wi-Fi channel scan to determine a first parameter value, where the first parameter value is used to evaluate the quality of the communication environment between the electronic device and the first AP;
  • the bandwidth setting unit is configured to set the frequency band bandwidth of the electronic device to the first frequency band bandwidth if the first parameter value is within the first range, and the first frequency band bandwidth is greater than the second frequency band bandwidth, and the first frequency band bandwidth is greater than the second frequency band bandwidth.
  • the second frequency band bandwidth is the frequency band bandwidth set when the first parameter value is in the second range, the first parameter value is in the first range to characterize the quality of the first communication environment, and the first parameter value is in the The second range characterizes the quality of the second communication environment, the quality of the first communication environment is better than the quality of the second communication environment, and the frequency band bandwidth currently used by the first AP is the first frequency band bandwidth;
  • the connection establishment unit is used to establish a wireless connection with the first AP.
  • embodiments of the present application provide an electronic device that includes a processor, a memory, a communication interface, and one or more programs.
  • the one or more programs are stored in the memory and are The configuration is executed by the processor, and the program includes instructions for executing part or all of the steps described in the method described in the first aspect of the embodiments of the present application.
  • an embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium is used to store a computer program, and the above-mentioned computer program is executed by a processor to realize Part or all of the steps described in the method described in one aspect.
  • the embodiments of the present application provide a computer program product, wherein the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program. Part or all of the steps described in the method described in the first aspect.
  • the computer program product may be a software installation package.
  • FIG. 1 is a schematic structural diagram of a network architecture provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a connection establishment method provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a connection establishment method provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Fig. 5 is a schematic structural diagram of a connection establishment apparatus provided by an embodiment of the present application.
  • the embodiment of the application provides a method for establishing a wireless fidelity wifi connection, which is applied to an electronic device, and the method includes:
  • the frequency band bandwidth of the electronic device is set to the first frequency band bandwidth, the first frequency band bandwidth is greater than the second frequency band bandwidth, and the second frequency band bandwidth is the The frequency band bandwidth set when the first parameter value is in the second range, the first parameter value characterizes the quality of the first communication environment in the first range, and the first parameter value characterizes the first communication environment quality in the second range. 2.
  • the quality of the communication environment, the quality of the first communication environment is better than the quality of the second communication environment, and the frequency band bandwidth currently used by the first AP is the first frequency band bandwidth;
  • the scanning of the wifi channel to determine the first parameter value includes:
  • the electronic device scans multiple wifi channels and receives beacon frame messages sent by P APs.
  • Each beacon frame message carries the working information of its corresponding AP.
  • the first parameter value is determined based on the working information of the P APs.
  • Said P is an integer greater than 1.
  • the method further includes:
  • the first AP is determined based on the work information of the P APs.
  • the determining the first AP based on the work information of the P APs includes:
  • the frequency band bandwidth currently used by each AP of the p APs is the first frequency band bandwidth, and the p is a positive integer; select among the p APs One AP is determined to be the first AP.
  • the scanning of the wifi channel to determine the first parameter value includes:
  • the first parameter value is determined based on the first RSSI, the first quantity, and the first degree of interference.
  • the scanning of the wifi channel to obtain the first number of APs currently scanned by the electronic device includes:
  • the first number of APs currently scanned by the electronic device is P based on the work information of the P APs.
  • the scanning of the wifi channel to obtain the current first RSSI of the first AP includes:
  • the working information of the first AP includes the current first RSSI of the first AP.
  • the determining a first parameter value based on the first RSSI, the first quantity, and the first degree of interference includes:
  • the first RSSI is greater than or equal to a first threshold, the first number is less than a second threshold, and the first degree of interference is less than a third threshold, determining that the first parameter value is within the first range;
  • the first RSSI is less than the first threshold, and/or the first number is greater than or equal to the second threshold, and/or the first degree of interference is greater than or equal to the third threshold, then determine The first parameter value is within the second range.
  • the determining a first parameter value based on the first RSSI, the first quantity, and the first degree of interference includes:
  • the first RSSI is converted into a first value, the first amount is converted into a second value, and the first interference level is converted into a third value, the first value, the second value and The third value is of the same order of magnitude;
  • the first parameter value is determined based on the first value, the first weight, the second value, the second weight, the third value, and the third weight, and the first weight is used to indicate that the RSSI is used to evaluate the first parameter value.
  • the second weight is used to indicate the proportion of the number of APs used to evaluate the first parameter value
  • the third weight is used to indicate that the first degree of interference is used to evaluate the value of the first parameter.
  • the proportion of the first parameter value, the sum of the first weight, the second weight, and the third weight is 1.
  • the method further includes:
  • the frequency band bandwidth of the electronic device is set to the second frequency band bandwidth, and a wireless connection with the first AP is established, and the first AP
  • the currently used frequency band bandwidth also includes the second frequency band bandwidth.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and the Wi-Fi channel scan is performed to obtain the first interference degree of the channel currently occupied by the first AP, include:
  • the first degree of interference is determined based on the idle duty ratio of each channel.
  • the determining the first degree of interference based on the idle duty ratio of each channel includes:
  • the idle duty ratio of each channel is greater than or equal to the fourth threshold, or the sum of the N idle duty ratios in the N channels is greater than or equal to the fifth threshold, then it is determined that the first degree of interference is less than the fourth threshold.
  • the third threshold is
  • the idle duty ratio of each channel is less than the fourth threshold, or the sum of the N idle duty ratios in the N channels is less than the fifth threshold, it is determined that the first degree of interference is greater than or Equal to the third threshold.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and the Wi-Fi channel scan is performed to obtain the first interference degree of the channel currently occupied by the first AP, include:
  • the first degree of interference is determined based on the number of wifi packets of each channel.
  • the determining the first degree of interference based on the number of wifi packets of each channel includes:
  • the sixth threshold If the number of wifi packets in each channel is greater than or equal to the sixth threshold, or the sum of the number of N wifi packets in the N channels is greater than or equal to the seventh threshold, it is determined that the first degree of interference is less than the first threshold.
  • the first degree of interference is greater than or equal to all The third threshold.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and the Wi-Fi channel scan is performed to obtain the first interference degree of the channel currently occupied by the first AP, include:
  • the determining a first parameter value based on the first RSSI, the first quantity, and the first degree of interference includes:
  • the first RSSI is converted into a first value, the first amount is converted into a second value, and the first interference level is converted into a third value, the first value, the second value and The third value is of the same order of magnitude;
  • the first parameter value is determined based on the first value, the first weight, the second value, the second weight, the third value, and the third weight, and the first weight is used to indicate that the RSSI is used to evaluate the first parameter value.
  • the second weight is used to indicate the proportion of the number of APs used to evaluate the first parameter value
  • the third weight is used to indicate that the first degree of interference is used to evaluate the value of the first parameter.
  • the proportion of the first parameter value, the sum of the first weight, the second weight, and the third weight is 1.
  • the embodiment of the present application also provides a wifi connection establishment device, which is applied to electronic equipment, and the device includes:
  • a parameter determining unit configured to perform a Wi-Fi channel scan to determine a first parameter value, where the first parameter value is used to evaluate the quality of the communication environment between the electronic device and the first AP;
  • the bandwidth setting unit is configured to set the frequency band bandwidth of the electronic device to the first frequency band bandwidth if the first parameter value is within the first range, and the first frequency band bandwidth is greater than the second frequency band bandwidth, and the first frequency band bandwidth is greater than the second frequency band bandwidth.
  • the second frequency band bandwidth is the frequency band bandwidth set when the first parameter value is in the second range, the first parameter value is in the first range to characterize the quality of the first communication environment, and the first parameter value is in the The second range characterizes the quality of the second communication environment, the quality of the first communication environment is better than the quality of the second communication environment, and the frequency band bandwidth currently used by the first AP is the first frequency band bandwidth;
  • the connection establishment unit is used to establish a wireless connection with the first AP.
  • the embodiments of the present application also provide an electronic device, including a processor, a memory, a communication interface, and one or more programs.
  • the one or more programs are stored in the memory and configured to be processed by the processor.
  • the program includes instructions for executing the steps in the method provided in the above-mentioned embodiments of the present application.
  • the embodiment of the present application also provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method provided in the foregoing embodiment of the present application.
  • the embodiments of the present application also provide a computer program product.
  • the computer program product includes a non-transitory computer-readable storage medium storing a computer program.
  • the foregoing computer program is operable to cause a computer to execute a computer program as provided in the foregoing embodiment of the present application. Part or all of the steps of the method.
  • Figure 1 is a schematic structural diagram of a network architecture provided by an embodiment of the present application.
  • the network architecture includes electronic equipment and multiple wireless access points (Access Point, AP), and the multiple APs include a first AP.
  • AP wireless access point
  • the electronic device plays a role of a station (Station, STA) in the network architecture.
  • STA station
  • Each AP notifies its surrounding STAs by continuously sending beacon frames, so that the STAs can search for the AP.
  • electronic devices may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices (such as smart watches, smart bracelets, pedometers, etc.), computing devices, or other processing devices that are communicatively connected to a wireless modem, And various forms of user equipment (User Equipment, UE), mobile station (Mobile Station, MS), terminal equipment (terminal device), and so on.
  • UE User Equipment
  • MS Mobile Station
  • terminal device terminal device
  • the AP is the communication bridge between the wireless network and the wired network, and is the core device for building a wireless local area network (WLAN). It mainly provides mutual access between STAs and wired LANs, so that STAs within the signal coverage of the first AP can communicate with each other through it. Without an AP, it is basically impossible to build a WLAN that can access the Internet in a true sense. AP in the WLAN is equivalent to the role of the transmitting base station in the mobile communication network.
  • WLAN wireless local area network
  • 2.4G frequency band 2.4GHz ⁇ 2.4835GHz.
  • 5G 5.15GHz ⁇ 5.825GHz.
  • STA and AP carry on wireless communication through the channel.
  • Table 1 The mapping relationship between the channel, center frequency and frequency range in 2.4GHz is shown in Table 1.
  • the frequency band bandwidth is divided into 20MHz and 40MHz.
  • the 20MHz bandwidth has strong anti-interference ability, but the data transmission speed is slow, while the 40MHz bandwidth has weak anti-interference ability and fast data transmission speed. Since there is mostly overlap between channels, there will be conflicts between channels.
  • the transmission efficiency of the 20MHz bandwidth is higher than the transmission efficiency of the 40MHz bandwidth, and when the communication environment is good, the transmission efficiency of the 40MHz bandwidth is higher than the transmission efficiency of the 20MHz bandwidth.
  • FIG. 2 is a schematic flowchart of a method for establishing a wifi connection provided by an embodiment of the present application, which is applied to an electronic device, and the method includes:
  • Step 201 Perform a Wi-Fi channel scan to determine a first parameter value, where the first parameter value is used to evaluate the quality of the communication environment between the electronic device and the first wireless access node AP.
  • the performing Wi-Fi channel scanning to determine the first parameter value includes: the electronic device scans multiple Wi-Fi channels, and receives beacon frames (Beacon) messages sent by P APs, and each beacon frame message carries its value.
  • the work information of the corresponding AP is determined based on the work information of P APs, and the first parameter value is determined, where P is an integer greater than 1.
  • the working information of each AP includes the identity of the AP, the band bandwidth currently used by the AP, the current Received Signal Strength Indication (RSSI) of the AP, the number of channels currently occupied by the AP, and the number of channels currently occupied by the AP.
  • RSSI is an optional part of the wireless transmission layer, used to determine the link quality, and whether to increase the broadcast transmission strength.
  • the strength of the RSSI can be used to determine the distance between the signal point and the receiving point, and then locate it based on the corresponding data.
  • the number of channels currently occupied by each AP refers to the number of channels occupied under different frequency band bandwidths. For example, if the frequency band bandwidth is 20MHz, the number of occupied channels can be 4, and if the frequency band bandwidth is 40MHz, Then the number of occupied channels can be 8.
  • the frequency band bandwidth is 20MHz
  • the channel currently used by the first AP is channel 6.
  • the frequency range of channel 6 is 2426MHz ⁇ 2448MHz
  • the center frequency of channel 4 is 2427MHz
  • the center of channel 5 is The frequency is 2432MHz
  • the center frequency of channel 7 is 2442MHz
  • the center frequency of channel 8 is 2447MHz
  • the frequency range of channel 6 includes the center frequencies of channel 4, channel 5, channel 7 and channel 8, so the number of channels occupied by channel 6 is 4.
  • the idle duty ratio refers to the ratio of the time when the channel is not occupied for data transmission in a unit time to the unit time.
  • the number of wifi packets refers to the number of packets in the wifi working frequency band monitored by the electronic device per unit time, which is used to characterize the magnitude of microwave energy in the wifi working frequency band in the environment around the electronic device.
  • the method further includes: determining the first AP based on the work information of the P APs.
  • the specific implementation manner of determining the first AP based on the working information of the P APs is: determining p APs of the P APs, and each AP of the p APs is currently used
  • the frequency band bandwidth of is the first frequency band bandwidth, and the p is a positive integer; one of the p APs is selected and determined as the first AP.
  • the bandwidth of the first frequency band is, for example, 40 MHz, 80 MHz, etc.
  • the performing Wi-Fi channel scanning to determine the first parameter value includes:
  • the first parameter value is determined based on the first RSSI, the first quantity, and the first degree of interference.
  • a specific implementation manner of performing wifi channel scanning to obtain the first number of APs currently scanned by the electronic device is: determining the current scanned by the electronic device based on the work information of the P APs The first number of APs is P.
  • a specific implementation manner of performing Wi-Fi channel scanning to obtain the current first RSSI of the first AP is: obtaining the working information of the first AP, and the working information of the first AP includes the The current first RSSI of the first AP.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and the wifi channel scan is performed to obtain the current occupied by the first AP
  • N is an integer greater than 0
  • the wifi channel scan is performed to obtain the current occupied by the first AP
  • the determining the first degree of interference based on the idle duty ratio of each channel includes:
  • the idle duty ratio of each channel is greater than or equal to the fourth threshold, or the sum of the N idle duty ratios in the N channels is greater than or equal to the fifth threshold, then it is determined that the first degree of interference is less than the fourth threshold.
  • the third threshold is
  • the idle duty ratio of each channel is less than the fourth threshold, or the sum of the N idle duty ratios in the N channels is less than the fifth threshold, it is determined that the first degree of interference is greater than or Equal to the third threshold.
  • the value range of the first degree of interference can be, for example, 0-10, 0 means no interference at all, and 10 means the degree of interference is the greatest.
  • the third threshold can be 1, 3, 5, or other values, for example, which is not limited here. .
  • the fourth threshold may be 3%, 5%, 7%, or other values, for example, which is not limited here.
  • the fifth threshold can be, for example, 10%, 20%, 30%, or other values, which are not limited here.
  • N is less than or equal to 4 and greater than 1
  • N is less than or equal to 8 and greater than 3.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and the Wi-Fi channel scan is performed to obtain the first degree of interference of the channel currently occupied by the first AP
  • N is an integer greater than 0
  • the Wi-Fi channel scan is performed to obtain the first degree of interference of the channel currently occupied by the first AP
  • the first degree of interference is determined based on the number of wifi packets of each channel.
  • the determining the first degree of interference based on the number of wifi packets of each channel includes:
  • the sixth threshold If the number of wifi packets in each channel is greater than or equal to the sixth threshold, or the sum of the number of N wifi packets in the N channels is greater than or equal to the seventh threshold, it is determined that the first degree of interference is less than the first threshold.
  • the first degree of interference is greater than or equal to all The third threshold.
  • the sixth threshold may be, for example, 100/s, 150/s, 200/s, or other values, which are not limited here.
  • the seventh threshold can be, for example, 200/s, 250/s, 300/s, or other values, which are not limited here.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and the Wi-Fi channel scan is performed to obtain the first degree of interference of the channel currently occupied by the first AP
  • N is an integer greater than 0
  • the Wi-Fi channel scan is performed to obtain the first degree of interference of the channel currently occupied by the first AP
  • the overlapping part of the second channel and the first channel is S 1
  • the overlapping part of the third channel and the first channel is S 2
  • the S 1 is greater than the S 2 .
  • Q is the first degree of interference
  • D 1 , D 2 , D 3 and D 4 are the second, third and fourth numbers respectively
  • R 1 , R 2 and R 3 are the second RSSI and third respectively RSSI and fourth RSSI.
  • channel 3 will partially overlap with channel 1, channel 2, channel 4, and channel 5, and channel 9 will overlap with channel 7.
  • Channel 8, Channel 10, and Channel 11 partially overlap.
  • the N is 8, the first channel is channel 6, the second channel is channels 5 and 7, the third channel is channels 4 and 8, and the fourth channel is channel 3.
  • the fifth channel is channels 2 and 10. If the second number is 1, the second RSSI is -30dB, the third number is 2, the third RSSI is -40dB, the fourth number is 3, and the fourth RSSI is -50dB, the Q can be calculated to be 287.5.
  • the determining a first parameter value based on the first RSSI, the first quantity, and the first degree of interference includes:
  • the first RSSI is greater than or equal to a first threshold, the first number is less than a second threshold, and the first degree of interference is less than a third threshold, determining that the first parameter value is within the first range;
  • the first RSSI is less than the first threshold, and/or the first number is greater than or equal to the second threshold, and/or the first degree of interference is greater than or equal to the third threshold, then determine The first parameter value is within the second range.
  • the first threshold can be, for example, -50dB, -60dB, -70dB, or other values, which are not limited here.
  • the first number can be, for example, 5, 7, 9, or other values, which is not limited here.
  • the range of the first parameter value may be, for example, 0-10, 0 means the quality of the communication environment is the best, 10 means the quality of the communication environment is the worst, and the first range may be, for example, 0-3, 0-5, or others. The value is not limited here.
  • the determining a first parameter value based on the first RSSI, the first quantity, and the first degree of interference includes:
  • the first RSSI is converted into a first value, the first amount is converted into a second value, and the first interference level is converted into a third value, the first value, the second value and The third value is of the same order of magnitude;
  • the first parameter value is determined based on the first value, the first weight, the second value, the second weight, the third value, and the third weight, and the first weight is used to indicate that the RSSI is used to evaluate the first parameter value.
  • the second weight is used to indicate the proportion of the number of APs used to evaluate the first parameter value
  • the third weight is used to indicate that the first degree of interference is used to evaluate the value of the first parameter.
  • the proportion of the first parameter value, the sum of the first weight, the second weight, and the third weight is 1.
  • Table 2 is a conversion relationship table between a first RSSI and a first value provided in an embodiment of the present application
  • Table 3 is a conversion relationship table between a first quantity and a second value provided in an embodiment of the present application
  • Table 4 It is a conversion relationship table between the first interference degree and the third value provided by the embodiment of the present application.
  • Second value Less than 3 0 Greater than or equal to 3 and less than 5 1 Greater than or equal to 5 and less than 7 2 Greater than or equal to 7 and less than 9 3 ⁇ ⁇
  • first weight, the second weight, and the third weight may be determined based on empirical parameters.
  • first weight, the second weight, and the third weight may be 0.1, 0.2, 0.7, or 0.2, 0.4, 0.4, not limited here.
  • the first weight, the second weight, and the third weight can be 0.1, 0.2, 0.7, and the first, second, and third values are 5, 5, and 6, respectively, and the first parameter value can be calculated Is 5.7.
  • Step 202 If the first parameter value is within the first range, set the frequency band bandwidth of the electronic device to the first frequency band bandwidth, the first frequency band bandwidth is greater than the second frequency band bandwidth, and the second frequency band bandwidth Is the frequency band bandwidth set when the first parameter value is in the second range, the first parameter value is in the first range to characterize the quality of the first communication environment, and the first parameter value is in the second range
  • the internal characterization of the quality of the second communication environment, the quality of the first communication environment is better than the quality of the second communication environment, and the frequency band bandwidth currently used by the first AP is the first frequency band bandwidth.
  • the bandwidth of the second frequency band may be, for example, 10 MHz, 20 MHz, 30 MHz or other values, which is not limited here.
  • Step 203 Establish a wireless connection with the first AP.
  • a specific implementation manner of establishing a wireless connection with the first AP is: sending a connection request to the first AP, where the connection request carries authentication information required to connect to the first AP; and receiving; A connection response sent by the first AP in response to the connection request.
  • the authentication information may include, for example, the MAC address of the electronic device, the connection password, and the like.
  • the frequency band bandwidth of the electronic device is first set to a larger frequency band bandwidth, and then the wireless connection with the first AP is established. connection. Since the quality of the communication environment between the electronic device and the first AP is good, choosing a larger frequency band bandwidth has less impact on the communication stability between the two. At the same time, the larger the frequency band bandwidth, the greater the data transmission speed. While ensuring the stability of communication, it can also increase the data transmission speed.
  • the method further includes:
  • the frequency band bandwidth of the electronic device is set to the second frequency band bandwidth, and a wireless connection with the first AP is established, and the first AP
  • the currently used frequency band bandwidth also includes the second frequency band bandwidth.
  • the bandwidth of the first frequency band may be, for example, 40 MHz, and the bandwidth of the second frequency band may be, for example, 20 MHz.
  • the frequency band bandwidth of the device allows the use of the first frequency band bandwidth
  • the frequency band bandwidth of the device allows the use of the second frequency band bandwidth.
  • the frequency band bandwidth of the electronic device is first set to a smaller frequency band bandwidth, and then the communication with the first AP is established. Wireless connections. Since the quality of the communication environment between the electronic device and the first AP is not good, selecting a smaller frequency band bandwidth has less impact on the communication stability between the two, which ensures the communication stability.
  • FIG. 3 is a schematic flowchart of a method for establishing a wifi connection provided by an embodiment of the present application, which is applied to an electronic device, and the method includes:
  • Step 301 Perform wifi channel scanning to obtain the idle duty ratio of each of the N channels, the number of wifi packets of each of the N channels, the current first RSSI of the first AP, and all The first number of APs currently scanned by the electronic device, the N channels are channels currently occupied by the first AP, and the N is an integer greater than 0.
  • Step 302 Determine a first degree of interference based on the idle duty ratio of each channel.
  • Step 303 Determine a first degree of interference based on the number of wifi packets of each channel.
  • Step 304 Determine whether the first RSSI is greater than or equal to a first threshold, whether the first number is less than a second threshold, and whether the first degree of interference is less than a third threshold.
  • step 305 If yes, go to step 305;
  • Step 305 Determine that the first parameter value is within the first range, and then perform step 310.
  • Step 306 Determine that the first parameter value is within the second range, and then execute step 311.
  • Step 307 Convert the first RSSI to a first value, convert the first number to a second value, and convert the first degree of interference to a third value, the first value, the first value
  • the second value is of the same order of magnitude as the third value.
  • Step 308 Determine the first parameter value based on the first value, the first weight, the second value, the second weight, the third value, and the third weight, where the first weight is used to represent RSSI When used to evaluate the value of the first parameter, the second weight is used to indicate the proportion of the number of APs used to evaluate the value of the first parameter, and the third weight is used to indicate the second interference The proportion of the degree when used to evaluate the value of the first parameter, and the sum of the first weight, the second weight, and the third weight is 1.
  • Step 309 Determine whether the first parameter is within the first range or the second range.
  • step 310 If it is within the first range, perform step 310;
  • step 311 is executed.
  • Step 310 Set the frequency band bandwidth of the electronic device to the first frequency band bandwidth, and establish a wireless connection with the first AP, the first frequency band bandwidth is greater than the second frequency band bandwidth, and the second frequency band bandwidth is all
  • the second communication environment quality, the first communication environment quality is better than the second communication environment quality
  • the frequency band bandwidth currently used by the first AP is the first frequency band bandwidth.
  • Step 311 Set the frequency band bandwidth of the electronic device to the second frequency band bandwidth, and establish a wireless connection with the first AP, and the frequency band bandwidth currently used by the first AP also includes the second frequency band bandwidth .
  • step 302 and step 303 are two different implementations. In the embodiment of this application, it can be step 302 or step 303; step 304 and step 307-step 309 are two different implementations. In the embodiment of the present application, it may be step 304 or step 307 to step 309, which is not limited here.
  • step 304 or step 307 to step 309 which is not limited here.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device includes a processor and a memory. , A communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the processor, and the programs include instructions for executing the following steps:
  • the frequency band bandwidth of the electronic device is set to the first frequency band bandwidth, the first frequency band bandwidth is greater than the second frequency band bandwidth, and the second frequency band bandwidth is the The frequency band bandwidth set when the first parameter value is in the second range, the first parameter value characterizes the quality of the first communication environment in the first range, and the first parameter value characterizes the first communication environment quality in the second range. 2.
  • the quality of the communication environment, the quality of the first communication environment is better than the quality of the second communication environment, and the frequency band bandwidth currently used by the first AP is the first frequency band bandwidth;
  • the above-mentioned program includes instructions specifically for executing the following steps:
  • the first parameter value is determined based on the first RSSI, the first quantity, and the first degree of interference.
  • the foregoing program includes instructions specifically for executing the following steps:
  • the first RSSI is greater than or equal to a first threshold, the first number is less than a second threshold, and the first degree of interference is less than a third threshold, determining that the first parameter value is within the first range;
  • the first RSSI is less than the first threshold, and/or the first number is greater than or equal to the second threshold, and/or the first degree of interference is greater than or equal to the third threshold, then determine The first parameter value is within the second range.
  • the foregoing program includes instructions specifically for executing the following steps:
  • the first RSSI is converted into a first value, the first amount is converted into a second value, and the first interference level is converted into a third value, the first value, the second value and The third value is of the same order of magnitude;
  • the first parameter value is determined based on the first value, the first weight, the second value, the second weight, the third value, and the third weight, and the first weight is used to indicate that the RSSI is used to evaluate the first parameter value.
  • the second weight is used to indicate the proportion of the number of APs used to evaluate the first parameter value
  • the third weight is used to indicate that the first degree of interference is used to evaluate the value of the first parameter.
  • the proportion of the first parameter value, the sum of the first weight, the second weight, and the third weight is 1.
  • the above-mentioned program includes instructions that are further used to execute the following steps:
  • the frequency band bandwidth of the electronic device is set to the second frequency band bandwidth, and a wireless connection with the first AP is established, and the first AP
  • the currently used frequency band bandwidth also includes the second frequency band bandwidth.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and wifi channel scanning is being performed to obtain the channels currently occupied by the first AP
  • the above program includes instructions specifically for executing the following steps:
  • the first degree of interference is determined based on the idle duty ratio of each channel.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and wifi channel scanning is being performed to obtain the channels currently occupied by the first AP
  • the above program includes instructions specifically for executing the following steps:
  • the first degree of interference is determined based on the number of wifi packets of each channel.
  • an electronic device includes hardware structures and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • the embodiment of the present application may divide the electronic device into functional units according to the method example.
  • each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the integrated unit can be implemented in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 5 is a schematic structural diagram of a wifi connection establishment device provided by an embodiment of the present application, which is applied to electronic equipment, and the device includes:
  • the parameter determination unit 501 is configured to perform a Wi-Fi channel scan to determine a first parameter value, where the first parameter value is used to evaluate the quality of the communication environment between the electronic device and the first wireless access node AP;
  • the bandwidth setting unit 502 is configured to set the frequency band bandwidth of the electronic device to the first frequency band bandwidth if the first parameter value is within the first range, and the first frequency band bandwidth is greater than the second frequency band bandwidth, and
  • the second frequency band bandwidth is the frequency band bandwidth set when the first parameter value is in the second range, the first parameter value represents the quality of the first communication environment in the first range, and the first parameter value is in the first range.
  • the second range characterizes the quality of the second communication environment, the quality of the first communication environment is better than the quality of the second communication environment, and the frequency band bandwidth currently used by the first AP is the first frequency band bandwidth;
  • the connection establishment unit 503 is configured to establish a wireless connection with the first AP.
  • the parameter determining unit 501 is specifically configured to perform wifi channel scanning to obtain the current first reception of the first AP
  • the signal strength indicates the RSSI, the first number of APs currently scanned by the electronic device, and the first degree of interference of the channel currently occupied by the first AP; based on the first RSSI, the first number, and the The first degree of interference determines the value of the first parameter.
  • the parameter determining unit 501 is specifically configured to: If an RSSI is greater than or equal to the first threshold, the first number is less than the second threshold, and the first degree of interference is less than the third threshold, it is determined that the first parameter value is within the first range; if the first RSSI Is less than the first threshold, and/or the first number is greater than or equal to the second threshold, and/or the first interference degree is greater than or equal to the third threshold, then the first parameter value is determined Within the second range.
  • the parameter determination unit 501 is specifically configured to determine the first parameter value Convert an RSSI to a first value, convert the first number to a second value, and convert the first degree of interference to a third value, the first value, the second value, and the third value
  • the numerical values are of the same order of magnitude; the first parameter value is determined based on the first numerical value, the first weight, the second numerical value, the second weight, the third numerical value, and the third weight, and the first weight is used to represent RSSI
  • the second weight is used to indicate the proportion of the number of APs used to evaluate the value of the first parameter, and the third weight is used to indicate the first interference
  • the proportion of the degree when used to evaluate the value of the first parameter, and the sum of the first weight, the second weight, and the third weight is 1.
  • the bandwidth setting unit 502 is further configured to set the frequency band bandwidth of the electronic device to the second frequency band if the first parameter value is within the second range Bandwidth;
  • the connection establishment unit 503 is further configured to establish a wireless connection with the first AP, the frequency band bandwidth currently used by the first AP also includes the second frequency band bandwidth, the second frequency band bandwidth is less than the The bandwidth of the first frequency band.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and wifi channel scanning is being performed to obtain the channels currently occupied by the first AP
  • the parameter determining unit 501 is specifically configured to perform Wi-Fi channel scanning to obtain the idle duty ratio of each of the N channels; based on the idle duty of each channel Ratio determines the first degree of interference.
  • the number of channels currently occupied by the first AP is N, where N is an integer greater than 0, and wifi channel scanning is being performed to obtain the channels currently occupied by the first AP
  • the parameter determination unit 501 is specifically configured to perform wifi channel scanning to obtain the number of wireless fidelity wifi packets for each of the N channels; based on the wifi of each channel The number of packets determines the first degree of interference.
  • parameter determination unit 501 the bandwidth setting unit 502, and the connection establishment unit 503 may be implemented by a processor.
  • An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method as recorded in the above method embodiment ,
  • the above-mentioned computer includes electronic equipment.
  • the embodiments of the present application also provide a computer program product.
  • the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program.
  • the above-mentioned computer program is operable to cause a computer to execute any of the methods described in the above method embodiments. Part or all of the steps of the method.
  • the computer program product may be a software installation package, and the above-mentioned computer includes electronic equipment.
  • the disclosed device may be implemented in other ways.
  • the device embodiments described above are only illustrative, for example, the division of the above-mentioned units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable memory.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory.
  • a number of instructions are included to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the foregoing methods of the various embodiments of the present application.
  • the aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk, or optical disk and other media that can store program codes.
  • the program can be stored in a computer-readable memory, and the memory can include: a flash disk , Read-only memory (English: Read-Only Memory, abbreviation: ROM), random access device (English: Random Access Memory, abbreviation: RAM), magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请公开了一种wifi连接建立方法及相关设备,该方法包括:进行wifi信道扫描,以确定第一参数值,该第一参数值用于评价电子设备与第一AP之间的通信环境的质量;若第一参数值在第一范围内,则将电子设备的频段带宽设置为第一频段带宽;建立与第一AP的无线连接。采用本申请实施例可在通信环境良好的情况下,提升数据传输速度。

Description

wifi连接建立方法及相关设备 技术领域
本申请涉及电子技术领域,尤其涉及一种wifi连接建立方法及相关设备。
背景技术
在无线通信时,一个频段可以分为多个信道,在我国2.4G频段下一共设有14个信道,允许使用的信道有13个,2.4G频段的频段带宽有两种:20MHz和40MHz。目前,大多数的电子设备(如智能手机、平板等)厂商通常是直接将电子设备的频段带宽固定在20MHz,这种方式在某些情况下可能会限制电子设备的数据传输速度。
发明内容
本申请实施例提供一种wifi连接建立方法及相关设备,用于在通信环境良好的情况下,提升数据传输速度。
第一方面,本申请实施例提供一种wifi连接建立方法,应用于电子设备,所述方法包括:
进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一无线访问节点AP之间的通信环境的质量;
若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽;
建立与所述第一AP的无线连接。
第二方面,本申请实施例提供一种wifi连接建立装置,应用于电子设备,所述装置包括:
参数确定单元,用于进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一AP之间的通信环境的质量;
带宽设置单元,用于若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽;
连接建立单元,用于建立与所述第一AP的无线连接。
第三方面,本申请实施例提供一种电子设备,该电子设备包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如本申请实施例第一方面所述的方法中所描述的部分或全部步骤的指令。
第四方面,本申请实施例提供了一种计算机可读存储介质,其中,上述计算机可读存储介质用于存储计算机程序,其中,上述计算机程序被处理器执行,以实现如本申请实施例第一方面所述的方法中所描述的部分或全部步骤。
第五方面,本申请实施例提供了一种计算机程序产品,其中,上述计算机程序产品包 括存储了计算机程序的非瞬时性计算机可读存储介质,上程序可操作来使计算机执行如本申请实施例第一方面所述的方法中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种网络架构的结构示意图;
图2是本申请实施例提供的一种连接建立方法的流程示意图;
图3是本申请实施例提供的一种连接建立方法的流程示意图;
图4是本申请实施例提供的一种电子设备的结构示意图;
图5是本申请实施例提供的一种连接建立装置的结构示意图。
具体实施方式
本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。
本申请实施例提供了一种无线保真wifi连接建立方法,应用于电子设备,所述方法包括:
进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一无线访问节点AP之间的通信环境的质量;
若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽;
建立与所述第一AP的无线连接。
其中,所述进行wifi信道扫描,以确定第一参数值,包括:
电子设备扫描多个wifi信道,接收P个AP发送的信标帧报文,每个信标帧报文携带其对应的AP的工作信息,基于P个AP的工作信息确定第一参数值,所述P为大于1的整数。
其中,所述方法还包括:
基于所述P个AP的工作信息确定所述第一AP。
其中,所述基于所述P个AP的工作信息确定所述第一AP,包括:
确定所述P个AP中的p个AP,所述p个AP中的每个AP当前使用的频段带宽均为第一频段带宽,所述p为正整数;从所述p个AP中选择其中一个AP确定为所述第一AP。
其中,所述进行wifi信道扫描,以确定第一参数值,包括:
进行wifi信道扫描,以得到所述第一AP当前的第一接收信号强度指示RSSI、所述电子设备当前扫描到的AP的第一数量、以及所述第一AP当前所占用的信道的第一干扰程度;
基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值。
其中,所述进行wifi信道扫描,以得到所述电子设备当前扫描到的AP的第一数量,包括:
基于所述P个AP的工作信息确定所述电子设备当前扫描到的AP的第一数量为P。
其中,所述进行wifi信道扫描,以得到所述第一AP当前的第一RSSI,包括:
获取所述第一AP的工作信息,所述第一AP的工作信息包括所述第一AP当前的第一RSSI。
其中,所述基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值,包括:
若所述第一RSSI大于或等于第一阈值、所述第一数量小于第二阈值、所述第一干扰程度小于第三阈值,则确定第一参数值在所述第一范围内;
若所述第一RSSI小于所述第一阈值、和/或所述第一数量大于或等于所述第二阈值、和/或所述第一干扰程度大于或等于所述第三阈值,则确定所述第一参数值在所述第二范围内。
其中,所述基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值,包括:
将所述第一RSSI转换为第一数值,将所述第一数量转换为第二数值,以及将所述第一干扰程度转换为第三数值,所述第一数值、所述第二数值和所述第三数值的数量级相同;
基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定第一参数值,所述第一权重用于表示RSSI在用于评价第一参数值时所占的比重,所述第二权重用于表示AP的数量在用于评价第一参数值时所占的比重,所述第三权重用于表示第一干扰程度在用于评价第一参数值时所占的比重,所述第一权重、所述第二权重与所述第三权重之和为1。
其中,所述方法还包括:
若所述第一参数值在所述第二范围内,则将所述电子设备的频段带宽设置为所述第二频段带宽,以及建立与所述第一AP的无线连接,所述第一AP当前使用的频段带宽还包括所述第二频段带宽。
其中,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度,包括:
进行wifi信道扫描,以得到所述N个信道中的每个信道的空闲空占比;
基于所述每个信道的空闲空占比确定第一干扰程度。
其中,所述基于所述每个信道的空闲空占比确定第一干扰程度,包括:
若所述每个信道的空闲空占比均大于或等于第四阈值,或者所述N个信道中的N个空闲空占比之和大于或等于第五阈值,则确定第一干扰程度小于所述第三阈值;
若所述每个信道的空闲空占比均小于所述第四阈值,或者所述N个信道中的N个空闲空占比之和小于所述第五阈值,则确定第一干扰程度大于或等于所述第三阈值。
其中,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度,包括:
进行wifi信道扫描,以得到所述N个信道中的每个信道的wifi封包数量;
基于所述每个信道的wifi封包数量确定第一干扰程度。
其中,所述基于所述每个信道的wifi封包数量确定第一干扰程度,包括:
若所述每个信道的wifi封包数量均大于或等于第六阈值,或者所述N个信道中的N个wifi封包数量之和大于或等于第七阈值,则确定第一干扰程度小于所述第三阈值;
若所述每个信道的wifi封包数量均小于所述第六阈值,或者所述N个信道中的N个 wifi封包数量之和小于所述第七阈值,则确定第一干扰程度大于或等于所述第三阈值。
其中,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度,包括:
进行wifi信道扫描,以得到所述第一AP当前所使用的第一信道,以及所述第一信道中的第二AP的第二数量和所述第二AP当前的第二RSSI;
进行wifi信道扫描,以得到所述N个信道中与所述第一信道第一近邻的第二信道,以及所述第二信道中的第三AP的第三数量和所述第三AP当前的第三RSSI;
进行wifi信道扫描,以得到所述N个信道中与所述第一信道第二近邻的第三信道,以及所述第三信道中的第四AP的第四数量和所述第四AP当前的第四RSSI;
基于所述第二数量、所述第二RSSI、所述第三数量、所述第三RSSI、所述第四数量、所述第四RSSI和第一干扰程度计算公式确定所述第一干扰程度。
其中,所述基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值,包括:
将所述第一RSSI转换为第一数值,将所述第一数量转换为第二数值,以及将所述第一干扰程度转换为第三数值,所述第一数值、所述第二数值和所述第三数值的数量级相同;
基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定第一参数值,所述第一权重用于表示RSSI在用于评价第一参数值时所占的比重,所述第二权重用于表示AP的数量在用于评价第一参数值时所占的比重,所述第三权重用于表示第一干扰程度在用于评价第一参数值时所占的比重,所述第一权重、所述第二权重与所述第三权重之和为1。
本申请实施例还提供了一种wifi连接建立装置,应用于电子设备,所述装置包括:
参数确定单元,用于进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一AP之间的通信环境的质量;
带宽设置单元,用于若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽;
连接建立单元,用于建立与所述第一AP的无线连接。
本申请实施例还提供了一种电子设备,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如本申请上述实施例提供的方法中的步骤的指令。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现本申请上述实施例提供的方法。
本申请实施例还提供了一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请上述实施例提供的方法的部分或全部步骤。
如图1所示,图1是本申请实施例提供的一种网络构架的结构示意图。该网络构架包括电子设备和多个无线访问节点(Access Point,AP),该多个AP包括第一AP。
其中,电子设备在该网络构架中作为站点(Station,STA)角色。各个AP通过不停地发送信标帧(Beacon)报文来通知其周围的STA,使STA可以搜索到AP。
其中,电子设备可以包括各种具有无线通信功能的手持设备、车载设备、可穿戴设备 (例如智能手表、智能手环、计步器等)、计算设备或通信连接到无线调制解调器的其他处理设备,以及各种形式的用户设备(User Equipment,UE),移动台(Mobile Station,MS),终端设备(terminal device)等等。为方便描述,上面提到的设备统称为电子设备。
其中,AP是无线网和有线网之间沟通的桥梁,是组建无线局域网(WLAN)的核心设备。它主要是提供STA和有线局域网之间的互相访问,这样,在第一AP信号覆盖范围内的STA可以通过它进行相互通信,没有AP基本上就无法组建真正意义上可访问Internet的WLAN。AP在WLAN中就相当于发射基站在移动通信网络中的角色。
目前,STA和AP进行无线通信的常见频段主要有两个:2.4G频段和5G频段。2.4G频段的频率范围为2.4GHz~2.4835GHz。5G的频率范围为5.15GHz~5.825GHz。
其中,STA和AP通过信道进行无线通信。2.4G频段一共设有14个信道,但在我国只允许使用前13个信道。每个信道22MHz宽,实际用来传输数据的只有20MHz,另外2MHz用来隔离信道。2.4G一共可用83.5MHz,信道与信道之间大多会有重叠。每个信道的中心频率间隔5MHz。2.4GHz中信道、中心频率和频率范围的映射关系如表1所示。
表1
信道 中心频率(MHz) 频率范围(MHz)
01 2412 2401-2423
02 2417 2406-2428
03 2422 2411-2433
04 2427 2416-2438
05 2432 2421-2443
06 2437 2426-2448
07 2442 2431-2453
08 2447 2426-2448
09 2452 2441-2463
10 2457 2446-2468
11 2462 2451-2473
12 2467 2456-2478
13 2472 2461-2483
其中,频段带宽分为20MHz和40MHz。20MHz频宽的抗干扰能力强,但是数据传输速度慢,而40MHz频宽的抗干扰能力弱,数据传输速度快。由于信道与信道之间大多会有重叠,因此信道与信道之间会有冲突。在通信环境较差时20MHz频宽的传输效率高于40MHz频宽的传输效率,而在通信环境良好时40MHz频宽的传输效率高于20MHz频宽的传输效率。
下面对本申请实施例进行详细介绍。
请参阅图2,图2是本申请实施例提供的一种wifi连接建立方法的流程示意图,应用于电子设备,所述方法包括:
步骤201:进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一无线访问节点AP之间的通信环境的质量。
具体地,所述进行wifi信道扫描,以确定第一参数值包括:电子设备扫描多个wifi信道,接收P个AP发送的信标帧(Beacon)报文,每个信标帧报文携带其对应的AP的工作信息,基于P个AP的工作信息确定第一参数值,所述P为大于1的整数。
其中,每个AP的工作信息包括该AP的标识、该AP当前使用的频段带宽、该AP当前的接收信号强度指示(Received Signal Strength Indication,RSSI)、该AP当前所占用的 信道的数量、该AP当前所占用的信道中每个信道的空闲空占比、该AP当前所占用的信道中每个信道的wifi封包数量等。
其中,RSSI是无线发送层的可选部分,用来判定链接质量,以及是否增大广播发送强度。通过RSSI的强弱可以测定信号点与接收点的距离,进而根据相应数据进行定位。
其中,每个AP当前所占用的信道的数量指的是不同频段带宽下占用的信道个数,举例说明,若频段带宽为20MHz,则占用的信道的数量可以为4,若频段带宽为40MHz,则占用的信道的数量可以为8。
又举例说明,假定频段带宽为20MHz,第一AP当前所使用的信道为信道6,如表1所示,信道6的频率范围为2426MHz~2448MHz,信道4的中心频率为2427MHz,信道5的中心频率为2432MHz,信道7的中心频率为2442MHz,信道8的中心频率为2447MHz,信道6的频率范围包括信道4、信道5、信道7和信道8的中心频率,所以信道6占用的信道的数量为4。
其中,空闲空占比指的是单位时间内信道未被占用用于传输数据时的时间与该单位时间的比值。
其中,wifi封包数量指的是电子设备单位时间内监测到的wifi工作频段的封包数量,用于表征电子设备周围环境中wifi工作频段的微波能量的大小。
进一步地,所述方法还包括:基于所述P个AP的工作信息确定所述第一AP。
具体地,所述基于所述P个AP的工作信息确定所述第一AP的具体实现方式为:确定所述P个AP中的p个AP,所述p个AP中的每个AP当前使用的频段带宽均为第一频段带宽,所述p为正整数;从所述p个AP中选择其中一个AP确定为所述第一AP。
其中,第一频段带宽例如为40MHz,80MHz等。
在本申请的一实现方式中,所述进行wifi信道扫描,以确定第一参数值,包括:
进行wifi信道扫描,以得到所述第一AP当前的第一接收信号强度指示RSSI、所述电子设备当前扫描到的AP的第一数量、以及所述第一AP当前所占用的信道的第一干扰程度;
基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值。
具体地,所述进行wifi信道扫描,以得到所述电子设备当前扫描到的AP的第一数量的一具体实现方式为:基于所述P个AP的工作信息确定所述电子设备当前扫描到的AP的第一数量为P。
具体地,所述进行wifi信道扫描,以得到所述第一AP当前的第一RSSI的一具体实现方式为:获取所述第一AP的工作信息,所述第一AP的工作信息包括所述第一AP当前的第一RSSI。
在本申请的一实现方式中,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度的一具体实现方式为:
进行wifi信道扫描,以得到所述N个信道中的每个信道的空闲空占比;基于所述每个信道的空闲空占比确定第一干扰程度,所述第一AP的工作信息包括所述N个信道中的每个信道的空闲空占比。
进一步地,所述基于所述每个信道的空闲空占比确定第一干扰程度,包括:
若所述每个信道的空闲空占比均大于或等于第四阈值,或者所述N个信道中的N个空闲空占比之和大于或等于第五阈值,则确定第一干扰程度小于所述第三阈值;
若所述每个信道的空闲空占比均小于所述第四阈值,或者所述N个信道中的N个空闲空占比之和小于所述第五阈值,则确定第一干扰程度大于或等于所述第三阈值。
其中,第一干扰程度的取值范围例如可以为0~10,0表示完全无干扰,10表示干扰程 度最大,则第三阈值例如可以为1、3、5或是其他值,在此不作限定。
其中,第四阈值例如可以为3%、5%、7%,或是其他值,在此不作限定。第五阈值例如可以为10%、20%、30%,或是其他值,在此不作限定。
其中,若频段带宽为20MHz,则N小于或等于4且大于1,若频段带宽为40MHz,则N小于或等于8且大于3。
具体地,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度的另一具体实现方式为:
进行wifi信道扫描,以得到所述N个信道中的每个信道的wifi封包数量;
基于所述每个信道的wifi封包数量确定第一干扰程度。
进一步地,所述基于所述每个信道的wifi封包数量确定第一干扰程度,包括:
若所述每个信道的wifi封包数量均大于或等于第六阈值,或者所述N个信道中的N个wifi封包数量之和大于或等于第七阈值,则确定第一干扰程度小于所述第三阈值;
若所述每个信道的wifi封包数量均小于所述第六阈值,或者所述N个信道中的N个wifi封包数量之和小于所述第七阈值,则确定第一干扰程度大于或等于所述第三阈值。
其中,第六阈值例如可以为100/s、150/s、200/s,或是其他值,在此不作限定。第七阈值例如可以为200/s、250/s、300/s,或是其他值,在此不作限定。
具体地,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度的另一具体实现方式为:
进行wifi信道扫描,以得到所述第一AP当前所使用的第一信道,以及所述第一信道中的第二AP的第二数量和所述第二AP当前的第二RSSI;
进行wifi信道扫描,以得到所述N个信道中与所述第一信道第一近邻的第二信道,以及所述第二信道中的第三AP的第三数量和所述第三AP当前的第三RSSI;
进行wifi信道扫描,以得到所述N个信道中与所述第一信道第二近邻的第三信道,以及所述第三信道中的第四AP的第四数量和所述第四AP当前的第四RSSI;
基于所述第二数量、所述第二RSSI、所述第三数量、所述第三RSSI、所述第四数量、所述第四RSSI和第一干扰程度计算公式确定所述第一干扰程度。
其中,第二信道与第一信道的重叠部分为S 1,第三信道与第一信道的重叠部分为S 2,其中所述S 1大于所述S 2
其中,所述第一干扰程度公式为Q=(D 1×100-R 1×0.2)+(D 2×100-R 2×0.2)×0.5+(D 3×100-R 3×0.2)×0.25,Q为第一干扰程度,D 1、D 2、D 3和D 4分别为第二数量、第三数量和第四数量,R 1、R 2和R 3分别为第二RSSI、第三RSSI和第四RSSI。
举例说明,假定频段带宽为40MHz,第一AP当前所使用的信道为信道3和信道9,则信道3会和信道1、信道2、信道4以及信道5产生部分重叠,信道9会和信道7、信道8、信道10以及信道11产生部分重叠,所述N为8,第一信道为信道6,第二信道为信道5和7,第三信道为信道4和8,第四信道为信道3和9,第五信道为信道2和10。若第二数量为1,第二RSSI为-30dB,第三数量为2,第三RSSI为-40dB,第四数量为3,第四RSSI为-50dB,则可计算出Q为287.5。
在本申请的一实现方式中,所述基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值,包括:
若所述第一RSSI大于或等于第一阈值、所述第一数量小于第二阈值、所述第一干扰程度小于第三阈值,则确定第一参数值在所述第一范围内;
若所述第一RSSI小于所述第一阈值、和/或所述第一数量大于或等于所述第二阈值、和/或所述第一干扰程度大于或等于所述第三阈值,则确定所述第一参数值在所述第二范围内。
其中,第一阈值例如可以为-50dB、-60dB、-70dB,或是其他值,在此不作限定。第一数量例如可以为5、7、9,或是其他值,在此不作限定。
其中,第一参数值的范围例如可以为0~10,0表示通信环境的质量最佳,10表示通信环境的质量最差,则第一范围例如可以为0~3、0~5或是其他值,在此不作限定。
在本申请的一实现方式中,所述基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值,包括:
将所述第一RSSI转换为第一数值,将所述第一数量转换为第二数值,以及将所述第一干扰程度转换为第三数值,所述第一数值、所述第二数值和所述第三数值的数量级相同;
基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定第一参数值,所述第一权重用于表示RSSI在用于评价第一参数值时所占的比重,所述第二权重用于表示AP的数量在用于评价第一参数值时所占的比重,所述第三权重用于表示第一干扰程度在用于评价第一参数值时所占的比重,所述第一权重、所述第二权重与所述第三权重之和为1。
其中,表2是本申请实施例提供的一种第一RSSI和第一数值的转换关系表,表3是本申请实施例提供的一种第一数量和第二数值的转换关系表,表4是本申请实施例提供的一种第一干扰程度和第三数值的转换关系表。
表2
第一RSSI 第一数值
大于-30dB 0
小于-30dB,且大于或等于-35dB 1
小于-35dB,且大于或等于-40dB 2
小于-40dB,且大于或等于-45dB 3
··· ···
表3
第一数量 第二数值
小于3 0
大于或等于3,且小于5 1
大于或等于5,且小于7 2
大于或等于7,且小于9 3
··· ···
表4
第一干扰程度 第三数值
0 0
1 1
2 2
3 3
··· ···
进一步地,第一权重、第二权重和第三权重可以基于经验参数确定,举例说明,第一权重、第二权重和第三权重分别可以为0.1、0.2、0.7,也可以为0.2、0.4、0.4,在此不作限定。
进一步地,所述基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定第一参数值的一具体实现方式为:基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值、第三权重和第一参数值的计算公式确定第一参数值,所述第一参数值的计算公式为:S=A×a+B×b+C×c,A、B和C分别为第一数值、第二数值和第三数值,a、b和c分别为第一权重、第二权重和第三权重,S为第一参数值。
举例说明,第一权重、第二权重和第三权重分别可以为0.1、0.2、0.7,第一数值、第二数值和第三数值分别为5、5、6,则可计算出第一参数值为5.7。
步骤202:若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽。
其中,第二频段带宽例如可以是10MHz、20MHz、30MHz或是其他值,在此不作限定。
步骤203:建立与所述第一AP的无线连接。
具体地,所述建立与所述第一AP的无线连接的一具体实现方式为:向所述第一AP发送连接请求,所述连接请求携带连接所述第一AP所需要的认证信息;接收所述第一AP针对所述连接请求发送的连接响应。
其中,认证信息例如可以包括电子设备的MAC地址,连接密码等。
可以看出,在本申请实施例中,在电子设备与第一AP之间的通信环境质量良好时,先将电子设备的频段带宽设置为较大的频段带宽,然后建立与第一AP的无线连接。由于电子设备与第一AP之间的通信环境质量良好,所以选择较大的频段带宽对两者间的通信稳定性造成的影响较小,同时由于频段带宽越大,数据传输速度越大,因此在保证通信稳定性的同时,还可提升数据传输速度。
在本申请的一实现方式中,所述方法还包括:
若所述第一参数值在所述第二范围内,则将所述电子设备的频段带宽设置为所述第二频段带宽,以及建立与所述第一AP的无线连接,所述第一AP当前使用的频段带宽还包括所述第二频段带宽。
其中,第一频段带宽例如可以为40MHz,第二频段带宽例如可以为20MHz。
需要说明的是,若设备的频段带宽允许使用第一频段带宽,则设备的频段带宽允许使用第二频段带宽。
可以看出,在本申请实施例中,在电子设备与第一AP之间的通信环境质量不良好时,先将电子设备的频段带宽设置为较小的频段带宽,然后建立与第一AP的无线连接。由于电子设备与第一AP之间的通信环境质量不良好,所以选择较小的频段带宽对两者间的通信稳定性造成的影响较小,保证了通信稳定性。
与所述图2所示的实施例一致的,请参阅图3,图3是本申请实施例提供的一种wifi连接建立方法的流程示意图,应用于电子设备,所述方法包括:
步骤301:进行wifi信道扫描,以得到N个信道中的每个信道的空闲空占比,N个信 道中的每个信道的wifi封包数量,所述第一AP当前的第一RSSI、以及所述电子设备当前扫描到的AP的第一数量,所述N个信道为第一AP当前所占用的信道,所述N为大于0整数。
步骤302:基于所述每个信道的空闲空占比确定第一干扰程度。
步骤303:基于所述每个信道的wifi封包数量确定第一干扰程度。
步骤304:确定所述第一RSSI是否大于或等于第一阈值、所述第一数量是否小于第二阈值、所述第一干扰程度是否小于第三阈值。
若是,则执行步骤305;
若否,则执行步骤306。
步骤305:确定所述第一参数值在第一范围内,然后执行步骤310。
步骤306:确定所述第一参数值在第二范围内,然后执行步骤311。
步骤307:将所述第一RSSI转换为第一数值,将所述第一数量转换为第二数值,以及将所述第一干扰程度转换为第三数值,所述第一数值、所述第二数值和所述第三数值的数量级相同。
步骤308:基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定所述第一参数值,所述第一权重用于表示RSSI在用于评价第一参数值时所占的比重,所述第二权重用于表示AP的数量在用于评价第一参数值时所占的比重,所述第三权重用于表示第二干扰程度在用于评价第一参数值时所占的比重,所述第一权重、所述第二权重与所述第三权重之和为1。
步骤309:确定所述第一参数在所述第一范围内还是在所述第二范围内。
若在所述第一范围内,则执行步骤310;
若在所述第二范围内,则执行步骤311。
步骤310:将所述电子设备的频段带宽设置为第一频段带宽,以及建立与所述第一AP的无线连接,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽。
步骤311:将所述电子设备的频段带宽设置为所述第二频段带宽,以及建立与所述第一AP的无线连接,所述第一AP当前使用的频段带宽还包括所述第二频段带宽。
需要说明的是,步骤302和步骤303是两种不同的实现方式,在本申请实施例中,可以为步骤302或步骤303;步骤304和步骤307-步骤309是两种不同的实现方式,在本申请实施例中,可以为步骤304或步骤307-步骤309,在此不作限定。本实施例的具体实现过程可参见上述方法实施例所述的具体实现过程,在此不再叙述。
与上述图2和图3所示的实施例一致的,请参阅图4,图4是本申请实施例提供的一种电子设备的结构示意图,如图所示,该电子设备包括处理器、存储器、通信接口以及一个或多个程序,其中,上述一个或多个程序被存储在上述存储器中,并且被配置由上述处理器执行,上述程序包括用于执行以下步骤的指令:
进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一无线访问节点AP之间的通信环境的质量;
若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一 参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽;
建立与所述第一AP的无线连接。
在本申请的一实现方式中,在进行wifi信道扫描,以确定第一参数值方面,上述程序包括具体用于执行以下步骤的指令:
进行wifi信道扫描,以得到所述第一AP当前的第一接收信号强度指示RSSI、所述电子设备当前扫描到的AP的第一数量、以及所述第一AP当前所占用的信道的第一干扰程度;
基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值。
在本申请的一实现方式中,在基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值方面,上述程序包括具体用于执行以下步骤的指令:
若所述第一RSSI大于或等于第一阈值、所述第一数量小于第二阈值、所述第一干扰程度小于第三阈值,则确定第一参数值在所述第一范围内;
若所述第一RSSI小于所述第一阈值、和/或所述第一数量大于或等于所述第二阈值、和/或所述第一干扰程度大于或等于所述第三阈值,则确定所述第一参数值在所述第二范围内。
在本申请的一实现方式中,在基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值方面,上述程序包括具体用于执行以下步骤的指令:
将所述第一RSSI转换为第一数值,将所述第一数量转换为第二数值,以及将所述第一干扰程度转换为第三数值,所述第一数值、所述第二数值和所述第三数值的数量级相同;
基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定第一参数值,所述第一权重用于表示RSSI在用于评价第一参数值时所占的比重,所述第二权重用于表示AP的数量在用于评价第一参数值时所占的比重,所述第三权重用于表示第一干扰程度在用于评价第一参数值时所占的比重,所述第一权重、所述第二权重与所述第三权重之和为1。
在本申请的一实现方式中,上述程序包括还用于执行以下步骤的指令:
若所述第一参数值在所述第二范围内,则将所述电子设备的频段带宽设置为所述第二频段带宽,以及建立与所述第一AP的无线连接,所述第一AP当前使用的频段带宽还包括所述第二频段带宽。
在本申请的一实现方式中,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,在进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度方面,上述程序包括具体用于执行以下步骤的指令:
进行wifi信道扫描,以得到所述N个信道中的每个信道的空闲空占比;
基于所述每个信道的空闲空占比确定第一干扰程度。
在本申请的一实现方式中,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,在进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度方面,上述程序包括具体用于执行以下步骤的指令:
进行wifi信道扫描,以得到所述N个信道中的每个信道的无线保真wifi封包数量;
基于所述每个信道的wifi封包数量确定第一干扰程度。
需要说明的是,本实施例的具体实现过程可参见上述方法实施例所述的具体实现过程,在此不再叙述。
上述实施例主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元 及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据所述方法示例对电子设备进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。所述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
下面为本申请装置实施例,本申请装置实施例用于执行本申请方法实施例所实现的方法。请参阅图5,图5是本申请实施例提供的一种wifi连接建立装置的结构示意图,应用于电子设备,所述装置包括:
参数确定单元501,用于进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一无线访问节点AP之间的通信环境的质量;
带宽设置单元502,用于若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽;
连接建立单元503,用于建立与所述第一AP的无线连接。
在本申请的一实现方式中,在进行wifi信道扫描,以确定第一参数值方面,所述参数确定单元501,具体用于进行wifi信道扫描,以得到所述第一AP当前的第一接收信号强度指示RSSI、所述电子设备当前扫描到的AP的第一数量、以及所述第一AP当前所占用的信道的第一干扰程度;基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值。
在本申请的一实现方式中,在基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值方面,所述参数确定单元501,具体用于若所述第一RSSI大于或等于第一阈值、所述第一数量小于第二阈值、所述第一干扰程度小于第三阈值,则确定第一参数值在所述第一范围内;若所述第一RSSI小于所述第一阈值、和/或所述第一数量大于或等于所述第二阈值、和/或所述第一干扰程度大于或等于所述第三阈值,则确定所述第一参数值在所述第二范围内。
在本申请的一实现方式中,在基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值方面,所述参数确定单元501,具体用于将所述第一RSSI转换为第一数值,将所述第一数量转换为第二数值,以及将所述第一干扰程度转换为第三数值,所述第一数值、所述第二数值和所述第三数值的数量级相同;基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定第一参数值,所述第一权重用于表示RSSI在用于评价第一参数值时所占的比重,所述第二权重用于表示AP的数量在用于评价第一参数值时所占的比重,所述第三权重用于表示第一干扰程度在用于评价第一参数值时所占的比重,所述第一权重、所述第二权重与所述第三权重之和为1。
在本申请的一实现方式中,所述带宽设置单元502,还用于若所述第一参数值在所述第二范围内,则将所述电子设备的频段带宽设置为所述第二频段带宽;所述连接建立单元503,还用于建立与所述第一AP的无线连接,所述第一AP当前使用的频段带宽还包括所 述第二频段带宽,所述第二频段带宽小于所述第一频段带宽。
在本申请的一实现方式中,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,在进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度方面,所述参数确定单元501,具体用于进行wifi信道扫描,以得到所述N个信道中的每个信道的空闲空占比;基于所述每个信道的空闲空占比确定第一干扰程度。
在本申请的一实现方式中,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,在进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度方面,所述参数确定单元501,具体用于进行wifi信道扫描,以得到所述N个信道中的每个信道的无线保真wifi封包数量;基于所述每个信道的wifi封包数量确定第一干扰程度。
需要说明的是,参数确定单元501、带宽设置单元502和连接建立单元503可通过处理器实现。
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤,上述计算机包括电子设备。
本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤。该计算机程序产品可以为一个软件安装包,上述计算机包括电子设备。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存 储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。

Claims (20)

  1. 一种无线保真wifi连接建立方法,其特征在于,应用于电子设备,所述方法包括:
    进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一无线访问节点AP之间的通信环境的质量;
    若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽;
    建立与所述第一AP的无线连接。
  2. 根据权利要求1所述的方法,其特征在于,所述进行wifi信道扫描,以确定第一参数值,包括:
    电子设备扫描多个wifi信道,接收P个AP发送的信标帧报文,每个信标帧报文携带其对应的AP的工作信息,基于P个AP的工作信息确定第一参数值,所述P为大于1的整数。
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:
    基于所述P个AP的工作信息确定所述第一AP。
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述P个AP的工作信息确定所述第一AP,包括:
    确定所述P个AP中的p个AP,所述p个AP中的每个AP当前使用的频段带宽均为第一频段带宽,所述p为正整数;从所述p个AP中选择其中一个AP确定为所述第一AP。
  5. 根据权利要求1所述的方法,其特征在于,所述进行wifi信道扫描,以确定第一参数值,包括:
    进行wifi信道扫描,以得到所述第一AP当前的第一接收信号强度指示RSSI、所述电子设备当前扫描到的AP的第一数量、以及所述第一AP当前所占用的信道的第一干扰程度;
    基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值。
  6. 根据权利要求5所述的方法,其特征在于,所述进行wifi信道扫描,以得到所述电子设备当前扫描到的AP的第一数量,包括:
    基于所述P个AP的工作信息确定所述电子设备当前扫描到的AP的第一数量为P。
  7. 根据权利要求5所述的方法,其特征在于,所述进行wifi信道扫描,以得到所述第一AP当前的第一RSSI,包括:
    获取所述第一AP的工作信息,所述第一AP的工作信息包括所述第一AP当前的第一RSSI。
  8. 根据权利要求5所述的方法,其特征在于,所述基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值,包括:
    若所述第一RSSI大于或等于第一阈值、所述第一数量小于第二阈值、所述第一干扰程度小于第三阈值,则确定第一参数值在所述第一范围内;
    若所述第一RSSI小于所述第一阈值、和/或所述第一数量大于或等于所述第二阈值、和/或所述第一干扰程度大于或等于所述第三阈值,则确定所述第一参数值在所述第二范围内。
  9. 根据权利要求5所述的方法,其特征在于,所述基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值,包括:
    将所述第一RSSI转换为第一数值,将所述第一数量转换为第二数值,以及将所述第一 干扰程度转换为第三数值,所述第一数值、所述第二数值和所述第三数值的数量级相同;
    基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定第一参数值,所述第一权重用于表示RSSI在用于评价第一参数值时所占的比重,所述第二权重用于表示AP的数量在用于评价第一参数值时所占的比重,所述第三权重用于表示第一干扰程度在用于评价第一参数值时所占的比重,所述第一权重、所述第二权重与所述第三权重之和为1。
  10. 根据权利要求5-9任一项所述的方法,其特征在于,所述方法还包括:
    若所述第一参数值在所述第二范围内,则将所述电子设备的频段带宽设置为所述第二频段带宽,以及建立与所述第一AP的无线连接,所述第一AP当前使用的频段带宽还包括所述第二频段带宽。
  11. 根据权利要求5-9任一项所述的方法,其特征在于,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度,包括:
    进行wifi信道扫描,以得到所述N个信道中的每个信道的空闲空占比;
    基于所述每个信道的空闲空占比确定第一干扰程度。
  12. 根据权利要求11所述的方法,其特征在于,所述基于所述每个信道的空闲空占比确定第一干扰程度,包括:
    若所述每个信道的空闲空占比均大于或等于第四阈值,或者所述N个信道中的N个空闲空占比之和大于或等于第五阈值,则确定第一干扰程度小于所述第三阈值;
    若所述每个信道的空闲空占比均小于所述第四阈值,或者所述N个信道中的N个空闲空占比之和小于所述第五阈值,则确定第一干扰程度大于或等于所述第三阈值。
  13. 根据权利要求5-9任一项所述的方法,其特征在于,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度,包括:
    进行wifi信道扫描,以得到所述N个信道中的每个信道的wifi封包数量;
    基于所述每个信道的wifi封包数量确定第一干扰程度。
  14. 根据权利要求13所述的方法,其特征在于,所述基于所述每个信道的wifi封包数量确定第一干扰程度,包括:
    若所述每个信道的wifi封包数量均大于或等于第六阈值,或者所述N个信道中的N个wifi封包数量之和大于或等于第七阈值,则确定第一干扰程度小于所述第三阈值;
    若所述每个信道的wifi封包数量均小于所述第六阈值,或者所述N个信道中的N个wifi封包数量之和小于所述第七阈值,则确定第一干扰程度大于或等于所述第三阈值。
  15. 根据权利要求5-9任一项所述的方法,其特征在于,所述第一AP当前所占用的信道的数量为N,所述N为大于0整数,所述进行wifi信道扫描,以得到所述第一AP当前所占用的信道的第一干扰程度,包括:
    进行wifi信道扫描,以得到所述第一AP当前所使用的第一信道,以及所述第一信道中的第二AP的第二数量和所述第二AP当前的第二RSSI;
    进行wifi信道扫描,以得到所述N个信道中与所述第一信道第一近邻的第二信道,以及所述第二信道中的第三AP的第三数量和所述第三AP当前的第三RSSI;
    进行wifi信道扫描,以得到所述N个信道中与所述第一信道第二近邻的第三信道,以及所述第三信道中的第四AP的第四数量和所述第四AP当前的第四RSSI;
    基于所述第二数量、所述第二RSSI、所述第三数量、所述第三RSSI、所述第四数量、所述第四RSSI和第一干扰程度计算公式确定所述第一干扰程度。
  16. 根据权利要求5所述的方法,其特征在于,所述基于所述第一RSSI、所述第一数量和所述第一干扰程度确定第一参数值,包括:
    将所述第一RSSI转换为第一数值,将所述第一数量转换为第二数值,以及将所述第一干扰程度转换为第三数值,所述第一数值、所述第二数值和所述第三数值的数量级相同;
    基于所述第一数值、第一权重、所述第二数值、第二权重、所述第三数值和第三权重确定第一参数值,所述第一权重用于表示RSSI在用于评价第一参数值时所占的比重,所述第二权重用于表示AP的数量在用于评价第一参数值时所占的比重,所述第三权重用于表示第一干扰程度在用于评价第一参数值时所占的比重,所述第一权重、所述第二权重与所述第三权重之和为1。
  17. 一种wifi连接建立装置,其特征在于,应用于电子设备,所述装置包括:
    参数确定单元,用于进行wifi信道扫描,以确定第一参数值,所述第一参数值用于评价所述电子设备与第一AP之间的通信环境的质量;
    带宽设置单元,用于若所述第一参数值在第一范围内,则将所述电子设备的频段带宽设置为第一频段带宽,所述第一频段带宽大于第二频段带宽,所述第二频段带宽为所述第一参数值在第二范围内时设置的频段带宽,所述第一参数值在所述第一范围内表征第一通信环境质量,所述第一参数值在所述第二范围内表征第二通信环境质量,所述第一通信环境质量好于所述第二通信环境质量,所述第一AP当前使用的频段带宽为所述第一频段带宽;
    连接建立单元,用于建立与所述第一AP的无线连接。
  18. 一种电子设备,其特征在于,包括处理器、存储器、通信接口,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如权利要求1-16任一项所述的方法中的步骤的指令。
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现权利要求1至16任意一项所述的方法。
  20. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如权利要求1-16任一项所述的方法的部分或全部步骤。
PCT/CN2020/108171 2019-09-09 2020-08-10 wifi连接建立方法及相关设备 WO2021047337A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910848236.3 2019-09-09
CN201910848236.3A CN110545555B (zh) 2019-09-09 2019-09-09 wifi连接建立方法及相关设备

Publications (1)

Publication Number Publication Date
WO2021047337A1 true WO2021047337A1 (zh) 2021-03-18

Family

ID=68713130

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/108171 WO2021047337A1 (zh) 2019-09-09 2020-08-10 wifi连接建立方法及相关设备

Country Status (2)

Country Link
CN (1) CN110545555B (zh)
WO (1) WO2021047337A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110545555B (zh) * 2019-09-09 2022-04-05 Oppo广东移动通信有限公司 wifi连接建立方法及相关设备
CN114788349A (zh) * 2019-12-24 2022-07-22 Oppo广东移动通信有限公司 设备控制方法、装置、存储介质及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180042027A1 (en) * 2016-08-06 2018-02-08 Ambit Microsystems (Shanghai) Ltd. System for detecting interference sources and method for detecting interference sources
CN107949030A (zh) * 2017-10-18 2018-04-20 北京算云联科科技有限公司 一种接入多频段信道的控制方法及装置
CN108322924A (zh) * 2018-01-24 2018-07-24 维沃移动通信有限公司 一种带宽切换方法及移动终端
CN110545555A (zh) * 2019-09-09 2019-12-06 Oppo广东移动通信有限公司 wifi连接建立方法及相关设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103889011A (zh) * 2014-04-09 2014-06-25 上海斐讯数据通信技术有限公司 一种基于wlan无线带宽评估的无线带宽选择方法及系统
CN106330211B (zh) * 2016-08-31 2019-04-26 Oppo广东移动通信有限公司 Lte频段选择方法及设备
CN109951885B (zh) * 2017-12-21 2021-06-15 深圳Tcl新技术有限公司 无线信道频宽模式自动切换的方法、移动终端及存储介质
CN108966350A (zh) * 2018-06-20 2018-12-07 四川斐讯信息技术有限公司 一种选择无线路由器带宽的方法和装置
CN108848536B (zh) * 2018-06-27 2023-06-06 新华三技术有限公司 频宽控制方法、装置及通信设备
CN109041240A (zh) * 2018-08-09 2018-12-18 维沃移动通信有限公司 一种改善信号干扰的方法和移动终端
CN109673001A (zh) * 2019-02-12 2019-04-23 Oppo广东移动通信有限公司 数据传输控制方法及相关产品

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180042027A1 (en) * 2016-08-06 2018-02-08 Ambit Microsystems (Shanghai) Ltd. System for detecting interference sources and method for detecting interference sources
CN107949030A (zh) * 2017-10-18 2018-04-20 北京算云联科科技有限公司 一种接入多频段信道的控制方法及装置
CN108322924A (zh) * 2018-01-24 2018-07-24 维沃移动通信有限公司 一种带宽切换方法及移动终端
CN110545555A (zh) * 2019-09-09 2019-12-06 Oppo广东移动通信有限公司 wifi连接建立方法及相关设备

Also Published As

Publication number Publication date
CN110545555A (zh) 2019-12-06
CN110545555B (zh) 2022-04-05

Similar Documents

Publication Publication Date Title
CN104081815B (zh) 用于无线网络的请求-响应过程
KR101619965B1 (ko) 무선랜 시스템에서의 채널 스캐닝 방법
TWI433577B (zh) 用於異質無線網路之多重無線射頻協調的設備及方法
US9924519B2 (en) Channel availability coordination for Wi-Fi and unlicensed bands using radio access network
CN107889257B (zh) 一种数据传输方法及相关设备
CN116193632A (zh) 多链路通信方法和装置
JP2018201254A (ja) 無線通信装置および無線通信方法
US20180376467A1 (en) Extension of beacon request/report mechanism for spatial reuse
CN106922029B (zh) 一种信道资源的调度方法及装置
JP2019511163A (ja) Wi−Fi性能への影響を低減するための干渉検出のためのメカニズム
US11690101B1 (en) Systems and methods for coordinated multi point operation in the unlicensed band
US9491658B2 (en) Systems and methods for determining congestion in wireless networks
WO2021047337A1 (zh) wifi连接建立方法及相关设备
JP2014533049A (ja) Wlan送信モードおよびそれらの共存
US9609579B2 (en) Systems and methods for sharing scanning information
WO2020228454A1 (zh) 通信方法及相关产品
WO2022022380A1 (zh) 无线局域网中的通信方法、装置及系统
WO2017028055A1 (zh) 一种无线局域网络wlan的测量上报方法及相关设备
US10050930B2 (en) Multi-radio single internet protocol address wireless local area network apparatus and method
CN116569631A (zh) 无线网络中的侧链路通信
US11765706B2 (en) Cooperative inter-network channel selection
WO2020253307A1 (zh) 频谱资源分配方法及装置
US10911167B2 (en) Enhanced radio frequency (RF) management using active sensors
JP6659042B2 (ja) 通信装置、通信システム、通信制御方法および通信制御プログラム
JP2022553121A (ja) Pdcch検出方法、pdcch送信方法及びデバイス

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20863919

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20863919

Country of ref document: EP

Kind code of ref document: A1