WiFi scanning method and device, electronic equipment, chip and computer readable medium

By dynamically adjusting the WiFi scanning cycle according to the target scenario of the electronic device and the WiFi network status, the efficiency and power consumption problems caused by the fixed WiFi scanning cycle in the prior art are solved, and more efficient WiFi connection management is achieved.

CN118945768APending Publication Date: 2024-11-12GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310539837.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-12
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The scanning cycle of existing WiFi scanning operations is fixed and cannot be adjusted according to the scenario in which the electronic device is located and the stability of the WiFi network environment, resulting in poor efficiency and power consumption.

Method used

The scanning cycle is dynamically adjusted according to the target scenario and WiFi network status of the electronic device. The target scenario is determined by the matching degree of the preset scenario and WiFi access point. The WiFi network status is determined by the change of the WiFi access point continuously scanned. Unstable.

Benefits of technology

It improves the efficiency and battery life of WiFi scanning, reduces the power consumption of electronic devices, ensures that good network connection is maintained in stable scenarios and timely adjusts the scanning frequency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945768A_ABST
    Figure CN118945768A_ABST
Patent Text Reader

Abstract

The invention discloses a WiFi scanning method and device, electronic equipment, a chip and a computer readable medium, and relates to the technical field of communication, the method comprises the following steps: determining a scanning period according to a target scene in which the electronic equipment is located and a WiFi network state, the target scene being determined in advance based on a WiFi access point currently scanned by the electronic equipment, and the WiFi network state being determined in advance based on the WiFi access point currently scanned by the electronic equipment; the WiFi network state is determined in advance based on WiFi access points continuously scanned by the electronic equipment in a current time period, and the WiFi network state comprises a stable state and an unstable state; and executing WiFi scanning operation based on the scanning period. Therefore, the electronic equipment can use a fixed scanning period in any case based on the current scene of the electronic equipment and whether the scanning period is stable by WiFi instead of setting the fixed scanning period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and more specifically, to a WiFi scanning method, device, electronic device, chip and computer-readable medium. Background Art

[0002] With the widespread use of mobile terminals such as mobile phones, people use mobile terminals more and more frequently in their daily lives. Mobile terminals can be used for video, voice, music, film and television playback, and game playing. These activities generally require the mobile terminal to connect to the network, such as connecting to a WiFi (Wireless Fidelity) network. However, the current WiFi scanning operation often has a fixed scanning cycle, which is not set reasonably. Summary of the invention

[0003] The present application proposes a WiFi scanning method, device, electronic device, chip and computer-readable medium to improve the above-mentioned defects.

[0004] In a first aspect, an embodiment of the present application provides a WiFi scanning method, the method comprising: determining a scanning period according to a target scene and a WiFi network status of an electronic device, wherein the target scene is pre-determined based on a WiFi access point scanned by the electronic device, and the WiFi network status is pre-determined based on WiFi access points continuously scanned by the electronic device within a preset time period, and the WiFi network status is used to characterize whether the WiFi network environment of the target scene is stable.

[0005] In a second aspect, an embodiment of the present application further provides a WiFi scanning device, the device comprising: a determination unit and a scanning unit. The determination unit is used to determine a scanning period according to a target scene and a WiFi network state of the electronic device, wherein the target scene is pre-determined based on a WiFi access point scanned by the electronic device, and the WiFi network state is pre-determined based on a WiFi access point continuously scanned by the electronic device within a preset time period, and the WiFi network state is used to characterize whether the WiFi network environment of the target scene is stable. The scanning unit is used to perform a WiFi scanning operation based on the scanning period.

[0006] In a third aspect, an embodiment of the present application also provides an electronic device, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the above method.

[0007] In a fourth aspect, an embodiment of the present application further provides a chip, comprising: a processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes the above method.

[0008] In a fifth aspect, an embodiment of the present application further provides a computer-readable medium, wherein the readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.

[0009] The WiFi scanning method, device, electronic device, chip and computer-readable medium provided by the present application determine the scanning period according to the target scene and WiFi network status of the electronic device, wherein the target scene is determined in advance based on the WiFi access points scanned by the electronic device, the WiFi network status is determined in advance based on the WiFi access points continuously scanned by the electronic device within a preset time period, and the WiFi network status is used to characterize whether the WiFi network environment of the target scene is stable. Then, the WiFi scanning operation is performed based on the scanning period. Therefore, the electronic device can determine the scanning period based on the scene in which the electronic device is currently located and whether the WiFi network environment is stable, instead of setting a fixed scanning period, and use this fixed scanning period in any case.

[0010] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0012] Figure 1 A schematic diagram of a WIFI network access scenario provided in an embodiment of the present application is shown;

[0013] Figure 2 The WiFi network list interface provided by an embodiment of the present application is shown;

[0014] Figure 3 A method flow chart of a WiFi scanning method provided by an embodiment of the present application is shown;

[0015] Figure 4A method flow chart of a WiFi scanning method provided by another embodiment of the present application is shown;

[0016] Figure 5 A method flow chart of a WiFi scanning method provided by another embodiment of the present application is shown;

[0017] Figure 6 A module block diagram of a WiFi scanning device provided in an embodiment of the present application is shown;

[0018] Figure 7 A schematic diagram of the structure of an electronic device proposed in an embodiment of the present application is shown;

[0019] Figure 8 A schematic diagram of the structure of a chip proposed in an embodiment of the present application is shown;

[0020] Fig. 9 A module block diagram of an electronic device according to an embodiment of the present application for executing a method according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0021] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0022] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0023] In wireless communication technology, the process of an electronic device accessing a wireless network includes four steps: scanning, authentication, association, and successful connection. The electronic device may be a smart phone, tablet computer, desktop computer, laptop computer, or PDA.

[0024] Specifically, see Figure 1, shows a schematic diagram of a WIFI network access scenario provided by an embodiment of the present application. Figure 1 As shown, the network coverage of the electronic device 100 includes multiple WiFi access points, such as Figure 1 The first WiFi access point 201, the second WiFi access point 202 and the third WiFi access point 203. The electronic device 100 needs a channel to connect with any WiFi access point, that is, each WiFi access point is located on a channel, and different WiFi access points can be located on different channels or on the same channel.

[0025] When the electronic device 100 enters the coverage area of ​​the network, it starts scanning the WiFi access points within the coverage area of ​​the network. Specifically, the system of the electronic device sends a scan request, and after the WiFi chip or other underlying network module of the electronic device receives the scan command, it scans according to a preset channel scan sequence, such as first scanning commonly used channels 1, 7, and 13, and then scanning other uncommon channels.

[0026] Specifically, Figure 2 The WiFi network list interface shown in the figure has a WiFi control switch, which has the function of turning on or off the WiFi network. For example, the WiFi control switch can control the power on and off of the WiFi module. When the user clicks to turn on WiFi on the mobile phone, the WiFi module is powered on and the WiFi driver is loaded accordingly.

[0027] When the WiFi control switch is turned on, the WiFi access point near the electronic device 100 is searched by scanning (Scanning), and the scanned results are displayed in the WiFi network list interface, wherein the scanning can be performed by active scanning or passive scanning. After the scan is completed, the scanned wireless access hotspot needs to be authenticated (Authentication). For example, authentication can be performed by open system authentication, shared key authentication, or pre-identity authentication. For example, the WiFi access point successfully authenticated by the electronic device 100 is the first WiFi access point. After the authentication is completed, the electronic device 100 is associated with the access point to obtain full access to the network, so that the electronic device 100 can successfully connect to the Internet through the access point.

[0028] Among them, scanning different channels in sequence through the above scanning method can be understood as a WiFi scanning operation of the electronic device. However, the inventors found in their research that the scanning period of the current WiFi scanning operation is often a fixed value, which is not set reasonably.

[0029] See also Figure 3 , Figure 3 A WiFi scanning method provided in an embodiment of the present application is shown. The method can be applied to an electronic device. Specifically, the method includes: S301 and S302.

[0030] S301: Determine a scanning period according to the target scene and WiFi network status of the electronic device.

[0031] It should be noted that the target scene is determined in advance based on the WiFi access points scanned by the electronic device, and the WiFi network state is determined in advance based on the WiFi access points continuously scanned by the electronic device within a preset time period. The WiFi network state is used to characterize whether the WiFi network environment of the target scene is stable, and the WiFi network state includes a stable state and an unstable state. It can be understood that the preset time period includes a target moment for determining the target scene. For example, the electronic device determines the target scene based on the WiFi access points scanned at time T1, and then, with time T1 as the starting point, continuously scans the WiFi access points within a preset time length to determine the WiFi network state.

[0032] As an implementation mode, the electronic device may be provided with a corresponding default scanning cycle, that is, when there is no special requirement for the WiFi scanning cycle of the electronic device, the WiFi scanning operation is usually performed using the default scanning cycle. Therefore, in the embodiment of the present application, determining the scanning cycle according to the target scene and WiFi network status of the electronic device may refer to determining whether to use the default scanning cycle according to the target scene and WiFi network status of the electronic device, and if the default scanning cycle is not used, whether to increase or decrease the default scanning cycle.

[0033] Exemplarily, the scanning period is determined according to whether the target scene of the electronic device is a preset scene and whether the WiFi network state is a stable state or an unstable state. The preset scene may be some pre-set special scenes, and there are special requirements for the WiFi scanning period of the electronic device in these special scenes. As an implementation method, the preset scene may be a place where the user often goes, such as an office or a home.

[0034] As an implementation method, the WiFi access points within a preset scene are obtained as the WiFi access point combination corresponding to the preset scene. That is, several location areas where the user's residence time and / or number of times in a specified time period meet the preset conditions can be defined in advance as preset scenes, wherein the specified time period can be a preset time period for counting preset scenes, which can be set based on actual usage needs. The residence time meeting the preset condition can mean that the residence time is greater than the specified time threshold, and the number of residences meeting the preset condition can mean that the number of residences is greater than the specified number threshold. Thus, the WiFi access points scanned by the electronic device in the location area are corresponded to the location area to complete the establishment of a preset scene. That is to say, each preset scene corresponds to a location area, and the WiFi access points scanned by the electronic device in the location area are used as a WiFi access point combination, and the WiFi access point combination corresponds to the preset scene. Exemplarily, the correspondence between the preset scene and the WiFi access point combination is shown in Table 1:

[0035]

[0036] It can be seen from Table 1 that the preset scenario corresponds to two location areas, namely office and residence, each corresponding to a WiFi access point combination, each WiFi access point combination has at least one WiFi access point, and the at least one WiFi access point is a WiFi access point scanned by the electronic device in the location area.

[0037] It can be understood that the implementation method of determining the target scene in which the electronic device is located based on the WiFi access points scanned by the electronic device is to match the scanned WiFi access points with a preset WiFi access point combination to obtain a matching degree, and the WiFi access point combination includes at least one WiFi access point corresponding to the preset scene; if the matching degree is greater than a specified threshold, it is determined that the target scene in which the electronic device is currently located is the preset scene; if the matching degree is not greater than the specified threshold, it is determined that the target scene in which the electronic device is currently located is not the preset scene.

[0038] Exemplarily, all WiFi access points scanned by the electronic device are determined as the first WiFi access points, and the number of the first WiFi access points can be one or more. Then, the first WiFi access point is matched with at least one WiFi access point combination corresponding to the preset scene, and at least one matching degree is determined. If there is a matching degree greater than a specified threshold in the at least one matching degree, it is determined that the current target scene is the preset scene, that is, the location area where the first WiFi access point is distributed belongs to the often-located location area. If there is no matching degree greater than the specified threshold, that is, the at least one matching degree is not greater than the specified threshold, it is determined that the target scene currently located by the electronic device is not the preset scene, that is, the location area where the first WiFi access point is distributed does not belong to the often-located location area. The specified threshold can be set according to actual use requirements. For example, the specified threshold can be 75%. The matching degree is used to characterize the similarity between all WiFi access points currently scanned and the WiFi access point combination corresponding to the preset preset scene, that is, the ratio of the number of WiFi access points currently scanned that appear in the WiFi access point combination corresponding to the preset scene to the number of WiFi access point combinations that do not appear in the preset scene.

[0039] Exemplarily, the electronic device can associate the preset scene and the wifi devices scanned in the scene based on software and store them in the device. Then, after obtaining the WiFi access points in the preset scene, the WiFi access point combination corresponding to the preset scene is obtained, and then the scanned WiFi access points are matched with the preset WiFi access point combination, and it is determined whether the target scene corresponding to the scanned WiFi access point is the preset scene based on the matching degree.

[0040] It should be noted that, in order to ensure the accuracy of the WiFi access points in the WiFi access point combination corresponding to the preset scene and to update them in time, in the embodiment of the present application, the WiFi access points in the preset scene are obtained as the WiFi access point combination corresponding to the preset scene, that is, after obtaining the WiFi access point combination corresponding to the preset scene, the number of times each WiFi access point in the WiFi access point combination is connected in the first time period is determined as the first number, and the WiFi access points whose first number is less than the first specified number are deleted from the WiFi access point combination, thereby updating the WiFi access point combination, and at least one WiFi access point corresponding to the preset scene is replaced with the updated WiFi access point combination. Taking the above Table 1 as an example, assuming that the number of times the WiFi access point WiFi4 in combination 1: [WiFi1, WiFi2, WiFi3, WiFi4] is connected in the first time period is less than the first specified number, then WiFi4 in combination 1: [WiFi1, WiFi2, WiFi3, WiFi4] is deleted, that is, combination 1 corresponding to the preset scene is [WiFi1, WiFi2, WiFi3]. Among them, the first time period and the first designated number of times can be set according to actual usage requirements. Exemplarily, the first time period can be a preset number of days, for example, three days, and the first designated number of times can be 1, so the WiFi access point with a first number less than the first designated number of times refers to a WiFi access point that has been connected less than 1 time in the first time period, that is, a WiFi access point that has not been connected in the first time period.

[0041] In addition, for the preset scene, the newly scanned WiFi access point should also be added to the WiFi access point combination corresponding to the preset scene in a timely manner. For example, after obtaining the WiFi access point in the preset scene as the WiFi access point combination corresponding to the preset scene, when a new WiFi access point is scanned in the preset scene, the number of times the new WiFi access point is connected in the second time period is determined as the second number; if the second number is greater than the second specified number, the new WiFi access point is added to the WiFi access point combination. Specifically, each time the electronic device enters the preset scene, the WiFi access point scanned by the electronic device is determined, and compared with each WiFi access point in the WiFi access point combination corresponding to the preset preset scene, and the WiFi access point that does not exist in the current WiFi access point combination and is scanned by the electronic device is determined as the WiFi access point newly scanned by the electronic device in the preset scene, and each time the electronic device enters the preset scene, the above method is used to determine whether there is a new WiFi access point.

[0042] After determining the WiFi access point newly scanned by the electronic device in the preset scene, the WiFi access point is recorded as a WiFi access point to be determined, and then the number of times the WiFi access point to be determined is connected in the second time period is counted as the second number. It should be noted that the number of times the WiFi access point is connected mentioned in this application refers to the number of times the WiFi access point is connected by the electronic device of this application. When it is detected that the second number is greater than the second specified number, the new WiFi access point is added to the WiFi access point combination. Among them, the second specified number and the second time period can be set according to actual usage requirements. Exemplarily, the second time period can be a preset number of days, for example, three days, and the second specified number can be 1, so the new WiFi access point with a second number greater than the second specified number means that the new WiFi access point has been connected more than 1 times in the second time period, that is, it has been connected in the second time period. Taking the above Table 1 as an example, assuming that the preset scenario is the location area of ​​the residence, the corresponding WiFi access point combination is combination 2: [WiFi5, WiFi6, WiFi7, WiFi8]. If a new WiFi access point WiFi9 is detected, the number of connections to the WiFi access point WiFi9 is recorded within the second time period. If the number of connections is greater than the second specified number, WiFi9 is added to combination 2, so that the updated combination 2 is [WiFi5, WiFi6, WiFi7, WiFi8, WiFi9].

[0043] Further, if the second number is greater than the second specified number, and all WiFi access points in the WiFi access point combination are continuously scanned in the preset scene within the second time period, the new WiFi access point is added to the WiFi access point combination. That is to say, when a new WiFi access point is detected, and the WiFi access points in the WiFi access point combination corresponding to the preset scene are continuously scanned within the second time period, and the number of times the new WiFi access point is connected within the second time period is greater than the second specified number, the WiFi access point is added to the WiFi access point combination.

[0044] It should be noted that, in the embodiment of the present application, the WiFi access point corresponding to the preset scene is not just the WiFi access point that the electronic device is connecting to in the preset scene, but the WiFi access point scanned by the electronic device in the location area of ​​the preset scene is used as the WiFi access point combination corresponding to the preset scene, so as to perform subsequent matching to verify whether the WiFi access point scanned by the electronic device corresponds to the WiFi access point in the preset scene, so that the determination of the preset scene is more accurate, and, in the embodiment of the present application, the specified threshold value can be a value less than 100%, for example, a value within the range of 70% to 80%, so that it can be determined in advance that the electronic device has entered the preset scene, so that the determination of the preset scene can be advanced. Moreover, compared with the method of determining whether the current scene of the electronic device is the preset scene by detecting the audio features in the current environmental noise, the recognition method is more accurate, and the scene recognition failure will not be caused by the absence of preset audio features, nor will the recognition result be inaccurate due to too many interference factors of the environment to the sound.

[0045] As an implementation method, the implementation method of determining the WiFi network state of the electronic device may be that if the WiFi access points continuously scanned by the electronic device within a preset time period change, the WiFi network state of the electronic device is determined to be unstable; if the WiFi access points continuously scanned by the electronic device within the preset time period do not change, the WiFi network state of the electronic device is determined to be stable. Wherein, the preset time period refers to a time period including the aforementioned target moment, for example, it may be a time period corresponding to a specified time length before the target moment with the target moment as the end point, or it may be a time period corresponding to a specified time length after the target moment with the target moment as the starting point, or it may be a time period corresponding to a specified time length before and after the target moment. Exemplarily, the target scene refers to the scene corresponding to the WiFi access point scanned by the electronic device at the target moment, and the determination of the WiFi network state may be based on the time period corresponding to the specified time length after the target moment, so the WiFi network state is used to characterize whether the WiFi network environment of the target scene is stable. That is, after detecting that the electronic device enters the target scene, starting from the moment when the electronic device enters the target scene, the WiFi access points scanned within the preset time period are continuously detected to see whether they change, so as to obtain whether the WiFi access point is in a stable state or an unstable state, and then obtain the WiFi network state of the electronic device.

[0046] It should be noted that the foregoing content describes an implementation method for determining the target scene and WiFi network status of the electronic device. The specific method for determining the scanning period according to the target scene and WiFi network status of the electronic device will be described in different embodiments in the subsequent content.

[0047] S302: Execute a WiFi scanning operation based on the scanning cycle.

[0048] As mentioned above, the WiFi scanning operation of the electronic device is to scan different channels in sequence, and then the electronic device completes the scanning operation of all channels to be scanned according to the preset channel scanning order, which can be regarded as a complete WiFi scanning operation. The scanning period determined in the embodiment of the present application according to the preset scenario and the WiFi network status can be the time interval between each channel, or it can be the time interval for performing a complete WiFi scanning operation each time. For example, the scanning period is T, and after scanning a channel, the next channel is scanned after an interval of T. Of course, it can also be after completing a complete WiFi scan, that is, after scanning all channels in sequence once, after an interval of T, the next complete WiFi scan is performed.

[0049] Therefore, the embodiment of the present application determines the scanning period according to the target scene and the WiFi network status of the electronic device, wherein the target scene is determined in advance based on the WiFi access points scanned by the electronic device, and the WiFi network status is determined in advance based on the WiFi access points continuously scanned by the electronic device within a preset time period. Then, the WiFi scanning operation is performed based on the scanning period. Therefore, the electronic device can determine the scanning period based on the scene in which the electronic device is currently located and whether the WiFi network environment is stable, rather than setting a fixed scanning period, and use this fixed scanning period in any case.

[0050] See also Figure 4 , Figure 4 A WiFi scanning method provided in an embodiment of the present application is shown, and the method can be applied to an electronic device. In the embodiment of the present application, it is mainly based on the target scene and WiFi network status of the electronic device to determine under what circumstances the scanning cycle can be increased to achieve the purpose of reducing the power consumption of the electronic device. Specifically, the method includes: S401 to S406.

[0051] S401: Determine a target scene where the electronic device is located based on the WiFi access points scanned by the electronic device.

[0052] S402: Determine whether the target scene is a preset scene.

[0053] In the embodiment of the present application, the preset scenario is a location area where the user often appears. Specifically, the location area where the electronic device is located when the electronic device scans a WiFi access point and is connected to the WiFi access point is determined, and the residence time of the electronic device in the location area is determined, wherein the location area can be the location of the electronic device collected by the positioning device of the electronic device when the electronic device is connected to the WiFi access point, and then a preset range centered on the location is used as the location area, and the preset range can be a range with a radius of N kilometers, and N can be a certain value from 0.1 to 0.5. If the residence time is greater than the specified time, the location area is defined as a location area to be determined, and the number of residences of the electronic device in the preset location area within the preset reference time period and the WiFi access points scanned each time in the location area to be determined are determined. If the number of residences is greater than the specified number threshold, the location area to be determined is determined to be a location area where the user often appears, and the location area to be determined is set as a preset scenario, and the WiFi access points cumulatively scanned by the electronic device in the location area to be determined are used as the WiFi access point combination corresponding to the preset scenario.

[0054] It can be seen that the determined preset scene is often the location area where the user stays for a long time. Therefore, when the electronic device is located in the preset scene, that is, the target scene is the preset scene, it is necessary to ensure that the electronic device can connect to the WiFi network without being easily disconnected and even that the network signal of the WiFi network is not too bad. Therefore, when the target scene currently located by the electronic device is the preset scene, it is necessary to carefully consider whether to increase the scanning cycle. When the electronic device is not in the preset scene, it can be considered that the electronic device currently has a low demand for the WiFi network, and the scanning cycle can be increased. Therefore, when the current target scene of the electronic device is not the preset scene, the power consumption of the electronic device can be reduced.

[0055] S403: Determine the WiFi network status of the electronic device based on the WiFi access points continuously scanned by the electronic device within a preset time period.

[0056] If the target scene is a preset scene, it is necessary to further determine whether to increase the WiFi scanning period according to the WiFi network status of the electronic device. Exemplarily, if the target scene is a preset scene, S403 is executed, that is, the WiFi network status of the electronic device is determined based on the WiFi access points continuously scanned by the electronic device within a preset time period.

[0057] It should be noted that the implementation methods of determining whether the target scene is a preset scene and determining the WiFi network status in the embodiments of the present application can refer to the aforementioned embodiments and will not be repeated here.

[0058] S404: Determine whether the WiFi network status is stable.

[0059] S405: Determine that the scanning period is a first period, and the first period is less than or equal to an initial period.

[0060] If the WiFi network state is stable, that is, the WiFi access points continuously scanned by the electronic device change within the time length corresponding to the preset time period after the electronic device enters the preset scene, it can be determined that the WiFi network state in the current scene is unstable. In order to ensure that the electronic device has a good WiFi network signal in the scene, S405 is executed, that is, the scanning period is determined to be the first period, and the first period is less than or equal to the initial period, that is, the first period is used as the scanning period of the electronic device in this situation, and the electronic device does not increase the scanning period on the basis of the initial period, but uses the initial period or a period lower than the initial period. The initial period is the aforementioned default scanning period.

[0061] As an implementation method, in order to avoid excessive power consumption of electronic devices, when the target scene of the electronic device is a preset scene and the WiFi network state is stable, the initial cycle can be used. That is to say, when the electronic device determines that there is no need to increase the scanning cycle, the initial cycle, that is, the default scanning cycle, is uniformly used, thereby not only meeting the needs of WiFi scanning, but also avoiding excessive power consumption due to too low a scanning cycle.

[0062] S406: Determine that the scanning period is a second period, where the second period is a period increased based on the initial period.

[0063] If the target scene is not a preset scene, or the target scene is a preset scene but the WiFi network state is a stable state, S406 can be executed, that is, the scanning period is determined to be the second period, and the second period is the period increased on the basis of the initial period. As an implementation method, the second period can be a fixed value, and the fixed value can be a specified value increased on the basis of the initial period. For example, if the initial period is 5s, the specified value is 5s, and the second period is 10s. As another implementation method, the second period can be a variable value, that is, an increasing value on the basis of the initial period. For example, the variation function of the second period is: T2 = T1 + M*A, where A is a constant, for example, it can be 5s, M is the number of scans, that is, the number of scans this time, the initial value is 1, and on the basis of the initial value, each additional scan increases by 1, T1 is the initial period, the unit is s, and T2 is the second period, the unit is also s. Exemplarily, after determining to scan in the second cycle, the scanning cycle of the first scan is T1+A, the second scanning cycle is T1+2A, and the third scanning cycle is T1+3A. For example, assuming T1 is 5s and A is 5s, then T2 is 10s, 15s, 20s, 25s, and 30s respectively.

[0064] It should be noted that when the change of T2 reaches an upper limit value, it will no longer increase. That is to say, the implementation method of determining the scanning period as the second period can be to determine the scanning period based on the change function as the period to be determined, determine whether the period to be determined is less than the upper limit value, if less than the upper limit value, use the period to be determined as the second period, update the number of scans, and return to perform the aforementioned operation of determining the scanning period based on the change function, if greater than or equal to the upper limit value, use the upper limit value as the second period, and keep the subsequent scanning operation in the current target scene with the upper limit value as the second period, if it is detected that the electronic device does not meet the conditions for using the second period, that is, the target scene is the preset scene and the WiFi network state is unstable, then restore the number of scans to the initial value.

[0065] Below, taking the preset scene of office as an example, the WiFi access point combination corresponding to the scene in the office is combination 1: [WiFi1, WiFi2, WiFi3, WiFi4]. The matching degree of the WiFi access point scanned by the electronic device at the current moment and the combination 1 is greater than the specified threshold, thereby determining that the electronic device is currently located in the office. Then, detect whether the scanned WiFi access point within the preset time period has changed. If there is no change, it is determined that the current WiFi network state of the electronic device is a stable state, then increase the initial cycle to obtain the second cycle, and perform WiFi scanning with the second cycle. If the scanned WiFi access point within the preset time period has changed, it is determined that the current WiFi network state of the electronic device is an unstable state, then do not increase the initial cycle, that is, perform WiFi scanning with the initial cycle. If the result obtained when determining whether the target scene is a preset scene is not a preset scene, then directly perform WiFi scanning with the second cycle.

[0066] It is understandable that after executing S405 or S406, the process returns to executing S401, that is, after completing a complete WiFi scan, S401 is executed again, that is, the current target scene is determined again and subsequent operations are performed.

[0067] It should be noted that, when the electronic device uses the first cycle to perform the WiFi scanning operation, that is, the target scene is the preset scene and the WiFi network state is in an unstable state, it is determined whether the preset condition is met. If the preset condition is met, it is determined that the electronic device does not meet the condition for using the first cycle, that is, it meets the condition for using the second cycle, then S406 is executed, and then the WiFi scanning operation is performed using the second cycle. Wherein, the preset condition is a pre-set condition that the electronic device is in a power saving priority. For example, the preset condition includes but is not limited to: the screen-off time of the electronic device in the screen-off state this time is greater than the first specified time, the static time of the electronic device in the static state this time is greater than the second specified time, and the remaining power of the electronic device is lower than at least one of the specified power threshold. Wherein, the first specified time, the second specified time and the specified power threshold can all be set based on actual use needs. For example, the first specified time is 30 to 60 minutes, the second specified time is 60 minutes, and the specified power threshold is 30% of the maximum power.

[0068] Therefore, the embodiments of the present application take special care of the preset scenarios, that is, when the electronic device is not in the preset scenario, the scanning period of the WiFi scanning operation is directly increased. In the preset scenario, whether to increase the scanning period is further determined based on the stability of the WiFi. Specifically, in the preset scenario, if the WiFi is stable, the scanning period is increased; if the WiFi is unstable, the scanning period is not increased.

[0069] See also Figure 5 , Figure 5 A WiFi scanning method provided in an embodiment of the present application is shown, and the method can be applied to an electronic device. In the embodiment of the present application, it is mainly based on the WiFi network status of the electronic device and the target scene to determine under what circumstances the scanning cycle can be increased to achieve the purpose of reducing the power consumption of the electronic device. Specifically, the method includes: S501 to S506.

[0070] S501: Determine the WiFi network status of the electronic device based on the WiFi access points continuously scanned by the electronic device within a preset time period.

[0071] S502: Determine whether the WiFi network status is stable.

[0072] In the embodiment of the present application, the stability of the WiFi network state in which the electronic device is currently located can be given priority consideration, and whether to increase the scanning period is determined based on the stability. Specifically, if the WiFi network state is stable, the scanning period can be increased. This is because, in a stable network environment, it means that the WiFi access point currently scanned by the electronic device has not changed, and the electronic device does not need to scan too frequently. Therefore, in this case, S506 is executed.

[0073] S503: Determine the target scene where the electronic device is located based on the WiFi access points scanned by the electronic device.

[0074] If the current WiFi network state of the electronic device is not stable, it means that the WiFi access point in the current WiFi network is in a changing state, and it is necessary to further determine whether it is necessary to increase the scanning period based on whether the current target scene of the electronic device is a preset scene. Therefore, if the determination result of S502 is no, S503 is executed to obtain the target scene of the electronic device.

[0075] S504: Determine whether the target scene is a preset scene.

[0076] If the current WiFi network state of the electronic device is not a stable state, then when the target scene currently located in the electronic device is a preset scene, considering that the user has a high demand for the WiFi network in the preset scene, the WiFi scanning period will not be increased, so S505 is executed. If the current WiFi network state of the electronic device is not a stable state and the electronic device is not currently in the preset scene, the scanning period is increased. That is to say, when the network is unstable and the current scene is not a preset scene, although increasing the scanning period will reduce the speed of scanning WiFi access points, it will not seriously affect the user's use, because in this case the user may be in a moving state, for example, moving in a non-preset scene, and the user is likely to not have a high demand for the use of the WiFi network, so the WiFi scanning period can be increased to reduce power consumption.

[0077] S505: Determine that the scanning period is a first period, and the first period is less than or equal to an initial period.

[0078] S506: Determine that the scanning period is a second period, where the second period is a period increased based on the initial period.

[0079] It should be noted that the parts of the above steps that are not described in detail can refer to the aforementioned embodiments, and as mentioned in the aforementioned embodiments, when the electronic device uses the first cycle to perform a WiFi scanning operation, if a preset situation exists, it is determined that the electronic device does not meet the conditions for using the first cycle, that is, it meets the conditions for using the second cycle, and thus uses the second cycle as the scanning cycle to perform the WiFi scanning operation. This is also applicable to the embodiments of the present application. Specifically, when the WiFi network state is stable and the target scene is a preset scene, it can be detected whether the electronic device has a preset situation. If so, the WiFi scanning operation is performed using the second cycle as the scanning cycle. The specific implementation method can refer to the aforementioned embodiment and will not be repeated here.

[0080] Exemplarily, taking the preset scene as an office, the WiFi access point combination corresponding to the scene in the office is combination 1: [WiFi1, WiFi2, WiFi3, WiFi4]. If the electronic device determines that the WiFi network state within the preset time period is a stable state, the initial cycle is increased to obtain a second cycle, and the WiFi scan is performed with the second cycle. If the electronic device determines that the WiFi network state within the preset time period is an unstable state and is in the scene of the office, the initial cycle is not increased, that is, the WiFi scan is performed with the initial cycle. If the electronic device determines that the WiFi network state within the preset time period is an unstable state and is not in the scene of the office, the initial cycle is increased to obtain a second cycle, and the WiFi scan is performed with the second cycle.

[0081] It is understandable that after executing S505 or S506, the process returns to executing S501, that is, after completing a complete WiFi scan, S501 is executed again, that is, the current target scene is determined again and subsequent operations are performed.

[0082] Therefore, the embodiment of the present application takes special care of WiFi stability, that is, when the WiFi network state of the electronic device is stable, the scanning period of the WiFi scanning operation is directly increased. When the WiFi network state of the electronic device is unstable, the scanning period is not increased in the case of a preset scenario, and the scanning period is increased if it is not in the preset scenario.

[0083] See also Figure 6 , which shows a structural block diagram of a WiFi scanning device 600 provided in an embodiment of the present application. The device may include: a determining unit 601 and a scanning unit 602.

[0084] The determination unit 601 is used to determine the scanning period according to the target scene and the WiFi network state of the electronic device, wherein the target scene is pre-determined based on the WiFi access points scanned by the electronic device, the WiFi network state is pre-determined based on the WiFi access points continuously scanned by the electronic device within a preset time period, and the WiFi network state includes a stable state and an unstable state.

[0085] The scanning unit 602 is configured to perform a WiFi scanning operation based on the scanning cycle.

[0086] Furthermore, the determination unit 601 is also used to determine the target scene in which the electronic device is located based on the WiFi access points scanned by the electronic device; if the target scene is a preset scene, the WiFi network state of the electronic device is determined based on the WiFi access points continuously scanned by the electronic device within a preset time period; if the WiFi network state is an unstable state, the scanning period is determined to be a first period, and the first period is less than or equal to the initial period.

[0087] Furthermore, the determining unit 601 is further configured to determine that the scanning period is a second period if the WiFi network state is a stable state, and the second period is a period increased based on the initial period.

[0088] Furthermore, the determining unit 601 is further configured to determine that the scanning period is a second period if the target scene is not a preset scene, and the second period is a period increased on the basis of the initial period.

[0089] Furthermore, the determination unit 601 is also used to determine the WiFi network state of the electronic device based on the WiFi access points continuously scanned by the electronic device within a preset time period; if the WiFi network state is an unstable state, determine the target scene of the electronic device based on the WiFi access points scanned by the electronic device; if the target scene is a preset scene, determine the scanning period to be a first period, and the first period is less than or equal to the initial period.

[0090] Furthermore, the determining unit 601 is further configured to determine that the scanning cycle is a second cycle if the target scene is not a preset scene, and the second cycle is a cycle increased on the basis of the initial cycle.

[0091] Furthermore, the determining unit 601 is further configured to determine that the scanning period is a second period if the WiFi network state is a stable state, and the second period is a period increased based on the initial period.

[0092] Furthermore, the determination unit 601 is also used to match the scanned WiFi access point with a preset WiFi access point combination to obtain a matching degree, wherein the WiFi access point combination includes at least one WiFi access point corresponding to a preset scene; if the matching degree is greater than a specified threshold, it is determined that the target scene currently located by the electronic device is the preset scene; if the matching degree is not greater than the specified threshold, it is determined that the target scene currently located by the electronic device is not the preset scene.

[0093] Furthermore, the determining unit 601 is further configured to obtain WiFi access points in a preset scene as the WiFi access point combination corresponding to the preset scene before matching the scanned WiFi access points with the preset WiFi access point combination.

[0094] Further, the determining unit 601 is further configured to determine the number of times each WiFi access point in the WiFi access point combination is connected within a first time period as a first number; and delete a WiFi access point whose first number is less than a first specified number from the WiFi access point combination.

[0095] Furthermore, the determination unit 601 is also used to determine the number of times the new WiFi access point is connected within a second time period as a second number when a new WiFi access point is scanned within the preset scenario; if the second number is greater than a second specified number, the new WiFi access point is added to the WiFi access point combination.

[0096] Further, the determining unit 601 is further configured to add the new WiFi access point to the WiFi access point combination if the second number is greater than a second specified number and all WiFi access points in the WiFi access point combination are continuously scanned in a preset scenario within the second time period.

[0097] Furthermore, the determination unit 601 is also used to determine that the WiFi network state of the electronic device is unstable if the WiFi access points continuously scanned by the electronic device within a preset time period change; if the WiFi access points continuously scanned by the electronic device within the preset time period do not change, determine that the WiFi network state of the electronic device is stable.

[0098] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0099] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0100] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0101] Please refer to Figure 7 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

[0102] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.

[0103] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 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 implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.

[0104] Please refer to Figure 8 , which shows a structural block diagram of a chip provided in an embodiment of the present application. A chip is also provided in an embodiment of the present application, which may be an integrated circuit chip with signal processing capabilities, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0105] Optionally, the chip can be applied to various communication devices (such as the electronic devices mentioned above), so that the communication device equipped with the chip can execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0106] Figure 8 It is a schematic structural diagram of a chip according to an embodiment of the present application.

[0107] Figure 8 The chip 800 shown includes a processor 810, which can call and run a computer program from a memory to implement the method in the embodiment of the present application.

[0108] Alternatively, if Figure 8 As shown, the chip 800 may further include a memory 820. The processor 810 may call and run a computer program from the memory 820 to implement the method in the embodiment of the present application. The memory 820 may be used to store indication information, and may also be used to store codes, instructions, etc. executed by the processor 810.

[0109] The memory 820 may be a separate device independent of the processor 810, or may be integrated into the processor 810. The processor 810 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The memory 820 may be a volatile memory and / or a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM), etc.

[0110] It should be noted that the memory 820 may be integrated into the chip 800 , or may be an external memory independent of the chip 800 .

[0111] Optionally, the chip 800 may further include an input interface 830. The processor 810 may control the input interface 830 to communicate with other devices or chips, and specifically, may obtain information or data sent by other devices or chips.

[0112] Optionally, the chip 800 may further include an output interface 840. The processor 810 may control the output interface 840 to communicate with other devices or chips, and specifically, may output information or data to other devices or chips.

[0113] Optionally, the chip can be applied to the network device in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the network device in each method of the embodiments of the present application. For the sake of brevity, they will not be repeated here.

[0114] Optionally, the chip can be applied to the terminal device in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the terminal device in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.

[0115] It should be understood that the chip mentioned in the embodiment of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc. It should also be understood that the various components in the chip 800 are connected through a bus system, wherein the bus system includes a power bus, a control bus and a status signal bus in addition to a data bus.

[0116] Please refer to Fig. 9 , which shows a structural block diagram of a computer-readable medium provided in an embodiment of the present application. The computer-readable medium 900 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0117] The computer readable medium 900 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable medium 900 includes a non-transitory computer-readable storage medium. The computer readable medium 900 has storage space for program code 910 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 910 can be compressed, for example, in an appropriate form.

[0118] In summary, the scanning period is determined according to the target scene and WiFi network status of the electronic device, wherein the target scene is determined in advance based on the WiFi access point currently scanned by the electronic device, the WiFi network status is determined in advance based on the WiFi access point continuously scanned by the electronic device in the current time period, and the WiFi network status includes a stable state and an unstable state. Then, the WiFi scanning operation is performed based on the scanning period. Therefore, the electronic device can scan the period based on the scene currently in which the electronic device is located and whether the WiFi is stable, instead of setting a fixed scanning period, and use this fixed scanning period in any case. The preset scene recognition based on the software reduces the power consumption of the hardware module.

[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. 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 spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A WiFi scanning method, characterized in that: include: Determine the scanning period according to the target scene and the WiFi network state of the electronic device, wherein the target scene is determined in advance based on the WiFi access points scanned by the electronic device, the WiFi network state is determined in advance based on the WiFi access points continuously scanned by the electronic device within a preset time period, and the WiFi network state is used to characterize whether the WiFi network environment of the target scene is stable; A WiFi scanning operation is performed based on the scanning period.

2. The method according to claim 1, characterized in that The determining the scanning frequency according to the target scenario and the WiFi network status includes: Determining a target scene where the electronic device is located based on the WiFi access points scanned by the electronic device; If the target scene is a preset scene, determining the WiFi network status of the electronic device based on the WiFi access points continuously scanned by the electronic device within a preset time period; If the WiFi network state is an unstable state, the scanning period is determined to be a first period, and the first period is less than or equal to an initial period.

3. The method according to claim 2, characterized in that Also includes: If the WiFi network state is a stable state, the scanning period is determined to be a second period, and the second period is a period increased based on the initial period.

4. The method according to claim 2, characterized in that: Also includes: If the target scene is not a preset scene, the scanning period is determined to be a second period, where the second period is a period increased based on the initial period.

5. The method according to claim 1, characterized in that The determining the scanning frequency according to the target scenario and the WiFi network status includes: Determining a WiFi network status of the electronic device based on WiFi access points continuously scanned by the electronic device within a preset time period; If the WiFi network state is an unstable state, determining the target scene where the electronic device is located based on the WiFi access points scanned by the electronic device; If the target scene is a preset scene, the scanning period is determined to be a first period, and the first period is less than or equal to an initial period.

6. The method according to claim 5, characterized in that Also includes: If the target scene is not a preset scene, the scanning period is determined to be a second period, where the second period is a period increased based on the initial period.

7. The method according to claim 5, characterized in that Also includes: If the WiFi network state is a stable state, the scanning period is determined to be a second period, and the second period is a period increased based on the initial period.

8. The method according to claim 2 or 5, characterized in that: The determining the target scene where the electronic device is located based on the WiFi access points scanned by the electronic device includes: Matching the scanned WiFi access point with a preset WiFi access point combination to obtain a matching degree, wherein the WiFi access point combination includes at least one WiFi access point corresponding to a preset scenario; If the matching degree is greater than a specified threshold, determining that the target scene where the electronic device is located is a preset scene; If the matching degree is not greater than a specified threshold, it is determined that the target scene where the electronic device is located is not a preset scene.

9. The method according to claim 8, characterized in that Before matching the scanned WiFi access point with the preset WiFi access point combination, the method further includes: The WiFi access points in a preset scene are obtained as the WiFi access point combination corresponding to the preset scene.

10. The method according to claim 9, characterized in that After obtaining the WiFi access points in the preset scene as the WiFi access point combination corresponding to the preset scene, the method further includes: Determine the number of times each WiFi access point in the WiFi access point combination is connected within the first time period as a first number; The WiFi access points whose first number is less than the first specified number are deleted from the WiFi access point combination.

11. The method according to claim 9, characterized in that After obtaining the WiFi access points in the preset scene as the WiFi access point combination corresponding to the preset scene, the method further includes: When a new WiFi access point is scanned in the preset scenario, determining the number of times the new WiFi access point is connected within a second time period as a second number; If the second number is greater than a second specified number, the new WiFi access point is added to the WiFi access point combination.

12. The method according to claim 11, characterized in that If the second number is greater than the second specified number, adding the new WiFi access point to the WiFi access point combination includes: If the second number is greater than the second specified number, and all WiFi access points in the WiFi access point combination are continuously scanned in a preset scenario within the second time period, the new WiFi access point is added to the WiFi access point combination.

13. The method according to claim 2 or 5, characterized in that: The determining the WiFi network status of the electronic device based on the WiFi access points continuously scanned by the electronic device within a preset time period includes: If the WiFi access points continuously scanned by the electronic device within a preset time period change, determining that the WiFi network state of the electronic device is unstable; If the WiFi access points continuously scanned by the electronic device within a preset time period do not change, it is determined that the WiFi network state of the electronic device is a stable state.

14. A WiFi scanning device, characterized in that: include: A determination unit, configured to determine a scanning period according to a target scene and a WiFi network state of the electronic device, wherein the target scene is determined in advance based on WiFi access points scanned by the electronic device, the WiFi network state is determined in advance based on WiFi access points continuously scanned by the electronic device within a preset time period, and the WiFi network state is used to characterize whether the WiFi network environment of the target scene is stable; The scanning unit is used to perform a WiFi scanning operation based on the scanning cycle.

15. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-13.

16. A chip, characterized in that: include: A processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes a method as described in any one of claims 1 to 13.

17. A computer readable medium, characterized in that The computer-readable medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method according to any one of claims 1 to 13.