CN110621028B - Network distribution method, network distribution device and electronic equipment - Google Patents

Network distribution method, network distribution device and electronic equipment Download PDF

Info

Publication number
CN110621028B
CN110621028B CN201910491751.0A CN201910491751A CN110621028B CN 110621028 B CN110621028 B CN 110621028B CN 201910491751 A CN201910491751 A CN 201910491751A CN 110621028 B CN110621028 B CN 110621028B
Authority
CN
China
Prior art keywords
channel
current channel
monitored
time
data packet
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
CN201910491751.0A
Other languages
Chinese (zh)
Other versions
CN110621028A (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.)
Allwinner Technology Co Ltd
Original Assignee
Allwinner 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 Allwinner Technology Co Ltd filed Critical Allwinner Technology Co Ltd
Priority to CN201910491751.0A priority Critical patent/CN110621028B/en
Publication of CN110621028A publication Critical patent/CN110621028A/en
Application granted granted Critical
Publication of CN110621028B publication Critical patent/CN110621028B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a network distribution method, a network distribution device and electronic equipment, wherein the method comprises the following steps: the electronic equipment starts a promiscuous mode; the method comprises the steps that the electronic equipment monitors a plurality of channels, whether a channel locking data packet is monitored in a first retention time preset on the current channel is judged, if yes, the channel locking data packet is used for locking the channel and staying on the locked channel to obtain distribution network information, and if not, the AP existence condition on the current channel is determined; and when the preset time is executed and the channel is not locked, the electronic equipment monitors a plurality of channels, judges whether a channel locking data packet is monitored in the second retention time of the current channel, and locks the channel and retains the locked channel by using the channel locking data packet to acquire the distribution network information if the channel locking data packet is monitored in the second retention time of the current channel, wherein the second retention time of the current channel is determined according to the existence condition of the AP on the current channel. The invention is beneficial to reducing the time of the distribution network and improving the efficiency of the distribution network.

Description

Network distribution method, network distribution device and electronic equipment
Technical Field
The invention relates to the technical field of network communication, in particular to a network distribution method, a network distribution device and electronic equipment.
Background
At present, internet of things equipment based on WiFi is used more and more, and all have networking requirements, however, generally such equipment does not carry a screen or a key for human-computer interaction, and therefore a user cannot directly set distribution network information (namely SSID and PSK of a wireless access point AP to be connected) for network equipment to be distributed in a manual input mode, so that the network equipment to be distributed must be used for acquiring the distribution network information in a wireless distribution network or other auxiliary modes, and the current main adopted mode is as follows:
firstly, controlling a device to be distributed in a hybrid mode (monitoring mode), monitoring a data packet in a wireless network, encoding distribution network information into a UDP (user datagram protocol) message by a user through an intelligent terminal (such as a mobile phone), sending the distribution network information through a broadcast packet or a multicast packet, receiving the UDP message sent by the intelligent terminal or forwarded by a router by the device to be distributed, decoding the UDP message to obtain correct distribution network information, and connecting the network information to a target AP (such as a router) according to the distribution network information, wherein in order to receive the UDP message, the device to be distributed generally needs to traverse all channels, and stay on each channel for a certain time to receive the data packet, wherein the data packet is generally divided into two types, one type is a channel locking data packet, and the other type is a distribution network information data packet containing the distribution network information.
At present, in the process of traversing all channels, the monitoring dwell time of each channel (i.e., the time for continuously monitoring a certain channel) is fixed and the same, but in an actual situation, because the number of APs on different channels is usually different, the actually required monitoring dwell time may also be different, and when all channels need to be traversed for multiple times, if the fixed monitoring dwell time manner is adopted for traversing all channels every time, a long time waste is easily caused, which is not favorable for improving the distribution network efficiency.
Disclosure of Invention
Based on the current situation, the invention mainly aims to provide a network distribution method, a network distribution device and electronic equipment, which are beneficial to reducing the network distribution time and improving the network distribution efficiency.
In order to achieve the above object, a technical solution of the present invention provides a network distribution method applied to an electronic device, where the method includes:
step S1: the electronic equipment starts a promiscuous mode to monitor a wireless network data packet;
step S2: the method comprises the steps that the electronic equipment monitors a plurality of channels in sequence according to a first preset sequence, when each channel is monitored, whether a channel locking data packet is monitored in a first retention time preset on the current channel or not is judged, if yes, the channel locking data packet is used for locking the channel and staying on the locked channel to obtain distribution network information, a target AP is connected according to the obtained distribution network information, if not, the existence condition of the AP on the current channel is determined by using a beacon frame and a detection response frame monitored in the first retention time on the current channel, and monitoring on the next channel is started according to the first preset sequence;
when the step S2 is executed for the preset time and the channel is not locked, the step S3 is started to be executed;
and step S3: the electronic equipment monitors the plurality of channels in sequence according to a second preset sequence, judges whether a channel locking data packet is monitored in second residence time on the current channel or not when each channel is monitored, locks the channel and stays on the locked channel by using the channel locking data packet to acquire distribution network information if the channel locking data packet is monitored in the second residence time on the current channel, connects a target AP according to the acquired distribution network information, and starts to monitor the next channel according to the second preset sequence if the channel locking data packet is not monitored in the second residence time on the current channel, wherein the second residence time of the current channel is determined according to the existence condition of the AP on the current channel.
Further, the AP presence includes whether an AP is present, wherein step S2 includes:
step A1: starting a timer when monitoring a current channel is started, extracting a configuration channel of an AP and an MAC address of the AP from a monitored beacon frame or a detected response frame when the beacon frame or the detected response frame is monitored before the channel is unlocked and the timer reaches a first dwell time, associating the configuration channel of the AP extracted from the same beacon frame or the detected response frame with the MAC address of the AP, and recording;
step A2: when the channel is not locked and the timer reaches the first retention time, whether the MAC address associated with the current channel exists in the currently recorded information or not is judged, if yes, the current channel is confirmed to have the AP, and the timer is initialized.
Further, in step A2, if it is determined that the MAC address associated with the current channel does not exist in the currently recorded information, it is determined that the AP does not exist in the current channel, and the timer is initialized.
Further, the AP presence includes whether an AP is present, wherein the determining the second stay time of the current channel according to the AP presence on the current channel includes:
and if the AP does not exist on the current channel, determining that the second staying time is a second time value, wherein the first time value is greater than the second time value.
Further, the first time value is 100ms-400ms, preferably 200ms; the second time value is 30ms to 60ms, preferably 50ms.
Further, the AP presence includes the number of existing APs, wherein step S2 includes:
step B1: starting a timer when monitoring a current channel is started, extracting a configuration channel of an AP and an MAC address of the AP from a monitored beacon frame or a detected response frame when the beacon frame or the detected response frame is monitored before the channel is unlocked and the timer reaches a first dwell time, associating the configuration channel of the AP extracted from the same beacon frame or the detected response frame with the MAC address of the AP, and recording;
and step B2: when the channel is not locked and the timer reaches the first staying time, determining the number of the APs existing on the current channel according to the number of the MAC addresses associated with the current channel in the current recorded information, and initializing the timer.
Further, the AP presence includes a number of APs present, wherein the determining the second stay time of the current channel according to the AP presence on the current channel includes:
calculating N = N × K + M, wherein N is less than or equal to 400ms;
and N is the second staying time of the current channel, N is the number of the APs existing on the current channel, and K and M are preset values.
Further, K is 30ms-50ms, preferably 40ms; m is 30ms to 60ms, preferably 50ms.
Further, in step S3, if it is determined that the channel lock data packet is not monitored in the second dwell time on the current channel, the AP presence on the current channel is updated by using the beacon frame and the probe response frame monitored in the second dwell time on the current channel.
Further, the first dwell time is 100ms to 200ms, preferably 150ms.
Further, the preset time is 4s-12s, and is preferably 9s.
In order to achieve the above object, a technical solution of the present invention further provides a network distribution device, which is applied to an electronic device, and the device includes:
the mode control module is used for controlling the electronic equipment to start a promiscuous mode so as to monitor a wireless network data packet;
the first monitoring processing module is used for controlling the electronic equipment to monitor a plurality of channels in sequence according to a first preset sequence, judging whether a channel locking data packet is monitored in a first residence time preset on a current channel when each channel is monitored, if so, locking the channel and staying on the locked channel by using the channel locking data packet to acquire distribution network information, connecting a target AP according to the acquired distribution network information, and if not, determining the existence condition of the AP on the current channel by using a beacon frame and a detection response frame monitored in the first residence time on the current channel, and starting to monitor the next channel according to the first preset sequence;
and the second monitoring processing module is used for controlling the electronic equipment to monitor the plurality of channels in sequence according to a second preset sequence, judging whether a channel locking data packet is monitored in a second retention time on the current channel when each channel is monitored, if so, locking the channel and staying on the locked channel by using the channel locking data packet to acquire distribution network information, connecting a target AP according to the acquired distribution network information, and if not, starting to monitor the next channel according to the second preset sequence, wherein the second retention time of the current channel is determined according to the existence condition of the AP on the current channel.
In order to achieve the above object, the present invention further provides an electronic device, which is characterized by including a processor, a memory coupled to the processor, and a WiFi module, where the processor is configured to execute instructions in the memory, so as to implement the above network distribution method.
Further, the electronic device is an internet of things device.
According to the distribution network method provided by the invention, the channel locking data packet is monitored on each channel by adopting the fixed preset monitoring dwell time, the AP existence condition on each channel is collected, and when the channel is not locked after the preset time is reached, the monitoring dwell time of each channel is dynamically adjusted according to the AP existence condition on each channel, so that the waste of the distribution network time is reduced and the distribution network efficiency is improved.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of embodiments of the present invention with reference to the accompanying drawings, in which:
fig. 1 is a flowchart of a network distribution method according to an embodiment of the present invention.
Detailed Description
The present invention will be described below based on examples, but the present invention is not limited to only these examples. In the following detailed description of the present invention, certain specific details are set forth in order to avoid obscuring the nature of the present invention, and well-known methods, procedures, and components have not been described in detail.
Furthermore, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.
Unless the context clearly requires otherwise, throughout the description and the claims, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, what is meant is "including but not limited to".
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specified.
Referring to fig. 1, fig. 1 is a flowchart of a network distribution method provided in an embodiment of the present invention, where the network distribution method is applied to an electronic device, and the method includes:
step S1: the electronic equipment starts a promiscuous mode to monitor a wireless network data packet;
step S2: the electronic device monitors a plurality of channels in sequence according to a first preset sequence, and when each channel is monitored, whether a channel locking data packet is monitored in a first dwell time preset on a current channel is judged, if yes, the channel locking data packet is used for locking the channel and staying on the locked channel to acquire distribution network information, a target AP is connected according to the acquired distribution network information, if not, the AP existence condition on the current channel is determined by using a beacon frame (beacon frame) and a probe response frame (probe response frame) monitored in the first dwell time on the current channel, and the next channel is monitored according to the first preset sequence, wherein the first dwell time is 100ms-200ms, and is preferably 150ms;
in step S2, the monitoring dwell time of each channel is preset and fixed, when the current channel is monitored, if a channel lock data packet is not monitored on the current channel, the monitoring dwell time is a preset first dwell time, when the dwell time for continuously monitoring the current channel reaches the preset first dwell time, the next channel is switched to, and if a channel lock data packet is monitored before the first dwell time is reached, channel lock is performed, and then the channel lock is not switched to other channels, so as to further monitor a data packet containing distribution network information;
specifically, in this step, when each channel is monitored, when a data packet is received, it is determined whether the currently received data packet is a channel locking data packet and is a beacon frame or a probe response frame, if the currently received data packet is the channel locking data packet, the channel locking data packet is used to lock a channel and stay on the locked channel to acquire distribution network information, and a target AP is connected according to the acquired distribution network information, if the currently received data packet is the channel locking data packet, a configuration channel of an AP and an MAC address of the AP are extracted from the beacon frame or the probe response frame, and the configuration channel of the AP and the MAC address of the AP extracted from the same beacon frame or the probe response frame are associated and recorded, and when the stay time for continuously monitoring the current channel reaches a preset first stay time and the channel is not yet locked, the presence of the AP on the current channel is determined by using the currently recorded information, and the current channel is switched to the next channel for monitoring;
step S3 is started to be executed when step S2 is executed for a preset time and a channel is not locked, for example, the preset time is 4S-12S, and is preferably 9S;
and step S3: the electronic device monitors the plurality of channels in sequence according to a second preset sequence, and when each channel is monitored, whether a channel locking data packet is monitored in a second residence time of the current channel is judged, if so, the channel locking data packet is used for locking the channel and staying on the locked channel to obtain distribution network information, and a target AP is connected according to the obtained distribution network information, if not, the next channel is monitored according to the second preset sequence, wherein the second residence time of the current channel is determined according to the existence condition of the AP on the current channel, specifically, if the current channel has fewer APs, the monitoring residence time of the current channel can be properly reduced (namely, the second residence time is shorter), if the current channel has more APs, the monitoring residence time of the current channel can be properly increased (namely, the second residence time is longer) to receive more data packets, so that the broadcast packets or multicast packets for locking the channel (namely, the channel locking data packets) can be received easily, and thus, when each monitoring is performed, the waste of the number of APs on the channel with fewer APs can be reduced, and the number of APs on the channel can be increased, and the distribution network efficiency can be improved;
wherein, the second preset sequence can be the same as or different from the first preset sequence;
according to the distribution network method provided by the embodiment of the invention, the channel locking data packet is monitored on each channel by adopting the fixed preset monitoring residence time, the AP existence condition on each channel is collected, and when the channel is not locked after the preset time is reached, the monitoring residence time of each channel is dynamically adjusted according to the AP existence condition on each channel, so that the waste of the distribution network time is reduced and the distribution network efficiency is improved.
It should be noted that, in the present invention, it is the prior art that the channel locking data packet is a data packet that conforms to the preset channel locking rule, and how to determine whether the received data packet is a channel locking data packet (i.e., how to determine whether the received data packet conforms to the preset channel locking rule) is not described herein again;
in addition, in an embodiment, when it is determined that a channel locking packet is received on a currently monitored channel (i.e., a current channel), the current channel is locked, and the current channel is continuously stayed to acquire the distribution network information.
In the embodiment of the present invention, the second staying time of each channel is determined according to the currently determined AP presence on the channel, for example, for each channel, the second staying time of the channel may be determined immediately after determining the AP presence thereof, then the second staying time is stored, when switching to the current channel and monitoring is started, the second staying time may be directly obtained from the stored information, in addition, the information may also be stored after determining the AP presence, when switching to the current channel and monitoring is started, the AP presence of the current channel is obtained from the stored information, and then the staying time of current channel for this monitoring (i.e., the second staying time of the current channel) is determined according to the obtained information, that is, the execution time of the step "determining the second staying time of the current channel according to the AP presence on the current channel" is not specifically limited by the present invention.
Preferably, in an embodiment, in the step S3, if it is determined that the channel locking data packet is not monitored in the second dwell time on the current channel, the AP existence condition on the current channel is further updated by using the beacon frame and the probe response frame monitored in the second dwell time on the current channel, and when the current channel is monitored next time, the second dwell time determined by the updated AP existence condition on the current channel is taken as the current monitoring dwell time.
The embodiment of the invention provides a network distribution method, which is applied to electronic equipment and comprises the following steps:
step S11: the electronic equipment starts a promiscuous mode to monitor a wireless network data packet;
step S12: the electronic equipment monitors a plurality of channels in sequence according to a first preset sequence, judges whether a channel locking data packet is monitored in a first residence time preset on a current channel or not when each channel is monitored, if so, uses the channel locking data packet to lock the channel and stay on the locked channel to acquire distribution network information, and connects a target AP according to the acquired distribution network information, and if not, uses a beacon frame and a detection response frame monitored in the first residence time on the current channel to determine whether the current channel has the AP or not, and starts to monitor the next channel according to the first preset sequence;
in some cases, when the AP sends the data packet on the configured channel, other devices may also receive the data packet on an adjacent channel, for example, the configured channel of an AP is 6 channels, and other devices may not only receive the data packet on 6 channels, but also receive a part of the data packet on 5 channels or 7 channels, but the quality of the data packet received on 5 channels or 7 channels is worse than that of the data packet received on 6 channels, and preferably, in this step, in order to accurately detect the existence of the AP on each channel, this step may include:
step A1: starting a timer (or timer) when monitoring a current channel is started, extracting a configuration channel of an AP and a MAC address of the AP from a monitored beacon frame or a probe response frame when the beacon frame or the probe response frame is monitored before the channel is unlocked and the timer reaches a first dwell time, associating the configuration channel of the AP extracted from the same beacon frame or the probe response frame with the MAC address of the AP, and recording;
step A2: when a channel is unlocked and the timer reaches the first staying time, judging whether the MAC address associated with the current channel exists in the current recorded information, if so, confirming that the AP exists in the current channel and initializing the timer, and if not, confirming that the AP does not exist in the current channel and initializing the timer.
It is understood that, in the prior art, when an AP transmits a beacon frame or a probe response frame to the outside, the transmitted beacon frame or probe response frame may include its own MAC address and its own configuration channel, and therefore, when other devices receive the beacon frame or probe response frame, the MAC address and the configuration channel of the AP that transmitted the beacon frame or probe response frame may be extracted from the received beacon frame or probe response frame.
For example, the channels are 1 to 14 channels (total 14 channels) or 1 to 13 channels (total 13 channels), in this step, the channels are monitored sequentially according to a first preset sequence, the dwell time (i.e. the first dwell time) of each monitoring of each channel is 100ms to 200ms, preferably 150ms, and when step S12 is executed for a preset time and the channel is not locked, step S13 is started to be executed, for example, the preset time is 4S to 12S, such as 9S;
step S13: the electronic equipment monitors the plurality of channels in sequence according to a second preset sequence, judges whether a channel locking data packet is monitored in second residence time on the current channel or not when each channel is monitored, locks the channel and stops on the locked channel by using the channel locking data packet to acquire distribution network information if the channel locking data packet is monitored in the second residence time on the current channel, connects a target AP according to the acquired distribution network information, and starts to monitor the next channel according to the second preset sequence if the channel locking data packet is not monitored in the second residence time on the current channel, wherein the mode of determining the second residence time on the current channel is as follows: if the AP exists on the current channel, determining the second dwell time as a first time value, and if the AP does not exist, determining the second dwell time as a second time value, where the first time value is greater than the second time value, for example, the first time value is 100ms to 400ms, preferably 200ms, and the second time value is 30ms to 60ms, preferably 50ms.
The embodiment of the invention provides a network distribution method, which is applied to electronic equipment and comprises the following steps:
step S21: the electronic equipment starts a promiscuous mode to monitor a wireless network data packet;
step S22: the electronic equipment monitors a plurality of channels in sequence according to a first preset sequence, judges whether a channel locking data packet is monitored in a first residence time preset on a current channel or not when each channel is monitored, locks the channel and stays on the locked channel by using the channel locking data packet to acquire distribution network information if the channel locking data packet is monitored in the first residence time, connects a target AP according to the acquired distribution network information, determines the number of APs existing in the current channel by using a beacon frame and a detection response frame monitored in the first residence time on the current channel if the channel locking data packet is monitored in the first residence time, and starts to monitor the next channel according to the first preset sequence;
preferably, in this step, to accurately detect the presence of an AP on each channel, this step may include:
step B1: starting a timer when monitoring a current channel is started, extracting a configuration channel of an AP and an MAC address of the AP from a monitored beacon frame or a detected response frame when the beacon frame or the detected response frame is monitored before the channel is unlocked and the timer reaches a first dwell time, associating the configuration channel of the AP extracted from the same beacon frame or the detected response frame with the MAC address of the AP, and recording;
and step B2: when the channel is unlocked and the timer reaches the first staying time, determining the number of the APs existing on the current channel according to the number of the MAC addresses associated with the current channel in the currently recorded information, and initializing the timer.
For example, the channels are 1 to 14 channels (total 14 channels) or 1 to 13 channels (total 13 channels), in this step, the channels are monitored sequentially according to a first preset sequence, the dwell time (i.e. the first dwell time) of each monitoring of each channel is 100ms to 200ms, preferably 150ms, and when step S22 is executed for a preset time and a channel is not locked, step S23 is executed, for example, the preset time is 4S to 12S, such as 9S;
step S23: the electronic equipment monitors the plurality of channels in sequence according to a second preset sequence, judges whether a channel locking data packet is monitored in second residence time on the current channel when each channel is monitored, locks the channel and stays on the locked channel by using the channel locking data packet to acquire distribution network information if the channel locking data packet is monitored in the second residence time on the current channel, connects a target AP according to the acquired distribution network information, and starts to monitor the next channel according to the second preset sequence if the channel locking data packet is not monitored in the second residence time on the current channel, wherein the mode of determining the second residence time on the current channel is as follows:
calculating N = N × K + M, and N is less than or equal to 400ms, i.e. when N calculated by the formula is greater than 400ms, determining the value of N to be 400ms;
wherein N is the second staying time of the current channel, N is the number of APs existing on the current channel, K and M are preset values, for example, K is 30ms to 50ms, preferably 40ms, and M is 30ms to 60ms, preferably 50ms.
An embodiment of the present invention further provides a network distribution device, which is applied to an electronic device, and the device includes:
the mode control module is used for controlling the electronic equipment to start a promiscuous mode so as to monitor a wireless network data packet;
the first monitoring processing module is used for controlling the electronic equipment to monitor a plurality of channels in sequence according to a first preset sequence, judging whether a channel locking data packet is monitored in a first residence time preset on a current channel when each channel is monitored, if so, locking the channel and staying on the locked channel by using the channel locking data packet to acquire distribution network information, connecting a target AP according to the acquired distribution network information, and if not, determining the existence condition of the AP on the current channel by using a beacon frame and a detection response frame monitored in the first residence time on the current channel, and starting to monitor the next channel according to the first preset sequence;
and the second monitoring processing module is used for controlling the electronic equipment to monitor the plurality of channels in sequence according to a second preset sequence, judging whether a channel locking data packet is monitored in a second retention time on the current channel when each channel is monitored, if so, locking the channel and staying on the locked channel by using the channel locking data packet to acquire distribution network information, connecting a target AP according to the acquired distribution network information, and if not, starting to monitor the next channel according to the second preset sequence, wherein the second retention time of the current channel is determined according to the existence condition of the AP on the current channel.
The embodiment of the invention also provides electronic equipment, which comprises a processor, a memory coupled with the processor and a WiFi module, wherein the processor is used for executing instructions in the memory to realize the network distribution method.
The electronic device in the embodiment of the invention can be WiFi-based Internet of things devices (such as an air purifier, an air conditioner and the like) and can also be other wireless devices needing to be distributed with a network.
According to the electronic equipment provided by the embodiment of the invention, the channel locking data packet is monitored on each channel by adopting the fixed preset monitoring dwell time, the AP existence condition on each channel is collected, and when the channel is not locked after the preset time is reached, the monitoring dwell time of each channel is dynamically adjusted according to the AP existence condition on each channel, so that the waste of the time of a distribution network is reduced, and the efficiency of the distribution network is improved.
It will be appreciated by those skilled in the art that the various preferences described above can be freely combined, superimposed without conflict.
It will be understood that the embodiments described above are illustrative only and not restrictive, and that various obvious and equivalent modifications and substitutions for details described herein may be made by those skilled in the art without departing from the basic principles of the invention.

Claims (18)

1. A network distribution method is applied to electronic equipment, and the method comprises the following steps:
step S1: the electronic equipment starts a promiscuous mode to monitor a wireless network data packet;
step S2: the method comprises the steps that the electronic equipment monitors a plurality of channels in sequence according to a first preset sequence, when each channel is monitored, whether a channel locking data packet is monitored in a first retention time preset on the current channel or not is judged, if yes, the channel locking data packet is used for locking the channel and staying on the locked channel to obtain distribution network information, a target AP is connected according to the obtained distribution network information, if not, the existence condition of the AP on the current channel is determined by using a beacon frame and a detection response frame monitored in the first retention time on the current channel, and monitoring on the next channel is started according to the first preset sequence;
when the step S2 is executed for the preset time and the channel is not locked, the step S3 is started to be executed;
and step S3: the electronic equipment monitors the plurality of channels in sequence according to a second preset sequence, judges whether a channel locking data packet is monitored in second residence time on the current channel or not when each channel is monitored, locks the channel and stays on the locked channel by using the channel locking data packet to acquire distribution network information if the channel locking data packet is monitored in the second residence time on the current channel, connects a target AP according to the acquired distribution network information, and starts to monitor the next channel according to the second preset sequence if the channel locking data packet is not monitored in the second residence time on the current channel, wherein the second residence time of the current channel is determined according to the existence condition of the AP on the current channel.
2. The method according to claim 1, wherein the AP presence comprises whether an AP is present, wherein step S2 comprises:
step A1: starting a timer when monitoring a current channel is started, extracting a configuration channel of an AP and an MAC address of the AP from a monitored beacon frame or a detected response frame when the beacon frame or the detected response frame is monitored before the channel is unlocked and the timer reaches a first dwell time, associating the configuration channel of the AP extracted from the same beacon frame or the detected response frame with the MAC address of the AP, and recording;
step A2: when the channel is unlocked and the timer reaches the first staying time, judging whether the MAC address associated with the current channel exists in the currently recorded information, if so, confirming that the AP exists in the current channel, and initializing the timer.
3. The method according to claim 2, wherein in step A2, if it is determined that the MAC address associated with the current channel does not exist in the currently recorded information, it is determined that the AP does not exist in the current channel, and a timer is initialized.
4. The method of claim 1, wherein the AP presence comprises a presence of an AP, and wherein the determining the second dwell time for the current channel based on the AP presence on the current channel comprises:
and if the AP does not exist on the current channel, determining that the second staying time is a second time value, wherein the first time value is larger than the second time value.
5. The method of claim 4, wherein the first time value is 100ms-400ms; the second time value is 30ms-60ms.
6. The method of claim 5, wherein the first time value is 200ms; the second time value is 50ms.
7. The method according to claim 1, wherein the AP presence comprises a number of existing APs, and wherein step S2 comprises:
step B1: starting a timer when monitoring a current channel is started, extracting a configuration channel of an AP and an MAC address of the AP from a monitored beacon frame or a detected response frame when the beacon frame or the detected response frame is monitored before the channel is unlocked and the timer reaches a first dwell time, associating the configuration channel of the AP extracted from the same beacon frame or the detected response frame with the MAC address of the AP, and recording;
and step B2: when the channel is not locked and the timer reaches the first staying time, determining the number of the APs existing on the current channel according to the number of the MAC addresses associated with the current channel in the current recorded information, and initializing the timer.
8. The method of claim 1, wherein the AP presence comprises a number of APs present, and wherein the determining the second dwell time for the current channel based on the AP presence on the current channel comprises:
calculating N = N × K + M, wherein N is less than or equal to 400ms;
and N is the second staying time of the current channel, N is the number of the APs existing on the current channel, and K and M are preset values.
9. The method of claim 8, wherein K is 30ms to 50ms; m is 30ms-60ms.
10. The method of claim 9, wherein K is 40ms; the M is 50ms.
11. The method according to any one of claims 1 to 10, wherein in step S3, if it is determined that the channel locking packet is not monitored in the second dwell time on the current channel, the AP presence on the current channel is further updated by using the beacon frame and the probe response frame monitored in the second dwell time on the current channel.
12. The method according to any of claims 1-9, characterized in that the first dwell time is 100ms-200ms.
13. The method of claim 12, wherein the first dwell time is 150ms.
14. The method according to any one of claims 1 to 9, wherein the predetermined time is 4s to 12s.
15. The method of claim 14, wherein the predetermined time is 9s.
16. A distribution network device applied to electronic equipment is characterized by comprising:
the mode control module is used for controlling the electronic equipment to start a promiscuous mode so as to monitor a wireless network data packet;
the first monitoring processing module is used for controlling the electronic equipment to monitor a plurality of channels in sequence according to a first preset sequence, judging whether a channel locking data packet is monitored in a first residence time preset on a current channel when each channel is monitored, if so, locking the channel and staying on the locked channel by using the channel locking data packet to acquire distribution network information, connecting a target AP according to the acquired distribution network information, and if not, determining the existence condition of the AP on the current channel by using a beacon frame and a detection response frame monitored in the first residence time on the current channel, and starting to monitor the next channel according to the first preset sequence;
and the second monitoring processing module is used for controlling the electronic equipment to monitor the plurality of channels in sequence according to a second preset sequence, judging whether a channel locking data packet is monitored in a second residence time of the current channel when each channel is monitored, if so, locking the channel and staying in the locked channel by using the channel locking data packet to acquire distribution network information, connecting a target AP according to the acquired distribution network information, and if not, starting to monitor the next channel according to the second preset sequence, wherein the second residence time of the current channel is determined according to the existence condition of the AP on the current channel.
17. An electronic device comprising a processor, a memory coupled to the processor, and a WiFi module, wherein the processor is configured to execute instructions in the memory to implement the method of any of claims 1-15.
18. The electronic device of claim 17, wherein the electronic device is an internet of things device.
CN201910491751.0A 2019-06-06 2019-06-06 Network distribution method, network distribution device and electronic equipment Active CN110621028B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910491751.0A CN110621028B (en) 2019-06-06 2019-06-06 Network distribution method, network distribution device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910491751.0A CN110621028B (en) 2019-06-06 2019-06-06 Network distribution method, network distribution device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110621028A CN110621028A (en) 2019-12-27
CN110621028B true CN110621028B (en) 2022-12-20

Family

ID=68921397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910491751.0A Active CN110621028B (en) 2019-06-06 2019-06-06 Network distribution method, network distribution device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110621028B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112770369B (en) * 2020-12-30 2023-09-15 宇龙计算机通信科技(深圳)有限公司 Channel selection method and device, storage medium and electronic equipment
CN113676932B (en) * 2021-08-12 2023-08-11 珠海格力电器股份有限公司 Automatic network allocation method, system, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106327559A (en) * 2016-08-22 2017-01-11 苏州伟卓奥科三维科技有限公司 Communication method, data processing method and calculating system
CN106793119A (en) * 2016-12-22 2017-05-31 浙江宇视科技有限公司 Channel method to set up and device
CN108260186A (en) * 2016-12-29 2018-07-06 中兴通讯股份有限公司 A kind of method for network access and device, system
CN109640375A (en) * 2019-01-23 2019-04-16 欧普照明股份有限公司 A kind of smart machine distribution method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2929671B1 (en) * 2012-12-07 2017-02-22 Microsec Szamitastechnikai Fejlesztö Zrt. Method and system for authenticating a user using a mobile device and by means of certificates

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106327559A (en) * 2016-08-22 2017-01-11 苏州伟卓奥科三维科技有限公司 Communication method, data processing method and calculating system
CN106793119A (en) * 2016-12-22 2017-05-31 浙江宇视科技有限公司 Channel method to set up and device
CN108260186A (en) * 2016-12-29 2018-07-06 中兴通讯股份有限公司 A kind of method for network access and device, system
CN109640375A (en) * 2019-01-23 2019-04-16 欧普照明股份有限公司 A kind of smart machine distribution method and system

Also Published As

Publication number Publication date
CN110621028A (en) 2019-12-27

Similar Documents

Publication Publication Date Title
US8817788B2 (en) Wireless communication terminal, method, program, recording medium, and wireless communication system
US9237479B2 (en) Method and device for data traffic distribution
EP3487226B1 (en) Group management method utilized in coordinated multipoint, device, and system
EP3001734B1 (en) System, program and method for radio terminal to find access point
US9942821B2 (en) Wireless communication terminal, communication system, control apparatus, communication method and program
US20180110037A1 (en) User apparatus and method for transmitting control information
CN106576248B (en) Wireless communication system, wireless communication method, cooperation control device, terminal device, and licensed band base station device
CN105120507A (en) Data packet monitoring method and system
CN111404814B (en) Data transmission method and communication device
EP2792187A1 (en) Request-response procedure for wireless network
EP3297331A1 (en) Wireless communication system
JP2007214713A (en) Wireless lan system, access point and channel control method and program for use therein
US9510271B2 (en) Systems, apparatus, and methods for address format detection
JP2013143624A (en) Access point, wireless terminal, and program for wireless lan for minimizing sensing time for multiple wireless communication bands
WO2015030773A1 (en) Mobile station and method for anonymous media access control addressing
WO2014110380A1 (en) System and method for network selection
CN110621028B (en) Network distribution method, network distribution device and electronic equipment
CN106304047A (en) A kind of smart machine method of network entry and configuration system
JP2006013788A (en) Radio device
JP2008244989A (en) Radio communication system and terminal, packet control device, and program
EP2369791B1 (en) Apparatus and method for establishing connections with a plurality of virtual networks
EP2573999A1 (en) A transmission method for supporting data compression
CN110621053B (en) Network distribution method, network distribution device and electronic equipment
JP5794644B2 (en) Wireless LAN access point, mobile wireless communication device, and control method
US11979819B2 (en) Communication method and apparatus

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