Channel Automatic Selection and Switching Method and System, and Wireless Access Point
20190174383 ยท 2019-06-06
Inventors
Cpc classification
G06F2009/45595
PHYSICS
H04W36/13
ELECTRICITY
International classification
G06F9/455
PHYSICS
Abstract
A channel automatic selection and switching method and system, where after an access point (AP) and a station (STA) are successfully coupled, the AP performs quality detection on a first channel, determines, based on a quality detection result, whether the first channel needs to be switched, performs quality detection on backup channels when the first channel needs to be switched, and starts channel switching for the AP and the STA when there is a backup channel of higher quality. Because the backup channel and the first channel use same network coupling information, for the STA, a data link layer coupling is the same. Therefore, during first channel switching, a coupling interruption phenomenon does not occur, and thereby completing first channel switching without interrupting the data link layer coupling between the AP and the STA.
Claims
1.-19. (canceled)
20. A method of switching a channel, comprising: performing, by an access point (AP), quality detection on a first channel to obtain a first quality detection result after a station (STA) couples with a first virtual access point (VAP) of the AP via the first channel; determining, by the AP based on the first quality detection result, whether the first channel needs to be switched; performing, by the AP, quality detection on a plurality of backup channels to obtain a plurality of second quality detection results when the first channel needs to be switched; determining, by the AP, a second channel from the backup channels based on the second quality detection results, wherein the second channel corresponds to a second VAP; instructing, by the AP, the STA to switch from the first channel to the second channel which uses a same network coupling information as the first channel; and performing, by the AP, data transmission with the STA using the second VAP via the second channel.
21. The method of claim 20, wherein instructing the STA to switch from the first channel to the second channel comprises sending, by the AP, a notification message instructing the STA to switch from the first channel to the second channel.
22. The method of claim 21, wherein after determining the second channel and before sending the notification message, the method further comprises suspending, by the AP, sending data to the STA.
23. The method of claim 20, wherein determining whether the first channel needs to be switched comprises determining, by the AP based on a result of whether the first quality detection result meets a first switching condition, whether the first channel needs to be switched, and wherein the first switching condition comprises: a value of a first parameter in the first quality detection result reaches a preset threshold of the first parameter.
24. The method of claim 20, wherein determining the second channel comprises: comparing, by the AP, the second quality detection results; and selecting, by the AP, a channel of highest quality from the backup channels as the second channel.
25. The method of claim 20, wherein determining the second channel comprises: comparing, by the AP, the second quality detection results with a second switching condition; and selecting, by the AP, a channel of which a second quality detection result meeting the second switching condition as the second channel, wherein the second switching condition comprises either: a value of a first parameter in the second quality detection results reaches a preset threshold of the first parameter.
26. The method of claim 20, wherein the network coupling information comprises at least one of a service set identifier (SSID), a basic SSID (BSSID), an encryption mode, key information, state machine information, or a user equipment identifier.
27. The method of claim 20, wherein a data link layer coupling is established between the AP and the STA after the STA couples with the first VAP of the AP via the first channel.
28. The method of claim 27, wherein the data link layer coupling is not interrupted when the STA switches from the first channel to the second channel.
29. An electronic device, comprising: one or more processors; and one or more memories coupled to the one or more processors and comprising instructions that, when executed by the one or more processors, cause the electronic device to: perform quality detection on a first channel to obtain a first quality detection result after a station (STA) couples with a first virtual access point (VAP) of an access point (AP) via the first channel; determine, based on the first quality detection result, whether the first channel needs to be switched; perform quality detection on a plurality of backup channels to obtain a plurality of second quality detection results when the first channel needs to be switched; determine a second channel from the backup channels based on the second quality detection results, wherein the second channel corresponds to a second VAP; instruct the STA to switch from the first channel to the second channel which uses a same network coupling information as the first channel; trigger the AP to perform data transmission with the STA using the second VAP via the second channel.
30. The electronic device of claim 29, wherein the instructions further cause the electronic device to send a notification message instructing the STA to switch from the first channel to the second channel.
31. The electronic device of claim 29, wherein after determining the second channel and before sending the notification message, the instructions further cause the electronic device to suspend the AP of sending data to the STA.
32. The electronic device of claim 29, wherein the instructions further cause the electronic device to determine, based on a result of whether the first quality detection result meets a first switching condition, whether the first channel needs to be switched, and wherein the first switching condition comprises: a value of a first parameter in the first quality detection result reaches a preset threshold of the first parameter, a value of a second parameter reaches a preset threshold of the second parameter, and a weighted value of the first parameter and the second parameter reaches a preset threshold of the weighted value.
33. The electronic device of claim 29, wherein the instructions further cause the electronic device to: compare the second quality detection results; and select a channel of highest quality from the backup channels as the second channel.
34. The electronic device of claim 29, wherein the instructions further cause the electronic device to: compare the second quality detection results with a second switching condition; and select a channel of which a second quality detection result meets the second switching condition as the second channel, wherein the second switching condition comprises: a value of a second parameter in the second quality detection result reaches a preset threshold of the second parameter, a value of a third parameter reaches a preset threshold of the third parameter, and a weighted value of the second parameter and the third parameter reaches a preset threshold of the weighted value of the second parameter and the third parameter.
35. The electronic device of claim 29, wherein the network coupling information comprises at least one of a service set identifier (SSID), a basic SSID (BSSID), an encryption mode, key information, state machine information, or a user equipment identifier.
36. A non-transitory computer readable storage medium having stored thereon executable instructions that, when executed by an electronic device, cause the electronic device to: perform quality detection on a first channel to obtain a first quality detection result after a station (STA) couples with a first virtual access point (VAP) of an access point (AP) via the first channel; determine, based on the first quality detection result, whether the first channel needs to be switched; perform quality detection on a plurality of backup channels to obtain a plurality of second quality detection results when the first channel needs to be switched; determine a second channel from the backup channels based on the second quality detection results, wherein the second channel corresponds to a second VAP; send a notification message instructing the STA to switch from the first channel to the second channel which uses a same network coupling information as the first channel; and trigger the AP to perform data transmission with the STA using the second VAP via the second channel.
37. The non-transitory computer readable storage medium of claim 36, wherein after determining the second channel and before sending the notification message instructing the STA to perform first channel switching, the executable instructions further cause the electronic device to suspend the AP of sending data to the STA.
38. The non-transitory computer readable storage medium of claim 36, wherein the executable instructions further cause the electronic device to determine, based on a result of whether the first quality detection result meets a first switching condition, whether the first channel needs to be switched, and wherein the first switching condition comprises: a value of a first parameter in the first quality detection result reaches a preset threshold of the first parameter.
39. The non-transitory computer readable storage medium of claim 36, wherein the executable instructions further cause the electronic device to: compare the second quality detection results; and select a channel of highest quality from the backup channels as the second channel.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0027] To describe the technical solutions in the embodiments of the present invention or in the prior art more clearly, the following briefly describes the accompanying drawings required for describing the embodiments or the prior art. Apparently, the accompanying drawings in the following description show merely some embodiments of the present invention, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
DESCRIPTION OF EMBODIMENTS
[0036] The following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are merely some but not all of the embodiments of the present invention. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0037]
[0038]
[0039] It should be noted that the AP may include a plurality of VAPs, one VAP corresponds to one channel, and network connection information the same as that of an operating VAP is configured on each VAP. These VAPs may be a plurality of logical interfaces that are virtualized by a same network interface of the AP, or may be a plurality of logical interfaces that are virtualized by a plurality of network interfaces of the AP, and the network interface may be a radio-frequency physical interface. A person skilled in the art may understand how a VAP is created, and details are not described in this embodiment of the present invention. For example, if an AP supports China's 2.4 GHz frequency band of 2.412 to 2.472 GHz and the frequency band includes 13 channels, the AP may include a VAP 1: a channel 1, a VAP 2: a channel 2, . . . , a VAP 12: a channel 12, and a VAP 13: a channel 13. In a process of connecting the AP and the STA, the AP establishes a connection to the STA by using one VAP. The VAP is an operating VAP. The operating VAP is a VAP that is on the AP and that currently provides a service for the STA, and the operating channel is a channel in which the operating VAP is located. A backup VAP is a VAP that currently does not provide any service for the STA. The backup VAP may be configured before being used, or may start to be configured when needing to be used. Because all the VAPs use the same network connection information, a data link layer connection interruption phenomenon does not occur when the AP and the STA perform operating channel switching, thereby ensuring that operating channel switching is completed without interrupting the data link layer connection between the AP and the STA.
[0040] Step 200: The AP performs quality detection on the operating channel to obtain a first quality detection result.
[0041] It should be noted that the AP may perform quality detection on the operating channel in real time or periodically.
[0042] In the prior art, the AP does not detect quality of the operating channel. When the quality of the operating channel deteriorates and consequently data cannot be normally received or sent, a user manually interrupts the connection between the AP and the STA and then establishes a connection between the AP and the STA. In a process of re-establishing a connection, the AP detects quality of channels and selects a relatively good channel to connect to the STA, so as to switch the operating channel to the relatively good channel. An entire process needs the user's manual participation, and the connection between the AP and the STA is interrupted for a period of time.
[0043] The first quality detection result may include a received signal strength indicator (Received Signal Strength Indication, RSSI) of the operating channel, a packet error rate (Packet Error Rate, PER) of the operating channel, or a signal-to-noise ratio of the operating channel. The quality detection result may further include another parameter, as long as the another parameter can reflect quality of the operating channel. No specific limitation is imposed in this embodiment of the present invention.
[0044] Step 201: Determine, based on the first quality detection result, whether the operating channel needs to be switched. If the operating channel needs to be switched, step 202 is performed. If the operating channel does not need to be switched, step 200 is performed.
[0045] When determining, based on the first quality detection result, whether the operating channel needs to be switched, the AP needs to compare the first quality detection result with a first switching condition to determine whether the operating channel needs to be switched.
[0046] Specifically, when the first quality detection result meets the first switching condition, it is determined that the operating channel needs to be switched; or when the first quality detection result does not meet the first switching condition, it is determined that the operating channel does not need to be switched.
[0047] That the first switching condition is met is: a value of a first parameter in the first quality detection result reaches a preset threshold of the first parameter; or a value of a first parameter in the first quality detection result reaches a preset threshold of the first parameter, a value of a second parameter reaches a preset threshold of the second parameter, and a weighted value of the first parameter and the second parameter reaches a preset threshold of the weighted value. First parameter or second parameter herein represents any parameter in the first quality detection result, and is not limited in a quantity, and a plurality of first parameters or a plurality of second parameters may be included. How to specifically set the first switching condition is not specifically limited in this embodiment of the present invention.
[0048] It should be noted that reaching a preset threshold of a corresponding parameter includes being greater than or equal to the preset threshold of the corresponding parameter, being less than or equal to the preset threshold of the corresponding parameter, or the like. A specific expressed meaning needs to be limited depending on an actual parameter because some smaller parameters may indicate lower link quality, or conversely some larger parameters may indicate lower link quality, or when a value of a parameter is equal to a preset enumerated value, it indicates that a corresponding preset threshold is reached. For example, that a value of an RSSI is less than or equal to a preset threshold of the RSSI is defined as that the first switching condition is met, and in this case, it is determined that the operating channel needs to be switched. Alternatively, that a value of an RSSI is less than or equal to a preset threshold of the RSSI and a value of a PER is greater than or equal to a preset threshold of the PER is defined as that the first switching condition is met, and in this case, it is determined that the operating channel needs to be switched. Which parameters to be specifically used and how to set a preset threshold of a parameter may be set depending on an actual need of a product design, and no specific limitation is imposed in this embodiment of the present invention, as long as the setting can help identify that the operating channel needs to be switched.
[0049] It should be noted that the first switching condition may be configured on the AP at an initial networking stage or prestored before the AP is delivered.
[0050] Step 202: Perform quality detection on a plurality of backup channels to obtain a plurality of second quality detection results, where each backup channel corresponds to one second quality detection result.
[0051] It should be noted that the plurality of backup channels are some or all channels other than the operating channel, and the plurality of backup channels and the operating channel use same network connection information.
[0052] Specifically, all channels other than the operating channel may be detected, for example, quality of a channel 2, a channel 3 . . . . , a channel 12, and a channel 13 may be detected in sequence. All channels that absolutely have no interference to the operating channel may alternatively be detected, for example, quality of a channel 6, a channel 7, . . . , a channel 12, and a channel 13 may be detected in sequence. Some channels that absolutely have no interference to the operating channel may alternatively be detected, for example, a channel 6 and a channel 13 may be detected in sequence.
[0053] Step 203: Determine a target channel based on the plurality of second quality detection results. As shown in
[0054] The determining a target channel based on the plurality of second quality detection results may be performed in the following manners:
[0055] Manner 1: The plurality of second quality detection results are compared, and a channel of highest quality is selected from the plurality of backup channels as the target channel. In this way, the optimal channel can be selected from the backup channels to serve the STA, thereby implementing network optimization.
[0056] Manner 2: The AP compares the plurality of second quality detection results with a second switching condition, and selects a channel of which the second quality detection result meets the second switching condition as the target channel. That the second switching condition is met is: a value of a second parameter in the plurality of second quality detection results reaches a preset threshold of the second parameter; or a value of a second parameter in the second quality detection result reaches a preset threshold of the second parameter, a value of a third parameter reaches a preset threshold of the third parameter, and a weighted value of the second parameter and the third parameter reaches a preset threshold of the weighted value. Second parameter or third parameter herein represents any parameter in the second quality detection result, and is not limited in a quantity, and a plurality of second parameters or a plurality of third parameters may be included. How to specifically set the second switching condition is not specifically limited in this embodiment of the present invention.
[0057] Specifically, the AP may determine the target channel after performing quality detection on all the backup channels. The AP may detect channel quality of all the backup channels and randomly select a comparison object from the plurality of second quality detection results. When the comparison object does not meet the second switching condition, a channel corresponding to the comparison object cannot be used as the target channel and a next comparison object is selected. When the comparison object meets the second switching condition, a channel corresponding to the comparison object is determined as the target channel. In this way, the target channel can be rapidly determined, and therefore operating channel switching can be rapidly completed, thereby resolving, as soon as possible, a problem caused by operating channel quality deterioration.
[0058] Certainly, the AP may alternatively compare all the second quality detection results with the second switching condition to obtain channels that meet the second switching condition, and then randomly select one channel from the obtained channels as the target channel or alternatively select an optimal channel from the obtained channels as the target channel.
[0059] The AP may alternatively detect channel quality of one backup channel to obtain one second quality detection result, use the second quality detection result as a comparison object, and determine whether the backup channel can be used as the target channel. Specifically, some channels that absolutely have no interference to the operating channel may be detected. For example, the operating channel is a channel 1, and the AP may detect a channel 6 and a channel 13 in sequence. After the second quality detection result is obtained through quality detection on the channel 6, whether the channel 6 meets the second switching condition is determined. If it is determined that the channel 6 meets the second switching condition, the AP may directly determine the channel 6 as the target channel. In this case, the AP performs quality detection on only one backup channel and there is no need to further perform quality detection on another backup channel. The target channel can be determined as soon as possible even when the AP needs to perform quality detection on the plurality of backup channels. In this way, the AP can determine the target channel more rapidly and therefore the AP can rapidly complete operating channel switching, thereby resolving, as soon as possible, a problem caused by operating channel quality deterioration.
[0060] It should be noted that parameters used in the two switching conditions, that is, the first switching condition and the second switching condition, in this application all are parameters in quality detection. A difference lies in that preset thresholds corresponding to the parameters are different. From the perspective of descending order of link quality, link quality when the second switching condition is met is higher than link quality when the first switching condition is met. To be specific, when the AP detects that the RSSI of the operating channel is less than R1 (the first switching condition), it indicates that a current network status is already poor, and switching of the operating channel needs to be started; otherwise, a case such as a packet loss may occur. When switching of the operating channel is started, the AP needs to detect an RSSI of a backup channel and select a channel of which an RSSI is greater than R2 (the second switching condition) as a target standby device. R2 is greater than R1.
[0061] Step 204: The AP sends a notification message to instruct the STA to perform operating channel switching, where the notification message carries the target channel (the channel 6).
[0062] Optionally, a CSA Notify message in 802.11h may be used as the notification message. A specific structure of the CSA Notify message is as follows:
TABLE-US-00001 Category Action Channel Switch Announcement element
[0063] Category occupies one byte, has a fixed value of 0, and indicates frequency spectrum management. Action occupies one byte, has a fixed value of 4, and indicates that this frame is CSA. Channel Switch Announcement element occupies five bytes, each byte is used to store one field, and byte formats and field meanings are as follows:
TABLE-US-00002 Element ID Length Channel Switch New Channel Channel Switch Mode Number Count
[0064] Length has a fixed value of 3. Channel Switch Mode is set to 1, used to notify the STA that the AP is to deliver a new operating channel. New Channel Number is a value of the new operating channel. Channel Switch Count is an occasion for switching to the new channel, 0 indicates any random occasion after a CSA packet, and 1 indicates that switching is started after a fixed time period.
[0065] Step 205: The STA switches the operating channel to the target channel (the channel 6). In
[0066] The STA may complete operating channel switching based on a switching occasion specified in the CSA message. Certainly, the AP may not specify a switching occasion for the STA, and the STA itself determines when to perform operating channel switching.
[0067] Optionally, the STA may send an operating channel switching completion response message to the AP, after operating channel switching is completed. In this case, by using the response message, the AP may learn that the operating channel of the STA has been switched and a next operation may be performed, for example, step 206 is performed. If the AP has not received the response message within a preset time, the AP may resend a notification message to notify the STA of the target channel again, thereby ensuring that operating channel switching is completed for the AP and the STA.
[0068] Step 206: The AP switches the operating channel to the target channel. As shown in
[0069] The AP may configure, after receiving the response message from the STA, the target channel as an operating channel that serves the STA, or may directly configure, without waiting for the response message from the STA, the target channel as an operating channel that serves the STA.
[0070] Now, operating channel switching is completed, and the AP performs data transmission with the STA on the new operating channel (the target channel). Before operating channel switching, the AP and the STA use the VAP 1 (a VAP corresponding to the channel 1) to perform data transmission by using the channel 1. After operating channel switching, the AP and the STA use the VAP 6 (a VAP corresponding to the channel 6) to perform data transmission by using the channel 6.
[0071] Therefore, according to the channel automatic selection and switching method provided in this embodiment of the present invention, after the AP and the STA are successfully connected, the AP performs quality detection on the operating channel, and then determines, based on the quality detection result, whether the operating channel needs to be switched. If the operating channel needs to be switched, the AP performs quality detection on the backup channels, and if there is a backup channel of higher quality, channel switching for the AP and the STA is started. Because the backup channel and the operating channel use the same network connection information, when the AP and the STA perform operating channel switching, a data link layer connection interruption phenomenon does not occur, thereby ensuring that operating channel switching is completed without interrupting a data link layer connection between the AP and the STA.
[0072]
[0073]
[0074]
[0075] It should be noted that there may be only one operating VAP on the AP, and correspondingly, there is only one operating channel. As shown in
[0076]
[0077] After step 203 and before step 204, the method further includes:
[0078] Step 601: The AP suspends sending of data to the STA, to ensure that data sent by the AP to the STA is not lost.
[0079] After step 204 and before step 205, the method further includes:
[0080] Step 602: The STA suspends sending of data to the AP, to ensure that data sent by the STA to the AP is not lost.
[0081] Therefore, according to the channel automatic selection and switching method provided in this embodiment of the present invention, before sending an operating channel switching message to the STA, the AP suspends sending of data to the STA. Before performing operating channel switching, the STA suspends sending of data to the AP. Data transmission between the AP and the STA can be normally started after the operating channel of both the AP and the STA is switched to the target channel. In this way, integrity of data sent between the AP and the STA is effectively ensured.
[0082] According to the channel automatic selection and switching method provided in this embodiment of the present invention, channel switching prompt information may be presented on the STA to prompt a user of the STA that the AP has automatically completed channel optimization. This resolves an operating channel quality deterioration problem, thereby effectively improving AP and STA user experience. A specific prompt method may be notifying the user of the STA in a form of text on a screen of the STA, or may be notifying the user of the STA in a form of a sound. A specific manner to be used needs to be set depending on an actual need, and no specific limitation is imposed in the present invention.
[0083] An embodiment of the present invention provides an AP. Referring to
[0084] An embodiment of the present invention provides a STA. Referring to
[0085] An embodiment of the present invention provides a channel automatic selection and switching system, including the AP shown in
[0086] In the specification, claims, and accompanying drawings of the present invention, the terms first, second, third, and so on are intended to distinguish between different objects but do not indicate a particular order. It should also be understood that, the term and/or used herein indicates and includes any or all possible combinations of one or more associated listed items. It should be further understood that the term include adopted in the specification specifies presence of features, integers, steps, operations, elements and/or components, with presence or attachment of other features, integers, steps, operations, components, elements, and their combinations not excluded.
[0087] All or some of the steps of the method embodiments may be implemented by a program instructing relevant hardware. The program may be stored in a computer-readable storage medium. When the program runs, the steps of the method embodiments are performed. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (Read Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disc.
[0088] The foregoing descriptions are merely specific implementations of the present invention, but are not intended to limit the protection scope of the present invention. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the present invention shall fall within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.