CN114980041A - WiFi signal scanning method, device, terminal and storage medium - Google Patents

WiFi signal scanning method, device, terminal and storage medium Download PDF

Info

Publication number
CN114980041A
CN114980041A CN202110192236.XA CN202110192236A CN114980041A CN 114980041 A CN114980041 A CN 114980041A CN 202110192236 A CN202110192236 A CN 202110192236A CN 114980041 A CN114980041 A CN 114980041A
Authority
CN
China
Prior art keywords
scanning
channel
channels
type
wifi
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.)
Pending
Application number
CN202110192236.XA
Other languages
Chinese (zh)
Inventor
翟召轩
曾春亮
朱洪波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110192236.XA priority Critical patent/CN114980041A/en
Priority to PCT/CN2022/073470 priority patent/WO2022174722A1/en
Publication of CN114980041A publication Critical patent/CN114980041A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B17/00Monitoring; Testing
    • H04B17/30Monitoring; Testing of propagation channels
    • H04B17/309Measuring or estimating channel quality parameters
    • H04B17/318Received signal strength

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application discloses a WiFi signal scanning method, a WiFi signal scanning device, a terminal and a storage medium, and belongs to the technical field of Internet of things. When the WiFi available channel is scanned, the two types of channels with different numbers are respectively scanned to obtain a first scanning result and a second scanning result, because the number of the second type of channels is smaller than that of the first type of channels, the time length for scanning is shortened by a method for repeatedly scanning the full channels relatively in a scene for obtaining a plurality of scanning results, and the time interval between the scanning of the first type of channels and the scanning of the second type of channels is a first preset time length, so that the equipment can recover to the originally working WiFi channel within a certain time between the two types of scanning, and the influence of the scanning of other channels on the originally used WiFi channel is reduced.

Description

WiFi signal scanning method, device, terminal and storage medium
Technical Field
The embodiment of the application relates to the technical field of internet of things, in particular to a WiFi signal scanning method, a WiFi signal scanning device, a WiFi signal scanning terminal and a storage medium.
Background
With the continuous development of Internet of Things (Internet over Things), more and more electronic devices can interact with each other in a wireless manner.
In the related art, a WiFi (Wireless Fidelity) signal can be used to support communication between electronic devices. When the first device acquires the broadcasting information of the peripheral devices based on the WiFi signals, the first device is influenced by a WiFi wireless protocol scanning strategy, and the conventional WiFi scanning mode has the defects of long time for acquiring scanning results and low efficiency.
Disclosure of Invention
The embodiment of the application provides a WiFi signal scanning method, a WiFi signal scanning device, a terminal and a storage medium. The technical scheme is as follows:
according to an aspect of the present application, there is provided a WiFi signal scanning method, the method including:
scanning a first type of channel in WiFi available channels to obtain a first scanning result, wherein the first scanning result comprises part or all information of scanned part or all broadcast data packets and signal intensity of corresponding broadcasting equipment;
scanning a second type of channel in the WiFi available channel to obtain a second scanning result, wherein the second scanning result comprises part or all information of the scanned part or all broadcast data packets and the signal intensity of corresponding broadcasting equipment;
the number of the second type channels is smaller than that of the first type channels, and the interval duration between the scanning of the first type channels and the scanning of the second type channels is a first preset duration.
According to another aspect of the present application, there is provided a WiFi signal scanning method, the method including:
carrying out wifi signal scanning according to a preset period;
wherein the preset period includes: and performing M rounds of first-class channel scanning and N rounds of second-class channel scanning, wherein the number of the second-class channels is less than that of the first-class channels, the interval duration between each round of scanning is the same or different, and M and N are positive integers.
According to another aspect of the present application, there is provided a WiFi signal scanning apparatus, the apparatus comprising:
the first scanning module is used for scanning a first type of channel in the WiFi available channels to obtain a first scanning result, wherein the first scanning result comprises part or all information of scanned part or all broadcast data packets and signal intensity of corresponding broadcasting equipment;
a second scanning module, configured to scan a second type of channel in the WiFi available channels to obtain a second scanning result, where the second scanning result includes part or all of the scanned information of part or all of the broadcast data packets and signal strength of corresponding broadcast equipment;
the number of the second type channels is smaller than that of the first type channels, and the interval duration between the scanning of the first type channels and the scanning of the second type channels is a first preset duration.
According to another aspect of the present application, there is provided a WiFi signal scanning apparatus, the apparatus including:
the third scanning module is used for carrying out wifi signal scanning according to a preset period;
wherein the preset period includes: and performing M rounds of first-class channel scanning and N rounds of second-class channel scanning, wherein the number of the second-class channels is less than that of the first-class channels, the interval duration between each round of scanning is the same or different, and M and N are positive integers.
According to another aspect of the present application, there is provided a terminal comprising a processor and a WiFi transceiver;
the processor is configured to instruct the WiFi transceiver to scan a first type of channel in WiFi available channels, to obtain a first scanning result, where the first scanning result includes partial or all information of a scanned partial or all broadcast data packets and signal strength of corresponding broadcast equipment;
the processor is configured to instruct the WiFi transceiver to scan a second type of channel in the WiFi available channels to obtain a second scanning result, where the second scanning result includes part or all of information of the scanned part or all of broadcast data packets and signal strength of corresponding broadcast equipment; the number of the second type channels is smaller than that of the first type channels, and the interval duration between the scanning of the first type channels and the scanning of the second type channels is a first preset duration.
According to another aspect of the present application, there is provided a terminal comprising a processor and a WiFi transceiver;
the processor is used for indicating the WiFi transceiver to carry out WiFi signal scanning according to a preset period;
wherein the preset period includes: and performing M rounds of first-class channel scanning and N rounds of second-class channel scanning, wherein the number of the second-class channels is less than that of the first-class channels, the interval duration between each round of scanning is the same or different, and M and N are positive integers.
According to another aspect of the present application, there is provided a computer-readable storage medium having at least one instruction stored therein, the instruction being loaded and executed by a processor to implement the WiFi signal scanning method as provided in the various aspects of the present application.
According to one aspect of the present application, a computer program product is provided that includes computer instructions stored in a computer readable storage medium. The computer instructions are read by a processor of the computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to execute the WiFi signal scanning method provided in the various alternative implementations of any one of the aspects.
According to the WiFi signal scanning method provided by the embodiment of the application, when the WiFi available channels are scanned, the first scanning result and the second scanning result are obtained by respectively scanning the two types of channels with different numbers, because the number of the second type of channels is smaller than that of the first type of channels, in a scene for obtaining a plurality of scanning results, the time length for scanning the whole channels is shortened by a method for repeatedly scanning the whole channels relatively, and the time interval between the scanning of the first type of channels and the scanning of the second type of channels is the first preset time length, so that equipment can recover to the originally working WiFi channels within a certain time between the two types of scanning, and the influence of the scanning of other channels on the originally used WiFi channels is reduced.
Drawings
In order to more clearly describe the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 2 is a flowchart of a WiFi signal scanning method provided by an exemplary embodiment of the present application;
fig. 3 is a flowchart of a WiFi signal scanning method shown in the present application;
fig. 4 is a flowchart of a WiFi signal scanning method provided by another exemplary embodiment of the present application;
fig. 5 is a flowchart of a WiFi signal scanning method provided by another exemplary embodiment of the present application;
fig. 6 is a flowchart of a WiFi signal scanning method provided by an embodiment of the present application;
fig. 7 is a block diagram of a WiFi signal scanning apparatus according to an exemplary embodiment of the present application;
fig. 8 is a block diagram of another WiFi signal scanning apparatus provided in an exemplary embodiment of the present application;
fig. 9 is a block diagram of a computer device according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
When the following description refers to the accompanying drawings, like 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 application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In the description of the present application, 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 the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "connected" and "connected" are to be interpreted broadly, e.g., as being fixed or detachable or integrally connected; can be mechanically or electrically connected; may be directly connected or indirectly connected through an intermediate. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B, which may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In the related art, when the first device measures the distance between the surrounding second devices and itself, an instruction for full channel scanning may be issued to the WiFi transceiver in the first device. Wherein, WiFi transceivers of different models have different full channel scanning strategies. The purpose of the full channel scan is to scan channels available for WiFi in a traversal fashion. For example, if the total number of WiFi available channels is 18, the purpose of the full channel scan is to perform a round of traversal on the 18 WiFi available channels, so as to acquire signal information of the wireless signal in each WiFi available channel. Therefore, in a scenario where signal information of multiple wireless signals is needed, the time delay for the first device to acquire the multiple signal information is high, and power consumption is large. For example, in a scenario where the first device needs to calculate the distance from the second device according to the multiple pieces of signal information, the process of the first device obtaining the multiple pieces of signal information has a high time delay and a high energy consumption.
Illustratively, in one possible scenario of full channel scanning, the total number of WiFi available channels is 18, and the scanning period is 40 ms. The first device is camped on channel 6 before starting the process. Illustratively, the 18 WiFi available channels may be 1 st channel, 2 nd channel, 3 rd channel, 4 th channel, 5 th channel, 6 th channel, 7 th channel, 8 th channel, 9 th channel, 10 th channel, 11 th channel, 12 th channel, 13 th channel, 149 th channel, 153 th channel, 157 th channel, 161 th channel, and 165 th channel.
During the first scan round of the full channel scan, the WiFi transceiver switches the currently listened channel from channel 6 to channel 1 and listens for 40 ms. The WiFi transceiver then switches the currently listened to channel back to channel 6 and listens for 60 ms.
In each scanning process after the first scanning process of the full channel scanning, the WiFi transceiver switches the currently monitored channel from the 6 th channel to the channel to be scanned for 40 milliseconds. The WiFi transceiver then switches the currently listened channel back to channel 6 for listening for 60 ms. And then, performing the next scanning process until the WiFi transceiver finishes scanning the 18 channels, and generating a scanning result containing the 18 channels. At this point, the WiFi transceiver completes one round of full channel scanning.
It should be noted that, in order to reduce the influence of the first device on normal reception of WiFi data during full channel scanning, a process of switching back and forth between an originally camped channel and a channel to be scanned is usually designed in the full channel scanning process. The scheme provided by the application can reduce the power consumption and the time delay for acquiring a plurality of signal information scenes, and is specifically introduced as follows.
For the understanding of the present application, before describing the detailed description, the meanings and application scenarios of several nouns are first described.
WiFi available channel: indicating the channels that the WiFi signal may use. In one possible approach, the specific channel number of the WiFi available channel is related to the specific agency using the WiFi signal. The designated organization may be an administrative organization such as a country, province, or city, or an industrial organization such as a communication association or a communication standard organization. The designation mechanism may designate different WiFi available channels for different regions.
Illustratively, in one possible way of planning the channels available for WiFi. The WiFi available channels are 18 channels.
First type channel: are some or all of the channels available in WiFi. In one possible approach, the first type of channel is a partial channel of the WiFi available channels. In another possible approach, the first type of channels are all of the channels available for WiFi.
Taking the WiFi available channels as an example, the number of the first type of channels is less than or equal to 17 when the first type of channels are partial channels of the WiFi available channels. When the first type of channel is all of the WiFi available channels, the first type of channel is all of the 18 WiFi available channels.
Second type channel: are part of the channels available in WiFi. In one possible approach, the number of channels of the second type is smaller than the number of channels of the first type. In the embodiment of the application, the number of the second type channels is smaller than that of the first type channels. Thus, in a scenario where the duration of scanning a WiFi available channel is fixed, the total duration of scanning the second type of channel is shorter than the total duration of scanning the first type of channel.
The first scanning result: the first scanning result at least comprises two parts of contents, namely information of the broadcast data packet and signal strength of a broadcasting device corresponding to the broadcast data packet.
Note that, the signal strength of the broadcasting device: may be used to indicate the signal strength of the broadcast data packet received by the first device. The distance between the first device and the target device can be calculated by acquiring the signal strength of the broadcast data packet corresponding to the target device received by the first device.
Optionally, scanning the first type of channel may obtain a plurality of broadcast packets, and the broadcast packet corresponding to the first scanning result may be all of the broadcast packets or a part of the broadcast packets. If the first type of channel is scanned to obtain 5 broadcast data packets, the corresponding broadcast data packet in the first scanning result may be the above 5 data packets, or may be a partial data packet in the 5 broadcast data packets. It should be noted that the broadcast packet obtained by scanning the first type of channel may include a variety of information. The information of the broadcast packet in the first scanning result may be all information in the broadcast packet obtained by scanning the first type channel, or may be partial information in the broadcast packet obtained by scanning the first type channel.
Optionally, scanning the first type of channel may further obtain signal strengths of broadcasting devices corresponding to a plurality of broadcast packets. It should be noted that the signal strength of the broadcasting device in the first scanning result corresponds to the broadcasting data packet in the first scanning result. For example, scanning the WiFi available channel results in 5 broadcast packets, packet 1, packet 2, packet 3, packet 4, and packet 5. The corresponding broadcast packets in the first scanning result are packet 1, packet 2 and packet 5, respectively. In this scenario, the signal strengths of the broadcasting devices in the first scanning result are the signal strength of the broadcasting device transmitting the packet 1, the signal strength of the broadcasting device transmitting the packet 2, and the signal strength of the broadcasting device transmitting the packet 5, respectively.
And the second scanning result: the type of the information included in the second scanning result is similar to the type of the information included in the first scanning result, and reference is made to the above description, which is not repeated herein.
Signal strength: may be represented by RSSI (Received Signal Strength Indication).
Referring to fig. 1, fig. 1 is a schematic diagram of an implementation environment according to an embodiment of the present disclosure. The implementation environment includes a first device 110 and a second device 120.
The first device 110 is an electronic device with a wireless signal transceiving function, the electronic device may be a smart phone, a tablet computer, a wearable device, a personal computer, or the like, and the wireless signal transceiving function may be implemented by a signal transceiving component. When the first device 110 starts the wireless signal transceiving function, the signal transceiving component can receive the wireless signal transmitted by other devices in the signal receiving range, and can transmit the wireless signal to other devices in the signal transmitting range. The signal transceiver component may be built in the first device 110, or may be externally connected to the first device 110, which is not limited in this embodiment.
In some embodiments, when the signal transceiver component is a WiFi component, the wireless signal transmitted and received by the signal transceiver component is a WiFi signal.
The second device 120 is an electronic device with wireless signal transceiving function, which may be an IoT device, such as a wireless sound box 121, a smart television 122, a smart door lock 123, a smart light fixture 124, or a smart watch 125, and the wireless signal transceiving function may be implemented by a signal transceiving component. When the second device 120 starts the wireless signal transceiving function, the signal transceiving component can receive the wireless signal transmitted by other devices in the signal receiving range, and can transmit the wireless signal to other devices in the signal transmitting range.
In one possible scenario, when the signal transceiving functions of the first device 110 and the second device 120 are both turned on, the second device 120 transmits a wireless signal through the signal transceiving component, and the first device 110 receives the wireless signal through the signal transceiving component. In this embodiment, the period and the used channel of the wireless signal transmitted by the second device 120 are not changed, and the first device 110 performs a first scanning of the first type of channel to obtain a first scanning result, and performs a second scanning of the second type of channel to obtain a second scanning result, so as to obtain the signal strengths of multiple wireless signals quickly.
The embodiment of the present application takes an example in which the wireless signal scanning method is applied to the first device 110.
Please refer to fig. 2, which is a flowchart illustrating a WiFi signal scanning method according to an exemplary embodiment of the present application. The WiFi signal scanning method may be applied in the first device shown above. In fig. 2, the WiFi signal scanning method includes:
step 210, scanning a first type of channels in the WiFi available channels to obtain a first scanning result, where the first scanning result includes part or all of the information of the scanned part or all of the broadcast data packets and the signal strength of the corresponding broadcasting device.
In one possible approach, the first device may be a mobile terminal with a display screen. When the screen of the mobile terminal is lighted, the processor in the first device issues an instruction to the WiFi transceiver to instruct the WiFi transceiver to scan the first type of channels of the WiFi available channels, and a first scanning result is obtained. The first scanning result comprises part or all information of the scanned part or all broadcast data packets and the signal intensity of the corresponding broadcasting equipment. Illustratively, the broadcast packet may include a name and a matching identifier of the WiFi hotspot from which the broadcast packet is transmitted. The name of the WiFi hotspot may be an SSID (Service Set Identifier), and the matching Identifier may be an Identifier of the broadcasting device. In a possible embodiment, the broadcast packet may also include information of the broadcast channel, since the broadcasting device, e.g. the second device, would configure the channel used for the broadcast in the broadcast packet.
In another possible approach, the first device starts to perform the first type of channel scanning for the WiFi available channels at the preset occasion. Optionally, the preset scene may be a home scene, an office scene, or a resident place scene. The first device may store a machine learning model therein, which identifies whether the first device is in a predetermined scene. Illustratively, the input parameters of the machine learning model may include one or more of time, location, and wireless signal strength. That is, in response to the first device being in the preset scene, the first device starts to perform the first type of channel scanning on the WiFi available channels.
Step 220, scanning a second type of channels in the WiFi available channels to obtain a second scanning result, where the second scanning result includes part or all of the information of the scanned part or all of the broadcast data packets and the signal strength of the corresponding broadcasting device. The number of the second type channels is smaller than that of the first type channels, and the interval duration between the scanning of the first type channels and the scanning of the second type channels is a first preset duration.
It is understood that the first preset time period may be a numerical value, such as a fixed value, or may be one of a group of numerical values, or may be one of a numerical range.
In one possible approach, the first device will perform step 210 first, and then step 220. The flow actually performed may refer to the flow chart shown in fig. 2. In this implementation, the interval duration between the first device finishing scanning the first type of channels in the WiFi available channels and the first device starting scanning the second type of channels in the WiFi available channels is a first preset duration. It should be noted that the first preset time period may be a predetermined time period. If the first device scans a first round of the first type of channel and then scans a second round of the second type of channel, the first preset time length is a fixed interval time length between the first and second rounds of the first and second type of channels, and certainly, the interval time length between the two rounds of scanning the second type of channel can also be the first preset time length. For example, the first preset time period may be 5 seconds, 6 seconds, 8 seconds, or 10 seconds. The interval duration between any two scanning rounds can be any one of the above, and the interval duration between each two scanning rounds can be the same or different.
In another possible approach, please refer to fig. 3, wherein fig. 3 is a flowchart of a WiFi signal scanning method shown in this application. In fig. 3, the first device will perform step 220 and then step 210. The condition for triggering the execution of step 220 by the first device may refer to the triggering condition of step 210, which is not described again. In this implementation, the interval duration between the first device finishing scanning the first type of channels in the WiFi available channels and the first device starting scanning the second type of channels in the WiFi available channels may still be the first preset duration.
In summary, in the WiFi signal scanning method provided in this embodiment, when the WiFi available channels are scanned, the two types of channels with different numbers are respectively scanned to obtain the first scanning result and the second scanning result, because the number of the second type of channels is smaller than the number of the first type of channels, in a scene in which a plurality of scanning results are obtained, the time duration for scanning the full channels is shortened by using the method of relatively repeatedly scanning the full channels, and the time interval between scanning the first type of channels and scanning the second type of channels is the first preset time duration, so that the device can recover to the originally working WiFi channel within a certain time between the two types of scanning, and the influence of scanning other channels on the originally used WiFi channel is reduced.
Based on the solution disclosed in the previous embodiment, the first device can also achieve efficiency of WiFi signal scanning by controlling other parameters in the scanning process, please refer to the following embodiments.
Please refer to fig. 4, which is a flowchart illustrating a WiFi signal scanning method according to another exemplary embodiment of the present application. The WiFi signal scanning method may be applied in the first device shown above. The first channel can be scanned first and then the second channel can be scanned, and the second channel can be scanned first and then the first channel can be scanned. For convenience of introduction, in fig. 4, taking an example of scanning first type channels and then scanning second type channels as an example, the WiFi signal scanning method includes:
in step 410, a first type of channels in the WiFi available channels are scanned to obtain a first scanning result.
In this example, the execution process of step 410 is the same as the execution process of step 210, and is not described herein again.
In one possible approach, the broadcast data packet in the first scanning result is transmitted by the broadcasting device. And broadcasting the broadcast data packet to the surrounding space by the broadcasting equipment according to a preset broadcasting protocol. Since the WiFi channel where the broadcast packet is located is one of the WiFi available channels, the first device does not know which available channel the broadcast packet specifically uses when scanning the WiFi available channel. Also, in some specific scenarios, the first device needs to acquire a plurality of broadcast packets to obtain a distance from the broadcasting device.
Optionally, the broadcasting device may have the capability of transmitting the broadcast data packet. Due to the large number of WiFi devices in daily life. Some of the devices are broadcast devices for which the first device is interested and wishes to obtain broadcast packets, and some of the devices are broadcast devices for which the first device is not interested for broadcast packets. In this scenario the device that the first device is interested in and wants to retrieve its broadcast packets is the target device and the broadcast device for broadcast packets that the first device is not interested in is the non-target device.
In one possible approach, the broadcasting device includes only the target device. In this scenario, the broadcast packet may be data that is subsequently useful for the first device, and may be used for subsequently calculating a distance to the target device, or displaying a signal strength of the target device.
In another possible approach, the broadcast device includes both target devices and non-target devices. In this scenario, the first device may acquire only a broadcast packet corresponding to the target device, to calculate a distance to the target device using the broadcast packet, and to display the signal strength of the target device.
In another possible approach, the broadcast device includes only non-target devices. In this scenario, the first device does not acquire a broadcast packet of a target device that it needs. Therefore, the first device continues to perform WiFi channel scanning until the broadcast data of the target device is acquired, and then calculates the distance between the first device and the target device by using the broadcast data packet, and displays the signal strength of the target device.
Note that, in daily life, the user is in a home or an office. WiFi devices in the vicinity of the first device include both devices that the first device may control and devices that the first device may not control. It is an object of the present application to know the distance between a device controllable by a first device and the first device. Thus, in this scheme, the first device may acquire only the target device among the broadcasting devices. Wherein the target device is a broadcasting device satisfying a first preset condition.
Alternatively, the first preset condition may include two conditions.
Illustratively, the first condition is that the matching identifier carried in the broadcast packet matches a preset template. In this scenario, the first device locally stores a preset template, where the preset template may be a white list storing a plurality of identifiers, or may be a calculation model matching rules. After the first device obtains the matching identifier carried in the broadcast data packet, if the preset template is a white list, matching the matching identifier with the identifier in the white list. And when the matching is hit, the first device determines that the matching identifier is matched with the preset template, and the matching identifier in this case can be understood as the preset matching identifier. If the preset template is a calculation model, the matching identification carried in the broadcast data packet is used as an input variable, and whether the broadcast equipment meets a first preset condition is judged through the numerical value of the output variable. In one possible scenario, the computational model can output a logical value of 1 or 0. Wherein, a logic value of 1 indicates that the broadcasting equipment satisfies the first preset condition, and a logic value of 0 indicates that the broadcasting equipment does not satisfy the first preset condition.
Illustratively, the second condition is that the broadcasting device provides its own control authority. For the first device, the broadcasting device may be a device that has been pre-bound or provided with control authority in advance, for example, a smart camera, a smart air conditioner, a smart door lock, or a smart television. When the first device recognizes the device again, it is determined that the broadcasting device is the target device. In another possible approach, the broadcast device may be the device that first established a connection with the first device. When the control right provided by the broadcasting device to the first device passes the authentication of the first device, that is, the first device verifies that the control right is a right for controlling the broadcasting device, the first device will be identified as a target device.
It should be noted that, after the step 410 is completed, the first device may count time by setting a first timer, and an timeout duration of the first timer is set to be a first preset duration.
Step 420, a first timer is set, and the timeout duration of the first timer is a first preset duration.
Alternatively, the timing for setting the first timer may be the time when the scanning of the first type of channel is completed. The timing of setting the first timer may also be a timing at which the first scanning result is obtained. Of course, other time points are also possible, for example, a certain delay or adjustment is performed based on the above time points.
It should be noted that, the processor in the first device may receive the information fed back by the WiFi transceiver at the time when the WiFi transceiver scans the first type of channel. Thus, the processor in the first device is able to set the first timer at that time.
In another scenario of setting the first timer, the processor in the first device may also set the first timer when receiving the first scanning result provided by the WiFi transceiver.
Step 430, in response to the timeout of the first timer, scanning a second type of channels in the WiFi available channels to obtain a second scanning result.
In the application, the first device can scan the second type of channel when the first timer times out, so as to obtain a second scanning result.
In the present application, the second type of channel may include the following three constituent cases.
In the first case, the second type of channels includes only designated channels. The designated channel is a channel to which a channel number is previously designated. In one possible approach, the designer may determine the designated channel based on the location of use of the first device using the scheme. Alternatively, the location of use of the first device may be determined by the geographical location and/or operator identification fed back by the first device. Different points of use may correspond to different designated channels.
Alternatively, the designated channels may be non-overlapping channels. That is, if the designated channel is a set of channels greater than 1 channel, the designated channel is a set of non-overlapping channels. In one possible approach, the non-overlapping channel may be at least one of a following 3 sets of non-overlapping channels. The first set of non-overlapping channels includes a 1 st channel, a 6 th channel, and an 11 th channel. The second set of non-overlapping channels includes a 2 nd channel, a 7 th channel, and a 12 th channel. The third set of non-overlapping channels includes channel 3, channel 8, and channel 13. It should be noted that, because of mutual interference between different sets of non-overlapping channels, in one possible implementation, a given channel may only be selected from the above set of non-overlapping channels. In one possible implementation, the designated channel is a channel commonly used by the device, for example, channels commonly used by devices on the market for transmitting WiFi broadcast signals, such as channel 1, channel 6, and channel 11, are obtained by statistics.
In the second case, the second type of channel includes both the designated channel and the broadcast channel. In this scenario, the second type may include, in addition to the specified channel, a broadcast channel including a channel on which a broadcast packet broadcasted by the target device is scanned, or the broadcast channel may include a channel indicated by channel information of a channel in the broadcast packet broadcasted by the target device. In this scenario, the processor in the first device can know the channel where the broadcast packet received by the WiFi transceiver is located, that is, the WiFi transceiver informs the processor in the first device of which channel the broadcast packet is received on. In another scenario, the WiFi transceiver does not inform itself on which channel the broadcast packet is received, but the broadcast packet carries channel information indicating through which channel the broadcast packet is transmitted.
In a third case, the second type of channel comprises only broadcast channels. In this scenario, the second type of channel includes only broadcast channels.
It should be noted that in some scenarios, the first device may not be able to determine the broadcast channel due to the logic limitations of the underlying design of the WiFi transceiver used, or due to the fact that no channel information is carried in the broadcast packet. In this scenario, the first device may only scan the designated channels as channels of the second type.
Optionally, a period of the WiFi signal scanning method shown in this application includes one round of scanning the first type of channel and n rounds of scanning the second type of channel, where n is a positive integer. It should be noted that, in order to improve the scanning efficiency, n may be set to be smaller under the condition of effectively reducing the packet loss rate. For example, in the simulation design stage, the packet loss rate is about 50% when n is 1, about 25% when n is 2, and about 10% when n is 3. To balance the efficiency and power consumption of the scanning WiFi transceiver in transmitting broadcast packets, the value of n may be set to 3 in advance. That is, in this scenario, the first device may scan 1 round of the first type of channels and 3 rounds of the second type of channels in one cycle of the WiFi signal scan. Taking this scenario as an example, a round sequence for performing the above-mentioned 4 rounds of scanning in one cycle of the present application is described.
The first scanning sequence: (1) scanning a first type of channel; (2) 1, scanning a second type of channel in turn; (3) scanning the second type of channels in the 2 nd round; (4) round 3 scans the second type of channel.
The second scanning sequence: (1) 1, scanning a second type of channel in turn; (2) scanning a first type of channel; (3) scanning the second type of channels in the 2 nd round; (4) round 3 scans the second type of channel.
The second scanning sequence: (1) 1, scanning a second type of channel in turn; (2) scanning the second type of channels in the 2 nd round; (3) scanning a first type of channel; (4) round 3 scans the second type of channel.
The second scanning sequence: (1) 1, scanning a second type of channel in turn; (2) scanning the second type of channels in the 2 nd round; (3) scanning the second type of channels in the 3 rd round; (4) channels of a first type are scanned.
It should be noted that there is a time interval (interval duration) between any two scanning passes, and the time interval may be a first preset duration. In one possible approach, the time interval between any two scanning passes is equal, for example, the preset first preset time is 5 seconds, and the time interval between any two scanning passes is set to 5 seconds.
In another possible way, the time interval between each two scanning passes is a preset value and may not be equal. For example, there are 3 time intervals for the above scanning, and the first device may preset the first time interval to be 4.5 seconds, the second time interval to be 4 seconds, and the 3 rd time interval to be 5 seconds.
In yet another possible approach, the first preset duration may indicate one of the durations of the preset value range. For example, the preset value range of the first preset duration is a first preset interval [4 seconds, 5 seconds ]. After one round of WiFi channel scanning is executed, the first device randomly determines a time interval from a preset value range [4 seconds, 5 seconds ] to serve as the interval time between any two rounds of scanning.
It should be noted that the 3 setting methods of the first preset time duration are only exemplary, and do not limit the present application to other manners in which the first preset time duration can be preset. In another possible embodiment of the present application, the interval time between any two scanning rounds can be adjusted from a first preset time length to a second preset time length, wherein the first preset time length is shorter than the second preset time length.
In this application, the first device may determine that the device transmitting the broadcast packet is the target device when scanning the first type of channel, or may determine that the device transmitting the broadcast packet is the target device when scanning the second type of channel. Optionally, the first device may be capable of responding to matching between a matching identifier written in a broadcast packet and a preset template, and when the matching identifier matches with the preset template, the first device determines that the device sending the broadcast packet is the target device. When the first device confirms that the device for sending the broadcast data packet is the target device, the first device adjusts the interval duration of two scanning rounds from a first preset duration to a second preset duration, and the second preset duration is smaller than the first preset duration.
Illustratively, if the first preset duration is a fixed value of 5 seconds, the second preset duration is a duration shorter than the fixed value. For example, in this scenario, the second preset duration may be 2 seconds.
For example, if the first preset time period is any one of a fixed set of values, for example, 4.5 seconds, 4 seconds, and 5 seconds, the second preset time period may also be any one of a corresponding set of values, and the second preset time period is smaller than the corresponding first preset time period. For example, in this scenario, the second preset time period is 1.5 seconds, 1 second, and 2 seconds.
Illustratively, if the first predetermined duration is a value within a predetermined interval, for example, a value within a first predetermined interval [4 seconds, 5 seconds ], the second predetermined duration may be a value within a second predetermined interval [1 second, 2 seconds ].
In one possible approach, the use of the second preset duration has a valid duration. And when the first equipment changes the first preset time length into a second preset time length, using the effective time length of the second preset time length as a first time interval. It should be noted that the valid period is not limited by the number of rounds and the period of scanning WiFi valid channels. For example, in the first period, the interval time between any two scans is set to a second preset duration, regardless of the first device performing several cycles of WiFi active channels.
It should be noted that, when the system time of the first device is within the first period, the duration of the interval between each round of channel scanning may be the same. And/or when the system time of the first device is not in the first period, the interval duration between each round of channel scanning can be the same. In the setting mode, the complexity of time interval setting can be reduced, and the robustness of the system can be improved. It can be understood that, when the system time of the first device is in the first period, the duration of the interval between each channel scan may also be different, and similarly, when the system time of the first device is not in the first period, the duration of the interval between each channel scan may also be different.
On the basis, the application provides two methods for recovering the second preset duration to the first preset duration.
In a first recovery method, the first device recovers the second preset duration to the first preset duration in response to the system time not being in the first period. If the effective duration of the second preset duration is 30 seconds, the fact that the system time is not in the first time period means that 30 seconds have elapsed since the system time adjusted the first preset duration to the second preset duration, and at this time, the first device restores the second preset duration to the first preset duration.
In a second recovery method, in response to the system being in the first time period at the moment and the matching identifier in the scanning result of the current round not matching the preset template, the second preset duration is recovered to the first preset duration. Taking the effective duration of the second preset duration as 30 seconds as an example, when the system is still within 30 seconds after the first preset duration is adjusted to the second preset duration, the matching identifier of the first device in the scanning result of the current round is different from the preset template, and at this time, the second preset duration is restored to the first preset duration.
And step 440, calculating the distance between the target device and the target device according to part or all of the information in the first scanning result and/or the second scanning result.
In one possible implementation, the first device uses all information in the first scanning result and the second scanning result in a superposition manner to calculate the distance between the first device and the target device.
In another possible embodiment, if the data quality of the first scanning result is high, the distance to the target device can be calculated separately, and the first device only uses the data in the first scanning result. Similarly, if the data quality of the second scanning result is high, and the distance to the target device can be calculated independently, the first device only uses the data in the second scanning result.
A way of calculating the distance to the target device from the scanning result is now introduced.
Illustratively, the first device may use the received signal strength of the broadcast packet transmitted by the target device, which is obtained in the scanning result, as the original signal strength, and the signal strength is expressed by RSSI, where a larger RSSI indicates a smaller loss of the wireless signal in the propagation process, and conversely, a smaller RSSI indicates a larger loss of the wireless signal in the propagation process. The raw signal strengths may be a set of signal strengths provided by each of the first scan results and the second scan results. For example, the first scanning result is a result obtained by the first device scanning a first type of channel, and may specifically include the received signal strength R1 of the broadcast packet transmitted by the target device a. If the second scanning result is the result obtained by the first device scanning a second type of channel, the second scanning result may specifically include the channel strength R2 of the received broadcast packet transmitted by the target device a; similarly, if there are other scanning results obtained from the scanning round, the scanning results include R3 and R4. In this scenario, the data of raw signal strength includes a total of four data of R1, R2, R3, and R4.
On the basis, the first device corrects the original signal strength through a correction function to obtain corrected signal strength. The modified signal strength is used to modify the effect of the first device and/or target device differences on the signal strength measurement. Since the measurement result of the signal strength is affected by the receiving device (i.e., the first device) and the transmitting device (i.e., the target device) (i.e., the signal strength measurement results of the wireless signals transmitted by different receiving devices to the same target device are different in the same device interval; and the signal strength measurement results of the wireless signals transmitted by different transmitting devices are different in the same device interval), the first device needs to correct the original signal strength in order to improve the accuracy of the signal measurement result.
The correction process of the signal strength can be understood as standardization of a measurement process, that is, a measurement process of a wireless signal sent by the first device to the target device at an actual device distance is converted into a measurement process of a wireless signal sent by the standard receiving device to the standard sending device at the actual device distance. It should be noted that, if the first device and the target device are both standard devices, the first device does not need to perform signal strength correction.
In one possible embodiment, a correction function for signal strength correction is provided in the first device, and in the signal strength correction process, the first device takes the measured raw signal strength as a function input and determines a function output of the correction function as the corrected signal strength. Different receiving devices and/or transmitting devices correspond to different correction functions, and the correction functions can be preset at the first device or acquired from a server and stored by the first device.
Since the effect of the receiving device on the signal strength measurement is large, in one possible embodiment the correction function is used to correct the effect of the receiving device on the signal strength measurement or the correction function is used to correct the effect of the receiving device and the transmitting device on the signal strength measurement (i.e. at least the effect of the receiving device on the signal strength measurement needs to be corrected).
Optionally, when the target device sends the wireless signal according to the specific frequency, the first device performs signal strength correction on a plurality of continuously measured original signal strengths.
On the basis, the first device determines the device distance between the first device and the target device based on the corrected signal strength. Further, the first device determines a device separation based on the modified signal strength, wherein the device separation may be a specific distance (e.g., 30cm, 50cm, etc.), and may be a range indication (e.g., 30cm to 50cm, or 30cm within, 30cm outside).
In a possible implementation manner, when a specific device interval needs to be obtained, the first device inputs the corrected signal strength as a parameter into a distance calculation formula to obtain the device interval. Because the distance calculation formula comprises power operation, the speed of calculating the distance between the devices by using the distance calculation formula is slow. In another possible implementation, when only the approximate range of the device distance needs to be obtained, the first device obtains a standard comparison table of the standard device distance and the standard signal strength, so as to search the device distance from the comparison table based on the corrected signal strength, wherein the standard signal strength is obtained by measuring a wireless signal transmitted by a second standard device (standard transmitting device) at different standard device distances through the first standard device (standard receiving device). The speed of determining the device spacing by looking up the look-up table is faster (because no power operation is required) than calculating the device spacing using the distance calculation formula.
In one illustrative example, a standard look-up table of standard device spacing versus standard signal strength is shown in Table one.
Watch 1
Standard equipment spacing (cm) Standard signal strength (dbm)
10 -20
20 -25
30 -30
60 -40
100 -50
For example, when the corrected signal strength is-27 dbm, the first device determines that the device distance between the first device and the second device is in the range of 20cm to 30cm, or determines that the device distance is in the range of 30 cm; and when the corrected signal strength is-35 dbm, the first equipment determines that the equipment distance between the first equipment and the second equipment is in the range of 30 cm-60 cm, or determines that the equipment distance is out of the range of 30 cm.
In another possible usage manner of the scanning result, the first device may also simply display the measured signal strength of the target device, which is not limited in this embodiment of the present application.
In summary, in the embodiment of the application, when the WiFi signal is scanned, the first type of channel is scanned to obtain the first scanning result, and the second type of channel is scanned to obtain the second scanning result. The number of the second type channels is smaller than that of the first type channels, and the second type channels comprise designated channels and/or broadcast channels containing broadcast data packets sent by the target device, so that the number of the channels to be scanned can be reduced on the premise of obtaining the same scanning result, the scanning time delay and the energy consumption are reduced, and the scanning efficiency is improved.
The WiFi signal scanning method provided in this embodiment can also shorten the interval time between any two rounds from the first preset time to the second preset time when the target device is identified in the scanning result of the current round, so as to accelerate the speed of obtaining the scanning result, further improve the scanning efficiency, and reduce the scanning delay.
The WiFi signal scanning method provided in this embodiment can also set an effective duration for the second preset duration after the first preset duration is shortened to the second preset duration, so as to avoid that the device is continuously in a high-frequency scanning state, and reduce energy consumption of the device during long-term operation.
The WiFi signal scanning method provided in this embodiment can also set the designated channel as a non-overlapping channel, and since the WiFi device usually receives and transmits signals through the non-overlapping channel, this design can reduce the scanning delay on the premise of successfully acquiring the broadcast data packet broadcast by the target device.
Based on the methods shown in the above embodiments, the embodiments of the present application further provide a WiFi signal scanning method, which can obtain multiple groups of scanning results through multiple rounds of WiFi signal scanning, please refer to the following embodiments.
Please refer to fig. 5, which is a flowchart illustrating a WiFi signal scanning method according to another exemplary embodiment of the present application. The WiFi signal scanning method may be applied in the first device shown above, and the WiFi signal scanning method includes:
step 500, the first device scans according to a preset period, the preset period includes M rounds of first type channel scanning and N rounds of second type channel scanning, the number of the second type channels is smaller than the number of the first type channels, the interval duration between each round of scanning is the same or different, and M and N are positive integers.
In this example, the first device will scan at a preset period. It should be noted that the preset period includes two types of scanning. The first type of scan is a first type of channel scan and the second type of scan is a second type of channel scan. The number of channels of the first type is greater than the number of channels of the second type.
Since the related art usually performs the full channel scan repeatedly in each cycle to obtain multiple sets of scan results, the related art consumes more energy and time to obtain multiple scan results. In the present application, the number of the second type channels is smaller than the data of the first type channels, and if M is smaller than or equal to N, the present example can obtain a plurality of scanning results in a shorter time duration.
In another possible approach, M may be greater than N. When M is larger than N, the first device can more comprehensively cover each channel in the scanning process, and scenes which are not easy to find by the first device are reduced when new broadcasting devices appear in some uncommon WiFi channels.
In this application, the first device may scan the first type of channel first, or may scan the second type of channel first. Alternatively, the first device may scan the first type of channels for M rounds first, and then scan the second type of channels for N rounds second. Optionally, the first device may also scan N rounds of the second type channels first, and then scan M rounds of the first type channels. Optionally, the first device may also scan M rounds of the first type of channels and N rounds of the second type of channels in an interleaved manner. It should be noted that, the above execution manners are all schematic illustrations, and the present application does not limit the execution order between the M rounds of first-type channel scanning and the N rounds of second-type channel scanning in the preset period.
Optionally, the interval duration between each round may be the starting time at the time when the previous round completes the first type channel scanning, or may be the starting time at the time when the previous round obtains the scanning result.
In summary, compared with the manner of performing multiple rounds of full channel scanning in order to obtain multiple scanning results in the related art, the embodiment of the present application can obtain the same scanning result through shorter duration and lower energy consumption by scanning the second channel with a smaller number, thereby improving the scanning efficiency of the WiFi channel.
Based on the embodiment shown in fig. 5, the present application further provides a WiFi signal scanning method, which can effectively reduce the scanning delay and energy through multiple scanning rounds, and the details can be seen in fig. 6.
Fig. 6 is a flowchart of a WiFi signal scanning method provided in an embodiment of the present application, where M is less than or equal to N, and M is 1, the WiFi signal scanning method includes:
in step 611, the first device first performs a first scanning round of channels.
In one possible approach, the first type of channel includes all WiFi available channels. In another possible approach, the first type of channel comprises part of the WiFi available channels.
In step 612, the first device performs N second-type channel scans again.
In one possible approach, the second type of channel comprises a designated channel and/or a broadcast channel; wherein, the designated channel is a predetermined available channel, and reference may be made to the description of the designated channel in the previous embodiment; the broadcast channel comprises a channel where a broadcast data packet broadcasted by the target device is scanned or a channel indicated by channel information carried in the broadcast data packet broadcasted by the target device.
In a possible implementation manner, the first device may perform one round of first type channel scanning first and then perform N rounds of second type channel scanning. The first device may also perform N rounds of second type channel scanning first and perform one round of first type channel scanning. Or, the first device may further perform one round of first-type channel scanning between any two rounds of N second-type channel scanning, which is not limited in this application, and in a possible implementation manner, N is 3, and related technical effects thereof refer to the foregoing description and are not described herein again.
In one possible implementation, after M rounds of first-type channel scanning and N rounds of second-type channel scanning are completed, M rounds of first-type channel scanning and N rounds of second-type channel scanning are performed again.
In this application, the first device may perform scanning for another preset period after completing scanning for one preset period, and repeat this way, it can be understood that there may be an interval duration between the last channel scanning for the previous preset period and the first channel scanning for the current preset period. In one possible approach, the first device is provided with an interrupt condition of a preset period of the terminal. Illustratively, the interrupt condition may be that the distance to the target device has been successfully measured, or that the first device is no longer in a preset home or office setting, or that the first device is in a screen-off state. The embodiment of the present application does not limit the interrupt condition.
Optionally, in this application, after each scanning round, a scanning result of the channel scanning round is obtained. The scanning result includes information of some or all broadcast data packets scanned in the current round and signal strength of corresponding broadcasting equipment. Wherein the broadcast data packet is transmitted by a corresponding broadcasting device. The information in the broadcast packet in the scanning result may be all information in the broadcast packet or may be part information in the broadcast packet.
Optionally, after each round of channel scanning is performed by the first device, the distance information of the target device is obtained according to part or all of the information of part or all of the scanning results in the scanning results of the previous times. The method for the first device to obtain the distance information between the first device and the target device according to the channel in the scanning result may be discussed with reference to fig. 4, which is not described herein again.
It can be understood that, each time the distance information is calculated, the calculation may be performed by using a part of the scanning results in the past scanning results, or may be performed by using all the scanning results in the past scanning results, or may be partial information of the scanning results, such as RSSI values, or may be all the information, and may specifically be determined according to an algorithm for calculating the distance.
Optionally, the broadcasting device includes a target device and/or a non-target device, where if the broadcast packet includes a preset matching identifier, the corresponding broadcasting device is the target device, and the preset matching identifier is used to indicate that the broadcasting device satisfies a first preset condition.
It can be understood that the preset matching identifier may be an identifier that can be matched with a preset list, for example, a white list in the foregoing embodiment, or may be in other cases, and specific examples are similar to the description of the first preset condition in the foregoing embodiment, and are not described herein again.
If the broadcast data packet broadcast by the target device is scanned in the jth channel scanning, the first device may shorten the interval duration between each channel scanning. For example, if the duration of the interval between each round of channel scanning is 5 seconds, the shortened duration may be 2 seconds.
It is to be understood that the jth channel scan may be a first type of channel scan, for example, a full channel scan, or may be a second channel scan, for example, a designated channel scan and/or a broadcast channel scan, and the time from the interval duration may refer to the description in the foregoing embodiments, which is not described herein again.
And if the first time interval passes after the jth round of channel scanning, restoring or increasing the interval duration between each round of channel scanning. The first period may be an effective duration of the shortened interval duration of the first device, for example, the first period is 30 seconds. The first device may restore the interval duration to the original 5 seconds or increase the duration after 30 seconds, and the increased duration may be longer than the original 5 seconds or shorter than the original 5 seconds, which is not limited in this embodiment of the application.
It can be understood that when to start calculating the first period may also be flexibly set, such as from confirming that the packet information sent by the target device exists in the scanning result of the current round; in addition to restoring or increasing the interval duration after the first period has elapsed, the interval duration may be restored or increased during any one scan cycle when the target device is scanned, as described in the previous embodiments. In addition, in a feasible manner, if the target device is still scanned in a certain round of channel scanning in the first period, the preset time is not recalculated.
In summary, the WiFi signal scanning method provided in this embodiment can complete WiFi signal scanning according to a preset period by performing M rounds of first type channel scanning and N rounds of second type channel scanning. Since the number of channels of the second type is less than the number of channels of the first type and M is less than or equal to N. Therefore, the embodiment of the application can reduce the energy consumption and the time length for repeatedly executing multiple rounds of full channel scanning in the related art through multiple rounds of channel scanning, thereby improving the efficiency for obtaining multiple scanning results.
It should be noted that the technical solutions and technical features provided in the above embodiments may be mutually cited and supplemented without conflict.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 7, a block diagram of a WiFi signal scanning apparatus according to an exemplary embodiment of the present application is shown. The WiFi signal scanning apparatus may be implemented as all or part of the first device by software, hardware, or a combination of both. The device includes:
a first scanning module 710, configured to scan a first type of channel in WiFi available channels to obtain a first scanning result, where the first scanning result includes part or all of information of a scanned part or all of broadcast data packets and signal strength of corresponding broadcast equipment;
a second scanning module 720, configured to scan a second type of channel in the WiFi available channels to obtain a second scanning result, where the second scanning result includes part or all of the scanned information of part or all of the broadcast data packets and signal strength of corresponding broadcasting equipment; the number of the second type channels is smaller than that of the first type channels, and the interval duration between the scanning of the first type channels and the scanning of the second type channels is a first preset duration.
In an optional embodiment, the broadcast data packet related to the apparatus is transmitted by the corresponding broadcasting device, and the broadcasting device includes: the target device is a broadcasting device meeting a first preset condition.
In an alternative embodiment, the first preset condition to which the apparatus relates includes: matching a matching identifier carried in the broadcast data packet with a preset template, wherein the matching identifier is an identifier of the broadcasting equipment for sending the broadcast data packet; or, the first preset condition comprises: the broadcasting device provides its own control authority.
In an alternative embodiment, the second type of channel to which the apparatus relates comprises a designated channel and/or a broadcast channel; the designated channel is a channel with a pre-designated channel number, and the broadcast channel includes a channel where the broadcast data packet broadcasted by the target device is scanned or a channel indicated by channel information carried in the broadcast data packet broadcasted by the target device.
In an optional embodiment, the first preset duration related to the apparatus is timed by a first timer, and the time when the first timer is set includes any one of the time when the first type of channel is scanned, the time when the first scanning result is obtained, and the time when the broadcast packet sent by the target device is identified; a second scanning module 720, configured to scan the second type of channels in the WiFi available channels in response to the first timer expiring.
In an optional embodiment, the apparatus further includes a distance calculation module, configured to calculate a distance to the target device according to part or all of the information in the first scanning result and/or the second scanning result.
In an optional embodiment, the period of the WiFi signal scanning method involved in the apparatus includes one round of scanning the first type of channels and n rounds of scanning the second type of channels, where n is a positive integer.
In an optional embodiment, the device includes an apparatus acknowledgement module and a duration adjustment module, where the apparatus acknowledgement module is configured to, in response to a matching identifier carried in the broadcast data packet matching a preset template, acknowledge that a device that sends the broadcast data packet is the target device, and the matching identifier is an identifier of the broadcast device that sends the broadcast data packet; the time length adjusting module is configured to adjust the first preset time length to a second preset time length in response to that the device sending the broadcast data packet is the target device, where the second preset time length is smaller than the first preset time length.
In an optional embodiment, the effective duration of the second preset duration involved in the apparatus is a first duration, and the apparatus further includes a duration recovery module, configured to recover the second preset duration to the first preset duration in response to that the system time is not in the first duration. Or, the duration restoration module is configured to restore the second preset duration to the first preset duration in response to that the system time is in the first time period and the matching identifier in the scanning result of the current round is not matched with the preset template.
In an alternative embodiment, the device relates to the first period of time at the system time, and the interval duration between each round of channel scanning is the same; and/or, the interval duration between each round of channel scanning is the same when the system time is outside the first period
In an alternative embodiment, the designated channels to which the apparatus relates are non-overlapping channels, the non-overlapping channels including at least one of the following groups of channels; 1 st channel, 6 th channel and 11 th channel; channel 2, channel 7 and channel 12; channel 3, channel 8, and channel 13.
In an alternative embodiment, the first type of channels to which the apparatus relates comprises all of the WiFi available channels.
Referring to fig. 8, a block diagram of another WiFi signal scanning apparatus provided in an exemplary embodiment of the present application is shown. The WiFi signal scanning apparatus may be implemented as all or part of the first device by software, hardware, or a combination of both. The device includes:
a third scanning module 800, configured to perform wifi signal scanning according to a preset period; wherein the preset period includes: and performing M rounds of first-class channel scanning and N rounds of second-class channel scanning, wherein the number of the second-class channels is less than that of the first-class channels, the interval duration between each round of scanning is the same or different, and M and N are positive integers.
In an optional embodiment, the third scanning module 800 is configured to perform a first round of channel scanning of a first type; and sequentially scanning N second-type channels, wherein M is 1 and is less than or equal to N.
In an optional embodiment, the third scanning module 800 is configured to perform M rounds of first-type channel scanning and N rounds of second-type channel scanning again after the M rounds of first-type channel scanning and the N rounds of second-type channel scanning are performed.
In an optional embodiment, the apparatus further includes a result obtaining module, configured to obtain a scanning result of the current channel scanning after the channel scanning is completed, where the scanning result includes: and partial or all information of partial or all broadcast data packets scanned in the current round and the signal strength of the corresponding broadcasting equipment, wherein the broadcast data packets are transmitted by the corresponding broadcasting equipment.
In an optional embodiment, the broadcasting device related to the apparatus includes a target device and/or a non-target device, where if the broadcast packet includes a preset matching identifier, the corresponding broadcasting device is the target device, and the preset matching identifier is used to indicate that the broadcasting device satisfies a first preset condition.
In an optional embodiment, the apparatus further includes a distance obtaining module, configured to obtain distance information of the target device according to part or all of information of part or all of scanning results in scanning results of previous times after each round of channel scanning is performed.
In an optional embodiment, the apparatus further includes a first adjusting module, configured to shorten an interval duration between each channel scan if a broadcast packet broadcast by the target device is scanned in a jth channel scan, where j is a positive integer.
In an optional embodiment, the apparatus further includes a second adjusting module, configured to recover or increase the interval time between each channel scan if a first time period elapses after the jth channel scan.
In an alternative embodiment, the first type of channels to which the apparatus relates comprises all available channels.
In an alternative embodiment, the second type of channel to which the apparatus relates comprises a designated channel and/or a broadcast channel; wherein the designated channel is a predetermined available channel; the broadcast channel includes a channel where the broadcast data packet broadcasted by the target device is scanned or a channel indicated by channel information carried in the broadcast data packet broadcasted by the target device.
In an alternative embodiment, the designated channels involved in the apparatus are non-overlapping channels, the non-overlapping channels including at least one of the following groups of channels; 1 st channel, 6 th channel and 11 th channel; channel 2, channel 7 and channel 12; channel 3, channel 8, and channel 13.
It should be noted that, in order to avoid redundancy, the related technical features in the above-mentioned apparatuses may be explained with reference to descriptions of technical features in the methods, and the related technical features may be combined with each other without conflict.
Referring to fig. 9, a block diagram of a computer device according to an exemplary embodiment of the present application is shown. The computer device 900 may be a smartphone, tablet, wearable device, or the like. The computer device 900 in the present application may include one or more of the following components: a processor 910, a memory 920, and a WiFi receiver 930.
Processor 910 may include one or more processing cores. The processor 910 interfaces with various components throughout the computer device 900 using various interfaces and lines to perform various functions of the computer device 900 and process data by executing or performing instructions, programs, code sets, or instruction sets stored in the memory 920 and invoking data stored in the memory 920. Alternatively, the processor 910 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 910 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural-Network Processing Unit (NPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the touch screen 930; the NPU is used for realizing an Artificial Intelligence (AI) function; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 910, but may be implemented by a single chip.
The Memory 920 may include a Random Access Memory (RAM) or a Read-Only Memory (ROM). Optionally, the memory 920 includes a non-transitory computer-readable medium. The memory 920 may be used to store instructions, programs, code sets, or instruction sets. The memory 920 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like; the stored data area may store data (such as audio data, a phonebook) created according to the use of the computer device 900, and the like.
The WiFi receiver 930 is a component for performing wireless signal transceiving, and is constituted by a receiver and a transmitter. The WiFi receiver 930 may be a bluetooth communication module, a WiFi communication module, or a UWB communication module, etc., which is not limited in this embodiment.
In addition, those skilled in the art will appreciate that the configuration of computer device 900 illustrated in the above-described figures does not constitute a limitation of computer devices, which may include more or fewer components than those illustrated, or some of the components may be combined, or a different arrangement of components. For example, the computer device 900 further includes a display screen, a sensor, an audio circuit, a power supply, and other components, which are not described herein again.
The embodiment of the present application further provides a computer-readable medium, which stores at least one instruction, where the at least one instruction is loaded and executed by the processor to implement the WiFi signal scanning method according to the above embodiments.
It should be noted that: in the WiFi signal scanning apparatus provided in the foregoing embodiment, when the WiFi signal scanning method is executed, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the WiFi signal scanning apparatus provided in the foregoing embodiment and the WiFi signal scanning method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the implementation of the present application and is not intended to limit the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (28)

1. A WiFi signal scanning method, the method comprising:
scanning a first type of channels in WiFi available channels to obtain a first scanning result, wherein the first scanning result comprises part or all information of scanned part or all broadcast data packets and signal intensity of corresponding broadcasting equipment;
scanning a second type of channel in the WiFi available channels to obtain a second scanning result, wherein the second scanning result comprises part or all information of the scanned part or all broadcast data packets and signal intensity of corresponding broadcasting equipment;
the number of the second type channels is smaller than that of the first type channels, and the interval duration between the scanning of the first type channels and the scanning of the second type channels is a first preset duration.
2. The method of claim 1, wherein the broadcast packet is transmitted by the corresponding broadcasting device, and wherein the broadcasting device comprises: the target device is a broadcasting device meeting a first preset condition.
3. The method according to claim 2, wherein the first preset condition comprises: matching a matching identifier carried in the broadcast data packet with a preset template, wherein the matching identifier is an identifier of the broadcasting equipment for sending the broadcast data packet; or, the first preset condition comprises: the broadcasting device provides its own control authority.
4. The method according to claim 2, wherein the second type of channel comprises a designated channel and/or a broadcast channel;
the designated channel is a channel with a pre-designated channel number, and the broadcast channel includes a channel where the broadcast data packet broadcasted by the target device is scanned or a channel indicated by channel information carried in the broadcast data packet broadcasted by the target device.
5. The method according to claim 2, wherein the first preset duration is timed by a first timer, and the time when the first timer is set includes any one of the time when the first type of channel is scanned and the time when the first scanning result is obtained;
the scanning for a second type of channels of the WiFi available channels comprises:
scanning the second type of channels of the WiFi available channels in response to the first timer expiring.
6. The method of claim 2, further comprising:
and calculating the distance between the target device and the target device according to part or all of information in the first scanning result and/or the second scanning result.
7. The method of claim 2, wherein a period of the WiFi signal scanning method comprises one scanning round of the first type of channels and n scanning rounds of the second type of channels, wherein n is a positive integer.
8. The method of claim 7, further comprising:
responding to matching of a matching identifier carried in the broadcast data packet and a preset template, and confirming that equipment for sending the broadcast data packet is the target equipment, wherein the matching identifier is the identifier of the broadcast equipment for sending the broadcast data packet;
and responding to the device sending the broadcast data packet as the target device, and adjusting the first preset time length to a second preset time length, wherein the second preset time length is less than the first preset time length.
9. The method of claim 8, wherein the second predetermined duration is a first duration, the method further comprising:
responding to the situation that the system time is not in the first time period, and recovering the second preset time length to the first preset time length;
or the like, or, alternatively,
and in response to the system moment being in the first time period and the matching identifier in the scanning result of the current round not being matched with the preset template, restoring the second preset time length to the first preset time length.
10. The method of claim 9, wherein the system time is in the first period, and the time interval between each channel scan is the same; and/or the time interval between each round of channel scanning is the same when the system time is outside the first time period.
11. The method of claim 4, wherein the designated channels are non-overlapping channels, and wherein the non-overlapping channels comprise at least one of the following groups of channels;
1 st channel, 6 th channel and 11 th channel;
2 nd channel, 7 th channel and 12 th channel;
channel 3, channel 8, and channel 13.
12. The method of any of claims 1 to 11, wherein the first type of channels comprises all of the WiFi available channels.
13. A WiFi signal scanning method, the method comprising:
carrying out WiFi signal scanning according to a preset period;
wherein the preset period includes: and performing M rounds of first-class channel scanning and N rounds of second-class channel scanning, wherein the number of the second-class channels is less than that of the first-class channels, the interval duration between each round of scanning is the same or different, and M and N are positive integers.
14. The method of claim 13, wherein M is less than or equal to N, wherein M is equal to 1, and wherein performing M rounds of the first type channel scanning and N rounds of the second type channel scanning comprises:
firstly, performing a round of first-class channel scanning;
and then sequentially carrying out N rounds of second-class channel scanning.
15. The method of claim 13, wherein the wifi signal scanning according to the preset period comprises:
and after M rounds of first-class channel scanning and N rounds of second-class channel scanning are finished, M rounds of first-class channel scanning and N rounds of second-class channel scanning are carried out again.
16. The method of claim 13, further comprising:
obtaining a scanning result of the channel scanning of the current round after the channel scanning of the current round is finished, wherein the scanning result comprises: and partial or all information of partial or all broadcast data packets scanned in the current round and the signal strength of the corresponding broadcasting equipment, wherein the broadcast data packets are transmitted by the corresponding broadcasting equipment.
17. The method according to claim 16, wherein the broadcasting device includes a target device and/or a non-target device, and wherein if the broadcast packet includes a preset matching identifier, the corresponding broadcasting device is the target device, and the preset matching identifier is used to indicate that the broadcasting device satisfies a first preset condition.
18. The method of claim 17, further comprising: and after each round of channel scanning is finished, obtaining the distance information of the target equipment according to part or all information of part or all scanning results in the scanning results of all the times.
19. The method of claim 17, wherein the method comprises: and if the broadcast data packet broadcasted by the target equipment is scanned in the jth channel scanning, shortening the interval duration between each channel scanning, wherein j is a positive integer.
20. The method of claim 19, wherein the method comprises: and if a first time interval passes after the jth round of channel scanning, recovering or increasing the interval time between each round of channel scanning.
21. A method according to any one of claims 13 to 20, wherein the channels of the first type comprise all available channels.
22. The method according to any of claims 17 to 20, wherein the second type of channel comprises a designated channel and/or a broadcast channel; wherein the designated channel is a predetermined available channel; the broadcast channel includes a channel where the broadcast data packet broadcasted by the target device is scanned or a channel indicated by channel information carried in the broadcast data packet broadcasted by the target device.
23. The method of claim 22, wherein the designated channels are non-overlapping channels, and wherein the non-overlapping channels comprise at least one of the following groups of channels;
1 st channel, 6 th channel and 11 th channel;
channel 2, channel 7 and channel 12;
channel 3, channel 8, and channel 13.
24. A WiFi signal scanning apparatus, characterized in that the apparatus comprises:
the first scanning module is used for scanning a first type of channel in the WiFi available channels to obtain a first scanning result, wherein the first scanning result comprises part or all information of scanned part or all broadcast data packets and signal intensity of corresponding broadcasting equipment;
a second scanning module, configured to scan a second type of channel in the WiFi available channels to obtain a second scanning result, where the second scanning result includes part or all of the scanned information of part or all of the broadcast data packets and signal strength of corresponding broadcast equipment;
the number of the second type channels is smaller than that of the first type channels, and the interval duration between the scanning of the first type channels and the scanning of the second type channels is a first preset duration.
25. A WiFi signal scanning apparatus, characterized in that the apparatus comprises:
the third scanning module is used for carrying out wifi signal scanning according to a preset period;
wherein the preset period includes: and performing M rounds of first-class channel scanning and N rounds of second-class channel scanning, wherein the number of the second-class channels is less than that of the first-class channels, the interval duration between each round of scanning is the same or different, and M and N are positive integers.
26. A terminal, characterized in that the terminal comprises a processor and a WiFi transceiver;
the processor is configured to instruct the WiFi transceiver to scan a first type of channel in WiFi available channels, and obtain a first scanning result, where the first scanning result includes part or all of information of a scanned part or all of broadcast data packets and signal strength of a corresponding broadcast device;
the processor is configured to instruct the WiFi transceiver to scan a second type of channel in the WiFi available channels, to obtain a second scanning result, where the second scanning result includes part or all of information of the scanned part or all of broadcast data packets and signal strength of a corresponding broadcast device; the number of the second type channels is smaller than that of the first type channels, and the interval duration between the scanning of the first type channels and the scanning of the second type channels is a first preset duration.
27. A terminal, characterized in that the terminal comprises a processor and a WiFi transceiver;
the processor is used for indicating the WiFi transceiver to carry out WiFi signal scanning according to a preset period;
wherein the preset period includes: and performing M rounds of first-class channel scanning and N rounds of second-class channel scanning, wherein the number of the second-class channels is less than that of the first-class channels, the interval duration between each round of scanning is the same or different, and M and N are positive integers.
28. A computer readable storage medium having stored thereon program instructions which, when executed by a processor, implement the WiFi signal scanning method of any of claims 1 to 23.
CN202110192236.XA 2021-02-19 2021-02-19 WiFi signal scanning method, device, terminal and storage medium Pending CN114980041A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110192236.XA CN114980041A (en) 2021-02-19 2021-02-19 WiFi signal scanning method, device, terminal and storage medium
PCT/CN2022/073470 WO2022174722A1 (en) 2021-02-19 2022-01-24 Wifi signal scanning method and apparatus, and terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110192236.XA CN114980041A (en) 2021-02-19 2021-02-19 WiFi signal scanning method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN114980041A true CN114980041A (en) 2022-08-30

Family

ID=82932222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110192236.XA Pending CN114980041A (en) 2021-02-19 2021-02-19 WiFi signal scanning method, device, terminal and storage medium

Country Status (2)

Country Link
CN (1) CN114980041A (en)
WO (1) WO2022174722A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10251121B2 (en) * 2016-09-30 2019-04-02 Intel IP Corporation Apparatus, system and method of detecting one or more active wireless communication channels
CN110234152B (en) * 2019-06-03 2021-06-18 Oppo广东移动通信有限公司 Channel scanning method, device, storage medium and electronic equipment
CN110225573A (en) * 2019-06-03 2019-09-10 Oppo广东移动通信有限公司 WiFi channel scanning method and device, electronic equipment, computer readable storage medium
CN110392413B (en) * 2019-07-31 2021-09-03 新华三技术有限公司成都分公司 Channel scanning method and device

Also Published As

Publication number Publication date
WO2022174722A1 (en) 2022-08-25

Similar Documents

Publication Publication Date Title
US20210336737A1 (en) Measurement configuration method, apparatus, devices, system, and storage medium
US11340341B2 (en) Electronic device for performing ranging by using ultra-wide band and operation method thereof
CN109089327B (en) Wireless network connection method, device, terminal and storage medium
CN106936515A (en) Radio frequency interference processing method, storage medium and terminal
CN110445511B (en) Self-adaptive synchronous frequency hopping method and device, wireless AP and communication system
CN113473549B (en) Measurement gap configuration method and device
CN112040420B (en) Self-adaptive energy-saving method and device in complex signal environment
CN111601325B (en) Electromagnetic interference control method and related device
CN112187377A (en) Antenna frequency modulation system, frequency modulation method, device and medium
US20240237079A9 (en) Transmission processing method, terminal and network side device
CN114339867B (en) Cell measurement method, device, terminal equipment and storage medium
CN110278599A (en) A kind of method, the network equipment and the user equipment of the transmission of synchronization signal block
CN113365318B (en) NR measuring method, device, terminal equipment and storage medium
JP2024518516A (en) METHOD FOR DETERMINING MEASUREMENT GAP, TERMINAL AND NETWORK SIDE DEVICE
CN116367313A (en) Method, device and terminal for determining time-frequency resource of Msg1 repeated transmission
CN114980041A (en) WiFi signal scanning method, device, terminal and storage medium
CN104853426A (en) Method for adjusting signal transmitting power and mobile terminal
CN116744264A (en) Communication method of Bluetooth protocol, electronic equipment, device, storage medium and product
CN114124251A (en) Calibration method, electronic device, chip and storage medium
CN114755934A (en) Control method of household equipment and household equipment
CN115442778A (en) Method and device for establishing Bluetooth link, bluetooth chip and equipment
CN114286290A (en) BLE broadcast sending and receiving method, device and system
CN110299935B (en) Communication method, base station, terminal, storage medium and electronic device
CN110932802A (en) Interference testing method, device, terminal and storage medium
CN110176972A (en) Frequency modulation broadcasting tranmitting frequency selection method, device, storage medium and mobile unit

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