WiFi scanning method and device, and storage medium
By sending a sleep frame on the first and second links of the WiFi device and switching the transmission link of the quality of service data, the problem of channel switching affecting WiFi services during WiFi scanning is solved, and the normal operation of WiFi services is achieved.
Patent Information
- Application Number
- CN202310954344.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-14
AI Technical Summary
When performing WiFi scanning, channel switching causes the currently running WiFi service to be affected and cannot be carried out normally.
By sending a sleep frame on the first link and the second link, the wireless access point enters a sleep state, switches the transmission link of the quality of service data, and then returns to its original state after completing the WiFi scan.
During the WiFi scanning process, ensure that the currently running WiFi service can proceed normally and not be affected.
Smart Images

Figure CN119450647A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communication technology, and in particular to a WiFi scanning method, device and storage medium. Background Art
[0002] With the continuous development of wireless communication technology, Wireless Fidelity (WiFi) has many advantages such as high transmission speed, easy deployment and scalability. More and more electronic devices with integrated WiFi chips and specific WiFi functions are being used, and applications based on WiFi functions are becoming more and more extensive.
[0003] At present, electronic devices with WiFi functions may need to perform WiFi scanning while running WiFi services. Since channels are switched during WiFi scanning, data packets of the original channel cannot be received after the channel is switched, thus affecting the currently running WiFi services. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a WiFi scanning method, device and storage medium, aiming to ensure that during the WiFi scanning process, the currently running WiFi services can proceed normally and are not affected.
[0005] In a first aspect, the present application provides a WiFi scanning method, which is applied to an electronic device that is executing a first WiFi service, and a first link and a second link are established between the electronic device and a wireless access point; wherein, during the execution of the first WiFi service, the wireless access point sends first service quality data to the electronic device through the first link, and sends second service quality data to the electronic device through the second link. The method comprises: in response to a received WiFi scanning instruction, sending a sleep frame on a first link, the sleep frame is used to instruct a wireless access station to enter a sleep state; wherein, after the wireless access station enters the sleep state, the first service quality data is stopped from being sent to the electronic device through the first link, and the first service quality data and the second service quality data are sent to the electronic device through a second link; the first link is used to perform WiFi scanning to obtain a first WiFi scanning result of a channel corresponding to the first link; the first link is used to send an exit sleep frame on the first link, the exit sleep frame is used to instruct the wireless access point to exit the sleep state and enter a wake-up state; wherein, after the wireless access point enters the wake-up state, the first service quality data is sent to the electronic device through the first link, and the second service quality data is sent to the electronic device through the second link; the sleep frame is sent on the second link; wherein, after the wireless access station enters the sleep state, the second service quality data is stopped from being sent to the electronic device through the second link, and the first service quality data and the second service quality data are sent to the electronic device through the first link; the second link is used to perform WiFi scanning to obtain a second WiFi scanning result of a channel corresponding to the second link; the exit sleep frame is sent on the second link; and a target WiFi scanning result is obtained according to the first WiFi scanning result and the second WiFi scanning result.
[0006] The first link is, for example, Link1 mentioned in the following embodiment.
[0007] The second link is, for example, Link2 mentioned in the following embodiment.
[0008] The sleep frame is, for example, a PS frame with PowerSave=1 in the following embodiments.
[0009] The sleep exit frame is, for example, a PS-Poll frame with PowerSave=0 or a Qosnull frame in the following embodiments.
[0010] The first quality of service data, for example, is the QOS DATA 2.4 GHz mentioned in the following embodiment.
[0011] The second quality of service data, for example, is the QOS DATA 5GHz mentioned in the following embodiment.
[0012] The first WiFi scanning result, for example, receives Probe Rsp via Link1 in the following embodiment.
[0013] The second WiFi scanning result, for example, receives Probe Rsp via Link2 in the following embodiment.
[0014] The first link and the second link are implemented through a WiFi chip with dual-band communication specifications in the electronic device.
[0015] Therefore, when a WiFi scan instruction is received, a sleep frame is actively sent on the first link, so that the corresponding wireless access point can enter the sleep state, and the first service quality data sent by it is switched to the second link for transmission. After the WiFi scan is completed on the first link, an exit sleep frame is sent on the first link, so that the corresponding wireless access point can exit the sleep state, and the first service quality data sent by it is switched from the second link back to the first link for transmission, thereby ensuring that during the WiFi scan on the first link, the currently running WiFi service can proceed normally and is not affected.
[0016] Accordingly, after the first link exits the sleep state, a sleep frame is actively sent on the second link, so that the corresponding wireless access point can enter the sleep state, and the second service quality data sent by it is switched to the first link for transmission. After the second link completes the WiFi scan, an exit sleep frame is sent on the second link, so that the corresponding wireless access point can exit the sleep state, and the second service quality data sent by it is switched from the first link back to the second link for transmission, thereby ensuring that during the WiFi scan on the second link, the currently running WiFi service can proceed normally and is not affected.
[0017] In this way, during the entire WiFi scanning process, it can be ensured that the currently running WiFi services can proceed normally without being affected.
[0018] According to a first aspect, in response to a received WiFi scan instruction, sending a sleep frame on a first link includes: a UMAC layer of an electronic device responds to a WiFi scan instruction received from an APP layer, based on traffic link mapping,
[0019] Determining that the first link corresponds to the first LMAC layer and the second link corresponds to the second LMAC layer; sending a sleep frame on the first link by the first LMAC layer; and correspondingly sending a sleep frame on the second link, includes: sending a sleep frame on the second link by the second LMAC layer.
[0020] For the implementation of this aspect, please refer to Figure 5A and Figure 5B , I will not go into details here.
[0021] According to the first aspect, or any implementation of the first aspect above, using the first link to perform WiFi scanning includes: the first LMAC layer uses the first link to perform WiFi scanning; accordingly, using the second link to perform WiFi scanning includes: the second LMAC layer uses the second link to perform WiFi scanning.
[0022] For the implementation of this aspect, please refer to Figure 5A and Figure 5B , I will not go into details here.
[0023] According to the first aspect, or any implementation of the first aspect above, in the process of using the first link for WiFi scanning, the method also includes: the UMAC layer sends a MAC protocol data unit from the APP layer to the second LMAC layer, and stops sending the MAC protocol data unit to the first LMAC layer; accordingly, in the process of using the second link for WiFi scanning, the method also includes: the UMAC layer sends a MAC protocol data unit to the first LMAC layer, and stops sending the MAC protocol data unit to the second LMAC layer.
[0024] The MAC protocol data unit may be a data unit processed by the data encryption and decryption module described in the following embodiments.
[0025] For the implementation of this aspect, please refer to Figure 5A and Figure 5B , I will not go into details here.
[0026] According to the first aspect, or any implementation method of the first aspect above, sending an exit sleep frame on the first link includes: the UMAC layer triggers the first LMAC layer to send an exit sleep frame on the first link; accordingly, sending a sleep frame on the second link includes: the UMAC layer triggers the second LMAC layer to send an exit sleep frame on the second link.
[0027] For the implementation of this aspect, please refer to Figure 5A and Figure 5B , I will not go into details here.
[0028] According to the first aspect, or any implementation of the first aspect above, after sending an exit sleep frame on the first link, the method also includes: the UMAC layer sends a MAC protocol data unit to the first LMAC layer; the UMAC layer receives the first quality of service data sent by the first LMAC layer, and the second quality of service data sent by the second LMAC layer; the UMAC layer aggregates the first quality of service data and the second quality of service data; the UMAC layer transmits the aggregated quality of service data to a first application located at the APP layer, and the first application is an application that triggers the first WiFi service.
[0029] For the implementation of this aspect, please refer to Figure 5A and Figure 5B , I will not go into details here.
[0030] According to the first aspect, or any implementation of the first aspect above, in response to a received WiFi scan instruction, sending a sleep frame on the first link includes: in response to the received WiFi scan instruction, determining whether the first link and the second link meet the first condition; when the first link and the second link meet the first condition, sending a sleep frame on the first link.
[0031] The first condition is, for example, the preset condition in the following embodiment. For details on setting the first condition and determining whether the first link and the second link meet the first condition, see Figure 4 The foreground description of the illustrated embodiment will not be repeated here.
[0032] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the first link and / or the second link does not meet the first condition, using the first link and the second link to perform WiFi scanning simultaneously.
[0033] According to the first aspect, or any implementation method of the first aspect above, determining whether the first link and the second link meet the first condition includes: determining whether the first link has a beacon loss situation according to the first quality of service data; when the first link has a beacon loss situation, determining that the first link does not meet the first condition; when the first link does not have a beacon loss situation, determining whether the RSSI value of the first link is less than a preset RSSI threshold according to the first quality of service data; when the RSSI value of the first link is less than the RSSI threshold, determining that the first link does not meet the first condition; when the RSSI value of the first link is greater than or equal to the RSSI threshold, determining whether the packet loss rate of the first link is greater than the preset packet loss rate threshold according to the first quality of service data; when the packet loss rate of the first link is greater than the packet loss rate threshold, determining that the first link does not meet the first condition; when the packet loss rate of the first link is less than the RSSI threshold, determining that the first link does not meet the first condition. When the RSSI value of the second link is greater than or equal to the RSSI threshold, it is determined that the first link satisfies the first condition; according to the second quality of service data, it is determined whether there is a beacon loss in the second link; when there is a beacon loss in the second link, it is determined that the second link does not meet the first condition; when there is no beacon loss in the second link, according to the second quality of service data, it is determined whether the RSSI value of the second link is less than a preset RSSI threshold; when the RSSI value of the second link is less than the RSSI threshold, it is determined that the second link does not meet the first condition; when the RSSI value of the second link is greater than or equal to the RSSI threshold, according to the second quality of service data, it is determined whether the packet loss rate of the second link is greater than the preset packet loss rate threshold; when the packet loss rate of the second link is greater than the packet loss rate threshold, it is determined that the second link does not meet the first condition; when the packet loss rate of the second link is less than or equal to the packet loss rate threshold, it is determined that the second link meets the first condition.
[0034] According to the first aspect, or any implementation of the first aspect, the sleep frame is a PS frame, and the exit sleep frame is a PS-Poll frame or a Qos null frame.
[0035] According to the first aspect, or any implementation manner of the first aspect above, a frequency band corresponding to the first link is different from a frequency band corresponding to the second link.
[0036] The frequency band corresponding to the first link is, for example, the 2.4 GHz frequency band mentioned in the following embodiments.
[0037] The frequency band corresponding to the second link is, for example, the 5 GHz frequency band mentioned in the following embodiments.
[0038] Exemplarily, in some possible implementations, the frequency corresponding to the first link may also be a 2.4 GHz frequency band, and the frequency band corresponding to the second link may also be a 6 GHz frequency band.
[0039] Exemplarily, in some other possible implementations, the frequency corresponding to the first link may also be a 5 GHz frequency band, and the frequency corresponding to the second link may also be a 5 GHz frequency band.
[0040] Exemplarily, in some other possible implementations, the frequency corresponding to the first link may also be a 5 GHz frequency band, and the frequency corresponding to the second link may also be a 6 GHz frequency band.
[0041] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.
[0042] In a second aspect, the present application provides an electronic device. The electronic device includes: a memory and a processor, the memory and the processor are coupled; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes instructions of the method in the first aspect or any possible implementation of the first aspect.
[0043] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.
[0044] In a third aspect, the present application provides a computer-readable medium for storing a computer program, wherein the computer program includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0045] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.
[0046] In a fourth aspect, the present application provides a computer program, comprising instructions for executing the method in the first aspect or any possible implementation of the first aspect.
[0047] The fourth aspect and any implementation of the fourth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fourth aspect and any implementation of the fourth aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.
[0048] In a fifth aspect, the present application provides a chip system, the chip system comprising a processor. The processor is used to support an electronic device to implement instructions of the method in the first aspect or any possible implementation of the first aspect.
[0049] According to a fifth aspect, the processor comprises a modem.
[0050] Accordingly, the processor is used to support the electronic device in implementing the instructions of the method in the first aspect or any possible implementation manner of the first aspect, specifically including:
[0051] The modem is used to support the electronic device to implement instructions of the method in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0052] The fifth aspect and any implementation of the fifth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fifth aspect and any implementation of the fifth aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1A is a schematic diagram of the hardware structure of an electronic device shown as an example;
[0054] Figure 1B is a schematic diagram of the hardware structure of a wireless access point shown as an example;
[0055] Figure 2 A schematic diagram of the software structure of an electronic device is shown as an example;
[0056] Figure 3A A schematic diagram of a link between an electronic device and a wireless access point supporting multi-link connection is shown exemplarily;
[0057] Figure 3B A schematic diagram of a link between an electronic device and a wireless access point that does not support multi-link connection is shown as an example;
[0058] Figure 4 A timing diagram of a WiFi scanning method provided by an embodiment of the present application is exemplarily shown;
[0059] Figure 5A and Figure 5B A schematic diagram showing an exemplary electronic device actively changing the state of a link to be scanned;
[0060] Figure 6 A schematic diagram showing an exemplary electronic device aggregating data transmitted on links between wireless access points supporting multi-link connections;
[0061] Fig. 7A A timing diagram for exemplarily illustrating a method for implementing P2P device discovery based on a WiFi scanning method provided in an embodiment of the present application;
[0062] Figure 7B is a schematic diagram of an exemplary 2.4G WIFI channel;
[0063] Figure 8 The present invention is a timing diagram for exemplarily illustrating a method for implementing channel switching based on the WiFi scanning method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0065] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0066] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.
[0067] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0068] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
[0069] With the continuous development of wireless communication technology, Wireless Fidelity (WiFi) has many advantages such as high transmission speed, easy deployment and scalability. More and more electronic devices with integrated WiFi chips and specific WiFi functions are being used, and applications based on WiFi functions are becoming more and more extensive.
[0070] Currently, electronic devices with WiFi functions may also need to perform WiFi scanning while running WiFi services.
[0071] For WiFi scanning, the scanning method is different due to the different communication specifications of WiFi chips. Specifically, at present, WiFi chips can be divided into chips with communication specifications such as 2.4GHz single frequency, 2.4GHz+5GHz dual frequency, 5GHz+6GHz dual frequency, 2.4GHz+6GHz dual frequency, and 2.4GHz+5GHz+6GHz triple frequency.
[0072] In order to facilitate the description of the currently commonly used WiFi scanning method, this embodiment takes a WiFi chip with a 2.4 GHz+5 GHz dual-band communication specification as an example for specific description.
[0073] For example, for a WiFi chip with 2.4GHz+5GHz dual-band communication specifications, in some possible implementations, such as when the WiFi chip does not support dual-band dual-transmission (Dual Band Dual Concurrent, DBDC), the WiFi scanning method is a sequential scanning method. During the scanning process, the channel is first switched to the channel range corresponding to the 2.4GHz frequency band, and then channels 1 to 14 are scanned in sequence. After the channels corresponding to the 2.4GHz frequency band are scanned, the channels are switched to the channels corresponding to the 5GHz spectrum, and channels 36 to 165 are scanned in sequence.
[0074] It should be noted that the corresponding channels of WiFi chips for different regions are different. For example, in China, among the 14 channels corresponding to the 2.4GHz band, channels 1 to 13 are available, and channel 14 is not available. Therefore, in China, the channel range corresponding to the 2.4GHz band is channels 1 to 13, that is, when scanning the channels corresponding to the 2.4GHz band in a sequential scanning manner, channels 1 to 13 are scanned in sequence. After scanning channel 13, the channel can be switched to the channel corresponding to the 5GHz band.
[0075] In addition, it should be noted that for other WiFi chips with dual-band communication specifications or tri-band communication specifications, if the sequential scanning method is used, it is also necessary to first switch the channel to the channel range corresponding to a certain frequency band, and then scan the channels corresponding to the frequency band in turn, and then switch the channel to the channel range corresponding to another frequency band, and then scan the channels corresponding to the other frequency band in turn, until the channels corresponding to all frequency bands are scanned in turn, and this WiFi scanning operation will end.
[0076] Since scanning channels takes a certain amount of physical time, using a sequential scanning method will result in a large WiFi scanning time cost for WiFi chips with multi-frequency (dual-frequency or triple-frequency) communication specifications, that is, the WiFi scanning time required is too long.
[0077] Therefore, for WiFi chips with multi-frequency (dual-frequency, or tri-frequency) communication specifications, still taking the WiFi chip with 2.4GHz+5GHz dual-frequency communication specifications as an example, in other possible implementations, such as the scenario where the WiFi chip supports DBDC, its WiFi scanning method is a parallel scanning method. That is, the channels corresponding to the 2.4GHz frequency band and the channels corresponding to the 5GHz frequency band are scanned at the same time. For example, 1 channel + 36 channels are scanned at the same time (that is, 1 channel corresponding to the 2.4GHz frequency band and 36 channels corresponding to the 5GHz frequency band are scanned at the same time), 2 channels + 40 channels (that is, 2 channels corresponding to the 2.4GHz frequency band and 40 channels corresponding to the 5GHz frequency band are scanned at the same time), ... and so on, until all channels are scanned. In this way, the time cost required for multi-band WiFi scanning can be greatly reduced.
[0078] From the above description of the sequential scanning mode and the parallel scanning mode, it can be seen that no matter which scanning mode is used, channel switching is required during the WiFi scanning process. After the channel is switched, the data packets of the original channel cannot be received, which will affect the currently running WiFi service.
[0079] For example, in one possible implementation scenario, when a user is using a mobile phone as an electronic device to play games, that is, when the foreground WiFi service running on the mobile phone is a game service, if an application in the background, such as an application involving location-based services (LBS) functions, triggers a WiFi scan, the WiFi scan of the background application will cause a delay, which may cause the game to freeze.
[0080] For example, in some possible implementations, in order to avoid the freezing problem caused by WiFi scanning, WiFi scanning may be prohibited in certain business scenarios. However, this will cause applications that expect to obtain WiFi scanning results, such as applications involving LBS functions, to be unable to obtain WiFi scanning results, thereby causing the inability to perform indoor positioning.
[0081] In view of this, an embodiment of the present application provides a WiFi scanning method, which aims to ensure that during the WiFi scanning process, the currently running WiFi services can proceed normally and are not affected.
[0082] In order to better understand the technical solution provided by the embodiment of the present application, before describing the technical solution of the embodiment of the present application, the hardware structure of the electronic device and the wireless access point applicable to the embodiment of the present application is first described in conjunction with the accompanying drawings.
[0083] Specifically, in the WiFi scanning solution provided in the embodiment of the present application, the electronic device refers to a device connected to a wireless network, i.e., a station (STA). In some possible implementations, the STA may be, for example, a mobile phone, a tablet computer, etc., which will not be described here, and this embodiment does not limit this.
[0084] In addition, in the WiFi scanning solution provided in the embodiment of the present application, a wireless access point (AP) refers to the creator of a wireless network and is the central node of the network. In some possible implementations, the AP may be, for example, a router.
[0085] See also Figure 1A , which exemplarily shows a hardware structure of an electronic device 100.
[0086] like Figure 1A As shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0087] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP) (i.e. Figure 1A AP [110A] shown in FIG. 1 ), a modem processor (Modem) (i.e. Figure 1AModem [110B]), graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural-network processing unit (NPU), etc. shown in the figure are not listed one by one here and are not limited in this application.
[0088] It should be noted that, regarding the above-mentioned processing units included in the processor 110, in some implementations, different processing units may be independent devices. That is, each processing unit may be regarded as a processor. In other implementations, different processing units may also be integrated into one or more processors. For example, in some implementations, the modem processor may be an independent device. In other implementations, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0089] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.
[0090] In addition, the processor 110 may further include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc., which are not listed here one by one, and the present application does not limit this.
[0091] In addition, the processor 110 may also be provided with a memory for storing instructions and data. In some implementations, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0092] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0093] Among them, the internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, and a stereo recording function described in an embodiment of the present application, etc.). The data storage area may store data created during the use of the electronic device 100 (such as stereo audio data recorded based on the technical solution provided in an embodiment of the present application), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0094] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging implementations, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging implementations, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0095] Among them, the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other implementations, the power management module 141 can also be set in the processor 110. In other implementations, the power management module 141 and the charging management module 140 can also be set in the same device.
[0096] Among them, the wireless communication function of the electronic device 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0097] It should be noted that antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other implementations, the antenna can be used in combination with a tuning switch.
[0098] Among them, the mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some implementations, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some implementations, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0099] Among them, the wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (WiFi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0100] Specifically in the embodiments provided in the present application, the data that the electronic device needs to send out can be transmitted through AP110A, Modem 110B, mobile communication module or wireless communication module, and antenna 1 or antenna 2. Data describing the link and channel service quality can also be transmitted through antenna 1 or antenna 2, wireless communication module, and finally received by Modem 110B and fed back to AP 110A. WiFi scanning can be implemented through Modem 110B, wireless communication module and antenna 2. That is, the function of WiFi chip can be implemented in the wireless communication module.
[0101] The audio module 170 may include a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, etc. For example, the electronic device 100 may implement audio functions through the application processor and the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, etc. in the audio module 170, such as recording and video recording functions.
[0102] Among them, the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc., which are not listed here one by one and the present application does not impose any limitation on this.
[0103] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0104] The motor 191 can generate a vibration prompt. The motor 191 can be used for an incoming call vibration prompt or for touch vibration feedback.
[0105] Among them, the indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, and can also be used to indicate messages, missed calls, notifications, etc.
[0106] The camera 193 is used to capture static images or videos. In some implementations, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0107] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some implementations, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0108] The hardware structure of the electronic device 100 is introduced here. It should be understood that: Figure 1A The electronic device 100 shown is only an example. In a specific implementation, the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different component configuration. Figure 1A The various components shown in the drawings may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0109] See also Figure 1B , exemplarily showing a hardware structure of a wireless access point 200.
[0110] like Figure 1B As shown, the wireless access point 200 may include: a processor 210, a WiFi chip 220, a memory 230, a transceiver 240, and the like.
[0111] The processor 210 may be the nerve center and command center of the wireless access point 200. The processor 210 may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions. A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a high-speed cache memory.
[0112] Among them, the memory 230 can be used to store computer executable program code, and the executable program code includes instructions. The memory 230 can be a volatile memory or a persistent memory. The computer executable program code stored in the memory 230 can include one or more modules, and each module can include a series of instruction operations in the wireless router. The memory 230 can include a program storage area and a data storage area.
[0113] Furthermore, the processor 210 may be configured to communicate with the memory 230 to execute a series of instruction operations in the memory 230 on the wireless access point 200. The processor 210 executes the computer program instructions stored in the memory 230 to perform various functions and data processing of the wireless access point 200.
[0114] The WiFi chip 220 is used to enable the wireless access point 200 to establish a communication link with the electronic device 100, such as Link 1 and Link 2 mentioned in the following embodiments.
[0115] The transceiver 240 is used to receive and send data signals.
[0116] The hardware structure of the wireless access point 200 is introduced here. It should be understood that: Figure 1B The wireless access point 200 shown is only an example. In a specific implementation, the wireless access point 200 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different component configuration. Figure 1B The various components shown in the drawings may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0117] It should be noted that the WiFi scanning solution provided in the embodiment of the present application is specifically implemented on the STA side. In order to better understand the WiFi scanning solution, the following is combined with Figure 2 , the software structure of STA, i.e., electronic device 100 is explained.
[0118] Before describing the software structure of the electronic device 100 , the architecture that can be adopted by the software system of the electronic device 100 is first described.
[0119] Specifically, in actual applications, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
[0120] In addition, it is understandable that the software systems used by the current mainstream electronic devices include but are not limited to Windows systems, Android systems and iOS systems. For ease of explanation, the present application embodiment takes the layered Android system as an example to exemplify the software structure of the electronic device 100.
[0121] In addition, it should be understood that the WiFi scanning solution provided in the subsequent embodiments of the present application is also applicable to other systems in specific implementations.
[0122] See also Figure 2 , which is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0123] like Figure 2 As shown, the layered architecture of the electronic device 100 divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some implementations, the Android system is divided into five layers, from top to bottom, the application layer / application layer (Applications) belonging to the application part, the framework layer / application framework layer (Application Framework, FWK) belonging to the core part, the runtime (Runtime) and the system library belonging to the bottom layer, the hardware abstraction layer (HAL) and the Linux kernel (Linux Kernel) layer.
[0124] The application layer can include a series of application packages. Figure 2 As shown, the application package may include camera, game, video, setting and other applications, which are not listed here one by one and are not limited in this application.
[0125] The framework layer can provide application programming interfaces (APIs) and programming frameworks for applications in the application layer. In some implementations, these programming interfaces and programming frameworks can be described as functions. Figure 2 As shown, the framework layer may include functions such as content provider, window manager, view system, resource manager, etc., which are not listed here one by one and are not limited in this application.
[0126] It should be noted that the window manager located in the framework layer is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0127] In addition, it should be noted that the content provider located in the framework layer is used to store and obtain data and make the data accessible to the application. The data may include video, images, audio, dialed and received calls, browsing history and bookmarks, phone book, etc., which are not listed here one by one and are not limited by this application.
[0128] In addition, it should be noted that the view system located in the framework layer includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures.
[0129] In addition, it should be noted that Shanshui's resource manager located in the framework layer is used to provide various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc., which are not listed one by one here and this application does not impose any restrictions on this.
[0130] Continue to see Figure 2 , exemplarily, the runtime, specifically the Android runtime (Android Runtime) may include a core library and a virtual machine, which is mainly responsible for the scheduling and management of the Android system.
[0131] The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0132] Continue to see Figure 2 Exemplarily, the system library may include multiple functional modules, such as a surface manager, a media library, a three-dimensional (3D) graphics processing library (such as OpenGL ES), a two-dimensional (2D) graphics engine (such as SGL), etc.
[0133] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports multiple commonly used audio and video format playback and recording, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PnG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
[0134] In addition, it can be understood that the 2D graphics engine mentioned above is a drawing engine for 2D drawing.
[0135] Continue to see Figure 2 For example, the HAL layer is an interface layer between the operating system kernel (kernel layer) and the hardware circuit. Its purpose is to isolate the FWK from the kernel so that Android does not rely too much on the kernel, so that the development of FWK can be carried out without considering the driver.
[0136] Continue to see Figure 2 For example, the HAL layer may include various interfaces, such as audio and video interface, GPS interface, call interface, WiFi interface, etc., which are not listed here one by one and are not limited in this application.
[0137] Specifically, in the technical solution provided in the embodiment of the present application, during the WiFi scanning process, it is necessary to call the WiFi interface to access the WiFi driver in the kernel layer, thereby driving the WiFi chip hardware device to work.
[0138] Continue to see Figure 2 , exemplary, the kernel layer in the Android system is a layer between hardware and software. The kernel layer may include various processes / threads, power management, various drivers, such as WiFi drivers, etc.
[0139] The software structure of the electronic device 100 is introduced here. It can be understood that: Figure 2 The layers in the software structure shown and the components included in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the present application.
[0140] Based on the above hardware structure and software structure, the WiFi scanning method provided by this application is specifically described below in combination with specific embodiments.
[0141] Before describing the WiFi scanning method provided in the embodiment of the present application, it is first stated that the WiFi scanning method provided in the embodiment of the present application involves two scanning methods, which are subsequently referred to as scanning method 1 and scanning method 2 for ease of distinction.
[0142] When using scanning mode 1 to perform WiFi scanning, it is necessary to ensure that the electronic device 100 and the wireless access point 200 to be connected have multi-link characteristics, that is, the electronic device 100 and the wireless access point 200 are both multi-link devices (MLD).
[0143] It should be noted that MLD supports multi-link operation (Multi-Link Operation, MLO). Specifically, based on MLO, the electronic device 100 and the wireless access point 200 can simultaneously connect to two WiFi hotspots, such as 2.4GHz+5GHz, or 5GHz+5GHz, and even 5GHz+6GHz for areas with 6GHz frequency band. In this way, dual links can be established between the electronic device 100 and the wireless access point 200 at the same time, and data can be transmitted simultaneously through the dual links established between the two. For example, the wireless access point 200 can transmit the quality of service data (Quality of Service Data, QOS DATA) used to describe the channel through these two links.
[0144] When the WiFi scan is performed using scanning mode 2, the electronic device 100 and the connected wireless access point 200 may support dual links or single links.
[0145] In addition, it should be noted that, regarding the selection of scanning mode 1 and scanning mode 2, in some possible implementations, for example, it may be possible to determine whether the current dual link meets the preset condition (first condition), and then when the preset condition is met (both links meet), scanning mode 1 is used to perform WiFi scanning. On the contrary, when the preset condition is not met (if any link does not meet, it is considered that the preset condition is not met), scanning mode 2 is used to perform WiFi scanning.
[0146] Exemplarily, regarding the preset conditions, in some possible cases, it can be determined by carrying various indication / indicator data in the QOSDATA transmitted in the link. For example, a beacon frame (beacon), a received signal strength indication (RSSI), a packet error ratio (PER), etc. can be set as parameters for determining whether the preset conditions are met.
[0147] Exemplarily, in some possible cases, it can be set that the link that needs to perform WiFi scanning has any one or more of the following conditions: beacon frame loss (beacon miss), RSSI value is less than a preset SRRI threshold (e.g., -76dBm), PER is greater than a preset packet loss rate threshold (e.g., 30%, 50%, etc.), and then it is determined that the link that needs to perform WiFi scanning does not meet the preset conditions. Conversely, if the link that needs to perform WiFi scanning has neither beacon miss, nor RSSI value less than the preset SRRI threshold, nor PER greater than the preset packet loss rate threshold, then it can be determined that the link that needs to perform WiFi scanning meets the preset conditions.
[0148] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.
[0149] For ease of explanation, this embodiment takes the electronic device 100, a wireless access point supporting scanning mode 1 (hereinafter referred to as AP MLD), and a wireless access point supporting scanning mode 2 (hereinafter referred to as AP Legacy), both of which use a WiFi chip with a 2.4GHz+5GHz dual-band communication specification as an example.
[0150] It should be noted that in some possible implementations, one frequency band may be regarded as corresponding to one STA or AP. Therefore, for the convenience of explanation, in this embodiment, the STA corresponding to the 2.4 GHz frequency band in the electronic device 100 is represented as STA1, and the STA corresponding to the 5 GHz frequency band is represented as STA2; the AP corresponding to the 2.4 GHz frequency band in AP MLD is represented as AP1, and the AP corresponding to the 5 GHz frequency band is represented as AP2; the AP corresponding to the 2.4 GHz frequency band in AP Legacy is represented as AP1', and the AP corresponding to the 5 GHz frequency band is represented as AP2'; the link established between STA1 and AP1 is represented as Link1, the link established between STA2 and AP2 is represented as Link2, the link established between STA1 and AP1' is represented as Link1', and the link established between STA2 and AP2' is represented as Link2'. Among them, the QOS DATA transmitted in Link1 and Link1' are both represented as QOS DATA 2.4GHz, and the QOS DATA transmitted in Link2 and Link2' are both represented as QOS DATA 5GHz.
[0151] For example, the electronic device 100 is a mobile phone, that is, STA1 and STA2 are STAs corresponding to different frequency bands of the WiFi chip in the same mobile phone; AP MLD and AP Legacy are both routers. Figure 3A As shown, for the mobile phone, the data transmitted between it and the AP MLD is still realized through one link (Multi-Link), that is, when the sent data reaches the mobile phone, specifically the media access control layer (MAC layer) of the modem, it will choose whether to send it through Link1 or Link2.
[0152] Accordingly, the data received through Link 1 and Link 2 will be aggregated after reaching the MAC layer of the mobile phone, that is, the application layer of the mobile phone finally receives the data provided by a link of Multi-Link.
[0153] The dual link between the mobile phone and AP Legacy is specifically two independent links. That is, the data provided by the application from the application layer and the data fed back to the application by AP Legacy are both transmitted through independent links. What the application layer perceives is the data of two links, not the data of one link.
[0154] See also Figure 4 For example, when the electronic device 100 receives a WiFi scan instruction, it will determine whether Link1 and Link2 meet the first condition according to the above-mentioned logic for determining whether the link meets the first condition.
[0155] Regarding the WiFi scan instruction received by the electronic device 100, in some possible cases, for example, it may be generated periodically by an application involving an LBS function, or it may be generated when entering a geographic fence corresponding to a certain application.
[0156] It should be understood that the prerequisite for generating the WiFi scan instruction is that the electronic device has enabled the WLAN function, that is, the Link1, Link2, Link1', Link2', etc. mentioned above have been established.
[0157] For example, in some other possible situations, it can also be manually triggered by the user, for example, opening the setting application located at the application layer and entering the WLAN interface by clicking the "WLAN" entry provided in the setting interface. In this case, if the WLAN function has been turned on, a WiFi scan instruction will be automatically generated in the WLAN interface.
[0158] For example, in some other possible situations, if the WLAN function is not turned on in advance in the electronic device, in this case, when the user enters the WLAN interface through the above method and clicks on the control to turn on the WLAN function; or directly turns on the WLAN function through the WLAN shortcut control in the pull-down notification bar, a WiFi scan instruction will be automatically generated.
[0159] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.
[0160] Continue to see Figure 4 , exemplarily, when it is determined that Link1 and Link2 meet the first condition, the electronic device 100 can use scanning mode 1 to perform WiFi scanning.
[0161] It should be noted that when using scanning mode 1 for WiFi scanning, both Link1 and Link2 will eventually complete the WiFi scanning, so it is OK to choose to start WiFi scanning from Link1 first or Link2 first. For ease of description, this embodiment takes starting WiFi scanning from Link1 as an example.
[0162] Continue to see Figure 4 For example, when scanning mode 1 is used for WiFi scanning, STA1 will actively send a sleep frame on Link1, thereby enabling AP1 to enter a sleep state.
[0163] It should be noted that after AP1 enters the sleep state, AP1 will no longer process the WiFi service currently being executed by the electronic device 100, that is, QOS DATA 2.4GHz will no longer be transmitted on Link1. Therefore, AP1 entering the sleep state can also achieve the effect of power saving. Therefore, the sleep state mentioned in this embodiment can also be understood as a power saving state. In some possible implementations, a PowerSave frame (PS frame) can be sent to AP1 to control AP1 to enter the power saving state. Therefore, the sleep frame mentioned in this embodiment can be a PS frame.
[0164] Exemplarily, in some possible implementations, it may be agreed that PowerSave=1 indicates entering a sleep state, and PowerSave=0 indicates exiting a sleep state and entering a wake-up state.
[0165] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.
[0166] Continue to see Figure 4 For example, when a WiFi scan instruction is received and it is determined that the first condition is currently met, a PS frame with PowerSave=1 can be sent in Link1 first, so that AP1 enters a sleep state after receiving the PS frame with PowerSave=1 sent by STA1 through Link1, that is, stops sending QOS DATA 2.4GHz to STA1 through Link1.
[0167] It should be noted that when STA1 sends a PS frame with PowerSave=1 in Link1 and the PS frame does not reach AP1, AP1 has not entered the sleep state, so QOS DATA 2.4 GHz can still be transmitted in Link1.
[0168] Continue to see Figure 4 For example, STA1 sends a PS frame on Link1 to instruct AP1 to enter the sleep state. After AP1 enters the sleep state, STA1 will perform a WiFi scan on Link1, that is, send a Probe Req (a broadcast request) on Link1.
[0169] Specifically in the actual WiFi scan, STA1 uses Link1 to send Probe Req in the channels corresponding to the 2.4 GHz frequency band, such as channels 1 to 13 corresponding to China.
[0170] It should be noted that since Probe Req is a broadcast request belonging to the 2.4GHz frequency band sent through Link1, in some possible implementations, the APs supporting 2.4G WiFi around STA1, whether it is the APMLD mentioned above or AP Legacy, may receive the Probe Req and then respond on the corresponding channel. Specifically, the Probe Rsp will be made on the channel on which the Probe Rsp is received.
[0171] After sending Probe Req in the channels corresponding to the 2.4 GHz frequency band in sequence through Link1 and receiving the Probe Req made by the searched AP in the corresponding channel through Link1, the Probe Req of all channels received can be summarized to obtain the WiFi scan result of all channels in the 2.4 GHz frequency band using Link1 this time.
[0172] For the sake of distinction, the WiFi scanning result obtained by performing WiFi scanning through Link1 is referred to as the first WiFi scanning result.
[0173] It should be noted that the AP whose Probe Req is made on the corresponding channel and is searched and received through Link1 may be an AP MLD, an AP Legacy, or both APs. Figure 4 For example, the AP that issues the Probe Req is AP1. Regarding the Probe Rsp issued by other APs, Figure 4 Not shown in FIG.
[0174] Continue to see Figure 4For example, when AP1 enters the sleep state and STA1 performs WiFi scanning via Link1, in order not to affect the currently executing WiFi service, i.e., lose the QOS DATA 2.4GHz sent by AP1 to STA1 via Link1. In a possible implementation, the QOS DATA 2.4GHz that AP1 needs to send to STA1 can be handed over to AP2 which is in the awake state, i.e., not in the sleep state, and then AP2 sends the QOS DATA 2.4GHz and QOSDATA 5GHz to STA2 via Link2, and then STA2 hands over the QOS DATA 2.4GHz provided by AP1 to STA1 (hereinafter referred to as method A).
[0175] In addition, it should be noted that both STA1 and STA2 are within the electronic device 100, that is, they can be regarded as a whole, so by transferring the QOS DATA 2.4GHz transmitted in Link1 to Link2, it can be ensured that during the process of using Link1 for WiFi scanning, the QOS DATA 2.4GHz and QOSDATA 5GHz required for the currently executing WiFi service can still be normally received by the electronic device 100. In this way, the QOS DATA 2.4GHz will not be lost due to WiFi scanning, thereby ensuring that the currently executing WiFi service is not affected.
[0176] For example, in another possible implementation, when AP1 enters the sleep state and STA1 performs WiFi scanning via Link1, in order not to affect the currently executing WiFi service, i.e., lose the QOS DATA 2.4GHz sent by AP1 to STA1 via Link1, AP1 can be set to stop sending QOS DATA 2.4GHz, so that AP1 does not send QOSDATA 2.4GHz, and STA1 does not have the problem of losing QOS DATA 2.4GHz (hereinafter referred to as method B).
[0177] It should be understood that the above description is only an example for better understanding the technical solution of this embodiment, and is not the only limitation to this embodiment. Figure 4 The illustrated embodiment takes sending QOSDATA 2.4GHz through Link2, i.e., the above-mentioned method A as an example. That is, when AP1 is in a dormant state and Link1 is used to perform WiFi scanning on the channels corresponding to the 2.4GHz frequency band, QOS DATA 5GHz and QOS DATA 2.4GHz required by the currently executing WiFi service are both sent to the electronic device by Link2.
[0178] Continue to see Figure 4 For example, after STA1 obtains the first WiFi scan result (ProbeRsp) for the channel corresponding to the 2.4 GHz frequency band through Link1, it will send an exit sleep frame on Link1, so that AP1 can exit the sleep state and resume the awake state. In this way, AP1 can send QOS DATA 2.4GHz to STA1 through Link1.
[0179] From the above description, it can be known that the PS frame with PowerSave=1 can be sent to AP1 to indicate that AP1 enters the sleep state. Therefore, when exiting the sleep state, in a possible implementation, a PS-Poll frame with PowerSave=0 can be sent in Link1. It is agreed that after receiving the PS-Poll frame, AP1 automatically exits the sleep state and resumes the awake state, so that AP1 can send QOS DATA 2.4GHz on Link1 again.
[0180] Exemplarily, in another possible implementation, a Qos null frame may be sent in Link1 to enable AP1 to automatically exit the dormant state and resume the awakened state, and then send QOS DATA 2.4 GHz on Link1 again.
[0181] It should be understood that the above description is only an example for better understanding the technical solution of this embodiment, and is not the only limitation to this embodiment. Figure 4 The illustrated embodiment takes sending a PS-Poll frame with PowerSave=0 to instruct AP1 to exit the sleep state as an example.
[0182] Continue to see Figure 4 For example, since AP1 exits the sleep state and enters the awake state, it can send QOS DATA 2.4 GHz to STA1 through Link1, so Link2 can stop sending QOS DATA 2.4 GHz and only send QOS DATA 5 GHz.
[0183] Thus, WiFi scanning of channels corresponding to the 2.4 GHz frequency band is achieved without losing QOS DATA 2.4 GHz.
[0184] It should be noted that since the WiFi chip in the electronic device 100 is a 2.4GHz+5GHz dual-band communication specification, after completing the WiFi scan of the channels corresponding to the 2.4GHz frequency band and obtaining the first WiFi scan result, it is necessary to continue to perform WiFi scan on the channels corresponding to the 5GHz frequency band.
[0185] Continue to see Figure 4 For example, STA2 sends a sleep frame on Link2, such as a PS frame with PowerSave=1, thereby enabling AP2 to enter a sleep state from an awake state.
[0186] From the above introduction to the sleep state, it can be seen that after AP2 enters the sleep state, AP2 will stop sending QOS DATA 5GHz to STA2 through Link2, and STA2 will send ProbeReq in the channels corresponding to the 5GHz frequency band through Link2 in sequence, such as sending Probe Req in non-dynamic frequency selection (Dynamic Frequency Selection, DFS) channels 36 to 165 in sequence, thereby realizing WiFi scanning of the channels corresponding to the 5GHz frequency band.
[0187] Specifically, the DFS channel is used to dynamically adjust the communication channel between the AP and the terminal in the wireless LAN. Since radar signals may exist in this type of channel, when performing WiFi scanning, it is necessary to send ProbeReq on a non-DFS channel to achieve WiFi scanning of the channels corresponding to the 5GHz frequency band.
[0188] Before STA2 transmits a signal in the DFS channel, it must verify (listen for 60 seconds) that there is no radar activity on it.
[0189] Accordingly, after sending Probe Req in the channels corresponding to the 5 GHz frequency band in sequence through Link2 and receiving the Probe Req made by the searched AP in the corresponding channel through Link2, by summarizing the Probe Req of all channels received, the WiFi scan result of all channels in the 5 GHz frequency band using Link2 can be obtained.
[0190] For the sake of distinction, the WiFi scanning result obtained by performing WiFi scanning through Link2 is referred to as the second WiFi scanning result.
[0191] It should be noted that the AP that has made a Probe Req on the corresponding channel and is searched and received through Link2 may be an AP MLD, an AP Legacy, or both. Figure 5 takes the AP2 that made the Probe Req as an example. Regarding the Probe Rsp made by other APs, Figure 4 Not shown in FIG.
[0192] Continue to see Figure 4For example, when AP2 enters the sleep state and STA2 performs WiFi scanning via Link2, in order not to affect the currently executing WiFi service, the QOS DATA 5GHz sent by AP2 to STA1 via Link2 is lost. In a possible implementation, a method similar to the above-mentioned method A can be adopted, that is, the QOS DATA 5GHz to be sent to STA2 is sent to the electronic device 100 via Link1.
[0193] Exemplarily, in another possible implementation, a method similar to the above-mentioned method B may be adopted, that is, when AP2 is in the sleep state, the sending of QOS DATA 5 GHz to STA2 is stopped.
[0194] It should be understood that the above description is only an example for better understanding the technical solution of this embodiment, and is not the only limitation to this embodiment. Figure 4 The illustrated embodiment takes sending QOSDATA 2.4GHz through Link1 as an example, that is, when AP2 is in sleep mode and Link2 is used to perform WiFi scanning on the channel corresponding to the 5GHz band, QOS DATA 5GHz and QOS DATA 2.4GHz required for the currently executing WiFi service are both sent to the electronic device by Link1.
[0195] Continue to see Figure 4 For example, after STA2 obtains the second WiFi scan result (Probe Rsp) for the channel corresponding to the 5GHz frequency band through Link2, it will send an exit sleep frame on Link2, so that AP2 can exit the sleep state and resume the awake state. In this way, AP2 can send QOS DATA 5GHz to STA2 through Link2.
[0196] From the above description of making AP1 exit the sleep state and enter the awake state, it can be known that in order to make AP2 exit the sleep state and enter the awake state, STA2 can send a PS-Poll frame with PowerSave=0 or a Qosnull frame in Link2 to make AP2 automatically exit the sleep state and restore the awake state, and then send QOSDATA 5GHz on Link2 again.
[0197] It should be understood that the above description is only an example for better understanding the technical solution of this embodiment, and is not the only limitation to this embodiment. Figure 4 The illustrated embodiment takes sending a PS-Poll frame with PowerSave=0 to instruct AP2 to exit the sleep state as an example.
[0198] Continue to see Figure 4 For example, since AP2 exits the sleep state and enters the awake state, it can send QOS DATA 5 GHz to STA2 through Link2. Therefore, Link1 can stop sending QOS DATA 5 Hz and only send QOSDATA 2.4 GHz.
[0199] Thus, WiFi scanning of channels corresponding to the 5GHz frequency band is achieved without losing QOS DATA 5GHz.
[0200] By sending sleep frames through Link1 and Link2 respectively, AP1 and AP2 can be actively controlled to enter the sleep state, and then stop sending QOS DAT (QOS DATA 2.4GHz or QOS DATA 5GHz) on the corresponding link. Since the link stops sending QOS DAT, the QOS DAT required for the currently executing WiFi service will not be lost during the process of using the link for WiFi scanning, thereby ensuring that the WiFi service being executed is not affected during the WiFi scanning process.
[0201] In addition, after obtaining the first WiFi scanning result and the second WiFi scanning result through the above scanning method 1, the final WiFi scanning result (target WiFi scanning result) of this WiFi scanning can be obtained by aggregating the first WiFi scanning result and the second WiFi scanning result.
[0202] Exemplarily, in some implementations, for example, a WiFi scan instruction is generated by an application involving an LBS function, or a scene is generated by entering a specified geographic fence. After obtaining the target WiFi scan result, these applications that provide WiFi scan instructions can achieve positioning based on the target WiFi scan result.
[0203] For example, in some other implementations, for example, the WiFi scan command is a scenario generated by the user through the portal of the setting application or the WLAN control in the pull-down notification bar, after obtaining the target WiFi scan result, the searched WiFi scan result can be displayed on the WLAN interface, that is, all available WLANs currently searched. Alternatively, the connected WLAN is automatically selected.
[0204] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.
[0205] In the process of performing WiFi scanning using scanning mode 1, the implementation process of notifying AP1 to enter a dormant state on Link1 and switching the QOS DATA 2.4GHz required for the WiFi service to Link2; or notifying AP2 to enter a dormant state on Link2 and switching the QOS DATA 5GHz required for the WiFi service to Link1 is in the modem (such as Figure 1A It is implemented in the Modem [110B]) shown in FIG. 1 , specifically in the MAC layer in the Modem.
[0206] For the sake of explanation, Figure 5A and Figure 5B , the process of notifying AP1 to enter the dormant state through Link1 and switching the QOS DATA 2.4GHz required for the WiFi service to Link2, and notifying AP1 to exit the dormant state through Link1 and switching the QOS DATA 2.4GHz required for the WiFi service from Link2 back to Link1 is specifically described. The process of notifying AP2 to enter the dormant state through Link2 and switching the QOS DATA 5GHz required for the WiFi service to Link1, and notifying AP2 to exit the dormant state through Link2 and switching the QOS DATA 5GHz required for the WiFi service from Link1 back to Link2 is not repeated here.
[0207] See also Figure 5A In (1), for example, when the TCP / IP in the kernel layer transmits the App data provided by the application layer, such as the WiFi scan command, to the MAC layer in the modem, the upper media access control layer (Upper MAC, UMAC) in the MAC layer will determine the lower media access control layer (lower MAC, LMAC) corresponding to each link based on the traffic link mapping, that is, the mapping relationship between the traffic identifier (Traffic Identifier, TID) and Link1 and Link2 (which can be expressed as: TID-to-Link mapping), that is, the LMAC corresponding to Link1 and the LMAC corresponding to Link2.
[0208] It should be noted that in MLD, each link corresponds to an LMAC. Therefore, in the case where there are dual links between the electronic device 100 and the AP MLD, the modem of the electronic device 100 needs to include two LMACs. For ease of description, Figure 5A In (1), the LMAC corresponding to Link1 is represented as LMAC_STA1, and the LMAC corresponding to Link2 is represented as LMAC_STA2.
[0209] Continue to see Figure 5A In (1), illustratively, in some possible implementations, the UMAC may include a data encryption and decryption module, a block confirmation module, a data distribution module, and a data aggregation module.
[0210] Among them, the data encryption and decryption module is used to encrypt the App data from the application layer.
[0211] The data distribution module is used to distribute the App data encrypted by the data encryption and decryption module to the corresponding LMAC, so as to send the encrypted App data to the corresponding AP through the corresponding Link through the corresponding physical layer (Physical Layer, PHY layer). For example, when AP1 is in the awake state, that is, PM = 0, the App data fed back for data1 (data transmitted in Link1) is encrypted by the data encryption and decryption module, and then distributed to LMAC_STA1 through the data distribution module, and then through the PHY corresponding to LMAC_STA1, such as Figure 5A PHY_Link1(STA1) shown in (1) is sent to Link1. In this way, the data transmitted to AP1 through Link1 can reach AP1.
[0212] For example, when AP2 is in the awake state, that is, PM=0, the App data fed back for data2 (data transmitted in Link2) is encrypted by the data encryption and decryption module, and then distributed to LMAC_STA2 by the data distribution module, and then distributed to LMAC_STA2 by the PHY corresponding to LMAC_STA2, such as Figure 5A PHY_Link1(STA2) shown in (1) is sent to Link2. In this way, the data transmitted to AP2 via Link2 can reach AP2.
[0213] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.
[0214] The data aggregation module is used to aggregate data1 obtained by LMAC_STA1 from Link1 and data2 obtained by LMAC_STA2 from Link2, that is, to aggregate the data of the two links into the data of one link. That is, for the electronic device 100 (such as a mobile phone), the data aggregation is specifically implemented at the MAC layer, so when the data reaches the APP layer, the APP layer perceives the data of one link, such as Figure 6 shown.
[0215] The data encryption and decryption module is also used to decrypt the data aggregated by the data aggregation module, and then transmit it to the corresponding application of the application layer via TCP / IP.
[0216] The block confirmation module is used to implement the processing of replying only one confirmation frame for multiple data packets, thereby reducing the overhead caused by the confirmation frame.
[0217] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.
[0218] based on Figure 5A In the structure shown in (1), when a WiFi scan command is received, the data distribution module in the UMAC can dynamically select whether the data packet from the wireless access point 200 is transmitted to the electronic device 100 via Link 1 or Link 2 based on the TID-to-Link mapping.
[0219] Continue to see Figure 5A In (1), taking Link 2 as an example to transmit the data of wireless access point 200, i.e., data and data2, LMAC_STA1 will send a PS frame in Link 1 to instruct AP1 in wireless access point 200 to enter the sleep state, thereby changing the state of AP1 from PM = 0 to PM = 1, so that AP1 enters the sleep state. At the same time, data1 is switched to Link 2 for transmission, such as Figure 5A As shown in (2), when AP1 is in a dormant state, the App data distributed by the data distribution module in UMAC to the wireless access point 200 is specifically distributed to LMAC_STA2, thereby realizing data transmission to AP2 of the wireless access point 200 through Link2. And, data1 and data2 transmitted by AP2 through Link2 are transmitted to the data aggregation module in UMAC through LMAC_STA2.
[0220] See also Figure 5A Medium (2) or Figure 5B In (1), illustratively, after switching the data packet to Link2 for transmission, Link1 is used to perform WiFi scanning on the channel corresponding to the 2.4 GHz frequency band to obtain the WiFi scanning result, that is, the first WiFi scanning result mentioned above, UMAC can trigger LMAC_STA1 to send the above-mentioned PS-Poll frame or Sos null frame in Link1, thereby causing AP1 to exit the sleep state. In this way, the data distribution module can switch data1 that should be transmitted by Link1 from Link2 back to Link1 for transmission based on TID-to-Link mapping, such as Figure 5B As shown in (2).
[0221] In this way, based on the WiFi scanning method provided in this embodiment, when the first condition is met, by adopting scanning mode 1 to perform WiFi scanning, it is ensured that during the WiFi scanning process, the currently running WiFi services can be carried out normally and are not affected.
[0222] Continue to see Figure 4 For example, when a WiFi scan instruction is received, if it is determined through judgment that the first condition is not currently met, the WiFi scan is performed using scanning mode 2.
[0223] Continue to see Figure 4 For example, regarding scanning mode 2, for example, Link1 is used to perform WiFi scanning on channels in the 2.4GHz band, and Link2 is used to perform WiFi scanning on channels in the 5GHz band. That is, Link1 and Link2 are used in parallel to complete this WiFi scanning service. For example, 1 channel + 36 channels are scanned simultaneously (i.e., channel 1 corresponding to the 2.4GHz band and channel 36 corresponding to the 5GHz band are scanned simultaneously), 2 channels + 40 channels (i.e., channels 2 corresponding to the 2.4GHz band and channels 40 corresponding to the 5GHz band are scanned simultaneously), and so on, until all channels are scanned.
[0224] In this way, based on the WiFi scanning method provided in this embodiment, when the first condition is met, WiFi scanning is performed by adopting scanning mode 2, so that the WiFi scanning can be completed as quickly as possible, the time cost required for multi-band WiFi scanning is reduced, and channel switching can be performed quickly.
[0225] In addition, it should be noted that, in actual applications, there may be multiple wireless access points 200 around the electronic device 100 that responds to the WiFi scan command. These wireless access points 200 may be the AP MLD mentioned in the above embodiment, or may be the AP Legacy mentioned in the above embodiment. Therefore, when the electronic device 100 switches the QOSDATA 2.4GHz that the AP MLD needs to transmit to Link2 for transmission, and then performs WiFi scanning on the channel corresponding to the 2.4GHz frequency band through Link1 between the AP MLD, it can also directly perform WiFi scanning through Link1' between the AP Legacy. However, in the process of performing WiFi scanning through Link1', the QOS DATA 2.4GHz transmitted in Link1' is interrupted, that is, the electronic device 100 cannot receive it, which affects the WiFi service of the QOS DATA 2.4GHz that needs to be transmitted in Link1'.
[0226] Accordingly, the electronic device 100 switches the QOS DATA 5GHz that AP MLD needs to transmit to Link1 for transmission, and then performs WiFi scanning on the channel corresponding to the 5GHz band through Link2 between AP MLD, and can also directly perform WiFi scanning through Link2' between AP Legacy. However, during the process of performing WiFi scanning through Link2', the QOS DATA 5GHz transmitted in Link2' is interrupted, that is, the electronic device 100 cannot receive it, which affects the WiFi service of the QOS DATA 5GHz that needs to be transmitted in Link2'.
[0227] Therefore, based on the WiFi scanning method provided in this embodiment, it is possible to select a suitable scanning mode for WiFi scanning according to the actual scenario and link quality, thereby ensuring that the currently running WiFi services can proceed normally and are not affected during the WiFi scanning process, and can complete the WiFi scanning as quickly as possible when conditions do not permit, thereby reducing the time cost required for multi-band WiFi scanning, and thus enabling fast channel switching.
[0228] In addition, it should be noted that the WiFi scanning method provided in the embodiment of the present application can also be applied to the discovery scenario of P2P devices and the channel switching scenario.
[0229] See also Fig. 7A , exemplarily illustrating a P2P device discovery process implemented based on the WiFi scanning method provided in an embodiment of the present application.
[0230] In this embodiment, the WiFi chip in the electronic device 100 is still taken as an example with a 2.4 GHz+5 GHz dual-band communication specification.
[0231] based on Figure 4 Description of the illustrated embodiment, Fig. 7A In the illustrated embodiment, the electronic device 100 and the wireless access point 200 are both devices supporting Multi-link, wherein a Link 1 for transmitting QOS DATA 2.4 GHz and a Link 2 for transmitting QOS DATA 5 GHz are also established between the electronic device 100 and the wireless access point 200.
[0232] Continue to see Fig. 7A For example, when receiving a P2P device discovery instruction, such as P2P_DISCOVERY_CMD, the electronic device responds to the instruction and, if the first condition is met, performs full channel scanning using scanning mode 1. For a specific implementation process of performing full channel scanning using scanning mode, please refer to Figure 4In the illustrated embodiment, the WiFi scanning process of the channels corresponding to the 2.4 GHz frequency band and the channels corresponding to the 5 GHz frequency band using scanning mode 1 is not described in detail here.
[0233] It should be noted that since the number of channels corresponding to the 2.4GHz frequency band is relatively small, for example, in China, only channels 1 to 13 need to be scanned. Therefore, after completing the full channel scan using scanning method 1, the P2P device discovery process can be completed on the channels corresponding to the 2.4GHz frequency band, thereby speeding up the scanning speed and reducing the scanning time cost. However, after completing the P2P device discovery process and completing the GO negotiation with the discovered P2P device, subsequent services can be directly implemented in the 5GHz frequency band of the P2P device.
[0234] Continue to see Fig. 7A For example, Link1 can be used to complete the P2P device discovery process on the channel corresponding to the 2.4GHz frequency band. Therefore, when using Link1 to discover P2P devices, STA1 can send the above-mentioned PS frame on Link1 to put AP1 into a dormant state. In this way, after monitoring an available channel, such as CH1 (the first channel corresponding to the 2.4GHz frequency band), the traditional P2P device discovery process can be performed on Link1.
[0235] See also Figure 7B For example, for the 14 channels corresponding to the 2.4 GHz frequency band, the frequency band is between 2.400 GHz and 2.4835 GHz.
[0236] See also Figure 7B For example, 2.400 GHz to 2.4835 GHz is divided into 14 channels, of which the 14th channel is generally not used and can be ignored.
[0237] Continue to see Figure 7B For example, for channel 1 to channel 13, the bandwidth of each channel is 22M, and the interval between any two adjacent channels is 5M.
[0238] Continue to see Figure 7BFor example, the center frequency corresponding to the first channel is 2.412 GHz, and the center frequency corresponding to each channel increases by 5 MHz thereafter, such as the center frequency corresponding to the second channel is 2.417 GHz, the center frequency corresponding to the third channel is 2.422 GHz, the center frequency corresponding to the fourth channel is 2.427 GHz, the center frequency corresponding to the fifth channel is 2.432 GHz, the center frequency corresponding to the sixth channel is 2.437 GHz, the center frequency corresponding to the seventh channel is 2.442 GHz, the center frequency corresponding to the eighth channel is 2.447 GHz, the center frequency corresponding to the ninth channel is 2.452 GHz, the center frequency corresponding to the tenth channel is 2.457 GHz, the center frequency corresponding to the eleventh channel is 2.462 GHz, the center frequency corresponding to the twelfth channel is 2.467 GHz, and the center frequency corresponding to the thirteenth channel is 2.472 GHz.
[0239] Continue to see Figure 7B For example, the interval between the 14th channel and the 13th channel is not 5M, for example, it can be 12M, that is, the center frequency corresponding to the 14th channel is 2.484GHz.
[0240] pass Figure 7B It can be found that for the channels corresponding to the 2.4GHz frequency band, only CH1, CH6 and CH11 are completely independent, that is, they do not overlap with other channels. Therefore, there are fewer interference signals in these three channels. Therefore, when this embodiment implements the traditional P2P discovery process on Link1, it will send detection signals / detection requests through these three channels, namely CH1, CH6 and CH11. Fig. 7A The Probe Req is sent through three channels: CH1, CH6 and CH11.
[0241] Correspondingly, if the P2P device makes a probe response (Probe Rsp) on the three channels CH1, CH6 and CH11, the electronic device will complete the P2P discovery after receiving the probe response, which means that the P2P device is discovered in this P2P discovery process.
[0242] Continue to see Fig. 7A For example, in this embodiment, during the P2P discovery phase, the P2P device makes a detection response on the CH6 channel, that is, Fig. 7A Take the Probe Rsp sent through the CH6 channel as an example.
[0243] Since the electronic device 100 has discovered Fig. 7AThe P2P device shown in the figure, therefore, the electronic device 100 and the P2P device can perform the GO negotiation (Group Owner Negotiation) process, specifically, negotiating between the electronic device 100 and the P2P device as to which of them will play the GO role and which will play the Client role. After completing the GO negotiation, the device playing the GO role will switch itself to AP mode (equivalent to acting as a wireless access point), and the device playing the Client role will connect to the AP of the GO (equivalent to acting as a STA).
[0244] Continue to see Fig. 7A For example, after completing the GO negotiation, STA1 will send a PS-Poll frame or a Qos null frame on Link1 to instruct AP1 to exit the sleep state, so that the QOS DATA 2.4GHz provided by AP1 can be switched back from Link2 to Link1 for transmission.
[0245] In addition, it should be noted that after the electronic device 100 completes the GO negotiation with the discovered P2P device, a corresponding link will be established between the two, and then when there is data to be interacted, it will be transmitted through the corresponding link.
[0246] Therefore, in the P2P discovery scenario, based on the WiFi scanning method provided in this embodiment, when the first condition is met, by adopting scanning mode 1 to perform WiFi scanning of all channels, it is ensured that during the WiFi scanning process, the currently running WiFi service can be carried out normally and is not affected. In addition, after the full channel scan is completed by adopting scanning mode 1, the processing logic of scanning mode 1 is also adopted to control the data of Link1 to switch to Link2, and then the P2P discovery process is implemented on Link, ensuring that during the P2P discovery process, the currently running WiFi service can be carried out normally and is not affected.
[0247] See also Figure 8 , exemplarily illustrating a process of channel switching implemented based on the WiFi scanning method provided in an embodiment of the present application.
[0248] In this embodiment, the WiFi chip in the electronic device 100 is still used as an example of a 2.4 GHz+5 GHz dual-band communication specification, and the APs that can currently be accessed and connected to include two types of APs, namely, AP MLD and AP Legacy.
[0249] Continue to see Figure 8 Exemplarily, when the electronic device receives a channel switching request, the electronic device responds to the channel switching request and can also determine whether Link1 and Link2 meet the first condition.
[0250] Accordingly, when the first condition is met, WiFi scanning is performed using scanning mode 1; when the first condition is not met, WiFi scanning is performed using scanning mode 2. In this way, WiFi scanning is performed using a suitable scanning mode, that is, channels corresponding to different frequency bands are detected, and then the channel quality of each channel is determined, so that the channel switching process can be implemented according to the channel quality of each channel later. Figure 8 Take satisfying the first condition as an example.
[0251] For details about WiFi scanning using Scan Mode 1 or Scan Mode 1, see Figure 4 The illustrated embodiments will not be described in detail here.
[0252] Therefore, in the channel switching scenario, based on the WiFi scanning method provided in this embodiment, when the first condition is met, the WiFi scanning is performed by adopting scanning mode 1 to determine the channel quality of each channel, thereby ensuring that the currently running WiFi service can proceed normally during the WiFi scanning process without being affected, while ensuring the smooth progress of the channel switching process.
[0253] In addition, when the first condition is not met, WiFi scanning is performed by adopting scanning method 2 to determine the channel quality of each channel, so that WiFi scanning can be completed as quickly as possible when conditions do not permit, reducing the time cost required for multi-band WiFi scanning, and thus enabling fast channel switching.
[0254] In addition, it is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0255] In addition, it should be noted that the WiFi scanning method provided in the above embodiments implemented by an electronic device in an actual application scenario can also be executed by a chip system included in the electronic device, wherein the chip system may include a processor. The chip system can be coupled to a memory so that when the chip system is running, a computer program stored in the memory is called to implement the steps executed by the above electronic device. The processor in the chip system can be an application processor ( Figure 1A AP [110A] in the example), or a non-application processor such as a modem ( Figure 1AModem[110B] in.
[0256] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the WiFi scanning method in the above-mentioned embodiment.
[0257] In addition, an embodiment of the present application further provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the above-mentioned related steps to implement the WiFi scanning method in the above-mentioned embodiment.
[0258] In addition, it can be seen from the above description that the electronic device, computer-readable storage medium, computer program product or chip system provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0259] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A WiFi scanning method, characterized in that: The invention is applied to an electronic device that is executing a first WiFi service, wherein a first link and a second link are established between the electronic device and a wireless access point; wherein, during the execution of the first WiFi service, the wireless access point sends first quality of service data to the electronic device through the first link, and sends second quality of service data to the electronic device through the second link; The WiFi scanning method comprises: In response to the received WiFi scan instruction, a sleep frame is sent on the first link, where the sleep frame is used to instruct the wireless access station to enter a sleep state; wherein after the wireless access station enters the sleep state, it stops sending the first quality of service data to the electronic device through the first link, and sends the first quality of service data and the second quality of service data to the electronic device through the second link; Perform a WiFi scan using the first link to obtain a first WiFi scan result of a channel corresponding to the first link; Sending an exit sleep frame on the first link, wherein the exit sleep frame is used to instruct the wireless access point to exit the sleep state and enter the awake state; wherein after the wireless access point enters the awake state, the first quality of service data is sent to the electronic device through the first link, and the second quality of service data is sent to the electronic device through the second link; sending the sleep frame on the second link; wherein, after the wireless access station enters the sleep state, it stops sending the second quality of service data to the electronic device through the second link, and sends the first quality of service data and the second quality of service data to the electronic device through the first link; Perform a WiFi scan using the second link to obtain a second WiFi scan result of a channel corresponding to the second link; sending the exit sleep frame on the second link; A target WiFi scan result is obtained according to the first WiFi scan result and the second WiFi scan result.
2. The method according to claim 1, characterized in that: The sending of a sleep frame on the first link in response to the received WiFi scan instruction includes: The UMAC layer of the electronic device responds to the WiFi scan instruction received from the APP layer and determines, based on traffic link mapping, that the first link corresponds to the first LMAC layer and the second link corresponds to the second LMAC layer; Sending, by the first LMAC layer, the sleep frame on the first link; Accordingly, sending the sleep frame on the second link includes: The sleep frame is sent by the second LMAC layer on the second link.
3. The method according to claim 2, characterized in that The using the first link to perform WiFi scanning includes: The first LMAC layer performs the WiFi scan using the first link; Accordingly, the using the second link to perform WiFi scanning includes: The second LMAC layer performs the WiFi scan using the second link.
4. The method according to claim 2, characterized in that: In the process of using the first link to perform WiFi scanning, the method further includes: The UMAC layer sends the MAC protocol data unit from the APP layer to the second LMAC layer, and stops sending the MAC protocol data unit to the first LMAC layer; Accordingly, in the process of performing WiFi scanning using the second link, the method further includes: The UMAC layer sends the MAC protocol data unit to the first LMAC layer, and stops sending the MAC protocol data unit to the second LMAC layer.
5. The method according to claim 4, characterized in that The step of sending an exit sleep frame on the first link comprises: The UMAC layer triggers the first LMAC layer to send the exit sleep frame on the first link; Accordingly, sending the sleep frame on the second link includes: The UMAC layer triggers the second LMAC layer to send the exit sleep frame on the second link.
6. The method according to claim 5, characterized in that After sending the exit sleep frame on the first link, the method further includes: The UMAC layer sends the MAC protocol data unit to the first LMAC layer; The UMAC layer receives the first quality of service data sent by the first LMAC layer and the second quality of service data sent by the second LMAC layer; The UMAC layer aggregates the first quality of service data and the second quality of service data; The UMAC layer transmits the post-meeting quality of service data to the first application located at the APP layer, where the first application is an application that triggers the first WiFi service.
7. The method according to any one of claims 1 to 6, characterized in that: The sending of a sleep frame on the first link in response to the received WiFi scan instruction includes: In response to the received WiFi scan instruction, determining whether the first link and the second link meet a first condition; When the first link and the second link satisfy the first condition, the sleep frame is sent on the first link.
8. The method according to claim 7, characterized in that The method further comprises: When the first link and / or the second link does not satisfy the first condition, the first link and the second link are used to perform WiFi scanning simultaneously.
9. The method according to claim 7, characterized in that: The determining whether the first link and the second link satisfy a first condition includes: Determining, according to the first quality of service data, whether the first link has a beacon loss situation; When there is a beacon loss situation in the first link, determining that the first link does not meet the first condition; When there is no beacon loss on the first link, determining, according to the first quality of service data, whether an RSSI value of the first link is less than a preset RSSI threshold; When the RSSI value of the first link is less than the RSSI threshold, determining that the first link does not meet the first condition; When the RSSI value of the first link is greater than or equal to the RSSI threshold, determining, according to the first quality of service data, whether the packet loss rate of the first link is greater than a preset packet loss rate threshold; When the packet loss rate of the first link is greater than the packet loss rate threshold, determining that the first link does not meet the first condition; When the packet loss rate of the first link is less than or equal to the packet loss rate threshold, determining that the first link satisfies the first condition; determining, according to the second quality of service data, whether a beacon is lost on the second link; When the beacon is lost on the second link, determining that the second link does not meet the first condition; When there is no beacon loss on the second link, determining, according to the second quality of service data, whether an RSSI value of the second link is less than a preset RSSI threshold; When the RSSI value of the second link is less than the RSSI threshold, determining that the second link does not meet the first condition; When the RSSI value of the second link is greater than or equal to the RSSI threshold, determining, according to the second quality of service data, whether the packet loss rate of the second link is greater than a preset packet loss rate threshold; When the packet loss rate of the second link is greater than the packet loss rate threshold, determining that the second link does not meet the first condition; When the packet loss rate of the second link is less than or equal to the packet loss rate threshold, it is determined that the second link meets the first condition.
10. The method according to any one of claims 1 to 9, characterized in that: The sleep frame is a PS frame, and the exit sleep frame is a PS-Poll frame or a Qos null frame.
11. The method according to any one of claims 1 to 10, characterized in that: A frequency band corresponding to the first link is different from a frequency band corresponding to the second link.
12. An electronic device, characterized in that: The electronic device comprises: a memory and a processor, wherein the memory and the processor are coupled; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the WiFi scanning method as described in any one of claims 1 to 11.
13. A chip system, characterized in that: The chip system includes a processor, and the processor is used to support the electronic device to implement the WiFi scanning method as described in any one of claims 1 to 11.
14. The chip system according to claim 13, characterized in that: The processor includes a modem.
15. A computer-readable storage medium, characterized in that: It comprises a computer program, and when the computer program is run on an electronic device, the electronic device executes the WiFi scanning method as claimed in any one of claims 1 to 11.