Network scanning method, device and storage medium
By reordering the channel scanning order in the wireless LAN, the problem of low efficiency in mutual discovery and connection between devices is solved, and the efficiency of discovery and connection of devices to be connected to the network is improved.
Patent Information
- Application Number
- CN202111640753.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In a wireless LAN, due to the existence of multiple channels, mutual discovery and connection efficiency between devices is low, resulting in low discovery efficiency of devices to be connected.
By scanning multiple channels according to the initial scanning order, the beacon information of the access point device is obtained, and if the access point information is not included, the access point device information corresponding to the channel is determined, and the second scanning order is obtained by reordering. Used to optimize the channel scanning sequence for the next scan.
It improves the efficiency of discovering and connecting access point devices to devices to be connected to the network, and reduces the impact on terminals associated with devices to be connected to the network.
Smart Images

Figure CN114302405B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of wireless communications, and in particular to a network scanning method, device, and storage medium. Background Art
[0002] At present, wireless LAN technology is widely used, and many functions are derived based on wireless LAN technology. For example, with Wi-Fi technology, devices can discover each other through wireless communication protocols. However, in the process of mutual discovery between devices, due to the existence of multiple channels, different devices may be located in different channels, resulting in low discovery efficiency and connection efficiency of the devices to be connected. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a network scanning method, device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a network scanning method is provided, which is applied to an electronic device, and the method includes:
[0005] Scanning a plurality of channels in a first scanning order to obtain beacon information of at least one access point device scanned in at least one channel;
[0006] In a case where the beacon information of the at least one access point device does not include information allowing access, determining access point device information corresponding to the plurality of channels;
[0007] The multiple channels are sorted according to the access point device information corresponding to the multiple channels to obtain a second scanning order, and the second scanning order is used to scan the multiple channels according to the second scanning order when scanning channels next time.
[0008] Optionally, when the beacon information of the at least one access point device does not include the access permission information, determining the access point device information corresponding to the plurality of channels includes:
[0009] In a case where the beacon information of the at least one access point device does not include information allowing access, determining access point device information corresponding to the plurality of channels according to the generated access point device record of the at least one access point device;
[0010] The access point device record includes channel information corresponding to the beacon information of the access point device and attribute information of the access point device.
[0011] Optionally, scanning the multiple channels in a first scanning order to acquire beacon information of at least one access point device scanned in at least one channel includes:
[0012] A first channel is scanned to obtain first beacon information of a first access point device, where the first channel is any one of the multiple channels; wherein, when the first beacon information does not include information allowing access, an access point device record corresponding to the first beacon information is generated and a second channel is continuously scanned, where the access point device record corresponding to the first beacon information includes channel information of the first channel and attribute information of the first access point device, and the second channel is the first channel, or the second channel is a channel that is located after the first channel in a scanning order.
[0013] Optionally, for any beacon information, when the beacon information includes preset format information and the value of a specified flag bit in the preset format information is a specified value, the beacon information does not include information allowing access.
[0014] Optionally, the access point device information is the number of access point devices, and the sorting of the multiple channels according to the access point device information corresponding to the multiple channels to obtain the second scanning order includes:
[0015] The plurality of channels are sorted according to the number of access point devices corresponding to the plurality of channels to obtain the second scanning order, wherein a channel with a greater number of access point devices corresponding to it has a higher scanning priority in the second scanning order.
[0016] Optionally, the access point device information is the number of access point devices and state information of the access point devices, and the sorting of the multiple channels according to the access point device information corresponding to the multiple channels to obtain the second scanning order includes:
[0017] According to the number of access point devices corresponding to the multiple channels and the status information of the access point devices corresponding to the multiple channels, the multiple channels are sorted to obtain the second scanning order; wherein the status information includes: at least one of: signal strength, transmission rate, and the number of connected terminals.
[0018] Optionally, the electronic device is an access point device, and the method further includes:
[0019] Obtaining the number of terminals to be connected currently associated with the electronic device;
[0020] Determine a scanning period according to the number of terminals to be accessed; wherein, the greater the number of terminals to be accessed, the longer the duration of the scanning period;
[0021] Timing is performed based on the scanning cycle, and when the time interval from the last scanning reaches the duration of the scanning cycle, the plurality of channels are scanned according to the second scanning order.
[0022] Optionally, the electronic device is an access point device, and the method further includes:
[0023] After the electronic device accesses the network by accessing the third access point device, third beacon information is generated, wherein the third beacon information includes a device identification of the electronic device and information on whether the electronic device is allowed to access;
[0024] The third beacon information is broadcasted.
[0025] According to a second aspect of an embodiment of the present disclosure, a network scanning device is provided, which is applied to an electronic device, and the device includes:
[0026] A scanning module configured to scan a plurality of channels in a first scanning order to obtain beacon information of at least one access point device scanned in at least one channel;
[0027] a determination module, configured to determine access point device information corresponding to the plurality of channels when the beacon information of the at least one access point device does not contain access permission information;
[0028] The processing module is configured to sort the multiple channels according to the access point device information corresponding to the multiple channels to obtain a second scanning order, and the second scanning order is used to scan the multiple channels according to the second scanning order when scanning channels next time.
[0029] Optionally, the determination module is configured to determine the access point device information corresponding to the multiple channels based on the generated access point device record of the at least one access point device when the beacon information of the at least one access point device does not contain the information allowing access; wherein the access point device record includes the channel information corresponding to the beacon information of the access point device and the attribute information of the access point device.
[0030] Optionally, the scanning module is configured to:
[0031] A first channel is scanned to obtain first beacon information of a first access point device, where the first channel is any one of the multiple channels; wherein, when the first beacon information does not include information allowing access, an access point device record corresponding to the first beacon information is generated and a second channel is continuously scanned, where the access point device record corresponding to the first beacon information includes channel information of the first channel and attribute information of the first access point device, and the second channel is the first channel, or the second channel is a channel that is located after the first channel in a scanning order.
[0032] Optionally, for any beacon information, when the beacon information includes preset format information and the value of a specified flag bit in the preset format information is a specified value, the beacon information does not include information allowing access.
[0033] Optionally, the scanning module further includes:
[0034] A second scanning submodule is configured to scan the second channel to obtain second beacon information of the second access point device;
[0035] The connection submodule is configured to initiate a connection to the second access point device when the second beacon information contains access permission information.
[0036] Optionally, the access point device information is the number of access point devices, and the processing module is further configured to:
[0037] The plurality of channels are sorted according to the number of access point devices corresponding to the plurality of channels to obtain the second scanning order, wherein a channel with a greater number of access point devices corresponding to it has a higher scanning priority in the second scanning order.
[0038] Optionally, the access point device information is the number of access point devices and status information of the access point devices, and the processing module is further configured to:
[0039] According to the number of access point devices corresponding to the multiple channels and the status information of the access point devices corresponding to the multiple channels, the multiple channels are sorted to obtain the second scanning order; wherein the status information includes: at least one of: signal strength, transmission rate, and the number of connected terminals.
[0040] Optionally, the electronic device is an access point device, and the apparatus further includes: an acquisition module and a determination module;
[0041] The acquisition module is configured to acquire the number of terminals to be accessed that are currently associated with the electronic device;
[0042] The determination module is configured to determine a scanning period according to the number of terminals to be accessed; wherein, the greater the number of terminals to be accessed, the longer the duration of the scanning period;
[0043] The scanning module is further configured to perform timing based on the scanning cycle, and scan the plurality of channels according to the second scanning order when the time interval from the last scanning reaches the duration of the scanning cycle.
[0044] Optionally, the electronic device is an access point device, and the apparatus further includes:
[0045] A generating module, configured to generate third beacon information after the electronic device accesses the network by accessing the third access point device, wherein the third beacon information includes a device identification of the electronic device and information on whether the electronic device is allowed to access;
[0046] The broadcast module is configured to broadcast the third beacon information.
[0047] According to a third aspect of an embodiment of the present disclosure, there is provided a network scanning device, which is applied to an electronic device, comprising: a processor; a memory for storing instructions executable by the processor;
[0048] The processor is configured to: execute the executable instructions to implement the steps of the method described in any embodiment of the first aspect above.
[0049] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the network scanning method provided in the first aspect of the present disclosure are implemented.
[0050] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0051] In the above technical solution, by scanning multiple channels according to the first scanning order, the beacon information of at least one access point device scanned in at least one channel is obtained. When the beacon information of the at least one access point device obtained by scanning does not contain information allowing access, the access point device information corresponding to the multiple channels is determined, and the multiple channels are sorted according to the access point device information corresponding to each channel to obtain a second scanning order. The second scanning order is used to scan the multiple channels according to the second scanning order when scanning the channels next time, so that the electronic device can scan the channels according to the sorted scanning order when scanning again. The above technical solution can re-sort the scanning order of each channel according to the access point device scanned in each information, so that the electronic device can scan according to the latest channel scanning order when scanning next time, and can improve the efficiency of the device to be connected to discover and connect to the access point device while minimizing the impact on the associated terminal of the device to be connected to the network.
[0052] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0054] Figure 1The figure is a flow chart of a network scanning method according to an exemplary embodiment.
[0055] Figure 2 The figure is a flow chart of another network scanning method according to an exemplary embodiment.
[0056] Figure 3 The present invention is a flowchart of a beacon information identification method according to an exemplary embodiment.
[0057] Figure 4 The flowchart of another network scanning method is shown according to an exemplary embodiment.
[0058] Figure 5 The flowchart of another network scanning method is shown according to an exemplary embodiment.
[0059] Figure 6 The figure is a block diagram of a network scanning device according to an exemplary embodiment.
[0060] Figure 7 is a block diagram of another network scanning device according to an exemplary embodiment. DETAILED DESCRIPTION
[0061] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0062] Figure 1 is a flow chart of a network scanning method according to an exemplary embodiment, the method is applied to an electronic device, such as Figure 1 As shown, the method includes the following steps.
[0063] In step S101, multiple channels are scanned in a first scanning order to obtain beacon information of at least one access point device scanned in at least one channel.
[0064] It is understandable that the first scanning order may be a default order of multiple channels during the first scanning, or may be a scanning order obtained according to the method shown in steps S102 to S103 after the last channel scanning.
[0065] For example, an access point device refers to an AP (Access Point) device. An access point device has two important functions: relay and bridge. Based on these functions, a local area network that is not connected to the network can be connected to the Internet, or multiple local area networks can be connected. The access point device in the present disclosure is a wireless access point device. A wireless access point device is an access point for mobile terminal users to access the network wirelessly, and is a typical application of a wireless local area network (WLAN).
[0066] Taking Wi-Fi as an example, when an access point device is working, in order to allow other devices to discover it, it will periodically broadcast beacon information, also known as beacon frames, at a certain frequency. The beacon information usually carries the SSID (Service Set Identifier) of the access point device, a timestamp for synchronization, and other information. The access device can discover the access point device by scanning the beacon information.
[0067] The channel in the present disclosure, also referred to as a channel or frequency band, is a data signal transmission channel using a wireless signal as a transmission carrier. For example, in Wi-Fi technology, the current IEEE802.11 protocol uses two frequency bands, 2.4GHz and 5GHz. Among them, the operating frequency of the 2.4G frequency band is usually 2.4-2.4835GHz, and this 83.5MHz frequency band is divided into 14 channels. The center frequency of each channel differs by 5MHz, and the upward and downward extensions are 11MHz respectively. The channel bandwidth is 22MHz, and China generally uses channels 1-13. The 5G frequency band is different from the 2.4G frequency band in range, but similar to the 2.4G frequency band, it is also divided into several channels based on different frequency bands, among which China generally uses channels such as 36, 40, 44, 52, 56, 60, 64, 100, 104, 149, 153, etc. The multiple channels described in each embodiment of the present disclosure may be all or part of the channels in the above-mentioned 2.4G or 5G, and the present disclosure is not limited.
[0068] In an embodiment of the present disclosure, there may be multiple access point devices in the current environment, and the multiple access point devices may be connected to the same local area network, for example, accessing the same local area network in a mesh networking (a wireless mesh network) manner, and the local area network has been connected to the Internet. The electronic device currently waiting to be connected to the network can achieve network access by accessing any access point device in the current environment. Alternatively, the multiple access point devices may be connected to different local area networks, and the different local area networks have been connected to the Internet. The electronic device currently waiting to be connected to the network can also achieve network access by accessing any access point device in the current environment. The present disclosure does not make specific restrictions. Due to the existence of the above-mentioned multiple channels, different access point devices may work on different channels. Therefore, the electronic device to be connected needs to scan each channel, so as to realize the discovery of the access point device and subsequent access by scanning the beacon information of the access point device.
[0069] In one implementation, by scanning the multiple channels one by one according to the first scanning order, beacon information of one or more access point devices in the current environment can be obtained. For any beacon information, if the beacon information does not contain information allowing access, an access point device record corresponding to the beacon information is generated and saved, and the access point device record includes channel information corresponding to the beacon information and attribute information of the access point device.
[0070] In step S102, when the beacon information of the at least one access point device does not include access permission information, access point device information corresponding to a plurality of channels is determined.
[0071] In one implementation, the beacon information of the at least one access point device does not contain the information allowing access, which can be understood as that after the scanning of the multiple channels is completed, the obtained beacon information does not contain the information allowing access. In this case, the access point device information corresponding to the multiple channels can be determined based on the access point device record of the at least one access point device corresponding to the beacon information obtained during the channel scanning, and the access point device record includes the channel information corresponding to the beacon information of the access point device and the attribute information of the access point device. The access point device record can be generated after scanning the beacon information of the at least one access point device mentioned above, for example, after scanning the beacon information of an access point device, if the beacon information does not contain the information allowing access, then the access point device record of the access point device corresponding to the beacon information is generated; or, the beacon information of the scanned at least one access point device can also be screened, for example, after scanning any beacon information, first determine whether the beacon information supports access, if it does not support access, then ignore the beacon information, if it supports access, then continue to determine whether the beacon information contains the information allowing access, and if it does not contain the information allowing access, then generate the access point device record of the access point device corresponding to the beacon information.
[0072] In step S103, the multiple channels are sorted according to the access point device information corresponding to the multiple channels to obtain a second scanning order, and the second scanning order is used to scan the multiple channels according to the second scanning order when scanning channels next time.
[0073] It is understandable that if the beacon information scanned on each channel does not contain information allowing access, the above multiple channels can be sorted according to the access point device information corresponding to different channels, and the obtained second scanning order can be used for the next scan. For example, the access point device information can be information that can characterize the access point conditions scanned under different channels, such as the number of access point devices. Therefore, the access point devices scanned under different channels are sorted according to different conditions, providing guidance for the priority of the access point devices in the next scan, thereby improving the access efficiency in the next scan.
[0074] In addition, it is worth explaining that the multiple channels mentioned in step S101, step 102 and step S103 respectively may be the same channels, or there may be differences. For example, in step S101, each channel in the current environment is scanned, the multiple channels in step S102 may be each channel in the current environment, the multiple channels in step S103 may also be each channel in the current environment, or the multiple channels in step S103 may be multiple channels after eliminating one or more channels. For another example, when the multiple channels in step S101 are part of all channels, the multiple channels in step S103 may be multiple channels obtained by adding one or more channels to the multiple channels in step S101. That is, it can be understood that the channels in the second scanning sequence may be the same as the channels in the first scanning sequence, or there may be different channels.
[0075] Optionally, Figure 2 is a flowchart of another network scanning method according to an exemplary embodiment. Figure 2 In one implementation, step S101 may include the following steps:
[0076] In step S1011, a first channel is scanned to obtain first beacon information of a first access point device, where the first channel is any channel among the multiple channels.
[0077] In step S1012, when the first beacon information does not include access permission information, an access point device record corresponding to the first beacon information is generated.
[0078] The access point device record corresponding to the first beacon information includes channel information of the first channel and attribute information of the first access point device.
[0079] For example, when scanning to channel 36 of the 5G frequency band, beacon information 1 sent by access point device 1 is scanned, and it is determined that the beacon information does not contain information allowing access. At this time, an access point device record can be generated to record the channel 36 corresponding to the beacon information 1 and the attribute information of the access point device 1. For example, the attribute information can be the device identifier AP1 of the access point device 1, and the access point device record can be saved in the form of a tuple, such as [channel 36, AP1].
[0080] Alternatively, see Figure 2 After step S1012, step S101 may further include the following steps:
[0081] In step S1013, the second channel is scanned to obtain second beacon information of the second access point device.
[0082] It can be understood that after scanning the first channel and obtaining the first beacon information of the first access point device, since the first beacon information does not contain the information allowing access, it is necessary to continue scanning. Since the beacon information of one or more access point devices may be scanned in the same channel, the second beacon information of the second access point device may be scanned in the same channel as the first beacon information. In this case, the second channel is the first channel; when the access point device allowed to access is not scanned in the first channel, it is necessary to continue scanning the subsequent channels in the first scanning sequence. In this case, the second channel is the channel whose scanning sequence is located after the first channel. Therefore, the second channel can be the same channel as the first channel, or the second channel can be any channel whose scanning sequence is located after the first channel. Of course, if all the beacon information obtained in the first scanning sequence does not contain the information not allowing access, it is necessary to perform steps S102 and S103 to obtain the second scanning sequence. At this time, the second channel can be understood as the channel scanned in the next scan (or one of the following scans).
[0083] In step S1014, when the second beacon information includes access permission information, a connection is initiated to the second access point device.
[0084] Optionally, before determining whether the beacon information contains information allowing access, the scanned beacon information may be screened by first identifying whether the beacon information contains information in a preset format. Figure 3 is a flowchart of a beacon information identification method according to an exemplary embodiment. Figure 3 , step S1012 may include the following steps:
[0085] In step S10121, when the first beacon information includes preset format information, the value of a specified flag bit in the preset format information is obtained.
[0086] It can be understood that the preset format information can be used to characterize whether access is supported. When the first beacon information contains the preset format information, it means that the first access point device supports access, and step S10122 can continue to be executed; when the first beacon information does not contain the preset format information, it means that the first access point device does not support access, scanning can continue, and the channel information of the first beacon information and the attribute information of the first access point device may not be recorded.
[0087] In step S10122, when the value of the designated flag bit is the designated value, it is determined that the first beacon information does not include information allowing access.
[0088] In step S10123, an access point device record corresponding to the first beacon information is generated.
[0089] For example, for any beacon information, if the beacon information includes preset format information, and the value of the designated flag bit in the preset format information is a designated value, it can be determined that the beacon information does not include information that allows access. For example, the designated value can be a numerical value or a symbol, but is not limited thereto. For example, if the designated value is 1, it can indicate that access is allowed, and correspondingly, if the value of the designated flag bit is 0, it can indicate that access is not allowed. Therefore, when the value of the designated flag bit is not 1, step S10123 is executed. When the value of the designated flag bit is 1, it indicates that the access point device corresponding to the beacon information can be accessed, and an access process can be initiated for the access point device.
[0090] It can be seen that when performing channel scanning, if the beacon information is scanned, it is determined whether the beacon information contains information allowing access. If it does not contain information allowing access, an access point device record corresponding to the beacon information is generated, including the channel information corresponding to the beacon information and the attribute information of the access point device, and the scanning continues. If no other beacon information is scanned on the current channel, the next channel in the first scanning sequence is scanned; if the scanned beacon information contains information allowing access, the electronic device to be accessed initiates access to the access point device that sent the beacon information. If the access is successful, the scanning is stopped; if the access fails, the scanning continues.
[0091] Optionally, in an implementation, the attribute information of the access point device is a device identifier, so that the number of access point devices corresponding to each channel can be counted according to the device identifier carried in the beacon information scanned in each channel. Therefore, the access point device information corresponding to each channel may be the number of access point devices. In this implementation, step S102 may include:
[0092] The multiple channels are sorted according to the number of access point devices corresponding to the multiple channels to obtain a second scanning order.
[0093] Among them, the scanning priority of each channel in the second scanning sequence is positively correlated with the number of access point devices. That is, the more access point devices are scanned in the channel, the higher the scanning priority of the channel in the second scanning sequence, and the fewer access point devices are scanned in the channel, the lower the priority of the channel in the second scanning sequence. For example, assuming that access point devices can be scanned on channels 36 and 149 in the 5G frequency band, channel 36 scans the beacon information of AP1 and AP3, and channel 149 scans the beacon information of AP2. It can be seen that channel 36 scans 2 APs, channel 149 scans 1 AP, and no AP is found in other channels. Therefore, each channel is sorted according to the number of APs. In the resulting scanning sequence, channel 36 has the highest priority, and channel 149 ranks second. It is worth mentioning that if other channels are scanned in addition to the above-mentioned channels 36 and 149, and no AP is scanned, the other scanned channels can be ranked after channel 149. Since the other channels are all scanned to AP, the ranking between the other channels can be determined according to the scanning order determined by the last scan (if the last scan is the first time, refer to the default scanning order).
[0094] Optionally, in another implementation, the attribute information of the access point device includes a device identifier and status information, and the status information includes: at least one of: signal strength, transmission rate, and the number of connected terminals. The number of access point devices corresponding to each channel can be counted according to the device identifier carried in the beacon information scanned in each channel, and the quality of service that can be provided by the access point devices in each channel can be evaluated according to the status information of the access point devices. Therefore, in this implementation, the access point device information corresponding to each channel can be the number of access point devices and the status information of each access point device in the channel. The step S102 may include:
[0095] The multiple channels are sorted according to the number of access point devices corresponding to the multiple channels and the status information of each access point device of the multiple channels to obtain a second scanning order.
[0096] For example, in one method, the multiple channels can be sorted first according to the number of access point devices corresponding to the channels. When there are at least two channels with the same number of access point devices, the at least two channels are sorted again according to the state information of each access point device of each channel to obtain a final scanning order as the second scanning order. When there are multiple pieces of state information, the at least two channels can be sorted according to each piece of state information, and the final order of the at least two channels is determined based on the obtained multiple orderings, which can be understood as: when sorting, the dimension of the number of access points is given priority, and the state information of each access point device is comprehensively considered. For example, assuming that the channels with the most APs scanned are channel 36 and channel 149, and the above-mentioned status information includes signal strength, transmission rate, and the number of connected terminals, the average signal strength, average transmission rate, and average number of connected terminals of the APs in channel 36 and channel 149 can be calculated respectively, and channels 36 and 149 can be sorted in order of high to low signal strength averages, and channels 36 and 149 can be sorted in order of high to low transmission rate averages, and channels 36 and 149 can be sorted in order of low to high terminal number averages. Assuming that channel 36 ranks higher than channel 149 in terms of signal strength averages, and ranks lower than channel 149 in terms of transmission rate averages, and ranks higher than channel 149 in terms of connected terminal number averages, it can be determined that channel 36 has the highest priority, channel 149 ranks second, and the remaining channels are sorted according to the number of access point devices.
[0097] In another manner, the number of access point devices corresponding to the channel and the status information of each access point device corresponding to the channel may be comprehensively considered. For example, for any channel, the signal strength average and the transmission rate average corresponding to the channel may be calculated according to the signal strength and the transmission rate of each access point device corresponding to the channel, and different weights may be set for the number of access point devices, the signal strength and the transmission rate, respectively. Thus, the score of each channel may be calculated according to the number of access point devices corresponding to the channel, the signal strength average and the transmission rate average, and the above-mentioned weights, and the channels may be sorted according to the scores. The scanning order priority of each channel is positively correlated with the score, that is, the higher the score, the higher the scanning order priority, and the obtained scanning order is used as the second scanning order.
[0098] Optionally, Figure 4 is a flowchart of another network scanning method according to an exemplary embodiment. Figure 4 In the case where the electronic device is an access point device, the network scanning method may further include the following steps:
[0099] In step S104, the number of terminals to be connected currently associated with the electronic device is obtained.
[0100] In step S105, the scanning period is determined according to the number of terminals to be accessed. The duration of the scanning period is positively correlated with the number of terminals to be accessed. That is, the more terminals to be accessed, the longer the duration of the scanning period.
[0101] In step S106, timing is performed based on the scanning cycle, and when the time interval from the last scanning reaches the duration of the scanning cycle, multiple channels are scanned according to the second scanning order.
[0102] It is understandable that the scanning period can be determined by the number of terminals currently associated with the electronic device. The more associated terminals there are, the longer the next scanning period will be, and the fewer associated terminals there are, the shorter the next scanning period will be. Because scanning will affect terminal performance, the longer the scanning period is, the less impact it has on the wireless performance of the terminal when the number of associated terminals is greater. When there is no associated terminal, the electronic device can enter the next channel scan without waiting. The terminal currently associated with the electronic device refers to a terminal that has established a connection with the electronic device. For example, if the electronic device is an AP, its associated terminal is a terminal that has been connected to the AP. After the AP is connected to any other AP that has been connected to the network, the terminal associated with the AP also connects to the network.
[0103] Optionally, Figure 5 is a flowchart of another network scanning method according to an exemplary embodiment. Figure 5 In the case where the electronic device is an access point device, the network scanning method may further include the following steps:
[0104] In step S107, after the electronic device accesses the network by accessing the third access point device, third beacon information is generated, and the third beacon information includes a device identification of the electronic device and information on whether the electronic device is allowed to access.
[0105] In step S108, third beacon information is broadcast.
[0106] It is understandable that when the access point device successfully accesses the network, the access point device can serve as a node for accessing the network. At this time, the access point device can generate beacon information with the access point device identification and information on whether access is allowed, and can broadcast the beacon information for scanning by other electronic devices.
[0107] In the above technical solution, by scanning multiple channels according to the first scanning order, the beacon information of at least one access point device scanned in at least one channel is obtained. When the beacon information of the at least one access point device obtained by scanning does not contain information allowing access, the access point device information corresponding to the multiple channels is determined, and the multiple channels are sorted according to the access point device information corresponding to the multiple channels to obtain a second scanning order. The second scanning order is used to scan the multiple channels according to the second scanning order when scanning the channels next time, so that the electronic device can scan the channels according to the sorted scanning order when scanning again. The above technical solution can re-sort the scanning order of each channel according to the access point device scanned in each information, so that the electronic device can scan according to the latest channel scanning order when scanning next time, and can improve the efficiency of the device to be connected to discover and connect to the access point device while minimizing the impact on the terminal associated with the device to be connected.
[0108] Figure 6 is a block diagram of a network scanning device according to an exemplary embodiment. The network scanning device 600 can be applied to electronic devices. Figure 6 , the network scanning device 600 comprises:
[0109] The scanning module 601 is configured to scan a plurality of channels in a first scanning sequence to obtain beacon information of at least one access point device scanned in at least one channel.
[0110] The determination module 602 is configured to determine the access point device information corresponding to each channel when the beacon information of the at least one access point device does not include the access permission information.
[0111] The processing module 603 is configured to sort the multiple channels according to the access point device information corresponding to the multiple channels to obtain a second scanning order, and the second scanning order is used to scan the multiple channels according to the second scanning order when scanning channels next time.
[0112] Optionally, the determination module 602 is configured to determine, when the beacon information of the at least one access point device does not contain information allowing access, access point device information corresponding to the multiple channels based on the generated access point device record of the at least one access point device; wherein the access point device record includes channel information corresponding to the beacon information of the access point device and attribute information of the access point device.
[0113] Optionally, the scanning module 601 is configured to:
[0114] A first channel is scanned to obtain first beacon information of a first access point device, where the first channel is any one of the multiple channels; wherein, when the first beacon information does not include information allowing access, an access point device record corresponding to the first beacon information is generated and a second channel is continuously scanned, where the access point device record corresponding to the first beacon information includes channel information of the first channel and attribute information of the first access point device, and the second channel is the first channel, or the second channel is a channel that is located after the first channel in a scanning order.
[0115] Optionally, the recording submodule, for any beacon information, when the beacon information includes preset format information and the value of a specified flag bit in the preset format information is a specified value, the beacon information does not include information allowing access.
[0116] Optionally, the attribute information of the access point device is a device identifier, the access point device information is the number of access point devices, and the processing module 603 is further configured to:
[0117] According to the number of access point devices corresponding to the multiple channels, the multiple channels are sorted to obtain the second scanning order, wherein the scanning order ranking of each channel in the second scanning order is positively correlated with the number of access point devices. That is, the more the number of access point devices corresponding to the channel, the higher the scanning priority in the second scanning order.
[0118] Optionally, the attribute information of the access point device includes a device identifier and status information, and the access point device information is the number of access point devices and status information of the access point devices. The processing module 603 is further configured to:
[0119] The multiple channels are sorted according to the number of access point devices corresponding to the multiple channels and the status information of the access point devices corresponding to the multiple channels to obtain the second scanning order; wherein the status information includes: at least one of: signal strength, transmission rate, and the number of connected terminals.
[0120] Optionally, the electronic device is an access point device, and the apparatus 600 may further include: an acquisition module and a determination module;
[0121] The acquisition module is configured to acquire the number of terminals to be accessed that are currently associated with the electronic device;
[0122] The determination module 602 is configured to determine a scanning period according to the number of the terminals to be accessed, and the duration of the scanning period is positively correlated with the number of the terminals to be accessed, that is, the greater the number of the terminals to be accessed, the longer the duration of the scanning period.
[0123] The scanning module is further configured to perform timing based on the scanning cycle, and scan the multiple channels according to the second scanning order when the time interval from the last scanning reaches the duration of the scanning cycle.
[0124] Optionally, the electronic device is an access point device, and the network scanning device 600 further includes:
[0125] A generating module, configured to generate third beacon information after the electronic device accesses the network by accessing the third access point device, the third beacon information including the device identification of the electronic device and information on whether the electronic device is allowed to access;
[0126] The broadcast module is configured to broadcast the third beacon information.
[0127] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0128] The present disclosure also provides a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the network scanning method provided by the present disclosure are implemented.
[0129] Figure 7 700 is a block diagram of a network scanning device 700 according to an exemplary embodiment. For example, the device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, an access point device, etc.
[0130] Reference Figure 7 , the device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .
[0131] The processing component 702 generally controls the overall operation of the device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned network scanning method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.
[0132] The memory 704 is configured to store various types of data to support operations on the device 700. Examples of such data include instructions for any application or method operating on the device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0133] The power component 706 provides power to the various components of the device 700. The power component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 700.
[0134] The multimedia component 708 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0135] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the device 700 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.
[0136] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0137] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the device 700. For example, the sensor assembly 714 can detect the open / closed state of the device 700, the relative positioning of components, such as the display and keypad of the device 700, the sensor assembly 714 can also detect the position change of the device 700 or a component of the device 700, the presence or absence of user contact with the device 700, the orientation or acceleration / deceleration of the device 700, and the temperature change of the device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0138] The communication component 716 is configured to facilitate wired or wireless communication between the device 700 and other devices. The device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0139] In an exemplary embodiment, the device 700 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned network scanning method.
[0140] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by the processor 720 of the device 700 to complete the above network scanning method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0141] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable device. The computer program has a code portion for executing the above network scanning method when executed by the programmable device.
[0142] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0143] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A network scanning method, It is characterized in that Applied to electronic equipment, the method comprises: Scan multiple channels in a first scanning order to obtain beacon information of at least one access point device scanned in at least one channel; for any beacon information, if the beacon information includes preset format information and the value of the specified flag bit in the preset format information is a specified value, the beacon information does not include information allowing access; In a case where the beacon information of the at least one access point device does not include information allowing access, determining access point device information corresponding to the plurality of channels; According to the access point device information corresponding to the multiple channels, the multiple channels are sorted to obtain a second scanning order; wherein the access point device information is the number of access point devices, and the more the number of access point devices corresponding to the channels is, the higher the scanning priority in the second scanning order is; the second scanning order is used to scan the multiple channels according to the second scanning order when scanning channels next time.
2. The method according to claim 1, It is characterized in that The determining, when the beacon information of the at least one access point device does not include the access permission information, the access point device information corresponding to the plurality of channels includes: In a case where the beacon information of the at least one access point device does not include information allowing access, determining access point device information corresponding to the plurality of channels according to the generated access point device record of the at least one access point device; The access point device record includes channel information corresponding to the beacon information of the access point device and attribute information of the access point device.
3. The method according to claim 1, It is characterized in that The step of scanning a plurality of channels in a first scanning order to obtain beacon information of at least one access point device scanned in at least one channel includes: A first channel is scanned to obtain first beacon information of a first access point device, where the first channel is any one of the multiple channels; wherein, when the first beacon information does not include information allowing access, an access point device record corresponding to the first beacon information is generated and a second channel is continuously scanned, where the access point device record corresponding to the first beacon information includes channel information of the first channel and attribute information of the first access point device, and the second channel is the first channel, or the second channel is a channel that is located after the first channel in a scanning order.
4. The method according to claim 1, It is characterized in that The access point device information is the number of access point devices and the state information of the access point devices, and the sorting of the multiple channels according to the access point device information corresponding to the multiple channels to obtain a second scanning order includes: According to the number of access point devices corresponding to the multiple channels and the status information of the access point devices corresponding to the multiple channels, the multiple channels are sorted to obtain the second scanning order; wherein the status information includes: at least one of: signal strength, transmission rate, and the number of connected terminals.
5. The method according to claim 1, It is characterized in that The electronic device is an access point device, and the method further includes: Obtaining the number of terminals to be connected currently associated with the electronic device; Determine a scanning period according to the number of terminals to be accessed; wherein, the greater the number of terminals to be accessed, the longer the duration of the scanning period; Timing is performed based on the scanning cycle, and when the time interval from the last scanning reaches the duration of the scanning cycle, the plurality of channels are scanned according to the second scanning order.
6. The method according to claim 1, It is characterized in that The electronic device is an access point device, and the method further includes: After the electronic device accesses the network by accessing the third access point device, third beacon information is generated, wherein the third beacon information includes a device identification of the electronic device and information on whether the electronic device is allowed to access; The third beacon information is broadcasted.
7. A network scanning device, It is characterized in that Applied to electronic equipment, the device comprises: A scanning module is configured to scan multiple channels in a first scanning order to obtain beacon information of at least one access point device scanned in at least one channel; for any beacon information, if the beacon information includes preset format information and the value of the specified flag bit in the preset format information is a specified value, the beacon information does not include information allowing access; a determination module configured to determine access point device information corresponding to the plurality of channels when the beacon information of the at least one access point device does not contain access permission information; The processing module is configured to sort the multiple channels according to the access point device information corresponding to the multiple channels to obtain a second scanning order; wherein the access point device information is the number of access point devices, and the more the number of access point devices corresponding to the channels is, the higher the scanning priority in the second scanning order is; and the second scanning order is used to scan the multiple channels according to the second scanning order when scanning channels next time.
8. A network scanning device, It is characterized in that Used in electronic equipment, including: processor; a memory for storing processor-executable instructions; The processor is configured to: execute the executable instructions to implement the steps of the method in any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
