CN110234152B - Channel scanning method, device, storage medium and electronic equipment - Google Patents

Channel scanning method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110234152B
CN110234152B CN201910476025.1A CN201910476025A CN110234152B CN 110234152 B CN110234152 B CN 110234152B CN 201910476025 A CN201910476025 A CN 201910476025A CN 110234152 B CN110234152 B CN 110234152B
Authority
CN
China
Prior art keywords
channel
scanning
time
station
channel scanning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910476025.1A
Other languages
Chinese (zh)
Other versions
CN110234152A (en
Inventor
林进全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910476025.1A priority Critical patent/CN110234152B/en
Publication of CN110234152A publication Critical patent/CN110234152A/en
Application granted granted Critical
Publication of CN110234152B publication Critical patent/CN110234152B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information

Abstract

The embodiment of the application discloses a channel scanning method, a channel scanning device, a storage medium and electronic equipment, and belongs to the field of wireless communication. When the preset short-period scanning time is up, the station acquires a channel set after the last channel scanning; the station scans an access point on a channel of which the channel parameter information meets the screening condition in the channel set after the last channel scanning; the screening condition comprises that the number of times that the access point is not scanned on the channel is less than the preset number, so that the station does not need to perform full channel scanning each time in the channel scanning process, and the time for channel scanning is reduced.

Description

Channel scanning method, device, storage medium and electronic equipment
Technical Field
The present application relates to the field of wireless communications, and in particular, to a channel scanning method, apparatus, storage medium, and electronic device.
Background
In a wireless fidelity (Wi-Fi) communication system, in order for a station to discover a newly deployed access point, the station (station) periodically scans channels to detect whether an access point exists in each channel. The channel scanning method comprises the following steps: the station acquires the channels supported by the station, and scans the channels in sequence according to a certain scanning sequence, the scanning mode can be active scanning or passive scanning, and how to optimize the time for scanning the channels is a problem to be solved urgently at present.
Disclosure of Invention
The channel scanning method, the channel scanning device, the storage medium and the station provided by the embodiment of the application can reduce the channel scanning time in the process of scanning the access point. The technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a channel scanning method, where the method includes:
when the preset short-period scanning time is up, the station acquires a channel set after the last channel scanning;
the station scans an access point on a channel of which the channel parameter information meets the screening condition in the channel set after the last channel scanning;
and the station updates the channel parameter information of each channel in the channel set after the channel scanning last time according to the channel scanning result, and obtains the channel set after the channel scanning this time after updating.
In a second aspect, the present application provides a channel scanning method, including:
when the preset short-period scanning time is up, the station acquires a channel set after the last channel scanning;
a station scans an access point on each channel in a channel set after channel scanning last time;
the station removes the channel with the channel parameter information meeting the removal condition in the channel set after the channel scanning last time according to the channel scanning result, and obtains the channel set after the channel scanning this time after removal; wherein the removal condition includes that the number of times that the access point is not scanned on the channel continuously is greater than a preset number of times.
In one possible design, further comprising:
if the channel scanning is long-period channel scanning, the station acquires a full channel set and performs long-period channel scanning according to the full channel set, records the time of the channel scanning as the time of the long-period channel scanning, and updates the parameter information of each channel in the full channel set according to the channel scanning result to obtain the channel set after the channel scanning.
In one possible design, the channel parameter information includes a first parameter, an initial value of the first parameter representing a maximum value for which no access point is continuously scanned on the channel;
the method for removing the channel with the channel parameter information meeting the removal condition in the channel set after the channel scanning last time according to the channel scanning result by the station to obtain the channel set after the channel scanning this time includes:
updating the value of the first parameter of each channel in the channel set after the channel scanning last time according to the channel scanning result;
selecting a channel of which the value of the first parameter in the updated channel set after the last channel scanning is not greater than a first threshold value; wherein the initial value is greater than the first threshold;
and removing the updated channel set after the channel scanning of the last time from the selected channel to obtain the channel set after the channel scanning of this time.
In one possible design, the channel parameter information includes a second parameter indicating a number of consecutive unscanned access points on the channel;
the method for removing the channel with the channel parameter information meeting the removal condition in the channel set after the channel scanning last time according to the channel scanning result by the station to obtain the channel set after the channel scanning this time includes:
updating the value of the second parameter of each channel in the channel set after the channel scanning last time according to the channel scanning result;
selecting a channel of which the value of the second parameter in the updated channel set subjected to channel scanning last time is not less than a second threshold value;
and removing the selected channel from the channel set subjected to the channel scanning last time to obtain the channel set subjected to the channel scanning this time.
In one possible design, the acquiring of the full channel set and the long-period channel scanning according to the full channel set record the time of the channel scanning as the time of the long-period channel scanning; updating the channel parameter information of each channel in the full channel set according to the channel scanning result to obtain the channel set after the current channel scanning comprises:
acquiring a full channel set; wherein the value of the first parameter for each channel in the full channel set is equal to the initial value;
scanning for access points on each channel in the full channel set;
if the access point is detected on the channel, resetting the value of the first parameter of the channel to the initial value;
and if the access point is not detected on the channel, reducing the value of the first parameter of the channel by the preset step value.
In one possible design, the acquiring of the full channel set and the long-period channel scanning according to the full channel set record the time of the channel scanning as the time of the long-period channel scanning; updating the channel parameter information of each channel in the full channel set according to the channel scanning result to obtain the channel set after the current channel scanning comprises:
acquiring a full channel set; wherein the value of the second parameter of each channel in the full channel set is the initial value;
performing long-period channel scanning according to the full channel set;
if the access point is scanned on the channel, setting the value of the second parameter of the channel as the initial value;
if the access point is not scanned on the channel, the value of the second parameter of the channel is increased by a preset step value.
In a third aspect, an embodiment of the present application provides a channel scanning apparatus, where the channel scanning apparatus includes:
the acquisition unit is used for acquiring a channel set after channel scanning last time when the preset short-period scanning time is up;
the scanning unit is used for scanning the access point on the channel of which the channel parameter information meets the screening condition in the channel set after the channel scanning last time; wherein the screening condition includes that the number of times of continuously scanning the access point on the channel is less than a preset number of times.
In a third aspect, the present application provides a channel scanning method, including:
detecting the time of reaching the current channel scanning and determining the frequency of the current channel scanning;
selecting a channel from a full channel set according to the frequency of the channel scanning; wherein the number of selected channels is less than the number of channels in the full channel set;
a channel scan is performed on the selected channel.
In one possible design, the full set of channels includes a first subset of channels and a second subset of channels;
wherein, the selecting a channel from the full channel set according to the number of times of the channel scanning of this time includes:
if the channel scanning times are odd, selecting the first channel subset;
and if the channel scanning times are even, selecting the second channel subset.
In one possible design, the full set of channels includes a first subset of channels and a second subset of channels;
wherein, the selecting a channel from the full channel set according to the number of times of channel scanning at this time includes:
if the number of times of channel scanning is even, selecting the second channel subset;
and if the channel scanning times are odd, selecting the second channel subset.
In a possible design, the number of each signal in the full channel set is increased by a preset step value from an initial number, the number of each channel in the first channel subset is an odd number, and the number of each channel in the second channel subset is an even number.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In a fourth aspect, an embodiment of the present application provides a station, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
the station selects a channel with the continuous non-scanning access point times less than the preset times from the channel set after the last channel scanning based on the channel set after the last channel scanning, and performs access point detection on the channel, so that the station does not need to perform full channel scanning every time in the periodic channel scanning process, thereby reducing the time of channel scanning.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is an architecture diagram of a wireless communication system provided by an embodiment of the present application;
fig. 2 is another schematic flow chart of a channel scanning method according to an embodiment of the present application;
fig. 3 is another schematic diagram of a channel scanning method according to an embodiment of the present application;
fig. 4 is another schematic diagram of a channel scanning method provided in an embodiment of the present application;
fig. 5 is another schematic diagram of a channel scanning method according to an embodiment of the present application;
fig. 6 is another schematic diagram of a channel scanning method according to an embodiment of the present application;
fig. 7 is another schematic diagram of a channel scanning method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a channel scanning apparatus provided in the present application;
fig. 9 is a schematic structural diagram of a station provided in the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a network architecture diagram of a wireless communication system. A wireless communication system includes a station and at least one access point. For example: the wireless fidelity communication system includes a station 10, an access point 11, an access point 12, and an access point 13. Before the station 10 does not establish a connection with any access point, the station 10 selects an access point to connect through passive scanning or active scanning, for example: station 10 establishes a connection with access point 11. In the case where station 10 establishes a connection with access point 11, station 10 periodically scans for full channels based on an application trigger or a frame trigger. The station 10 performs a full channel scan based on a full channel set comprising a plurality of channels, the full channel set being related to the terminal's support capability and region. For example: the terminal supports 2.4G and 5G wifi channels, when the terminal is powered on, the terminal reads a region code from a Subscriber Identity Module (SIM) and communication capability information from a local memory, and obtains a full channel set associated with the region code and the communication capability information, where the full channel set includes 14 2.4G wifi channels and 24 5G wifi channels, the 2.4GHz wifi channel has 13 channels, and the distribution of the 13 channels is shown in table 1:
Figure BDA0002082278410000051
Figure BDA0002082278410000061
TABLE 1
The planning information of the wifi channel of 5G refers to the description in the 802.11 standard text, and is not described in detail here. The station 10 periodically and sequentially performs full channel scanning according to the full channel set, the time for scanning 38 channels needs about 1 second to 2 seconds, and as the number of channels increases, the time for scanning channels may increase to 4S to the maximum extent, so that the station 10 cannot transmit service data during the full channel scanning process, which increases the time delay.
The embodiment of the application provides a channel scanning method, which can be applied to a station. The website may be a smartphone, a tablet, a gaming device, an AR (augmented reality) device, an automobile, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
The channel scanning method provided by the embodiment of the present application will be described in detail below with reference to fig. 2 to 7. The wireless network-based channel scanning device in the embodiment of the present application may be a station shown in fig. 2 to 7.
Referring to fig. 2, a flow chart of a channel scanning method is provided in the present embodiment. As shown in fig. 2, the method of the embodiment of the present application may include the steps of:
s201, when the preset short-period scanning time is up, the station acquires a channel set obtained after the last channel scanning.
In the embodiment of the present application, a station may perform channel scanning periodically or aperiodically, the types of the station performing channel scanning are divided into long-period channel scanning and short-period channel scanning, a time for performing long-period channel scanning each time is referred to as a long-period channel scanning time, and a time for performing short-period channel scanning each time is referred to as a short-period channel scanning time. The method for judging the short period channel scanning time and the long period channel scanning time comprises the following steps: the station can judge whether the time of the current channel scanning and the time of the last long-period channel scanning are smaller than a time length threshold value, if so, the current channel scanning is short-period channel scanning, and otherwise, the current channel scanning is long-period channel scanning. The period of long period channel scanning is greater than that of short period channel scanning, and the first channel scanning is long period channel scanning. For example: the long-period channel scanning time is t0, t0+60s, … and t0+ (60 × n) s in sequence, the short-period scanning time is t0+3s, t0+ (3 × 2) s, … and t0(3 × n) in sequence, namely, the station performs long-period channel scanning every 60s and performs short-period channel scanning every 3 s.
The station can periodically scan a channel in a connection state to detect whether an access point exists in the channel, the mode of triggering the scanning channel by the station comprises application program triggering or framework triggering, the application program triggering indicates that the station receives a triggering instruction of a user through an application program, and the periodic channel scanning is carried out in response to the triggering instruction; the framework trigger represents that the station automatically scans channels periodically without relying on the trigger of the application program. The connection state indicates that the station establishes a wireless fidelity connection with a surrounding access point, and service data can be transmitted between the station and the access point. In the process of executing the channel scanning method of the present application, the station is always in the on-line state.
Generally, the first channel scan is generally a channel scan performed after a station is powered on or restarted; if the channel scanning is the first channel scanning, the station executes long-period channel scanning and records the time of the long-period channel scanning. The station prestores or is preconfigured with a period of channel scanning, which is also sized according to actual requirements, for example: the channel scanning period is 3 seconds, and the station performs channel scanning every 3 seconds. Long period channel scanning, that is, full channel scanning, indicates that a station performs channel scanning according to each channel in a pre-stored or pre-configured full channel set, where the number of channels corresponding to the full channel set is generally related to channels and regions supported by the station, for example: the station is located in the area A, the stations support 2.4G and 5G wireless fidelity channels, the full channel set corresponds to 30 channels, and when the stations are subjected to long-period channel scanning, the stations are subjected to channel scanning last time on the 30 channels to detect whether the access points exist on the channels.
Generally, the station prestores or pre-configures a time length threshold, which may be determined according to actual needs, and the time length threshold is greater than the period of channel scanning, for example: the time length threshold is positive integral multiple of the channel scanning period, the time length threshold is 1 minute, and the channel scanning period is 3 seconds. The previous channel scanning is based on the adjacent channel scanning before the current channel scanning, and the previous channel scanning can be long-period channel scanning or short-period channel scanning. The channel set after the last channel scanning is the channel set obtained after the last channel scanning, and the channel set after the current channel scanning is the channel set obtained after the current channel scanning. The channel set after the previous channel scanning and the channel set after the current channel scanning are in a data structure, the number of channels corresponding to the channel set after the previous channel scanning and the channel set after the current channel scanning is the same as the number of channels corresponding to the full channel set, and the difference is that each channel may have different channel parameter information, and the channel parameter information is used for describing the result of scanning the access point on the channel. The type of the channel set in the present application may be a two-dimensional table, a linked list, an array, a structure, or a stack, and the present application is not limited.
It should be understood that the channel scanning and the channel scanning last time, and the channel set after the channel scanning last time can be converted to each other. For example: for the nth channel scanning, the (n + 1) th channel scanning and the (n + 2) th channel scanning executed by the station, wherein n is an integer greater than 1; if the (n + 1) th channel scanning is the current channel scanning, and the (n + 1) th channel scanning obtains a channel set after the current channel scanning, the (n) th channel scanning is the last channel scanning, and the (n) th channel scanning obtains a channel set after the last channel scanning; if the (n + 2) th channel scanning is the channel scanning of the time, the channel set after the channel scanning of the time is obtained after the (n + 2) th channel scanning, the (n + 1) th channel scanning is the channel scanning of the last time, and the channel set after the channel scanning of the last time is obtained after the (n + 1) th channel scanning.
S202, the station scans the access point on the channel of which the channel parameter information meets the screening condition in the channel set after the last channel scanning.
Generally, the channel set after the last channel scan includes a plurality of elements, each element may include a channel identifier and channel parameter information, and the channel identifier is used to indicate the identity of a channel, for example: the channel identification is represented using a number. The channel parameter information is used for representing the result of the access point detection on the channel, and the channel parameter information comprises one or more of a credit value of the channel, data throughput, a data transmission rate, a signal strength value of the channel, the number of times of continuous scanning to the access point and the number of times of continuous non-scanning to the access point.
The screening condition is used for selecting one or more channels meeting the condition from the channel set after the channel scanning last time according to the channel parameter information, and the screening condition can be set according to actual requirements, which is not limited in the application; for example: the screening condition includes that the number of times of continuously scanning the access point on the channel is less than a preset number. . The station scans the access point on the screened channel, and scans whether the access point exists on the channel, the channel scanning mode may be active scanning or passive scanning, and the active scanning and passive scanning process may refer to a process of scanning the access point when the station is in an offline state in the prior art, which is not described herein again.
The method for the station to scan the access point may be: the station measures the signal intensity value of the access point, if the signal intensity value is smaller than the signal intensity threshold value, the access point is determined not to be scanned, otherwise, the access point is determined to be scanned; the signal strength threshold may be determined according to actual requirements, and the application is not limited.
For example, the channel set after the last channel scan corresponds to 5 channels, which is represented by the following form:
{ID:0,number:1;
ID:1,number:4;
ID:2,number:2;
ID:3,number:0;
ID:4,number:3},
where ID denotes the number of channels and number denotes the number of times that an access point is not scanned in succession. If the number of the screening conditions is less than 3, the channels meeting the screening conditions in the channel set after the channel scanning last time are: channel 0, channel 2 and channel 3, the station performs channel scanning on the above 3 channels, and scans whether an access point exists on the channel.
In one embodiment, the method further comprises:
and the station updates the channel parameter information of the channel set after the channel scanning last time according to the channel scanning result, and obtains the channel set after the channel scanning this time after updating.
For example: according to the example of S202, assuming that the station does not scan for an access point on channel 0, the number of channel 0 is updated to 2; the station scans the access point on the channel 2, and then the number of the channel 2 is updated to 0; the station does not scan for an access point on channel 3 and the number of channel 3 is updated to 1. The channel set obtained after the channel scanning is as follows:
{ID:0,number:2;
ID:2,number:0;
ID:3,number:1}
in this embodiment, when a station is in a connected state, when a time interval between a current scanning time and a time when the current scanning time is less than a time length threshold from a previous long-period channel scanning time, a channel set obtained after the previous channel scanning is obtained, one or more channels are selected from the channel set obtained after the previous channel scanning according to a screening condition, an access point is scanned on the selected one or more channels, and the channel set obtained by the previous channel scanning is updated according to a scanning result, so that the channel set obtained by the current scanning is obtained.
The embodiment of the present application may be implemented in a WIFI scanning service of a frame (framework), or in a WIFI driver layer, which is not limited in the present application.
When the embodiment of the invention is implemented, in the process that the station starts channel scanning in a connection state, the station counts channel parameter information of a channel after performing channel scanning each time, and when the channel is scanned this time, if the channel parameter information of the channel does not meet specified conditions, the channel is skipped when performing channel scanning this time, and the number of channels scanned by the station is reduced, namely, the station does not need to perform full channel scanning each time in the channel scanning process, so that the time for the station to scan the channel is correspondingly reduced, and the time for the station to perform channel scanning in the connection state can be reduced, thereby reducing the time delay of data transmission and increasing the throughput of data transmission.
Please refer to fig. 3, which is a flowchart illustrating a channel scanning method according to an embodiment of the present disclosure. The present embodiment is exemplified by applying the channel scanning method to a station. The channel scanning method may include the steps of:
s301, detecting the time of the current channel scanning.
In this embodiment of the present application, a station may trigger a periodic or aperiodic channel scan in an online state to scan whether an access point exists in a channel, and a station trigger channel scan manner may be an application (application) trigger or a framework (framework) trigger. For example: taking a terminal of the android system as an example, the process of triggering the application program may include: the method comprises the steps that a site receives an instruction for opening a wireless fidelity list triggered by a user, and a terminal responds to the instruction and then periodically scans channels by utilizing Wifi scanning service; the frame triggered procedure may be that the station periodically scans channels with wifi scanning service in the background.
The station is in a connection state, which means that the station establishes a wireless fidelity connection with a surrounding access point, and the station and the access point can transmit service data.
The period of channel scanning may be determined according to actual requirements, for example: the channel scanning period is 3 seconds, and the station scans the channel every 3 seconds. The reference time point of the station may be a time when the station is powered on, restarted or switched to an unlocked state, and the station may use the reference time point as a time for first channel scanning. And when the station detects that the time between the current time and the currently stored channel scanning time reaches a scanning period, determining that the channel scanning time is up, and starting the channel scanning by the station.
S302, whether to scan the appointed channel or access point.
In this embodiment of the present application, a station determines whether it needs to scan a specified channel or access point, for example: when a user needs to connect to a designated access point, the user triggers and opens the wireless fidelity list, and selects an SSID (Service Set Identifier) in the wireless fidelity list for connection, so that the station scans the access point corresponding to the SSID. Another example is: the station stores a wireless fidelity connection history table, and performs channel scanning on channels used by each access point in the wireless fidelity connection history table according to the channels.
And S303, scanning the appointed channel or access point.
S304, calculating the time interval between the time of the current channel scanning and the time of the last long-period channel scanning.
In general, long-period channel scanning refers to a station performing channel scanning on all channels in a full channel set, where the number of channels in the full channel set is related to channels supported by the station and a region, for example: the station is located in area A, the station supports 2.4G and 5G wireless fidelity channels, the full channel set pre-stored or pre-configured by the station comprises channels 0-29, and a total of 30 channels, and the station scans the access points on the 30 channels according to a certain scanning sequence. The station records the time of the long-period channel scanning each time the long-period channel scanning is performed, and the time of the long-period channel scanning may be the start time.
S305, judging whether the time interval is smaller than a time length threshold value.
Generally, the time length threshold may be determined according to actual requirements, the station prestores or preconfigures a time length threshold, and the station compares whether the time interval between the time of the current channel scanning and the time of the last long-period channel scanning is smaller than the time length threshold. If the judgment result is yes, short-period channel scanning is executed, namely the time of the current channel scanning is the short-period channel scanning time; if the judgment result is negative, long-period channel scanning is executed, namely the time of the current channel scanning is the long-period channel scanning time.
For example: the time length threshold value is 60 seconds, the channel scanning period is 3 seconds, the time of the current channel scanning is t1, the time of the last long period channel scanning is t1+6 seconds, the time interval between the time of the current channel scanning and the time of the last channel scanning calculated by the station is 6 seconds, and the time interval is less than the time length threshold value 60 seconds.
Another example is: the time length threshold value is 60 seconds, the channel scanning period is 3 seconds, the time of the current channel scanning is t1, the time of the station acquiring and storing the last channel scanning is t1+60s, the time interval between the time of the current channel scanning and the time of the last channel scanning calculated by the station is 60s and is equal to the time length threshold value 60s, and the judgment result is that the time length threshold value is not less than the time length threshold value.
Generally, the time length threshold is greater than the channel scanning period, and the time length threshold may be an integer multiple of the channel scanning period, that is, the station performs short-period channel scanning according to the first period and performs long-period channel scanning according to the second period, where the second period is greater than the first period and is an integer multiple of the first period, and the non-long-period channel scanning time coincides with the long-period channel scanning time. For example: the first period is 3 seconds, the second period is 60 seconds, the first channel scanning is long period channel scanning, the station performs short period channel scanning every 3 seconds, and performs long period channel scanning every 60 seconds.
S306, the station acquires the channel set obtained after the channel scanning last time.
The station records the time of channel scanning every time the station performs channel scanning, the time of channel scanning may be the starting time, the last channel scanning may be long-period channel scanning or short-period channel scanning, and when the station stores the time of channel scanning, the station may distinguish the long-period channel scanning from the short-period channel scanning by using different flag bits.
For example: the time when the station stores the channel scan may be represented as { time: 8:00:00, type: 1} and, for example: the time when the station stores the channel scan may be represented as { time: 8:00:03, type: 0, where time represents the time of channel scanning, expressed in time-minutes-seconds; type indicates the type of channel scan, 1 indicates the channel scan as a long period channel scan, and 0 indicates the channel scan as a short period channel scan.
The channel set after the last channel scanning is the channel set obtained after the last channel scanning, the channel set after the current channel scanning is the channel set obtained after the current channel scanning, the channel set after the last channel scanning and the channel set after the current channel scanning are of a data structure, and the representation form of the channel set can be a two-dimensional table, a linked list, an array, a structural body or a stack. The channel set after the last channel scanning and the channel set after the current channel scanning do not relate to the addition or removal of channels, and channels corresponding to the channel set after the last channel scanning and the channel set after the current channel scanning are the same as channels corresponding to the full channel set.
It should be understood that there is a relative concept between the channel scanning of this time and the channel scanning of the last time, and there is also a relative concept between the channel set after the channel scanning of this time and the channel set after the channel scanning of this time, and the channel scanning of this time and the channel set after the channel scanning of last time and the channel set after the channel scanning of this time can be converted to each other.
For example: for the nth channel scanning, the (n + 1) th channel scanning and the (n + 2) th channel scanning performed by the station, n is an integer greater than 1; if the (n + 1) th channel scanning is the channel scanning of this time, the (n) th channel scanning is the channel scanning of the last time, a channel set obtained after the channel scanning of the last time is obtained after the channel scanning of the nth time, and a channel set obtained after the channel scanning of this time is obtained after the channel scanning of the (n + 1) th time; if the (n + 2) th channel scanning is the current channel scanning, the (n + 1) th channel scanning is the last channel scanning, the (n + 1) th channel scanning obtains a channel set after the last channel scanning, and the (n + 2) th channel scanning obtains a channel set after the current channel scanning.
S307, the station selects a channel with the first parameter value larger than a first threshold value from the channel set after the last channel scanning.
The channel set after the last channel scanning includes multiple elements, each element includes a channel identifier and a value of a first parameter, an initial value of the first parameter is a maximum number of times that the station has not scanned the access point continuously, which is pre-stored or pre-configured, and a size of the initial value may be determined according to an actual requirement, and the initial value is greater than a first threshold. The station is pre-stored or pre-configured with a first threshold, which may be sized according to actual needs.
For example: the channel set after the last channel scanning corresponds to 6 channels, and the representation form is as follows: {
ID:0,number:1;
ID:1,number:0;
ID:2,number:2;
ID:3,number:0;
ID:4,number:2;
ID: 5, number: 0; a number represents a value of the first parameter, and an ID represents a channel identifier; assuming that the first threshold is 0, the station selects a channel greater than 0 in the first channel list as: channel 0, channel 2, and channel 4.
And S308, the station scans the access point on the selected channel.
For example: according to the example of S307, the station scans for access points on channel 0, on channel 2 and on channel 4 in sequence. A station scans for an access point on channel 0, a station does not scan for an access point on channel 2, and a station 3 does not scan for an access point on channel 4.
S309, the station updates the value of the first parameter of each channel in the first channel according to the channel scanning result to obtain the channel set after the channel scanning.
If the access point is scanned on the channel selected in S308, the station resets the value of the first parameter of the channel to the initial value; if no access point is scanned on the channel selected in S308, the station decreases the value of the first parameter of the channel by the preset step value. The initial value and the preset step value may be determined according to actual requirements, and the application is not limited.
It should be understood that the station only updates S308 the value of the first parameter of the channel selected in the channel set after the last channel scan, and the values of the first parameters of the other channels remain unchanged in this channel scan.
For example: the initial value is 3, the preset step value is 1, the station scans the access point on the channel 0 according to the channel scanning result of the S308, and the station resets the value of the first parameter of the channel 0 to the initial value 3; the station does not scan for an access point on channel 2, the station reduces the value 2 of the first parameter of channel 2 by 1 and then becomes 1, and the station reduces the value 2 of the first parameter of channel 4 by 1 and then becomes 1. Then the updated channel set obtained after this channel scanning can be represented as: {
ID:0,number:3;
ID:1,number:0;
ID:2,number:1;
ID:3,number:0;
ID:4,number:1;
ID:5,number:0;}。
S310, the station acquires a full channel set.
Under the condition that the time interval between the current channel scanning time and the last long-period channel scanning time is not less than the time length threshold, the station acquires a full channel set, the full channel set comprises a plurality of channels, the number of the channels of the full channel set is related to the channel supporting capacity and the region of the station, the distribution conditions of wireless fidelity channels of different countries are different, and the station can obtain the corresponding full channel set according to the region. For example: and the site detects that the site is currently located in the area B according to the geographical position information, and determines 30 channels corresponding to the area B according to a preset mapping relation. The value of the first parameter of each channel in the full channel set is an initial value.
For example, according to the example of S307, the full channel set corresponds to 6 channels, and the initial value is 3, which is represented by the following form:
{ID:0,number:3;
ID:1,number:3;
ID:2,number:3;
ID:3,number:3;
ID:4,number:3;
ID:5,number:3;}。
and S311, the station records the time of the current channel scanning as the time of the long-period channel scanning.
When storing the time record of the channel scanning, the station distinguishes between the long-period channel scanning and the long-period channel scanning, for example: different bits are used for distinction.
And S312, the station executes long-period channel scanning according to the full channel set.
And the station scans the access point on each channel in the channel set after the last channel scanning to obtain a channel scanning result.
For example: according to the example of S311, the station sequentially performs channel scanning on channels 0 to 5, and it is assumed that the channel scanning result includes: the station scans the access point on the channel 0, the station scans the access point on the channel 1, the station scans the access point on the channel 2, and the station does not scan the access point on the channels 3 to 5.
And S313, the station obtains the channel set after the channel scanning according to the channel scanning result.
If the access point is scanned on the channel, resetting the value of the first parameter of the channel as an initial value; if the access point is not scanned on the channel, the value of the first parameter of the channel is reduced by a preset step value.
For example: according to the channel detection result in S312, the station resets the values of the first parameters of channels 0 to 2 to 3, the station subtracts 1 from the values of the first parameters of channels 3 to 5 to obtain 2, and the updated channel set after this time of channel scanning is represented as:
{ID:0,number:3;
ID:1,number:3;
ID:2,number:3;
ID:3,number:2;
ID:4,number:2;
ID:5,number:2;}。
when the scheme of the embodiment of the application is executed, a station starts channel scanning of this time in a connection state, the station acquires a channel set of channel scanning of the last time, selects a channel which is not continuously scanned to an access point for a time less than a preset time from the channel set of channel scanning of the last time, performs channel scanning according to the selected channel, and then updates the channel set of channel scanning of the last time according to a channel scanning result to obtain the channel set of channel scanning of this time. Therefore, the station does not need to perform full channel scanning each time in a connection state, the time for channel scanning is reduced, the sleep time of the station is correspondingly reduced, the time delay of data transmission is reduced, and the throughput of data transmission is increased.
Please refer to fig. 4, which is a flowchart illustrating a channel scanning method according to an embodiment of the present disclosure. The present embodiment is exemplified by applying the channel scanning method to a station. The channel scanning method may include the steps of:
s401, detecting the time of the current channel scanning.
The specific process of S401 may refer to the description of S301 in fig. 3, and is not described herein again.
S402, whether to scan the appointed channel or access point.
The specific process of S402 may refer to the description of S302 in fig. 3, and is not described herein again.
And S403, scanning the designated channel or access point.
S404, calculating the time interval between the time of the current channel scanning and the time of the last long-period channel scanning.
The specific process of S404 may refer to the description of S304 in fig. 3, and is not described herein again.
S405, judging whether the time interval is smaller than a time length threshold value.
The specific process of S405 may refer to the description of S305 in fig. 3, and is not described herein again.
S406, acquiring a channel set obtained by the last channel scanning and obtained by the last channel scanning.
The specific process of S406 may refer to the description in S306, and is not described herein again. In this embodiment, each element in the channel set after the last channel scan may include a channel identifier and a value of a second parameter, where the value of the second parameter indicates the number of times that the access point is not scanned continuously.
And S407, the station selects a channel with the value of the second parameter smaller than the second threshold value in the channel set after the channel scanning last time.
The channel set after the channel scanning last time includes a plurality of elements, each element includes a channel identifier and a value of a second parameter, an initial value of the second parameter is smaller than a second threshold, and the initial value and the second threshold may be determined according to actual requirements, which is not limited in the present application.
For example: the channel set after the last channel scanning corresponds to 6 channels, and the representation form is as follows: {
ID:0,number:1;
ID:1,number:3;
ID:2,number:2;
ID:3,number:4;
ID:4,number:0;
ID: 5, number: 5; a number represents a value of the second parameter, and an ID represents a channel identifier; assuming that the second threshold is 3, the station selects channels less than 3 in the first channel list as: channel 0, channel 2, and channel 4.
And S408, the station scans the access point on the selected channel.
For example: the station scans for access points on channel 0, channel 2, and channel 4 in sequence, according to the example of S407.
And S409, the station updates the value of the second parameter of each channel in the channel set after the channel scanning last time according to the channel scanning result, and obtains the channel set after the channel scanning this time after updating.
If the access point is scanned on the channel selected in S408, the station resets the value of the second parameter of the channel to the initial value; if the access point is not scanned on the channel selected in S408, the station increases the value of the second parameter of the channel by the preset step value. The initial value and the preset step value may be determined according to actual requirements, and the application is not limited.
It should be understood that the station only updates S408 the values of the second parameter of the channels selected in the channel set after the last channel scan, and the values of the second parameters of the other channels remain unchanged in this channel scan.
For example: the initial value is 0, the preset step value is 1, the station scans the access point on the channel 0 according to the channel scanning result of S408, and the station resets the value of the first parameter of the channel 0 to the initial value 0. The station does not scan for an access point on channel 2 and the station increases the value of the first parameter of channel 2 by 1 to 3. The station does not scan for an access point on channel 4 and the station increases the value of the second parameter of channel 4 by 1 to become 1. Then the updated channel set after this channel scanning can be represented as:
{ID:0,number:0;
ID:1,number:3;
ID:2,number:3;
ID:3,number:4;
ID:4,number:1;
ID:5,number:5;}
s410, the station acquires a full channel set.
Under the condition that the time interval between the time of channel scanning this time and the time of channel scanning last time is not less than the duration threshold, the station acquires a full channel set, the full channel set includes one or more channels, the number of channels in the full channel set is related to the channel support capability and the area where the station is located, for example: and the site detects that the site is currently located in the area B according to the geographical position information, and determines 30 channels corresponding to the area B according to a preset mapping relation. The value of the second parameter for each channel in the full channel set is an initial value.
And S411, the station records the time of the current channel scanning as the time of the long-period channel scanning.
For example, according to the example of S407, the full channel set corresponds to 6 channels, the initial value is 0, and the representation form may be:
{ID:0,number:0;
ID:1,number:0;
ID:2,number:0;
ID:3,number:0;
ID:4,number:0;
ID:5,number:0;}。
and S412, the station executes long-period channel scanning according to the full channel set.
And the station scans the access point on each channel in the channel set after the last channel scanning to obtain a channel scanning result.
For example: according to the example of S411, the station sequentially performs channel scanning on channels 0 to 5, and it is assumed that the channel scanning result includes: the station scans the access point on the channel 0, the station scans the access point on the channel 1, the station scans the access point on the channel 2, and the station does not scan the access point on the channels 3 to 5.
And S413, the station updates the value of the second parameter of each channel in the full channel set according to the channel scanning result to obtain the channel set after the channel scanning.
If the access point is scanned on the channel, resetting the value of the second parameter of the channel as an initial value; if the access point is not scanned on the channel, the value of the second parameter of the channel is increased by a preset step value.
For example: according to the channel detection result in S412, the station resets the values of the second parameters of channels 0 to 2 to 0, the station increases the values of the first parameters of channels 3 to 5 by 1 to obtain 1, and the updated channel set after this time of channel scanning is represented as:
{ID:0,number:0;
ID:1,number:0;
ID:2,number:0;
ID:3,number:1;
ID:4,number:1;
ID:5,number:1;}。
when the scheme of the embodiment of the application is executed, a station starts channel scanning of this time in a connection state, the station acquires a channel set of channel scanning of the last time, selects a channel which is not continuously scanned to an access point for a time less than a preset time from the channel set of channel scanning of the last time, performs channel scanning according to the selected channel, and then updates the channel set of channel scanning of the last time according to a channel scanning result to obtain the channel set of channel scanning of this time. Therefore, the station does not need to perform full channel scanning each time in a connection state, the time for channel scanning is reduced, the sleep time of the station is correspondingly reduced, the time delay of data transmission is reduced, and the throughput of data transmission is increased.
Referring to fig. 5, a schematic flow chart of a channel scanning method provided in the embodiment of the present application is shown, and as shown in fig. 5, the method in the embodiment of the present application may include the following steps:
s501, when the preset short-period channel scanning time is up, the station acquires a channel set generated by the last channel scanning and obtained after the last channel scanning.
In the embodiment of the present application, the time for performing long-period channel scanning each time is referred to as long-period channel scanning time, and the time for performing short-period channel scanning each time is referred to as short-period channel scanning time. The method includes that a station scans channels periodically or aperiodically in a connection state to detect whether an access point exists in the channels, the mode of scanning the channels triggered by the station can be application program triggering or framework triggering, the application program triggering indicates that the station receives a triggering instruction of a user through an application program, periodic channel scanning is carried out in response to the triggering instruction, and the application program can be an application program carried by an operating system or an application program of a third party. The framework trigger represents that the station automatically scans channels periodically without relying on the trigger of the application program. The connection state indicates that the station establishes a wireless fidelity connection with a surrounding access point, and service data can be transmitted between the station and the access point. It should be noted that, during the process of executing the channel scanning method of the present application, the station is always in the on-line state.
Generally, the initial channel scanning is generally channel scanning performed after being started or after a long time, and if the current channel scanning is the initial channel scanning, the station performs long-period channel scanning and records the time of the long-period channel scanning. The station prestores or is preconfigured with a channel scanning period, and the size of the channel scanning period can be determined according to actual requirements, for example: the channel scanning period is 3 seconds, and the station performs channel scanning every 3 seconds. The long-period channel scanning indicates that the station performs channel scanning according to each channel in a pre-stored or pre-configured full channel set, and the number of channels corresponding to the full channel set is generally related to the channel support capability of the station and the region where the station is located. For example: the station supports 2.4G and 5G wireless fidelity communication capabilities, the station is located in the area A, and the station sequentially scans 30 channels according to the fact that the full channel set corresponds to the 30 channels to determine whether the access point is scanned in the channels.
Generally, a station periodically performs channel scanning, the type of the station performing channel scanning is divided into long-period channel scanning and short-period channel scanning, the station can determine whether the time of the current channel scanning and the time of the last long-period channel scanning are less than a duration threshold, if so, the current channel scanning is short-period channel scanning, otherwise, the current channel scanning is long-period channel scanning. The period of long period channel scanning is greater than that of short period channel scanning, and the first channel scanning is regarded as long period channel scanning. For example: the long-period channel scanning time is t0, t0+60s, … and t0+ (60 × n) s in sequence, the short-period scanning time is t0+3s, t0+ (3 × 2) s, … and t0(3 × n) in sequence, namely, the station performs long-period channel scanning every 60s and performs short-period channel scanning every 3 s. The station prestores or pre-configures a time length threshold, which may be determined according to actual needs, and the time length threshold is greater than the period of channel scanning, for example: the time length threshold is positive integral multiple of the channel scanning period, the time length threshold is 1 minute, and the channel scanning period is 3 seconds. The last channel scan is based on the adjacent channel scan before the current channel scan, and the type of the last channel scan may be long-period channel scan or short-period channel scan.
The channel set after the previous channel scanning and the channel set after the current channel scanning are in a data structure, and the number of channels corresponding to the channel set after the previous channel scanning and the channel set after the current channel scanning may be less than the number of channels corresponding to one channel in the full channel set. Each channel in the channel set after the last channel scanning corresponds to one channel parameter information, and the channel parameter information may indicate a result of scanning the access point on the channel. The type of the channel set in the present application may be a two-dimensional table, a linked list, an array, a structure, or a stack, and the present application is not limited.
It should be understood that the channel scanning may be switched between this time and the last time, and correspondingly, the channel set after this time channel scanning and the channel set after the last time channel scanning may also be switched between each other.
For example, for the nth channel scan, the (n + 1) th channel scan, and the (n + 2) th channel scan performed by the station, n is an integer greater than 1. If the (n + 1) th channel scanning is the current channel scanning, the (n) th channel scanning is the last channel scanning, a channel set obtained after the last channel scanning is obtained after the n-th channel scanning, and a channel set obtained after the current channel scanning is obtained after the (n + 1) th channel scanning; if the (n + 2) th channel scanning is the current channel scanning, the (n + 1) th channel scanning is the last channel scanning, a channel set obtained after the last channel scanning is obtained after the (n + 1) th channel scanning, and a channel set obtained after the current channel scanning is obtained after the (n + 2) th channel scanning.
S502, the station scans the access point on each channel in the channel set after the last channel scanning.
Generally, the channel set after the last channel scan includes a plurality of elements, each element may include a channel identifier and channel parameter information, and the channel identifier is used to indicate the identity of a channel, for example: the channel identifier is represented by a number, the channel parameter is used for representing the result of access point detection on the channel, and the channel parameter information includes: data throughput, data transmission rate, signal strength value, number of consecutive scans to an access point, and number of consecutive unscanned access points. The access point scanning mode of the station may be active scanning or passive scanning, and the active scanning or passive scanning process may refer to a process of scanning the access point when the station is in a disconnected state in the prior art, which is not described herein again.
For example, the channel set after the last channel scan corresponds to 5 channels, which is represented by the following form:
{ID:0,number:1;
ID:1,number:1;
ID:2,number:2;
ID:3,number:1;
ID:4,number:2}。
wherein, ID represents the number of channels, and number represents the number of times that an access point is not scanned continuously, then the station scans access points on channels 0 to 5 in sequence according to the channel set after the previous channel scanning to obtain channel scanning results, and it is assumed that the channel scanning results are: a station scans for access points on channel 0, channel 1, and channel 3, and a station does not scan for access points on channel 2 and channel 4.
S503, the station removes the channel with the channel parameter information meeting the removal condition in the channel set after the channel scanning last time according to the channel scanning result, and obtains the channel set after the channel scanning this time after removal.
The removing condition indicates that one or more channels are removed from the updated channel set subjected to channel scanning last time according to the channel parameter information, so that the channel set subjected to channel scanning this time is obtained. The station is pre-stored or pre-configured with a removal condition, and the removal condition may be determined according to actual needs, which is not limited in the present application. For example: the removal conditions include: the number of times that the access point is not scanned on the channel is greater than the preset number of times.
The station updates the channel parameter information in the channel set after the last channel scanning according to the channel scanning result in S502, and then removes the channels meeting the removal condition in the updated channel set after the last channel scanning from the channel set after the last channel scanning.
For example, after updating the channel parameter information in the channel set after the channel scanning last time according to the channel scanning result of S502, the channel set after the channel scanning last time is represented as:
{ID:0,number:0;
ID:1,number:0;
ID:2,number:3;
ID:3,number:0;
ID:4,number:3}。
the removal condition is that number is not less than 3, so that it is known that channel 2 and channel 4 satisfy the removal condition, and the station represents a channel set after channel scanning of this time, which is obtained by removing channel 2 and channel 4 from a channel set after channel scanning of the last time, as follows:
{ID:0,number:0;
ID:1,number:0;
ID:3,number:0;}。
by implementing the embodiment of the invention, in the process that the station starts channel scanning in a connection state, the station counts channel parameter information of a channel after performing channel scanning each time, and when the channel is scanned this time, if the channel parameter information of the channel does not meet specified conditions, the channel is skipped when performing channel scanning next time, the number of channels scanned by the station is reduced, namely the station does not need to perform full channel scanning each time in the channel scanning process, so that the time for the station to scan the channel is correspondingly reduced, and the time for the station to perform channel scanning in the connection state can be reduced, thereby reducing the time delay of data transmission and increasing the throughput of data transmission
Referring to fig. 6, which is a schematic flowchart of a channel scanning method provided in an embodiment of the present application, as shown in fig. 5, the method in the embodiment of the present application may include the following steps:
s601, detecting the time of the current channel scanning.
In this embodiment of the present application, a station triggers a periodic or aperiodic channel scan in an online state, so as to scan whether an access point exists in a channel, and the mode of triggering the channel scan by the station may be application triggering or framework triggering. For example: taking the android system as an example, the process triggered by the application program may include: the method comprises the steps that a station receives an instruction for opening a wireless fidelity list triggered by a user, the station responds to the instruction and then periodically performs channel scanning by utilizing a Wifi scanning service, and an application program can be an application program carried by the system or a third-party application program; the frame trigger may be that the station periodically performs channel scanning with wifi scanning service in the background.
The station is in a connection state, which means that the station establishes a wireless fidelity connection with a surrounding access point, and the station and the access point can transmit service data.
The period of channel scanning may be determined according to actual requirements, for example: the period of channel scanning is described as 2, and the station performs channel scanning every 2 seconds. The reference time point of the station may be a time when the station is powered on, restarted or switched to an unlocked state, and the station may use the reference time point as a time for first channel scanning. And when the station detects that the time between the current time and the currently stored channel scanning time reaches a scanning period, determining that the channel scanning time is up, and starting the channel scanning by the station.
S602, whether to scan the appointed channel or access point.
In this embodiment of the present application, a station determines whether it needs to scan a specified channel or access point, for example: when a user needs to connect with a designated access point, the user triggers and opens the wireless fidelity list, and selects an SSID from the wireless fidelity list for connection, so that the station scans the access point corresponding to the SSID, namely the station scans the designated access point. Another example is: the station stores a wireless fidelity connection history table, the wireless fidelity connection history table comprises an SSID, a password and a channel identifier which are connected before, and the station scans an access point on a channel indicated by the channel identifier in the wireless fidelity connection history table, namely the station scans a specified channel.
And S603, scanning the designated channel or access point.
S604, calculating the time interval between the time of the current channel scanning and the time of the last long-period channel scanning.
In general, long-period channel scanning refers to a station performing channel scanning on all channels in a full channel set, where the number of channels in the full channel set is related to channels supported by the station and a region, for example: the station is located in area A, the station supports 2.4G and 5G wireless fidelity channels, the full channel set pre-stored or configured by the station comprises 30 channels, and the station scans access points on the 30 channels in sequence according to a certain scanning sequence. Each time the station performs the long-period channel scanning, the time of the long-period channel scanning is recorded, and the time of the long-period channel scanning can be the starting time.
And S605, judging whether the time interval is smaller than a time length threshold value.
In general, the time length threshold value can be determined according to actual requirements, and the time length threshold value is prestored or preconfigured by the station. If the judgment result is yes, the station executes short-period channel scanning, namely the time of the current channel scanning is the short-period channel scanning time; if the judgment result is negative, executing long-period channel scanning, namely the time of the current channel scanning is the long-period channel scanning time.
For example: the time length threshold value is 60 seconds, the channel scanning period is 3 seconds, the time of the current channel scanning is t1, the time of the last long period channel scanning is t1+6 seconds, the time interval between the time of the current channel scanning and the time of the last channel scanning calculated by the station is 6 seconds, the time interval is less than the time length threshold value 60 seconds, and the judgment result is yes.
Another example is: the time length threshold value is 60 seconds, the channel scanning period is 3 seconds, the time of the current channel scanning is t1, the time of the station acquiring the last channel scanning is t1+60 seconds, the time interval between the time of the current channel scanning and the time of the last channel scanning calculated by the station is 60 seconds, and is equal to the time length threshold value 60 seconds, and the judgment result is no.
Generally, the time length threshold is greater than the channel scanning period, and the time length threshold may be an integer multiple of the channel scanning period, that is, the station performs short-period channel scanning according to the first period and performs long-period channel scanning according to the second period, where the second period is greater than the first period and the second period is an integer multiple of the first period, and the non-long-period channel scanning time and the long-period channel scanning time coincide. For example: the first period is 2 seconds, the second period is 40 seconds, the first channel scanning is long period channel scanning, the station performs short period channel scanning every 3 seconds, and performs long period channel scanning every 60 seconds.
And S606, acquiring a channel set obtained after the channel scanning last time.
The station records the time of channel scanning every time the station performs channel scanning, the time of channel scanning may be the starting time, the last channel scanning may be long-period channel scanning or short-period channel scanning, and when the station stores the time of channel scanning, the station may distinguish the long-period channel scanning from the short-period channel scanning by using different flag bits.
For example: the time when the station stores the channel scan may be represented as { time: 8:00:00, type: 1} and, for example: the time when the station stores the channel scan may be represented as { time: 8:00:03, type: 0, where time represents the time of channel scanning, expressed in time-minutes-seconds; type indicates the type of channel scan, 1 indicates the channel scan as a long period channel scan, and 0 indicates the channel scan as a short period channel scan.
The channel set after the channel scanning last time is a channel set obtained after the channel scanning last time, the channel set after the channel scanning this time is a channel set obtained after the channel scanning this time, the channel set after the channel scanning last time and the channel set after the channel scanning this time are data structures, and the types of the channel sets include, but are not limited to, a two-dimensional table, a linked list, an array, a structure or a stack. The number of channels corresponding to the channel set after the last channel scanning and the channel set after the current channel scanning is less than or equal to the number of channels corresponding to the full channel set.
It should be understood that there is a relative concept between the channel scanning of this time and the channel scanning of the last time, and there is also a relative concept between the channel set after the channel scanning of this time and the channel set after the channel scanning of this time, and the channel scanning of this time and the channel set after the channel scanning of last time and the channel set after the channel scanning of this time can be converted to each other.
For example: for the nth channel scanning, the (n + 1) th channel scanning and the (n + 2) th channel scanning performed by the station, n is an integer greater than 1; if the channel scanning for n +1 times is the channel scanning of this time, the channel scanning for the nth time is the channel scanning of the last time, the channel set after the channel scanning of the last time is obtained after the channel scanning of the nth time, and the channel set after the channel scanning of this time is obtained after the channel scanning of the (n + 1) th time. If the (n + 2) th channel scanning is the current channel scanning, the (n + 1) th channel scanning is the last channel scanning, the (n + 1) th channel scanning obtains a channel set after the last channel scanning, and the (n + 2) th channel scanning obtains a channel set after the current channel scanning.
The channel set after the last channel scanning includes a plurality of elements, each element includes a channel identifier and a value of a first parameter, an initial value of the first parameter is a maximum number of times that the station has prestored or preconfigured and has not scanned the access point continuously, and a size of the initial value may be determined according to an actual requirement.
For example: the channel set after the last channel scanning corresponds to 6 channels, and the representation form is as follows: {
ID:0,number:1;
ID:1,number:2;
ID:2,number:1;
ID:3,number:1;
ID:4,number:1;
ID:5,number:2;}。
S607, the station scans an access point on each channel in the channel set after the previous channel scanning.
For example, according to the example of S606, the station performs channel scanning on channels 0 to 5 to detect whether there is an access point, and the channel scanning result is: a station does not scan for an access point on channel 0, channel 2, and channel 4, and a station scans for an access point on channel 1, channel 3, and channel 5.
And S608, the station updates the value of the first parameter of each channel in the channel set after the current channel scanning according to the channel scanning result.
If the access point is scanned on the channel, resetting the value of the first parameter of the channel as an initial value; if the access point is not scanned on the channel, the value of the first parameter of the channel is decreased by a preset step value. The initial value and the preset step value can be determined according to actual requirements, and the application is not limited.
For example: the initial value is 3, the preset step value is 1, the station does not scan the access point on the channel 0 according to the channel scanning result of S607, and the station subtracts 1 from the value of the first parameter of the channel 0 to obtain 0. The station scans for an access point on channel 1 and the station resets the value of the first parameter of channel 1 to 3. The station does not scan for an access point on channel 2, and the station subtracts 1 from the value of the first parameter of channel 2 to obtain 0. The station scans for an access point on channel 3 and the station resets the value of the first parameter of channel 3 to 3. The station does not scan for an access point on channel 4, and the station subtracts 1 from the value of the first parameter of channel 4 to obtain 0. The station scans for an access point on channel 5 and the station resets the value of the first parameter of channel 5 to 3. The updated set of channels from the last channel scan may be represented as:
{ID:0,number:0;
ID:1,number:3;
ID:2,number:0;
ID:3,number:3;
ID:4,number:0;
ID:5,number:3;}。
and S609, the station removes the channel which is not greater than the first threshold value in the channel set after the last channel scanning to obtain the channel set after the current channel scanning.
The removing condition is that the value of the first parameter is not greater than a first threshold value, the station prestores or is preconfigured with the first threshold value, and the first threshold value is smaller than an initial value.
For example: the first threshold is 0, and the station removes, according to the updated channel set after the channel scanning last time in S608, a channel that is less than or equal to 0 in the channel set after the channel scanning last time to obtain a channel set after the channel scanning this time, where the channel set after the channel scanning this time may be represented as:
{ID:1,number:3;
ID:3,number:3;
ID:5,number:3;}。
s610, the station acquires a full channel set.
Under the condition that the time interval between the current channel scanning time and the last channel scanning time is not less than the time length threshold, the station acquires a full channel set, the full channel set comprises a plurality of channels, the number of the channels of the full channel set is related to the channel supporting capacity and the area of the station, and the distribution conditions of wireless fidelity channels of different countries are different. For example: the station supports 2.4G and 5G wireless fidelity channels, the station determines that the station is located in a B area according to the geographical position information, the 2.4G and 5G wireless fidelity channels in the B area are determined to be channels 0-29 according to a preset mapping relation, and the channels 0-29 are multiple channels included in a full channel set. The value of the first parameter of each channel in the full channel set is an initial value.
For example, according to the example of S607, the full channel set corresponds to 6 channels, the initial value is 3, which is represented by the form:
{ID:0,number:3;
ID:1,number:3;
ID:2,number:3;
ID:3,number:3;
ID:4,number:3;
ID:5,number:3;}。
and S611, the station records the time of the current channel scanning as the time of the long-period channel scanning.
When the station stores the time of channel scanning, it distinguishes whether the type of channel scanning is long period channel scanning or short period channel scanning, for example, different bits are used for distinguishing.
And S612, the station executes long-period channel scanning according to the full channel set.
For example, as shown in S610, the station scans the access point on channels 0 to 5, respectively, and it is assumed that the channel scanning result includes: a station does not scan for an access point on channel 0, scans for an access point on channel 1, scans for an access point on channel 2, scans for an access point on channel 3, does not scan for an access point on channel 4, and scans for an access point on channel 5.
S613, the station updates the value of the first parameter of each channel in the full channel set according to the channel scanning result to obtain the channel set after the channel scanning.
If the access point is scanned on the channel, resetting the value of the first parameter of the channel as an initial value; if the access point is not scanned on the channel, the value of the first parameter of the channel is decreased by a preset step value. The initial value and the preset step value may be determined according to actual requirements, and the initial value and the preset step value are the same as in S608.
For example: the initial value is 3, the preset step value is 1, and according to the channel detection result in S612, the value of the first parameter of the full channel set in S611 is updated: the station subtracts 1 from the values of the first parameters of channel 0, channel 2 and channel 4 to obtain 2, and resets the values of the first parameters of channel 1, channel 3 and channel 5 to 3. The updated second channel parameter set of the current channel scan can be represented as:
{ID:0,number:2;
ID:1,number:3;
ID:2,number:2;
ID:3,number:3;
ID:4,number:2;
ID:5,number:3;}。
when the scheme of the embodiment of the application is executed, a station starts channel scanning of this time in a connection state, the station acquires a channel set of channel scanning of the last time, performs channel scanning according to the channel set of channel scanning of the last time, updates the channel set of channel scanning of the last time according to a channel scanning result, removes channels, which are not scanned by an access point continuously in the updated channel set of the last time and have a frequency greater than a preset frequency, and obtains the channel set of channel scanning of this time after removing. Therefore, the station does not need to perform full channel scanning each time in a connection state, the time for channel scanning is reduced, the sleep time of the station is correspondingly reduced, the time delay of data transmission is reduced, and the throughput of data transmission is increased.
Referring to fig. 7, a flowchart of a channel scanning method is provided in the embodiment of the present application. The present embodiment is exemplified by applying the channel scanning method to a station. The channel scanning method may include the steps of:
and S701, detecting the time of the current channel scanning.
The specific process of S701 may refer to the description of S601 in fig. 6, and is not described herein again.
S702, scanning the appointed channel or access point.
The specific process of S702 may refer to the description of S602 in fig. 6, and is not described herein again.
And S703, scanning the appointed channel or access point.
The specific process of S703 may refer to the description of S603 in fig. 6, and is not described herein again.
And S704, calculating the time of the current channel scanning and the time of the last long-period channel scanning.
The specific process of S704 may refer to the description of S604 in fig. 6, and is not described herein again.
S705, judging whether the time interval is smaller than a time length threshold value.
The specific process of S705 may refer to the description of S605 in fig. 6, and is not described herein again.
S706, acquiring a channel set obtained after the channel scanning last time.
The station records the time of channel scanning every time the station performs channel scanning, the time of channel scanning may be the starting time, the last channel scanning may be long-period channel scanning or short-period channel scanning, and when the station stores the time of channel scanning, the station may distinguish the long-period channel scanning from the short-period channel scanning by using different flag bits.
For example: the time when the station stores the channel scan may be represented as { time: 8:00:00, type: 1} and, for example: the time when the station stores the channel scan may be represented as { time: 8:00:03, type: 0, where time represents the time of channel scan, expressed in terms of time/min/sec; type indicates the type of channel scan, 1 indicates the channel scan as a long period channel scan, and 0 indicates the channel scan as a short period channel scan.
The channel set after the channel scanning last time is a channel set obtained after the channel scanning last time, the channel set after the channel scanning this time is a channel set obtained after the channel scanning this time, the channel set after the channel scanning last time and the channel set after the channel scanning this time are data structures, and the types of the channel sets include, but are not limited to, a two-dimensional table, a linked list, an array, a structure or a stack. The number of channels corresponding to the channel set after the last channel scanning and the channel set after the current channel scanning is less than or equal to the number of channels corresponding to the full channel set.
It should be understood that there is a relative concept between the channel scanning of this time and the channel scanning of the last time, and there is also a relative concept between the channel set after the channel scanning of this time and the channel set after the channel scanning of this time, and the channel scanning of this time and the channel set after the channel scanning of last time and the channel set after the channel scanning of this time can be converted to each other.
For example, for the nth channel scan, the (n + 1) th channel scan and the (n + 2) th channel scan performed by the station, n is an integer greater than 1; if the channel scanning for n +1 times is the channel scanning of this time, the channel scanning for the nth time is the channel scanning of the last time, the channel set after the channel scanning of the last time is obtained after the channel scanning of the nth time, and the channel set after the channel scanning of this time is obtained after the channel scanning of the (n + 1) th time. If the (n + 2) th channel scanning is the current channel scanning, the (n + 1) th channel scanning is the last channel scanning, the (n + 1) th channel scanning obtains a channel set after the last channel scanning, and the (n + 2) th channel scanning obtains a channel set after the current channel scanning.
The channel set after the last channel scanning includes a plurality of elements, each element includes a channel identifier and a value of a second parameter, an initial value of the second parameter is a maximum number of times that the station has prestored or preconfigured and has not scanned the access point continuously, and a size of the initial value may be determined according to an actual requirement.
For example: the channel set after the last channel scanning corresponds to 6 channels, and the representation form is as follows: {
ID:0,number:2;
ID:1,number:0;
ID:2,number:2;
ID:3,number:1;
ID:4,number:2;
ID:5,number:1;}。
And S707, the station scans the access point on each channel in the channel set after the last channel scanning.
For example, according to the example of S706, the station performs channel scanning on channel 0 to channel 5 to detect whether there is an access point, and the result of the channel scanning is: a station does not scan for an access point on channel 0, channel 2, and channel 4, and a station scans for an access point on channel 1, channel 3, and channel 5.
And S708, the station further updates the value of the second parameter of each channel in the channel set after the channel scanning last time according to the channel scanning result.
If the access point is scanned on the channel, the station resets the value of the second parameter of the channel to an initial value; if the access point is not scanned on the channel, the station increases the value of the second parameter of the channel by a preset step value. The initial value and the preset step value can be determined according to actual requirements.
For example, the initial value is 0, the preset step value is 1, according to the channel scanning result of S707, the station does not scan the access point on the channel 0, and the station adds 1 to the value of the first parameter of the channel 0 to obtain 3. The station scans for an access point on channel 1 and the station resets the value of the second parameter of channel 1 to 0. The station does not scan for an access point on channel 2, and the station adds 1 to the value of the second parameter of channel 2 to obtain 3. The station scans for an access point on channel 3 and the station resets the value of the second parameter of channel 3 to 0. The station does not scan for an access point on channel 4, and the station adds 1 to the value of the second parameter of channel 4 to obtain 3. The station scans for an access point on channel 5 and the station resets the value of the second parameter of channel 5 to 0. The updated set of channels after the last channel scan is represented as:
{ID:0,number:3;
ID:1,number:0;
ID:2,number:3;
ID:3,number:0;
ID:4,number:3;
ID:5,number:0;}。
and S709, removing channels which are not less than a first threshold value in the channel set after the channel scanning last time by the station to obtain the channel set after the channel scanning this time.
The removing condition is that the value of the first parameter is not less than a first threshold value, the station prestores or is preconfigured with the first threshold value, and the first threshold value is greater than an initial value.
For example, the first threshold is 3, and the station removes, according to the updated channel set after the channel scanning last time in S708, channels greater than or equal to 3 in the channel set after the channel scanning last time to obtain the channel set after the channel scanning this time, where the channel set after the channel scanning this time may be represented as:
{ID:1,number:0;
ID:3,number:0;
ID:5,number:0;}。
and S710, the station acquires a full channel set.
Under the condition that the time interval between the current channel scanning time and the last channel scanning time is not less than the time length threshold, the station acquires a full channel set, the full channel set comprises a plurality of channels, the number of the channels of the full channel set is related to the channel supporting capacity and the area of the station, and the distribution conditions of wireless fidelity channels of different countries are different. For example: the station supports 2.4G and 5G wireless fidelity channels, the station determines that the station is located in a B area according to the geographical position information, the 2.4G and 5G wireless fidelity channels in the B area are determined to be channels 0-29 according to a preset mapping relation, and the channels 0-29 are multiple channels included in a full channel set. The value of the first parameter of each channel in the full channel set is an initial value.
For example, according to the example of S607, the full channel set corresponds to 6 channels, the initial value is 3, which is represented by the form:
{ID:0,number:0;
ID:1,number:0;
ID:2,number:0;
ID:3,number:0;
ID:4,number:0;
ID:5,number:0;}。
and S711, the station records the time of the current channel scanning as the time of the long-period channel scanning.
When the station stores the time for channel scanning, it can distinguish whether the type of channel scanning is long-period channel scanning or short-period channel scanning, for example: different bits are used for distinction.
And S712, the station executes long-period channel scanning according to the full channel set.
For example, in the full channel set, as shown in S710, the station scans the access point on channels 0 to 5, respectively, and it is assumed that the channel scanning result includes: a station does not scan for an access point on channel 0, scans for an access point on channel 1, scans for an access point on channel 2, scans for an access point on channel 3, does not scan for an access point on channel 4, and scans for an access point on channel 5.
S713, the station updates the value of the second parameter of each channel in the full channel set according to the channel scanning result to obtain the second channel parameter set of the current channel scanning.
If the access point is scanned on the channel, resetting the value of the first parameter of the channel as an initial value; if the access point is not scanned on the channel, the value of the first parameter of the channel is decreased by a preset step value. The initial value and the preset step value may be determined according to actual requirements, and the initial value and the preset step value are the same as in S608.
For example, the initial value is 0, the preset step value is 1, and the value of the first parameter of the full channel set in S611 is updated according to the channel detection result in S612: the station adds 1 to the values of the first parameters of channel 0, channel 2 and channel 4 to obtain 1, and resets the values of the first parameters of channel 1, channel 3 and channel 5 to 0. The updated second channel parameter set of the current channel scan can be represented as:
{ID:0,number:1;
ID:1,number:0;
ID:2,number:1;
ID:3,number:0;
ID:4,number:1;
ID:5,number:0;}。
when the scheme of the embodiment of the application is executed, a station starts channel scanning of this time in a connection state, the station acquires a channel set of channel scanning of the last time, performs channel scanning according to the channel set of channel scanning of the last time, updates the channel set of channel scanning of the last time according to a channel scanning result, removes channels, which are not scanned by an access point continuously in the updated channel set of the last time and have a frequency greater than a preset frequency, and obtains the channel set of channel scanning of this time after removing. Therefore, the station does not need to perform full channel scanning each time in a connection state, the time for channel scanning is reduced, the sleep time of the station is correspondingly reduced, the time delay of data transmission is reduced, and the throughput of data transmission is increased.
The embodiment of the present application further provides a channel scanning method, where the channel scanning method includes, but is not limited to, the following steps:
step A, detecting the time of reaching the current channel scanning and determining the frequency of the current channel scanning.
The station periodically performs channel scanning, where the channel scanning is used to detect whether an access point exists in a channel, and a manner for the station to scan the access point in the channel may be: the method comprises the steps that a station scans a signal strength value of an access point, and under the condition that the signal strength value is smaller than a signal strength threshold value, the station does not detect the access point; otherwise, determining that the station detects the access point. In the event that the signal strength of all access points in the signal is less than the signal strength threshold, the station determines that no access point has been scanned on the channel.
Generally, the period for the station to perform channel scanning may be determined according to actual requirements, for example: the period of the station channel scan is 3 s. The station calculates the channel scanning times by taking the first channel scanning as the start, wherein the first channel scanning can be the first channel scanning after the station is started and the first channel scanning after the station is switched from a dormant state to a working state. The number of scans for the first channel scan is initialized to 1 and then incremented by 1.
And B, selecting a channel from the full channel set according to the channel scanning times.
The full channel set comprises a plurality of channels, the number of the channels of the full channel set is related to the channel support capability and the region of the site, the distribution conditions of the wireless fidelity channels of different countries are different, and the site can obtain the corresponding full channel set according to the region. For example: and the site detects that the site is currently located in the area B according to the geographical position information, and determines 30 channels corresponding to the area B according to a preset mapping relation. The number of channels selected from the full channel set according to the number of channel scans is less than the number of channels in the full channel set, for example: the station selects half channels in the full channel set each time, the channels selected twice by the vector are different,
in some embodiments, the full channel set includes a first channel subset and a second channel subset, and the selecting a channel from the full channel set according to the number of times of channel scanning includes:
if the channel scanning times are odd, selecting the first channel subset;
and if the channel scanning times are even, selecting the second channel subset.
Wherein the first channel subset and the second channel subset form a full channel set, for example: the full channel set comprises 30 channels from channel 0 to channel 29, the first channel subset comprises channel 0 to channel 14, and the second channel subset comprises channel 15 to channel 29. The number of channels in the first channel subset and the second channel subset is equal or approximately equal. The way of dividing the full channel set into the first channel subset and the second channel subset may be determined according to actual requirements, and the present application is not limited.
For example: the frequency of the current channel scanning is 100, the number of the channel scanning is even, and the station selects channels 0 to 14; another example is: the number of times of channel scanning this time is 101, the number of times is odd, and the station selects channels 15 to 29.
In some embodiments, the full set of channels includes a first subset of channels and a second subset of channels;
wherein, the selecting a channel from the full channel set according to the number of times of channel scanning at this time includes:
if the number of times of channel scanning is even, selecting the second channel subset;
and if the channel scanning times are odd, selecting the second channel subset.
In some embodiments, the number of each signal in the full channel set is increased by a preset step value from an initial number, the number of each channel in the first channel subset is an odd number, and the number of each channel in the second channel subset is an even number.
Wherein, the initial number and the preset step value can be determined according to actual requirements, for example: the initial number is 1, and the preset step value is 1.
And C, scanning channels on the selected channels.
The channel scanning is used to detect whether there is an access point on the channel, and the method for the station to scan the access point may be: the station measures the signal intensity value of the access point, if the signal intensity value is smaller than the signal intensity threshold value, the access point is determined not to be scanned, otherwise, the access point is determined to be scanned; the signal strength threshold may be determined according to actual requirements, and the application is not limited.
By implementing the embodiment of the application, the station selects one or more channels from the full channel set to scan according to the number of times of channel scanning at this time, the channels selected by two adjacent times of scanning are different, and the number of the selected channels is less than that of the channels in the full channel set, that is, the station completes long-period channel scanning in two scanning periods.
An embodiment of the present application further provides a channel scanning method, where the channel scanning method includes: when the time of the current channel scanning is up, if the current channel scanning is short-period odd channel scanning, acquiring a first channel subset of last odd channel scanning, selecting a channel meeting a screening condition from the first channel subset of last odd channel scanning, performing channel scanning on the selected channel, updating the first channel subset of last odd channel scanning according to a channel scanning result, and acquiring the first channel subset of the current odd channel scanning; or if the current channel scanning is short-period even channel scanning, acquiring a second channel subset after the last even channel scanning, selecting a channel meeting the screening condition from the second channel subset after the last even channel scanning, updating the second channel subset after the last even channel scanning according to a channel scanning result, and acquiring the second channel subset after the current even channel scanning.
Wherein the short-period odd channel scan and the long-period odd channel scan represent channel scans whose number of scans is an odd number. The period of the long period odd channel scan is greater than the period of the short period channel scan. The short-period even-numbered channel scanning and the long-period even-numbered channel scanning indicate channel scanning with an even number of scanning times, and the period of the long-period even-numbered channel scanning is longer than that of the short-period even-numbered channel scanning.
In some embodiments, if the current channel scanning is long-period odd channel scanning, obtaining an initial first channel subset, performing channel scanning on each channel on the initial first channel subset, and updating the initial first channel subset according to a scanning result to obtain a first channel subset after the current odd channel scanning; or if the current channel scanning is long-period even channel scanning, acquiring an initial second channel subset, performing channel scanning on each channel in the initial second channel subset, and updating the initial second channel subset according to a channel scanning result to obtain a second channel subset of the current even channel scanning.
It should be understood that the initial first subset of channels and the initial second subset of channels comprise a full set of channels, and the number of channels in the initial first subset of channels and the initial second subset of channels are equal or approximately equal, for example: the initial first subset of channels includes odd numbered channels and the initial second subset of channels includes even numbered channels. The method for updating the first channel subset, the second channel subset, the initial first channel subset and the initial second channel subset may refer to the method for updating the channel set in fig. 2 to fig. 7, and details thereof are not repeated here.
For example: the full channel set comprises channels 1 through 30, the initial first channel subset comprises channels 1 through 15, and the initial second channel subset comprises channels 16 through 30. The station starts after the start: the station scans channels every 3 seconds, and if the short-period odd channel scanning period and the short-period even channel scanning period are both 6s, the long-period odd channel scanning period and the long-period even channel scanning period are 30 s. The first odd channel scan performed by the station after power-up or restart is performed based on the initial first subset of channels, the first even channel scan, or the initial second subset of channels.
The station performs odd channel scanning for 2n-1 times, wherein n is an integer greater than 1; when n is 1, the station performs long-period odd channel scanning according to the initial first channel subset at the 1 st time, namely performs channel scanning on the channels 1 to 15; when n is 2, 3 and 4, the station performs short-period odd channel scanning; when n is 5, the station executes long period odd channel scanning again, and so on.
The station performs even channel scanning for 2n times, wherein n is an integer greater than 1; when n is 1, the station performs long-period even channel scanning according to the initial second channel subset at the 2 nd time, namely, performs channel scanning on the channels 16 to 30; when n is 2, 3 and 4, the station performs short period even scanning, when n is 5, the station performs long period even channel scanning again, and so on.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Please refer to fig. 8, which shows a schematic structural diagram of a channel scanning apparatus according to an exemplary embodiment of the present application. The apparatus may be implemented as all or a portion of the terminal in software, hardware, or a combination of both. The channel scanning device 8 includes an acquisition unit 801 and a scanning unit 802.
An obtaining unit 801, configured to obtain a channel set obtained after channel scanning last time when a preset short-period scanning time is up;
a scanning unit 802, configured to scan an access point on a channel in the channel set after the previous channel scanning, where channel parameter information meets a screening condition; wherein the screening condition includes that the number of times of continuously scanning the access point on the channel is less than a preset number of times.
In one embodiment, further comprising:
and the updating unit is used for updating the channel parameter information of each channel in the channel set after the channel scanning last time according to the channel scanning result, and obtaining the channel set after the channel scanning this time after updating.
In one embodiment, the update unit is further configured to:
when the preset long-period channel scanning time is up, acquiring a full channel set and performing long-period channel scanning according to the full channel set; updating the channel parameter information of each channel in the full channel set according to the channel scanning result to obtain the channel set after the current channel scanning; the long-period channel scanning time is the time for executing the long-period channel scanning, and the period of the long-period channel scanning is greater than the period of the short-period channel scanning.
In one embodiment, the channel parameter information comprises a first parameter, the initial value of which represents the maximum value that an access point is not scanned continuously on a channel;
the updating unit is configured to update channel parameter information of each channel in the channel set after the channel scanning last time according to a channel scanning result, and includes:
if the access point is scanned on the channel, resetting the value of the first parameter of the channel as the initial value;
if the access point is not scanned on the channel, the value of the first parameter of the channel is reduced by a preset step value.
In one embodiment, the scanning unit 802 is configured to scan an access point on a channel in the channel set after the last channel scan, where channel parameter information of the channel set meets a screening condition, and includes:
selecting a channel with a first parameter value larger than a first threshold value from the channel set after the last channel scanning; wherein the first threshold is less than an initial value of the first parameter;
an access point is scanned on a selected channel.
In one embodiment, the updating unit is configured to acquire a full channel set, perform long-period channel scanning according to the full channel set, and record the time of the current channel scanning as the time of the long-period channel scanning; updating the channel parameter information of each channel in the full channel set according to the channel scanning result to obtain the channel set after the current channel scanning comprises:
acquiring a full channel set; wherein the value of the first parameter for each channel in the full channel set is equal to the initial value;
scanning for access points on each channel in the full channel set;
if the access point is detected on the channel, resetting the value of the first parameter of the channel to the initial value;
and if the access point is not detected on the channel, reducing the value of the first parameter of the channel by the preset step value.
In one embodiment, the channel parameter information includes a second parameter whose value represents a number of consecutive unscanned access points on a channel;
the scanning unit 802 is configured to update channel parameters of each channel in the channel set after the channel scanning last time according to the channel scanning result, and includes:
if the access point is not scanned on the channel, increasing the value of the second parameter of the channel by a preset step value;
if the access point is scanned on the channel, the value of the second parameter of the channel is reset to the initial value.
In one embodiment, the updating unit is configured to scan the access point on a channel in the channel set of the last channel scan on which the channel parameter information satisfies the screening condition, and includes:
the station selects a channel with a second parameter value smaller than a second threshold value from the channel set after the last channel scanning; wherein the second threshold is greater than an initial value of the second parameter;
an access point is scanned on a selected channel.
In one embodiment, the updating unit is configured to acquire a full channel set, perform long-period channel scanning according to the full channel set, and record the time of the current channel scanning as the time of the long-period channel scanning; updating the channel parameter information of each channel in the full channel set according to the channel scanning result to obtain the channel set after the current channel scanning comprises:
acquiring a full channel set; wherein the value of the second parameter of each channel in the full channel set is the initial value;
performing long-period channel scanning according to the full channel set;
if the access point is scanned on the channel, setting the value of the second parameter of the channel as the initial value;
if the access point is not scanned on the channel, the value of the second parameter of the channel is increased by a preset step value.
In one embodiment, the station is in a wired state.
In one embodiment, the scanning unit 802 is further configured to: and if the current channel scanning is the first channel scanning, executing long-period channel scanning according to the full channel set.
It should be noted that, when the channel scanning apparatus 8 provided in the foregoing embodiment executes the channel scanning method, only the division of the above functional modules is taken as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above described functions. In addition, the touch operation response device provided by the above embodiment and the touch operation response method embodiment belong to the same concept, and details of implementation processes thereof are referred to the method embodiment, and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executing the method steps in the embodiments shown in fig. 2 to 7, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 2 to 7, which are not described herein again.
The present application further provides a computer program product storing at least one instruction, which is loaded and executed by the processor to implement the channel scanning method according to the above embodiments.
Referring to fig. 9, a schematic structural diagram of a station 9 according to an embodiment of the present application is shown, where the station 9 may be configured to implement the channel scanning method provided in the foregoing embodiment. Specifically, the method comprises the following steps:
the station 9 includes a memory 920, a processor 980, and a WiFi module 970, the WiFi module 970 being a wireless module of the present application.
The memory 920 may be used to store software programs and modules, and the processor 980 performs various functional applications and data processing by operating the software programs and modules stored in the memory 920. The memory 920 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal device, and the like. Further, the memory 920 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 920 may also include a memory controller to provide the processor 980 and the input unit 930 with access to the memory 920.
The processor 980 is a control center of the terminal device, connects various parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 920 and using data stored in the memory 920, thereby integrally monitoring the terminal device. Optionally, processor 980 may include one or more processing cores; processor 980 may, among other things, integrate an application processor, which primarily handles operating systems, user interfaces, and applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 980.
WiFi belongs to short distance wireless transmission technology, and the terminal device can help the user send and receive e-mail, browse web page and access streaming media, etc. through the WiFi module 970, which provides wireless broadband internet access for the user.
Specifically, in this embodiment, the station 9 includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs are configured to be executed by the one or more processors and include instructions for executing the channel scanning method described in fig. 2 to 7.
The embodiment of the present application and the method embodiments of fig. 2 to 7 are based on the same concept, and the technical effects brought by the embodiment are also the same, and the specific process may refer to the method embodiments of fig. 2 to 7, which are not described herein again.
Optionally, the station 9 further includes a display unit 940. The display unit 940 may be used to display information input by or provided to a user and various graphic user interfaces of the terminal device, which may be configured by graphics, text, icons, video, and any combination thereof. The Display unit 940 may include a Display panel 941, and optionally, the Display panel 941 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch device 931 may overlay the display panel 941, and when the touch device 931 detects a touch operation thereon or nearby, the touch device transmits the touch operation to the processor 980 to determine the type of touch event, and then the processor 980 provides a corresponding visual output on the display panel 941 according to the type of touch event. Although in FIG. 9, touch device 931 and display panel 941 are shown as two separate components to implement input and output functions, in some embodiments, touch device 931 and display panel 941 may be integrated to implement input and output functions.
Optionally, the station 9 further includes: an input unit 930. The input unit 930 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. Specifically, the input unit 930 may include a touch device 931 (e.g., a touch screen, a touch pad, or a touch frame). The touch device 931, also referred to as a touch screen or a touch pad, may collect a touch operation performed by a user on or near the touch device 931 (e.g., a user operating the touch device 931 or near the touch device 931 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connecting device according to a preset program. Alternatively, the touch device 931 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the touch device 931 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave.
Optionally, the station may include RF (Radio Frequency) circuitry 910, memory 920 including one or more computer-readable storage media, an input unit 930, a display unit 940, a sensor 950, audio circuitry 960, a WiFi (wireless fidelity) module 960, a processor 980 including one or more processing cores, and a power supply 990, among other components. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 9 does not constitute a limitation of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 910 may be used for receiving and transmitting signals during a message transmission or call, and in particular, for receiving downlink information from a base station and then processing the received downlink information by the one or more processors 980; in addition, data relating to uplink is transmitted to the base station. In general, RF circuit 910 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, the RF circuit 910 may also communicate with networks and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to 3GPP (3rd Generation Partnership Project, 3GPP for short), 3GPP2 (3rd Generation Partnership Project 2, 3GPP2 for short), UMTS (Universal Mobile Telecommunications System, UMTS for short), LTE (Long Time Evolution, LTE for short), LTE-a (LTE-Advanced, Long Term Evolution upgrade, LTE-a for short), WIMAX (Worldwide Access for Microwave Access, WIMAX for short), HSDPA (High Speed Downlink Packet Access, HSDPA for short), HSUPA (High Speed Uplink Packet Access, TDMA for short), and Multiple Access Time Division Multiple Access (HSUPA for short), which may be implemented by using any communication standard or protocol, including but not limited to 3GPP (3rd Generation Partnership Project, UMTS for short), UMTS (Universal Mobile Telecommunications System, UMTS for short), LTE (Long Time Evolution, LTE for short), LTE-a (LTE-Advanced Long Term Evolution upgrade, LTE-a for short), WIMAX (Worldwide Interoperability for Microwave Access, TDMA for short), and TDMA for short WCDMA (Wideband Code Division Multiple Access, WCDMA for Short), GSM (Global System for Mobile Communication, GSM for Short, email, SMS (Short Messaging Service), etc.
Optionally, the station 9 may also include at least one sensor 950, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 941 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 941 and/or a backlight when the terminal device is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the terminal device is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) for recognizing the attitude of the terminal device, and related functions (such as pedometer and tapping) for vibration recognition; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal device, detailed description is omitted here.
The audio circuitry 960, speaker 961, microphone 962 may provide an audio interface between a user and a terminal device. The audio circuit 960 may transmit the electrical signal converted from the received audio data to the speaker 961, and convert the electrical signal into a sound signal for output by the speaker 961; on the other hand, the microphone 962 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 960, and outputs the audio data to the processor 980 for processing, and then transmits the audio data to another terminal device through the RF circuit 910, or outputs the audio data to the memory 920 for further processing. The audio circuit 960 may also include an earbud jack to provide communication of peripheral headphones with the terminal device.
Optionally, the station 9 further includes a power supply 990 (e.g., a battery) for supplying power to various components, wherein the power supply may be logically connected to the processor 980 via a power management system, so as to manage charging, discharging, and power consumption via the power management system. Power supply 990 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and the like.
Optionally, the station 9 may further include a camera 991, a bluetooth module, and the like, where the camera 991 is configured to expose the surrounding environment to obtain a frame image, and in one manner, the camera 991 transmits parameters of the frame image obtained by exposure to the processor 980 so that the processor 980 performs processing such as denoising and enhancing on the frame image to generate a picture that can be displayed to the user; in yet another alternative, the camera 991 may be equipped with an image processor chip, which may perform a preliminary processing on the frame of image, and then transmit the processed data to the processor 980 to enable the processor 980 to ultimately produce an image that can be displayed to a user. Further, the number of the cameras 991 may be one or more.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (14)

1. A method for channel scanning, the method comprising:
when the preset short-period scanning time is up, acquiring a channel set after the last channel scanning; wherein the short period scanning time is the time for executing short period channel scanning;
scanning an access point on a channel of which the channel parameter information meets the screening condition in the channel set after the last channel scanning; wherein the screening condition includes that the number of times of continuously scanning the access point on the channel is less than a preset number of times.
2. The method of claim 1, further comprising:
and updating the channel parameter information of each channel in the channel set after the channel scanning of the last time according to the channel scanning result, and obtaining the channel set after the channel scanning of this time after updating.
3. The method of claim 1 or 2, further comprising:
when the preset long-period scanning time is up, acquiring a full channel set and performing long-period channel scanning according to the full channel set; updating the channel parameter information of each channel in the full channel set according to the channel scanning result to obtain a channel set after the current channel scanning; the long-period channel scanning time is the time for executing long-period channel scanning, and the period of the long-period channel scanning is greater than the period of the short-period channel scanning.
4. The method of claim 2, wherein the channel parameter information comprises a first parameter, and an initial value of the first parameter represents a maximum value of the first parameter that is continuously not scanned to the access point on the channel;
the updating of the channel parameter information of each channel in the channel set after the channel scanning last time according to the channel scanning result includes:
if the access point is scanned on the channel, resetting the value of the first parameter of the channel as the initial value;
if the access point is not scanned on the channel, the value of the first parameter of the channel is reduced by a preset step value.
5. The method according to claim 4, wherein scanning for an access point on a channel in the channel set after the last channel scanning, on which the channel parameter information satisfies the screening condition, comprises:
selecting a channel with a first parameter value larger than a first threshold value from the channel set after the last channel scanning; wherein the first threshold is less than an initial value of the first parameter;
an access point is scanned on a selected channel.
6. The method of claim 3, wherein the acquiring a full channel set and performing a long period channel scan according to the full channel set; updating the channel parameter information of each channel in the full channel set according to the channel scanning result to obtain the channel set after the current channel scanning comprises the following steps:
acquiring a full channel set; wherein the value of the first parameter of each channel in the full channel set is equal to an initial value;
scanning for access points on each channel in the full channel set;
if the access point is detected on the channel, resetting the value of the first parameter of the channel to the initial value;
if no access point is detected on the channel, the value of the first parameter of the channel is decreased by a preset step value.
7. The method of claim 2, wherein the channel parameter information comprises a second parameter, a value of the second parameter indicating a number of consecutive unscanned access points on a channel;
the updating of the channel parameters of each channel in the channel set after the channel scanning last time according to the channel scanning result includes:
if the access point is not scanned on the channel, increasing the value of the second parameter of the channel by a preset step value;
if the access point is scanned on the channel, the value of the second parameter of the channel is reset to the initial value.
8. The method of claim 7, wherein scanning for an access point on a channel in the channel set of the last channel scan on which channel parameter information satisfies the filtering condition comprises:
selecting a channel with a second parameter value smaller than a second threshold value from the channel set after the last channel scanning; wherein the second threshold is greater than an initial value of the second parameter;
an access point is scanned on a selected channel.
9. The method of claim 3, wherein the acquiring a full channel set and performing a long period channel scan according to the full channel set; updating the channel parameter information of each channel in the full channel set according to the channel scanning result to obtain the channel set after the current channel scanning comprises the following steps:
acquiring a full channel set; wherein, the value of the second parameter of each channel in the full channel set is an initial value;
performing long-period channel scanning according to the full channel set;
if the access point is scanned on the channel, setting the value of the second parameter of the channel as the initial value;
if the access point is not scanned on the channel, the value of the second parameter of the channel is increased by a preset step value.
10. The method of claim 1, wherein a station performing the short period channel scan or the long period channel scan is in an on-line state.
11. The method of claim 1, further comprising:
and if the channel scanning is the first channel scanning, executing long-period channel scanning according to the full channel set.
12. A channel scanning apparatus, comprising:
the acquisition unit is used for acquiring a channel set after channel scanning last time when the preset short-period scanning time is up; wherein the short period scanning time is the time for executing short period channel scanning;
the scanning unit is used for scanning the access point on the channel of which the channel parameter information meets the screening condition in the channel set after the channel scanning last time; wherein the screening condition includes that the number of times of continuously scanning the access point on the channel is less than a preset number of times.
13. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to carry out the method steps according to any one of claims 1 to 11.
14. An electronic device, comprising: a processor, a memory, and a wireless module; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1 to 11.
CN201910476025.1A 2019-06-03 2019-06-03 Channel scanning method, device, storage medium and electronic equipment Active CN110234152B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910476025.1A CN110234152B (en) 2019-06-03 2019-06-03 Channel scanning method, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910476025.1A CN110234152B (en) 2019-06-03 2019-06-03 Channel scanning method, device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110234152A CN110234152A (en) 2019-09-13
CN110234152B true CN110234152B (en) 2021-06-18

Family

ID=67859210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910476025.1A Active CN110234152B (en) 2019-06-03 2019-06-03 Channel scanning method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110234152B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111698742B (en) * 2020-06-08 2023-03-21 锐捷网络股份有限公司 Data communication method, terminal device, electronic device, and computer storage medium
CN111970181B (en) * 2020-08-27 2022-04-01 深圳市欧瑞博科技股份有限公司 Network distribution method and device for intelligent household equipment, electronic equipment and storage medium
US11930445B2 (en) 2020-09-18 2024-03-12 Arris Enterprises Llc Single-carrier quadrature amplitude modulation (SC-QAM) downstream channel fast pre-scanning
CN112492568B (en) * 2020-11-06 2023-08-22 北京小米移动软件有限公司 Network information processing method, device, mobile terminal and storage medium
CN114980041A (en) * 2021-02-19 2022-08-30 Oppo广东移动通信有限公司 WiFi signal scanning method, device, terminal and storage medium
CN114245439A (en) * 2021-11-05 2022-03-25 广西电网有限责任公司南宁供电局 Wireless communication method, device, system and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101123552A (en) * 2007-09-20 2008-02-13 杭州华三通信技术有限公司 An access point and wireless scanning method for this access point
CN101662796A (en) * 2009-09-08 2010-03-03 杭州华三通信技术有限公司 Method and device for scanning wireless local area network (LAN) channels
CN101772980A (en) * 2007-07-31 2010-07-07 日本电气株式会社 Wireless LAN terminal and access point searching method
CN102457942A (en) * 2010-10-29 2012-05-16 中兴通讯股份有限公司 Method and system for scanning channel in wireless network
CN104602324A (en) * 2015-01-27 2015-05-06 广东欧珀移动通信有限公司 Wireless access point scanning method and device and terminal device
CN107094315A (en) * 2017-04-24 2017-08-25 北京星网锐捷网络技术有限公司 Scan channel collocation method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080205340A1 (en) * 2007-02-28 2008-08-28 Qualcomm, Incorporated Neighbor discovery in a wireless system
KR101909025B1 (en) * 2012-05-17 2018-10-17 삼성전자 주식회사 Portable terminal and method for access point scan thereof
US9107145B2 (en) * 2012-07-06 2015-08-11 Htc Corporation Method and wireless communication device for conveying neighbor access point information
CN106412326B (en) * 2016-10-28 2019-09-13 Oppo广东移动通信有限公司 A kind of parameter regulation means and terminal device of terminal device
CN109660990A (en) * 2019-02-18 2019-04-19 上海连尚网络科技有限公司 Method and apparatus for scanning wireless access point

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101772980A (en) * 2007-07-31 2010-07-07 日本电气株式会社 Wireless LAN terminal and access point searching method
CN101123552A (en) * 2007-09-20 2008-02-13 杭州华三通信技术有限公司 An access point and wireless scanning method for this access point
CN101662796A (en) * 2009-09-08 2010-03-03 杭州华三通信技术有限公司 Method and device for scanning wireless local area network (LAN) channels
CN102457942A (en) * 2010-10-29 2012-05-16 中兴通讯股份有限公司 Method and system for scanning channel in wireless network
CN104602324A (en) * 2015-01-27 2015-05-06 广东欧珀移动通信有限公司 Wireless access point scanning method and device and terminal device
CN107094315A (en) * 2017-04-24 2017-08-25 北京星网锐捷网络技术有限公司 Scan channel collocation method and device

Also Published As

Publication number Publication date
CN110234152A (en) 2019-09-13

Similar Documents

Publication Publication Date Title
CN110234152B (en) Channel scanning method, device, storage medium and electronic equipment
US10142845B2 (en) Network connection method and apparatus, and computer storage medium
CN109462885B (en) Network slice registration method and terminal
CN108255683B (en) Method for prompting message in terminal and terminal
CN110831109B (en) Network selection method, terminal, network indication method and network side equipment
CN111010718B (en) Method for quickly searching network, configuration method and electronic equipment
CN111835488A (en) Method for determining mapping of antenna port and terminal
CN109005574B (en) Cell selection method, mobile terminal and computer readable storage medium
CN105989572B (en) Picture processing method and device
CN111010663B (en) Information sharing method and device, storage medium and computer equipment
CN107862217B (en) Position information acquisition method, mobile terminal and computer storage medium
CN113099521A (en) Dormancy awakening method and device of station, storage medium and electronic equipment
CN107122036B (en) Method and device for adjusting frequency of central processing unit
CN106708390B (en) Screen capturing method, device and system
CN110958644B (en) Terminal equipment capability information processing method and related equipment
CN110621071B (en) Processing method of measurement interval, terminal and network node
CN113286335B (en) Frequency point switching method and device, storage medium and access point
CN110493771B (en) Data network connection method, device, storage medium and terminal equipment
CN110717486B (en) Text detection method and device, electronic equipment and storage medium
CN111601364B (en) Method for sending and receiving network identification information and communication equipment
CN104954231B (en) Method and device for sending and displaying recommendation information
CN108088436B (en) Navigation information prompting method, terminal and computer readable storage medium
CN108111553B (en) Method and device for providing service
CN106879046B (en) Network scanning method and terminal equipment
CN111436138A (en) Signal transmission method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant