WIFI network scanning method and apparatus, and device, storage medium and product

By configuring a Wi-Fi chip and processor in the terminal device and utilizing the scan cache space to store historical scan results, the Wi-Fi scanning process is optimized, solving the problem of high power consumption in the terminal device during Wi-Fi scanning and achieving more efficient energy management.

WO2026046059A1PCT designated stage Publication Date: 2026-03-05GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

In existing technologies, terminal devices suffer from high power consumption when scanning Wi-Fi networks, especially when managing sensor data using a Sensor Hub, where frequent Wi-Fi scanning leads to unnecessary energy consumption.

Method used

By configuring a Wi-Fi chip and at least two processors in the terminal, historical scan results are stored in the scan cache space. The cache is queried according to the scan command to determine the scan result, and the radio frequency device is woken up only when necessary to perform the scan, thus avoiding repeated scans.

Benefits of technology

It reduces the power consumption of terminal devices, improves energy efficiency, and reduces energy waste caused by unnecessary Wi-Fi scanning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025116389_05032026_PF_FP_ABST
    Figure CN2025116389_05032026_PF_FP_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of wireless communications. Provided are a WiFi network scanning method and apparatus, and a device, a storage medium and a product. The method is applied to a terminal, wherein the terminal is configured with a WiFi chip and at least two processors. The method comprises: by means of a WiFi chip, receiving a WiFi scanning instruction sent by a target processor among at least two processors, wherein the WiFi scanning instruction carries a first frequency band set; on the basis of the WiFi scanning instruction, querying a scanning cache space to obtain a first WiFi scanning result, wherein the scanning cache space is used for storing WiFi scanning results obtained from historical scans performed by the at least two processors; on the basis of the first WiFi scanning result, determining a second WiFi scanning result corresponding to the WiFi scanning instruction; and by means of the WiFi chip, sending the second WiFi scanning result to the target processor. The embodiments of the present application can reduce the power consumption of a terminal, thereby improving the energy efficiency of the terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, devices, equipment, storage media, and products for scanning Wi-Fi networks

[0001] This application claims priority to Chinese Patent Application No. 202411195825.3, filed on August 28, 2024, entitled "Scanning Method, Apparatus, Device, Storage Medium and Product for Wifi Networks", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of wireless communication technology, and in particular to a scanning method, apparatus, device, storage medium, and product for Wi-Fi networks. Background Technology

[0003] Currently, most devices support sensor hubs, a technology for managing sensor data. Sensor hubs can operate with very low power consumption while the device's main processor is in sleep mode, continuously collecting sensor data. For example, Sensor Hub's low-power fencing technology periodically initiates Wireless Fidelity (Wi-Fi) scans to determine if the device is within the coverage area of ​​a particular Wi-Fi network, and automatically connects to that network when it is. Summary of the Invention

[0004] This application provides a method, apparatus, device, storage medium, and product for scanning Wi-Fi networks. The technical solution is as follows:

[0005] On the one hand, a method for scanning Wi-Fi networks is provided, applied to a terminal, the terminal being configured with a Wi-Fi chip and at least two processors, the method comprising:

[0006] The Wifi chip receives a Wifi scanning command sent by a target processor from at least two processors. The Wifi scanning command carries a first frequency band set, which is the frequency band set corresponding to the channel information requested by the Wifi scanning command.

[0007] Based on the Wifi scan command, the terminal's scan cache space is queried to obtain the first Wifi scan result, and the scan cache space is used to store the Wifi scan results historically scanned by the at least two processors;

[0008] Based on the first Wi-Fi scan result, determine the second Wi-Fi scan result corresponding to the Wi-Fi scan command;

[0009] The second Wi-Fi scan result is sent to the target processor via the Wi-Fi chip.

[0010] On the other hand, a Wi-Fi network scanning device is provided, deployed on a terminal, the terminal being configured with a Wi-Fi chip and at least two processors, the device comprising:

[0011] The receiving module is configured to receive a Wi-Fi scanning command sent by a target processor among the at least two processors via the Wi-Fi chip. The Wi-Fi scanning command carries a first frequency band set, which is the frequency band set corresponding to the channel information requested by the Wi-Fi scanning command.

[0012] The query module is used to query the terminal's scan cache space based on the Wifi scan command to obtain a first Wifi scan result. The scan cache space is used to store the Wifi scan results historically scanned by the at least two processors.

[0013] The determining module is used to determine the second Wifi scan result corresponding to the Wifi scan command based on the first Wifi scan result;

[0014] The transmitting module is used to transmit the second Wi-Fi scan result to the target processor via the Wi-Fi chip.

[0015] On the other hand, a terminal is provided, the terminal including a processor and a memory, the memory storing at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to implement the Wi-Fi network scanning method described above.

[0016] On the other hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the storage medium, the at least one piece of program code being loaded and executed by a processor to implement the Wi-Fi network scanning method described above.

[0017] On the other hand, a computer program product is provided, which stores at least one piece of program code for execution by a processor to implement the Wi-Fi network scanning method described above. Attached Figure Description

[0018] Figure 1 shows a schematic diagram of the implementation environment of a Wi-Fi network scanning method according to an exemplary embodiment of this application;

[0019] Figure 2 shows a flowchart of a Wi-Fi network scanning method according to an exemplary embodiment of this application;

[0020] Figure 3 shows a flowchart of a Wi-Fi network scanning method according to an exemplary embodiment of this application;

[0021] Figure 4 shows a flowchart of a Wi-Fi network scanning method according to an exemplary embodiment of this application;

[0022] Figure 5 shows a flowchart of a Wi-Fi network scanning method according to an exemplary embodiment of this application;

[0023] Figure 6 shows a flowchart of a Wi-Fi network scanning method according to an exemplary embodiment of this application;

[0024] Figure 7 shows a block diagram of a Wi-Fi network scanning device according to an exemplary embodiment of this application;

[0025] Figure 8 shows a block diagram of a terminal illustrated in an exemplary embodiment of this application. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0027] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0028] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the Wi-Fi scanning commands, scanning channel information, and Wi-Fi scanning results involved in this application were all obtained with full authorization.

[0029] The following technical solutions are provided in the embodiments of this application:

[0030] A method for scanning a Wi-Fi network, applied to a terminal equipped with a Wi-Fi chip and at least two processors, the method comprising:

[0031] The Wifi chip receives a Wifi scanning command sent by a target processor from at least two processors. The Wifi scanning command carries a first frequency band set, which is the frequency band set corresponding to the channel information requested by the Wifi scanning command.

[0032] Based on the Wifi scan command, the terminal's scan cache space is queried to obtain the first Wifi scan result, and the scan cache space is used to store the Wifi scan results historically scanned by the at least two processors;

[0033] Based on the first Wi-Fi scan result, determine the second Wi-Fi scan result corresponding to the Wi-Fi scan command;

[0034] The second Wi-Fi scan result is sent to the target processor via the Wi-Fi chip.

[0035] In some embodiments, obtaining the first Wi-Fi scan result by querying the terminal's scan cache space based on the Wi-Fi scan command includes:

[0036] The scan cache space is used to store historical scan results corresponding to at least one second frequency band set, where the second frequency band set is the frequency band set corresponding to the historical Wi-Fi scan instruction request scan channel message; based on the first frequency band set, a target frequency band set is queried from the at least one second frequency band set, where the target frequency band set is the frequency band set that includes the first frequency band set;

[0037] If the target frequency band set is found, the historical scan results corresponding to the target frequency band set are obtained from the scan cache space to obtain the first Wi-Fi scan result.

[0038] In some embodiments, the method further includes:

[0039] If the target frequency band set is not found, wake up the radio frequency device of the Wi-Fi chip;

[0040] Using the radio frequency device, a Wi-Fi scan is initiated on each frequency band included in the first frequency band set to obtain a third Wi-Fi scan result;

[0041] The third Wi-Fi scan result is sent to the target processor via the Wi-Fi chip.

[0042] In some embodiments, the at least two processors include a main processor and a sensor hub, wherein the target processor is the sensor hub.

[0043] In some embodiments, obtaining the first Wi-Fi scan result by querying the terminal's scan cache space based on the Wi-Fi scan command includes:

[0044] The scanning cache space is used to store the historical scanning results of the frequency band corresponding to each historical scanning channel information. Then, based on each frequency band in the first frequency band set, the scanning cache space is queried one by one.

[0045] The first Wi-Fi scan result is composed of historical scan results retrieved from the scan cache space.

[0046] In some embodiments, determining the second Wi-Fi scan result corresponding to the Wi-Fi scan command based on the first Wi-Fi scan result includes:

[0047] If the first Wi-Fi scan result includes the historical scan result of each frequency band in the first frequency band set, the first Wi-Fi scan result is determined as the second Wi-Fi scan result;

[0048] If the first Wi-Fi scan result includes historical scan results of some frequency bands in the first frequency band set, the radio frequency device of the Wi-Fi chip is woken up, and the Wi-Fi scan is initiated on other frequency bands through the radio frequency device to obtain the Wi-Fi scan results of the other frequency bands; the first Wi-Fi scan result and the Wi-Fi scan results of the other frequency bands are combined to form the second Wi-Fi scan result, wherein the other frequency bands are the frequency bands in the first frequency band set for which no historical scan results were found.

[0049] In some embodiments, the method further includes:

[0050] The Wi-Fi scan results of the other frequency bands are stored in the scan cache space, and the scan time of the Wi-Fi scan results of the other frequency bands is marked.

[0051] In some embodiments, the at least two processors include a main processor and a Sensor Hub, and the target processor is either the Sensor Hub or the main processor.

[0052] In some embodiments, determining the second Wi-Fi scan result corresponding to the Wi-Fi scan command based on the first Wi-Fi scan result includes:

[0053] The Wifi scanning command also carries the validity period of the scanning result. The scanning cache space stores the scanning time of the first Wifi scanning result. Based on the scanning time of the first Wifi scanning result and the validity period, the expiration time of the first Wifi scanning result is determined.

[0054] If the current time is earlier than the expiration time of the first Wifi scan result, a second Wifi scan result corresponding to the Wifi scan command is determined based on the first Wifi scan result.

[0055] In some embodiments, the method further includes:

[0056] If the current time is not earlier than the expiration time of the first Wifi scan result, the radio frequency device of the Wifi chip is woken up, and the Wifi scan is initiated on each frequency band included in the first frequency band set through the radio frequency device to obtain the third Wifi scan result;

[0057] The third Wi-Fi scan result is sent to the target processor via the Wi-Fi chip.

[0058] In some embodiments, the method further includes:

[0059] The third Wi-Fi scan result is stored in the scan cache space, and the scan time of the third Wi-Fi scan result is marked.

[0060] In some embodiments, the method further includes:

[0061] When the target processor is Sensor Hub, the system automatically connects to the Wi-Fi network based on the Wi-Fi networks included in the second Wi-Fi scan results.

[0062] When the target processor is the main processor, the main processor's Wi-Fi auxiliary function is implemented based on the Wi-Fi networks included in the second Wi-Fi scan results.

[0063] Please refer to Figure 1, which illustrates an implementation environment of a Wi-Fi network scanning method according to an exemplary embodiment of this application. Referring to Figure 1, this implementation environment includes: a terminal, which is configured with a Wi-Fi chip and at least two processors. The at least two processors send Wi-Fi scanning commands to the Wi-Fi chip based on different scanning mechanisms. For example, the at least two processors include a main processor and a Sensor Hub. The Sensor Hub periodically sends Wi-Fi scanning commands to the Wi-Fi chip; the main processor also periodically sends Wi-Fi scanning commands to the Wi-Fi chip, or when an application on the terminal needs to use Wi-Fi assistance functions, the main processor sends Wi-Fi scanning commands to the Wi-Fi chip; the Wi-Fi assistance functions can include Wi-Fi network-based positioning, etc. The Wi-Fi chip can be a Wi-Fi microcontroller unit (MCU).

[0064] In some embodiments, the Wi-Fi chip includes a radio frequency (RF) device. When no Wi-Fi scan command is received, the Wi-Fi chip controls the RF device to be in a sleep state to save power consumption. When the Wi-Fi chip receives a Wi-Fi scan command, it wakes up the RF device so that the RF device can perform a Wi-Fi scan based on the command. The main processor includes user applications, a Wi-Fi framework, a Wi-Fi native layer, and a driver layer (Wi-Fi native & driver). User applications manage the applications running on the main processor, and the Wi-Fi framework manages Wi-Fi protocol-related information. When user applications use a Wi-Fi network, Wi-Fi native & driver send a Wi-Fi scan command to the Wi-Fi chip (specifically, the Wi-Fi MCU). The sensor hub includes a positioning application and a Wi-Fi driver. When the positioning application needs to use a Wi-Fi network for assisted positioning, the Wi-Fi driver sends a Wi-Fi scan command to the Wi-Fi chip (specifically, the Wi-Fi MCU). Additionally, User Applications in the main processor can also use Positioning Applications in Sensor Hub for positioning, in which case Positioning Applications report positioning information to User Applications.

[0065] In some embodiments, the main processor can be a Host AP. The terminal can be a mobile phone, tablet computer, in-vehicle terminal, wearable device (smartwatch, smart bracelet, or smart glasses, etc.).

[0066] Please refer to Figure 2, which shows a flowchart of a Wi-Fi network scanning method according to an exemplary embodiment of this application. The method is applied to a terminal configured with a Wi-Fi chip and at least two processors; referring to Figure 2, the method includes:

[0067] Step 201: Receive a Wi-Fi scan command sent by the target processor from at least two processors via the Wi-Fi chip. The Wi-Fi scan command carries a first frequency band set.

[0068] The first frequency band set is the set of frequency bands corresponding to the Wi-Fi scan command request to scan channel information, and the first frequency band set includes at least one frequency band. A frequency band refers to the frequency range in which a Wi-Fi scan is initiated. A Wi-Fi chip can also initiate a Wi-Fi scan on a certain frequency; therefore, the first frequency band set can also be called the first frequency set, and the first frequency set includes at least one frequency.

[0069] The terminal is equipped with a Wi-Fi chip and at least two processors, including a main processor and a Sensor Hub. The Sensor Hub periodically sends Wi-Fi scan commands to the Wi-Fi chip. The main processor periodically sends Wi-Fi scan commands to the Wi-Fi chip, or sends Wi-Fi scan commands when a certain application on the terminal needs to use Wi-Fi assistance functions. Wi-Fi assistance functions can include positioning based on Wi-Fi networks. The Wi-Fi chip performs Wi-Fi scans based on the Wi-Fi scan commands and then stores the Wi-Fi scan results in a scan cache space; that is, the scan cache space stores the Wi-Fi scan results historically obtained by at least two processors. Therefore, when the Wi-Fi chip receives a Wi-Fi scan command from the target processor, it does not immediately perform a Wi-Fi scan, but instead executes step 202, querying the terminal's scan cache space based on the Wi-Fi scan command.

[0070] In some embodiments, the target processor can be any of at least two processors; that is, the target processor can be the main processor or the Sensor Hub. The Wi-Fi scan result can be the connection information (username and password), location information, etc. of the scanned Wi-Fi networks; the Wi-Fi scan result can also be the result of no Wi-Fi networks being scanned.

[0071] In some embodiments, in addition to carrying the first frequency band set, the Wi-Fi scanning command may also carry the validity period of the scan results, which is used to verify whether the Wi-Fi scan results in the scan cache are valid. The Wi-Fi scanning command may also carry scan accuracy requirement information, which is used to verify whether the Wi-Fi scan results in the scan cache meet the accuracy requirements. The Wi-Fi scanning command may also carry a scan level, which indicates the urgency of the Wi-Fi scan; for example, a higher scan level indicates a higher urgency of the Wi-Fi scan, while a lower scan level indicates a lower urgency of the Wi-Fi scan.

[0072] In some embodiments, the effective duration can be a fixed value, for example, 30 seconds. In other embodiments, the effective duration can be determined based on the purpose information of the Wi-Fi scan. This process can be as follows: using the Wi-Fi chip, determine the accuracy of the purpose information, and obtain an effective duration that matches the accuracy of the purpose information. For example, if the purpose information is for positioning, and the positioning is used for coarse positioning, then the accuracy of the purpose information is low, and the obtained effective duration is long; if the positioning is used for precise positioning, then the accuracy of the purpose information is high, and the obtained effective duration is short.

[0073] In this embodiment, the effective duration of the Wi-Fi scan result is determined based on the purpose information of the Wi-Fi scan, thereby enabling different effective durations to be set for different purpose information and improving the accuracy of the determined effective duration.

[0074] Step 202: Based on the Wifi scan command, query the terminal's scan cache space to obtain the first Wifi scan result. The scan cache space is used to store the Wifi scan results historically scanned by at least two processors of the terminal.

[0075] In some embodiments, the scan cache space is used to store historical scan results corresponding to at least one second frequency band set. The second frequency band set is the set of frequency bands corresponding to the historical Wi-Fi scan command requesting scan channel information. The second frequency band set includes at least one frequency band, and the historical Wi-Fi scan command is a scan command historically sent by at least two memories. The Wi-Fi chip can also initiate Wi-Fi scanning on a certain frequency; therefore, the second frequency band set can also be called a second frequency set, which includes at least one frequency. Accordingly, the step of the Wi-Fi chip querying the terminal's scan cache space based on the Wi-Fi scan command to obtain the first Wi-Fi scan result can be as follows: the Wi-Fi chip queries a target frequency band set from at least one second frequency band set based on the first frequency band set. The target frequency band set is a set of frequency bands that includes the first frequency band set. If the target frequency band set is found, the historical scan result corresponding to the target frequency band set is obtained from the terminal's scan cache space to obtain the first Wi-Fi scan result, and then step 203 is executed. If the target frequency band set is not found, the radio frequency device of the Wi-Fi chip is woken up; the radio frequency device initiates a Wi-Fi scan on each frequency band included in the first frequency band set to obtain the third Wi-Fi scan result; the Wi-Fi chip sends the third Wi-Fi scan result to the target processor.

[0076] It should be noted that the scan cache space is stored in a one-to-one correspondence between the second frequency band set and the historical scan result; for example, the scan cache space stores second frequency band set 1 - historical scan result 1, and second frequency band set 2 - historical scan result 2; wherein, the second frequency band set includes at least one frequency band.

[0077] In some embodiments, the scan cache space is used to store the historical scan results of the frequency band corresponding to each historical scan channel information; correspondingly, the step of the Wifi chip querying the scan cache space to obtain the first Wifi scan result based on the Wifi scan instruction can be as follows: the Wifi chip queries the scan cache space one by one based on each frequency band in the first frequency band set; and the historical scan results queried from the scan cache space are used to form the first Wifi scan result.

[0078] For example, the first frequency band set carried by the Wi-Fi scanning command includes three frequency bands, namely frequency band 1, frequency band 2 and frequency band 3. The Wi-Fi chip queries the scanning cache space one by one. Assuming that the scanning cache space includes the historical scanning results corresponding to frequency band 2 and frequency band 3, the first Wi-Fi scanning result obtained includes the historical scanning results corresponding to frequency band 2 and frequency band 3.

[0079] In this embodiment, the scan cache space stores the historical scan results of the frequency band corresponding to each historical scan channel information. This allows the historical scan results of all frequency bands in the first frequency band set to be obtained from the scan cache space; or, the historical scan results of some frequency bands in the first frequency band set can be obtained from the scan cache space, while the Wi-Fi scan results of other frequency bands can be obtained by scanning, thereby improving the flexibility of obtaining Wi-Fi scan results.

[0080] In some embodiments, the Wi-Fi scan command also carries a scan level. If the scan level is higher than a preset level, it indicates a higher scan level, requiring immediate scanning to obtain a more accurate Wi-Fi scan result. Therefore, when the Wi-Fi chip receives the Wi-Fi scan command, it determines whether the scan level carried by the Wi-Fi scan command is higher than the preset level. If the scan level carried by the Wi-Fi scan command is higher than the preset level, the Wi-Fi chip's radio frequency device is directly woken up. Through the radio frequency device, a Wi-Fi scan is initiated on each frequency band included in the first frequency band set to obtain a third Wi-Fi scan result. The Wi-Fi chip then sends the third Wi-Fi scan result to the target processor. After obtaining the third Wi-Fi scan result, the Wi-Fi chip stores the third Wi-Fi scan result in the scan cache space and marks the scan time of the third Wi-Fi scan result in the scan cache space so that the third Wi-Fi scan result can be reused by other processors or reused by the next Wi-Fi scan command. If the scan level is not higher than the preset level, when the Wi-Fi chip receives the Wi-Fi scan command, it queries the terminal's scan cache space based on the Wi-Fi scan command in step 202 to obtain the first Wi-Fi scan result.

[0081] In this embodiment, by carrying different scanning levels in the Wi-Fi scanning command, the Wi-Fi chip can immediately perform a scan when it receives a Wi-Fi scanning command with a higher scanning level to obtain more accurate Wi-Fi scanning results, thereby improving the response efficiency and accuracy of Wi-Fi scanning.

[0082] Step 203: Based on the first Wi-Fi scan result, determine the second Wi-Fi scan result corresponding to the Wi-Fi scan command.

[0083] In some embodiments, in addition to carrying the first frequency band set, the Wi-Fi scanning command may also carry the validity duration of the scan result, which is used to verify whether the scan result in the scan cache space is valid. Furthermore, the scan cache space stores the scan time of the first Wi-Fi scan result. Accordingly, this step may be: the Wi-Fi chip determines the expiration time of the first Wi-Fi scan result based on the scan time and validity duration of the first Wi-Fi scan result; if the current time is earlier than the expiration time of the first Wi-Fi scan result, the second Wi-Fi scan result corresponding to the Wi-Fi scanning command is determined based on the first Wi-Fi scan result.

[0084] If the current time is no earlier than the expiration time of the first Wi-Fi scan result, the Wi-Fi chip wakes up its radio frequency (RF) device. Through the RF device, it initiates a Wi-Fi scan on each frequency band included in the first frequency band set to obtain a third Wi-Fi scan result. The Wi-Fi chip then sends the third Wi-Fi scan result to the target processor. Additionally, the Wi-Fi chip stores the third Wi-Fi scan result in a scan cache space and marks the scan time of the third Wi-Fi scan result in the scan cache space, so that the third Wi-Fi scan result can be reused by other processors or by the next Wi-Fi scan command.

[0085] In other embodiments, the Wi-Fi scanning command may also carry scanning accuracy requirement information, which is used to verify whether the scanning results in the scanning cache space meet the accuracy requirements. Accordingly, this step can be: the Wi-Fi chip determines the scanning accuracy of the first Wi-Fi scan result, and determines whether the scanning accuracy of the first Wi-Fi scan result meets the accuracy requirement corresponding to the scanning accuracy requirement information carried by the Wi-Fi scanning command; if the scanning accuracy of the first Wi-Fi scan result meets the accuracy requirement corresponding to the scanning accuracy requirement information carried by the Wi-Fi scanning command, a second Wi-Fi scan result corresponding to the Wi-Fi scanning command is determined based on the first Wi-Fi scan result. If the scanning accuracy of the first Wi-Fi scan result does not meet the accuracy requirement corresponding to the scanning accuracy requirement information carried by the Wi-Fi scanning command, the Wi-Fi chip wakes up its radio frequency device, and through the radio frequency device, initiates a Wi-Fi scan on each frequency band included in the first frequency band set to obtain a third Wi-Fi scan result; the third Wi-Fi scan result is then sent to the target processor through the Wi-Fi chip. In addition, the Wi-Fi chip also stores the third Wi-Fi scan result in the scan cache space and marks the scan time of the third Wi-Fi scan result in the scan cache space so that the third Wi-Fi scan result can be reused by other processors or reused by the next Wi-Fi scan instruction.

[0086] In some embodiments, scanning accuracy is represented by the scanning position. Correspondingly, the step of the Wi-Fi chip determining whether the scanning accuracy of the first Wi-Fi scan result meets the accuracy requirement corresponding to the scanning accuracy requirement information carried by the Wi-Fi scan command can be as follows: the Wi-Fi chip determines the distance between the scanning position of the first Wi-Fi scan result and the current location of the terminal; if the distance is less than a preset distance, it determines that the scanning accuracy of the first Wi-Fi scan result meets the accuracy requirement corresponding to the scanning accuracy requirement information carried by the Wi-Fi scan command; if the distance is not less than the preset distance, it determines that the scanning accuracy of the first Wi-Fi scan result does not meet the accuracy requirement corresponding to the scanning accuracy requirement information carried by the Wi-Fi scan command.

[0087] In this embodiment, the first Wi-Fi scan result is verified by scanning accuracy. Only when the accuracy of the first Wi-Fi scan result is high is the second Wi-Fi scan result corresponding to the Wi-Fi scan command determined based on the first Wi-Fi scan result, thereby improving the accuracy of the determined second Wi-Fi scan result.

[0088] Step 204: Send the second Wi-Fi scan result to the target processor via the Wi-Fi chip.

[0089] When the target processor is Sensor Hub, Sensor Hub automatically connects to a Wi-Fi network based on the Wi-Fi networks included in the second Wi-Fi scan results. When the target processor is the main processor, the main processor implements Wi-Fi assistance functions based on the Wi-Fi networks included in the second Wi-Fi scan results. For example, the Wi-Fi assistance function can provide Wi-Fi location services; correspondingly, the main processor determines the current location of the terminal based on the location information of the Wi-Fi networks included in the second Wi-Fi scan results.

[0090] In this embodiment, since the scan cache space stores the Wi-Fi scan results from at least two historical memories of the terminal, when the target processor among at least two processors requests a Wi-Fi scan, the Wi-Fi scan results in the scan cache space can be reused, thereby avoiding the problem of wasted power consumption caused by repeated scanning. Therefore, this embodiment can reduce the power consumption of the terminal and thus improve the energy efficiency of the terminal.

[0091] Please refer to Figure 3, which shows a flowchart of a Wi-Fi network scanning method according to an exemplary embodiment of this application. The method is applied to a terminal equipped with a Wi-Fi chip and at least two processors. In this embodiment, the method is illustrated by storing historical scan results corresponding to at least one second frequency band set in a scan cache space, where the second frequency band set is the set of frequency bands corresponding to the historical Wi-Fi scan command request for scanning channel information. Referring to Figure 3, the method includes:

[0092] Step 301: The Wifi chip receives a Wifi scan command sent by the target processor from at least two processors. The Wifi scan command carries a first frequency band set.

[0093] The first frequency band set is the set of frequency bands corresponding to the Wi-Fi scan command request for scanning channel information; and the first frequency band set includes at least one frequency band, where a frequency band refers to the frequency range for initiating a Wi-Fi scan. A Wi-Fi chip can also initiate a Wi-Fi scan on a certain frequency; therefore, the first frequency band set can also be called the first frequency set, which includes at least one frequency. At least two processors are included, including a main processor and a Sensor Hub, and the target processor is either the Sensor Hub or the main processor. Since the scanning channel of the main processor is wider than that of the Sensor Hub, the Wi-Fi scan results of the main processor are often usable by the Sensor Hub; correspondingly, the target processor is preferably the Sensor Hub. Of course, if the scanning channel of the Sensor Hub is wider than that of the main processor, the main processor can also reuse the Wi-Fi scan results of the Sensor Hub, in which case the target processor can be the main processor.

[0094] Step 302: The Wi-Fi chip queries a target frequency band set from at least one second frequency band set based on the first frequency band set. The target frequency band set is a set of frequency bands that includes the first frequency band set.

[0095] The second frequency band set is the set of frequency bands corresponding to historical Wi-Fi scan command request channel messages. The second frequency band set includes at least one frequency band. The Wi-Fi chip can also initiate Wi-Fi scanning on a certain frequency; therefore, the second frequency band set can also be called the second frequency set, which includes at least one frequency. The Wi-Fi chip judges each second frequency band set sequentially. This process can be as follows: for each traversed second frequency band set, the Wi-Fi chip determines whether the second frequency band set contains the first frequency band set; if the second frequency band set contains the first frequency band set, it determines that the second frequency band set is the target frequency band set; if the second frequency band set does not contain the first frequency band set, it traverses the next second frequency band set until at least one second frequency band set has been traversed. In some embodiments, when there are multiple second frequency band sets, multiple target frequency band sets may appear.

[0096] Step 303: If the target frequency band set is found, the Wi-Fi chip obtains the historical scan results corresponding to the target frequency band set from the terminal's scan cache space to obtain the first Wi-Fi scan result.

[0097] In some embodiments, when there are multiple target frequency band sets, the Wi-Fi chip can obtain historical scan results corresponding to multiple target frequency band sets from the terminal's scan cache space, and combine the historical scan results corresponding to multiple target frequency band sets to form a first Wi-Fi scan result. In other embodiments, when there are multiple target frequency band sets, the Wi-Fi chip can select one target frequency band set from the multiple target frequency band sets, and obtain the historical scan results corresponding to the selected target frequency band set from the terminal's scan cache space to obtain the first Wi-Fi scan result.

[0098] The step of the Wi-Fi chip selecting a target frequency band set from multiple target frequency band sets can be as follows: The Wi-Fi chip determines the scanning time of the historical scan results corresponding to the multiple target frequency band sets; based on the scanning time of the historical scan results corresponding to the multiple target frequency band sets, it selects the target frequency band set with the closest scanning time from the multiple target frequency band sets, thereby obtaining the latest scanned historical scan result. Alternatively, the Wi-Fi chip determines the overlap between the multiple target frequency band sets and a first frequency band set; based on the overlap between the multiple target frequency band sets and the first frequency band set, it selects the target frequency band set with the highest overlap from the multiple target frequency band sets, thereby obtaining the historical scan result that best matches the first frequency band set.

[0099] Step 304: The Wifi chip determines the first Wifi scan result as the second Wifi scan result corresponding to the Wifi scan command.

[0100] In some embodiments, the target processor is a Sensor Hub, and the first Wi-Fi scan result may be a historical scan result of the main processor. Since the scanning channel of the main processor is wider than that of the Sensor Hub, that is, the frequency band corresponding to the scanning channel information of the main processor is wider than that corresponding to the scanning channel information of the Sensor Hub, the first Wi-Fi scan result queried by the Wi-Fi chip is a complete scan result; accordingly, in this step, the Wi-Fi chip directly determines the first Wi-Fi scan result as the second Wi-Fi scan result corresponding to the Wi-Fi scan command.

[0101] In other embodiments, the Wi-Fi scan command carries a validity period; this validity period is used to verify whether the scan result in the scan cache space is valid; and the scan cache space stores the scan time of the first Wi-Fi scan result. Accordingly, the Wi-Fi chip determines the expiration time of the first Wi-Fi scan result based on the scan time and validity period of the first Wi-Fi scan result. If the current time is earlier than the expiration time of the first Wi-Fi scan result, step 304 is executed; if the current time is not earlier than the expiration time of the first Wi-Fi scan result, the Wi-Fi chip wakes up its radio frequency device, and through the radio frequency device, initiates a Wi-Fi scan on each frequency band included in the first frequency band set to obtain a third Wi-Fi scan result; the Wi-Fi chip then sends the third Wi-Fi scan result to the target processor. In addition, the Wi-Fi chip also stores the third Wi-Fi scan result in the scan cache space and marks the scan time of the third Wi-Fi scan result in the scan cache space so that the third Wi-Fi scan result can be reused by other processors or reused by the next Wi-Fi scan command.

[0102] In this embodiment of the application, by setting an effective duration, the Wi-Fi chip can obtain a valid first Wi-Fi scan result, thereby improving the reliability of the obtained first Wi-Fi scan result.

[0103] Step 305: The Wifi chip sends the second Wifi scan result to the target processor.

[0104] In some embodiments, this step is the same as step 204, and will not be described again here.

[0105] Step 306: If no target frequency band set is found, the Wi-Fi chip wakes up the radio frequency devices included in the Wi-Fi chip, and initiates a Wi-Fi scan on each frequency band included in the first frequency band set through the radio frequency devices to obtain the third Wi-Fi scan result.

[0106] If no target frequency band set is found, it means there are no reusable historical scan results in the scan cache space. In this case, the radio frequency device needs to perform a Wi-Fi scan. In some embodiments, the radio frequency device included in the Wi-Fi chip is in a sleep state when Wi-Fi scanning is not required to save power consumption of the terminal. Therefore, in this step, the Wi-Fi chip wakes up the radio frequency device, and then initiates a Wi-Fi scan on each frequency band included in the first frequency band set through the radio frequency device to obtain the third Wi-Fi scan result.

[0107] Step 307: The Wifi chip sends the third Wifi scan result to the target processor.

[0108] For example, referring to Figure 4, when the Sensor Hub initiates a Wi-Fi scan command, the Wi-Fi chip, upon receiving the command, first queries the terminal's scan cache space to determine the first Wi-Fi scan result. Then, it checks if the first Wi-Fi scan result has expired. If it hasn't expired, it determines if the second frequency band set corresponding to the first Wi-Fi scan result includes the first frequency band set. If the second frequency band set includes the first frequency band set, it sends the first Wi-Fi scan result (or the second Wi-Fi scan result, or the cached Wi-Fi scan result) to the target processor. If the second frequency band set does not include the first frequency band set, it performs a Wi-Fi scan based on the Wi-Fi chip. When the main processor initiates a Wi-Fi scan command, the Wi-Fi chip performs a Wi-Fi scan based on the command, obtains the scan result, stores the first frequency band set of the command and the obtained scan result in the scan cache space, and marks the scan time of the result in the cache space. For example, the scan result stored in the scan cache space can be in the following format: <scanTimeStamp,ArrayMap<channel,List<SSID_info> >>; where scanTimeStamp represents the scan time, channel represents the frequency band corresponding to the scan channel message, and List<SSID_info> This indicates the results of historical scans.

[0109] Step 308: The Wifi chip stores the third Wifi scan result in the scan cache space and marks the scan time of the third Wifi scan result in the scan cache space.

[0110] In some embodiments, the Wi-Fi chip also periodically cleans up the scan cache space. This process can be as follows: the Wi-Fi chip determines the time difference between the scanning time of the historical Wi-Fi scan result in the scan cache space and the current time. If the time difference is greater than a preset duration, the historical Wi-Fi scan result is deleted. This not only saves scan cache space but also reduces the time and resource costs of determining the first Wi-Fi scan result from the scan cache space.

[0111] In this embodiment, since the scan cache space stores the Wi-Fi scan results from at least two historical memories of the terminal, when the target processor among at least two processors requests a Wi-Fi scan, the Wi-Fi scan results in the scan cache space can be reused, thereby avoiding the problem of wasted power consumption caused by repeated scanning. Therefore, this embodiment can reduce the power consumption of the terminal and thus improve the energy efficiency of the terminal.

[0112] Please refer to Figure 5, which shows a flowchart of a Wi-Fi network scanning method according to an exemplary embodiment of this application. The method is applied to a terminal equipped with a Wi-Fi chip and at least two processors. In this embodiment, the method is illustrated using the example of storing historical scan results of each historical scan channel in a scan cache space. Referring to Figure 5, the method includes:

[0113] Step 501: The Wifi chip receives a Wifi scan command sent by the target processor from at least two processors. The Wifi scan command carries a first frequency band set.

[0114] The first frequency band set is the set of frequency bands corresponding to the channel information requested by the Wi-Fi scan command; and the first frequency band set includes at least one frequency band, where a frequency band refers to the frequency range in which a Wi-Fi scan is initiated. A Wi-Fi chip can also initiate a Wi-Fi scan on a certain frequency; therefore, the first frequency band set can also be called the first frequency set, which includes at least one frequency. At least two processors are involved, including a main processor and a Sensor Hub. Since the scan cache space independently caches the historical scan results corresponding to the frequency bands of single-channel scan information, the scan results of the main processor and the Sensor Hub can be used interchangeably; correspondingly, the target processor is either the Sensor Hub or the main processor.

[0115] Step 502: The Wi-Fi chip queries the terminal's scan cache space one by one based on each frequency band in the first frequency band set.

[0116] The terminal's scan cache space stores the historical scan results for the frequency band corresponding to each historical scan channel information. Furthermore, the scan cache space stores these results in a one-to-one correspondence between the frequency band corresponding to the scan channel information and the historical scan results. In this step, the Wi-Fi chip queries the terminal's scan cache space one by one based on each frequency band in the first frequency band set to determine whether the historical scan result corresponding to each frequency band is found. For example, the terminal's scan cache space stores a frequency band list, which stores the frequency bands corresponding to the historical scan channel information. The Wi-Fi chip queries the frequency band list one by one based on each frequency band in the first frequency band set to determine whether each frequency band in the first frequency band set exists in the frequency band list. For frequency bands found in the frequency band list, the Wi-Fi chip retrieves the historical scan result corresponding to the found frequency band from the scan cache space and then executes step 503. For frequency bands not found in the frequency band list, these frequency bands are referred to as other frequency bands, and these other frequency bands are scanned separately subsequently.

[0117] Step 503: The Wifi chip will assemble the first Wifi scan result from the historical scan results retrieved from the scan cache space.

[0118] Step 504: If the first Wi-Fi scan result includes the historical scan results of each frequency band in the first frequency band set, the Wi-Fi chip determines the first Wi-Fi scan result as the second Wi-Fi scan result.

[0119] The first Wi-Fi scan result includes the historical scan result of each frequency band in the first frequency band set, indicating that the historical scan result of each frequency band in the first frequency band set has been retrieved from the scan cache space. Therefore, the first Wi-Fi scan result is complete, and the Wi-Fi chip determines the first Wi-Fi scan result as the second Wi-Fi scan result.

[0120] Step 505: If the first Wi-Fi scan result includes historical scan results of some frequency bands in the first frequency band set, the Wi-Fi chip wakes up the radio frequency device of the Wi-Fi chip, and initiates Wi-Fi scan on other frequency bands through the radio frequency device to obtain Wi-Fi scan results of other frequency bands.

[0121] Other frequency bands are those frequency bands in the first frequency band set for which no historical scan results were found. The first Wi-Fi scan result includes historical scan results for some frequency bands in the first frequency band set, indicating that there are other frequency bands in the first frequency band set for which no historical scan results were found from the scan cache space. In this case, the Wi-Fi chip needs to scan these other frequency bands.

[0122] In some embodiments, the radio frequency devices included in the Wifi chip are in a dormant state when Wifi scanning is not required, so as to save the power consumption of the terminal; therefore, in this step, the Wifi chip wakes up the radio frequency devices, and then initiates Wifi scanning on other frequency bands through the radio frequency devices to obtain Wifi scanning results on other frequency bands.

[0123] Step 506: Combine the first Wi-Fi scan result with the Wi-Fi scan results of other frequency bands to form the second Wi-Fi scan result.

[0124] In some embodiments, the Wi-Fi chip may also mark the corresponding scan time in the first Wi-Fi scan result and mark the corresponding scan time in the Wi-Fi scan results of other frequency bands, so that the target processor can perform weighting based on the scan time corresponding to the scan result.

[0125] Step 507: The Wifi chip sends the second Wifi scan result to the target processor.

[0126] In some embodiments, this step is the same as step 204, and will not be repeated here. In some embodiments, the target processor is a Sensor Hub. When the second Wi-Fi scan result includes the first Wi-Fi scan result and Wi-Fi scan results of other frequency bands, and the first Wi-Fi scan result and the Wi-Fi scan results of other frequency bands are all marked with scan times, after receiving the second Wi-Fi scan result, the target processor determines the weight of the first Wi-Fi scan result and the weight of the Wi-Fi scan results of other frequency bands based on the scan times of the first Wi-Fi scan result and the scan times of the Wi-Fi scan results of other frequency bands. Based on the weight of the first Wi-Fi scan result and the weight of the Wi-Fi scan results of other frequency bands, and the first Wi-Fi scan result and the Wi-Fi scan results of other frequency bands, the terminal is located. The further the scan time is from the current time, the smaller its corresponding weight; conversely, the closer the scan time is to the current time, the larger its corresponding weight.

[0127] Step 508: The Wi-Fi chip stores the Wi-Fi scan results of other frequency bands into the scan cache space and marks the scan time of the Wi-Fi scan results of other frequency bands.

[0128] For example, referring to Figure 6, the Sensor Hub or main processor sends a Wi-Fi scan command to the Wi-Fi chip. This Wi-Fi scan command carries the validity period and a first frequency band set. The Wi-Fi chip queries the terminal's scan cache space band by band based on the first frequency band set to find the first Wi-Fi scan result. Then, it determines whether the second frequency band set of the first Wi-Fi scan result contains the first frequency band set. If the second frequency band set of the first Wi-Fi scan result contains the first frequency band set, it determines whether the first Wi-Fi scan result has expired. If the first Wi-Fi scan result has not expired, it sends the first Wi-Fi scan result (also called the second Wi-Fi scan result) to the Sensor Hub or main processor. If the second frequency band set of the first Wi-Fi scan result does not contain the first frequency band set or the first Wi-Fi scan result has expired, it performs a Wi-Fi scan again to obtain a third Wi-Fi scan result. Then, it caches the third Wi-Fi scan result in the scan cache space and marks the scan time of the third Wi-Fi scan result.

[0129] In this embodiment, since the scan cache space stores the Wi-Fi scan results from at least two historical memories of the terminal, when the target processor among at least two processors requests a Wi-Fi scan, the Wi-Fi scan results in the scan cache space can be reused, thereby avoiding the problem of wasted power consumption caused by repeated scanning. Therefore, this embodiment can reduce the power consumption of the terminal and thus improve the energy efficiency of the terminal.

[0130] Please refer to Figure 7, which illustrates a Wi-Fi network scanning device according to an exemplary embodiment of this application. The device is deployed on a terminal, which is configured with a Wi-Fi chip and at least two processors. The device includes:

[0131] The receiving module 701 is used to receive a Wi-Fi scanning command sent by a target processor among at least two processors via a Wi-Fi chip. The Wi-Fi scanning command carries a first frequency band set, which is the set of frequency bands corresponding to the channel information requested by the Wi-Fi scanning command.

[0132] The query module 702 is used to query the terminal's scan cache space based on the Wifi scan command to obtain the first Wifi scan result. The scan cache space is used to store Wifi scan results from at least two processors in the past.

[0133] The determining module 703 is used to determine the second Wifi scan result corresponding to the Wifi scan command based on the first Wifi scan result;

[0134] The transmitting module 704 is used to send the second Wi-Fi scan result to the target processor via the Wi-Fi chip.

[0135] In some embodiments, the query module 702 is used to scan a cache space for storing historical scan results corresponding to at least one second frequency band set, wherein the second frequency band set is the frequency band set corresponding to a historical Wi-Fi scan instruction request scan channel message; based on the first frequency band set, query a target frequency band set from at least one second frequency band set, wherein the target frequency band set is the frequency band set that includes the first frequency band set; if the target frequency band set is found, retrieve the historical scan results corresponding to the target frequency band set from the scan cache space to obtain the first Wi-Fi scan result.

[0136] In some embodiments, the apparatus further includes:

[0137] The first scanning module is used to wake up the radio frequency device of the Wi-Fi chip when no target frequency band set is found; and to initiate a Wi-Fi scan on each frequency band included in the first frequency band set through the radio frequency device to obtain the third Wi-Fi scan result.

[0138] The transmitting module 704 is also used to send the third Wi-Fi scan result to the target processor via the Wi-Fi chip.

[0139] In some embodiments, at least two processors include a main processor and a Sensor Hub, with the target processor being the Sensor Hub.

[0140] In some embodiments, the query module 702 is used to scan the cache space for storing the historical scanning results of the frequency band corresponding to each historical scanning channel information. Then, based on each frequency band in the first frequency band set, the scan cache space is queried one by one; the historical scanning results queried from the scan cache space are used to form the first Wi-Fi scanning result.

[0141] In some embodiments, the query module 702 is configured to: determine the first Wi-Fi scan result as the second Wi-Fi scan result when the first Wi-Fi scan result includes historical scan results for each frequency band in the first frequency band set; wake up the radio frequency device of the Wi-Fi chip when the first Wi-Fi scan result includes historical scan results for some frequency bands in the first frequency band set, and initiate a Wi-Fi scan on other frequency bands through the radio frequency device to obtain Wi-Fi scan results for other frequency bands; and combine the first Wi-Fi scan result with the Wi-Fi scan results of other frequency bands to form the second Wi-Fi scan result, wherein the other frequency bands are frequency bands in the first frequency band set for which no historical scan results were found.

[0142] In some embodiments, the apparatus further includes:

[0143] The first storage module is used to store the Wi-Fi scan results of other frequency bands into the scan cache space and mark the scan time of the Wi-Fi scan results of other frequency bands.

[0144] In some embodiments, at least two processors include a main processor and a Sensor Hub, with the target processor being either the Sensor Hub or the main processor.

[0145] In some embodiments, the determining module 703 is configured to: firstly, determine the expiration time of the first Wi-Fi scan result based on the scan time and validity duration of the first Wi-Fi scan result, provided that the Wi-Fi scan instruction also carries the validity duration of the scan result and the scan cache space stores the scan time of the first Wi-Fi scan result; and secondly, determine the second Wi-Fi scan result corresponding to the Wi-Fi scan instruction based on the first Wi-Fi scan result if the current time is earlier than the expiration time of the first Wi-Fi scan result.

[0146] In some embodiments, the apparatus further includes:

[0147] The second scanning module is used to wake up the radio frequency device of the Wi-Fi chip when the current time is not earlier than the expiration time of the first Wi-Fi scan result, and to initiate a Wi-Fi scan on each frequency band included in the first frequency band set through the radio frequency device to obtain the third Wi-Fi scan result.

[0148] The transmitting module 704 is also used to send the third Wi-Fi scan result to the target processor via the Wi-Fi chip.

[0149] In some embodiments, the apparatus further includes:

[0150] The second storage module is used to store the third Wi-Fi scan result in the scan cache space and mark the scan time of the third Wi-Fi scan result.

[0151] In some embodiments, the apparatus further includes:

[0152] The access module is used to automatically access the Wi-Fi network based on the Wi-Fi networks included in the second Wi-Fi scan results when the target processor is a Sensor Hub.

[0153] An auxiliary module is used to implement Wi-Fi auxiliary functions for the main processor when the target processor is the main processor, based on the Wi-Fi networks included in the second Wi-Fi scan results.

[0154] In this embodiment, since the scan cache space stores the Wi-Fi scan results from at least two historical memories of the terminal, when the target processor among at least two processors requests a Wi-Fi scan, the Wi-Fi scan results in the scan cache space can be reused, thereby avoiding the problem of wasted power consumption caused by repeated scanning. Therefore, this embodiment can reduce the power consumption of the terminal and thus improve the energy efficiency of the terminal.

[0155] It should be noted that the Wi-Fi network scanning device provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal can be divided into different functional modules to complete all or part of the functions described above. In addition, the Wi-Fi network scanning device and the Wi-Fi network scanning method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0156] Please refer to Figure 8, which shows a block diagram of a terminal 800 according to an exemplary embodiment of this application. The terminal 800 in this application may include one or more of the following components: a Wi-Fi chip 810, at least two processors 820, a memory 830, and a display screen 840.

[0157] The Wi-Fi module 810 is used to scan Wi-Fi networks. The processor 820 includes at least two processors, namely a Sensor Hub and a main processor. The processor 820 may include one or more processing cores. The processor 820 connects to various parts within the terminal 800 using various interfaces and lines, and performs various functions and processes data of the terminal 800 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 830, and by calling data stored in the memory 830. Optionally, the processor 820 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 820 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Neural-network Processing Unit (NPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content displayed on the screen 840; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used for wireless communication. It is understood that the modem may not be integrated into the processor 820 and can be implemented separately as a computer program product.

[0158] The memory 830 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 830 may include a non-transitory computer-readable storage medium. The memory 830 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 830 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the various method embodiments described below, etc.; the data storage area may store data created according to the use of the terminal 800 (such as audio data, phone book, etc.).

[0159] Display screen 840 is a display component used to display a user interface. Optionally, display screen 840 is a touch-enabled display screen, through which users can use their fingers, styluses, or any suitable object to perform touch operations on display screen 840.

[0160] The display screen 840 is typically located on the front panel of the terminal 800. The display screen 840 can be designed as a full-screen, curved screen, irregularly shaped screen, dual-sided screen, or foldable screen. The display screen 840 can also be designed as a combination of a full-screen and a curved screen, or a combination of an irregularly shaped screen and a curved screen, etc., but this embodiment does not limit it in this way.

[0161] In addition, those skilled in the art will understand that the structure of the terminal 800 shown in the above figures does not constitute a limitation on the terminal 800. The terminal 800 may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the terminal 800 may also include audio acquisition devices, speakers, radio frequency circuits, input units, sensors, audio circuits, Bluetooth modules, power supplies, etc., which will not be described in detail here.

[0162] This application also provides a computer-readable medium storing at least one piece of program code, which is loaded and executed by a processor to implement the Wi-Fi network scanning method shown in the above embodiments.

[0163] This application also provides a computer program product that stores at least one piece of program code, which is loaded and executed by a processor to implement the Wi-Fi network scanning method shown in the above embodiments.

[0164] In some embodiments, the computer program product involved in the present application can be deployed and executed on a terminal, or executed on multiple terminals located in one location, or executed on multiple terminals distributed in multiple locations and interconnected through a communication network. Multiple terminals distributed in multiple locations and interconnected through a communication network can form a blockchain system.

[0165] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0166] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for scanning a Wi-Fi network, applied to a terminal, the terminal being equipped with a Wi-Fi chip and at least two processors, the method comprising: The Wifi chip receives a Wifi scanning command sent by a target processor from at least two processors. The Wifi scanning command carries a first frequency band set, which is the frequency band set corresponding to the channel information requested by the Wifi scanning command. Based on the Wifi scan command, the terminal's scan cache space is queried to obtain the first Wifi scan result, and the scan cache space is used to store the Wifi scan results historically scanned by the at least two processors; Based on the first Wi-Fi scan result, determine the second Wi-Fi scan result corresponding to the Wi-Fi scan command; The second Wi-Fi scan result is sent to the target processor via the Wi-Fi chip.

2. The method according to claim 1, wherein querying the terminal's scan cache space based on the Wi-Fi scan command to obtain the first Wi-Fi scan result includes: The scan cache space is used to store historical scan results corresponding to at least one second frequency band set, where the second frequency band set is the frequency band set corresponding to the historical Wi-Fi scan instruction request scan channel message; based on the first frequency band set, a target frequency band set is queried from the at least one second frequency band set, where the target frequency band set is the frequency band set that includes the first frequency band set; If the target frequency band set is found, the historical scan results corresponding to the target frequency band set are obtained from the scan cache space to obtain the first Wi-Fi scan result.

3. The method according to claim 2, further comprising: If the target frequency band set is not found, wake up the radio frequency device of the Wi-Fi chip; Using the radio frequency device, a Wi-Fi scan is initiated on each frequency band included in the first frequency band set to obtain a third Wi-Fi scan result; The third Wi-Fi scan result is sent to the target processor via the Wi-Fi chip.

4. The method according to claim 2, wherein the at least two processors include a main processor and a sensor hub, and the target processor is the sensor hub.

5. The method according to claim 1, wherein querying the terminal's scan cache space based on the Wi-Fi scan command to obtain the first Wi-Fi scan result includes: The scanning cache space is used to store the historical scanning results of the frequency band corresponding to each historical scanning channel information. Then, based on each frequency band in the first frequency band set, the scanning cache space is queried one by one. The first Wi-Fi scan result is composed of historical scan results retrieved from the scan cache space.

6. The method according to claim 5, wherein determining the second Wi-Fi scan result corresponding to the Wi-Fi scan command based on the first Wi-Fi scan result includes: If the first Wi-Fi scan result includes the historical scan result of each frequency band in the first frequency band set, the first Wi-Fi scan result is determined as the second Wi-Fi scan result; If the first Wi-Fi scan result includes historical scan results of some frequency bands in the first frequency band set, the radio frequency device of the Wi-Fi chip is woken up, and the Wi-Fi scan is initiated on other frequency bands through the radio frequency device to obtain the Wi-Fi scan results of the other frequency bands; the first Wi-Fi scan result and the Wi-Fi scan results of the other frequency bands are combined to form the second Wi-Fi scan result, wherein the other frequency bands are the frequency bands in the first frequency band set for which no historical scan results were found.

7. The method according to claim 6, further comprising: The Wi-Fi scan results of the other frequency bands are stored in the scan cache space, and the scan time of the Wi-Fi scan results of the other frequency bands is marked.

8. The method of claim 5, wherein the at least two processors include a main processor and a Sensor Hub, and the target processor is the Sensor Hub or the main processor.

9. The method according to claim 1, wherein determining the second Wi-Fi scan result corresponding to the Wi-Fi scan command based on the first Wi-Fi scan result includes: The Wifi scanning command also carries the validity period of the scanning result. The scanning cache space stores the scanning time of the first Wifi scanning result. Based on the scanning time of the first Wifi scanning result and the validity period, the expiration time of the first Wifi scanning result is determined. If the current time is earlier than the expiration time of the first Wifi scan result, a second Wifi scan result corresponding to the Wifi scan command is determined based on the first Wifi scan result.

10. The method according to claim 9, further comprising: If the current time is not earlier than the expiration time of the first Wifi scan result, the radio frequency device of the Wifi chip is woken up, and the Wifi scan is initiated on each frequency band included in the first frequency band set through the radio frequency device to obtain the third Wifi scan result; The third Wi-Fi scan result is sent to the target processor via the Wi-Fi chip.

11. The method according to claim 3 or 10, further comprising: The third Wi-Fi scan result is stored in the scan cache space, and the scan time of the third Wi-Fi scan result is marked.

12. The method according to claim 1, further comprising: When the target processor is Sensor Hub, the system automatically connects to the Wi-Fi network based on the Wi-Fi networks included in the second Wi-Fi scan results. When the target processor is the main processor, the main processor's Wi-Fi auxiliary function is implemented based on the Wi-Fi networks included in the second Wi-Fi scan results.

13. A Wi-Fi network scanning device deployed on a terminal, the terminal being equipped with a Wi-Fi chip and at least two processors, the device comprising: The receiving module is configured to receive a Wi-Fi scanning command sent by a target processor among the at least two processors via the Wi-Fi chip. The Wi-Fi scanning command carries a first frequency band set, which is the frequency band set corresponding to the channel information requested by the Wi-Fi scanning command. The query module is used to query the terminal's scan cache space based on the Wifi scan command to obtain a first Wifi scan result. The scan cache space is used to store the Wifi scan results historically scanned by the at least two processors. The determining module is used to determine the second Wifi scan result corresponding to the Wifi scan command based on the first Wifi scan result; The transmitting module is used to transmit the second Wi-Fi scan result to the target processor via the Wi-Fi chip.

14. The apparatus according to claim 13, wherein the query module is configured to: store historical scan results corresponding to at least one second frequency band set in the scan cache space, wherein the second frequency band set is a frequency band set corresponding to a historical Wi-Fi scan instruction request scan channel message; query a target frequency band set from the at least one second frequency band set based on the first frequency band set, wherein the target frequency band set is a frequency band set containing the first frequency band set; and, if the target frequency band set is found, obtain the historical scan results corresponding to the target frequency band set from the scan cache space to obtain the first Wi-Fi scan result.

15. The apparatus of claim 14, further comprising: The first scanning module is used to wake up the radio frequency device of the Wi-Fi chip if the target frequency band set is not found. Using the radio frequency device, a Wi-Fi scan is initiated on each frequency band included in the first frequency band set to obtain a third Wi-Fi scan result; The sending module is also used to send the third Wi-Fi scan result to the target processor through the Wi-Fi chip.

16. The apparatus according to claim 13, wherein the query module is configured to, when the scan cache space is used to store historical scan results of frequency bands corresponding to each historical scan channel information, query the scan cache space one by one based on each frequency band in the first frequency band set; and assemble the historical scan results queried from the scan cache space into the first Wi-Fi scan result.

17. The apparatus according to claim 16, wherein the query module is configured to: determine the first Wi-Fi scan result as the second Wi-Fi scan result when the first Wi-Fi scan result includes historical scan results for each frequency band in the first frequency band set; wake up the radio frequency device of the Wi-Fi chip when the first Wi-Fi scan result includes historical scan results for some frequency bands in the first frequency band set, and initiate a Wi-Fi scan on other frequency bands through the radio frequency device to obtain Wi-Fi scan results for the other frequency bands; and combine the first Wi-Fi scan result and the Wi-Fi scan results for the other frequency bands to form the second Wi-Fi scan result, wherein the other frequency bands are frequency bands in the first frequency band set for which no historical scan results were found.

18. A terminal comprising a Wifi chip, a memory, and at least two processors, wherein the memory stores at least one piece of program code, the at least one piece of program code being loaded and executed by the Wifi chip and the at least two processors to implement the Wifi network scanning method as described in any one of claims 1 to 12.

19. A computer-readable storage medium storing at least one piece of program code, the at least one piece of program code being loaded and executed by a processor to implement the Wifi network scanning method as described in any one of claims 1 to 12.

20. A computer program product storing at least one piece of program code for execution by a processor to implement the Wifi network scanning method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Channel scanning method and mobile terminal

    CN106792993A

  • Electronic apparatus and communication system

    CN113453309A

  • Channel scanning method and electronic equipment

    CN115243344A

  • Wifi network scanning method and device, equipment, storage medium and product

    CN118870298A

  • Assisted dynamic frequency scan for wi-fi access points

    US20180332583A1