CN106714258B - Channel switching method and device - Google Patents

Channel switching method and device Download PDF

Info

Publication number
CN106714258B
CN106714258B CN201611187153.7A CN201611187153A CN106714258B CN 106714258 B CN106714258 B CN 106714258B CN 201611187153 A CN201611187153 A CN 201611187153A CN 106714258 B CN106714258 B CN 106714258B
Authority
CN
China
Prior art keywords
channel
monitoring
mac addresses
beacon
duration
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
CN201611187153.7A
Other languages
Chinese (zh)
Other versions
CN106714258A (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201611187153.7A priority Critical patent/CN106714258B/en
Publication of CN106714258A publication Critical patent/CN106714258A/en
Application granted granted Critical
Publication of CN106714258B publication Critical patent/CN106714258B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/24Reselection being triggered by specific parameters
    • H04W36/30Reselection being triggered by specific parameters by measured or perceived connection quality data

Abstract

The invention discloses a channel switching method and a channel switching device, which are used for solving the problems of low efficiency and time resource waste caused by adopting a timing cycle switching channel to monitor and acquire a wireless communication data packet in the prior art. The channel switching method comprises the following steps: acquiring the number of beacon messages received in each channel after the N channels are monitored; updating the monitoring duration of the corresponding channel based on the number of beacon messages of each channel or updating the monitoring duration of the corresponding channel based on the number of effective MAC addresses carried in the beacon messages received by each channel; and for each channel after the monitoring duration is updated, switching to the j +1 th channel to continue monitoring after the j th channel monitors the monitoring duration corresponding to the j th channel.

Description

Channel switching method and device
Technical Field
The present invention relates to the field of wireless communications technologies, and in particular, to a channel switching method and apparatus.
Background
With the development of wireless communication technology and the wide-range popularization of intelligent terminal devices such as mobile phones, the intelligent terminal devices have become an essential part of people's daily life. Each intelligent terminal device with the wireless network function has a unique MAC address, and the address can be used as an identification code of the intelligent terminal device. And other equipment acquires the information of the intelligent terminal equipment by acquiring the MAC address of the intelligent terminal equipment.
In the prior art, a device for acquiring an MAC address acquires a wireless communication data packet through a monitoring channel, and obtains a required MAC address by analyzing the wireless communication data packet. The channel is monitored by periodically and cyclically switching the channels, for example, a fixed time duration is set, if there are 3 channels, the channel is switched to the channel 2 after the fixed time duration is monitored on the channel 1, the channel is switched to the channel 3 after the fixed time duration is monitored on the channel 2, the channel is switched to the channel 1 after the fixed time duration is monitored on the channel 3, and the channel is cyclically switched. Because the number distribution conditions of beacon messages on each channel are different, the efficiency of monitoring and acquiring wireless communication data packets by adopting the timing cycle switching channel is low, and the waste of time resources is caused.
Disclosure of Invention
The invention provides a channel switching method and a channel switching device, which are used for solving the problems of low efficiency and time resource waste caused by adopting a timing cycle switching channel to monitor and acquire a wireless communication data packet in the prior art.
In a first aspect, an embodiment of the present invention provides a channel switching method, including:
after monitoring a preset monitoring time length on the ith channel, the wireless equipment is switched to the (i + 1) th channel to continue monitoring, wherein i is all positive integers with the sampling times not more than N, and N represents the total number of the channels and is a positive integer more than or equal to 1;
the wireless equipment acquires the number of beacon messages received in each channel after determining that the N channels are monitored;
the wireless equipment updates the monitoring time of the corresponding channel based on the number of beacon messages of each channel, so that the updated monitoring time of the channel with the large number of the beacon messages is longer than the monitoring time of the channel with the small number of the beacon messages;
and for each channel after the monitoring duration is updated, the wireless equipment switches to the j +1 th channel to continue monitoring after monitoring the monitoring duration corresponding to the j channel in the j channel, wherein j is all positive integers of which the sampling times are not more than N.
And the monitoring duration of the N channels is recorded in a channel switching scheduling time array, and the array length of the channel switching scheduling time array is N.
The number of beacon messages received by each channel is recorded in a beacon message statistical array, and the array length of the beacon message statistical array is N.
It should be noted that N takes different values based on the number of channels used in different countries. Taking the value of N in China and the United states when using a 2.4Ghz wireless network and a 5Ghz wireless network as an example: in china, 13 channels are used in a 2.4Ghz wireless network and 4 channels are used in a 5Ghz wireless network, so that the value of N is 13+ 4. In the united states, 11 channels are used in a 2.4Ghz wireless network and 12 channels are used in a 5Ghz wireless network, so that the value of N is 11+ 12.
In the process of acquiring the MAC address, the embodiment of the invention adjusts the monitoring duration of each channel according to the distribution state of the beacon message on the channel during channel monitoring, and compared with the mode of acquiring the MAC address by periodically and circularly switching the channel during channel monitoring in the prior art, the unnecessary channel retention time is reduced, the MAC address acquisition efficiency is improved, and a large amount of time resources are saved.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the updating, by the wireless device, the monitoring duration of the corresponding channel based on the number of beacon packets of each channel includes:
the wireless device reduces the monitoring time of a channel with the beacon message quantity smaller than a message threshold by (R-R) t, wherein R represents the message threshold, R represents the beacon message quantity acquired from the channel, and t1Is a constant less than the preset listening duration.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the t is a monitoring duration of a channel with a beacon packet number of 0.
With reference to the first possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the message threshold is the quantity of the beacon message with the minimum quantity among the multiple beacon message quantities greater than the average value of the message quantity, or the message threshold is the quantity of the beacon message with the maximum quantity among the multiple beacon message quantities less than the average value of the message quantity, and the average value of the message quantity is the average value of the quantity of the beacon messages of the N channels.
With reference to the first possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, for each channel after updating the listening duration, before the wireless device listens to the listening duration corresponding to the jth channel on the jth channel, the method further includes:
and the wireless equipment updates the monitoring time length corresponding to each channel after the monitoring time length is updated based on the number of the effective MAC addresses carried in the message received by each channel, wherein the number of the effective MAC addresses carried in the message received by each channel is obtained after the wireless equipment determines that the monitoring on the N channels is completed.
The number of the effective MAC addresses of the N channels is recorded in an effective MAC address number statistic array, and the array length of the effective MAC address number statistic array is N.
In the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution state of the beacon message on the channel and the distribution state of the acquired effective MAC address number on the channel during channel monitoring.
With reference to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the updating, by the wireless device, the monitoring duration corresponding to each channel after the monitoring duration is updated based on the number of valid MAC addresses carried in a packet received by each channel, includes:
the wireless equipment determines the efficiency ratio of each channel, wherein the efficiency ratio is the ratio of the number of effective MAC addresses carried in messages received in the same channel to the number of obtained beacon messages;
the wireless device increases the monitoring time length after updating of the channel with the acquired beacon message quantity smaller than the message threshold value and the efficiency ratio larger than the MAC address threshold value by (Q/Q) × t1The Q represents an efficiency ratio of a corresponding channel, and the Q represents a MAC address threshold.
With reference to the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the MAC address threshold is an efficiency ratio of a channel corresponding to a largest quantity of beacon messages among a plurality of beacon message quantities that are smaller than the message threshold, or the MAC address threshold is an efficiency ratio of a channel corresponding to a smallest quantity of beacon messages among a plurality of beacon message quantities that are larger than the message threshold.
With reference to the first aspect and any one possible implementation manner of the first to sixth possible implementation manners of the first aspect, in a seventh possible implementation manner of the first aspect, the method includes:
and after the wireless equipment determines that the N channels are monitored for T times, updating the monitoring time of each channel to the preset monitoring time.
In a second aspect, an embodiment of the present invention provides a channel switching method, including
After monitoring a preset monitoring time length on an mth channel, the wireless equipment is switched to an M +1 th channel to continue monitoring, wherein M is all positive integers with the sampling times being not more than M, and M represents the total number of the channels and is a positive integer more than or equal to 1;
the wireless equipment acquires the number of effective MAC addresses carried in the message received by each channel after determining that the M channels are monitored;
the wireless equipment updates the monitoring duration of the corresponding channel based on the number of the effective MAC addresses of each channel, so that the updated monitoring duration for acquiring the channel with the large number of the effective MAC addresses is longer than the monitoring duration for acquiring the channel with the small number of the effective MAC addresses;
for each channel after updating the monitoring duration, the wireless device switches to the (n + 1) th channel to continue monitoring after monitoring the monitoring duration corresponding to the nth channel in the nth channel, wherein n is all positive integers whose sampling times are not greater than M.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the updating, by the wireless device, the listening duration of the corresponding channel based on the number of valid MAC addresses of each channel includes:
the wireless device reduces a listening duration of a channel having a number of valid MAC addresses less than an address number threshold by (Y-Y) t2Y represents an address number threshold, Y represents the number of valid MAC addresses acquired in the channel, and t2 is a constant smaller than a preset listening duration.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the t2The listening duration for a channel with a number of valid MAC addresses of 0.
With reference to the first possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the address quantity threshold is a quantity of valid MAC addresses with a smallest quantity among a plurality of valid MAC addresses that are larger than an average value of the quantity of valid MAC addresses, or the address quantity threshold is a quantity of valid MAC addresses with a largest quantity among a plurality of valid MAC addresses that are smaller than the average value of the quantity of valid MAC addresses, where the average value of the quantity of valid MAC addresses is an average value of the quantity of valid MAC addresses of the M channels.
In the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution state of the number of the effective MAC addresses carried in the received beacon message on the channel during channel monitoring.
In a third aspect, an embodiment of the present invention provides a channel switching apparatus, including:
the channel switching module is used for switching to the (i + 1) th channel for continuous monitoring after the ith channel monitors the preset monitoring time, wherein i is all positive integers with the sampling times being not more than N, and N represents the total number of the channels and is a positive integer more than or equal to 1;
the channel analysis module is used for acquiring the number of beacon messages received in each channel monitored by the channel switching module;
and the updating module is used for updating the monitoring time of the corresponding channel based on the number of beacon messages of each channel acquired by the channel analysis module, so that the updated monitoring time for acquiring the channel with the large number of beacon messages is longer than the monitoring time for acquiring the channel with the small number of beacon messages.
The channel switching module is further configured to, for each channel after the update module updates the monitoring duration, switch the wireless device to the (j + 1) th channel to continue monitoring after the jth channel monitors the monitoring duration corresponding to the jth channel, where j is all positive integers whose number of times is not greater than N.
With reference to the third aspect, in a first possible implementation manner of the third aspect, the updating module, when updating the monitoring duration of the corresponding channel based on the number of beacon messages of each channel acquired by the channel analysis module, is specifically configured to:
reducing the monitoring time of the channel with the beacon message quantity less than the message threshold value by (R-R) × t1R represents a message threshold, R represents the number of beacon messages acquired in a channel, and t represents the number of beacon messages acquired in the channel1Is a constant less than the preset listening duration.
With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the updating module is further configured to update the monitoring duration of the channel with the beacon packet number of 0 to t1
With reference to the first possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the message threshold is the quantity of the beacon message with the smallest quantity among the multiple beacon message quantities that are greater than the average value of the message quantities, or the message threshold is the quantity of the beacon message with the largest quantity among the multiple beacon message quantities that are less than the average value of the message quantities, and the average value of the message quantities is the average value of the quantity of the beacon messages of the N channels.
With reference to the first possible implementation manner of the third aspect, in a fourth possible implementation manner of the third aspect, before the channel switching module monitors a monitoring duration corresponding to a jth channel in the jth channel, the updating module is further configured to:
and updating the monitoring time length corresponding to each channel after the monitoring time length is updated based on the number of effective MAC addresses carried in the message received by each channel aiming at each channel after the monitoring time length is updated by the updating module, wherein the number of the effective MAC addresses carried in the message received by each channel is obtained after the channel analysis module determines that the monitoring of the N channels is completed.
With reference to the fourth possible implementation manner of the third aspect, in a fifth possible implementation manner of the third aspect, when the monitoring duration corresponding to each channel after updating the monitoring duration is updated again based on the number of valid MAC addresses carried in the packet received by each channel, the updating module is specifically configured to:
determining the efficiency ratio of each channel, wherein the efficiency ratio is the ratio of the number of effective MAC addresses carried in messages received in the same channel to the number of obtained beacon messages;
increasing (Q/Q) t monitoring time after updating of channels of which the number of acquired beacon messages is less than the message threshold and the efficiency ratio is greater than the MAC address threshold1The Q represents an efficiency ratio of a corresponding channel, and the Q represents a MAC address threshold.
With reference to the fifth possible implementation manner of the third aspect, in a sixth possible implementation manner of the third aspect, the MAC address threshold is an efficiency ratio of a channel corresponding to a largest quantity of beacon messages among a plurality of beacon message quantities that are smaller than the message threshold, or the MAC address threshold is an efficiency ratio of a channel corresponding to a smallest quantity of beacon messages among a plurality of beacon message quantities that are larger than the message threshold.
With reference to the third aspect and any one possible implementation manner of the first to sixth possible implementation manners of the third aspect, in a seventh possible implementation manner of the third aspect, the updating module is further configured to update the listening duration of each channel to the preset listening duration after determining that the N channels are all listened to for T times.
In a fourth aspect, an embodiment of the present invention provides a channel switching apparatus, including:
the channel switching module is used for switching to the (M + 1) th channel for continuous monitoring after the M-th channel monitors the preset monitoring time, wherein M is all positive integers with the sampling times being not more than M, and M represents the total number of channels and is a positive integer more than or equal to 1;
the channel analysis module is used for acquiring the number of effective MAC addresses carried in the message received by each channel monitored by the channel switching module;
and the updating module is used for updating the monitoring duration of the corresponding channel based on the number of the effective MAC addresses of each channel acquired by the channel analysis module, so that the updated monitoring duration for acquiring the channel with the large number of the effective MAC addresses is longer than the monitoring duration for acquiring the channel with the small number of the effective MAC addresses.
The channel switching module is further configured to, for each channel after the update module updates the monitoring duration, switch to an n +1 th channel for continuing monitoring after the nth channel monitors the monitoring duration corresponding to the nth channel, where n is all positive integers whose sampling times are not greater than M.
With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the updating module, when updating the listening duration of the corresponding channel based on the number of valid MAC addresses of each channel acquired by the channel analysis module, is specifically configured to:
reducing the listening duration of channels having a number of valid MAC addresses less than an address number threshold by (Y-Y) t2Y represents an address number threshold, Y represents the number of valid MAC addresses acquired in the channel, and t2 is a constant smaller than a preset listening duration.
With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the channel analysis module is further configured to determine the address quantity threshold, where the address quantity threshold is a quantity of valid MAC addresses with a smallest quantity among a plurality of quantities of valid MAC addresses that are larger than an average value of the quantities of valid MAC addresses, or the address quantity threshold is a quantity of valid MAC addresses with a largest quantity among a plurality of quantities of valid MAC addresses that are smaller than the average value of the quantities of valid MAC addresses, and the average value of the quantities of valid MAC addresses is an average value of the quantities of valid MAC addresses of the M channels.
In the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution state of the beacon message on the channel and the distribution state of the acquired effective MAC address number on the channel during channel monitoring.
Drawings
Fig. 1 is a flowchart of a channel switching method according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for updating a channel monitoring duration according to an embodiment of the present invention;
fig. 3 is a flowchart of another method for updating a channel listening duration according to an embodiment of the present invention;
fig. 4 is a flowchart of another channel switching method according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for updating a channel monitoring duration according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a channel switching apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 8 is a schematic diagram of another channel switching apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a channel switching method and a channel switching device, which are used for solving the problems of low efficiency and time resource waste caused by adopting a timing cycle switching channel to monitor and acquire a wireless communication data packet in the prior art. The method and the device are based on the same inventive concept, and because the principles of solving the problems of the method and the device are similar, the implementation of the device and the method can be mutually referred, and repeated parts are not repeated.
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a channel switching method according to an embodiment of the present invention is shown, where the method specifically includes the following steps:
s101, after monitoring a preset monitoring time length on the ith channel, the wireless device switches to the (i + 1) th channel to continue monitoring, wherein i is all positive integers with the sampling times not greater than N, and N represents the total number of the channels and is a positive integer greater than or equal to 1.
And S102, the wireless equipment acquires the number of beacon messages received in each channel after determining that the N channels are monitored.
S103, the wireless equipment updates the monitoring time of the corresponding channel based on the number of beacon messages of each channel, so that the updated monitoring time of the channel with the large number of the beacon messages is longer than the monitoring time of the channel with the small number of the beacon messages.
And S104, aiming at each channel after the monitoring duration is updated, switching the wireless equipment to the j +1 th channel for continuous monitoring after the j th channel monitors the monitoring duration corresponding to the j th channel, wherein j is all positive integers with the sampling times not more than N.
In step S101, when the wireless device monitors a preset monitoring duration on the ith channel, the wireless device may start a monitoring mode by controlling the driver, start monitoring the wireless packet, and start a channel switching thread to monitor the number of beacon packets included in the wireless packet monitored by the driver.
Optionally, after determining that the N channels are monitored for T times, the wireless device updates the monitoring duration of each channel to the preset monitoring duration, and then executes steps S101 to S104.
Optionally, the monitoring durations of the N channels may be recorded in a channel switching scheduling time array, where the array length of the channel switching scheduling time array is N.
Optionally, the number of beacon messages acquired by each channel may be recorded in a beacon message statistical array, and the array length of the beacon message statistical array is N.
It should be noted that N takes different values based on the number of channels used in different countries. Taking the value of N in China and the United states when using a 2.4Ghz wireless network and a 5Ghz wireless network as an example: in china, 13 channels are used in a 2.4Ghz wireless network and 4 channels are used in a 5Ghz wireless network, so that the value of N is 13+ 4. In the united states, 11 channels are used in a 2.4Ghz wireless network and 12 channels are used in a 5Ghz wireless network, so that the value of N is 11+ 12.
In the embodiment of the invention, when the channel monitoring is carried out in the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution quantity of the beacon messages (beacon messages) on the channel.
In a possible implementation manner, the wireless device updates the monitoring duration of the corresponding channel based on the beacon packet number of each channel, which may be implemented in the following manner:
the wireless equipment reduces the monitoring time of the channel with the beacon message quantity less than the message threshold by (R-R) × t1R represents a message threshold, R represents the number of beacon messages acquired in a channel, and t represents the number of beacon messages acquired in the channel1Is a constant less than the preset listening duration.
By the mode, the monitoring time of the channel with the small beacon message quantity is shortened, so that unnecessary channel retention time is reduced, the MAC address acquisition efficiency is improved, and a large amount of time resources are saved.
The wireless device updates the monitoring duration of the corresponding channel based on the beacon packet number of each channel, which can be specifically implemented in the manner shown in fig. 2 or fig. 3.
Referring to fig. 2, a flowchart of a method for updating a channel listening duration according to an embodiment of the present invention is shown, where the method specifically includes the following steps:
s201, the wireless device determines a message threshold.
The message threshold value can be the minimum number of beacon messages in a plurality of beacon message numbers larger than the average number of messages, or the message threshold value can also be the maximum number of beacon messages in a plurality of beacon message numbers smaller than the average number of messages, and the average number of messages is the average number of beacon messages of the N channels. The message threshold may also be a preset value. Of course, the message threshold may also be determined in other manners, and the embodiment of the present invention is not particularly limited.
Taking the value of N as 5 as an example, after the wireless device monitors 5 channels for a preset monitoring duration, the wireless device counts the number of beacon messages of the 5 channels, and arranges the beacon messages in an order from small to large, where r1 is 1, r2 is 2, r3 is 2, r4 is 4, and r5 is 6. The wireless device determines a message threshold, where the message threshold is the number of beacon messages with the minimum difference value from the message average value among all beacon message numbers greater than the message average value, and if the message average value of 5 channels is 3, then r1, r2, r3, r4, r5 are sequentially compared with the message average value 3, the message threshold may be the first beacon message number r2 or r3 less than 3, or may be the first beacon message number r4 greater than 3.
S202, the wireless equipment judges whether the beacon message quantity of each channel is smaller than a message threshold value; if yes, go to S203; if not, go to S204
S203, the wireless device reduces the monitoring duration of the channels with the beacon message quantity smaller than the message threshold value by (R-R) × t1R represents a message threshold, R represents the number of beacon messages acquired in a channel, and t represents the number of beacon messages acquired in the channel1Is a constant less than the preset listening duration.
Wherein, t is1It can be configured as a unit time much shorter than the preset listening time. E.g. t1The preset monitoring duration may be 200ms, 250ms, 300ms, or the like, taking the value of 10ms or 20 ms.
S204, the wireless device does not modify the monitoring time of the channels with the beacon message number larger than or equal to the message threshold.
Optionally, the method may further include:
s205, thenThe wireless equipment updates the monitoring duration of the channel with the quantity of the beacon messages being 0 to t1
Optionally, in step S104, for each channel after updating the listening duration, before the wireless device listens to the listening duration corresponding to the jth channel in the jth channel, the method further includes:
and the wireless equipment updates the monitoring time length corresponding to each channel after the monitoring time length is updated based on the number of the effective MAC addresses carried in the message received by each channel, wherein the number of the effective MAC addresses carried in the message received by each channel is obtained after the wireless equipment determines that the monitoring on the N channels is completed.
It should be noted that the valid MAC address is a non-duplicate MAC address received by the channel in the corresponding listening duration, for example, channel 1 receives 50 MAC addresses in the corresponding listening duration, where 7 MAC addresses are duplicate, and therefore, the number of valid MAC addresses received by channel 1 is 43.
When the wireless device monitors the number of beacon messages included in the wireless messages monitored by the driver through the channel switching thread, the wireless device can also monitor the number of effective MAC addresses carried in the wireless messages.
Optionally, the number of effective MAC addresses of the N channels is recorded in an effective MAC address number statistic array, and the array length of the effective MAC address number statistic array is N.
In the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution state of the beacon message on the channel and the distribution state of the acquired effective MAC address number on the channel during channel monitoring.
In a possible implementation manner, the wireless device updates the monitoring duration corresponding to each channel after updating the monitoring duration based on the number of effective MAC addresses carried in the packet received in each channel, and may implement the following steps:
the wireless equipment determines the efficiency ratio of each channel, wherein the efficiency ratio is the ratio of the number of effective MAC addresses carried in messages received in the same channel to the number of obtained beacon messages;
the wireless device increases the monitoring time length after updating of the channel with the acquired beacon message quantity smaller than the message threshold value and the efficiency ratio larger than the MAC address threshold value by (Q/Q) × t1The Q represents an efficiency ratio of a corresponding channel, and the Q represents a MAC address threshold.
Referring to fig. 3, a flowchart of another method for updating a channel listening duration according to an embodiment of the present invention is shown, where the method specifically includes the following steps:
s301, the wireless device determines a message threshold.
S302, the wireless equipment judges whether the beacon message quantity of each channel is less than a message threshold value; if yes, executing S303; if not, go to S304
S303, the wireless device reduces the monitoring time of the channels with the beacon message quantity less than the message threshold value by (R-R) × t1R represents a message threshold, R represents the number of beacon messages acquired in a channel, and t represents the number of beacon messages acquired in the channel1Is a constant less than the preset listening duration.
S304, the wireless device does not modify the monitoring time of the channel with the beacon message number larger than or equal to the message threshold.
Optionally, the method may further include:
s305, the wireless device updates the monitoring duration of the channel with the beacon message quantity of 0 to t1
S306, the wireless device determines a MAC address threshold.
Optionally, the MAC address threshold may be smaller than an efficiency ratio of a channel corresponding to a largest number of beacon messages among a plurality of beacon message numbers of the message threshold, or may be larger than the efficiency ratio of the channel corresponding to the smallest number of beacon messages among the plurality of beacon message numbers of the message threshold. The MAC address threshold may also be a preset value. Of course, the MAC address threshold may also be determined in other manners, and the embodiment of the present invention is not limited in particular.
S307, the wireless device determines an efficiency ratio of each channel.
S308, the wireless equipment judges whether the efficiency ratio of the channel is greater than the MAC address threshold value, wherein the efficiency ratio is the ratio of the number of effective MAC addresses of the channel to the number of beacon messages; if yes, go to S309; if not, go to step S310.
S309, the wireless device increases the efficiency by (Q/Q) t the updated listening duration of the channel with the efficiency greater than the MAC address threshold1The Q represents an efficiency ratio of a corresponding channel, and the Q represents a MAC address threshold.
S310, the wireless device does not modify the monitoring duration of the channel with the efficiency ratio less than or equal to the MAC address threshold.
Referring to fig. 4, a flowchart of another channel switching method provided in the embodiment of the present invention is shown, where the method specifically includes the following steps:
s401, after monitoring a preset monitoring time length on the mth channel, the wireless device switches to the (M + 1) th channel to continue monitoring, wherein M is all positive integers with the sampling times not greater than M, and M represents the total number of channels and is a positive integer greater than or equal to 1.
S402, the wireless device acquires the number of effective MAC addresses carried in the message received by each channel after determining that the M channels are monitored.
S403, the wireless device updates the monitoring duration of the corresponding channel based on the number of the effective MAC addresses of each channel.
S404, aiming at each channel after updating the monitoring time length, the wireless device switches to the (n + 1) th channel to continue monitoring after the monitoring time length corresponding to the nth channel is monitored by the nth channel, wherein n is all positive integers with the sampling time length not more than M.
In a possible implementation manner, the wireless device updates the listening duration of the corresponding channel based on the number of valid MAC addresses of each channel, which may be implemented as follows:
the wireless device reduces a listening duration of a channel having a number of valid MAC addresses less than an address number threshold by (Y-Y) t2Y represents an address number threshold, Y represents the number of valid MAC addresses acquired in the channel, and t2 is a constant smaller than a preset listening duration.
Wherein, t is2It can be configured as a unit time much shorter than the preset listening time. E.g. t2The preset monitoring duration may be 200ms, 250ms, 300ms, or the like, taking the value of 10ms or 20 ms.
In step S403, the wireless device updates the listening time duration of the corresponding channel based on the number of the effective MAC addresses of each channel, specifically referring to fig. 5, which is a flowchart of a method for updating the listening time duration of the channel according to the embodiment of the present invention, specifically including the following steps:
s501, the wireless device determines an address number threshold.
The threshold value of the number of addresses is the number of effective MAC addresses with the smallest number among a plurality of effective MAC addresses larger than the average value of the number of effective MAC addresses, or the threshold value of the number of addresses is the number of effective MAC addresses with the largest number among a plurality of effective MAC addresses smaller than the average value of the number of effective MAC addresses, where the average value of the number of effective MAC addresses is the average value of the number of effective MAC addresses of the M channels. The message threshold may also be a preset value. Of course, the message threshold may also be determined in other manners, and the embodiment of the present invention is not particularly limited.
Taking the value of M as 5 as an example, after the wireless device monitors 5 channels for a preset monitoring duration, the wireless device counts the number of effective MAC addresses of the 5 channels, and arranges the effective MAC addresses in a descending order as q1 ═ 1, q2 ═ 2, q3 ═ 2, q4 ═ 4, and q5 ═ 6. The wireless device determines an address number threshold, where the address number threshold is an effective MAC address number with a smallest difference value with a message average value among all effective MAC address numbers larger than an effective MAC address number average value, and if the effective MAC address number average value of the 5 channels is 3, sequentially comparing q1, q2, q3, q4, and q5 with the effective MAC address number average value 3, where the address number threshold is a first effective MAC address number q2 or q3 larger than 3, and may also be a first effective MAC address number q4 smaller than 3.
S502, the wireless device judges whether the number of effective MAC addresses of each channel is less than an address number threshold value; if yes, go to S503; if not, executing S504
S503, the wireless device reduces the monitoring duration of the channels with the effective MAC address number smaller than the address number threshold value by (Y-Y) × t2Y represents an address number threshold, Y represents the number of valid MAC addresses acquired in the channel, and t2 is a constant smaller than a preset listening duration.
S504, the wireless device does not modify the monitoring duration of the channels with the effective MAC address number larger than or equal to the address number threshold.
Optionally, the method may further include:
s505, the wireless device updates the monitoring duration of the channel with the effective MAC address number of 0 to t2
In the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution state of the number of the effective MAC addresses carried in the received beacon message on the channel during channel monitoring.
Based on the same inventive concept as the method embodiment corresponding to fig. 1, an embodiment of the present invention provides a channel switching apparatus 10, which has a structure as shown in fig. 6 and includes a channel switching module 11, a channel analyzing module 12, and an updating module 13, wherein:
the channel switching module 11 is configured to switch to the (i + 1) th channel to continue monitoring after the ith channel monitors a preset monitoring duration, where i is all positive integers whose number is not greater than N, and N represents the total number of channels and is a positive integer greater than or equal to 1;
the channel analysis module 12 is configured to obtain the number of beacon messages received in each channel, which is monitored by the channel switching module;
and the updating module 13 is configured to update the monitoring duration of the corresponding channel based on the number of beacon messages of each channel acquired by the channel analysis module, so that the updated monitoring duration of the channel with the large number of beacon messages is longer than the monitoring duration of the channel with the small number of beacon messages.
The channel switching module is further configured to, for each channel after the update module updates the monitoring duration, switch the wireless device to the (j + 1) th channel to continue monitoring after the jth channel monitors the monitoring duration corresponding to the jth channel, where j is all positive integers whose number of times is not greater than N.
Specifically, the updating module, when updating the monitoring duration of the corresponding channel based on the number of beacon messages of each channel acquired by the channel analysis module, is specifically configured to:
reducing the monitoring time of the channel with the beacon message quantity less than the message threshold value by (R-R) × t1R represents a message threshold, R represents the number of beacon messages acquired in a channel, and t represents the number of beacon messages acquired in the channel1Is a constant less than the preset listening duration.
Optionally, the updating module is further configured to update the monitoring duration of the channel with the beacon packet number of 0 to t1
Optionally, the message threshold is the quantity of beacon messages with the minimum quantity in a plurality of beacon message quantities greater than the average value of the message quantity, or the message threshold is the quantity of beacon messages with the maximum quantity in a plurality of beacon message quantities less than the average value of the message quantity, and the average value of the message quantity is the average value of the quantity of beacon messages of the N channels.
The message threshold may be determined by the channel analysis module, or a numerical value may be preset as the message threshold, which is not specifically limited in the embodiment of the present invention.
Optionally, before the channel switching module monitors the monitoring duration corresponding to the jth channel in the jth channel, the updating module is further configured to:
and updating the monitoring time length corresponding to each channel after the monitoring time length is updated based on the number of effective MAC addresses carried in the message received by each channel aiming at each channel after the monitoring time length is updated by the updating module, wherein the number of the effective MAC addresses carried in the message received by each channel is obtained after the channel analysis module determines that the monitoring of the N channels is completed.
Specifically, when the monitoring duration corresponding to each channel after updating the monitoring duration is updated again based on the number of the effective MAC addresses carried in the packet received by each channel, the update module is specifically configured to:
determining the efficiency ratio of each channel, wherein the efficiency ratio is the ratio of the number of effective MAC addresses carried in messages received in the same channel to the number of obtained beacon messages;
increasing (Q/Q) t monitoring time after updating of channels of which the number of acquired beacon messages is less than the message threshold and the efficiency ratio is greater than the MAC address threshold1The Q represents an efficiency ratio of a corresponding channel, and the Q represents a MAC address threshold.
Optionally, the MAC address threshold is smaller than an efficiency ratio of a channel corresponding to a largest quantity of beacon messages among the plurality of beacon message quantities of the message threshold, or the MAC address threshold is larger than the efficiency ratio of the channel corresponding to the smallest quantity of beacon messages among the plurality of beacon message quantities of the message threshold.
The MAC address threshold may be determined by the channel analysis module, or a numerical value may be preset as the MAC address threshold, which is not specifically limited in the embodiment of the present invention.
Optionally, the updating module is further configured to update the monitoring duration of each channel to the preset monitoring duration after determining that the N channels are monitored for T times.
The division of the modules in the embodiments of the present application is schematic, and only one logical function division is provided, and in actual implementation, there may be another division manner, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, may also exist alone physically, or may also be integrated in one module by two or more modules. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
When the integrated module may be implemented in a hardware form, as shown in fig. 7, the integrated module may include a transceiver 701, a processor 702, and a memory 703. The physical hardware corresponding to the channel switching module 11, the channel analyzing module 12 and the updating module 13 may be the processor 702. The processor 702 may be a Central Processing Unit (CPU), a digital processing unit, or the like. The processor 702 collects beacon messages through the transceiver 701. A memory 703 for storing programs executed by the processor 702.
The specific connection medium among the transceiver 701, the processor 702, and the memory 703 is not limited in this embodiment. In the embodiment of the present application, the memory 703, the processor 702, and the transceiver 701 are connected by the bus 704 in fig. 7, the bus is represented by a thick line in fig. 7, and the connection manner between other components is merely illustrative and not limited. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
The memory 703 may be a volatile memory (RAM), such as a random-access memory (RAM); the memory 703 may also be a non-volatile memory (non-volatile memory), such as a read-only memory (ROM), a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD), or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory 703 may be a combination of the above memories.
The processor 702 is configured to execute the program code stored in the memory 703, and is specifically configured to execute the method according to the embodiment corresponding to fig. 2 or fig. 3, which may be specifically implemented with reference to the embodiment corresponding to fig. 2 or fig. 3, and is not described herein again.
The preferred embodiments described herein are only for illustrating and explaining the present invention and are not intended to limit the present invention, and the embodiments and functional blocks in the embodiments may be combined with each other in the present application without conflict.
In the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution state of the beacon message on the channel and the distribution state of the acquired effective MAC address number on the channel during channel monitoring.
Based on the same inventive concept as the method embodiment corresponding to fig. 4, the embodiment of the present invention provides a channel switching apparatus 20, which has a structure as shown in fig. 8 and includes a channel switching module 21, a channel analyzing module 22, and an updating module 23, wherein:
the channel switching module 21 is configured to switch to the (M + 1) th channel for continuing monitoring after the mth channel monitors a preset monitoring duration, where M is all positive integers whose number is not greater than M, and M represents the total number of channels and is a positive integer greater than or equal to 1;
a channel analysis module 22, configured to obtain the number of effective MAC addresses carried in the message received in each channel, which is monitored by the channel switching module;
an updating module 23, configured to update the monitoring duration of the corresponding channel based on the number of the effective MAC addresses of each channel acquired by the channel analysis module, so that the updated monitoring duration for acquiring a channel with a large number of the effective MAC addresses is longer than the monitoring duration for acquiring a channel with a small number of the effective MAC addresses.
The channel switching module is further configured to, for each channel after the update module updates the monitoring duration, switch to an n +1 th channel for continuing monitoring after the nth channel monitors the monitoring duration corresponding to the nth channel, where n is all positive integers whose sampling times are not greater than M.
Specifically, the updating module, when updating the monitoring duration of the corresponding channel based on the number of the effective MAC addresses of each channel acquired by the channel analysis module, is specifically configured to:
reducing the listening duration of channels having a number of valid MAC addresses less than an address number threshold by (Y-Y) t2Y represents an address number threshold, Y represents the number of valid MAC addresses acquired in the channel, and t2 is a constant smaller than a preset listening duration.
Optionally, the address number threshold is the number of the least effective MAC addresses among the number of the plurality of effective MAC addresses greater than the average value of the number of effective MAC addresses, or the address number threshold is the number of the most effective MAC addresses among the number of the plurality of effective MAC addresses less than the average value of the number of effective MAC addresses, where the average value of the number of effective MAC addresses is the average value of the number of effective MAC addresses of the M channels.
The address number threshold may be determined by the channel analysis module, or a numerical value may be preset as the address number threshold, which is not specifically limited in the embodiment of the present invention.
In the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution state of the number of the effective MAC addresses carried in the received beacon message on the channel during channel monitoring.
The division of the modules in the embodiments of the present application is schematic, and only one logical function division is provided, and in actual implementation, there may be another division manner, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, may also exist alone physically, or may also be integrated in one module by two or more modules. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
When the integrated module can be implemented in the form of hardware, as shown in fig. 9, the integrated module may include a transceiver 901, a processor 902, and a memory 903. The physical hardware corresponding to the channel switching module 21, the channel analyzing module 22 and the updating module 23 may be the processor 902. The processor 902 may be a CPU, or a digital processing unit, etc. The processor 902 collects beacon messages through the transceiver 901. A memory 903 for storing programs executed by the processor 902.
The specific connection medium among the transceiver 901, the processor 902 and the memory 903 is not limited in the embodiments of the present application. In the embodiment of the present application, the memory 903, the processor 902, and the transceiver 901 are connected by the bus 904 in fig. 9, the bus is represented by a thick line in fig. 9, and the connection manner between other components is merely illustrative and is not limited. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The memory 903 may be a volatile memory such as RAM; the memory 903 may also be a non-volatile memory such as a ROM, a flash memory, a HDD or an SSD, or the memory 903 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory 903 may be a combination of the above memories.
The processor 902 is configured to execute the program code stored in the memory 903, and is specifically configured to execute the method according to the embodiment corresponding to fig. 5, which may be specifically implemented with reference to the embodiment corresponding to fig. 5, and is not described herein again.
In the process of acquiring the MAC address, the monitoring duration of each channel is adjusted according to the distribution state of the number of the effective MAC addresses carried in the received beacon message on the channel during channel monitoring.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (20)

1. A method for channel switching, comprising:
after monitoring a preset monitoring time length on the ith channel, the wireless equipment is switched to the (i + 1) th channel to continue monitoring, wherein i is all positive integers with the sampling times not more than N, and N represents the total number of the channels and is a positive integer more than or equal to 1;
the wireless equipment acquires the number of beacon messages received in each channel after determining that the N channels are monitored;
the wireless equipment updates the monitoring time of the corresponding channel based on the number of beacon messages of each channel, so that the updated monitoring time of the channel with the large number of the beacon messages is longer than the monitoring time of the channel with the small number of the beacon messages;
for each channel after updating the monitoring duration, the wireless device switches to the j +1 th channel to continue monitoring after monitoring the monitoring duration corresponding to the j channel in the j channel, wherein j is all positive integers of which the number of times of taking is not more than N;
for each channel after updating the monitoring duration, before the wireless device monitors the monitoring duration corresponding to the jth channel in the jth channel, the method further includes:
and the wireless equipment updates the monitoring time length corresponding to each channel after the monitoring time length is updated based on the number of the effective MAC addresses carried in the message received by each channel, wherein the number of the effective MAC addresses carried in the message received by each channel is obtained after the wireless equipment determines that the monitoring on the N channels is completed.
2. The method of claim 1, wherein the wireless device updating the listening duration of the corresponding channel based on the beacon packet number of each channel comprises:
the wireless equipment reduces the monitoring time of the channel with the beacon message quantity less than the message threshold by (R-R) × t1R represents a message threshold, R represents the number of beacon messages acquired in a channel, and t represents the number of beacon messages acquired in the channel1Is a constant less than the preset listening duration.
3. The method of claim 2, wherein t is1And monitoring the channel with beacon message quantity of 0.
4. The method according to claim 2, wherein the message threshold is the smallest number of beacon messages among a plurality of beacon message numbers greater than an average number of messages, or the largest number of beacon message numbers less than the average number of messages, and the average number of message numbers is the average number of beacon message numbers of the N channels.
5. The method of claim 1, wherein the wireless device updates the monitoring duration corresponding to each channel after updating the monitoring duration based on the number of valid MAC addresses carried in the packet received in each channel, and the updating comprises:
the wireless equipment determines the efficiency ratio of each channel, wherein the efficiency ratio is the ratio of the number of effective MAC addresses carried in messages received in the same channel to the number of obtained beacon messages;
the wireless device increases the monitoring time length after updating of the channel with the acquired beacon message quantity smaller than the message threshold value and the efficiency ratio larger than the MAC address threshold value by (Q/Q) × t1The Q represents an efficiency ratio of a corresponding channel, and the Q represents a MAC address threshold.
6. The method as claimed in claim 5, wherein the MAC address threshold is an efficiency ratio of a channel corresponding to a largest number of beacon messages among a plurality of beacon message numbers smaller than the message threshold, or the MAC address threshold is an efficiency ratio of a channel corresponding to a smallest number of beacon message numbers among a plurality of beacon message numbers larger than the message threshold.
7. The method of any of claims 1-6, further comprising:
and after the wireless equipment determines that the N channels are monitored for T times, updating the monitoring time of each channel to the preset monitoring time.
8. A method for channel switching, comprising:
after monitoring a preset monitoring time length on an mth channel, the wireless equipment is switched to an M +1 th channel to continue monitoring, wherein M is all positive integers with the sampling times being not more than M, and M represents the total number of the channels and is a positive integer more than or equal to 1;
the wireless equipment acquires the number of effective MAC addresses carried in the message received by each channel after determining that the M channels are monitored;
the wireless equipment updates the monitoring duration of the corresponding channel based on the number of the effective MAC addresses of each channel, so that the updated monitoring duration for acquiring the channel with the large number of the effective MAC addresses is longer than the monitoring duration for acquiring the channel with the small number of the effective MAC addresses;
for each channel after updating the monitoring duration, the wireless device switches to the (n + 1) th channel to continue monitoring after monitoring the monitoring duration corresponding to the nth channel in the nth channel, wherein n is all positive integers whose sampling times are not greater than M.
9. The method of claim 8, wherein the wireless device updating the listening duration for the corresponding channel based on the number of valid MAC addresses per channel comprises:
the wireless device reduces a listening duration of a channel having a number of valid MAC addresses less than an address number threshold by (Y-Y) t2Y represents an address number threshold, Y represents the number of valid MAC addresses acquired in the channel, and t2 is a constant smaller than a preset listening duration.
10. The method of claim 9 wherein the address number threshold is a minimum number of valid MAC addresses from a plurality of valid MAC addresses greater than an average number of valid MAC addresses, or the address number threshold is a maximum number of valid MAC addresses from a plurality of valid MAC addresses less than an average number of valid MAC addresses, the average number of valid MAC addresses being an average number of valid MAC addresses for the M channels.
11. A channel switching apparatus, comprising:
the channel switching module is used for switching to the (i + 1) th channel for continuous monitoring after the ith channel monitors the preset monitoring time, wherein i is all positive integers with the sampling times being not more than N, and N represents the total number of the channels and is a positive integer more than or equal to 1;
the channel analysis module is used for acquiring the number of beacon messages received in each channel monitored by the channel switching module;
the updating module is used for updating the monitoring time of the corresponding channel based on the number of beacon messages of each channel acquired by the channel analysis module, so that the updated monitoring time of the channel with the large number of the acquired beacon messages is longer than the monitoring time of the channel with the small number of the acquired beacon messages;
the channel switching module is further configured to, for each channel after the update module updates the monitoring duration, switch the wireless device to a (j + 1) th channel for continuing monitoring after the jth channel monitors the monitoring duration corresponding to the jth channel, where j is all positive integers whose number of times is not greater than N;
the updating module, before the channel switching module monitors the monitoring duration corresponding to the jth channel in the jth channel, is further configured to:
and updating the monitoring time length corresponding to each channel after the monitoring time length is updated based on the number of effective MAC addresses carried in the message received by each channel aiming at each channel after the monitoring time length is updated by the updating module, wherein the number of the effective MAC addresses carried in the message received by each channel is obtained after the channel analysis module determines that the monitoring of the N channels is completed.
12. The apparatus of claim 11, wherein the updating module, when updating the listening duration of the corresponding channel based on the number of beacon packets of each channel acquired by the channel analysis module, is specifically configured to:
reducing the monitoring time of the channel with the beacon message quantity less than the message threshold value by (R-R) × t1R represents a message threshold, R represents the number of beacon messages acquired in a channel, and t represents the number of beacon messages acquired in the channel1Is a constant less than the preset listening duration.
13. The apparatus of claim 12, wherein the updating module is further configured to update the listening duration of the channel with the beacon packet number of 0 to t1
14. The apparatus of claim 12, wherein the packet threshold is the smallest number of beacon packets among a plurality of beacon packets greater than the average number of packets, or the largest number of beacon packets among a plurality of beacon packets less than the average number of packets, and the average number of packets is the average number of beacon packets of the N channels.
15. The apparatus of claim 11, wherein the updating module, when updating the listening duration corresponding to each channel after updating the listening duration based on the number of valid MAC addresses carried in the packet received in each channel, is specifically configured to:
determining the efficiency ratio of each channel, wherein the efficiency ratio is the ratio of the number of effective MAC addresses carried in messages received in the same channel to the number of obtained beacon messages;
increasing (Q/Q) t monitoring time after updating of channels of which the number of acquired beacon messages is less than the message threshold and the efficiency ratio is greater than the MAC address threshold1The Q represents an efficiency ratio of a corresponding channel, and the Q represents a MAC address threshold.
16. The apparatus of claim 15, wherein the MAC address threshold is an efficiency ratio of a channel corresponding to a largest number of beacon packets among a plurality of beacon packet numbers smaller than the packet threshold, or the MAC address threshold is an efficiency ratio of a channel corresponding to a smallest number of beacon packet among a plurality of beacon packet numbers larger than the packet threshold.
17. The apparatus according to any of claims 11-16, wherein the updating module is further configured to update the listening time duration of each channel to the preset listening time duration after determining to listen on all of the N channels for T times.
18. A channel switching apparatus, comprising:
the channel switching module is used for switching to the (M + 1) th channel for continuous monitoring after the M-th channel monitors the preset monitoring time, wherein M is all positive integers with the sampling times being not more than M, and M represents the total number of channels and is a positive integer more than or equal to 1;
the channel analysis module is used for acquiring the number of effective MAC addresses carried in the message received by each channel monitored by the channel switching module;
the updating module is used for updating the monitoring duration of the corresponding channel based on the number of the effective MAC addresses of each channel acquired by the channel analysis module, so that the updated monitoring duration for acquiring the channel with the large number of the effective MAC addresses is longer than the monitoring duration for acquiring the channel with the small number of the effective MAC addresses;
the channel switching module is further configured to, for each channel after the update module updates the monitoring duration, switch to an n +1 th channel for continuing monitoring after the nth channel monitors the monitoring duration corresponding to the nth channel, where n is all positive integers whose sampling times are not greater than M.
19. The apparatus according to claim 18, wherein the updating module, when updating the listening duration of the corresponding channel based on the number of valid MAC addresses of each channel acquired by the channel analyzing module, is specifically configured to:
reducing the listening duration of channels having a number of valid MAC addresses less than an address number threshold by (Y-Y) t2Y represents an address number threshold, Y represents the number of valid MAC addresses acquired in the channel, and t2 is a constant smaller than a preset listening duration.
20. The apparatus of claim 19 wherein the address number threshold is a minimum number of valid MAC addresses from among a plurality of valid MAC addresses greater than an average number of valid MAC addresses, or the address number threshold is a maximum number of valid MAC addresses from among a plurality of valid MAC addresses less than an average number of valid MAC addresses, the average number of valid MAC addresses being an average number of valid MAC addresses for the M channels.
CN201611187153.7A 2016-12-20 2016-12-20 Channel switching method and device Active CN106714258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611187153.7A CN106714258B (en) 2016-12-20 2016-12-20 Channel switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611187153.7A CN106714258B (en) 2016-12-20 2016-12-20 Channel switching method and device

Publications (2)

Publication Number Publication Date
CN106714258A CN106714258A (en) 2017-05-24
CN106714258B true CN106714258B (en) 2020-05-26

Family

ID=58939522

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611187153.7A Active CN106714258B (en) 2016-12-20 2016-12-20 Channel switching method and device

Country Status (1)

Country Link
CN (1) CN106714258B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602712B (en) * 2019-08-13 2022-02-15 北京大学 Frequency point switching anti-interference wireless local area network communication method and device
CN113055928B (en) * 2021-02-04 2023-05-12 浙江大华技术股份有限公司 Channel management method, data communication method, device and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101299687A (en) * 2008-05-07 2008-11-05 中国联合通信有限公司 Method and system for measuring available bandwidth of wireless LAN
CN101662796A (en) * 2009-09-08 2010-03-03 杭州华三通信技术有限公司 Method and device for scanning wireless local area network (LAN) channels
CN104363599A (en) * 2014-11-26 2015-02-18 北京邮电大学 Method and device applied to permission-free frequency band multi-system coexisting
CN104469914A (en) * 2014-12-10 2015-03-25 宇龙计算机通信科技(深圳)有限公司 Channel detection method and system, base station and terminal
CN104641677A (en) * 2013-04-03 2015-05-20 华为技术有限公司 Method and apparatus for monitoring physical broadcast channel
CN104703210A (en) * 2015-03-23 2015-06-10 北京邮电大学 Method of interference rejection and information transmission in heterogeneous network
CN105338551A (en) * 2015-09-25 2016-02-17 联想(北京)有限公司 Channel monitoring method and device and electronic device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006121276A (en) * 2004-10-20 2006-05-11 Matsushita Electric Ind Co Ltd Wireless terminal
CN101631007B (en) * 2008-07-14 2013-06-05 电信科学技术研究院 Method, device and system for transmitting data
CN101662841A (en) * 2009-09-15 2010-03-03 江苏大学 WSN MAC protocol based on bidirectional curve traffic command system
CN102802236B (en) * 2012-08-03 2015-06-17 杭州华三通信技术有限公司 Method for scanning wireless network, and device for realizing thereof

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101299687A (en) * 2008-05-07 2008-11-05 中国联合通信有限公司 Method and system for measuring available bandwidth of wireless LAN
CN101662796A (en) * 2009-09-08 2010-03-03 杭州华三通信技术有限公司 Method and device for scanning wireless local area network (LAN) channels
CN104641677A (en) * 2013-04-03 2015-05-20 华为技术有限公司 Method and apparatus for monitoring physical broadcast channel
CN104363599A (en) * 2014-11-26 2015-02-18 北京邮电大学 Method and device applied to permission-free frequency band multi-system coexisting
CN104469914A (en) * 2014-12-10 2015-03-25 宇龙计算机通信科技(深圳)有限公司 Channel detection method and system, base station and terminal
CN104703210A (en) * 2015-03-23 2015-06-10 北京邮电大学 Method of interference rejection and information transmission in heterogeneous network
CN105338551A (en) * 2015-09-25 2016-02-17 联想(北京)有限公司 Channel monitoring method and device and electronic device

Also Published As

Publication number Publication date
CN106714258A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
AU2013259165B2 (en) Method to identify and differentiate background traffic
CN105578573A (en) Authorized frequency band channel occupation time configuration method and device
EP3678425B1 (en) Data transmission method and related device
CN107509201A (en) More Subscriber Identity Module devices, its chip and the method with its reception paging signal
CN105636087B (en) Method and device for distributing network configuration parameters
CN108513342B (en) Scheduling method of Internet of things terminal, base station and Internet of things terminal
CN103220752A (en) Method for equipment network access, access point, network access equipment and system
CN105794299B (en) Method for allocating resources and user equipment
CN111436096A (en) Method and device for sending packet wake-up signal
CN106714258B (en) Channel switching method and device
CN103200680B (en) Paging method, core network element, access network elements and terminal equipment
CN107920388B (en) Terminal paging method and device
EP2925072A1 (en) Node scheduling method, device and system
EP2999285B1 (en) Method for transmitting signal in device to device proximity service, base station and user equipment
CN108199809A (en) A kind of method for transmitting information, base station and user equipment
CN107548121B (en) Method and device for determining access network
CN105472570A (en) Base station/terminal and PDCCH scrambling/descrambling method and device thereof
WO2012062169A1 (en) Method, device and system for broadcasting and receiving system information
CN107548019B (en) Method and device for processing network beacon in wireless sensor network
EP3457781B1 (en) System information transmitting and receiving methods and devices
CN106888485B (en) CSFB terminal access method, system message SI2_ quater sending method and device
CN106550473B (en) Service scheduling method and device
CN106034346B (en) Information processing method and electronic equipment
CN108650049B (en) Channel detection method, device and base station
CN107005938A (en) A kind of method and device of reception group business datum

Legal Events

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