WO2025123735A1 - 一种WiFi芯片的控制方法及电子设备 - Google Patents
一种WiFi芯片的控制方法及电子设备 Download PDFInfo
- Publication number
- WO2025123735A1 WO2025123735A1 PCT/CN2024/111564 CN2024111564W WO2025123735A1 WO 2025123735 A1 WO2025123735 A1 WO 2025123735A1 CN 2024111564 W CN2024111564 W CN 2024111564W WO 2025123735 A1 WO2025123735 A1 WO 2025123735A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- wifi
- wifi chip
- electronic device
- chip
- indicate
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W24/00—Supervisory, monitoring or testing arrangements
- H04W24/04—Arrangements for maintaining operational condition
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/02—Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
- H04W84/10—Small scale networks; Flat hierarchical networks
- H04W84/12—WLAN [Wireless Local Area Networks]
Definitions
- the present application relates to the field of terminal technology, and in particular to a control method and electronic device of a Wireless Fidelity (WiFi) chip.
- WiFi Wireless Fidelity
- the present application provides a control method for a WiFi chip and an electronic device.
- the WiFi chip is promptly controlled to power off, thereby realizing self-healing of the WiFi chip, so that the electronic device can access the network normally through WiFi, meet the user's Internet access needs, and improve the user experience.
- the present application provides a control method for a WiFi chip, which is applied to an electronic device including a WiFi chip.
- the electronic device obtains a flag bit of the WiFi chip, which 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 WiFi chip is controlled to be powered off.
- the flag is used to indicate that the WiFi chip needs to be powered off when the WiFi chip is abnormal.
- the WiFi chip is controlled to be powered off, so that when a scanning abnormality caused by the abnormality of the WiFi chip occurs, the WiFi chip is controlled to be powered off so that it can self-heal within a certain period of time, so that the electronic device can access the network normally through WiFi, meet the user's Internet access needs, and enhance the user's Internet access experience.
- the electronic device may monitor whether there is a screen-off broadcast before controlling the WiFi chip to power off. If the screen-off broadcast is monitored, it indicates that the electronic device is in a screen-off state. In the screen-off state, the WiFi chip is controlled to power off, so as not to affect the user experience.
- the electronic device can set a flag bit to a first value, such as true, to indicate that the WiFi chip needs to be powered off when the information of the WiFi chip is used to indicate that the WiFi chip is abnormal.
- 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 the WiFi chip needs to be powered off by periodically or when a predetermined condition is met. The operation is simple, time-saving, and further ensures the user's Internet experience.
- the information of the WiFi chip can be used to indicate that the WiFi chip is abnormal, or to indicate that the current scene is a scene of WiFi chip abnormality.
- the first condition may include: the WiFi scan result is used to indicate that the WiFi chip scan is successful, the state of the WiFi switch The information 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 first condition is met 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, it can be determined that the WiFi chip is abnormal or the current scene is a WiFi chip abnormal scene.
- the scan result of the WiFi chip is identified as a successful scan, but the reported scan result list is empty. This is a scan abnormality scene caused by the abnormal WiFi chip, which improves the ability of the WiFi chip in the electronic device to automatically recover during use.
- the information of the WiFi chip can be used to indicate that the WiFi chip is abnormal, or to indicate that the current scene is a scene of WiFi chip abnormality.
- the first condition may further include 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.
- 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.
- the flag bit may be set to a first value based on a WiFi scan result of the WiFi chip. That is, 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.
- the WiFi scanning result is that the WiFi chip scanning fails, and the reason for the scanning failure is a preset reason
- the WiFi scanning result is used to indicate that the WiFi chip is abnormal, or to indicate that the current scene is a WiFi chip abnormal scene.
- the scanning abnormal scene in which the WiFi chip scanning fails due to the 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.
- the WiFi chip when the WiFi chip fails to scan and the number of times 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 when the WiFi chip scan fails for multiple times and the reason for the scan failure is a preset reason, the accuracy of identifying the WiFi chip abnormal scene is improved.
- the flag bit may be set to a second value, such as setting the second value to false, to indicate that the WiFi chip does not need to be powered off.
- the present application provides a control method for a WiFi chip, which is applied to an electronic device including a WiFi chip.
- information of the WiFi chip is obtained; the information of the WiFi chip includes change information of a 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; in response to the information of the WiFi chip indicating that the WiFi chip is abnormal, the WiFi chip is controlled to be powered off.
- the WiFi chip when the acquired WiFi chip information indicates that the WiFi chip is abnormal, the WiFi chip is controlled to be powered off.
- the WiFi chip is controlled to be powered off so that it can self-heal within a certain period of time, so that the electronic device can access the network normally through WiFi, meeting the needs of the user. Users' Internet access needs are met and their Internet experience is enhanced.
- the WiFi chip when the user senses that the WiFi chip is abnormal and manually operates the WiFi switch, the WiFi chip can be powered off so that it can successfully self-heal, further ensuring the user experience.
- the WiFi chip it is possible to determine whether the WiFi chip is abnormal, or to determine whether the current scene is an abnormal WiFi chip scene, based on 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. For example, when the state of the WiFi switch changes, 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 electronic device, such as the processor of the electronic device, can determine that the information of the WiFi chip is used to indicate that the WiFi chip is abnormal. Based on this, the abnormal WiFi chip scene can be accurately identified, further ensuring the user experience.
- the present application provides a control device for a WiFi chip, which has the function of implementing the behavior of the electronic device in the method of the first aspect.
- 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, and a monitoring unit or module.
- an electronic device comprising: 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
- the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device executes the control method of the WiFi chip in the above-mentioned first aspect, second aspect and any implementation method thereof.
- a computer-readable storage medium including a computer program, and when the computer program runs on an electronic device, the electronic device can execute a control method for a WiFi chip as in the first aspect, the second aspect, and any implementation thereof.
- a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the control method of the WiFi chip in the first aspect, the second aspect and any implementation manner thereof.
- an embodiment of the present application provides a chip system, the chip system including a processor, the processor being used to call a computer program in a memory to execute a control method for a WiFi chip as in the first aspect, the second aspect, and any implementation thereof.
- 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 provided above can refer to the beneficial effects in the first aspect, the second aspect and any possible implementation methods thereof, and will not be repeated here.
- FIG1 is a schematic diagram of a WiFi chip of an electronic device surfing the Internet in the related art
- FIG2 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application.
- FIG3 is a schematic flow chart of a control method for a WiFi chip provided in an embodiment of the present application.
- FIG4 is a schematic diagram of a first process flow of a method for handling abnormal scenarios of a WiFi chip provided by an embodiment of the present application;
- FIG5 is a second flow chart of a method for handling abnormal scenarios of a WiFi chip according to an embodiment of the present application
- FIG6 is a third flow chart of a method for handling abnormal scenarios of a WiFi chip provided by an embodiment of the present application.
- FIG. 7 is a flowchart of another abnormal scenario method for a WiFi chip provided by an embodiment of the present application.
- FIG8 is a second flow chart of another abnormal scenario method for a WiFi chip provided by an embodiment of the present application.
- FIG9 is a flow chart of another control method for a WiFi chip provided in an embodiment of the present application.
- FIG10 is a schematic diagram of a flow chart of another abnormal scenario method for a WiFi chip provided in an embodiment of the present application.
- FIG. 11 is a schematic diagram of the structure of a chip system provided in an embodiment of the present application.
- a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
- plural means two or more than two.
- At least one of the following or similar expressions refers to any combination of these items, including any combination of single items or plural items.
- at least one of a, b, or c can mean: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
- words such as “first” and “second” are used to distinguish the same or similar items with substantially the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order, and words such as “first” and “second” do not necessarily limit the difference.
- words such as “exemplary” or “for example” are used to indicate examples, illustrations or descriptions. Any embodiment or design described as “exemplary” or “for example” in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as “exemplary” or “for example” is intended to present related concepts in a concrete way for easy understanding.
- the electronic device In addition to surfing the Internet through traffic, current electronic devices can also use WiFi to provide users with Internet access functions.
- the electronic device is a mobile phone for demonstration.
- the user needs to turn on the WiFi function on the mobile phone.
- the user can enter the setting interface of the WiFi function through the interface of the setting application, such as the interface 11 shown in (a) of FIG1, such as the interface 12 shown in (b) of FIG1.
- the user can operate the WiFi switch in the interface 12 for controlling the opening/closing of the mobile phone WiFi function to trigger the mobile phone to turn on/off the WiFi function of the mobile phone.
- the mobile phone can perform periodic scanning to scan the available WiFi networks around. After scanning the available WiFi network, the mobile phone can display the identifier of the available WiFi network scanned by the mobile phone in the available WiFi list of the interface 12 shown in (b) of FIG1, such as the name of the WiFi network, such as XXX1, XXX2, etc. Afterwards, 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 WiFi network in the available WiFi list, the mobile phone can connect to the WiFi network selected by the user for the user to surf the Internet.
- the mobile phone performs periodic scanning: the WiFi chip of the mobile phone periodically scans the available WiFi channels, such as periodically scanning the available WiFi channels in the 5G frequency band, so as to determine the available WiFi networks, and display the scanned information of the available WiFi networks to the user through the available WiFi list for the user to select.
- the WiFi chip of the mobile phone periodically scans the available WiFi channels, such as periodically scanning the available WiFi channels in the 5G frequency band, so as to determine the available WiFi networks, and display the scanned information of the available WiFi networks to the user through the available WiFi list for the user to select.
- the available WiFi list displayed by the mobile phone does not include any WiFi network information, which causes the user to be unable to select the WiFi network to which the mobile phone needs to connect, thereby causing the user to be unable to use WiFi to access the Internet.
- the embodiment of the present application provides a control method for a WiFi chip, which controls the WiFi chip to be powered off when it is determined that the current scene is a scene of WiFi chip abnormality, that is, when the scanning is abnormal due to the abnormal WiFi chip.
- the electronic device can be a mobile phone, a tablet computer, a smart watch, a desktop, 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) or a virtual reality (VR) device, etc., which includes a WiFi chip.
- UMPC ultra-mobile personal computer
- PDA personal digital assistant
- AR augmented reality
- VR virtual reality
- the control method of the WiFi chip provided in the embodiment of the present application can be applied to the scene of abnormal scanning caused by abnormal WiFi chip of the electronic device.
- the scene of abnormal scanning caused by abnormal 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 scans failed, such as the WiFi chip receives the scan instruction but does not scan, resulting in a scan failure; or the WiFi function is abnormal, and the electronic device detects that the user manually operates the WiFi switch in the setting interface, etc.
- FIG2 shows a schematic diagram of the structure of the mobile phone 200.
- 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.
- SIM subscriber identification module
- the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the mobile phone 200.
- the mobile phone 200 may include more or fewer components than those shown in the figure, or combine some components, or separate some components, or arrange the components differently.
- the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
- 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 processor (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). Different processing units may be independent devices. It may also be integrated into one or more processors.
- AP application processor
- modem processor e.g., a modem processor, a graphics processor (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).
- AP application processor
- GPU graphics processor
- ISP image signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- Different processing units may be independent devices. It may also be integrated into one or more processors.
- the controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
- a memory may also be provided in the processor 210 for storing instructions and data.
- the memory in the processor 210 is a cache memory.
- the memory may store instructions or data that the processor 210 has just used or circulated. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
- the processor 210 may include one or more interfaces. In an embodiment of the present application, the processor 210 may be used to control the WiFi chip to power off when it is determined that the current scene is a scene of scanning abnormality caused by an abnormal WiFi chip, so that the WiFi chip can self-heal.
- the charging management module 250 is used to receive charging input from a charger.
- the charger can be a wireless charger or a wired charger. While the charging management module 250 charges the battery 270, it can also power the mobile phone 200 through the power management module 260.
- the power management module 260 is used to connect to the battery 270.
- the power management module 260 receives input from the battery 270 and/or the charging management module 250, and supplies power to the processor 210, the internal memory 221, the display screen 294, and the wireless communication module 240 (such as a WiFi chip).
- the power management module 260 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
- the power management module 260 can also be set in the processor 210.
- the power management module 260 and the charging management module 250 can also be set in the same device.
- the wireless communication function of the mobile phone 200 can be realized through the antenna 1, the antenna 2, the mobile communication module 230, the wireless communication module 240, the modem processor and the baseband processor.
- Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in mobile phone 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas.
- antenna 1 can be reused as a diversity antenna for a wireless local area network.
- the antenna can be used in combination with a tuning switch.
- 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 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
- the mobile communication module 230 can receive electromagnetic waves from the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
- the wireless communication module 240 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 200.
- WLAN wireless local area networks
- BT wireless fidelity
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication
- IR infrared
- the wireless communication module 240 may include the WiFi chip in the present application.
- the antenna 1 of the mobile phone 200 is coupled to the mobile communication module 230, and the antenna 2 is coupled to the wireless communication module 240, so that the mobile phone 200 can communicate with the network and other devices through wireless communication technology.
- the mobile phone 200 realizes the display function through the GPU, the display screen 294, and the application processor.
- a microprocessor for processing connected to the display screen 294 and the application processor.
- the GPU is used to perform mathematical and geometric calculations for graphics rendering.
- the processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.
- the display screen 294 is used to display images, videos, etc.
- the display screen 294 includes a display panel.
- the display screen 294 may be a touch screen.
- the display screen 294 may be used for a settings interface for the WiFi function.
- the settings interface may include a WiFi switch for turning on/off the WiFi function.
- the settings interface may also be used to display information about the scanned WiFi network, such as the WiFi network identifier, for the user to select the WiFi network to be connected.
- the external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 200.
- an external memory card such as a Micro SD card
- the internal memory 221 can be used to store computer executable program codes, which include instructions.
- the internal memory 221 can include a program storage area and a data storage area.
- the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
- the data storage area can store data created during the use of the mobile phone 200 (such as audio data, a phone book, etc.), etc.
- the internal memory 221 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (universal flash storage, UFS), etc.
- the processor 210 executes various functions and data processing of the mobile phone 200 by running instructions stored in the internal memory 221 and/or instructions stored in a memory provided in the processor 210.
- the audio module 280 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
- the audio module 280 can also be used to encode and decode audio signals.
- the audio module 280 can be arranged in the processor 210, or some functional modules of the audio module 280 can be arranged in the processor 210.
- the sensor module 290 may include a pressure sensor 290A, a fingerprint sensor 290B, a temperature sensor 290C, a touch sensor 290D, and the like.
- the pressure sensor 290A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
- the pressure sensor 290A can be set on the display screen 294.
- pressure sensors 290A such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc.
- a capacitive pressure sensor can be a parallel plate including at least two conductive materials.
- the fingerprint sensor 290B is used to collect fingerprints.
- the mobile phone 200 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.
- the temperature sensor 290C is used to detect temperature.
- 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 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 avoid abnormal shutdown of the mobile phone 200 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the mobile phone 200 performs a boost on the output voltage of the battery 270 to avoid abnormal shutdown caused by low temperature.
- the touch sensor 290D is also called a "touch device”.
- the touch sensor 290D can be set on the display screen 294.
- the touch sensor 290D and the display screen 294 form a touch screen, also called a "touch screen”.
- the touch sensor 290D is used to detect touch operations acting on or near it.
- the touch sensor can pass 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.
- the touch sensor 290D can also be set on the surface of the mobile phone 200, which is different from the position of the display screen 294.
- the key 291 includes a power key, a volume key, etc.
- the key 291 can be a mechanical key or a touch key.
- the mobile phone 200 can receive key input and generate key signal input related to the user settings and function control of the mobile phone 200.
- Motor 292 can generate vibration prompts.
- Motor 292 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
- touch operations acting on different applications can correspond to different vibration feedback effects.
- touch operations acting on different areas of the display screen 294, motor 292 can also correspond to different vibration feedback effects.
- Different application scenarios for example: time reminders, receiving messages, alarm clocks, games, etc.
- the touch vibration feedback effect can also support customization.
- Indicator 293 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
- the SIM card interface 295 is used to connect a SIM card.
- the SIM card can be connected to or disconnected from the mobile phone 200 by inserting the SIM card interface 295 or pulling the SIM card out of the SIM card interface 295.
- Figure 3 is a schematic flow chart of a control method for a WiFi chip provided in an embodiment of the present application, and the method may include: S301-S302.
- the 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, thereby ensuring the user's Internet experience when using WiFi.
- an electronic device such as a processor of an electronic device, may monitor the WiFi chip when it is determined that a predetermined condition is met, that is, execute S301 to determine whether an abnormality occurs in the WiFi chip.
- the predetermined condition may include whether a screen-off broadcast is monitored.
- An electronic device such as a processor of an electronic device, may monitor the WiFi chip when a screen-off broadcast is monitored to determine whether an abnormality occurs in the WiFi chip.
- an electronic device such as an electronic device processor, may periodically monitor whether there is a screen-off broadcast.
- the processor may send a screen-off broadcast. Turning off the screen of an electronic device may be triggered by a user or automatically by the electronic device. For example, if the electronic device does not receive any user operation on the electronic device after a predetermined period of time, the electronic device will automatically turn off the screen.
- the flag of the WiFi chip can be a flag for indicating whether the WiFi chip needs to be powered off.
- the flag can also be called a power-off flag, a power-off self-healing flag, or a screen-off power-off self-healing flag, etc.
- the flag can be set in the WiFi chip, or it can be set in other devices of the electronic device, such as a processor.
- the acquired WiFi chip flag is used to indicate that the WiFi chip does not need to be powered off. In this case, it indicates that the WiFi chip is not abnormal, that is, the WiFi chip can scan normally, and the user can use WiFi to surf the Internet normally, and S301 can be executed again. In the case where the acquired WiFi chip flag is used to indicate that the WiFi chip needs to be powered off, it indicates that the WiFi chip is abnormal, such as the WiFi chip may not be able to scan normally, and the user cannot use WiFi to surf the Internet normally, and the following S302 can be executed.
- the electronic device When it is determined that the flag bit is used to indicate that the WiFi chip needs to be powered off, the electronic device, such as the processor of the electronic device, can control the WiFi chip to be powered off. Powering off means disconnecting the WiFi chip from the power supply, such as stopping the power supply to the WiFi chip.
- the electronic device when it is determined that the flag bit of the WiFi chip is used to indicate that the WiFi chip needs to be powered off, the electronic device, such as the processor of the electronic device, can send a power-off control instruction to the power management module of the electronic device, and the power-off control instruction is used to instruct to stop supplying power to the WiFi chip. After receiving the power-off control instruction, the power management module of the electronic device stops supplying power to the WiFi chip.
- S301 can be executed periodically.
- an electronic device such as a processor of an electronic device
- the electronic device such as the processor of an electronic device
- S301 can also be executed when a predetermined condition is met, such as when a screen-off broadcast is monitored.
- the electronic device such as the processor of an electronic device, can monitor the screen-off broadcast, execute S301, and when it is determined based on the acquired WiFi chip flag that the WiFi chip needs to be powered off, control the WiFi chip to power off.
- the above embodiments are introduced by first monitoring whether there is a screen-off broadcast and then monitoring the WiFi chip, or first monitoring the WiFi chip and then monitoring whether there is a screen-off broadcast.
- electronic devices such as the processor of an electronic device, can also monitor the WiFi chip and whether there is a screen-off broadcast at the same time, and control the WiFi chip to power off when the screen-off broadcast is monitored and the flag of the WiFi chip is used to indicate that the WiFi chip needs to be powered off.
- the embodiments of the present application do not specifically limit the execution order of monitoring the screen-off broadcast and monitoring the WiFi chip.
- the WiFi chip when the flag 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.
- the WiFi chip can be controlled to be powered off to restore the function of the WiFi chip, so that the current scene no longer causes scanning abnormalities due to the abnormality of the WiFi chip, so that the user can normally use the WiFi function of the electronic device to surf the Internet, thereby improving the user experience.
- the WiFi chip can be controlled to be powered off when the screen of the electronic device is turned off, so as not to affect the user experience.
- the scenario that can indicate that the WiFi chip is abnormal is: the scan result of the WiFi chip is a successful scan, but the reported scan result list is empty, such as the number of available WiFi networks in the scan result list reported to the upper-layer application is 0.
- the WiFi chip can scan normally and successfully scans the WiFi network, but the available WiFi list displayed in the setting interface does not display the logo of the scanned WiFi network, resulting in the user being unable to select the WiFi network that the electronic device needs to access, resulting in the inability to use WiFi to access the Internet. Users are usually unable to perceive this WiFi chip abnormal scenario.
- the scenario that can indicate that the WiFi chip is abnormal is: after the WiFi chip performs a scan, the scan result is a scan failure, and the reason for the scan failure is a preset reason.
- the user cannot use WiFi to access the Internet. And the user is usually unaware of this WiFi chip abnormal scenario.
- the WiFi chip flag can be set to indicate that the WiFi chip needs to be powered off, so as to control the WiFi chip to power off, so as to restore the function of the WiFi chip and ensure that users can use WiFi to surf the Internet normally.
- the electronic device such as the processor of the electronic device, can set the flag 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 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:
- an electronic device such as a processor of an electronic device, can determine whether a first condition is satisfied based on information of the WiFi chip to determine whether the WiFi chip is abnormal, or determine whether the current scene is a WiFi chip abnormal scene.
- the information of the WiFi chip may include a WiFi scan result of the WiFi chip, status information of a WiFi switch of the WiFi chip, and a scan result list of the WiFi chip.
- the scanning results of the WiFi chip may include a successful scan and a failed scan.
- the processor of an electronic device such as an electronic device
- monitors the WiFi scan broadcast it can be determined that the scan result is a successful scan.
- the processor of an electronic device does not monitor the WiFi scan broadcast, it can be determined that the scan result is a failed scan.
- the switch of the WiFi chip can be a control for the user to turn on/off the WiFi function.
- the control can be included in the setting application of the electronic device, or in the control center of the electronic device, and of course 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 may include an on state and an off state.
- the scan result list can be a list for displaying information about scanned available WiFi networks to the user.
- the method of displaying the information about scanned available WiFi networks to the user may not be in the form of a list, but in other forms, and this embodiment does not make specific restrictions here.
- the first condition may include a WiFi scan result indicating 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, the 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.
- 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 scene is a WiFi chip abnormal scene.
- 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.
- the specific process of determining whether the current scene is a WiFi chip abnormal scene is as follows:
- Electronic devices can first obtain the WiFi scanning results of the WiFi chip, such as electronic
- the processor of the device can monitor whether there is a broadcast of WiFi scan results (such as android.net.wifi.SCAN_RESULTS). In the case where the broadcast of WiFi scan results is not monitored, the operation of monitoring whether there is a broadcast of WiFi scan results can be re-executed.
- 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 monitoring whether there is a broadcast of WiFi scan results can be re-executed.
- the WiFi switch 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 monitoring whether there is a broadcast of WiFi scan results can be re-executed. In the case of determining that the scan result list is empty, it is indicated that the current scene is an abnormal scene of the WiFi chip, 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 to indicate that the WiFi chip needs to be powered off.
- the first condition may also include the location information of the current location of the electronic device for indicating that the electronic device is in a preset location set. That is, in addition to 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 mentioned above, the electronic device, such as the processor of the electronic device, needs to determine whether the WiFi chip is abnormal based on the location information of the current location of the electronic device, that is, to determine whether the current scene is a WiFi chip abnormal scene based on these four parameters, so as to determine whether it is necessary to control the WiFi chip to power off for self-healing.
- the electronic device in addition to 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, 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.
- 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 scene is a WiFi chip abnormal scene.
- 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.
- the current location information of the electronic device is used as a judgment condition to avoid the situation when the user takes the electronic device to some unfamiliar environments that the user does not often go to. For example, there may be no WiFi network deployed in these unfamiliar environments (such as mountainous areas). If this judgment is not performed, the current scene may be misjudged as a WiFi chip abnormality scene.
- the specific process of determining whether the current scene is a WiFi chip abnormal scene is as follows:
- An electronic device such as a processor of an electronic device, can first obtain the WiFi scan results of a WiFi chip, such as the processor of an electronic device can monitor whether there is a broadcast of WiFi scan results (e.g., android.net.wifi.SCAN_RESULTS). In the event that the broadcast of WiFi scan results is not monitored, the operation of monitoring whether there is a broadcast of WiFi scan results can be re-executed. In the event that the broadcast of WiFi scan results is monitored, an electronic device, such as a processor of an electronic device, can obtain the status information of a WiFi switch to further determine whether the WiFi switch is in the on state.
- a broadcast of WiFi scan results e.g., android.net.wifi.SCAN_RESULTS
- the operation of monitoring whether there is a broadcast of WiFi scan results can be re-executed.
- the WiFi switch is determined to be in the on state
- the operation of listening for the broadcast of the WiFi scan result can be re-executed.
- the identifier of the cell to which the current electronic device is accessed (referred to as the current cell identifier, current cell id) can be obtained to determine whether the current cell id is included in the commonly used cell id set, which is pre-configured in the electronic device.
- the operation of listening for the broadcast of the WiFi scan result can be re-executed.
- 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.
- an electronic device such as a processor of an electronic device, can determine whether the first condition is met multiple times based on the information of the WiFi chip, that is, determine whether the number of times the first condition is met is greater than the first threshold, so as to determine whether the current scene is a WiFi chip abnormal scene.
- the number of times the first condition is met 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 scene is a WiFi chip abnormal scene, based on which the flag bit of the WiFi chip can be set to a first value.
- the specific description of the information of the WiFi chip and the first condition can refer to the description of the corresponding content of the above embodiment, and will not be repeated here.
- the first condition includes: 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, and this embodiment is illustrated in conjunction with Figure 6.
- an electronic device such as a processor of an electronic device, can obtain the WiFi scan result of a WiFi chip, such as a processor of an electronic device, can monitor whether there is a broadcast of a 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 an on state. In the case where it is determined that the WiFi switch is in an off state, the operation of monitoring whether there is a broadcast of the WiFi scan result can be re-executed.
- the WiFi switch In the case where it is determined that the WiFi switch is in an on state, it is continued to determine whether the scan result list is empty. In the case where it is determined that the scan result list is not empty, the cumulative number of times the scan result list is empty is cleared, and the operation of monitoring whether there is a broadcast of the WiFi scan result is re-executed. In the case where it is determined that the scan list is empty, it is continued to determine whether the current electronic device is located in a preset position set. In the case where the current electronic device is located not in the preset position set, the operation of monitoring whether there is a broadcast of the WiFi scan result can be re-executed.
- the cumulative number of times the scan result list is empty is increased by one. Afterwards, it can be further determined whether the cumulative number of times the scan result list is empty is greater than the first threshold, such as whether the cumulative number of times the scan result list is empty is greater than 5. If the cumulative number of times the scan result list is empty is not greater than the first threshold, the operation of monitoring whether there is a broadcast of WiFi scan results can be re-executed.
- the cumulative number of times the scan result list is empty is greater than the first threshold, it indicates that the number of times the first condition is satisfied 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 scene is a scene of WiFi chip abnormality, 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 to indicate that the WiFi chip needs to be powered off.
- the parameter judgments in the first condition are not restricted in the order of execution.
- the WiFi scan result is judged first, then the WiFi switch status is judged, then the scan result list is judged, and finally the The location information of the current location of the electronic device only exemplifies an execution order and is not a sole limitation.
- the electronic device can set the flag 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 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:
- an electronic device such as a processor of an 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 scene is a WiFi chip abnormal scene. 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, when the WiFi scan result of the WiFi chip is determined to be a scan failure, the electronic device, such as the processor of the electronic device, can continue to determine the cause of the scan failure, so as to determine whether it is necessary to control the WiFi chip to power off to make it self-healing according to the cause of the scan failure.
- the reason for determining the scan failure is that there are many reasons for the WiFi chip scan failure, and only when the cause of the scan failure is a preset reason, it can be triggered to power off the WiFi chip to make it self-healing.
- the preset reasons can be 1, 22, 95, 100.
- the preset reason 1 corresponds to unauthorized operation (Operation not permitted, EPERM).
- the preset reason 22 corresponds to invalid parameter (Invalid argument, EINVAL).
- the preset reason 95 corresponds to the transport endpoint does not support the operation (Operation not supported on transport endpoint, EOPNOTSUPP).
- the preset reason 100 corresponds to the network is down (ENETDOWN).
- the flag bit of the WiFi chip is set to the first value to indicate that the WiFi chip is abnormal, so that the WiFi chip can be controlled to power off to make it self-healing.
- the specific process of determining whether the current scene is a WiFi chip abnormal scene, or determining whether the current scene is a WiFi chip scanning failure scene is as follows:
- An electronic device such as a processor of an electronic device, can determine whether a WiFi scan result of a WiFi chip is a scan failure. For example, the processor of the electronic device can determine whether the broadcast of the WiFi scan result is monitored within a preset time. If the broadcast of the scan result is not monitored within the preset time, it can be determined that the scan has failed. In the case where it is determined that the WiFi scan result of the WiFi chip is a scan failure, the cause of the scan failure is determined (e.g., Handle wifi condsc an fail). Next, it is determined whether the cause of the scan failure is a preset cause. In the case where the cause of the scan failure is not a preset cause, it can be re-determined whether the WiFi scan result of the WiFi chip is a scan failure.
- the processor of the electronic device can determine whether the broadcast of the WiFi scan result is monitored within a preset time. If the broadcast of the scan result is not monitored within the preset time, it can be determined that the scan has failed. In the case where it is determined that the WiFi
- the cause of the scan failure is a preset cause
- 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.
- an electronic device such as a processor of an electronic device, can determine multiple times whether the WiFi scan result is a scan failure and whether the failure reason is a preset reason based on the WiFi scan result of the WiFi chip, that is, whether the number of times the WiFi scan result is a scan failure and the failure reason is a preset reason is greater than a second threshold, so as to 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 corresponding internal The description of the content will not be repeated here.
- an electronic device such as a processor of an electronic device, can determine whether the WiFi scan result of the WiFi chip is a scan failure. If the broadcast of the WiFi scan result is not heard within a preset time, it is considered that the scan has failed. In the case where it is determined that the WiFi scan result of the WiFi chip is a scan failure, the cause of the scan failure is determined. Next, it is determined whether the cause of the scan failure is a preset cause.
- the cumulative number of causes of the scan failure is cleared, and the operation of determining whether the WiFi scan result of the WiFi chip is a scan failure is re-executed.
- the cumulative number of causes of the scan failure is increased by one, and it is continued to be determined whether the cumulative number of causes of the scan failure is greater than a second threshold, such as whether the cumulative number of causes of the scan failure is greater than 3.
- the operation of determining whether the WiFi scan result of the WiFi chip is a scan failure can be re-executed.
- the cumulative number of reasons for scan failure is greater than the second threshold, it indicates that the scan failed and the number of times the failure reason is a 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 scene is a scene of WiFi chip abnormality.
- 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.
- the WiFi chip when the cumulative number of reasons for scan failure is equal to the second threshold, the WiFi chip can be considered abnormal, that is, the operation of setting the flag to the first value is performed, or the operation of determining whether the WiFi scan result of the WiFi chip is a scan failure is re-executed.
- the embodiment of the present application does not impose specific restrictions on the operations performed by the electronic device when the cumulative number of reasons is equal to the second threshold, and can be set according to the needs of the actual application scenario.
- the electronic device such as the processor of the electronic device, can set the flag bit of the WiFi chip to the first value when the conditions are met, such as the first value can be set to true, so as to indicate that the WiFi chip needs to be powered off. Then, by executing the embodiment shown in Figure 3, the purpose of controlling the WiFi chip to power off and make it self-healing can be achieved when the flag bit of the WiFi chip is set to the first value.
- the electronic device such as the processor of the electronic device, can control the WiFi chip to power on after controlling the WiFi chip to power off. Alternatively, it can also be controlled to power on after a preset time after controlling the WiFi chip to power off.
- the embodiment of the present application does not specifically limit the timing and triggering conditions for re-controlling the WiFi chip to power on after 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 flase, to indicate that the WiFi chip does not need to be powered off.
- 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.
- 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.
- the two WiFi chip abnormality scenarios in the above embodiments may not be perceived by the user.
- the user may be able to perceive the abnormality.
- the user has used a mobile phone to connect to the home WiFi network before, but the user is currently at home and the WiFi switch is turned on, but the mobile phone cannot access the home WiFi network.
- the user generally manually operates the WiFi switch to try to restore the WiFi function.
- the user manually operates the WiFi switch to restore the WiFi function.
- the WiFi switch may not be able to restore the WiFi function.
- the WiFi switch when the user manually operates the WiFi switch, it can be determined whether the current scene is a WiFi chip abnormal scene, and if the current scene is a WiFi chip abnormal scene, the WiFi chip is controlled to power off to achieve self-healing.
- Figure 9 is a flow chart of another control method of a WiFi chip according to an embodiment of the present application, and the method includes S901-S902.
- 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.
- the electronic device such as the processor of the electronic device, can obtain information about the WiFi chip, that is, execute S901 to determine whether an abnormality occurs in the WiFi chip, or determine whether the current scene is an abnormal WiFi chip scene, so as to ensure the user's Internet experience when using WiFi.
- 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 scan result list of the WiFi chip and the timestamp of the cached scan result list of the WiFi chip.
- the change information of the WiFi chip switch refers to whether the state of the WiFi switch in the electronic device setting interface has changed, such as the WiFi switch changes from the on state to the off state, or the WiFi switch changes 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 scan result list of the WiFi chip refers to the WiFi scan result list stored in the cache of the electronic device, that is, the scan result list of the WiFi network scanned by the WiFi chip last time.
- the above timestamp 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.
- the cache time of the scan result list that is, the above timestamp may be the time when the first WiFi network is scanned.
- the scan result list includes information of two WiFi networks, namely WiFi1 and WiFi2. The time when WiFi1 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 timestamp is 12:02.
- the electronic device such as the processor of the electronic device, can control the WiFi chip to power off.
- an electronic device such as a processor of an electronic device, can determine whether a WiFi chip is abnormal based on information about the WiFi chip, or determine whether the current scene is a scene where the WiFi chip is abnormal.
- the change information of the WiFi switch is used to indicate that the state of the WiFi switch has changed
- the state information of the WiFi switch is used to indicate that the WiFi switch is in an off state
- the scan result list is not empty
- the timestamp is greater than a preset threshold
- an electronic device such as a processor of an electronic device, can obtain the change information of the WiFi switch of the WiFi chip, the state 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.
- the state information of the WiFi switch is used to indicate that the WiFi switch is in an off state
- the scan result list is not empty
- the timestamp is greater than a preset threshold
- an electronic device such as a processor of an electronic device
- the information of the WiFi chip is used to determine whether the WiFi chip is abnormal. Based on this, the electronic device, such as the processor of the electronic device, can control the WiFi chip to power off.
- the change information of the WiFi switch of the WiFi chip can be as follows:
- An electronic device such as a processor of an electronic device, may first monitor the change information of a WiFi switch, such as the processor of an electronic device may 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 state of the WiFi switch 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, may obtain the state information of the WiFi switch to further determine whether the WiFi switch is in a closed state. In the case of determining that the WiFi switch is in an open state, the operation of monitoring the change information of the state of the WiFi switch is re-executed.
- the electronic device In the case of determining that the state of the WiFi switch is in a closed state, the electronic device, such as the processor of the electronic device, may obtain a 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 that the cached scan result list of the WiFi chip is empty, the operation of monitoring the change information of the state of the WiFi switch is re-executed. In the case that the acquired cached scan result list of the WiFi chip is not empty, it is further determined 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 where the above timestamp is greater than the preset threshold, the electronic device, such as the processor of the electronic device, controls the WiFi chip to power off.
- a preset threshold such as determining whether the timestamp is greater than 20s.
- the electronic device such as the processor of the electronic device, may consider that the WiFi chip is abnormal, that is, execute the operation of controlling the WiFi chip to power off, or re-execute the operation of monitoring the change information of the WiFi switch state.
- the embodiment of the present application does not impose specific restrictions on the operation performed by the electronic device when the timestamp is equal to the preset threshold, and can be set according to the needs of the actual application scenario.
- the preset threshold can be set based on empirical values. Specifically, the preset threshold can be set to a value greater than the scanning period, which is not limited here.
- the WiFi chip can be powered off to achieve self-healing within a certain period of time, thereby ensuring the normal use of the user's WiFi function and improving the user's Internet experience.
- 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.
- the processor executes the computer instructions, the electronic device can perform each function or step performed in the above method embodiment.
- the structure of the electronic device can refer to the structure of the electronic device shown in Figure 2, taking a mobile phone as an example.
- 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 via a line.
- the interface circuit 1102 can be used to receive signals from other devices (such as a memory of an electronic device).
- the interface circuit 1102 may be used to send a signal to another device (e.g., the processor 1101).
- the interface circuit 1102 may read an instruction stored in the memory and send the instruction to the processor 1101.
- the electronic device may perform the various steps in the above embodiment.
- the chip system may also include other discrete devices, which is not specifically limited in the embodiment of the present application.
- An embodiment of the present application also provides a computer storage medium, which includes computer instructions.
- the computer instructions When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device in the above-mentioned method embodiment.
- the embodiment of the present application also provides a computer program product.
- the computer program product When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the electronic device in the above method embodiment.
- the disclosed devices and methods can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
- the 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.
- the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephone Function (AREA)
Abstract
本申请公开了一种WiFi芯片的控制方法及电子设备,涉及终端技术领域,针对WiFi芯片异常导致的扫描异常情况,通过控制WiFi芯片下电使其自愈,从而保证用户连接网络的日常使用需求。该方法可以应用于包括WiFi芯片的电子设备,具体方案可以为:获取WiFi芯片的标志位,该标志位用于指示是否需要WiFi芯片下电;响应于标志位用于指示需要WiFi芯片下电,控制WiFi芯片下电。
Description
本申请要求于2023年12月15日提交国家知识产权局、申请号为202311735273.6、发明名称为“一种WiFi芯片的控制方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及终端技术领域,尤其涉及一种无线保真(Wireless Fidelity,WiFi)芯片的控制方法及电子设备。
为了给用户提供网络便利,当前手机可以利用WiFi进行上网。但在通过WiFi上网时,用户往往会遇到不明原因的扫描异常,如,WiFi芯片异常导致的扫描异常,从而无法保证用户连接网络的日常使用需求,给用户带来不便。
发明内容
基于此,本申请提供一种WiFi芯片的控制方法及电子设备,在WiFi芯片异常导致的扫描异常的情况下,及时控制WiFi芯片下电,从而实现WiFi芯片自愈,以使得电子设备能正常通过WiFi接入网络,满足用户的上网需求,提高了用户的体验。
为达到上述目的,本申请的实施例采用如下技术方案:
第一方面,本申请提供一种WiFi芯片的控制方法,应用于包括WiFi芯片的电子设备。该方法中,电子设备获取WiFi芯片的标志位,该标志位可以用于指示是否需要WiFi芯片下电;响应于标志位用于指示需要WiFi芯片下电,控制WiFi芯片下电。
其中,上述标志位在WiFi芯片异常的情况下,用于指示需要WiFi芯片下电。通过在获取到的标志位用于指示需要WiFi芯片下电的情况下,控制WiFi芯片下电,使得在WiFi芯片异常导致的扫描异常发生时,通过控制WiFi芯片下电,使其能够在一定时间内自愈,以使得电子设备能正常通过WiFi接入网络,满足用户的上网需求,增加用户的上网体验。
在第一方面的一种可实现方式中,电子设备在控制WiFi芯片下电之前,可以监听是否有灭屏广播。在监听到灭屏广播的情况下,说明电子设备处于灭屏状态,在灭屏状态下,控制WiFi芯片下电,从而不影响用户的体验感。
在第一方面的一种可实现方式中,电子设备可以在WiFi芯片的信息用于指示WiFi芯片异常的情况下,设置标志位为第一值,如true,以用于指示需要WiFi芯片下电。其中,WiFi芯片的信息可以包括:WiFi芯片的WiFi扫描结果,WiFi芯片的WiFi开关的状态信息,和WiFi芯片的扫描结果列表。电子设备,如电子设备的处理器可以通过周期性或者在满足预定条件时判断WiFi芯片的标志位是否为第一值来确定是否需要对WiFi芯片进行下电处理,操作简便,节省时间,进一步保证了用户的上网体验感。
在第一方面的一种可实现方式中,在满足第一条件的情况下,WiFi芯片的信息可以用于指示WiFi芯片异常,或者说用于指示当前场景为WiFi芯片异常的场景。其中,第一条件可以包括:WiFi扫描结果用于指示WiFi芯片扫描成功,WiFi开关的状态
信息用于指示WiFi开关处于开启状态,和扫描结果列表为空。也就是说,电子设备,如电子设备的处理器可以在获取到WiFi芯片的信息,即获取到WiFi芯片的WiFi扫描结果,WiFi芯片的WiFi开关的状态信息,和WiFi芯片的扫描结果列表之后,在WiFi扫描结果用于指示WiFi芯片扫描成功,WiFi开关的状态信息用于指示WiFi开关处于开启状态,且扫描结果列表为空的情况下,电确定满足第一条件,即可确定WiFi芯片异常或者可确定当前场景为WiFi芯片异常场景。这样,识别出了WiFi芯片的扫描结果为扫描成功,但是上报的扫描结果列表却为空这种由于WiFi芯片异常导致的扫描异常场景,提高了电子设备中WiFi芯片在使用中自动恢复的能力。
在第一方面的一种可实现方式中,在满足第一条件的次数大于第一阈值的情况下,WiFi芯片的信息可以用于指示WiFi芯片异常,或者说用于指示当前场景为WiFi芯片异常的场景。通过在多次判断满足上述第一条件的情况下,确定WiFi芯片异常,提高了WiFi芯片异常场景识别的准确性。
在第一方面的一种可实现方式中,上述第一条件还可以包括电子设备当前所处位置的位置信息用于指示电子设备处于预设位置集合中。这样,通过在识别WiFi芯片异常场景的条件中,增加电子设备当前所处位置的位置信息用于指示电子设备处于预设位置集合中这一判断,可以规避将用户携带电子设备去往未部署WiFi网络的场景误识别为WiFi芯片异常场景的情况,进一步提高了WiFi芯片异常场景识别的准确性。
在第一方面的一种可实现方式中,可以基于WiFi芯片的WiFi扫描结果设置标志位为第一值。也就是说,在WiFi芯片的WiFi扫描结果用于指示WiFi芯片异常的情况下,设置标志位为第一值,以指示需要WiFi芯片下电。
在第一方面的一种可实现方式中,在WiFi扫描结果为WiFi芯片扫描失败,且扫描失败的原因为预设原因的情况下,该WiFi扫描结果用于指示WiFi芯片异常,或者说用于指示当前场景为WiFi芯片异常场景。这样,识别出了因为预设原因导致的WiFi芯片扫描失败的扫描异常场景,提高了电子设备中WiFi芯片在使用中自动恢复的能力,提高了用户的体验。
在第一方面的一种可实现方式中,在WiFi芯片扫描失败,且扫描失败的原因为预设原因的次数大于第二阈值的情况下,可以确定WiFi芯片异常。这样,通过在多次判断WiFi芯片扫描失败,且扫描失败的原因为预设原因的情况下,确定WiFi芯片异常,提高了WiFi芯片异常场景识别的准确性。
在第一方面的一种可实现方式中,在控制WiFi芯片下电之后,可以设置标志位为第二值,如设置第二值为flase,用于指示不需要WiFi芯片下电。
第二方面,本申请提供一种WiFi芯片的控制方法,应用于包括WiFi芯片的电子设备。该方法中,获取WiFi芯片的信息;WiFi芯片的信息包括WiFi芯片的WiFi开关的变化信息,WiFi开关的状态信息,缓存的WiFi芯片的扫描结果列表和缓存的WiFi芯片的扫描结果列表的时间戳;响应于WiFi芯片的信息用于指示WiFi芯片异常,控制WiFi芯片下电。
上述方法中,在获取到的WiFi芯片信息用于指示WiFi芯片异常的情况下,控制WiFi芯片下电。使得在WiFi芯片异常导致的扫描异常发生时,通过控制WiFi芯片下电,使其能够在一定时间内自愈,以使得电子设备能正常通过WiFi接入网络,满足用
户的上网需求,增加用户的上网体验。
上述方法中,可以在用户感知到WiFi芯片异常,对WiFi开关进行手动操作的过程中,控制WiFi芯片下电,使其能够成功自愈,进一步保证了用户的体验感。
在第一方面的一种可实现方式中,可以根据WiFi芯片的WiFi开关的变化信息,WiFi开关的状态信息,缓存的WiFi芯片的扫描结果列表和缓存的WiFi芯片的扫描结果列表的时间戳确定WiFi芯片是否异常,或者说确定当前场景是否为WiFi芯片异常场景。如,在WiFi开关的状态发生变化,WiFi开关的状态信息用于指示WiFi开关处于关闭状态,扫描结果列表不为空和时间戳大于预设阈值的情况下,电子设备,如电子设备的处理器可以确定WiFi芯片的信息用于指示所述WiFi芯片异常。基于此,能够准确识别WiFi芯片异常场景,进一步确保了用户的体验感。
第三方面,本申请提供了一种WiFi芯片的控制装置,该装置具有实现上述第一方面的所述方法中电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块,例如,获取单元或模块,控制单元或模块,监听单元或模块。
第四方面,提供了一种电子设备,该电子设备包括:存储器、WiFi芯片和一个或多个处理器;存储器、WiFi芯片与处理器耦合;
其中,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令;当计算机指令被处理器执行时,使得电子设备执行如上述第一方面、第二方面及其任一实现方式中的WiFi芯片的控制方法。
第五方面,提供了一种计算机可读存储介质,计算机可读存储介质包括计算机程序,当计算机程序在电子设备上运行时,使得电子设备可以执行如第一方面、第二方面及其任一实现方式中的WiFi芯片的控制方法。
第六方面,提供了一种包含指令的计算机程序产品,当其在电子设备上运行时,使得电子设备可以执行上述第一方面、第二方面及其任一实现方式中的WiFi芯片的控制方法。
第七方面,本申请实施例提供了一种芯片系统,芯片系统包括处理器,处理器用于调用存储器中的计算机程序,以执行如第一方面、第二方面及其任一实现方式中的WiFi芯片的控制方法。
可以理解地,上述提供的第三方面所述的装置,第四方面所述的电子设备,第五方面所述的计算机可读存储介质,第六方面所述的计算机程序产品,第七方面所述的芯片系统所能达到的有益效果,可参考第一方面、第二方面及其任一种可能的实现方式中的有益效果,此处不再赘述。
图1为相关技术中电子设备WiFi芯片上网的示意图;
图2为本申请实施例提供的一种终端设备的结构示意图;
图3为本申请实施例提供一种WiFi芯片的控制方法流程示意图;
图4为本申请实施例提供一种WiFi芯片的异常场景方法流程示意图一;
图5为本申请实施例提供一种WiFi芯片的异常场景方法流程示意图二;
图6为本申请实施例提供一种WiFi芯片的异常场景方法流程示意图三;
图7为本申请实施例提供另一种WiFi芯片的异常场景方法流程示意图一;
图8为本申请实施例提供另一种WiFi芯片的异常场景方法流程示意图二;
图9为本申请实施例提供另一种WiFi芯片的控制方法流程示意图;
图10为本申请实施例提供又一种WiFi芯片的异常场景方法流程示意图;
图11为本申请实施例提供的一种芯片系统的结构示意图。
在本申请的描述中,除非另有说明,本申请中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。
在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念,便于理解。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
除了通过流量进行上网之外,当前电子设备还可以利用WiFi为用户提供上网功能。示例性的,如图1所示,以电子设备为手机进行展示。在使用WiFi功能进行上网的过程中,用户需要打开手机上的WiFi功能。如,用户可以通过设置应用的界面,如图1中的(a)所示的界面11进入WiFi功能的设置界面,如图1中的(b)所示的界面12。之后,用户可以对界面12中的用于控制手机WiFi功能打开/关闭的WiFi开关进行操作,以触发手机打开/关闭手机的WiFi功能。在手机接收到打开WiFi功能的操作后,手机可以进行周期性地扫描,以扫描周围可用的WiFi网络。在扫描到可用的WiFi网络后,手机可在如图1中的(b)所示的界面12的可用WiFi列表中显示手机扫描到的可用WiFi网络的标识,如WiFi网络的名称,如XXX1、XXX2等。之后,用户可在可用WiFi列表中选择需要手机连接的WiFi网络,如选中需要手机连接的WiFi网络的标识。在接收到用户选中可用WiFi列表中的某个WiFi网络的标识的操作后,手机可连接到用户选择的WiFi网络,以供用户上网。
其中,手机进行周期性扫描具体的可以为:手机的WiFi芯片周期性地对可用的WiFi信道进行扫描,如周期性地扫描5G频段中可用的WiFi信道,从而确定可用的WiFi网络,以通过可用WiFi列表将扫描到的可用WiFi网络的信息展示给用户,供用户选择。
但用户可能会遇到不明原因的扫描异常,如在WiFi芯片异常的情况下,会造成扫
描异常。其中,在扫描异常的情况下,用户是无法使用WiFi进行上网的。如在WiFi芯片异常的情况下,如图1中的(c)所示的界面13,手机显示的可用WiFi列表中不包括任何WiFi网络的信息,这导致用户无法选择需要手机连接的WiFi网络,从而导致无法使用WiFi进行上网。
在相关技术中,对WiFi芯片异常时用户无法使用WiFi进行上网,并未采取补救方案。换句话说,在WiFi芯片异常场景中,用户就没有办法使用WiFi进行上网,无法满足用户的上网需求。
为了解决上述问题,本申请实施例提供一种WiFi芯片的控制方法,在判断出当前场景为WiFi芯片异常的场景,也就是在因WiFi芯片异常导致扫描异常的场景下,控制WiFi芯片下电。通过精准识别WiFi芯片异常的场景并触发WiFi芯片下电使其自愈,以使得电子设备能正常通过WiFi接入网络,满足用户的上网需求,提高了用户的体验。
本申请实施例提供的方案可以应用于电子设备。示例性的,该电子设备可以是如手机、平板电脑、智能手表、桌面型、膝上型、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备等包括WiFi芯片的设备,本申请实施例对该电子设备的具体形态不作特殊限制。
另外,需要说明的是,本申请实施例提供的WiFi芯片的控制方法,可以应用于由于电子设备的WiFi芯片异常导致的扫描异常的场景中。其中,WiFi芯片异常导致的扫描异常的场景可以是WiFi芯片扫描成功,但可用WiFi列表中不包括成功扫描到的WiFi网络的信息;也可以是WiFi芯片扫描失败,如,WiFi芯片接收到扫描指令,但是并未进行扫描,从而造成的扫描失败;亦或是WiFi功能异常,电子设备监测到用户在设置界面中手动操作WiFi开关的场景等。
示例性的,以手机200作为上述电子设备的举例,图2示出了手机200的结构示意图。如图2所示,手机200可以包括处理器210,外部存储器接口220,内部存储器221,移动通信模块230,无线通信模块240,充电管理模块250,电源管理模块260,电池270,天线1,天线2,音频模块280,传感器模块290,按键291,马达292,指示器293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。
可以理解的是,本发明实施例示意的结构并不构成对手机200的具体限定。在本申请另一些实施例中,手机200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,
也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。在一些实施例中,处理器210可以包括一个或多个接口。在本申请实施例中,处理器210可以用于在确定当前场景是由于WiFi芯片异常导致的扫描异常的场景的情况下,控制WiFi芯片下电,以使得WiFi芯片自愈。
充电管理模块250用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块250为电池270充电的同时,还可以通过电源管理模块260为手机200供电。
电源管理模块260用于连接电池270。电源管理模块260接收电池270和/或充电管理模块250的输入,为处理器210,内部存储器221,显示屏294,和无线通信模块240(如WiFi芯片)等供电。电源管理模块260还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块260也可以设置于处理器210中。在另一些实施例中,电源管理模块260和充电管理模块250也可以设置于同一个器件中。
手机200的无线通信功能可以通过天线1,天线2,移动通信模块230,无线通信模块240,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。手机200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块230可以提供应用在手机200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块230可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块230可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。
无线通信模块240可以提供应用在手机200上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(blue tooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。在本申请一些实施例中,无线通信模块240在提供手机200上的WLAN解决方案的情况下,该无线通信模块240可以包括本申请中的WiFi芯片。
在一些实施例中,手机200的天线1和移动通信模块230耦合,天线2和无线通信模块240耦合,使得手机200可以通过无线通信技术与网络以及其他设备通信。
手机200通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像
处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏294用于显示图像,视频等。显示屏294包括显示面板。例如,显示屏294可以是触摸屏。在本申请一些实施例中,在用户打开设置应用后,显示屏294可以用于WiFi功能的设置界面。该设置界面可包括用于打开/关闭WiFi功能的WiFi开关。该设置界面还可以用于显示扫描到的WiFi网络的信息,如WiFi网络的标识,供用户选择需连接的WiFi网络。
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机200的存储能力。
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机200使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器210通过运行存储在内部存储器221的指令,和/或存储在设置于处理器210中的存储器的指令,执行手机200的各种功能以及数据处理。
音频模块280用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块280还可以用于对音频信号编码和解码。在一些实施例中,音频模块280可以设置于处理器210中,或将音频模块280的部分功能模块设置于处理器210中。
传感器模块290可以包括压力传感器290A,指纹传感器290B,温度传感器290C,触摸传感器290D等。
其中,压力传感器290A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器290A可以设置于显示屏294。压力传感器290A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器290A,电极之间的电容改变。手机200根据电容的变化确定压力的强度。当有触摸操作作用于显示屏294,手机200根据压力传感器290A检测所述触摸操作强度。手机200也可以根据压力传感器290A的检测信号计算触摸的位置。
指纹传感器290B用于采集指纹。手机200可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器290C用于检测温度。在一些实施例中,手机200利用温度传感器290C检测的温度,执行温度处理策略。例如,当温度传感器290C上报的温度超过阈值手机200执行降低位于温度传感器290C附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,手机200对电池270加热,以避免低温导致手机200异常关机。在其他一些实施例中,当温度低于又一阈值时,手机200对电池270的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器290D,也称“触控器件”。触摸传感器290D可以设置于显示屏294,由触摸传感器290D与显示屏294组成触摸屏,也称“触控屏”。触摸传感器290D用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏294提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器290D也可以设置于手机200的表面,与显示屏294所处的位置不同。
按键291包括开机键,音量键等。按键291可以是机械按键。也可以是触摸式按键。手机200可以接收按键输入,产生与手机200的用户设置以及功能控制有关的键信号输入。
马达292可以产生振动提示。马达292可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏294不同区域的触摸操作,马达292也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器293可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和手机200的接触和分离。
以下结合图3来介绍电子设备实现WiFi芯片的自愈的具体流程。如图3所示,图3为本申请实施例提供一种WiFi芯片的控制方法流程示意图,该方法可以包括:S301-S302。
S301.获取WiFi芯片的标志位,标志位用于指示是否需要WiFi芯片下电。
为了保证WiFi芯片能够正常工作,在本申请一些实施例中,电子设备,如电子设备的处理器可以周期性对WiFi芯片进行监测,即执行S301,以确定WiFi芯片是否发生异常,从而保证用户使用WiFi时的上网体验。
在其他一些实施例中,电子设备,如电子设备的处理器可以在确定满足预定条件时,对WiFi芯片进行监测,即执行S301,以确定WiFi芯片是否发生异常。例如,该预定条件可以包括是否监听到灭屏广播。电子设备,如电子设备的处理器可以在监听到灭屏广播的情况下,对WiFi芯片进行监测,以确定WiFi芯片是否发生异常。其中,电子设备,如电子设备处理器可以周期性的监听是否有灭屏广播。其中,在电子设备需要熄灭屏幕(后续简称为熄屏)的情况下,处理器可以发送灭屏广播。电子设备熄屏可以是用户触发的,也可以是电子设备自动触发的,如电子设备在预定时长后未接收到用户对电子设备的操作,电子设备便会自动熄屏。
其中,监测WiFi芯片是否异常可以根据WiFi芯片的标志位确定。在本实施例中,WiFi芯片的标志位可以是一个用于指示是否需要对WiFi芯片下电的标志。该标志位也可以称为下电标志位,下电自愈标志位,或灭屏下电自愈标志位等。该标志位可以设置于WiFi芯片中,也可以不设置于WiFi芯片中,如设置于电子设备的其他器件,如处理器中。
示例性的,在获取到的WiFi芯片的标志位用于指示不需要对WiFi芯片下电的情
况下,表明WiFi芯片未发生异常,即WiFi芯片可以正常扫描,用户可以正常使用WiFi进行上网,此时可以重新执行S301。在获取到的WiFi芯片的标志位用于指示需要对WiFi芯片下电的情况下,表明WiFi芯片发生异常,如WiFi芯片可能无法正常扫描,用户无法正常使用WiFi进行上网,则可以执行下述S302。
S302.响应于标志位用于指示需要WiFi芯片下电,控制WiFi芯片下电。
在确定标志位用于指示需要WiFi芯片下电的情况下,电子设备,如电子设备的处理器可以控制WiFi芯片下电。所谓下电是指让WiFi芯片脱离电源,如停止对WiFi芯片进行供电。例如,电子设备,如电子设备的处理器在确定WiFi芯片的标志位用于指示需要WiFi芯片下电的情况下,可以向电子设备的电源管理模块发送下电控制指令,该下电控制指令用于指示停止为WiFi芯片供电。电子设备的电源管理模块接收到下电控制指令后,停止向WiFi芯片供电。
如S301的描述,S301可以周期性的执行。在S301周期性执行的情况下,在一些实施例中,电子设备,如电子设备的处理器可以在基于获取到的WiFi芯片的标志位确定需要对WiFi芯片下电的情况下,便控制WiFi芯片下电。在其他一些实施例中,在电子设备,如电子设备的处理器基于获取到的WiFi芯片的标志位确定需要对WiFi芯片下电后,电子设备,如电子设备的处理器可以监听是否有灭屏广播,并在监听到灭屏广播的情况下,再控制WiFi芯片下电。S301也可以在满足预定条件,如监听到灭屏广播的情况下执行。在S301在监听到灭屏广播的情况下才执行时,电子设备,如电子设备的处理器可以监听到灭屏广播后,执行S301,并在基于获取到的WiFi芯片的标志位确定需要对WiFi芯片下电的情况下,便控制WiFi芯片下电。
需要说明的是,以上实施例是以先监听是否有灭屏广播,后对WiFi芯片进行监测,或者先对WiFi芯片进行监测,再监听是否有灭屏广播为例进行介绍的,在其他一些实施例中,电子设备,如电子设备的处理器也可以同时对WiFi芯片及是否有灭屏广播进行监测,并在监听到灭屏广播且WiFi芯片的标志位用于指示需要WiFi芯片下电的情况下,控制WiFi芯片下电。本申请实施例在此对监听灭屏广播和对WiFi芯片进行监测的执行先后顺序不作具体限定。
采用本申请的技术方案,在WiFi芯片的标志位用来指示需要WiFi芯片下电的情况下,表明WiFi芯片可能存在异常,此时可以控制WiFi芯片下电,以此来恢复WiFi芯片的功能,使当前场景不再由于WiFi芯片异常而导致扫描异常,从而使得用户可以正常使用电子设备的WiFi功能上网,增加用户的体验感。另外,可以在电子设备灭屏的情况下,控制WiFi芯片下电,从而不影响用户的体验感。
在实际使用中,能够表明WiFi芯片异常的场景可能存在很多,下面以两个实施例进行展示。
在实施例一中,能够表明WiFi芯片异常的场景是:WiFi芯片的扫描结果为扫描成功,但是上报的扫描结果列表却为空,如上报给上层应用的扫描结果列表中可用的WiFi网络的数量为0。换句话说,用户在设置界面打开WiFi开关后,WiFi芯片能够正常进行扫描,且成功扫描到了WiFi网络,但设置界面中显示的可用WiFi列表中却不显示扫描到的WiFi网络的标识,从而导致用户无法选择需要电子设备接入的WiFi网络,导致无法使用WiFi上网。这种WiFi芯片异常场景用户通常无法感知。
在实施例二中,能够表明WiFi芯片异常的场景是:WiFi芯片进行扫描后,扫描结果为扫描失败,且扫描失败的原因是预设原因。这种场景下,用户也是无法使用WiFi上网的。且这种WiFi芯片异常场景用户通常也是无法感知的。
上述两种表明WiFi芯片异常的场景往往可以通过控制WiFi芯片下电而使得WiFi芯片自愈。那么在这两种场景中,可以通过设置WiFi芯片的标志位用于指示WiFi芯片需要下电,来控制WiFi芯片下电,以便恢复WiFi芯片的功能,确保用户可以正常使用WiFi上网。下面将对这两个实施例进行详细介绍。
实施例一
在WiFi芯片的扫描结果为扫描成功,但是上报的扫描结果列表却为空的场景中,电子设备,如电子设备的处理器可以基于WiFi芯片的信息来对WiFi芯片的标志位进行设置。如,在WiFi芯片的信息用于指示WiFi芯片异常的情况下,设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。其中,具体过程可以如下所示:
在本申请的一些实施例中,电子设备,如电子设备的处理器可以基于WiFi芯片的信息判断是否满足第一条件来确定WiFi芯片是否异常,或者说确定当前场景是否为WiFi芯片异常场景。WiFi芯片的信息可以包括WiFi芯片的WiFi扫描结果,WiFi芯片的WiFi开关的状态信息,和WiFi芯片的扫描结果列表。
其中,WiFi芯片的扫描结果可以包括扫描成功和扫描失败。如,电子设备,如电子设备的处理器监听到WiFi扫描广播,则可确定扫描结果为扫描成功。电子设备,如电子设备的处理器未监听到WiFi扫描广播,则可确定扫描结果为扫描失败。WiFi芯片的开关可以是用于用户开启/关闭WiFi功能的控件,该控件可以包含在电子设备的设置应用中,也可以包含在电子设备的控制中心,当然还可以包含在其他应用中供用户开启/关闭电子设备的WiFi功能。WiFi开关的状态信息可以包括开启状态和关闭状态。扫描结果列表可以是用于向用户展示扫描到的可用WiFi网络的信息的列表。当前,向用户展示扫描到的可用WiFi网络的信息的方式也可以不是列表形式,而是其他形式,本实施例在此不做具体限制。
在一些示例中,第一条件可以包括WiFi扫描结果用于指示WiFi芯片扫描成功,WiFi开关的状态信息用于指示WiFi开关处于开启状态,和扫描结果列表为空。也就是说,电子设备,如电子设备的处理器可以获取WiFi芯片的信息,即获取WiFi芯片的WiFi扫描结果,WiFi芯片的WiFi开关的状态信息,和WiFi芯片的扫描结果列表。在WiFi扫描结果用于指示WiFi芯片扫描成功,WiFi开关的状态信息用于指示WiFi开关处于开启状态,且扫描结果列表为空的情况下,电子设备,如电子设备的处理器可以确定WiFi芯片的信息满足第一条件,即确定WiFi芯片的信息指示WiFi芯片异常,或者说确定当前场景为WiFi芯片异常场景。此时,电子设备,如电子设备的处理器可以设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。
需要说明的是,上述WiFi扫描结果是否用于指示WiFi芯片扫描成功,WiFi开关的状态信息是否用于指示WiFi开关处于开启状态,和扫描结果列表是否为空的判断并没有先后的执行顺序。作为一种示例,如图4所示,基于第一条件,确定当前场景是否为WiFi芯片异常场景的具体流程如下:
电子设备,如电子设备的处理器可以先获取WiFi芯片的WiFi扫描结果,如电子
设备的处理器可以监听是否有WiFi扫描结果的广播(如,android.net.wifi.SCAN_RESULTS)。在没有监听到WiFi扫描结果的广播的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在监听到WiFi扫描结果的广播的情况下,电子设备,如电子设备的处理器可以获取WiFi开关的状态信息,以便进一步判断WiFi开关是否处于开启状态。在确定WiFi开关处于关闭状态的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在确定WiFi开关处于开启状态的情况下,继续判断WiFi芯片的扫描结果列表是否为空。在确定扫描结果列表不为空的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在确定扫描结果列表为空的情况下,表明当前场景为WiFi芯片异常场景,电子设备,如电子设备的处理器可以设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。
在另一示例中,第一条件还可以包括电子设备当前所处位置的位置信息用于指示电子设备处于预设位置集合中。也就是说,电子设备,如电子设备的处理器除了根据上述提到的WiFi芯片的WiFi扫描结果,WiFi芯片的WiFi开关的状态信息,和WiFi芯片的扫描结果列表的之外,还需要基于电子设备当前所处位置的位置信息判断WiFi芯片是否异常,即基于这四个参数判断当前场景是否为WiFi芯片异常场景,从而确定是否需要控制WiFi芯片下电来自愈。也就是说,电子设备,如电子设备的处理器除了可以获取WiFi芯片的WiFi扫描结果,WiFi芯片的WiFi开关的状态信息,和WiFi芯片的扫描结果列表之外,还可以获取电子设备当前所处位置的位置信息。在WiFi扫描结果用于指示WiFi芯片扫描成功,WiFi开关的状态信息用于指示WiFi开关处于开启状态,扫描结果列表为空,且电子设备当前所处位置的位置信息用于指示电子设备处于预设位置集合中的情况下,电子设备,如电子设备的处理器可以确定WiFi芯片的信息满足第一条件,即可以确定WiFi芯片异常,或者说可以确定当前场景为WiFi芯片异常场景。此时,电子设备,如电子设备的处理器可以设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。
其中,电子设备当前所处的位置信息作为判断条件是为了规避当用户带着电子设备去到一些不常去的陌生环境,如,这些陌生环境(如山区)中可能未部署WiFi网络,如若不进行该判断,可能误判当前场景为WiFi芯片异常场景。
类似的,上述WiFi扫描结果是否用于指示WiFi芯片扫描成功,WiFi开关的状态信息是否用于指示WiFi开关处于开启状态,扫描结果列表是否为空,以及当前所处位置的位置信息是否用于指示电子设备处于预设位置集合中的判断并没有先后的执行顺序。作为一种示例,结合图4,如图5所示,基于第一条件,确定当前场景是否为WiFi芯片异常场景的具体流程如下:
电子设备,如电子设备的处理器可以先获取WiFi芯片的WiFi扫描结果,如电子设备的处理器可以监听是否有WiFi扫描结果的广播(如,android.net.wifi.SCAN_RESULTS)。在没有监听到WiFi扫描结果的广播的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在监听到WiFi扫描结果的广播的情况下,电子设备,如电子设备的处理器可以获取WiFi开关的状态信息,以便进一步判断WiFi开关是否处于开启状态。在确定WiFi开关处于关闭状态的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在确定WiFi开关处于开启状态
的情况下,继续判断WiFi芯片的扫描结果列表是否为空。在确定扫描结果列表不为空的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在确定扫描结果列表为空的情况下,继续判断当前电子设备所处位置是否处于预设位置集合中。如,可以获取当前电子设备接入的小区的标识(简称当前小区标识,当前cell id),判断当前cell id是否包含在常用cell id集合中,该常用cell id集合预先配置在电子设备中。在当前电子设备所处位置未处于预设位置集合中的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在当前电子设备所处位置处于预设位置集合中的情况下,电子设备,如电子设备的处理器可以设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。
在本申请的又一些实施例中,电子设备,如电子设备的处理器可以基于WiFi芯片的信息,多次确定是否满足第一条件,即确定满足第一条件的次数是否大于第一阈值,以此来确定当前场景是否为WiFi芯片异常场景。在满足第一条件的次数大于第一阈值的情况下,可以认为WiFi芯片的信息用于指示WiFi芯片异常,或者说可以确定当前场景为WiFi芯片异常场景,基于此可以设置WiFi芯片的标志位为第一值。其中,WiFi芯片的信息以及第一条件的具体描述可以参照上述实施例对应内容的描述,在此不再赘述。此处,以第一条件包括:WiFi扫描结果用于指示WiFi芯片扫描成功,WiFi开关的状态信息用于指示WiFi开关处于开启状态,扫描结果列表为空,和电子设备当前所处位置的位置信息用于指示电子设备处于预设位置集合中为例,结合图6对该实施例进行举例说明。
如图6所示,电子设备,如电子设备的处理器可以获取WiFi芯片的WiFi扫描结果,如电子设备的处理器可以监听是否有WiFi扫描结果的广播。在没有监听到WiFi扫描结果的广播的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在监听到WiFi扫描结果的广播的情况下,电子设备,如电子设备的处理器可以获取WiFi开关的状态信息,以便进一步判断WiFi开关是否处于开启状态。在确定WiFi开关处于关闭状态的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在确定WiFi开关处于开启状态的情况下,继续判断扫描结果列表是否为空。在确定扫描结果列表不为空的情况下,清空扫描结果列表为空的累计次数,并重新执行监听是否有WiFi扫描结果的广播的操作。在确定扫描列表为空的情况下,继续判断当前电子设备所处位置是否处于预设位置集合中。在当前电子设备所处位置未处于预设位置集合中的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在当前电子设备所处位置处于预设位置集合中的情况下,对扫描结果列表为空的累计次数加一。之后,可以继续判断扫描结果列表为空的累计次数是否大于第一阈值,如扫描结果列表为空的累计次数是否大于5。在扫描结果列表为空的累计次数不大于第一阈值的情况下,可以重新执行监听是否有WiFi扫描结果的广播的操作。在扫描结果列表为空的累计次数大于第一阈值的情况下,表明满足第一条件的次数大于第一阈值,即可以确定WiFi芯片异常,或者说可以确定当前场景为WiFi芯片异常的场景,电子设备,如电子设备的处理器可以设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。
需要说明的是,第一条件中的各参数判断并没有先后执行顺序的限制。在图6示例中先判断WiFi扫描结果,再判断WiFi开关状态,再判断扫描结果列表,最后判断
电子设备当前所处位置的位置信息,只是示例性的展示了一种执行顺序,在此不做唯一限定。
实施例二
在WiFi芯片进行扫描后,扫描结果为扫描失败,且扫描失败的原因是预设原因场景中,电子设备,如电子设备的处理器可以基于WiFi芯片的信息来对WiFi芯片的标志位进行设置。如,在WiFi芯片的信息用于指示WiFi芯片异常的情况下,设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。其中,具体过程可以如下所示:
在一些实施例中,电子设备,如电子设备的处理器可以基于WiFi芯片的WiFi扫描结果来确定WiFi芯片是否异常,或者说确定当前场景是否为WiFi芯片异常场景。例如,在WiFi芯片的WiFi扫描结果为WiFi芯片扫描失败,且扫描失败的原因为预设原因的情况下,确定WiFi芯片异常。例如,电子设备,如电子设备的处理器可以在确定WiFi扫描结果为扫描失败的情况下,继续判断造成扫描失败的原因,从而根据扫描失败的原因确定是否需要通过控制WiFi芯片下电来使其自愈。之所以判断扫描失败的原因是因为造成WiFi芯片扫描失败的原因多种多样,而在扫描失败的原因为预设原因的情况下,才能够通过触发WiFi芯片下电让其自愈。作为一种示例,预设原因可以是1,22,95,100。其中,预设原因1对应的是无权操作(Operation not permitted,EPERM)。预设原因22对应的是参数无效(Invalid argument,EINVAL)。预设原因95对应的是传输端点不支持操作(Operation not supported on transport endpoint,EOPNOTSUPP)。预设原因100对应的是网络已宕(Network is down,ENETDOWN)。所以,在本申请实施例中,可以在确定WiFi芯片的WiFi扫描结果用于指示WiFi芯片扫描失败,且扫描失败的原因为预设原因的情况下,设置WiFi芯片的标志位为第一值,用于指示WiFi芯片异常,以便可以通过控制WiFi芯片下电来使其自愈。
作为一种示例,如图7所示,基于WiFi芯片的WiFi扫描结果,确定当前场景是否为WiFi芯片异常场景,或者说确定当前场景是否为WiFi芯片扫描失败场景的具体流程如下:
电子设备,如电子设备的处理器可以确定WiFi芯片的WiFi扫描结果是否为扫描失败。如,电子设备的处理器可以判断在预设时间内是否监听到WiFi扫描结果的广播,若在预设时间内未监听到扫描结果的广播,则可确定扫描失败。在确定WiFi芯片的WiFi扫描结果为扫描失败的情况下,确定扫描失败的原因(如,Handle wifi condsc an fail)。接着,判断扫描失败的原因是否为预设原因。在扫描失败的原因不为预设原因的情况下,可以重新判断WiFi芯片的WiFi扫描结果是否为扫描失败。在扫描失败的原因为预设原因的情况下,可以确定WiFi芯片异常,或者说可以确定当前场景为WiFi芯片异常场景,电子设备,如电子设备的处理器可以设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。
在另一些实施例中,电子设备,如电子设备的处理器可以基于WiFi芯片的WiFi扫描结果,多次确定WiFi扫描结果是否为扫描失败且失败原因是否为预设原因,即确定WiFi扫描结果为扫描失败且失败原因为预设原因的次数是否大于第二阈值,以此认为WiFi芯片的信息用于指示WiFi芯片异常。基于此,可以设置WiFi芯片的标志位为第一值。其中,WiFi芯片的WiFi扫描结果的具体描述可以参照上述实施例对应内
容的描述,在此不再赘述。
结合图7,如图8所示,对该实施例进行举例说明。如图8所示,电子设备,如电子设备的处理器可以确定WiFi芯片的WiFi扫描结果是否为扫描失败,如在预设时长内未监听到WiFi扫描结果的广播,则认为扫描失败。在确定WiFi芯片的WiFi扫描结果为扫描失败的情况下,确定扫描失败的原因。接着,判断扫描失败的原因是否为预设原因。在扫描失败的原因不为预设原因的情况下,清空扫描失败的原因累计次数,并重新执行确定WiFi芯片的WiFi扫描结果是否为扫描失败的操作。在扫描失败的原因为预设原因的情况下,对扫描失败的原因累计次数加一,继续判断扫描失败的原因累计次数是否大于第二阈值,如扫描失败的原因累计次数是否大于3。在扫描失败的原因累计次数小于第二阈值的情况下,可以重新执行确定WiFi芯片的WiFi扫描结果是否为扫描失败的操作。在扫描失败的原因累计次数大于第二阈值的情况下,表明扫描失败且失败原因为预设原因的次数大于第二阈值,即可以确定WiFi芯片异常,或者说可以确定当前场景为WiFi芯片异常的场景,电子设备,如电子设备的处理器可以设置WiFi芯片的标志位为第一值,用于指示需要WiFi芯片下电。
需要说明的是,在扫描失败的原因累计次数等于第二阈值的情况下,可以认为WiFi芯片异常,即执行设置标志位为第一值的操作,也可以重新执行确定WiFi芯片的WiFi扫描结果是否为扫描失败的操作,本申请实施例在此对原因累计次数等于第二阈值时,电子设备执行的操作不做具体限制,可以根据实际应用场景的需要进行设置。
其中,可以理解的是,通过上述实施例一和实施例二,电子设备,如电子设备的处理器可以在满足条件的情况下,将WiFi芯片的标志位设置为第一值,如可以将第一值设置为true,以便指示需要WiFi芯片下电。那么,通过执行图3所示的实施例,便可在WiFi芯片的标志位被设置为第一值的情况下,达到控制WiFi芯片下电使其自愈的目的。另外,电子设备,如电子设备的处理器可以在控制WiFi芯片下电之后,便控制其上电。或者,还可以是在控制WiFi芯片下电之后的预设时间后控制其上电。本申请实施例在此对控制WiFi芯片下电后,重新控制WiFi芯片上电的时机及触发条件不作具体限定。另外,继续结合图3,在控制WiFi芯片下电之后,电子设备,如电子设备的处理器可以设置标志位为第二值,如设置第二值为flase,用于指示不需要WiFi芯片下电。
需要说明的是,在实施例一和实施例二中,是以在满足相应条件后通过设置标志位,以便能够基于标志位控制WiFi芯片下电为例进行说明的。在其他一些实施例中,也可以是在确定满足相应的条件后,便控制WiFi芯片下电。例如,可以在确定满足上述第一条件或满足上述第一条件的次数大于第一阈值的情况下,电子设备,如电子设备的处理器控制WiFi芯片下电。又例如,可以在确定WiFi扫描结果为扫描失败,且失败的原因为预设原因的情况下,控制WiFi芯片下电。
实施例三
上述实施例中的两种WiFi芯片异常场景,用户不一定有感知。实际使用中,用户有可能能够感知到异常。如用户在之前使用手机连接过家里的WiFi网络,但是用户当前在家中且WiFi开关处于开启状态手机却无法接入家里的WiFi网络。在这种情况下,用户一般会通过手动操作WiFi开关,来尝试恢复WiFi功能。但用户通过手动操作
WiFi开关可能并不能恢复WiFi功能。因此本申请实施例中,在用户手动操作WiFi开关的情况下,可判断当前场景是否为WiFi芯片异常场景,并在当前场景为WiFi芯片异常场景的情况下,控制WiFi芯片下电来实现自愈。
以下,结合图9来介绍电子设备实现WiFi芯片的自愈的具体流程。如图9所示,图9位本申请实施例提供另一种WiFi芯片的控制方法流程示意图,该方法包括S901-S902。
S901.获取WiFi芯片的信息;WiFi芯片的信息包括WiFi芯片的WiFi开关的变化信息,WiFi开关的状态信息,缓存的WiFi芯片的扫描结果列表和缓存的WiFi芯片的扫描结果列表的时间戳。
在用户连接WiFi网络的过程中,往往会存在无法连接的情况,用户可能会手动在设置界面上对WiFi开关进行操作,从而尝试能够正常连接WiFi网络。为了能保证WiFi芯片的正常工作,在本申请一些实施例中,电子设备,如电子设备的处理器可以获取WiFi芯片的信息,即执行S901,以确定WiFi芯片是否发生异常,或者说判断当前场景是否为WiFi芯片异常场景,从而保证用户使用WiFi时的上网体验。
其中,WiFi芯片的信息可以包括WiFi芯片的WiFi开关的变化信息,WiFi开关的状态信息,缓存的WiFi芯片的扫描结果列表和缓存的WiFi芯片的扫描结果列表的时间戳。其中,WiFi芯片开关的变化信息是指电子设备设置界面的WiFi开关的状态是否发生变化,如WiFi开关由开启状态变成关闭状态,或者WiFi开关由关闭状态变成开启状态。WiFi芯片的WiFi开关的状态信息是指在WiFi开关处于开启状态或关闭状态。缓存的WiFi芯片的扫描结果列表是指在电子设备的缓存中存储的WiFi扫描结果列表,也就是上一次WiFi芯片扫描到的WiFi网络的扫描结果列表。上述时间戳可以是指在电子设备的缓存中存储扫描结果列表的时间或者说,扫描结果列表的缓存时间。如,在扫描结果列表包括多个扫描到的WiFi网络的信息的情况下,该扫描结果列表的缓存时间,即上述时间戳可以为扫描到第一个WiFi网络的时间。例如,扫描结果列表中包括两个WiFi网络的信息,分别为WiFi1和WiFi2。扫描到WiFi1的时间为12:02,扫描到WiFi2的时间为12:03,则扫描结果列表的缓存时间为12:02,也就是说时间戳为12:02。
S902.响应于WiFi芯片的信息用于指示WiFi芯片异常,控制WiFi芯片下电。
在上述S901中获取到WiFi芯片的信息用于指示WiFi芯片异常的情况下,电子设备,如电子设备的处理器可以控制WiFi芯片下电。
在本申请的一些实施例中,电子设备,如电子设备的处理器可以基于WiFi芯片的信息确定WiFi芯片是否异常,或者说确定当前场景是否为WiFi芯片异常场景。在WiFi开关的变化信息用于指示WiFi开关的状态发生变化,WiFi开关的状态信息用于指示WiFi开关处于关闭状态,扫描结果列表不为空和时间戳大于预设阈值的情况下,可以认为WiFi芯片的信息用于指示WiFi芯片异常。也就是说,电子设备,如电子设备的处理器可以获取WiFi芯片的WiFi开关的变化信息,WiFi开关的状态信息,缓存的WiFi芯片的扫描结果列表和缓存的WiFi芯片的扫描结果列表的时间戳。在WiFi开关的状态发生变化,WiFi开关的状态信息用于指示WiFi开关处于关闭状态,扫描结果列表不为空和时间戳大于预设阈值的情况下,电子设备,如电子设备的处理器可
以确定WiFi芯片的信息用于指示所述WiFi芯片异常。基于此,电子设备,如电子设备的处理器可以控制WiFi芯片下电。
需要说明的是,WiFi芯片的WiFi开关的变化信息,WiFi开关的状态信息,缓存的WiFi芯片的扫描结果列表和缓存的WiFi芯片的扫描结果列表的时间戳的判断并没有先后顺序的限制。作为一种示例,如图10所示,基于WiFi芯片的信息,确定当前场景为WiFi芯片异常场景的具体流程可以如下:
电子设备,如电子设备的处理器可以先监听WiFi开关的变化信息,如电子设备处理器可以监听是否有用于指示WiFi开关状态发生变化的广播。在未监听用于指示WiFi开关状态发生变化的广播的情况下,重新执行监听WiFi开关状态的变化信息的操作。在监听到用于指示WiFi开关状态发生变化的广播的情况下,电子设备,如电子设备的处理器可以获取WiFi开关的状态信息,以便进一步判断WiFi开关是否处于关闭状态。在确定WiFi开关处于开启状态的情况下,重新执行监听WiFi开关状态的变化信息的操作。在确定WiFi开关的状态处于关闭状态的情况下,电子设备,如电子设备的处理器可以获取缓存的WiFi芯片的扫描结果列表,进而判断缓存的WiFi芯片的扫描结果列表是否为空。在缓存的WiFi芯片的扫描结果列表为空的情况下,重新执行监听WiFi开关状态的变化信息的操作。在获取到的缓存的WiFi芯片的扫描结果列表不为空的情况下,进而判断缓存的WiFi芯片的扫描结果列表的时间戳是否大于预设阈值,如判断时间戳是否大于20s。在上述时间戳大于预设阈值的情况下,电子设备,如电子设备的处理器控制WiFi芯片下电。
需要说明的是,在上述时间戳等于预设阈值的情况下,电子设备,如电子设备的处理器可以认为WiFi芯片异常,即执行控制WiFi芯片下电的操作,也可以重新执行监听WiFi开关状态的变化信息的操作,本申请实施例在此对时间戳等于预设阈值时,电子设备执行的操作不做具体限制,可以根据实际应用场景的需要进行设置。
其中,上述预设阈值可以根据经验值设置的。具体的,预设阈值可以设置为大于扫描周期的一个值,在此不作唯一限定。
需要说明的是,上述的实施例中以电子设备中的处理器为例对本申请方案的执行过程进行了说明,执行本申请方案过程的也可以是电子设备中的其他器件,在此不作具体限制。
综上,在上述三种出现WiFi芯片异常的场景中,可以通过控制WiFi芯片下电,实现WiFi芯片在一定时间内自愈,从而保证用户WiFi功能的正常使用,提高用户的上网体验感。
本申请另一些实施例提供了一种电子设备,该电子设备可以包括:存储器、WiFi芯片和一个或多个处理器。该存储器、WiFi芯片和处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,电子设备可执行上述方法实施例中执行的各个功能或者步骤。该电子设备的结构可以参考图2所示的电子设备以手机为例的结构。
本申请实施例还提供一种芯片系统,如图11所示,该芯片系统1100包括至少一个处理器1101和至少一个接口电路1102。处理器1101和接口电路1102可通过线路互联。例如,接口电路1102可用于从其它装置(例如电子设备的存储器)接收信号。
又例如,接口电路1102可用于向其它装置(例如处理器1101)发送信号。示例性的,接口电路1102可读取存储器中存储的指令,并将该指令发送给处理器1101。当所述指令被处理器1101执行时,可使得电子设备执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
本申请实施例还提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在上述电子设备上运行时,使得该电子设备执行上述方法实施例中电子设备执行的各个功能或者步骤。
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中电子设备执行的各个功能或者步骤。
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
Claims (12)
- 一种无线保真WiFi芯片的控制方法,其特征在于,应用于包括WiFi芯片的电子设备,所述方法包括:获取所述WiFi芯片的标志位,所述标志位用于指示是否需要所述WiFi芯片下电;响应于所述标志位用于指示需要所述WiFi芯片下电,控制所述WiFi芯片下电。
- 根据权利要求1所述的方法,其特征在于,在所述控制所述WiFi芯片下电之前,所述方法还包括:监听到灭屏广播。
- 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:获取所述WiFi芯片的信息,所述WiFi芯片的信息包括:所述WiFi芯片的WiFi扫描结果,所述WiFi芯片的WiFi开关的状态信息,和所述WiFi芯片的扫描结果列表;响应于所述WiFi芯片的信息用于指示所述WiFi芯片异常,设置所述标志位为第一值,用于指示需要所述WiFi芯片下电。
- 根据权利要求3所述的方法,其特征在于,在满足第一条件或满足第一条件的次数大于第一阈值的情况下,所述WiFi芯片的信息用于指示所述WiFi芯片异常;所述第一条件包括:所述WiFi扫描结果用于指示所述WiFi芯片扫描成功,所述WiFi开关的状态信息用于指示所述WiFi开关处于开启状态,和所述扫描结果列表为空。
- 根据权利要求4所述的方法,其特征在于,所述第一条件还包括:所述电子设备当前所处位置的位置信息用于指示所述电子设备处于预设位置集合中。
- 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:获取所述WiFi芯片的WiFi扫描结果;响应于所述WiFi扫描结果用于指示所述WiFi芯片异常,设置所述标志位为第一值,用于指示需要所述WiFi芯片下电。
- 根据权利要求6所述的方法,其特征在于,在所述WiFi扫描结果用于指示所述WiFi芯片扫描失败,且扫描失败的原因为预设原因的情况下,所述WiFi扫描结果用于指示所述WiFi芯片异常;或,在所述WiFi扫描结果用于指示所述WiFi芯片扫描失败,且扫描失败的原因为预设原因的次数大于第二阈值的情况下,所述WiFi扫描结果用于指示所述WiFi芯片异常。
- 根据权利要求1-7中任一项所述的方法,其特征在于,在所述控制所述WiFi芯片下电之后,所述方法还包括:设置所述标志位为第二值,用于指示不需要所述WiFi芯片下电。
- 一种无线保真WiFi芯片的控制方法,其特征在于,应用于包括WiFi芯片的电子设备,所述方法包括:获取所述WiFi芯片的信息;所述WiFi芯片的信息包括所述WiFi芯片的WiFi开关的变化信息,所述WiFi开关的状态信息,缓存的所述WiFi芯片的扫描结果列表和缓存的所述WiFi芯片的扫描结果列表的时间戳;响应于所述WiFi芯片的信息用于指示所述WiFi芯片异常,控制所述WiFi芯片下电。
- 根据权利要求9所述的方法,其特征在于,在所述WiFi开关的变化信息用于指示所述WiFi开关的状态发生变化,所述WiFi开关的状态信息用于指示所述WiFi开关处于关闭状态,所述扫描结果列表不为空和所述时间戳大于预设阈值的情况下,所述WiFi芯片的信息用于指示所述WiFi芯片异常。
- 一种电子设备,其特征在于,所述电子设备包括:存储器、WiFi芯片和一个或多个处理器;所述存储器、所述WiFi芯片与所述处理器耦合;其中,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;当所述计算机指令被所述处理器执行时,使得所述电子设备执行如权利要求1-10中任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,包括计算机指令;当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-10中任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311735273.6A CN120201474A (zh) | 2023-12-15 | 2023-12-15 | 一种WiFi芯片的控制方法及电子设备 |
| CN202311735273.6 | 2023-12-15 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025123735A1 true WO2025123735A1 (zh) | 2025-06-19 |
Family
ID=96056403
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/111564 Pending WO2025123735A1 (zh) | 2023-12-15 | 2024-08-12 | 一种WiFi芯片的控制方法及电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN120201474A (zh) |
| WO (1) | WO2025123735A1 (zh) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150312857A1 (en) * | 2014-04-29 | 2015-10-29 | Samsung Electronics Co., Ltd. | Apparatus and method for controlling communication module |
| CN109032826A (zh) * | 2018-06-22 | 2018-12-18 | 北京蜂盒科技有限公司 | WiFi故障恢复方法,装置,存储介质和电子设备 |
| CN116668583A (zh) * | 2023-08-02 | 2023-08-29 | 荣耀终端有限公司 | 一种WiFi的连接方法、电子设备、存储介质和芯片 |
| CN116700802A (zh) * | 2022-11-15 | 2023-09-05 | 荣耀终端有限公司 | 指纹模组的控制方法和控制装置 |
| CN116866968A (zh) * | 2023-05-11 | 2023-10-10 | 深圳市酷开网络科技股份有限公司 | 一种WiFi切换崩溃的检测方法及相关设备 |
-
2023
- 2023-12-15 CN CN202311735273.6A patent/CN120201474A/zh active Pending
-
2024
- 2024-08-12 WO PCT/CN2024/111564 patent/WO2025123735A1/zh active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150312857A1 (en) * | 2014-04-29 | 2015-10-29 | Samsung Electronics Co., Ltd. | Apparatus and method for controlling communication module |
| CN109032826A (zh) * | 2018-06-22 | 2018-12-18 | 北京蜂盒科技有限公司 | WiFi故障恢复方法,装置,存储介质和电子设备 |
| CN116700802A (zh) * | 2022-11-15 | 2023-09-05 | 荣耀终端有限公司 | 指纹模组的控制方法和控制装置 |
| CN116866968A (zh) * | 2023-05-11 | 2023-10-10 | 深圳市酷开网络科技股份有限公司 | 一种WiFi切换崩溃的检测方法及相关设备 |
| CN116668583A (zh) * | 2023-08-02 | 2023-08-29 | 荣耀终端有限公司 | 一种WiFi的连接方法、电子设备、存储介质和芯片 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120201474A (zh) | 2025-06-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108476060B (zh) | 用于双模蓝牙设备之间建立经典蓝牙连接的方法和双模蓝牙设备 | |
| US20120316811A1 (en) | Apparatus and method for determining a remaining battery life of a portable terminal | |
| KR20150026652A (ko) | 전자장치에서 수신된 정보를 사용자에게 제공하기 위한 방법 및 장치 | |
| EP2649859B1 (en) | Automatically enabling wireless communication | |
| WO2023284415A1 (zh) | 电源键误触检测方法及电子设备 | |
| CN110837343B (zh) | 处理快照的方法、装置及终端 | |
| CN110225576A (zh) | 一种开机控制方法与电子设备 | |
| US11816200B2 (en) | Terminal and method for managing launch of an application of a terminal | |
| CN107231434A (zh) | 终端设备的控制方法及装置 | |
| CN115562570A (zh) | 数据迁移方法、系统及电子设备 | |
| KR20150086932A (ko) | 데이터 처리 방법 및 그 전자 장치 | |
| CN112269086A (zh) | 充电线缆的识别方法、装置、充电线缆及可读存储介质 | |
| CN114980045B (zh) | 蓝牙连接方法及电子设备 | |
| CN112866983B (zh) | 控制方法、控制装置以及电子设备 | |
| EP4683396A1 (en) | Resource scheduling method and apparatus | |
| CN112566086A (zh) | 数据传输方法、装置、电子设备及可读存储介质 | |
| CN113282361B (zh) | 一种窗口的处理方法及电子设备 | |
| CN114143765B (zh) | 蓝牙回连方法、装置和存储介质 | |
| CN120201474A (zh) | 一种WiFi芯片的控制方法及电子设备 | |
| CN117254539A (zh) | 充电方法及电子设备 | |
| CN116662024B (zh) | 进程间通信监控方法、装置、电子设备及存储介质 | |
| WO2025148709A1 (zh) | 一种Wi-Fi漫游的控制方法、电子设备及计算机可读存储介质 | |
| CN117135263B (zh) | 日志信息获取方法、电子设备及计算机可读存储介质 | |
| CN118474239B (zh) | 一种用户标识模块sim卡的上电方法及电子设备 | |
| CN117135600B (zh) | 一种蓝牙广播请求的处理方法及设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24902161 Country of ref document: EP Kind code of ref document: A1 |