Control method of WiFi chip and electronic equipment

By controlling the power off the WiFi chip when it is abnormal, it can achieve self-healing, and solve the scanning abnormality caused by WiFi chip abnormality, improving the user's WiFi connection stability and Internet access experience.

CN120201474APending Publication Date: 2025-06-24HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311735273.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

When surfing the Internet through WiFi, users often encounter scan abnormalities of unknown reasons, resulting in abnormal WiFi chips, which cannot guarantee the daily use needs of users to connect to the network, causing inconvenience to users.

Method used

By controlling the WiFi chip to power off when the WiFi chip is abnormal, the WiFi chip can be self-healed, so that electronic devices can access the network normally through WiFi to meet users' Internet access needs.

Benefits of technology

It realizes that in the abnormal situation of WiFi chip, it can heal itself by powering off, thereby ensuring the stability of the user's WiFi connection and improving the user's Internet experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120201474A_ABST
    Figure CN120201474A_ABST
Patent Text Reader

Abstract

The invention discloses a control method of a WiFi chip and electronic equipment, relates to the technical field of terminals, and aims at scanning abnormity caused by abnormity of the WiFi chip, the WiFi chip is controlled to be powered off to be self-healed, and therefore the daily use requirement of a user for network connection is met. The method can be applied to electronic equipment comprising a WiFi chip, and the specific scheme can be as follows: acquiring a flag bit of the WiFi chip, the flag bit being used for indicating whether the WiFi chip needs to be powered off; and controlling the WiFi chip to be powered off in response to the fact that the flag bit is used for indicating that the WiFi chip needs to be powered off.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminals, and in particular, to a control method for a Wireless Fidelity (WiFi) chip and an electronic device Background Art

[0002] In order to provide network convenience for users, current mobile phones can use WiFi to access the Internet. However, when accessing the Internet through WiFi, users often encounter scanning anomalies for unknown reasons, such as scanning anomalies caused by abnormal WiFi chips, which cannot guarantee the daily use requirements of users to connect to the network and bring inconvenience to users Summary of the Invention

[0003] Based on this, this application provides a control method for a WiFi chip and an electronic device. In the case of a scanning anomaly caused by an abnormal WiFi chip, the power of the WiFi chip is timely controlled to be powered off, so as to achieve self-healing of the WiFi chip, so that the electronic device can normally access the network through WiFi, meet the Internet access needs of users, and improve the user experience

[0004] To achieve the above object, the embodiments of this application adopt the following technical solutions

[0005] In a first aspect, this application provides a control method for a WiFi chip, which is applied to an electronic device including a WiFi chip. In this method, the electronic device obtains a flag bit of the WiFi chip, and this flag bit can be used to indicate whether the WiFi chip needs to be powered off; in response to the flag bit indicating that the WiFi chip needs to be powered off, the electronic device controls the WiFi chip to be powered off

[0006] Among them, the above flag bit is used to indicate that the WiFi chip needs to be powered off in the case of an abnormal WiFi chip. By controlling the WiFi chip to be powered off when the obtained flag bit indicates that the WiFi chip needs to be powered off, when a scanning anomaly caused by an abnormal WiFi chip occurs, the WiFi chip can be controlled to be powered off, so that it can self-heal within a certain period of time, so that the electronic device can normally access the network through WiFi, meet the Internet access needs of users, and increase the user's Internet access experience

[0007] In a feasible implementation manner of the first aspect, before controlling the WiFi chip to be powered off, the electronic device can listen for a screen-off broadcast. When a screen-off broadcast is detected, it means that the electronic device is in a screen-off state. In the screen-off state, the WiFi chip is controlled to be powered off, so as not to affect the user experience

[0008] In an implementable manner of the first aspect, when the information of the WiFi chip is used to indicate that the WiFi chip is abnormal, the electronic device may set the flag bit to a first value, such as true, to indicate that the WiFi chip needs to be powered off. The information of the WiFi chip may include: the WiFi scan result of the WiFi chip, the status information of the WiFi switch of the WiFi chip, and the scan result list of the WiFi chip. The electronic device, such as the processor of the electronic device, can determine whether to perform a power-off process on the WiFi chip by periodically or when a predetermined condition is met to check whether the flag bit of the WiFi chip is the first value. This operation is simple and time-saving, and further ensures the user's Internet experience.

[0009] In an implementable manner of the first aspect, when the first condition is met, the information of the WiFi chip can be used to indicate that the WiFi chip is abnormal, or to indicate that the current scenario is a scenario where the WiFi chip is abnormal. The first condition may include: the WiFi scan result is used to indicate that the WiFi chip scan is successful, the status information of the WiFi switch is used to indicate that the WiFi switch is in the on state, and the scan result list is empty. That is to say, the electronic device, such as the processor of the electronic device, can determine that the first condition is met, and thus determine that the WiFi chip is abnormal or determine that the current scenario is a scenario where the WiFi chip is abnormal, after obtaining the information of the WiFi chip, that is, obtaining the WiFi scan result of the WiFi chip, the status information of the WiFi switch of the WiFi chip, and the scan result list of the WiFi chip, and when the WiFi scan result is used to indicate that the WiFi chip scan is successful, the status information of the WiFi switch is used to indicate that the WiFi switch is in the on state, and the scan result list is empty. In this way, the scanning abnormal scenario caused by the WiFi chip abnormality, where the scan result of the WiFi chip is successful but the reported scan result list is empty, is identified, improving the ability of the WiFi chip in the electronic device to automatically recover during use.

[0010] In an implementable manner of the first aspect, when the number of times the first condition is met is greater than the first threshold, the information of the WiFi chip can be used to indicate that the WiFi chip is abnormal, or to indicate that the current scenario is a scenario where the WiFi chip is abnormal. By determining that the WiFi chip is abnormal when the above first condition is met multiple times, the accuracy of identifying the abnormal scenario of the WiFi chip is improved.

[0011] In an implementable manner of the first aspect, the above first condition may further include the location information of the current location of the electronic device, which is used to indicate that the electronic device is in a preset location set. In this way, by adding, in the condition for identifying the abnormal scenario of the WiFi chip, the judgment that the location information of the current location of the electronic device is used to indicate that the electronic device is in the preset location set, the situation of misidentifying the scenario where the user takes the electronic device to a place where the WiFi network is not deployed as an abnormal scenario of the WiFi chip can be avoided, and the accuracy of identifying the abnormal scenario of the WiFi chip is further improved.

[0012] In an implementable manner of the first aspect, the flag bit may be set to a first value based on the WiFi scan result of the WiFi chip. That is to say, when the WiFi scan result of the WiFi chip is used to indicate that the WiFi chip is abnormal, the flag bit is set to the first value to indicate that the WiFi chip needs to be powered off.

[0013] In an implementable manner of the first aspect, when the WiFi scan result is that the WiFi chip fails to scan and the reason for the scan failure is a preset reason, the WiFi scan result is used to indicate that the WiFi chip is abnormal, or it is used to indicate that the current scenario is an abnormal scenario of the WiFi chip. In this way, the scan abnormal scenario where the WiFi chip fails to scan due to a preset reason is identified, the ability of the WiFi chip in the electronic device to automatically recover during use is improved, and the user experience is improved.

[0014] In an implementable manner of the first aspect, when the number of times that the WiFi chip fails to scan and the reason for the scan failure is a preset reason is greater than a second threshold, it can be determined that the WiFi chip is abnormal. In this way, by determining that the WiFi chip is abnormal after multiple judgments that the WiFi chip fails to scan and the reason for the scan failure is a preset reason, the accuracy of identifying the abnormal scenario of the WiFi chip is improved.

[0015] In an implementable manner of the first aspect, after controlling the WiFi chip to be powered off, the flag bit may be set to a second value, such as setting the second value to false, which is used to indicate that the WiFi chip does not need to be powered off.

[0016] In a second aspect, the present application provides a control method for a WiFi chip, which is applied to an electronic device including a WiFi chip. In this method, the information of the WiFi chip is obtained; the information of the WiFi chip includes the change information of the WiFi switch of the WiFi chip, the status information of the WiFi switch, the cached WiFi chip scan result list, and the time stamp of the cached WiFi chip scan result list; in response to the information of the WiFi chip being used to indicate that the WiFi chip is abnormal, the WiFi chip is controlled to be powered off.

[0017] In the above method, when the obtained WiFi chip information indicates that the WiFi chip is abnormal, the power of the WiFi chip is controlled to be turned off. When a scanning abnormality caused by the abnormal WiFi chip occurs, by controlling the power of the WiFi chip to be turned off, it can self-heal within a certain period of time, so that the electronic device can normally access the network through WiFi, meet the user's Internet access needs, and improve the user's Internet experience.

[0018] In the above method, when the user perceives that the WiFi chip is abnormal and manually operates the WiFi switch, the power of the WiFi chip can be controlled to be turned off, enabling it to successfully self-heal, further ensuring the user experience.

[0019] In one implementable manner of the first aspect, it is possible to determine whether the WiFi chip is abnormal, or rather, determine whether the current scenario is a WiFi chip abnormal scenario, based on the change information of the WiFi switch of the WiFi chip, the status information of the WiFi switch, the cached WiFi chip scanning result list, and the time stamp of the cached WiFi chip scanning result list. For example, when the status of the WiFi switch changes, the status information of the WiFi switch indicates that the WiFi switch is in the off state, the scanning result list is not empty, and the time stamp is greater than a preset threshold, the electronic device, such as the processor of the electronic device, can determine that the WiFi chip information indicates that the WiFi chip is abnormal. Based on this, it is possible to accurately identify the WiFi chip abnormal scenario, further ensuring the user experience.

[0020] In a third aspect, the present application provides a control device for a WiFi chip, and this device has the function of implementing the behavior of the electronic device in the method of the first aspect described above. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, for example, an acquisition unit or module, a control unit or module, a monitoring unit or module.

[0021] In a fourth aspect, an electronic device is provided, and this electronic device includes: a memory, a WiFi chip, and one or more processors; the memory, the WiFi chip are coupled to the processor;

[0022] Among them, the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device is caused to execute the control method of the WiFi chip in the first aspect, the second aspect, and any of their implementable manners described above.

[0023] In a fifth aspect, a computer-readable storage medium is provided. The computer-readable storage medium includes a computer program, which, when running on an electronic device, enables the electronic device to execute the control method of the WiFi chip as described in the first aspect, the second aspect, and any implementation thereof.

[0024] In a sixth aspect, a computer program product containing instructions is provided. When it runs on an electronic device, it enables the electronic device to execute the control method of the WiFi chip as described in the first aspect, the second aspect, and any implementation thereof.

[0025] In a seventh aspect, an embodiment of the present application provides a chip system. The chip system includes a processor, and the processor is used to call a computer program in a memory to execute the control method of the WiFi chip as described in the first aspect, the second aspect, and any implementation thereof.

[0026] It can be understood that for the beneficial effects that can be achieved by the device described in the third aspect, the electronic device described in the fourth aspect, the computer-readable storage medium described in the fifth aspect, the computer program product described in the sixth aspect, and the chip system described in the seventh aspect, reference can be made to the beneficial effects in the first aspect, the second aspect, and any possible implementation thereof, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of an electronic device accessing the Internet through a WiFi chip in the related art;

[0028] Figure 2 A schematic structural diagram of a terminal device provided by an embodiment of the present application;

[0029] Figure 3 A schematic flowchart of a control method for a WiFi chip provided by an embodiment of the present application;

[0030] Figure 4 A schematic flowchart of an abnormal scenario method for a WiFi chip provided by an embodiment of the present application Figure 1 ;

[0031] Figure 5 A schematic flowchart of an abnormal scenario method for a WiFi chip provided by an embodiment of the present application Figure 2 ;

[0032] Figure 6 A schematic flowchart of an abnormal scenario method for a WiFi chip provided by an embodiment of the present application Figure 3 ;

[0033] Figure 7 A schematic flowchart of another abnormal scenario method for a WiFi chip provided by an embodiment of the present application Figure 1 ;

[0034] Figure 8 This is a schematic flowchart of another method for abnormal scenarios of a WiFi chip provided by an embodiment of the present application. Figure 2 ;

[0035] Figure 9 This is a schematic flowchart of another control method for a WiFi chip provided by an embodiment of the present application;

[0036] Figure 10 This is a schematic flowchart of yet another method for abnormal scenarios of a WiFi chip provided by an embodiment of the present application;

[0037] Figure 11 This is a schematic structural diagram of a chip system provided by an embodiment of the present application. Detailed implementation manners

[0038] In the description of the present application, unless otherwise specified, "and / or" in the present application is merely an association relationship describing associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. Here, A and B may be singular or plural.

[0039] In the description of the present application, unless otherwise specified, "a plurality of" means two or more than two. "At least one (item)" or a similar expression thereof refers to any combination of these items, including any combination of a single item (item) or plural items (items). For example, at least one (item) of a, b, or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c may be single or multiple.

[0040] For the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit to be different.

[0041] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" aims to present relevant concepts in a specific manner for easy understanding.

[0042] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.

[0043] In addition to accessing the Internet through traffic, the current electronic device can also use WiFi to provide Internet access for users. Exemplarily, as Figure 1 shown, the electronic device is demonstrated as a mobile phone. During the process of accessing the Internet using the WiFi function, the user needs to turn on the WiFi function on the mobile phone. For example, the user can enter the WiFi function settings interface through the interface of the settings application, such as Figure 1 the interface 11 shown in (a) of Figure 1 to enter the WiFi function settings interface, such as the interface 12 shown in (b) of Figure 1 . After that, the user can operate the WiFi switch in interface 12 for controlling the opening / closing of the mobile phone's WiFi function to trigger the mobile phone to turn on / off the WiFi function of the mobile phone. After the mobile phone receives the operation to turn on the WiFi function, the mobile phone can perform periodic scanning to scan for available WiFi networks around. After scanning for available WiFi networks, the mobile phone can display the identifiers of the available WiFi networks scanned by the mobile phone in the available WiFi list in interface 12 shown in (b) of Figure 1 , such as the names of the WiFi networks, such as XXX1, XXX2, etc. After that, the user can select the WiFi network that the mobile phone needs to connect to in the available WiFi list, such as selecting the identifier of the WiFi network that the mobile phone needs to connect to. After receiving the operation of the user selecting the identifier of a certain WiFi network in the available WiFi list, the mobile phone can connect to the WiFi network selected by the user for the user to access the Internet.

[0044] Specifically, the mobile phone's periodic scanning can be: the WiFi chip of the mobile phone periodically scans the available WiFi channels, such as periodically scanning the available WiFi channels in the 5G band, so as to determine the available WiFi networks, and display the information of the scanned available WiFi networks to the user through the available WiFi list for the user to select.

[0045] However, the user may encounter scanning anomalies for unknown reasons. For example, in the case of abnormal WiFi chips, scanning anomalies will occur. Among them, in the case of scanning anomalies, the user cannot use WiFi to access the Internet. For example, in the case of abnormal WiFi chips, as Figure 1 shown in (c) of

[0046] interface 13, the available WiFi list displayed on the mobile phone does not include the information of any WiFi networks, which causes the user to be unable to select the WiFi network that the mobile phone needs to connect to, resulting in the inability to use WiFi to access the Internet.

[0047] To solve the above problems, an embodiment of the present application provides a control method for a WiFi chip. When it is determined that the current scenario is a scenario where the WiFi chip is abnormal, that is, in a scenario where scanning is abnormal due to the abnormality of the WiFi chip, the WiFi chip is powered off. By accurately identifying the scenario where the WiFi chip is abnormal and triggering the power-off of the WiFi chip to self-heal, the electronic device can normally access the network through WiFi, meet the user's Internet access needs, and improve the user experience.

[0048] The solution provided by the embodiment of the present application can be applied to an electronic device. Exemplarily, the electronic device can be a device including a WiFi chip such as a mobile phone, a tablet computer, a smart watch, a desktop type, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, etc. The embodiment of the present application does not impose special restrictions on the specific form of the electronic device.

[0049] In addition, it should be noted that the control method for the WiFi chip provided by the embodiment of the present application can be applied to a scenario where scanning is abnormal due to the abnormality of the WiFi chip of the electronic device. Among them, the scenario where scanning is abnormal due to the abnormality of the WiFi chip can be that the WiFi chip scans successfully, but the available WiFi list does not include the information of the successfully scanned WiFi network; it can also be that the WiFi chip fails to scan, for example, the WiFi chip receives a scanning instruction but does not perform scanning, resulting in a scanning failure; or it can be that the WiFi function is abnormal, and the electronic device monitors the scenario where the user manually operates the WiFi switch in the settings interface, etc.

[0050] Exemplarily, taking the mobile phone 200 as an example of the above electronic device, Figure 2 shows a schematic structural diagram of the mobile phone 200. As Figure 2 shown, the mobile phone 200 may include a processor 210, an external memory interface 220, an internal memory 221, a mobile communication module 230, a wireless communication module 240, a charging management module 250, a power management module 260, a battery 270, an antenna 1, an antenna 2, an audio module 280, a sensor module 290, a button 291, a motor 292, an indicator 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.

[0051] It can be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the mobile phone 200. In some other embodiments of the present application, the mobile phone 200 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0052] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0053] The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0054] A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store the instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system. In some embodiments, the processor 210 may include one or more interfaces. In the embodiments of the present application, the processor 210 may be used to control the power-down of the WiFi chip in the case of determining that the current scenario is a scanning anomaly scenario caused by an abnormal WiFi chip, so that the WiFi chip can self-heal.

[0055] The charging management module 250 is used to receive a charging input from a charger. Among them, the charger may be a wireless charger or a wired charger. While charging the battery 270, the charging management module 250 can also supply power to the mobile phone 200 through the power management module 260.

[0056] The power management module 260 is used to connect to the battery 270. The power management module 260 receives inputs from the battery 270 and / or the charging management module 250 to supply power to the processor 210, the internal memory 221, the display screen 294, the wireless communication module 240 (such as a WiFi chip), etc. The power management module 260 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 260 can also be disposed in the processor 210. In some other embodiments, the power management module 260 and the charging management module 250 can also be disposed in the same device.

[0057] The wireless communication function of the mobile phone 200 can be implemented by the antenna 1, the antenna 2, the mobile communication module 230, the wireless communication module 240, the modulation and demodulation processor, and the baseband processor, etc.

[0058] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: The antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0059] The mobile communication module 230 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the mobile phone 200. The mobile communication module 230 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 230 can receive electromagnetic waves from the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.

[0060] The wireless communication module 240 can provide solutions for wireless communications applied to the mobile phone 200, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. In some embodiments of the present application, when the wireless communication module 240 provides the WLAN solution for the mobile phone 200, the wireless communication module 240 can include the WiFi chip in the present application.

[0061] In some embodiments, antenna 1 of mobile phone 200 is coupled to mobile communication module 230, and antenna 2 is coupled to wireless communication module 240, such that mobile phone 200 can communicate with the network and other devices through wireless communication technologies.

[0062] Mobile phone 200 implements the display function through the GPU, display screen 294, application processor, etc. The GPU is a microprocessor for image processing, connected to display screen 294 and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.

[0063] Display screen 294 is used to display images, videos, etc. Display screen 294 includes a display panel. For example, display screen 294 may be a touch screen. In some embodiments of the present application, after the user opens the settings application, display screen 294 can be used for the settings interface of the WiFi function. The settings interface may include a WiFi switch for turning on / off the WiFi function. The settings interface can also be used to display information of scanned WiFi networks, such as the identification of the WiFi network, for the user to select the WiFi network to be connected.

[0064] External memory interface 220 can be used to connect an external memory card, such as a MicroSD card, to expand the storage capacity of mobile phone 200.

[0065] Internal memory 221 can be used to store computer-executable program code, and the executable program code includes instructions. Internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, image playback function, etc.). The data storage area can store data created during the use of mobile phone 200 (such as audio data, phone book, etc.). In addition, internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 210 executes various functions and data processing of mobile phone 200 by running the instructions stored in internal memory 221, and / or the instructions stored in the memory provided in processor 210.

[0066] The audio module 280 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 280 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 280 can be disposed in the processor 210, or some functional modules of the audio module 280 can be disposed in the processor 210.

[0067] The sensor module 290 may include a pressure sensor 290A, a fingerprint sensor 290B, a temperature sensor 290C, a touch sensor 290D, etc.

[0068] Among them, the pressure sensor 290A is used to sense a pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 290A can be disposed on the display screen 294. There are many types of pressure sensors 290A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can include at least two parallel plates having a conductive material. When a force acts on the pressure sensor 290A, the capacitance between the electrodes changes. The mobile phone 200 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 294, the mobile phone 200 detects the intensity of the touch operation according to the pressure sensor 290A. The mobile phone 200 can also calculate the position of the touch according to the detection signal of the pressure sensor 290A.

[0069] The fingerprint sensor 290B is used to collect fingerprints. The mobile phone 200 can use the collected fingerprint characteristics to implement fingerprint unlocking, access to application locks, fingerprint photography, fingerprint answering of incoming calls, etc.

[0070] The temperature sensor 290C is used to detect temperature. In some embodiments, the mobile phone 200 uses the temperature detected by the temperature sensor 290C to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 290C exceeds a threshold, the mobile phone 200 reduces the performance of the processor located near the temperature sensor 290C in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the mobile phone 200 heats the battery 270 to prevent the mobile phone 200 from shutting down abnormally due to low temperature. In still other embodiments, when the temperature is lower than yet another threshold, the mobile phone 200 boosts the output voltage of the battery 270 to prevent abnormal shutdown due to low temperature.

[0071] The touch sensor 290D, also known as the "touch control device". The touch sensor 290D can be disposed on the display screen 294. The touch sensor 290D and the display screen 294 form a touch screen, also known as the "touch control screen". The touch sensor 290D is used to detect touch operations acting thereon or in its vicinity. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 294. In some other embodiments, the touch sensor 290D can also be disposed on the surface of the mobile phone 200, at a different position from that of the display screen 294.

[0072] The keys 291 include a power-on key, volume keys, etc. The keys 291 can be mechanical keys. They can also be touch keys. The mobile phone 200 can receive key inputs and generate key signal inputs related to the user settings and function control of the mobile phone 200.

[0073] The motor 292 can generate vibration prompts. The motor 292 can be used for incoming call vibration prompts and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. For touch operations acting on different regions of the display screen 294, the motor 292 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0074] The indicator 293 can be an indicator light and can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0075] The SIM card interface 295 is used to connect the SIM card. The SIM card can be inserted into or removed from the SIM card interface 295 to achieve contact and separation with the mobile phone 200.

[0076] The following is combined with Figure 3 to introduce the specific process of the electronic device realizing the self-healing of the WiFi chip. As Figure 3 shown, Figure 3 This is a schematic flow diagram of a control method for a WiFi chip provided by an embodiment of the present application. The method can include: S301 - S302.

[0077] S301. Obtain the flag bit of the WiFi chip. The flag bit is used to indicate whether the WiFi chip needs to be powered off.

[0078] In order to ensure the normal operation of the WiFi chip, in some embodiments of the present application, an electronic device, such as the processor of the electronic device, can periodically monitor the WiFi chip, that is, execute S301, to determine whether the WiFi chip has an abnormality, so as to ensure the Internet access experience of the user when using the WiFi.

[0079] In some other embodiments, an electronic device, such as the processor of the electronic device, can monitor the WiFi chip when it is determined that a predetermined condition is met, that is, execute S301, to determine whether the WiFi chip has an abnormality. For example, the predetermined condition may include whether a screen-off broadcast is monitored. An electronic device, such as the processor of the electronic device, can monitor the WiFi chip when a screen-off broadcast is monitored to determine whether the WiFi chip has an abnormality. Among them, an electronic device, such as the processor of the electronic device, can periodically monitor whether there is a screen-off broadcast. Among them, when the electronic device needs to turn off the screen (hereinafter simply referred to as screen-off), the processor can send a screen-off broadcast. The screen-off of the electronic device can be triggered by the user or automatically triggered by the electronic device. For example, when the electronic device does not receive an operation from the user after a predetermined duration, the electronic device will automatically turn off the screen.

[0080] Among them, it can be determined whether the WiFi chip is abnormal according to the flag bit of the WiFi chip. In this embodiment, the flag bit of the WiFi chip can be a flag used to indicate whether the WiFi chip needs to be powered off. This flag bit can also be called a power-off flag bit, a power-off self-healing flag bit, or a screen-off power-off self-healing flag bit, etc. This flag bit can be set in the WiFi chip or not set in the WiFi chip, such as set in other devices of the electronic device, such as the processor.

[0081] Exemplarily, when the flag bit of the obtained WiFi chip is used to indicate that the WiFi chip does not need to be powered off, it indicates that the WiFi chip has no abnormality, that is, the WiFi chip can normally scan, and the user can normally use the WiFi to access the Internet. At this time, S301 can be executed again. When the flag bit of the obtained WiFi chip is used to indicate that the WiFi chip needs to be powered off, it indicates that the WiFi chip has an abnormality. For example, the WiFi chip may not be able to scan normally, and the user cannot normally use the WiFi to access the Internet, then the following S302 can be executed.

[0082] S302. In response to the flag bit indicating that the WiFi chip needs to be powered off, control the WiFi chip to be powered off.

[0083] When it is determined that the flag bit is used to indicate that the WiFi chip needs to be powered off, an electronic device, such as the processor of the electronic device, can control the power-off of the WiFi chip. The so-called power-off means to disconnect the WiFi chip from the power supply, such as stopping the power supply to the WiFi chip. For example, when the processor of the electronic device determines that the flag bit of the WiFi chip is used to indicate that the WiFi chip needs to be powered off, it can send a power-off control instruction to the power management module of the electronic device, and this power-off control instruction is used to indicate to stop powering the WiFi chip. After receiving the power-off control instruction, the power management module of the electronic device stops powering the WiFi chip.

[0084] As described in S301, S301 can be executed periodically. When S301 is executed periodically, in some embodiments, when the processor of the electronic device, such as the electronic device, determines that the WiFi chip needs to be powered off based on the obtained flag bit of the WiFi chip, it can control the power-off of the WiFi chip. In some other embodiments, after the processor of the electronic device, such as the electronic device, determines that the WiFi chip needs to be powered off based on the obtained flag bit of the WiFi chip, the processor of the electronic device, such as the electronic device, can listen for whether there is a screen-off broadcast, and when a screen-off broadcast is detected, then control the power-off of the WiFi chip. S301 can also be executed when a predetermined condition is met, such as when a screen-off broadcast is detected. When S301 is executed only when a screen-off broadcast is detected, the processor of the electronic device, such as the electronic device, can execute S301 after detecting the screen-off broadcast, and when it is determined that the WiFi chip needs to be powered off based on the obtained flag bit of the WiFi chip, it can control the power-off of the WiFi chip.

[0085] It should be noted that the above embodiments are introduced by taking the example of first listening for whether there is a screen-off broadcast and then monitoring the WiFi chip, or first monitoring the WiFi chip and then listening for whether there is a screen-off broadcast. In some other embodiments, the processor of the electronic device, such as the electronic device, can also monitor the WiFi chip and whether there is a screen-off broadcast simultaneously, and when a screen-off broadcast is detected and the flag bit of the WiFi chip is used to indicate that the WiFi chip needs to be powered off, control the power-off of the WiFi chip. The embodiments of the present application do not specifically limit the execution sequence of listening for the screen-off broadcast and monitoring the WiFi chip.

[0086] Adopting the technical solution of the present application, when the flag bit of the WiFi chip is used to indicate that the WiFi chip needs to be powered off, it indicates that the WiFi chip may be abnormal. At this time, the WiFi chip can be controlled to be powered off to restore the function of the WiFi chip, so that the current scenario will no longer cause scanning abnormalities due to the abnormal WiFi chip, thereby enabling the user to normally use the WiFi function of the electronic device to access the Internet and enhancing the user experience. In addition, when the electronic device is turned off the screen, the WiFi chip can be controlled to be powered off, thus not affecting the user experience.

[0087] In actual use, there may be many scenarios that can indicate the abnormality of the WiFi chip. Two embodiments are shown below.

[0088] In the first embodiment, the scenario that can indicate the abnormality of the WiFi chip is: the scanning result of the WiFi chip is a successful scan, but the reported scanning result list is empty, such as the number of available WiFi networks in the scanning result list reported to the upper-layer application is 0. In other words, after the user turns on the WiFi switch in the settings interface, the WiFi chip can normally perform a scan and successfully scans a WiFi network, but the identifier of the scanned WiFi network is not displayed in the available WiFi list shown in the settings interface, resulting in the user being unable to select the WiFi network that the electronic device needs to access and thus unable to use WiFi to access the Internet. This abnormal scenario of the WiFi chip is usually imperceptible to the user.

[0089] In the second embodiment, the scenario that can indicate the abnormality of the WiFi chip is: after the WiFi chip performs a scan, the scanning result is a scan failure, and the reason for the scan failure is a preset reason. In this scenario, the user is also unable to use WiFi to access the Internet. And this abnormal scenario of the WiFi chip is usually also imperceptible to the user.

[0090] The above two scenarios indicating the abnormality of the WiFi chip can often make the WiFi chip self-heal by controlling the WiFi chip to be powered off. Then in these two scenarios, the flag bit of the WiFi chip can be set to indicate that the WiFi chip needs to be powered off to control the WiFi chip to be powered off in order to restore the function of the WiFi chip and ensure that the user can normally use WiFi to access the Internet. The following will introduce these two embodiments in detail.

[0091] Embodiment 1

[0092] In a scenario where the scan result of the WiFi chip is a successful scan, but the reported scan result list is empty, an electronic device, such as the processor of the electronic device, can set the flag bit of the WiFi chip based on the information of the WiFi chip. For example, when the information of the WiFi chip is used to indicate that the WiFi chip is abnormal, the flag bit of the WiFi chip is set to a first value to indicate that the WiFi chip needs to be powered off. The specific process can be as follows:

[0093] In some embodiments of the present application, an electronic device, such as the processor of the electronic device, can determine whether the WiFi chip is abnormal by determining whether the first condition is met based on the information of the WiFi chip, or determine whether the current scenario is a WiFi chip abnormal scenario. The information of the WiFi chip can include the WiFi scan result of the WiFi chip, the status information of the WiFi switch of the WiFi chip, and the scan result list of the WiFi chip.

[0094] Among them, the scan result of the WiFi chip can include a successful scan and a failed scan. For example, if an electronic device, such as the processor of the electronic device, monitors a WiFi scan broadcast, it can determine that the scan result is a successful scan. If the electronic device, such as the processor of the electronic device, does not monitor a WiFi scan broadcast, it can determine that the scan result is a failed scan. The WiFi switch can be a control for the user to turn on / off the WiFi function, and this control can be included in the settings application of the electronic device, or in the control center of the electronic device, and can also be included in other applications for the user to turn on / off the WiFi function of the electronic device. The status information of the WiFi switch can include an on state and an off state. The scan result list can be a list for presenting the information of the scanned available WiFi networks to the user. Currently, the way of presenting the information of the scanned available WiFi networks to the user can also be other forms instead of a list form, and this embodiment does not make specific limitations here.

[0095] In some examples, the first condition may include that the WiFi scan result is used to indicate successful scanning of the WiFi chip, the status information of the WiFi switch is used to indicate that the WiFi switch is in the on state, and the scan result list is empty. That is, an electronic device, such as the processor of the electronic device, can obtain the information of the WiFi chip, that is, obtain the WiFi scan result of the WiFi chip, the status information of the WiFi switch of the WiFi chip, and the scan result list of the WiFi chip. When the WiFi scan result is used to indicate successful scanning of the WiFi chip, the status information of the WiFi switch is used to indicate that the WiFi switch is in the on state, and the scan result list is empty, the electronic device, such as the processor of the electronic device, can determine that the information of the WiFi chip meets the first condition, that is, determine that the information of the WiFi chip indicates that the WiFi chip is abnormal, or determine that the current scenario is a WiFi chip abnormal scenario. At this time, the electronic device, such as the processor of the electronic device, can set the flag bit of the WiFi chip to the first value, which is used to indicate that the WiFi chip needs to be powered off.

[0096] It should be noted that there is no sequential execution order for the judgments on whether the above-mentioned WiFi scan result is used to indicate successful scanning of the WiFi chip, whether the status information of the WiFi switch is used to indicate that the WiFi switch is in the on state, and whether the scan result list is empty. As an example, as Figure 4 shown, based on the first condition, the specific process of determining whether the current scenario is a WiFi chip abnormal scenario is as follows:

[0097] An electronic device, such as the processor of the electronic device, can first obtain the WiFi scan result of the WiFi chip. For example, the processor of the electronic device can listen for broadcasts of WiFi scan results (such as, android.net.wifi.SCAN_RESULTS). In the case of not listening to the broadcast of the WiFi scan result, the operation of listening for the broadcast of the WiFi scan result can be re-executed. In the case of listening to the broadcast of the WiFi scan result, the electronic device, such as the processor of the electronic device, can obtain the status information of the WiFi switch to further determine whether the WiFi switch is in the on state. In the case of determining that the WiFi switch is in the off state, the operation of listening for the broadcast of the WiFi scan result can be re-executed. In the case of determining that the WiFi switch is in the on state, continue to determine whether the scan result list of the WiFi chip is empty. In the case of determining that the scan result list is not empty, the operation of listening for the broadcast of the WiFi scan result can be re-executed. In the case of determining that the scan result list is empty, it indicates that the current scenario is a WiFi chip abnormal scenario, and the electronic device, such as the processor of the electronic device, can set the flag bit of the WiFi chip to the first value, which is used to indicate that the WiFi chip needs to be powered off.

[0098] In another example, the first condition may further include location information of the current location of the electronic device to indicate that the electronic device is in a preset location set. That is to say, in addition to the WiFi scan results of the WiFi chip, the status information of the WiFi switch of the WiFi chip, and the scan result list of the WiFi chip mentioned above, the electronic device, such as the processor of the electronic device, also needs to determine whether the WiFi chip is abnormal based on the location information of the current location of the electronic device. That is, based on these four parameters, it is determined whether the current scenario is a WiFi chip abnormal scenario, so as to determine whether to control the power-off of the WiFi chip for self-healing. That is to say, in addition to being able to obtain the WiFi scan results of the WiFi chip, the status information of the WiFi switch of the WiFi chip, and the scan result list of the WiFi chip, the electronic device, such as the processor of the electronic device, can also obtain the location information of the current location of the electronic device. When the WiFi scan result is used to indicate that the WiFi chip scan is successful, the status information of the WiFi switch is used to indicate that the WiFi switch is in the on state, the scan result list is empty, and the location information of the current location of the electronic device is used to indicate that the electronic device is in a preset location set, the electronic device, such as the processor of the electronic device, can determine that the information of the WiFi chip meets the first condition, that is, it can be determined that the WiFi chip is abnormal, or it can be determined that the current scenario is a WiFi chip abnormal scenario. At this time, the electronic device, such as the processor of the electronic device, can set the flag bit of the WiFi chip to the first value to indicate that the WiFi chip needs to be powered off.

[0099] Among them, the location information of the current location of the electronic device is used as a judgment condition to avoid the situation that when the user takes the electronic device to some unfamiliar environments that are not often visited. For example, there may be no WiFi network deployed in these unfamiliar environments (such as mountainous areas). If this judgment is not made, it may be misjudged that the current scenario is a WiFi chip abnormal scenario.

[0100] Similarly, there is no specific execution order for the judgment of whether the above WiFi scan result is used to indicate that the WiFi chip scan is successful, whether the status information of the WiFi switch is used to indicate that the WiFi switch is in the on state, whether the scan result list is empty, and whether the location information of the current location is used to indicate that the electronic device is in a preset location set. As an example, combined with Figure 4 , such as Figure 5 shown, based on the first condition, the specific process of determining whether the current scenario is a WiFi chip abnormal scenario is as follows:

[0101] An electronic device, such as the processor of the electronic device, can first obtain the WiFi scan results of the WiFi chip. For example, the processor of the electronic device can listen for broadcasts of WiFi scan results (e.g., android.net.wifi.SCAN_RESULTS). In the case where no broadcast of WiFi scan results is listened to, the operation of listening for broadcasts of WiFi scan results can be re-executed. In the case where a broadcast of WiFi scan results is listened to, the electronic device, such as the processor of the electronic device, can obtain the status information of the WiFi switch to further determine whether the WiFi switch is in the on state. In the case where it is determined that the WiFi switch is in the off state, the operation of listening for broadcasts of WiFi scan results can be re-executed. In the case where it is determined that the WiFi switch is in the on state, continue to determine whether the scan result list of the WiFi chip is empty. In the case where it is determined that the scan result list is not empty, the operation of listening for broadcasts of WiFi scan results can be re-executed. In the case where it is determined that the scan result list is empty, continue to determine whether the current location of the electronic device is in a preset location set. For example, the identifier of the cell to which the current electronic device is connected (abbreviated as the current cell identifier, current cell id) can be obtained, and it can be determined whether the current cell id is included in the set of common cell ids, which is pre-configured in the electronic device. In the case where the current location of the electronic device is not in the preset location set, the operation of listening for broadcasts of WiFi scan results can be re-executed. In the case where the current location of the electronic device is in the preset location set, the electronic device, such as the processor of the electronic device, can set the flag bit of the WiFi chip to a first value to indicate that the WiFi chip needs to be powered off.

[0102] In some other embodiments of the present application, an electronic device, such as the processor of the electronic device, can determine multiple times whether the first condition is satisfied based on the information of the WiFi chip, that is, determine whether the number of times the first condition is satisfied is greater than a first threshold, so as to determine whether the current scenario is a WiFi chip abnormal scenario. In the case where the number of times the first condition is satisfied is greater than the first threshold, it can be considered that the information of the WiFi chip is used to indicate that the WiFi chip is abnormal, or it can be determined that the current scenario is a WiFi chip abnormal scenario. Based on this, the flag bit of the WiFi chip can be set to a first value. Among them, the specific description of the information of the WiFi chip and the first condition can refer to the corresponding content description of the above embodiments, and will not be repeated here. Here, taking the first condition including: the WiFi scan result is used to indicate that the WiFi chip scan is successful, the status information of the WiFi switch is used to indicate that the WiFi switch is in the on state, the scan result list is empty, and the location information of the current location of the electronic device is used to indicate that the electronic device is in a preset location set as an example, combined with Figure 6An example of this embodiment will be given.

[0103] As Figure 6 shown, for an electronic device, a processor of the electronic device can obtain the WiFi scan result of a WiFi chip. For example, the processor of the electronic device can monitor whether there is a broadcast of the WiFi scan result. In the case where the broadcast of the WiFi scan result is not monitored, the operation of monitoring whether there is a broadcast of the WiFi scan result can be re-executed. In the case where the broadcast of the WiFi scan result is monitored, the electronic device, such as the processor of the electronic device, can obtain the status information of the WiFi switch to further determine whether the WiFi switch is in the on state. In the case where it is determined that the WiFi switch is in the off state, the operation of monitoring whether there is a broadcast of the WiFi scan result can be re-executed. In the case where it is determined that the WiFi switch is in the on state, continue to determine whether the scan result list is empty. In the case where it is determined that the scan result list is not empty, clear the cumulative number of times that the scan result list is empty, and re-execute the operation of monitoring whether there is a broadcast of the WiFi scan result. In the case where it is determined that the scan list is empty, continue to determine whether the current location of the electronic device is in a preset location set. In the case where the current location of the electronic device is not in the preset location set, the operation of monitoring whether there is a broadcast of the WiFi scan result can be re-executed. In the case where the current location of the electronic device is in the preset location set, increment the cumulative number of times that the scan result list is empty by one. After that, continue to determine whether the cumulative number of times that the scan result list is empty is greater than a first threshold, such as whether the cumulative number of times that the scan result list is empty is greater than 5. In the case where the cumulative number of times that the scan result list is empty is not greater than the first threshold, the operation of monitoring whether there is a broadcast of the WiFi scan result can be re-executed. In the case where the cumulative number of times that the scan result list is empty is greater than the first threshold, it indicates that the number of times of meeting the first condition is greater than the first threshold, that is, it can be determined that the WiFi chip is abnormal, or it can be determined that the current scenario is a scenario where the WiFi chip is abnormal. The electronic device, such as the processor of the electronic device, can set the flag bit of the WiFi chip to a first value for indicating that the WiFi chip needs to be powered off.

[0104] It should be noted that there is no limitation on the execution order of the parameter judgments in the first condition. In Figure 6 the example, first judge the WiFi scan result, then judge the WiFi switch state, then judge the scan result list, and finally judge the location information of the current location of the electronic device. This is only an exemplary display of an execution order and is not uniquely limited here.

[0105] Embodiment 2

[0106] After the WiFi chip performs a scan, the scan result is a scan failure, and the reason for the scan failure is in the preset reason scenario. An electronic device, such as the processor of the electronic device, can set the flag bit of the WiFi chip based on the information of the WiFi chip. For example, when the information of the WiFi chip is used to indicate that the WiFi chip is abnormal, the flag bit of the WiFi chip is set to a first value, which is used to indicate that the WiFi chip needs to be powered down. The specific process can be as follows:

[0107] In some embodiments, an electronic device, such as the processor of the electronic device, can determine whether the WiFi chip is abnormal based on the WiFi scan result of the WiFi chip, or determine whether the current scenario is a WiFi chip abnormal scenario. For example, when the WiFi scan result of the WiFi chip is that the WiFi chip scan fails and the reason for the scan failure is a preset reason, it is determined that the WiFi chip is abnormal. For example, an electronic device, such as the processor of the electronic device, can continue to judge the reason for the scan failure when it is determined that the WiFi scan result is a scan failure, so as to determine whether it is necessary to make the WiFi chip self-heal by controlling the power-down of the WiFi chip according to the reason for the scan failure. The reason for judging the reason for the scan failure is that there are various reasons for the WiFi chip scan failure, and only when the reason for the scan failure is a preset reason can the WiFi chip be triggered to power down to make it self-heal. As an example, the preset reasons can be 1, 22, 95, 100. Among them, preset reason 1 corresponds to Operation not permitted (EPERM). Preset reason 22 corresponds to Invalid argument (EINVAL). Preset reason 95 corresponds to Operation not supported on transport endpoint (EOPNOTSUPP). Preset reason 100 corresponds to Network is down (ENETDOWN). Therefore, in the embodiments of the present application, when it is determined that the WiFi scan result of the WiFi chip is used to indicate that the WiFi chip scan fails and the reason for the scan failure is a preset reason, the flag bit of the WiFi chip is set to a first value, which is used to indicate that the WiFi chip is abnormal, so that the WiFi chip can be controlled to power down to make it self-heal.

[0108] As an example, such as Figure 7 shown, based on the WiFi scan result of the WiFi chip, the specific process of determining whether the current scenario is a WiFi chip abnormal scenario, or determining whether the current scenario is a WiFi chip scan failure scenario is as follows:

[0109] An electronic device, such as a processor of the electronic device, can determine whether the WiFi scan result of the WiFi chip is a scan failure. For example, the processor of the electronic device can determine whether it has monitored the broadcast of the WiFi scan result within a preset time. If it has not monitored the broadcast of the scan result within the preset time, it can be determined that the scan has failed. When it is determined that the WiFi scan result of the WiFi chip is a scan failure, determine the reason for the scan failure (e.g., Handle wifi condsc an fail). Then, determine whether the reason for the scan failure is a preset reason. When the reason for the scan failure is not a preset reason, it can be re-determined whether the WiFi scan result of the WiFi chip is a scan failure. When the reason for the scan failure is a preset reason, it can be determined that the WiFi chip is abnormal, or it can be determined that the current scenario is a WiFi chip abnormal scenario. An electronic device, such as a processor of the electronic device, can set the flag bit of the WiFi chip to a first value to indicate that the WiFi chip needs to be powered off.

[0110] In some other embodiments, an electronic device, such as a processor of the electronic device, can, based on the WiFi scan result of the WiFi chip, repeatedly determine whether the WiFi scan result is a scan failure and whether the reason for the failure is a preset reason, that is, determine whether the number of times that the WiFi scan result is a scan failure and the reason for the failure is a preset reason is greater than a second threshold, and thereby consider that the information of the WiFi chip is used to indicate that the WiFi chip is abnormal. Based on this, the flag bit of the WiFi chip can be set to the first value. The specific description of the WiFi scan result of the WiFi chip can refer to the description of the corresponding content in the above embodiments and will not be elaborated here.

[0111] Combined Figure 7 , such as Figure 8 shown, this embodiment will be illustrated by examples. Such as Figure 8As shown, for an electronic device, such as the processor of the electronic device, it can determine whether the WiFi scan result of the WiFi chip is a scan failure. For example, if the broadcast of the WiFi scan result is not monitored within a preset duration, it is considered a scan failure. When it is determined that the WiFi scan result of the WiFi chip is a scan failure, the reason for the scan failure is determined. Then, it is judged whether the reason for the scan failure is a preset reason. When the reason for the scan failure is not a preset reason, the cumulative count of the reason for the scan failure is cleared, and the operation of determining whether the WiFi scan result of the WiFi chip is a scan failure is performed again. When the reason for the scan failure is a preset reason, the cumulative count of the reason for the scan failure is incremented by one, and it continues to be judged whether the cumulative count of the reason for the scan failure is greater than a second threshold, such as whether the cumulative count of the reason for the scan failure is greater than 3. When the cumulative count of the reason for the scan failure is less than the second threshold, the operation of determining whether the WiFi scan result of the WiFi chip is a scan failure can be performed again. When the cumulative count of the reason for the scan failure is greater than the second threshold, it indicates that the number of times of scan failure and the failure reason being the preset reason is greater than the second threshold, that is, it can be determined that the WiFi chip is abnormal, or it can be determined that the current scenario is a scenario where the WiFi chip is abnormal. For an electronic device, such as the processor of the electronic device, the flag bit of the WiFi chip can be set to a first value to indicate that the WiFi chip needs to be powered off.

[0112] It should be noted that when the cumulative count of the reason for the scan failure is equal to the second threshold, it can be considered that the WiFi chip is abnormal, that is, the operation of setting the flag bit to the first value is performed, or the operation of determining whether the WiFi scan result of the WiFi chip is a scan failure can be performed again. In this embodiment of the present application, the operation performed by the electronic device when the cumulative count of the reason is equal to the second threshold is not specifically limited and can be set according to the needs of the actual application scenario.

[0113] Among them, it can be understood that through the above-mentioned Embodiment 1 and Embodiment 2, for an electronic device, such as the processor of the electronic device, the flag bit of the WiFi chip can be set to the first value under certain conditions. For example, the first value can be set to true to indicate that the WiFi chip needs to be powered off. Then, by executing Figure 3 the shown embodiment, the purpose of controlling the WiFi chip to power off and self-heal can be achieved when the flag bit of the WiFi chip is set to the first value. In addition, for an electronic device, such as the processor of the electronic device, it can control the WiFi chip to power on after controlling the WiFi chip to power off. Or, it can also be to control it to power on after a preset time after controlling the WiFi chip to power off. In this embodiment of the present application, the timing and triggering conditions for re-controlling the WiFi chip to power on after controlling the WiFi chip to power off are not specifically limited. In addition, continuing to combine Figure 3After controlling the WiFi chip to power off, the electronic device, such as the processor of the electronic device, can set the flag bit to a second value, such as setting the second value to fl ase, to indicate that the WiFi chip does not need to be powered off.

[0114] It should be noted that in Embodiment 1 and Embodiment 2, the explanation is given by setting a flag bit after the corresponding conditions are met so that the WiFi chip can be powered off based on the flag bit. In some other embodiments, the WiFi chip can be powered off after it is determined that the corresponding conditions are met. For example, when it is determined that the above-mentioned first condition is met or the number of times the above-mentioned first condition is met is greater than the first threshold, the electronic device, such as the processor of the electronic device, controls the WiFi chip to power off. For another example, when it is determined that the WiFi scan result is a scan failure and the reason for the failure is a preset reason, the WiFi chip can be controlled to power off.

[0115] Embodiment 3

[0116] The user may not be aware of the two WiFi chip abnormality scenarios in the above embodiments. In actual use, the user may be able to perceive the abnormality. For example, the user has previously used a mobile phone to connect to the home WiFi network, but the user is currently at home and the WiFi switch is on, but the mobile phone cannot access the home WiFi network. In this case, the user generally tries to restore the WiFi function by manually operating the WiFi switch. However, the user may not be able to restore the WiFi function by manually operating the WiFi switch. Therefore, in the embodiment of the present application, when the user manually operates the WiFi switch, it can be determined whether the current scene is a WiFi chip abnormality scene, and when the current scene is a WiFi chip abnormality scene, the WiFi chip is controlled to power off to achieve self-healing.

[0117] The following, combined Figure 9 Let's introduce the specific process of realizing self-healing of WiFi chips in electronic devices. Figure 9 As shown, Figure 9 An embodiment of the present application provides a flow chart of another control method for a WiFi chip, the method comprising S901 - S902 .

[0118] S901. Obtain information of the WiFi chip; the information of the WiFi chip includes change information of the WiFi switch of the WiFi chip, status information of the WiFi switch, a cached scan result list of the WiFi chip, and a timestamp of the cached scan result list of the WiFi chip.

[0119] During the process of a user connecting to a WiFi network, there are often situations where the connection fails. The user may manually operate the WiFi switch on the settings interface to try to connect to the WiFi network normally. To ensure the normal operation of the WiFi chip, in some embodiments of the present application, an electronic device, such as the processor of the electronic device, can obtain information about the WiFi chip, that is, execute S901, to determine whether the WiFi chip is abnormal, or to determine whether the current scenario is a WiFi chip abnormal scenario, thereby ensuring the user's Internet access experience when using WiFi.

[0120] Among them, the information of the WiFi chip may include the change information of the WiFi switch of the WiFi chip, the status information of the WiFi switch, the cached WiFi chip scan result list, and the time stamp of the cached WiFi chip scan result list. Among them, the change information of the WiFi chip switch refers to whether the status of the WiFi switch on the electronic device settings interface has changed, such as the WiFi switch changing from the on state to the off state, or the WiFi switch changing from the off state to the on state. The status information of the WiFi switch of the WiFi chip refers to whether the WiFi switch is in the on state or the off state. The cached WiFi chip scan result list refers to the WiFi scan result list stored in the cache of the electronic device, that is, the scan result list of the WiFi networks scanned by the WiFi chip last time. The above time stamp may refer to the time when the scan result list is stored in the cache of the electronic device, or the cache time of the scan result list. For example, in the case where the scan result list includes information of multiple scanned WiFi networks, the cache time of the scan result list, that is, the above time stamp, may be the time when the first WiFi network is scanned. For example, the scan result list includes information of two WiFi networks, namely WiFi 1 and WiFi2. The time when WiFi 1 is scanned is 12:02, and the time when WiFi2 is scanned is 12:03. Then the cache time of the scan result list is 12:02, that is, the time stamp is 12:02.

[0121] S902. In response to the information of the WiFi chip indicating that the WiFi chip is abnormal, control the WiFi chip to power off.

[0122] In the case where the information of the WiFi chip obtained in the above S901 indicates that the WiFi chip is abnormal, an electronic device, such as the processor of the electronic device, can control the WiFi chip to power off.

[0123] In some embodiments of the present application, an electronic device, such as a processor of the electronic device, may determine whether a Wi-Fi chip is abnormal based on information of the Wi-Fi chip, or determine whether the current scenario is a Wi-Fi chip abnormal scenario. When the change information of the Wi-Fi switch of the Wi-Fi chip is used to indicate that the state of the Wi-Fi switch has changed, the status information of the Wi-Fi switch is used to indicate that the Wi-Fi switch is in the off state, the scan result list is not empty, and the timestamp is greater than a preset threshold, it can be considered that the information of the Wi-Fi chip is used to indicate that the Wi-Fi chip is abnormal. That is to say, an electronic device, such as a processor of the electronic device, can obtain the change information of the Wi-Fi switch of the Wi-Fi chip, the status information of the Wi-Fi switch, the cached scan result list of the Wi-Fi chip, and the timestamp of the cached scan result list of the Wi-Fi chip. When the state of the Wi-Fi switch changes, the status information of the Wi-Fi switch is used to indicate that the Wi-Fi switch is in the off state, the scan result list is not empty, and the timestamp is greater than a preset threshold, an electronic device, such as a processor of the electronic device, can determine that the information of the Wi-Fi chip is used to indicate that the Wi-Fi chip is abnormal. Based on this, an electronic device, such as a processor of the electronic device, can control the power-off of the Wi-Fi chip.

[0124] It should be noted that there is no restriction on the order of judgment of the change information of the Wi-Fi switch of the Wi-Fi chip, the status information of the Wi-Fi switch, the cached scan result list of the Wi-Fi chip, and the timestamp of the cached scan result list of the Wi-Fi chip. As an example, as Figure 10 shown, based on the information of the Wi-Fi chip, the specific process of determining that the current scenario is a Wi-Fi chip abnormal scenario can be as follows:

[0125] An electronic device, such as the processor of the electronic device, can first monitor the change information of the WiFi switch. For example, the processor of the electronic device can monitor whether there is a broadcast indicating a change in the state of the WiFi switch. In the case of not monitoring the broadcast indicating a change in the state of the WiFi switch, the operation of monitoring the change information of the WiFi switch state is re-executed. In the case of monitoring the broadcast indicating a change in the state of the WiFi switch, the electronic device, such as the processor of the electronic device, can obtain the state information of the WiFi switch to further determine whether the WiFi switch is in the off state. In the case of determining that the WiFi switch is in the on state, the operation of monitoring the change information of the WiFi switch state is re-executed. In the case of determining that the state of the WiFi switch is in the off state, the electronic device, such as the processor of the electronic device, can obtain the cached scan result list of the WiFi chip, and then determine whether the cached scan result list of the WiFi chip is empty. In the case of the cached scan result list of the WiFi chip being empty, the operation of monitoring the change information of the WiFi switch state is re-executed. In the case of the obtained cached scan result list of the WiFi chip not being empty, then determine whether the timestamp of the cached scan result list of the WiFi chip is greater than a preset threshold, such as determining whether the timestamp is greater than 20s. In the case of the above timestamp being greater than the preset threshold, the electronic device, such as the processor of the electronic device, controls the WiFi chip to power down.

[0126] It should be noted that in the case of the above timestamp being equal to the preset threshold, the electronic device, such as the processor of the electronic device, can consider the WiFi chip to be abnormal, that is, execute the operation of controlling the WiFi chip to power down, or re-execute the operation of monitoring the change information of the WiFi switch state. In this embodiment of the present application, the operation performed by the electronic device when the timestamp is equal to the preset threshold is not specifically limited and can be set according to the needs of the actual application scenario.

[0127] Among them, the above preset threshold can be set according to empirical values. Specifically, the preset threshold can be set to a value greater than the scan period, and this is not the only limitation here.

[0128] It should be noted that in the above embodiments, the execution process of the solution of the present application is described by taking the processor in the electronic device as an example. Other components in the electronic device can also execute the solution of the present application, and this is not specifically limited here.

[0129] In summary, in the above three scenarios where the WiFi chip is abnormal, the WiFi chip can be controlled to power down to achieve self-healing of the WiFi chip within a certain period of time, thereby ensuring the normal use of the user's WiFi function and improving the user's Internet experience.

[0130] Some other embodiments of the present application provide an electronic device, which may include: a memory, a WiFi chip, and one or more processors. The memory, the WiFi chip, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform each function or step executed in the above method embodiments. The structure of the electronic device may refer to Figure 2 the structure of the electronic device shown in the example of a mobile phone.

[0131] Embodiments of the present application also provide a chip system, as Figure 11 shown, the chip system 1100 includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 can be interconnected through a line. For example, the interface circuit 1102 can be used to receive signals from other devices (such as the memory of an electronic device). For another example, the interface circuit 1102 can be used to send signals to other devices (such as the processor 1101). Exemplarily, the interface circuit 1102 can read the instructions stored in the memory and send the instructions to the processor 1101. When the instructions are executed by the processor 1101, the electronic device can perform each step in the above embodiments. Of course, the chip system may also include other discrete devices, and the embodiments of the present application do not make specific limitations thereto.

[0132] Embodiments of the present application also provide a computer storage medium, which includes computer instructions. When the computer instructions run on the above electronic device, the electronic device performs each function or step that the electronic device performs in the above method embodiments.

[0133] Embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, the computer performs each function or step that the electronic device performs in the above method embodiments.

[0134] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

[0135] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

[0136] The units described as separate components may or may not be physically separated. The components displayed as units may be one physical unit or multiple physical units, that is, they can be located in one place, or they can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0137] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0138] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0139] The above content is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A control method for a Wi-Fi chip, characterized in that Applied to an electronic device including a WiFi chip, the method includes: Obtain a flag bit of the WiFi chip, where the flag bit is used to indicate whether the WiFi chip needs to be powered down; In response to the flag bit indicating that the WiFi chip needs to be powered down, control the WiFi chip to be powered down.

2. The method according to claim 1, wherein Before controlling the WiFi chip to be powered down, the method further includes: Detect a screen-off broadcast.

3. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain information of the WiFi chip, where the information of the WiFi chip includes: the WiFi scan result of the WiFi chip, the status information of the WiFi switch of the WiFi chip, and the scan result list of the WiFi chip; In response to the information of the WiFi chip indicating that the WiFi chip is abnormal, set the flag bit to a first value, which is used to indicate that the WiFi chip needs to be powered down.

4. The method according to claim 3, wherein When a first condition is met or the number of times the first condition is met is greater than a first threshold, the information of the WiFi chip indicates that the WiFi chip is abnormal; The first condition includes: the WiFi scan result indicating that the WiFi chip scans successfully, the status information of the WiFi switch indicating that the WiFi switch is in an on state, and the scan result list is empty.

5. The method according to claim 4, wherein The first condition further includes: the location information of the current location of the electronic device indicating that the electronic device is in a preset location set.

6. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the WiFi scan result of the WiFi chip; In response to the WiFi scan result indicating that the WiFi chip is abnormal, set the flag bit to a first value, which is used to indicate that the WiFi chip needs to be powered down.

7. The method according to claim 6, wherein When the WiFi scan result indicates that the WiFi chip scans fails and the reason for the scan failure is a preset reason, the WiFi scan result indicates that the WiFi chip is abnormal; Or, When the WiFi scan result indicates that the WiFi chip scans fails and the number of times the reason for the scan failure is a preset reason is greater than a second threshold, the WiFi scan result indicates that the WiFi chip is abnormal.

8. The method according to any one of claims 1-7, characterized in that, After controlling the WiFi chip to be powered down, the method further includes: Set the flag bit to a second value, which is used to indicate that the WiFi chip does not need to be powered down.

9. A control method for a Wi-Fi chip, characterized in that, Applied to an electronic device including a WiFi chip, the method includes: Obtain information of the WiFi chip; the information of the WiFi chip includes the change information of the WiFi switch of the WiFi chip, the status information of the WiFi switch, the cached scan result list of the WiFi chip, and the timestamp of the cached scan result list of the WiFi chip; In response to the information of the WiFi chip indicating that the WiFi chip is abnormal, control the WiFi chip to be powered down.

10. The method according to claim 9, wherein when the change information of the WiFi switch is used to indicate that the state of the WiFi switch has changed, the status information of the WiFi switch is used to indicate that the WiFi switch is in the off state, the scan result list is not empty, and the timestamp is greater than a preset threshold, the information of the WiFi chip is used to indicate that the WiFi chip is abnormal.

11. An electronic device, characterized in that, The electronic device includes: a memory, a WiFi chip, and one or more processors; the memory, the WiFi chip are coupled to the processor; wherein, the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device is caused to execute the method according to any one of claims 1-10.

12. A computer-readable storage medium, characterized in that, including computer instructions; when the computer instructions run on the electronic device, the electronic device is caused to execute the method according to any one of claims 1-10.