WO2024255345A1 - 一种降低功耗的方法、设备和系统 - Google Patents

一种降低功耗的方法、设备和系统 Download PDF

Info

Publication number
WO2024255345A1
WO2024255345A1 PCT/CN2024/081171 CN2024081171W WO2024255345A1 WO 2024255345 A1 WO2024255345 A1 WO 2024255345A1 CN 2024081171 W CN2024081171 W CN 2024081171W WO 2024255345 A1 WO2024255345 A1 WO 2024255345A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
wifi
chip
abnormal
beacon frame
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.)
Ceased
Application number
PCT/CN2024/081171
Other languages
English (en)
French (fr)
Other versions
WO2024255345A9 (zh
Inventor
马红阳
侯添译
赵辰
方晓龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of WO2024255345A1 publication Critical patent/WO2024255345A1/zh
Publication of WO2024255345A9 publication Critical patent/WO2024255345A9/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. Transmission Power Control [TPC] or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • H04W52/0274Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. Transmission Power Control [TPC] or power classes
    • H04W52/02Power saving arrangements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of electronic technology, and in particular to a method, device and system for reducing power consumption.
  • Wi-Fi routers are used to provide Wi-Fi network services to various electronic devices within the coverage of Wi-Fi signals. Electronic devices can access Wi-Fi networks through Wi-Fi routers.
  • the WiFi chip of the electronic device may not sleep and the operating system of the electronic device may be frequently woken up, resulting in high power consumption and significant power consumption of the electronic device.
  • the present application provides a method, device and system for reducing power consumption, in which the electronic device can determine the chip status of the WiFi chip based on the received beacon frame, and then turn off the WiFi function when the WiFi chip is abnormal.
  • the method can avoid the situation where the WiFi chip does not sleep or the sleep time is short when the WiFi chip is abnormal, thereby effectively reducing the serious power consumption caused by the WiFi abnormality.
  • an embodiment of the present application provides a method for reducing power consumption, which is applied to an electronic device, wherein the electronic device includes a wireless fidelity WiFi chip, and the WiFi chip is used to implement a WiFi function.
  • the method includes:
  • the electronic device receives a beacon frame sent by a wireless access point
  • the electronic device determines a chip state of the WiFi chip based on the received beacon frame
  • the WiFi function of the electronic device is turned off.
  • the electronic device can identify whether the chip status of the WiFi chip is abnormal based on the beacon frame (i.e., beacon frame), wherein the abnormal chip status includes the chip not being in sleep mode, the sleep time being too short, and being frequently awakened, etc.
  • This method can reduce the power consumption and power consumption of the electronic device.
  • the method provided in the embodiment of the present application can reduce the nighttime standby power consumption, and after successful control, there will be a benefit of more than 20mA.
  • the specific benefit depends on the wake-up frequency and system status before control.
  • turning off the WiFi function of the electronic device may be that the electronic device powers off a Wi-Fi chip.
  • the beacon frame includes a data transmission indication information TIM bit
  • the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
  • the electronic device does not receive any data within a first time period after receiving a beacon frame with a TIM bit set, and determines that the TIM bit of the beacon frame is wrong; the beacon frame with a TIM bit set is used to indicate that the wireless access point will send data to the electronic device;
  • the chip state is an abnormal state.
  • the TIM bit being set may also be referred to as TIM bit being set.
  • the electronic device can identify frequent setting errors of the TIM bit in the beacon frame, and then turn off the WiFi function. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent setting errors of the TIM bit, thereby reducing the power consumption and power consumption of the electronic device.
  • the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
  • the electronic device calculates the ratio of the number of beacon frames received in the third time period to the preset number of frames to obtain a beacon frame reception rate
  • the electronic device determines that the chip state is an abnormal state.
  • an electronic device receives a small number of beacon frames, the WiFi chip will work for a long time, resulting in serious power consumption of the electronic device.
  • an electronic device with a reception rate of less than 60% can be called a problem user, and the power consumption of the problem user from 0 to 6 o'clock is about 7% to 8%.
  • the embodiment of the present application can identify the problem user and turn off the WiFi when several conditions are met (such as the data switch is turned on and/or there is no perceptible service as shown in Figure 4), which can avoid the WiFi chip from working for a long time and effectively reduce the power consumption of the electronic device.
  • the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
  • the electronic device acquires first data, where the first data includes at least one of a sending frequency of a broadcast key update frame, a sending frequency of a block request frame, a link disconnection frequency, a sending frequency of an aggregated multicast packet, and a filtered message condition;
  • the electronic device determines that at least one of the received beacon frame and the first data is abnormal, it determines that the chip state is an abnormal state.
  • the electronic device can identify any abnormal situation of the received beacon frames, the sending frequency of the broadcast key update frames, the sending frequency of the block request frames, the link disconnection frequency, the sending frequency of the aggregated multicast packets and the filtered message conditions, and then turn off the WiFi function.
  • This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short, thereby reducing the power consumption and power consumption of the electronic device.
  • the method further includes:
  • the electronic device determines that the received beacon frame is abnormal.
  • the method further includes:
  • the electronic device receives a broadcast key update frame sent by a wireless access point
  • the electronic device determines that the sending frequency of the broadcast key update frames is abnormal, where N is a positive integer.
  • the electronic device can identify whether the wireless access point frequently sends broadcast key update frames, and then turn off the WiFi function when the broadcast key update frames are frequently received. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent reception of broadcast key update frames, thereby reducing the power consumption and power consumption of the electronic device.
  • the method further includes:
  • the electronic device receives a block request frame sent by a wireless access point
  • the electronic device determines that the sending frequency of the block request frame is abnormal, where M is a positive integer.
  • the electronic device can identify whether the wireless access point frequently sends block request frames, and then turn off the WiFi function when the block request frames are frequently received. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent reception of block request frames, thereby reducing the power consumption and power consumption of the electronic device.
  • the method further includes:
  • the electronic device determines that the sending frequency of the aggregated multicast packets is abnormal, where K is a positive integer.
  • the electronic device can identify whether the wireless access point frequently sends aggregated multicast packets, and then turn off the WiFi function when the aggregated multicast packets are frequently received. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent reception of aggregated multicast packets, thereby reducing the power consumption and power consumption of the electronic device.
  • the method further includes:
  • the electronic device turns on the Android packet filtering APF function; the Android packet filtering APF function is used to filter broadcast packets and multicast packets;
  • the electronic device receives a data packet sent by a wireless access point, the data packet including a broadcast packet and a multicast packet;
  • the electronic device determines that the filtered message situation is abnormal, and L is a positive integer.
  • the electronic device may automatically enable the Android packet filtering APF function when the WiFi function is enabled.
  • the electronic device can identify whether the filtered message situation is abnormal, and turn off the WiFi function when the WiFi chip is frequently awakened by the unfiltered messages, thereby reducing the power consumption and power consumption of the electronic device.
  • the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
  • the electronic device After entering the sleep mode, the electronic device determines the chip state of the WiFi chip based on the received beacon frame.
  • the electronic device may enter the sleep mode when it recognizes that the user is in a sleep state.
  • the electronic device may exit the sleep mode when it recognizes through a sensor that its position has moved or the surrounding brightness has changed.
  • the WiFi monitoring function i.e., determining the chip status of the WiFi chip as described above
  • the WiFi monitoring function is activated only when the user is in a sleep state. This method can avoid network interruptions that affect user use during the user's use of the electronic device, and reduce the problem of excessive power consumption caused by WiFi anomalies when the user is in a sleep state.
  • the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
  • the electronic device determines whether the mobile network of the electronic device is turned on
  • the chip status of the WiFi chip is determined based on the received beacon frame.
  • the electronic device starts the WiFi monitoring function (i.e., the chip status of the WiFi chip is determined as mentioned above) only when the mobile network is turned on.
  • This can avoid turning off the WiFi when the data service switch is turned off, resulting in the electronic device not being connected to the Internet, and the electronic device's time, location, and other data that need to be updated online cannot be updated, thereby affecting the user experience.
  • This method can ensure that the electronic device can at least be connected to the Internet through cellular data during the WiFi management and control process, and the electronic device will not be disconnected from the Internet, thereby ensuring the user experience effect.
  • the method further includes:
  • the electronic device may exit the sleep mode when recognizing that the user switches from the sleep state to the non-sleep state.
  • the electronic device can turn on the WiFi function after recognizing that the user has exited the sleep state to meet the user's network needs.
  • turning off the WiFi function of the electronic device includes:
  • the electronic device determines the execution status of the first service when the chip status of the WiFi chip is in an abnormal status; the first service is a service that cannot be executed when the WiFi function is turned off;
  • the WiFi function of the electronic device is turned off.
  • not shutting down the WiFi can ensure that the perceptible service is not interrupted, and can avoid affecting the user experience after the perceptible service is interrupted.
  • the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
  • the electronic device periodically obtains the chip status of the WiFi chip through the WiFi driver.
  • the electronic device can periodically monitor the chip status of the WiFi chip when the WiFi function is turned on.
  • the WiFi chip is abnormal at any time during the entire process, the WiFi can be managed, thereby effectively reducing the power consumption of the electronic device and avoiding serious power consumption.
  • the electronic device can periodically monitor the chip status of the WiFi chip after entering the sleep mode, and manage the WiFi when an abnormality occurs in the WiFi chip at any time during the entire process, thereby effectively reducing the power consumption of the electronic device and avoiding severe power consumption.
  • the method further includes:
  • the electronic device stops periodically obtaining the chip status of the WiFi chip through the WiFi driver.
  • the electronic device can periodically perform WiFi monitoring on the chip status of the WiFi chip when the WiFi function is turned on. Then, the electronic device can stop periodically performing WiFi monitoring on the chip status of the WiFi chip when the WiFi function is turned off, thereby reducing the power consumption of the electronic device.
  • the present application provides an electronic device, the electronic device comprising a processor and a WiFi chip; wherein:
  • the processor is used to enable the WiFi function
  • the WiFi chip is used to receive beacon frames sent by a wireless access point when the WiFi function is turned on;
  • the WiFi chip is used to determine the chip state of the WiFi chip based on the received beacon frame; the WiFi chip is also used to notify the processor when the chip state is abnormal;
  • the processor is used to turn off the WiFi function when the chip status is abnormal.
  • the electronic device can identify whether the chip status of the WiFi chip is abnormal based on the beacon frame, wherein the abnormal chip status includes the chip not being in sleep mode, the sleep time being too short, and being frequently awakened, etc. This method can reduce the power consumption and power consumption of the electronic device.
  • the method provided in the embodiment of the present application can reduce the nighttime standby power consumption, and after successful control, there will be a benefit of more than 20mA.
  • the specific benefit depends on the wake-up frequency and system status before control.
  • the beacon frame includes a data to be transmitted indication information TIM bit, and the WiFi chip is specifically used for:
  • the beacon frame with the TIM bit set After receiving the beacon frame with the TIM bit set, no data is received within a first time period, determining that the TIM bit of the beacon frame is wrong; the beacon frame with the TIM bit set is used to indicate that the wireless access point will send data to the electronic device;
  • the chip state is an abnormal state.
  • the WiFi chip is specifically used for:
  • the beacon frame receiving rate is lower than a preset receiving rate, it is determined that the chip state is an abnormal state.
  • the electronic device can identify frequent setting errors of the TIM bit in the beacon frame, and then turn off the WiFi function. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent setting errors of the TIM bit, thereby reducing the power consumption and power consumption of the electronic device.
  • the WiFi chip is specifically used for:
  • the first data including at least one of a sending frequency of a broadcast key update frame, a sending frequency of a block request frame, a link disconnection frequency, a sending frequency of an aggregated multicast packet, and a filtered message condition;
  • the chip state is determined to be an abnormal state.
  • the electronic device can identify any abnormal situation of the sending frequency of the broadcast key update frame, the sending frequency of the block request frame, the link disconnection frequency, the sending frequency of the aggregated multicast packet and the filtered message status, and then turn off the WiFi function.
  • This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short, thereby reducing the power consumption and power consumption of the electronic device.
  • the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.
  • an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions so that the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.
  • the present application provides a computer-readable storage medium comprising instructions.
  • the instructions When the instructions are executed on an electronic device, the electronic device executes the method described in the first aspect and any possible implementation manner of the first aspect.
  • the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.
  • the electronic devices provided in the second and third aspects, the chip system provided in the fourth aspect, the computer storage medium provided in the fifth aspect, and the computer program product provided in the sixth aspect are all used to execute the Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods, which will not be repeated here.
  • FIG1 is a schematic diagram of an application scenario exemplarily shown in an embodiment of the present application.
  • FIG2 is a schematic diagram of the hardware structure of an electronic device exemplarily provided in an embodiment of the present application.
  • FIG3 is a schematic block diagram of a system architecture of an electronic device 100 exemplarily provided in an embodiment of the present application
  • FIG4 is a flow chart of a method for reducing power consumption exemplarily provided in an embodiment of the present application.
  • FIG5 is a flow chart of another method for reducing power consumption provided by an embodiment of the present application.
  • 6A to 6C are user interfaces for enabling a “power saving” function of an electronic device provided by an embodiment of the present application
  • 7A to 7C are user interfaces for enabling a “power saving” function of another electronic device provided in an embodiment of the present application.
  • FIG. 1 is a schematic diagram of an application scenario exemplarily shown in an embodiment of the present application.
  • the scenario includes an electronic device 100 and a routing device 200.
  • the electronic device 100 is a device with a Wi-Fi function, that is, the electronic device 100 supports Wireless Fidelity (WiFi) technology, and can realize wireless network connection through WiFi to send and receive network data; the routing device 200 is used to provide a Wi-Fi hotspot.
  • Wi-Fi Wireless Fidelity
  • the routing device 200 may be a Wi-Fi router that provides a Wi-Fi hotspot
  • the electronic device 100 is a device that includes a Wi-Fi module (or a Wi-Fi chip) and other structures to provide a WiFi function.
  • the electronic device can connect to the routing device 200 through its own Wi-Fi module and communicate with an external network through the routing device 200.
  • Wi-Fi is abbreviated as WiFi in the following embodiments, such as a Wi-Fi chip or a Wi-Fi module is referred to as a WiFi chip.
  • the electronic device 100 can periodically scan the WiFi signals within the current environment. For example, the electronic device 100 can display one or more currently detected WiFi signals and corresponding signal strength information to the user; in addition, the electronic device 100 can also implement WiFi automatic access and other operations according to the preset WiFi automatic access settings and the saved successfully accessed WiFi accounts.
  • the WiFi function of the electronic device 100 is set to "off” (i.e., the WiFi function is turned off)
  • the electronic device 100 will not scan the WiFi signals within the current environment, saving the power consumption of the device, thereby effectively saving the power consumption of the electronic device 100.
  • the communication messages received by the electronic device 100 from the routing device 200 may include management frames, such as beacon frames, collected data reported by other connected devices that must be forwarded by the routing device 200, and the routing device 200 responding to the detection request of the connected electronic device.
  • management frames such as beacon frames
  • the electronic device 100 may further include a cellular data module, and then the electronic device 100 may communicate with an external network through its own cellular data module.
  • the cellular data module may be the mobile communication module 150 in FIG. 2 .
  • the cellular data module and the WiFi chip may be located in the same hardware module (such as a chip). The above; they can also be separate hardware modules, which is not limited in the embodiments of the present application.
  • the WiFi chip of the electronic device 100 may not be in sleep mode and the operating system of the electronic device 100 may be frequently awakened, resulting in serious power consumption of the electronic device 100.
  • Case 1 The routing device sends a beacon frame.
  • the cycle is inaccurate, causing the WiFi chip to not sleep or sleep for a short time.
  • the routing device may send a management frame, such as a Beacon frame, to the electronic device.
  • a management frame such as a Beacon frame
  • the main reasons for the inaccurate beacon frame period include: the timestamps between the electronic device and the routing device are not aligned, resulting in the electronic device being unable to receive the beacon frame or a large number of beacon frames being unable to be received.
  • the WiFi chip will work for a long time, causing serious power consumption of the electronic device.
  • the power consumption of the electronic device with this problem from 0:00 to 6:00 may be between 7% and 8%.
  • Case 2 The traffic indication map (TIM) bit of the beacon frame sent by the routing device is incorrectly set, and the electronic device mistakenly believes that the wireless access point (AP) side (i.e., the routing device) still has data to send, and the WiFi chip does not sleep.
  • AP wireless access point
  • the TIM bit refers to the association ID assigned when the device is connected to the AP.
  • the routing device When the routing device has data to send to the device, it can set the TIM bit corresponding to the electronic device in the beacon frame (such as setting it to 1). Then, after the electronic device receives the beacon frame and sees that its corresponding TIM is set, it knows that the routing device has data to send to itself, so it wakes up the WiFi chip and waits for the data.
  • the WiFi chip When the TIM bit in the beacon frame is set incorrectly or is always set (the TIM bit is set even if there is no data to send), the WiFi chip will not be powered off, causing serious power consumption problems.
  • the TIM setting problem is the top power consumption problem.
  • the power consumption of electronic devices (problem users) with this problem depends on the error frequency of the incorrect setting. An error frequency of 1 time/s can cause the electronic device to consume more than 10% of its power, and an error frequency of 0.5 times/s can cause the electronic device to consume 5%-7% of its power. It should be understood that the incorrect setting of the TIM bit may be related to factors such as the design of the routing equipment manufacturer.
  • Case 3 The routing device configuration key is updated (rekey) too frequently, frequently waking up the host (host), such as waking up the central processor.
  • the broadcast key of the routing device is generally updated after a specified time interval, and then the updated broadcast key is sent to the electronic device via a broadcast key update frame (group rekey frame, referred to as rekey packet).
  • group rekey frame referred to as rekey packet
  • the routing device will frequently send rekey packets (such as updating every 30 seconds) to the electronic device, causing the WiFi chip sleep interrupt to be awakened, resulting in serious power consumption of the electronic device.
  • the update interval of the broadcast key is a configurable item of the routing device, but since the user is not aware of it and few users know how to reconfigure the configuration item of the routing device to return to normal, this problem affects the power consumption of the electronic device.
  • the update interval of the broadcast key is set very short, which may be caused by reasons such as non-standard routing equipment or setting errors.
  • Case 4 The routing device frequently kicks out the electronic device, which then re-initiates the WiFi connection, causing abnormal power consumption of the electronic device.
  • the router will turn off the electronic device when there is no data flow. (such as a mobile phone) is kicked out, the electronic device and the routing device will be disconnected. Some routing devices will kick the electronic device hundreds of times a night, that is, frequent disconnections. The electronic device will automatically reconnect after being kicked out. This reciprocating process causes serious power consumption problems. Problem users (that is, electronic devices with this problem) generally consume more than 15% of power.
  • Case 5 Block request frames (ADDBA request, referred to as addba req frames) frequently wake up the host.
  • ADDBA request referred to as addba req frames
  • the addba req frame is used to establish a block acknowledgment mechanism (Block Ack), but some routing devices will frequently send addba req action frame requests, causing the host to wake up and the WiFi chip to not sleep. It should be understood that because this is a management frame, the WiFi chip will not filter it, causing the electronic device to consume about 10% of power overnight.
  • Case 6 Aggregate multicast packets frequently wake up the host, and the WiFi chip does not sleep or sleeps for a short time.
  • the aggregation multicast packet can be an aggregation multicast packet (Aggregation MAC Service Data Unit, AMSDU), and the AMSDU multicast packet refers to a data packet aggregated from multiple service data units (MAC Service Data Unit, MSDU).
  • AMSDU aggregation multicast packet
  • MSDU MAC Service Data Unit
  • the WiFi chip side when performing Android Packet Filter (APF) on the WiFi chip side, only a single multicast packet or a single broadcast packet can be filtered; for aggregate frames, the WiFi chip side can only filter small packet aggregate frames of a single network buffer (netbuffer, netbuf), and the IP address header of each subframe is a multicast address or a broadcast address, while aggregate frames of multiple netbufs (large packet aggregation, such as AMSDU multicast packets) or aggregate frames with any subframe whose IP address header is a unicast address cannot be filtered.
  • API Android Packet Filter
  • the user will be frequently awakened, the power consumption when the screen is turned off can reach several hundred milliampere hours (mAh), and the WiFi chip does not sleep or sleeps for a short time, causing the electronic device to consume about 10% of power per night.
  • mAh milliampere hours
  • Case 7 APF filtering message is abnormal, and the chip is still frequently awakened.
  • an embodiment of the present application provides a method for reducing power consumption, which can reduce the serious power consumption problem caused by WiFi anomalies.
  • the electronic device can turn off the WiFi function when the WiFi chip is abnormal.
  • This method can avoid the situation where the WiFi chip does not sleep or the sleep time is short when the WiFi chip is abnormal, thereby effectively reducing the serious power consumption caused by the WiFi abnormality.
  • turning off the WiFi function is also referred to as turning off WiFi below.
  • the electronic device can also perform WiFi abnormality and WiFi monitoring and management when in deep sleep mode, wherein WiFi monitoring is to identify whether the WiFi chip is abnormal, and management includes turning off and on the WiFi function. This method can avoid turning off the WiFi function and affecting the user experience.
  • the electronic device can also perform WiFi abnormality WiFi monitoring and management when no perceptible service is performed, wherein WiFi monitoring is to identify whether the WiFi chip is abnormal, management includes turning off and on the WiFi function, and the perceptible service can be the service that is suspended when the WiFi function is interrupted. This method can avoid affecting the user experience due to turning off the WiFi function.
  • the electronic devices include but are not limited to mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPC), netbooks, etc.
  • Exemplary embodiments of electronic devices include but are not limited to devices equipped with Portable electronic devices running Linux or other operating systems. It is a portable electronic device, such as a laptop computer (Laptop) and the like.
  • Fig. 2 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
  • electronic device 100 is used as an example for description.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 330, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a microphone 170C, a sensor module 180, a camera 193, and a display screen 194.
  • the sensor module 180 may include a touch sensor 180K.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split 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 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural network processor (NPU), etc.
  • AP application processor
  • GPU graphics processor
  • ISP image signal processor
  • controller a memory
  • video codec a digital signal processor
  • DSP digital signal processor
  • NPU neural network processor
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller can be the nerve center and command center of the electronic device 100.
  • the controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
  • a memory can also be set in the processor 110 for storing instructions and data.
  • the internal memory 121 may be used to store computer executable program codes, wherein the executable program codes include instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121 .
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • the mobile communication module 150 can provide a solution for wireless communication including 2G/3G/4G/5G etc. applied to the electronic device 100.
  • the processor 110 can control the mobile communication module 150 to turn on or off the mobile network.
  • the wireless communication module 160 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) and the like for application in the electronic device 100.
  • WLAN Wireless Local Area Networks
  • BT Wireless Fidelity
  • GNSS Global Navigation Satellite System
  • FM Frequency Modulation
  • the electronic device 100 can also provide wireless communication solutions such as Near Field Communication (NFC) and Infrared (IR), which will not be expanded here.
  • NFC Near Field Communication
  • IR Infrared
  • the WiFi chip involved in the embodiment of the present application can be exemplarily a wireless communication module 160 as shown in FIG. 2 .
  • the wireless communication module 160 can include a firmware program (fireware) for identifying whether the chip status of the WiFi chip is abnormal (as shown in steps S17 and S18 in FIG. 4 ).
  • the electronic device 100 implements the display function through the GPU, the display screen 194, and the application processor.
  • a microprocessor for processing connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, etc.
  • the display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a Micro LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image or video visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor.
  • CMOS complementary metal oxide semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image or video signal.
  • the ISP outputs the digital image or video signal to the DSP for processing.
  • the DSP converts the digital image or video signal into an image or video signal in a standard RGB, YUV or other format.
  • the electronic device 100 may include multiple cameras 193.
  • Video codecs are used to compress or decompress digital videos.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG1, MPEG4, etc.
  • MPEG Moving Picture Experts Group
  • the touch sensor 180K is also called a "touch panel”.
  • the touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen”.
  • the touch sensor 180K 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 194.
  • the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the electronic device 100 may also include buttons, motors, indicators, and a subscriber identification module (SIM) card interface, etc.
  • SIM subscriber identification module
  • the sensor module may also include: a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a fingerprint sensor, a temperature sensor, a bone conduction sensor, and the like.
  • the electronic device 100 can execute the method for reducing power consumption through the processor 110 and the wireless communication module 160.
  • FIG3 is a schematic block diagram of the system architecture of an electronic device 100 exemplarily provided in an embodiment of the present application.
  • the system architecture of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
  • the embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
  • the layered architecture divides the system into several layers, each with clear roles and division of labor.
  • the layers communicate with each other through software interfaces.
  • the Android system is divided into four layers, from top to bottom, namely, the application layer (APP layer), the application framework layer (FWK layer), the system layer and the kernel layer.
  • the APP layer may include a series of application packages, such as Power Saving Wizard.
  • the APP layer may run the "Power Saving Wizard" application.
  • the power saving wizard is used to notify the WiFi FWK to start or shut down the WiFi monitoring of the chip status of the WiFi chip, and to notify the WiFi FWK to turn on or off the WiFi function.
  • the power saving wizard can also be used to identify whether the user is in a sleeping state, determine whether the data service switch is turned on, and judge whether a perceptible service is currently being executed.
  • the power saving wizard can intelligently learn user habits, identify whether the user is in sleep mode through the current time, ambient light, the static state of the electronic device 100 and the screen off state, and obtain the status of the mobile phone to determine whether the user has turned on WiFi and data services, has no perceptible services, and other scenarios; turn off WiFi when the WiFi chip abnormal conditions are met, for example, the WiFi chip abnormal conditions may include any of the seven flags listed below being set to 1; restore WiFi (i.e., turn on WiFi) when exiting deep sleep mode or charging, moving, or turning on the screen.
  • the application packages installed by the APP layer may also include gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications (not shown in FIG. 3 ), which are not limited here.
  • the system layer can include multiple functional modules, such as surface manager, media library, 3D image processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
  • functional modules such as surface manager, media library, 3D image processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
  • the surface manager is used to manage the display subsystem and provides the fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc.
  • a 2D graphics engine is a drawing engine for 2D drawings.
  • the FWK layer provides an application programming interface (API) and a programming framework for the applications in the APP layer. As shown in FIG3 , the FWK layer may include a WiFi FWK.
  • API application programming interface
  • the WiFi FWK is used to query the chip status of the WiFi chip from the WiFi driver; send the chip status of the WiFi chip to the power saving wizard when the WiFi chip is abnormal, and turn the WiFi on or off.
  • the FWK layer may include some predefined functions, and may also include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. (not shown in FIG. 3 ).
  • the window manager is used to manage window programs.
  • the window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • the content provider is used to store and obtain data and make the data accessible to applications.
  • the data can include videos, images, audio, calls made and received, browsing history and bookmarks, Phone book, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views. For example, a display interface including a text message notification icon can include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide the communication function of the electronic device 100.
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification type messages and can disappear automatically after a short stay without user interaction.
  • the notification manager is used to notify the completion of downloads, message reminders, etc.
  • the notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, the electronic device 100 vibrates, the indicator light flashes, etc.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes drivers for various hardware, such as the WiFi driver corresponding to the WiFi module.
  • the WiFi driver is used to obtain the chip status of the WiFi chip.
  • the details of how the WiFi driver obtains the chip status of the WiFi chip can be found in the relevant embodiments below, which will not be expanded here.
  • the specific process of obtaining the chip status of the WiFi chip can be implemented by the firmware program (fireware) of the WiFi driver.
  • the kernel layer may also include a camera driver, an audio driver, and a sensor driver.
  • the kernel layer may also include a digital signal processor driver (not shown) and an image processor driver (not shown).
  • the camera driver is used to drive the image sensor of one or more cameras in the camera module to collect images and drive the image signal processor to pre-process the image.
  • the digital signal processor driver is used to drive the digital signal processor to process images.
  • the image processor driver is used to drive the graphics processor to process images.
  • the software architecture may also include a hardware abstraction layer (HAL) not shown in Figure 3.
  • HAL hardware abstraction layer
  • the hardware abstraction layer is an interface layer located between the application framework layer and the kernel layer, providing a virtual hardware platform for the operating system.
  • FIG4 is a flow chart showing a method for reducing power consumption provided by an embodiment of the present application. As shown in FIG4 , the method includes some or all of the following steps:
  • the electronic device may start the WiFi function in response to a user operation.
  • the setting application of the electronic device includes a WiFi switch or the pull-down task bar of the main interface of the electronic device includes a WiFi switch, and the electronic device starts the WiFi function in response to the user operation acting on the WiFi switch, that is, the electronic device can establish a connection with the routing device through the WiFi chip.
  • the power saving wizard may enter a deep sleep mode (also referred to as a night mode or a sleep mode) when determining that the user is in a sleep state.
  • the user may be a user of the electronic device.
  • the power saving wizard can determine whether the user is in a sleeping state through an intelligent night mode algorithm based on information such as the current time, the length of time the smart device is locked, the length of time the smart device is idle, the brightness of the surrounding environment, and the user's historical sleeping habits; when the user is in a sleeping state, the power saving wizard enters a deep sleep mode.
  • Power Saver can use the smart night mode algorithm to determine the user's status every ten minutes. If it determines that the user is currently asleep, it can predict the user's wake-up time based on the user's habits. If the user suddenly unlocks the device while in night mode, the smart night mode algorithm can immediately exit night mode. If the user suddenly turns on the light while in night mode, the smart night mode algorithm can exit night mode at the next determination.
  • the intelligent night mode algorithm is obtained by learning the user's historical sleeping habits, which includes learning the user's sleep start time, wake-up time, ambient light brightness distribution when the user is sleeping, and ambient light brightness distribution when the user is not sleeping in the past period of time.
  • the WiFi monitoring function is activated only when the user is in a sleep state. This method can avoid network interruption during the user's use of the electronic device and affect the user's use, and reduce the problem of excessive power consumption caused by WiFi abnormalities when the user is in a sleep state.
  • the power saving wizard can also start the following steps when the user is not in sleep mode to achieve control of WiFi power consumption (that is, step S11 is not a step that must be executed).
  • step S11 is not a step that must be executed.
  • the embodiments of the present application do not limit the application scenarios.
  • the above-mentioned deep sleep mode scenario is a preferred scenario example provided by the embodiments of the present application and should not constitute a limitation on the embodiments of the present application.
  • S12 The power saving wizard determines whether the data service switch is turned on.
  • step S13 when the data service data switch is not turned on, the power saving wizard executes step S13; when the data service data switch is turned on, the power saving wizard executes step S14.
  • the power saving wizard can determine whether the data service switch is turned on when entering the deep sleep mode.
  • the data service switch is used to turn on cellular data.
  • the data service switch can be a switch in the settings application on the electronic device, such as the "mobile data” switch in the "mobile network”.
  • the data service switch may be shown as the mobile network switch 721 in the user interface in FIG. 7B .
  • the power saving wizard may not determine whether the data service switch is turned on (ie, not execute step S12 ) and directly execute step S14 .
  • the power saving wizard may not execute steps S12 and S13, but directly execute S14, that is, WiFi monitoring and management (referred to as control) of WiFi is performed regardless of whether the data service switch is turned on.
  • the power saving wizard executes the above S12 and S13 to avoid turning off the WiFi when the data service switch is turned off, resulting in the electronic device not being connected to the Internet, and the time, location and other data of the electronic device that need to be updated online cannot be updated, thereby affecting the user experience.
  • This method can ensure that the electronic device can at least be connected to the Internet through cellular data during the WiFi management and control process, and the electronic device will not be disconnected from the Internet, thereby ensuring the user experience effect.
  • the power saving wizard can notify the WiFi FWK to start WiFi monitoring when the data service data switch is turned on.
  • WiFi FWK When WiFi FWK receives the notification from Power Saving Wizard to start WiFi monitoring, it starts WiFi monitoring.
  • WiFi FWK periodically queries the chip status of the WiFi chip.
  • the WiFi FWK when the WiFi FWK receives the notification of starting WiFi monitoring sent by the power saving wizard, it periodically queries the chip status of the WiFi chip.
  • the chip status may include a normal state and an abnormal state; the embodiment of the present application does not limit the cycle duration.
  • the WiFi FWK can query the chip status of the WiFi chip once every five minutes.
  • the WiFi FWK may also query only once when receiving the notification of starting WiFi monitoring sent by the power saving wizard. Then, the WiFi FWK does not need to stop WiFi monitoring when executing steps S21 and S22; nor does it need to execute steps S25 and S26. This method only performs WiFi monitoring on the chip status of the WiFi chip when entering deep sleep mode.
  • the WiFi FWK periodically monitors the chip status of the WiFi chip after the power saving wizard enters the deep sleep mode.
  • This method can continuously monitor the chip status of the WiFi chip throughout the deep sleep mode, and manage the WiFi when the WiFi chip is abnormal at any time during the entire process, thereby effectively reducing the power consumption of the electronic device and avoiding serious power consumption.
  • the WiFi driver determines the chip status of the WiFi chip based on the routing data.
  • the routing data may include at least one of a unicast frame, a beacon frame, a rekey packet, a multicast packet, a broadcast packet and an addba req frame, and may also include other data not shown.
  • the WiFi driver may send a notification message to the WiFi FWK.
  • the notification message may include indication information indicating the chip status.
  • the indication information is 1, which means that the chip status is abnormal, and the indication information is 0, which means that the chip status is normal.
  • the WiFi driver may notify the WiFi FWK when determining that the chip status of the WiFi chip is normal, or may not notify the WiFi FWK. This is not limited to the embodiments of the present application.
  • the electronic device does not need to manage the WiFi when the WiFi chip is in a normal state. Therefore, in the embodiment of the present application, if the WiFi chip status is normal, the WiFi FWK is not notified, which can reduce the power consumption caused by the notification.
  • WiFi FWK notifies Power Saver that the chip status of the WiFi chip is abnormal.
  • the WiFi FWK may send a notification message to the power saving wizard.
  • the notification message may include indication information indicating the chip status, such as the indication information is 1 indicating that the chip status is abnormal, and the indication information is 0 indicating that the chip status is normal.
  • S20 The power saving wizard determines whether there is any perceptible service currently.
  • the perceptible service may be a service that is perceptible to the user, that is, the user may perceive the suspension of the service.
  • the perceptible service may include background playback, downloading, navigation, and other services.
  • the power saving wizard determines that there is currently a perceptible service (ie, the electronic device is executing a perceptible service), it executes step S13 and ends the following steps; when it determines that there is currently no perceptible service, it executes the following step S21.
  • the power saving wizard may include an abnormality identification module, and S20 is specifically executed by the abnormality identification module.
  • the WiFi FWK may notify the abnormality identification module in the power saving wizard that the chip status of the WiFi chip is abnormal; further, the abnormality identification module may determine whether there is currently a perceptible service.
  • not turning off the WiFi can ensure that the perceptible service is not This can prevent the user experience from being affected by perceived business interruptions.
  • the WiFi FWK may not execute the above-mentioned S20 and S13, and directly execute the following step S21.
  • S21 Power Saving Wizard notifies WiFi FWK to turn off WiFi monitoring and WiFi.
  • WiFi FWK turns off WiFi and stops WiFi monitoring.
  • the WiFi FWK can call the WiFi shutdown interface to shut down the WiFi function.
  • the WiFi monitoring device detects that the WiFi is abnormal, the WiFi function is turned off, which can avoid the problem of excessive power consumption and serious power consumption caused by the WiFi function.
  • the power saving wizard periodically determines whether the user is in a sleeping state through an intelligent night mode algorithm; when it is identified that the user is not in a sleeping state, the deep sleep mode is exited.
  • S24 Power Saving Wizard notifies WiFi FWK to stop WiFi monitoring.
  • the power saving wizard when the power saving wizard exits deep sleep mode, it notifies the WiFi FWK to stop WiFi monitoring.
  • WiFi FWK determines whether WiFi monitoring is currently being performed.
  • the WiFi FWK can determine whether WiFi monitoring has been activated; when WiFi monitoring is activated, execute step S26, and when WiFi monitoring is not activated, execute step S13.
  • the WiFi FWK stops WiFi monitoring when it determines that WiFi monitoring is started.
  • WiFi FWK determines whether the current WiFi is turned off.
  • the WiFi FWK can determine whether the WiFi has been turned off (or whether it is currently turned off); when the WiFi is turned off, execute step S28, and when the WiFi is not turned off, execute step S13.
  • the WiFi FWK may execute step S27 to determine that WiFi is turned off and then start WiFi.
  • the WiFi monitoring function is started when the user is in a sleep state, the WiFi monitoring is stopped when the user is in a non-sleep state, and the WiFi is turned on when the WiFi is turned off, so as to avoid network interruption when the user is using the electronic device.
  • This method can reduce the problem of excessive power consumption caused by WiFi abnormalities when the user is in a sleep state.
  • FIG5 is a flow chart showing another method for reducing power consumption provided by an embodiment of the present application. As shown in FIG5 , the method includes some or all of the following steps:
  • S1 The electronic device starts monitoring of WiFi abnormalities.
  • the electronic device may start monitoring for WiFi anomalies after turning on the WiFi function.
  • the power saving wizard of the electronic device can determine whether the data service switch is turned on when the user is in sleep mode, and then, when the data service switch is turned on, notify the WiFi FWK to start WiFi monitoring.
  • S2 The electronic device queries the chip status of the WiFi chip.
  • the WiFi FWK when the WiFi FWK receives a notification from the power saving wizard to start WiFi monitoring, the WiFi FWK starts WiFi monitoring, that is, it starts to periodically query the WiFi driver for the chip status of the WiFi chip; the WiFi driver can perform the following steps: Steps S3 to S10 determine the chip status of the WiFi chip (which is a specific implementation of step S17 in FIG. 4 ).
  • the electronic device obtains a flag corresponding to the reception rate of the beacon frame (referred to as the first flag).
  • the beacon frame is a management frame sent by the routing device to the electronic device; the first flag is used to indicate whether the reception rate of the beacon frame is abnormal, for example, the first flag can be 0, 0 is used to indicate that the reception rate of the beacon frame is normal; the first flag can be 1, 1 is used to indicate that the reception rate of the beacon frame is abnormal.
  • the reception rate of the beacon frame can also be called the beacon frame reception rate.
  • the specific process of the electronic device obtaining the flag corresponding to the reception rate of the beacon frame can refer to the following steps S31 to S35.
  • S31 The electronic device determines whether the reception rate of the beacon frame is abnormal.
  • step S33 when the electronic device determines that the reception rate of the beacon frame is abnormal, the electronic device executes step S33; when the electronic device determines that the reception rate of the beacon frame is normal, the electronic device executes step S32.
  • the electronic device may divide the number of beacon frames actually received within a preset time by the number of beacon frames that should be received (also referred to as the preset number of frames) to obtain a beacon reception rate (also referred to as a beacon frame reception rate). If the calculated beacon reception rate is lower than the preset reception rate, the beacon frame reception rate is considered abnormal.
  • the number of beacon frames that should be received may be the preset number of frames.
  • the preset time is 5 minutes and the preset reception rate can be 60%. Then, the electronic device can calculate the beacon reception rate every five minutes after starting WiFi monitoring. If the calculated beacon reception rate is lower than 60%, it is determined that the reception rate of the beacon frame is abnormal.
  • an electronic device receives a small number of beacon frames, the WiFi chip will work for a long time, resulting in serious power consumption of the electronic device.
  • a user with a reception rate lower than 60% may be called a problem user, and the power consumption of the problem user from 0 to 6 o'clock is about 7% to 8%.
  • the embodiment of the present application can identify the problem user and turn off the WiFi when certain conditions are met (such as the data switch is turned on and/or there is no perceptible service as shown in FIG. 4), which can avoid the WiFi chip working for a long time and effectively reduce the power consumption of the electronic device.
  • the first flag obtained by the electronic device is 0.
  • 0 is used to indicate that the reception rate of the beacon frame is normal.
  • the electronic device determines whether the number of abnormalities corresponding to the beacon frame reception rate (hereinafter referred to as the first abnormal number) is greater than N1 times. Further, when the electronic device determines that the first abnormal number is greater than N1 times, it executes step S35; when it determines that the beacon frame reception rate is normal, it executes step S34.
  • N1 is a positive integer.
  • the electronic device can obtain the recorded first abnormal number from the storage, add 1 to the abnormal number to obtain an updated first abnormal number, and compare the updated first abnormal number with N1 to determine whether the abnormal number corresponding to the beacon frame reception rate is greater than N1.
  • S34 The electronic device adds 1 to the recorded first abnormal number.
  • the first flag obtained by the electronic device is 1. 1 is used to indicate that the reception rate of the beacon frame is abnormal.
  • the electronic device obtains a flag (referred to as the second flag) corresponding to the frequency of the TIM bit being erroneously set.
  • the TIM bit refers to the flag bit corresponding to the electronic device in the beacon frame sent by the routing device to the electronic device.
  • the flag bit is set to indicate that the routing device will send data to the electronic device within the next preset time.
  • the second flag is used to indicate whether the frequency of the TIM bit error setting is abnormal.
  • the second flag can be 0, which is used to indicate The frequency of the TIM bit being erroneously set is normal, and the second flag may be 1, where 1 is used to indicate that the frequency of the TIM bit being erroneously set is abnormal.
  • the TIM bit in the beacon frame of the electronic device is set, but no data is received from the routing device after waiting for a preset time (also referred to as a first time period), it is considered that the TIM bit is set incorrectly; the frequency of the TIM bit being set incorrectly refers to the number of times the TIM bit is set incorrectly within a preset time period.
  • the first time period may be 60ms.
  • an electronic device receives a beacon frame every 1 second. If the TIM bit in the beacon frame is set, the electronic device will wait for 60ms. If the electronic device receives the data sent by the routing device within 60ms, the beacon is not misplaced, otherwise it is misplaced. If the electronic device receives 10 beacon frames in 1 second and 8 of the 10 beacon frames are wrong, the electronic device can determine that the frequency of the TIM bit being incorrectly set is 8 frames per second.
  • the electronic device obtains the frequency of the TIM bit being set incorrectly, and turns off the WiFi function when the frequency is too high, that is, the WiFi chip is powered off, which can avoid serious power consumption and effectively reduce power consumption.
  • the specific process of the electronic device obtaining the flag corresponding to the frequency of the TIM bit being erroneously set may refer to the following steps S41 to S45.
  • the electronic device determines whether the frequency of the TIM bit erroneous setting is abnormal. Further, the electronic device executes step S43 when determining that the frequency of the TIM bit erroneous setting is abnormal; and executes step S42 when determining that the frequency of the TIM bit erroneous setting is normal.
  • the electronic device may calculate the frequency of TIM bit errors in beacon frames received within a preset time (also referred to as a second time period), and if the frequency is greater than the preset frequency, it is determined that the frequency of TIM bit error is abnormal, otherwise it is normal. If the electronic device does not receive data within a preset time after receiving a beacon frame, it is determined that the TIM bit in the beacon frame is wrong.
  • a preset time also referred to as a second time period
  • the second time period can be 1s and the first preset number of times is 8
  • the electronic device can calculate the frequency of TIM bit error setting once per second, assuming that 10 beacon frames are received in 1s and 8 of the 10 beacon frames are wrong, the electronic device can determine that the frequency of TIM bit error setting is abnormal.
  • the second flag obtained by the electronic device is 0.
  • 0 is used to indicate that the frequency of the TIM bit erroneous setting is normal.
  • the electronic device determines whether the number of abnormal times (hereinafter referred to as the second abnormal number) corresponding to the frequency of the TIM bit being incorrectly set is greater than N2 times. Further, when the electronic device determines that the second abnormal number is greater than N2 times, it executes step S45; when it determines that the frequency of the TIM bit being incorrectly set is normal, it executes step S44.
  • N2 is a positive integer.
  • the electronic device can obtain the recorded second abnormal number from the storage, add 1 to the abnormal number to obtain an updated second abnormal number, and compare the updated second abnormal number with N2 to determine whether the abnormal number corresponding to the frequency of the TIM bit erroneous setting is greater than N2 times.
  • S44 The electronic device adds 1 to the recorded second abnormal number.
  • the second flag obtained by the electronic device is 1. 1 is used to indicate that the frequency of the TIM bit being incorrectly set is abnormal.
  • the electronic device obtains a flag (referred to as the third flag) corresponding to the sending frequency of the rekey packet.
  • the rekey package is a broadcast password update frame sent by the routing device to the electronic device;
  • the sending frequency of the rekey package may refer to the sending frequency of the rekey package configured by the routing device (i.e., the frequency at which the routing device sends the rekey package), that is, the receiving frequency at which the electronic device receives the rekey package.
  • the frequency at which the routing device sends the rekey package is not equal to the receiving frequency at which the electronic device receives the rekey package.
  • the electronic device may determine the receiving frequency at which the electronic device receives the rekey package as the frequency for determining whether the rekey package is abnormal.
  • the sending frequency of the rekey package may also be referred to as the sending frequency of the broadcast key update frame.
  • the third flag is used to indicate whether the sending frequency of the rekey packet is abnormal.
  • the third flag can be 0, 0 is used to indicate that the sending frequency of the rekey packet is normal, and the third flag can be 1, 1 is used to indicate that the sending frequency of the rekey packet is abnormal.
  • the specific process of the electronic device obtaining the flag corresponding to the sending frequency of the rekey packet can refer to the following steps S51 to S55.
  • S51 The electronic device determines whether the sending frequency of the rekey packet is abnormal.
  • step S53 when the electronic device determines that the sending frequency of the rekey packet is abnormal, the electronic device executes step S53; when the electronic device determines that the sending frequency of the rekey packet is normal, the electronic device executes step S52.
  • the electronic device may calculate the sending interval of the rekey package. If the sending interval of the rekey package is less than a preset time interval (such as 30s), it is determined that the sending frequency of the rekey package is abnormal, otherwise it is normal.
  • a preset time interval such as 30s
  • the electronic device determines that the sending frequency of the broadcast key update frames is abnormal, where N is a positive integer.
  • N 10
  • each of the N time periods is 1 minute
  • the first preset number is 2. If the electronic device can calculate the number of rekey packages received per minute, if at least two rekey packages are received per minute for ten consecutive minutes, it is determined that the sending frequency of the rekey packages is abnormal, otherwise it is normal.
  • the electronic device can avoid serious power consumption of the electronic device by obtaining the sending frequency of the rekey packet and turning off the WiFi function when the frequency is too high (i.e. abnormal), which can effectively reduce power consumption.
  • the third flag obtained by the electronic device is 0.
  • 0 is used to indicate that the sending frequency of the rekey packet is normal.
  • the electronic device determines whether the number of abnormal times (referred to as the third abnormal number) corresponding to the frequency of sending the rekey packet is greater than N3 times. Further, when the electronic device determines that the third abnormal number is greater than N3 times, it executes step S55; when it determines that the frequency of sending the rekey packet is normal, it executes step S54. Wherein, N3 is a positive integer.
  • the electronic device can obtain the recorded third abnormal number from the storage, add 1 to the abnormal number to obtain an updated third abnormal number, and compare the updated third abnormal number with N3 to determine whether the abnormal number corresponding to the frequency of the TIM bit erroneous setting is greater than N3 times.
  • S54 The electronic device adds 1 to the recorded third abnormal number.
  • the third flag obtained by the electronic device is 1. 1 is used to indicate that the sending frequency of the rekey packet is abnormal.
  • S6 The electronic device obtains a flag (referred to as the fourth flag) corresponding to the sending frequency of the addba req frame.
  • the addba req frame is a management frame sent by the routing device to the electronic device; the sending frequency of the addba req frame may refer to the frequency at which the routing device sends the rekey packet, that is, the receiving frequency at which the electronic device receives the rekey packet.
  • the sending frequency of the addba req frame may also be referred to as the sending frequency of the block request frame.
  • the frequency at which the routing device sends addba req frames is not equal to the receiving frequency at which the electronic device receives addba req frames.
  • the electronic device may determine the receiving frequency at which the electronic device receives addba req frames as the frequency for determining whether the rekey packet is abnormal.
  • the fourth flag is used to indicate whether the sending frequency of the addba req frame is abnormal.
  • the fourth flag can be 0, 0 is used to indicate that the sending frequency of the addba req frame is normal, and when the fourth flag is 1, it indicates that the sending frequency of the addba req frame is abnormal.
  • the specific process of the electronic device obtaining the flag of the sending frequency of the addba req frame can be referred to the following steps S61 to S65.
  • S61 The electronic device determines whether the sending frequency of the addba req frame is abnormal.
  • step S63 when the electronic device determines that the sending frequency of the addba req frame is abnormal, it executes step S63; when it determines that the sending frequency of the addba req frame is normal, it executes step S62.
  • the electronic device may calculate the sending interval of the addba req frame. If the sending interval of the addba req frame is less than a preset time interval, it is determined that the sending frequency of the addba req frame is abnormal, otherwise it is normal.
  • the electronic device determines that the sending frequency of the block request frame is abnormal, and M is a positive integer.
  • M is 10
  • each of the M time periods is 1 minute
  • the second preset number is 2.
  • the electronic device can calculate the number of addba req frames received per minute. If at least two addba req frames are received per minute for ten consecutive minutes, it is determined that the sending frequency of the addba req frames is abnormal, otherwise it is normal.
  • the electronic device if the electronic device frequently receives the addba req frame sent by the routing device, that is, the sending frequency of the addba req frame is too high, the WiFi chip will not sleep or the sleep time will be too short, resulting in serious power consumption of the electronic device.
  • the electronic device obtains the sending frequency of the addba req frame and turns off the WiFi function when the frequency is too large (i.e. abnormal), which can avoid serious power consumption of the electronic device and effectively reduce power consumption.
  • the fourth flag obtained by the electronic device is 0.
  • 0 is used to indicate that the sending frequency of the addba req frame is normal.
  • the electronic device determines whether the number of abnormal times (hereinafter referred to as the fourth abnormal number) corresponding to the sending frequency of the addba req frame is greater than N4 times. Further, when the electronic device determines that the fourth abnormal number is greater than N4 times, it executes step S65; when it determines that the sending frequency of the addba req frame is normal, it executes step S64.
  • N4 is a positive integer.
  • the electronic device can obtain the recorded fourth abnormal number from the storage, add 1 to the abnormal number to obtain an updated fourth abnormal number, and compare the updated fourth abnormal number with N4 to determine whether the abnormal number corresponding to the frequency of the TIM bit erroneous setting is greater than N4 times.
  • S64 The electronic device adds 1 to the recorded fourth abnormal number.
  • the fourth flag acquired by the electronic device is 1. 1 is used to indicate that the sending frequency of the addba req frame is abnormal.
  • the electronic device obtains a flag corresponding to the disconnection frequency (referred to as the fifth flag).
  • disconnection refers to the disconnection of communication between the electronic device and the routing device
  • disconnection frequency refers to the number of times the electronic device and the routing device disconnect communication within a preset time period. It should be noted that frequent disconnection can be caused by frequent kicking of electronic devices due to the settings of the routing device, or it can be other reasons.
  • the fifth flag is used to indicate whether the link breaking frequency is abnormal.
  • the fifth flag may be 0, which indicates that the link breaking frequency is normal; the fifth flag may be 1, which indicates that the link breaking frequency is abnormal.
  • the specific process of the electronic device obtaining the flag of the disconnection frequency can refer to the following steps S71 to S75.
  • S71 The electronic device determines whether the link disconnection frequency is abnormal.
  • step S73 when the electronic device determines that the link breaking frequency is abnormal, it executes step S73; when it determines that the link breaking frequency is normal, it executes step S72.
  • the electronic device may determine that the disconnection frequency is abnormal when it is recognized that the electronic device and the routing device are disconnected five times within 10 minutes.
  • the electronic device obtains the link disconnection frequency and turns off the WiFi function when the link disconnection frequency is too large (i.e. abnormal), which can avoid the situation where the electronic device frequently disconnects and then reconnects, resulting in serious power consumption, and can effectively reduce power consumption.
  • the fifth flag obtained by the electronic device is 0. 0 is used to indicate that the link disconnection frequency is normal.
  • the electronic device determines whether the number of abnormal times corresponding to the link-breaking frequency (hereinafter referred to as the fifth abnormal number) is greater than N5 times. Further, when the electronic device determines that the fifth abnormal number is greater than N5 times, it executes step S75; when it determines that the link-breaking frequency is normal, it executes step S74.
  • N5 is a positive integer.
  • the electronic device can obtain the recorded fifth abnormal number from the storage, add 1 to the abnormal number to obtain an updated fifth abnormal number, and compare the updated fifth abnormal number with N5 to determine whether the abnormal number corresponding to the frequency of the TIM bit erroneous setting is greater than N5 times.
  • S74 The electronic device adds 1 to the fifth abnormal number recorded.
  • the fifth flag obtained by the electronic device is 1. 1 is used to indicate that the link disconnection frequency is abnormal.
  • the electronic device obtains a flag corresponding to the sending frequency of the AMSDU multicast packet (referred to as the sixth flag).
  • the AMSDU multicast packet is a multicast packet sent by a routing device to an electronic device; the sending frequency of the AMSDU multicast packet may refer to the frequency at which the routing device sends the AMSDU multicast packet, that is, the receiving frequency at which the electronic device receives the AMSDU multicast packet.
  • the AMSDU multicast packet may also be referred to as the sending frequency of the aggregated multicast packet.
  • the frequency at which the routing device sends AMSDU multicast packets is not equal to the receiving frequency at which the electronic device receives the AMSDU multicast packets.
  • the electronic device may determine the receiving frequency at which the electronic device receives the AMSDU multicast packets as the frequency for determining whether the AMSDU multicast packets are abnormal.
  • the sixth flag is used to indicate whether the sending frequency of the AMSDU multicast packet is abnormal.
  • the sixth flag can be 0, 0 is used to indicate that the sending frequency of the AMSDU multicast packet is normal; the sixth flag can be 1, 1 is used to indicate that the sending frequency of the AMSDU multicast packet is abnormal.
  • the specific process of the electronic device obtaining the flag corresponding to the sending frequency of the AMSDU multicast packet can refer to the following steps S81 to S85.
  • S81 The electronic device determines whether the sending frequency of the AMSDU multicast packet is abnormal.
  • step S83 when the electronic device determines that the sending frequency of the AMSDU multicast packet is abnormal, the electronic device executes step S83; when the electronic device determines that the sending frequency of the AMSDU multicast packet is normal, the electronic device executes step S82.
  • the electronic device determines that the sending frequency of the aggregated multicast packets is abnormal, and K is a positive integer.
  • K is 10
  • each of the K time periods is 1 minute
  • the third preset number is 2. Then, if the electronic device receives two AMSDU multicast packets per minute for ten consecutive minutes, the electronic device can determine that the sending frequency of the AMSDU multicast packets is abnormal.
  • the electronic device if the electronic device frequently receives AMSDU multicast packets sent by the routing device, that is, the sending frequency of the AMSDU multicast packets is too high, the WiFi chip will not sleep or the sleep time will be too short, resulting in serious power consumption of the electronic device.
  • the electronic device obtains the sending frequency of the AMSDU multicast packets and turns off the WiFi function when the frequency is too high (i.e., abnormal), which can avoid serious power consumption of the electronic device and effectively reduce power consumption.
  • the sixth flag obtained by the electronic device is 0.
  • 0 is used to indicate that the sending frequency of the AMSDU multicast packet is normal.
  • the electronic device determines whether the number of abnormal times (referred to as the sixth abnormal number) corresponding to the sending frequency of the AMSDU multicast packet is greater than N6 times. Further, when the electronic device determines that the sixth abnormal number is greater than N6 times, it executes step S85; when it determines that the sending frequency of the AMSDU multicast packet is normal, it executes step S84.
  • N6 is a positive integer.
  • the electronic device can obtain the recorded sixth abnormal number from the storage, add 1 to the abnormal number to obtain an updated sixth abnormal number, and compare the updated sixth abnormal number with N6 to determine whether the abnormal number corresponding to the frequency of the TIM bit erroneous setting is greater than N6 times.
  • S84 The electronic device adds 1 to the recorded sixth abnormal number.
  • the sixth flag obtained by the electronic device is 1. 1 is used to indicate that the sending frequency of the AMSDU multicast packet is abnormal.
  • the electronic device obtains a flag corresponding to the APF filtering message (referred to as the seventh flag).
  • the seventh flag is used to indicate whether the APF filtering message is abnormal, wherein the message may include a broadcast packet and a multicast packet.
  • the seventh flag may be 0, which indicates that the APF filtering message is normal; the seventh flag may be 1, which indicates that the APF filtering message is abnormal.
  • the APF filtering message may also be referred to as the message condition after filtering. If the APF filtering message is abnormal, the message condition after filtering is abnormal.
  • the specific process of the electronic device obtaining the flag corresponding to the APF filtering message can refer to the following steps S91 to S95.
  • S91 The electronic device determines whether the APF filtering message is abnormal.
  • step S93 when the electronic device determines that the APF filtering message is abnormal, the electronic device executes step S93; If the text is normal, execute step S92.
  • the electronic device determines that the filtered message situation is abnormal, and L is a positive integer.
  • L is 10
  • each of the L time periods is 1 minute
  • the second preset number is 2
  • the electronic device wakes up the WiFi chip with two broadcast packets or multicast packets per minute for ten consecutive minutes, then the electronic device can determine that the APF filtering message is abnormal.
  • the electronic device can avoid serious power consumption of the electronic device by judging whether the APF filtering message is abnormal and turning off the WiFi function when the APF filtering message is abnormal, which can effectively reduce power consumption.
  • the seventh flag obtained by the electronic device is 0. 0 is used to indicate that the APF filtering message is normal.
  • the electronic device determines whether the number of abnormalities corresponding to the APF filtering message (hereinafter referred to as the seventh abnormality number) is greater than N7 times. Further, when the electronic device determines that the seventh abnormality number is greater than N7 times, it executes step S95; when it determines that the APF filtering message is normal, it executes step S94. Wherein, N7 is a positive integer.
  • the electronic device can obtain the recorded seventh abnormal number from the storage, add 1 to the abnormal number to obtain an updated seventh abnormal number, and compare the updated seventh abnormal number with N7 to determine whether the abnormal number corresponding to the APF filtering message is greater than N7 times.
  • S94 The electronic device adds 1 to the seventh abnormality count recorded.
  • the seventh flag obtained by the electronic device is 1. 1 is used to indicate that the APF filtering message is abnormal.
  • the embodiment of the present application does not limit the order of execution of the above steps S3 to S9, for example, steps S3 to S9 can be executed simultaneously; the embodiment of the present application does not limit the size of the above 7 values N1 to N7, for example, these 7 values can be different.
  • S10 The electronic device determines whether any flag among the first to seventh flags is set to 1.
  • step S11 when at least one flag is set to 1, step S11 is executed; when no flag is set to 1, step S12 is executed.
  • S11 The electronic device reports the abnormal chip status of the WiFi chip to the power saving wizard.
  • the electronic device has at least one flag set to 1 among the above seven flags, determines that the chip status of the WiFi chip is abnormal, and then sends indication information indicating that the chip status of the WiFi chip is abnormal to the power saving wizard.
  • the indication information can be 1.
  • the WiFi driver may send a notification indicating that the chip status of the WiFi chip is abnormal to the WiFi FWK; further, when the WiFi FWK receives the notification indicating that the chip status of the WiFi chip is abnormal sent by the WiFi driver, the WiFi FWK may send a notification message to the power saving wizard, and the notification message may include indication information indicating that the chip status is abnormal, such as the indication information is 1, which means that the chip status is abnormal.
  • S13 The electronic device determines whether there is a perceptible service currently.
  • the abnormality identification module in the power saving wizard of the electronic device receives the chip status of the WiFi chip.
  • a notification of abnormal state is received, it can be determined whether there is currently a perceptible service (also referred to as a first service). Further, when there is a perceptible service, step S12 is executed; when there is no perceptible service, step S14 is executed.
  • the electronic device can turn off the WiFi function by calling the relevant interface through the above-mentioned WiFi FWK.
  • the method for reducing power consumption provided in the embodiment of the present application can be embodied as a "power saving" function on an electronic device.
  • the above-mentioned "power saving” function may be executed by default by the electronic device, that is, the electronic device does not provide a switch for the user to choose whether to turn on the "power saving” function; the above-mentioned "power saving” function may also be turned on by a switch corresponding to the "power saving" function provided on the electronic device, that is, the user can decide whether to turn on the "power saving” function, that is, whether to execute the above-mentioned method of reducing power consumption.
  • the "power saving” function can be implemented by an application corresponding to the power saving wizard, and the user can install or uninstall the application; it can also be a function in a system application (such as a settings application) in an electronic device.
  • the settings application includes a switch corresponding to the "power saving” function, and the user can turn on or off the "power saving” function through the switch.
  • the user operation can be a touch operation (such as a click operation, a long press operation, an up slide operation, a down slide operation or a side slide operation) or a contactless operation (such as an air gesture) or a voice command.
  • a touch operation such as a click operation, a long press operation, an up slide operation, a down slide operation or a side slide operation
  • a contactless operation such as an air gesture
  • FIG6A to FIG6C exemplarily show a UI related to enabling the “power saving” function of an electronic device.
  • FIG6A to FIG6C exemplarily show a UI related to enabling the “power saving” function of an electronic device.
  • FIG. 6A shows an exemplary user interface 61 for displaying installed applications on an electronic device.
  • the user interface 61 displays: a status bar, an icon 610 of a power saving wizard application, an icon of a clock application, and icons of other applications, etc.
  • the status bar may include: one or more signal strength indicators of a mobile communication signal (also referred to as a cellular signal), one or more signal strength indicators of a Wi-Fi signal, a battery status indicator, a time indicator, etc.
  • the electronic device can detect a user operation on icon 610, and in response to the operation, the electronic device can display a user interface 62 as shown in Figure 6B.
  • the user interface 62 is an application interface of the power saving wizard application shown as an example, and should not limit the embodiments of the present application.
  • the user interface 62 may include a WiFi power saving switch 620.
  • the WiFi power saving switch 620 is used to turn on or off the above-mentioned "power saving" function. It should be noted that the user interface 62 may also include other power saving functions, which are not limited in the embodiments of the present application.
  • the user interface 62 exemplarily shows that the WiFi power saving switch 620 is in the off state. In other embodiments of the present application, when the user turns on the power saving wizard, the WiFi power saving switch may also be in the on state, that is, the WiFi power saving switch is in the on state.
  • the electronic device can detect a user operation on the WiFi power saving switch 620. In response to the operation, the electronic device can start the above-mentioned "power saving" function (i.e., execute the above-mentioned method for reducing power consumption) and display the user interface 63 shown in FIG6C .
  • the user interface 63 may include a WiFi power saving switch 630, wherein the WiFi power saving switch 630 is in an on state, which is used to indicate that the WiFi power saving switch is in an on state.
  • FIG. 7A to FIG. 7C exemplarily show the UI related to turning on the "power saving" function of another electronic device. Among them:
  • FIG. 7A shows an exemplary user interface 71 for displaying installed applications on an electronic device.
  • the user interface 71 displays: a status bar, an icon 710 of a setting application, an icon of a clock application, and icons of other applications, etc.
  • the status bar may include: one or more signal strength indicators of a mobile communication signal (also referred to as a cellular signal), one or more signal strength indicators of a Wi-Fi signal, a battery status indicator, a time indicator, etc.
  • the electronic device can detect a user operation on icon 710, and in response to the operation, the electronic device can display a user interface 72 as shown in Figure 7B.
  • the user interface 72 is an exemplary application interface of a setting application and should not limit the embodiments of the present application.
  • the user interface 72 may include a WiFi power saving switch 720, a mobile network switch 721, and a search bar 722.
  • the WiFi power saving switch 720 is used to turn on or off the above-mentioned "power saving" function;
  • the mobile network switch 721 is used to turn on cellular data, and the mobile network switch 721 may be the above-mentioned data service switch;
  • the search bar 722 is used to search for setting items in the setting application.
  • the mobile network switch 721 may also include an option for selecting a SIM card, etc., which is not limited in the embodiments of the present application; the user interface 72 may also include other setting functions, such as a WiFi function switch, which is used to turn on the WiFi function to access the WiFi network, which is not limited in the embodiments of the present application.
  • the user interface 72 exemplarily shows that the WiFi power saving switch 720 is in the off state.
  • the WiFi power saving switch may also be in the on state, that is, the WiFi power saving switch is in the on state.
  • the electronic device can detect a user operation on the WiFi power saving switch 720. In response to the operation, the electronic device can start the above-mentioned "power saving" function (i.e., execute the above-mentioned method for reducing power consumption) and display the user interface 73 shown in FIG7C .
  • the user interface 73 may include a WiFi power saving switch 730, wherein the WiFi power saving switch 730 is in an on state, which is used to indicate that the WiFi power saving switch is in an on state.
  • UI user interface
  • the term "user interface (UI)" in the specification, claims and drawings of this application refers to the medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user.
  • the user interface of an application is a source code written in a specific computer language such as Java and extensible markup language (XML).
  • the interface source code is parsed and rendered on the terminal device, and finally presented as content that can be recognized by the user, such as pictures, text, buttons and other controls.
  • Controls also known as widgets, are basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text.
  • the properties and contents of controls in the interface are defined by tags or nodes.
  • XML specifies the controls contained in the interface through nodes such as ⁇ Textview>, ⁇ ImgView>, and ⁇ VideoView>.
  • a node corresponds to a control or attribute in the interface, and the node is presented as user-visible content after parsing and rendering.
  • many applications such as hybrid applications, usually include web pages in their interfaces.
  • a web page also called a page, can be understood as a special control embedded in the application interface.
  • a web page is a source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc.
  • the web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser.
  • the specific content contained in a web page is also defined by tags or nodes in the web page source code.
  • HTML defines web pages through ⁇ p>, ⁇ img>, ⁇ video>, and ⁇ canvas>. Elements and attributes of a page.
  • GUI graphical user interface
  • It can be an icon, window, control or other interface element displayed on the display screen of an electronic device, where a control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.
  • each step in the above method embodiment provided by the present application can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software.
  • the method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
  • the present application also provides an electronic device, which may include: a memory and a processor, wherein the memory may be used to store a computer program; and the processor may be used to call the computer program in the memory so that the electronic device executes the method in any one of the above embodiments.
  • the present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method performed by the electronic device in any of the above embodiments.
  • the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
  • the chip system can be composed of chips, or it can include chips and other discrete devices.
  • the processor in the chip system may be one or more.
  • the processor may be implemented by hardware or by software.
  • the processor may be a logic circuit, an integrated circuit, etc.
  • the processor may be a general-purpose processor implemented by reading software code stored in a memory.
  • the memory in the chip system may also be one or more.
  • the memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application.
  • the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively.
  • the embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.
  • the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • SoC system on chip
  • CPU central processor unit
  • NP network processor
  • DSP digital signal processor
  • MCU microcontroller unit
  • PLD programmable logic device
  • the present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which enables a computer to execute the method executed by the electronic device in any of the above embodiments when the computer program is executed.
  • a computer program also referred to as code, or instruction
  • the present application also provides a computer-readable storage medium, which stores a computer program (also referred to as code or instruction).
  • a computer program also referred to as code or instruction.
  • the computer program executes the method executed by the electronic device in any of the above embodiments.
  • all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof.
  • all or part of the embodiments may be implemented in the form of a computer program product.
  • the computer program product includes Include one or more computer instructions. When loading and executing computer program instructions on a computer, all or part of the process or function according to the present application is generated.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • Computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode.
  • Computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. Available media can be magnetic media, (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid-state drive Solid State Disk), etc.
  • the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media.
  • the programs can include the processes of the above-mentioned method embodiments.
  • the aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请实施例提供了一种降低功耗的方法、设备和系统,电子设备包括无线保真WiFi芯片,WiFi芯片用于实现WiFi功能,该方法包括:电子设备开启WiFi功能;电子设备接收无线访问接入点发送的信标帧;电子设备基于接收到的信标帧,确定WiFi芯片的芯片状态;电子设备在芯片状态为异常状态时,关闭电子设备的WiFi功能。该方法可以在WiFi芯片出现异常时,关闭WiFi功能,从而有效降低WiFi异常导致的功耗严重。

Description

一种降低功耗的方法、设备和系统
本申请要求于2023年06月15日提交中国专利局、申请号为202310713807.9、申请名称为“一种降低功耗的方法、设备和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子技术领域,尤其涉及一种降低功耗的方法、设备和系统。
背景技术
随着通信技术的发展,越来越多的电子设备通过路由设备等网络设备接入无线局域网中,例如,无线保真(Wireless Fidelity,Wi-Fi)路由器用于向Wi-Fi信号覆盖范围内的各类电子设备提供Wi-Fi网络服务,电子设备可以通过Wi-Fi路由器接入Wi-Fi网络。
但是,由于电子设备与Wi-Fi路由器不匹配或者路由器本身配置等问题,会出现电子设备出现WiFi芯片不休眠以及频繁唤醒电子设备的操作系统等情况,从而导致电子设备功耗高,电量消耗明显。
发明内容
本申请提供了一种降低功耗的方法、设备和系统,该方法中,电子设备可以基于接收到的信标帧,确定WiFi芯片的芯片状态,进而,在WiFi芯片出现异常时,关闭WiFi功能。该方法可以避免WiFi芯片异常时出现的不休眠或休眠时间短的情况,从而有效降低WiFi异常导致的功耗严重。
第一方面,本申请实施例提供了一种降低功耗的方法,应用于电子设备,电子设备包括无线保真WiFi芯片,WiFi芯片用于实现WiFi功能,该方法包括:
电子设备开启WiFi功能;
电子设备接收无线访问接入点发送的信标帧;
电子设备基于接收到的信标帧,确定WiFi芯片的芯片状态;
电子设备在芯片状态为异常状态时,关闭电子设备的WiFi功能。
在本申请实施例中,电子设备可以基于信标帧(即beacon帧)识别WiFi芯片的芯片状态是否异常,其中,芯片状态异常包括芯片不休眠、休眠时间过短以及频繁被唤醒等,该方法可以减少电子设备的功耗和耗电量。
例如,电子设备在灭屏待机时间段内,若WiFi芯片不能休眠,电子设备的功耗超过60mA,执行本申请实施例提供的方法,可以降低夜间待机功耗,成功管控后有20mA以上收益。具体收益指大小取决于管控前唤醒频率以及系统状态。
可选地,关闭电子设备的WiFi功能可以是,电子设备对Wi-Fi芯片进行下电处理。
结合第一方面,在一种可能的实施方式中,信标帧包括数据待传指示信息TIM位,电子设备基于接收到的信标帧,确定WiFi芯片的芯片状态,包括:
电子设备在接收到TIM位被置位的信标帧后第一时间段内均没有接收到数据,确定信标帧的TIM位错误;TIM位被置位的信标帧用于指示无线访问接入点将发送数据至电子设备;
当电子设备在第二时间段内接收到TIM位错误的信标帧的次数大于第一预设次数时,确定芯片状态为异常状态。
其中,TIM位被置位也可以简称为TIM位置位。
在本申请实施例中,电子设备可以识别信标帧中TIM位频繁置位错误,进而,关闭WiFi功能,该方法可以避免TIM位频繁置位错误导致的WiFi芯片不休眠或休眠时间过短的情况,从而减少电子设备的功耗和耗电量。
结合第一方面,在一种可能的实施方式中,电子设备基于接收到的信标帧,确定WiFi芯片的芯片状态,包括:
电子设备计算第三时间段内接收到的信标帧数与预设帧数的比值,得到信标帧接收率;
当信标帧接收率低于预设接收率时,电子设备确定芯片状态为异常状态。
需要说明的是,若电子设备接收到较少的beacon帧数会导致WiFi芯片工作时间长,导致电子设备耗电严重,例如接收率低于60%的电子设备可以为称为问题用户,问题用户0-6点的耗电量大概为7%至8%。本申请实施例可以识别出该问题用户,在符合若干条件(如图4所示的数据开关开启和/或没有可感知业务等)的情况下关闭WiFi,可以避免WiFi芯片工作时间长,可以有效减少电子设备的耗电。
结合第一方面,在一种可能的实施方式中,电子设备基于接收到的信标帧,确定WiFi芯片的芯片状态,包括:
电子设备获取第一数据,第一数据包括广播密钥更新帧的发送频率、块请求帧的发送频率、断链频率、聚合组播包的发送频率和过滤后的报文情况中的至少一个;
当电子设备确定接收到的信标帧和第一数据中至少一个出现异常时,确定芯片状态为异常状态。
在本申请实施例中,电子设备可以识别出接收到的信标帧、广播密钥更新帧的发送频率、块请求帧的发送频率、断链频率、聚合组播包的发送频率和过滤后的报文情况任一个异常的情况,进而,关闭WiFi功能,该方法可以避免WiFi芯片不休眠或休眠时间过短的情况,从而减少电子设备的功耗和耗电量。
结合第一方面,在一种可能的实施方式中,该方法还包括:
当第四时间段内接收到TIM位错误的信标帧的次数大于第一预设次数,或者,信标帧接收率低于预设接收率时,电子设备确定接收到的信标帧出现异常。
结合第一方面,在一种可能的实施方式中,该方法还包括:
电子设备接收无线访问接入点发送的广播密钥更新帧;
当连续N个时间段内每个时间段中广播密钥更新帧的个数均超过第一预设个数时,电子设备确定广播密钥更新帧的发送频率出现异常,N为正整数。
在本申请实施例中,电子设备可以识别无线访问接入点是否频繁发送广播密钥更新帧,进而,在频繁接收到广播密钥更新帧时关闭WiFi功能,该方法可以避免频繁接收广播密钥更新帧导致的WiFi芯片不休眠或休眠时间过短的情况,从而减少电子设备的功耗和耗电量。
结合第一方面,在一种可能的实施方式中,该方法还包括:
电子设备接收无线访问接入点发送的块请求帧;
当连续M个时间段内每个时间段中广播密钥更新帧的个数均超过第二预设个数时,电子设备确定块请求帧的发送频率出现异常,M为正整数。
在本申请实施例中,电子设备可以识别无线访问接入点是否频繁发送块请求帧,进而,在频繁接收到块请求帧时关闭WiFi功能,该方法可以避免频繁接收块请求帧导致的WiFi芯片不休眠或休眠时间过短的情况,从而减少电子设备的功耗和耗电量。
结合第一方面,在一种可能的实施方式中,该方法还包括:
当连续K个时间段内每个时间段从无线访问接入点接收到的聚合组播包的个数均大于第三预设个数时,电子设备确定聚合组播包的发送频率异常,K为正整数。
在本申请实施例中,电子设备可以识别无线访问接入点是否频繁发送聚合组播包,进而,在频繁接收到聚合组播包时关闭WiFi功能,该方法可以避免频繁接收聚合组播包导致的WiFi芯片不休眠或休眠时间过短的情况,从而减少电子设备的功耗和耗电量。
结合第一方面,在一种可能的实施方式中,该方法还包括:
电子设备开启安卓包过滤APF功能;安卓包过滤APF功能用于过滤广播包和组播包;
电子设备接收无线访问接入点发送的数据包,数据包包括广播包和组播包;
当连续L个时间段内每个时间段中数据包唤醒WiFi芯片的次数均大于第二预设次数时,电子设备确定过滤后的报文情况出现异常,L为正整数。
可选地,电子设备可以在WiFi功能开启时自动开启安卓包过滤APF功能。
可以理解,若过滤后的报文情况出现异常也即是安卓包过滤APF功能出现异常,过滤不了的广播包和组播包会唤醒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芯片不能休眠,电子设备的功耗超过60mA,执行本申请实施例提供的方法,可以降低夜间待机功耗,成功管控后有20mA以上收益。具体收益指大小取决于管控前唤醒频率以及系统状态。
结合第二方面,在一种可能的实施方式中,信标帧包括数据待传指示信息TIM位,WiFi芯片具体用于:
在接收到TIM位被置位的信标帧后第一时间段内均没有接收到数据,确定信标帧的TIM位错误;TIM位被置位的信标帧用于指示无线访问接入点将发送数据至电子设备;
当第二时间段内接收到TIM位错误的信标帧的次数大于第一预设次数时,确定芯片状态为异常状态。
结合第二方面,在一种可能的实施方式中,WiFi芯片具体用于:
计算第三时间段内接收到的信标帧数与预设帧数的比值,得到信标帧接收率;
当信标帧接收率低于预设接收率时,确定芯片状态为异常状态。
在本申请实施例中,电子设备可以识别信标帧中TIM位频繁置位错误,进而,关闭WiFi功能,该方法可以避免TIM位频繁置位错误导致的WiFi芯片不休眠或休眠时间过短的情况,从而减少电子设备的功耗和耗电量。
结合第二方面,在一种可能的实施方式中,WiFi芯片具体用于:
获取第一数据,第一数据包括广播密钥更新帧的发送频率、块请求帧的发送频率、断链频率、聚合组播包的发送频率和过滤后的报文情况中的至少一个;
当确定接收到的信标帧和第一数据中至少一个出现异常时,确定芯片状态为异常状态。
在本申请实施例中,电子设备可以识别出广播密钥更新帧的发送频率、块请求帧的发送频率、断链频率、聚合组播包的发送频率和过滤后的报文情况任一个异常的情况,进而,关闭WiFi功能,该方法可以避免WiFi芯片不休眠或休眠时间过短的情况,从而减少电子设备的功耗和耗电量。
第三方面,本申请提供了一种电子设备,该电子设备包括一个或多个处理器和一个或多个存储器;其中,一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。
第四方面,本申请实施例提供了一种芯片系统,该芯片系统应用于电子设备,该芯片系统包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。
第五方面,本申请提供一种计算机可读存储介质,包括指令,当上述指令在电子设备上运行时,使得上述电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。
第六方面,本申请提供一种包含指令的计算机程序产品,当上述计算机程序产品在电子设备上运行时,使得上述电子设备执行如第一方面以及第一方面中任一可能的实现方式描述的方法。
可以理解地,上述第二方面和第三方面提供的电子设备、第四方面提供的芯片系统、第五方面提供的计算机存储介质、第六方面提供的计算机程序产品均用于执行本申请所提 供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。
附图说明
图1是本申请实施例示例性示出的一种应用场景示意图;
图2是本申请实施例示例性提供的一种电子设备的硬件结构示意图;
图3是本申请实施例示例性提供的电子设备100的系统架构示意框图;
图4是本申请实施例示例性提供的一种降低功耗的方法的流程图;
图5是本申请实施例示例性提供的另一种降低功耗的方法的流程图;
图6A至图6C是本申请实施例提供的一种电子设备开启“省电”功能的用户界面;
图7A至图7C是本申请实施例提供的另一种电子设备开启“省电”功能的用户界面。
具体实施方式
本申请以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括复数表达形式,除非其上下文中明确地有相反指示。还应当理解,本申请中使用的术语“和/或”是指并包含一个或多个所列出项目的任何或所有可能组合。
图1是本申请实施例示例性示出的一种应用场景示意图。
如图1所示,该场景包括电子设备100和路由设备200。其中,电子设备100为具备Wi-Fi功能的设备,也即是说,电子设备100支持无线保真(Wireless Fidelity,WiFi)技术,可以通过WiFi实现无线网络连接,进行网络数据的收发;路由设备200用于提供Wi-Fi热点。
示例性的,路由设备200可以是提供Wi-Fi热点的Wi-Fi路由器,电子设备100为包括Wi-Fi模组(或Wi-Fi芯片)等结构以提供WiFi功能的设备,电子设备可以通过自身的Wi-Fi模组连接路由设备200并通过路由设备200与外部网络进行通信。为方便描述,以下实施例中将Wi-Fi简写为WiFi,如将Wi-Fi芯片或Wi-Fi模组称为WiFi芯片。
示例性的,当电子设备100的WiFi功能设置为“开启”时(即WiFi功能开启中),电子设备100可以周期性扫描当前环境范围内的WiFi信号,例如,电子设备100可以为用户显示当前检测到的一个或者多个WiFi信号以及对应的信号强度等信息;此外,电子设备100还可以根据预设的WiFi自动接入设置以及保存的成功接入的WiFi账号等实现WiFi自动接入等操作。当电子设备100的WiFi功能设置为“关闭”时(即WiFi功能被关闭),电子设备100不会扫描当前环境范围内的WiFi信号,节省了设备的电量消耗,从而能够有效节省电子设备100的功耗。
其中,电子设备100从路由设备200接收到的通信消息,可以包括管理帧,例如beacon(信标)帧、须经路由设备200转发的其他连接设备上报的采集数据、以及路由设备200响应所连接电子设备的探测请求等。
可选地,电子设备100还可以包括蜂窝数据模组,进而,电子设备100可以通过自身的蜂窝数据模组与外部网络进行通信。示例性的,蜂窝数据模组可以为图2中的移动通信模块150。需要说明的是,蜂窝数据模组和WiFi芯片可以位于同一个硬件模块(如芯片) 上;也可以均为单独的硬件模块,本申请实施例对此不作限定。
在图1所示的场景中,若电子设备100与路由设备200存在不匹配或者路由设备200本身配置等问题,导会致电子设备100出现WiFi芯片不休眠以及频繁唤醒电子设备100的操作系统等情况发生,从而导致电子设备100耗电严重。
本申请实施例的发明人通过研究发现以下情况会导致电子设备耗电严重,具体如下:
情况1:路由设备发送beacon帧。
周期不准,导致WiFi芯片不休眠或休眠时间短。
在一些实施例中,路由设备可以向电子设备发送管理帧,例如Beacon(信标)帧等。
beacon帧周期不准的原因主要包括:电子设备和路由设备之间的时间戳(timestamp)没有对齐,导致电子设备无法收到beacon帧或者有较多的beacon帧无法接收。
若接收到较少的beacon帧数会导致WiFi芯片工作时间长,导致电子设备耗电严重,例如存在该问题的电子设备在0点到6点的耗电量可为7%到8%之间。
情况2:路由设备发送的beacon帧的数据待传指示信息(traffic indication map,TIM)位错误置位,电子设备误以为无线访问接入点((Wireless Access Point,AP)侧(即路由设备)仍有数据发送,WiFi芯片不休眠。
其中,TIM位指的是设备与AP连接时分配的关联标识(assoction ID),当路由设备有数据要发给设备时,可以在beacon帧中将该电子设备对应的TIM位置位(如置1),进而,该电子设备收到beacon帧看到自己对应的TIM置位后,知道路由设备有数据会发给自身,就会唤醒WiFi芯片,等待数据。
当beacon帧中TIM位被错误置位或一直置位(即使没有数据发送也将TIM位都置上)时,会导致WiFi芯片不下电,引起严重功耗问题。目前TIM置位问题是功耗的首要(TOP)问题,具备该问题的电子设备(问题用户)的耗电量取决于错误置位的错误频率,1次/s的错误频率可导致电子设备耗电10%以上,0.5次/s的错误频率可导致电子设备耗电5%-7%。应理解,TIM位被错误置位可能与路由设备厂商的设计等因素有关。
情况3:路由设备配置密钥更新(rekey)过于频繁,频繁唤醒主机(host),如唤醒中央处理器。
路由设备的广播密钥一般在指定的时间间隔后更新,然后通过广播密钥更新帧(group rekey帧,简称rekey包)将更新的广播密钥发送至电子设备。
但是,若广播密钥的更新间隔设置得非常短,则路由设备会频繁发送rekey包(如每30s更新一次)给电子设备,导致wifi芯片休眠中断被唤醒,导致电子设备耗电严重。
需要说明的是,在本申请的一些实施例中,广播密钥的更新间隔是路由设备的一个可配置项,但是由于用户无感知且较少有用户知道如何重新配置路由设备的该配置项恢复正常,从而导致该问题影响电子设备的功耗。其中,广播密钥的更新间隔设置得非常短可能是由于路由设备不规范或设置失误等原因造成的。
情况4:路由设备频繁踢电子设备,电子设备又重新发起WiFi连接,导致电子设备的功耗异常。
由于路由设备的自身产品设计等原因,路由设备在没有数据流量的时候会把电子设备 (如手机)踢掉,那么电子设备和路由设备会出现断链,有些路由设备一晚上会踢电子设备数百次,也即是频繁断链,电子设备在被踢后又会自动重连,这样往复造成较严重的功耗问题,问题用户(即具备该问题的电子设备)一般耗电15%以上。
情况5:块请求帧(ADDBA request,简称addba req帧)频繁唤醒host。
其中,addba req帧是用来建立块应答机制(Block Ack)的,但是部分路由设备会频繁发送addbareq action帧请求,导致唤醒host,WiFi芯片一直不休眠。应理解,因为这是管理帧,所以WiFi芯片不会进行过滤,导致电子设备一晚耗电10%左右。
情况6:聚合组播包频繁唤醒Host,WiFi芯片不休眠或休眠时间短。
其中,聚合组播包可以为聚合组播包(Aggregation MAC Service Data Unit,AMSDU),AMSDU组播包是指把多个服务数据单元(MAC Service Data Unit,MSDU)聚合成的数据包。
目前,WiFi芯片侧进行安卓包过滤(Android Packet Filter,APF)时,只能过滤单个组播包或单个广播包;针对聚合帧,WiFi芯片侧只能过滤单个网络缓冲区(Netbuffer,netbuf)的小包聚合帧,且每个子帧的ip地址头都为组播地址或广播地址,而针对多个netbuf的聚合帧(大包聚合,如AMSDU组播包)或聚合帧中存在任何一个子帧的ip地址头为单播地址均不能进行过滤。
该情况下,问题用户会被频繁唤醒,灭屏耗电可达几百毫安时(mAh),WiFi芯片不休眠或休眠时间短,导致电子设备一晚耗电10%左右。
情况7:APF过滤报文异常,芯片仍被频繁唤醒。
假设芯片侧已开启APF过滤组播包和广播包,若仍有组播包和广播包频繁唤醒WiFi芯片,则为APF过滤报文异常。
有鉴于此,本申请实施例提供了一种降低功耗的方法,可降低WiFi异常导致的功耗严重的问题。
本申请实施例中,电子设备可以在WiFi芯片出现异常时,关闭WiFi功能。该方法可以避免WiFi芯片异常时出现的不休眠或休眠时间短的情况,从而有效降低WiFi异常导致的功耗严重。为方便描述,下文也将关闭WiFi功能称为关闭WiFi。
本申请实施例中,电子设备还可以在处于深度睡眠模式时进行WiFi异常WiFi监控和管理,其中,WiFi监控为识别WiFi芯片是否出现异常,管理包括关闭和开启WiFi功能。该方法可以避免关闭WiFi功能导致影响用户使用体验。
本申请实施例中,电子设备还可以在未进行可感知业务时进行WiFi异常WiFi监控和管理,其中,WiFi监控为识别WiFi芯片是否出现异常,管理包括关闭和开启WiFi功能,可感知业务可以为中断WiFi功能时出现暂停的业务。该方法可以避免关闭WiFi功能导致影响用户使用体验。
本申请实施例中,电子设备包括但不限于手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本等等。电子设备的示例性实施例包括但不限于搭载 Linux或者其它操作系统的便携式电子设备。电子设备也可为其 它便携式电子设备,诸如膝上型计算机(Laptop)等。
接下来,示例性介绍本申请实施例中提供的电子设备的软硬件架构。
图2为本申请实施例提供的一种电子设备的硬件结构示意图。图2中以电子设备100为例进行说明。
如图2所示,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(Universal Serial Bus,USB)接口330,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,麦克风170C,传感器模块180,摄像头193以及显示屏194等。其中,传感器模块180可以包括,触摸传感器180K。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(Application Processor,AP),调制解调处理器,图形处理器(Graphics Processing unit,GPU),图像信号处理器(Image Signal Processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(Digital Signal Processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。
天线1和天线2用于发射和接收电磁波信号。移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。
本申请实施例中,处理器110可以控制上述移动通信模块150开启或关闭移动网络。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(Wireless Local Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络),蓝牙(Bluetooth,BT),全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM)等无线通信的解决方案。可选地,电子设备100还可以提供近距离无线通信技术(Near Field Communication,NFC),红外技术(Infrared,IR)等无线通信的解决方案,此处不再展开。
本申请实施例中涉及的WiFi芯片,示例性的可以为如图2所示的无线通信模块160,该无线通信模块160可以包括固件程序(fireware),用于实现识别WiFi芯片的芯片状态是否异常(如图4所示的步骤S17和S18)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像 处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(Liquid Crystal Display,LCD),有机发光二极管(Organic Light-Emitting Diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(Active-Matrix Organic Light Emitting Diode的,AMOLED),柔性发光二极管(Flex Light-Emitting Diode,FLED),Mini LED,Micro LED,Micro-OLED,量子点发光二极管(Quantum Dot Light Emitting Diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像或视频。ISP还可以对图像的噪点,亮度,颜色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(Charge Coupled Device,CCD)或互补金属氧化物半导体(Complementary Metal-Oxide-Semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像或视频信号。ISP将数字图像或视频信号输出到DSP加工处理。DSP将数字图像或视频信号转换成标准的RGB,YUV等格式的图像或视频信号。在一些实施例中,电子设备100可以包括多个摄像头193。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(Moving Picture Experts Group,MPEG)1,MPEG2,MPEG1,MPEG4等。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
需要说明的是,图2所示的电子设备100中其他未提及的模块的作用可以参考相关技术文档,本申请对此不展开说明。
本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。例如,电子设备100还可以包括按键,马达,指示器,以及用户标识模块(subscriber identification module,SIM)卡接口等。又例如,传感器模块还可以包括:陀螺仪传感器,气压传感器,磁传感器,加速度传感器,指纹传感器,温度传感器,骨传导传感器等等。
在本申请提供的实施例中,电子设备100可以通过处理器110和无线通信模块160执行所述降低功耗的方法。
图3是本申请实施例示例性提供的电子设备100的系统架构示意框图。
电子设备100的系统架构可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
分层架构将系统分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层(APP层),应用程序框架层(FWK层),系统层和内核(Kernel)层。
如图3所示,APP层可以包括一系列应用程序包,如省电精灵。在本申请实施例中,APP层可以运行“省电精灵”应用。
本申请实施例中,省电精灵用于通知WiFi FWK启动或关闭对WiFi芯片的芯片状态的WiFi监控,以及通知WiFi FWK开启或关闭WiFi功能。
可选地,省电精灵还可以用于识别用户是否处于睡眠状态、确定数据业务开关是否打开以及判断当前是否正在执行可感知业务等。
例如,省电精灵可以通过智能学习用户习惯,通过当前时间、环境光、电子设备100的静置情况和灭屏情况等识别用户是否为睡眠状态,并且获取手机状态,判断用户开启WiFi和数据业务、无可感知业务等场景;在满足WiFi芯片异常条件时,关闭WiFi,例如,WiFi芯片异常条件可以包括下文中七个标志中任一标志置1;在退出深度睡眠模式或充电、移动、亮屏时,恢复WiFi(即开启WiFi)。
可选地,APP层所安装的应用程序包还可以包括图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序(图3中未示出),在此不做限制。
系统层可以包括多个功能模块。例如:表面管理器(Surface Manager),媒体库(Media Libraries),三维图像处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了二维(2-Dimensional,2D)和三维(3-Dimensional,3D)图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现3D图形绘图,图像渲染,合成和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
FWK层为APP层的应用程序提供应用编程接口(application programminginterface,API)和编程框架。如图3所示,FWK层可以包括WiFi FWK。
本申请实施例中,WiFi FWK用于从WiFi驱动中查询WiFi芯片的芯片状态;在WiFi芯片异常时向省电精灵发送WiFi芯片的芯片状态,以及开启或关闭WiFi。
FWK层可以包括一些预先定义的函数,还可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等(图3中未示出)。
其中,窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。该数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签, 电话簿等。视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备100振动,指示灯闪烁等。
Kernel层是硬件和软件之间的层。Kernel层包括各种硬件的驱动,如WiFi模组对应的WiFi驱动。
本申请实施例中,WiFi驱动用于获取WiFi芯片的芯片状态,WiFi驱动获取WiFi芯片的芯片状态的详细内容可以参见下文中的相关实施例,此处暂不展开。其中,获取WiFi芯片的芯片状态的具体过程可以是由WiFi驱动的固件程序(fireware)实现的。
Kernel层还可以包括摄像头驱动,音频驱动和传感器驱动等。内核层还可以包括数字信号处理器驱动(未示出)以及图像处理器驱动(未示出)等。其中,摄像头驱动用于驱动摄像头模组中的一个或多个摄像头的图像传感器采集图像以及驱动图像信号处理器对图像进行预处理。数字信号处理器驱动用于驱动数字信号处理器处理图像。图像处理器驱动用于驱动图形处理器处理图像。
该软件架构还可以包括图3中未示出的、硬件抽象层(hardware abstract layer,HAL),硬件抽象层,是位于应用程序框架层以及内核层之间的接口层,为操作系统提供虚拟硬件平台。
基于上述图1所示的应用场景以及图2和图3介绍的电子设备的软硬件架构,下面通过图4和图5说明深入该架构分别阐述本申请各个实施例提供的降低功耗的方法。
图4示出了本申请实施例提供的一种降低功耗的方法的流程示意图。如图4所示,该方法包括以下部分或全部步骤:
S11:省电精灵进入深度睡眠模式。
在一些实施例中,在执行S11之前,电子设备可以响应于用户操作,启动WiFi功能。例如电子设备的设置应用中包括WiFi开关或电子设备的主界面的下拉任务栏中包括WiFi开关,电子设备响应于作用于该WiFi开关的用户操作,启动WiFi功能,即电子设备可以通过WiFi芯片与路由设备建立连接。
在一些实施例中,省电精灵可以在确定用户处于睡眠状态时,进入深度睡眠模式(也可以称为夜间模式或睡眠模式)。其中,用户可以为电子设备的使用者。
在一种实现中,省电精灵可以根据当前时间、智能设备锁屏时长、智能设备静止时长、周围环境光亮度以及用户历史上睡眠习惯等信息,通过智能夜间模式算法判断用户是否处于睡眠状态;在用户处于睡眠状态时,进入深度睡眠模式。
例如,省电精灵可以通过智能夜间模式算法可以每十分钟会对用户的状态进行一次判断,如果判断用户当前处于睡眠状态,则可以根据用户习惯预测用户的起床时间。如果处于夜间模式下用户突然解锁设备,则智能夜间模式算法可以立刻退出夜间模式。如果处于夜间模式下,用户突然开灯,则智能夜间模式算法可以在下一次判断的时候退出夜间模式。
其中,智能夜间模式算法是对用户历史上睡眠习惯进行学习得到的,该学习包括学习用户过去一段时间内的开始睡眠时间、起床时间、用户处于睡眠时周围环境光亮度分布以及用户不处于睡眠时周围环境光亮度分布。
本申请实施例中,在用户处于睡眠状态时才启动WiFi监控功能,该方法可以避免在用户使用电子设备过程中出现网络中断而影响用户使用,在用户处于睡眠状态时减少WiFi异常带来的功耗过大的问题。
在本申请的另一些实施例中,省电精灵也可以在用户未处于睡眠模式下启动下述步骤以实现对WiFi耗电的管控(也即是步骤S11不是必须执行的步骤),本申请实施例对应用场景不作限定,上述深度睡眠模式的场景为本本申请实施例提供的较佳的场景示例,不应构成对本申请实施例的限定。
S12:省电精灵判断数据业务开关是否打开。
进而,省电精灵在数据业务数据开关没有打开时,执行步骤S13;在数据业务数据开关打开时,执行步骤S14。
在一些实施例中,省电精灵可以在进入深度睡眠模式时,判断数据业务开关是否为开启状态。其中,数据业务开关用于开启蜂窝数据。例如,该数据业务开关可以为电子设备上的设置应用中的开关,如“移动网络”中的“移动数据”开关。
示例性的,数据业务开关可以如图7B中的用户界面中的移动网络开关721所示。
在本申请的另一些实施例中,省电精灵也可以不判断数据业务开关是否打开(即不执行步骤S12),直接执行步骤S14。
S13:电子设备结束执行该方法。
在一些实施例中,省电精灵也可以不执行步骤S12和S13,而是直接执行S14,即无论数据业务开关是否打开均进行WiFi的WiFi监控和管理(简称管控)。
需要说明的是,图4所示的实施例中,省电精灵执行上述S12和S13,可以避免在数据业务开关关闭的情况下关闭WiFi导致电子设备没有联网,出现电子设备的时间、位置等需要联网更新的数据无法更新,从而影响用户体验,该方法可以保证电子设备在WiFi管控的过程中至少可以通过蜂窝数据进行联网,不会出现电子设备断网的情况发生,从而保证用户体验效果。
S14:省电精灵通知WiFi FWK启动WiFi监控。
在一些实施例中,省电精灵可以在数据业务数据开关打开时,通知WiFi FWK启动WiFi监控。
S15:WiFi FWK收到省电精灵发送的启动WiFi监控的通知时,启动WiFi监控。
S16:WiFi FWK周期性查询WiFi芯片的芯片状态。
在一些实施例中,WiFi FWK收到省电精灵发送的启动WiFi监控的通知时,周期性查询WiFi芯片的芯片状态。
其中,芯片状态可以包括正常状态和异常状态;本申请实施例对周期时长不做限定,例如,WiFi FWK可以每五分钟查询一次WiFi芯片的芯片状态。
在本申请的另一些实施例中,WiFi FWK也可以在收到省电精灵发送的启动WiFi监控的通知时,仅查询一次。那么,WiFi FWK执行步骤S21和S22时不需要停止WiFi监控;也不需要执行步骤S25和步骤S26。该方法仅在进入深度睡眠模式时对WiFi芯片的芯片状态进行WiFi监控。
需要说明的是,图4所示的实施例中,WiFi FWK是在省电精灵进入深度睡眠模式后周期性对WiFi芯片的芯片状态进行WiFi监控。该方法可以在深度睡眠模式的整个过程中持续对WiFi芯片的芯片状态进行WiFi监控,当WiFi芯片在整个过程中任一时刻出现异常时可以对WiFi进行管理,从而有效的降低电子设备的功耗,避免耗电严重。
S17:WiFi驱动基于路由数据,确定WiFi芯片的芯片状态。
其中,路由数据可以包括单播帧、beacon帧、rekey包、组播包、广播包和addba req帧中的至少一个,还可以包括未示出的其它数据。
关于WiFi驱动确定WiFi芯片的芯片状态的具体过程可以参见图5中的相关内容,此处暂不展开。
S18:WiFi驱动在确定WiFi芯片的芯片状态异常时,通知WiFi FWK。
在一些实施例中,WiFi驱动在确定WiFi芯片的芯片状态异常时,可以向WiFi FWK发送通知消息,该通知消息可以包括指示芯片状态的指示信息,如指示信息为1代表芯片状态异常,指示信息为0代表芯片状态正常。
可选的,WiFi驱动可以在判断WiFi芯片的芯片状态正常时通知WiFi FWK,也可以不通知WiFi FWK,本申请实施例对此不作限定。
可以理解的,由于WiFi芯片在芯片状态正常时不会造成大量耗电,因此,电子设备在WiFi芯片处于正常状态时可以不对WiFi进行管理,那么,在本申请实施例WiFi芯片的芯片状态正常时不通知WiFi FWK,可以减少通知造成的功耗。
S19:WiFi FWK通知省电精灵WiFi芯片的芯片状态异常。
在一些实施例中,WiFi FWK在接收到WiFi驱动发送的指示WiFi芯片的芯片状态异常的通知时,可以向省电精灵发送通知消息,该通知消息可以包括指示芯片状态的指示信息,如指示信息为1代表芯片状态异常,指示信息为0代表芯片状态正常。
S20:省电精灵判断当前是否有可感知业务。
其中,可感知业务可以为用户可感知的业务,也就是说,该业务若暂停会被用户所感知。例如,可感知业务可以包括后台播放、下载和导航等业务。
在一些实施例中,省电精灵在判断当前有可感知业务(即电子设备正在执行可感知业务)时,执行步骤S13,结束执行以下步骤;在判断当前没有可感知业务时,执行以下步骤S21。
示例性的,省电精灵中可以包括异常识别模块,S20具体由异常识别模块执行。例如,在S19中WiFi FWK可以通知省电精灵中的异常识别模块WiFi芯片的芯片状态异常;进而,异常识别模块可以判断当前是否有可感知业务。
本申请实施例中,电子设备在执行可感知业务时,不关闭WiFi可以保证可感知业务不 被中断,可以避免可感知业务中断后影响用户体验。
在本申请的另一些实施例中,WiFi FWK也可以不执行上述S20和S13,直接执行下述步骤S21。
S21:省电精灵通知WiFi FWK关闭WiFi监控和WiFi。
S22:WiFi FWK关闭WiFi,停止WiFi监控。
在一些实施例中,WiFi FWK可以调用WiFi关闭接口以关闭WiFi功能。
本申请实施例中,电子设备在WiFi监控到WiFi出现异常时,将WiFi功能关闭,可以避免WiFi功能造成的功耗过大,耗电严重的问题。
S23:省电精灵退出深度睡眠模式。
在一些实施例中,省电精灵周期性通过智能夜间模式算法判断用户是否处于睡眠状态;在识别到用户不处于睡眠状态时,退出深度睡眠模式。
S24:省电精灵通知WiFi FWK停止WiFi监控。
在一些实施例中,省电精灵退出深度睡眠模式时,通知WiFi FWK停止WiFi监控。
S25:WiFi FWK判断当前是否在执行WiFi监控。
在一些实施例中,WiFi FWK在接收到省电精灵发送的指示停止WiFi监控的通知后,可以判断是否启动过WiFi监控;在WiFi监控启动时,执行步骤S26,在WiFi监控未启动时,执行步骤S13。
S26:WiFi FWK停止WiFi监控。
在一些实施例中,WiFi FWK在判断WiFi监控启动时,停止WiFi监控。
S27:WiFi FWK判断当前WiFi是否被关闭。
在一些实施例中,WiFi FWK可以判断WiFi是否被关闭过(或当前是否处于关闭状态);在WiFi被关闭时,执行步骤S28,在WiFi未被关闭时,执行步骤S13。
S28:WiFi FWK启动WiFi。
在一些实施例中,WiFi FWK可以执行步骤S27确定WiFi被关闭时,启动WiFi。
本申请实施例中,在用户处于睡眠状态时启动WiFi监控功能,在用户处于非睡眠状态时停止WiFi监控且在WiFi被关闭时开启WiFi,可以避免在用户使用电子设备过程中网络中断的情况发生,该方法可以在用户处于睡眠状态时减少WiFi异常带来的功耗过大的问题。
图5示出了本申请实施例提供的另一种降低功耗的方法的流程示意图。如图5所示,该方法包括以下部分或全部步骤:
S1:电子设备启动WiFi异常的监控。
在一些实施例中,电子设备可以在开启WiFi功能后,启动WiFi异常的监控。
在另一些实施例中,电子设备的省电精灵可以在用户处于睡眠状态时判断数据业务开关是否打开,进而,在数据业务数据开关打开时,通知WiFi FWK启动WiFi监控。
S2:电子设备查询WiFi芯片的芯片状态。
在一些实施例中,WiFi FWK收到省电精灵发送的启动WiFi监控的通知时,启动WiFi监控,即开始周期性向WiFi驱动查询WiFi芯片的芯片状态;WiFi驱动可以通过以下步骤 S3至步骤S10确定WiFi芯片的芯片状态(为图4中的步骤S17的一种具体实现)。
S3:电子设备获取beacon帧的接收率对应的标志(简称第一标志)。
其中,beacon帧是由路由设备发送至电子设备的管理帧;第一标志用于指示beacon帧的接收率是否出现异常,例如,第一标志可以为0,0用于指示beacon帧的接收率正常;第一标志可以为1,1用于指示beacon帧的接收率异常。其中,beacon帧的接收率也可以称为信标帧接收率。
示例性的,电子设备获取beacon帧的接收率对应的标志的具体过程可以参见以下步骤S31至S35。
S31:电子设备判断beacon帧的接收率是否异常。
进而,电子设备在确定beacon帧的接收率异常时,执行步骤S33;在确定beacon帧的接收率正常时,执行步骤S32。
在一些实施例中,电子设备可以将预设时间内实际收到beacon帧数除以应收beacon帧数(也可以称为预设帧数),得到beacon接收率(也可以称为信标帧接收率),若计算得到的beacon接收率低于预设接收率,则认为beacon帧的接收率异常。其中,应收beacon帧数可以为预设帧数。
例如,预设时间为5min,预设接收率可以为60%,那么,电子设备可以在启动WiFi监控后,每五分钟计算一次beacon接收率,若计算得到的beacon接收率低于60%,则确定beacon帧的接收率异常。
需要说明的是,若电子设备接收到较少的beacon帧数会导致WiFi芯片工作时间长,导致电子设备耗电严重,例如接收率低于60%的用户可以为称为问题用户,问题用户0-6点的耗电量大概为7%至8%。本申请实施例可以识别出该问题用户,在符合若干条件(如图4所示的数据开关开启和/或没有可感知业务等)的情况下关闭WiFi,可以避免WiFi芯片工作时间长,可以有效减少电子设备的耗电。
S32:电子设备将第一标志置0。
也就是说,电子设备获取的第一标志为0。其中,0用于指示beacon帧的接收率正常。
S33:电子设备判断beacon帧的接收率对应的异常次数(简称第一异常次数)是否大于N1次。进而,电子设备在确定第一异常次数大于N1次时,执行步骤S35;在确定beacon帧的接收率正常时,执行步骤S34。其中,N1为正整数。
在一些实施例中,电子设备可以从存储中获取记录的第一异常次数,在该异常次数加1后得到更新的第一异常次数,将更新后的第一异常次数与N1比较,从而确定beacon帧的接收率对应的异常次数是否大于N1次。
S34:电子设备将记录的第一异常次数加1。
S35:电子设备将第一标志置1。
也就是说,电子设备获取的第一标志为1。其中,1用于指示beacon帧的接收率异常。
S4:电子设备获取TIM位错误置位的频率对应的标志(简称第二标志)。
其中,TIM位是指路由设备发送至电子设备的beacon帧中该电子设备对应的标志位,该标志位被置位用于指示路由设备在接下来预设时间内将发送数据给该电子设备。第二标志用于指示TIM位错误置位的频率是否出现异常,例如,第二标志可以为0,0用于指示 TIM位错误置位的频率正常,第二标志可以为1,1用于指示TIM位错误置位的频率异常。
其中,若电子设备的beacon帧中TIM位被置位,但等待预设时间(也可以称为第一时间段)没有接收到来自路由设备发送的数据,则认为TIM位错误置位;TIM位错误置位的频率是指预设时间内TIM位错误置位的次数。如第一时间段可以为60ms。
例如,电子设备每间隔1s接收到一个beacon帧,若该beacon帧中TIM位被置位,则电子设备会等待60ms,若60ms内电子设备接收到该路由设备发送的数据,则该beacon没有被错位置位,反之则被错位置位;若电子设备1s中接收到10个beacon帧,10个beacon帧中有8个错误,则电子设备可以确定TIM位错误置位的频率为每秒钟8帧。
需要说明的是,若beacon帧中TIM位被错误置位或一直置位(即使没有数据发送也将TIM位都置上)时,导致WiFi芯片不下电,会引起严重功耗问题。本申请实施例中,电子设备通过获取TIM位错误置位的频率,在该频率过大时关闭WiFi功能,即让WiFi芯片下电,可以避免出现严重功耗,可以有效减少耗电。
示例性的,电子设备获取TIM位错误置位的频率对应的标志的具体过程可以参见以下步骤S41至S45。
S41:电子设备判断TIM位错误置位的频率是否异常。进而,电子设备在确定TIM位错误置位的频率异常时,执行步骤S43;在确定TIM位错误置位的频率正常时,执行步骤S42。
在一些实施例中,电子设备可以计算预设时间内(也可以称为第二时间段)接收到的beacon帧中TIM位错误的频率,若该频率大于预设频率,则确定TIM位错误置位的频率异常,反之为正常。其中,电子设备在接收beacon帧后预设时间内没有接收到数据则确定该beacon帧中TIM位错误。
也就是说,在第二时间段内接收到TIM位错误的信标帧的次数大于第一预设次数时,确定TIM位错误置位的频率异常。
示例性的,如第二时间段可以为1s,第一预设次数为8,则若电子设备可以每秒计算一次TIM位错误置位的频率,假设在1s中接收到10个beacon帧,10个beacon帧中有8个错误,则电子设备可以确定当前出现TIM位错误置位的频率异常。
S42:电子设备将第二标志置0。
也就是说,电子设备获取的第二标志为0。其中,0用于指示TIM位错误置位的频率正常。
S43:电子设备判断TIM位错误置位的频率对应的异常次数(简称第二异常次数)是否大于N2次。进而,电子设备在确定第二异常次数大于N2次时,执行步骤S45;在确定TIM位错误置位的频率正常时,执行步骤S44。其中,N2为正整数。
在一些实施例中,电子设备可以从存储中获取记录的第二异常次数,在该异常次数加1后得到更新的第二异常次数,将更新后的第二异常次数与N2比较,从而确定TIM位错误置位的频率对应的异常次数是否大于N2次。
S44:电子设备将记录的第二异常次数加1。
S45:电子设备将第二标志置1。
也就是说,电子设备获取的第二标志为1。其中,1用于指示TIM位错误置位的频率异常。
S5:电子设备获取rekey包的发送频率对应的标志(简称第三标志)。
其中,rekey包是路由设备发送至电子设备的广播密码更新帧;rekey包的发送频率可以是指路由设备配置的rekey包发送频率(即路由设备发送rekey包的频率),也即是,电子设备接收rekey包的接收频率。需要说明的是,本申请的部分实施例中,由于实际情况等原因导致路由设备发送rekey包的频率不等于电子设备接收rekey包的接收频率,那么,电子设备可以将电子设备接收rekey包的接收频率确定为判断rekey包是否异常的频率。其中,rekey包的发送频率也可以称为广播密钥更新帧的发送频率。
其中,第三标志用于指示rekey包的发送频率是否出现异常,例如,第三标志可以为0,0用于指示rekey包的发送频率正常,第三标志可以为1,1用于指示rekey包的发送频率异常。
示例性的,电子设备获取rekey包的发送频率对应的标志的具体过程可以参见以下步骤S51至S55。
S51:电子设备判断rekey包的发送频率是否异常。
进而,电子设备在确定rekey包的发送频率异常时,执行步骤S53;在确定rekey包的发送频率正常时,执行步骤S52。
在一些实施例中,电子设备可以计算rekey包的发送间隔时间,若rekey包的发送间隔时间小于预设时间间隔(如30s),则确定rekey包的发送频率异常,反之则正常。
在另一些实施例中,当连续N个时间段内每个时间段中广播密钥更新帧的个数均超过第一预设个数时,电子设备确定广播密钥更新帧的发送频率出现异常,N为正整数。
例如N为10,N个时间段中每一个时间段为1分钟,第一预设个数为2,若电子设备可以计算每分钟接收到的rekey包的个数,若连续十分钟内每分钟接收到至少两个rekey包,则确定rekey包的发送频率异常,反之则正常。
需要说明的是,若电子设备频繁接收到路由设备发送的rekey包,即rekey包的发送频率过高,会导致wifi芯片休眠中断被唤醒,导致电子设备耗电严重。本申请实施例中,电子设备通过获取rekey包的发送频率,在该频率过大(即异常)时关闭WiFi功能,可以避免电子设备出现严重功耗的情况,可以有效减少耗电。
S52:电子设备将第三标志置0。
也就是说,电子设备获取的第三标志为0。其中,0用于指示rekey包的发送频率正常。
S53:电子设备判断rekey包的发送频率对应的异常次数(简称第三异常次数)是否大于N3次。进而,电子设备在确定第三异常次数大于N3次时,执行步骤S55;在确定rekey包的发送频率正常时,执行步骤S54。其中,N3为正整数。
在一些实施例中,电子设备可以从存储中获取记录的第三异常次数,在该异常次数加1后得到更新的第三异常次数,将更新后的第三异常次数与N3比较,从而确定TIM位错误置位的频率对应的异常次数是否大于N3次。
S54:电子设备将记录的第三异常次数加1。
S55:电子设备将第三标志置1。
也就是说,电子设备获取的第三标志为1。其中,1用于指示rekey包的发送频率异常。
S6:电子设备获取addba req帧的发送频率对应的标志(简称第四标志)。
其中,addba req帧是路由设备发送至电子设备的管理帧;addba req帧的发送频率可以是指路由设备发送rekey包的频率,也即是,电子设备接收rekey包的接收频率。其中,addba req帧的发送频率也可以称为块请求帧的发送频率。
需要说明的是,本申请的部分实施例中,由于实际情况等原因导致路由设备发送addba req帧的频率不等于电子设备接收addba req帧的接收频率,那么,电子设备可以将电子设备接收addba req帧的接收频率确定为判断rekey包是否异常的频率。
其中,第四标志用于指示addba req帧的发送频率是否出现异常,例如,第四标志可以为0,0用于指示addba req帧的发送频率正常,第四标志为1时指示addba req帧的发送频率异常。
示例性的,电子设备获取addba req帧的发送频率的标志的具体过程可以参见以下步骤S61至S65。
S61:电子设备判断addba req帧的发送频率是否异常。
进而,电子设备在确定addba req帧的发送频率异常时,执行步骤S63;在确定addba req帧的发送频率正常时,执行步骤S62。
在一些实施例中,电子设备可以计算addba req帧的发送间隔时间,若addba req帧的发送间隔时间小于预设时间间隔,则确定addba req帧的发送频率异常,反之则正常。
在另一些实施例中,当连续M个时间段内每个时间段中广播密钥更新帧的个数均超过第二预设个数时,电子设备确定块请求帧的发送频率出现异常,M为正整数。
例如,M为10,M个时间段中每个时间段为1分钟,第二预设个数为2,电子设备可以计算每分钟接收到的addba req帧的帧数,若连续十分钟内每分钟接收到至少两帧addba req帧,则确定addba req帧的发送频率异常,反之则正常。
需要说明的是,若电子设备频繁接收到路由设备发送的addba req帧,即addba req帧的发送频率过高,会导致WiFi芯片一直不休眠或休眠时间过短,导致电子设备耗电严重。本申请实施例中,电子设备通过获取addba req帧的发送频率,在该频率过大(即异常)时关闭WiFi功能,可以避免电子设备出现严重功耗的情况,可以有效减少耗电。
S62:电子设备将第四标志置0。
也就是说,电子设备获取的第四标志为0。其中,0用于指示addba req帧的发送频率正常。
S63:电子设备判断addba req帧的发送频率对应的异常次数(简称第四异常次数)是否大于N4次。进而,电子设备在确定第四异常次数大于N4次时,执行步骤S65;在确定addba req帧的发送频率正常时,执行步骤S64。其中,N4为正整数。
在一些实施例中,电子设备可以从存储中获取记录的第四异常次数,在该异常次数加1后得到更新的第四异常次数,将更新后的第四异常次数与N4比较,从而确定TIM位错误置位的频率对应的异常次数是否大于N4次。
S64:电子设备将记录的第四异常次数加1。
S65:电子设备将第四标志置1。
也就是说,电子设备获取的第四标志为1。其中,1用于指示addba req帧的发送频率异常。
S7:电子设备获取断链频率对应的标志(简称第五标志)。
其中,断链是指电子设备与路由设备之间断开通信,断链频率是在预设时间段内电子设备与路由设备断开通信的次数。需要说明的是,断链频繁可以是因为路由设备设置原因导致的频繁踢电子设备,也可以是其他原因。
其中,第五标志用于指示断链频率是否出现异常,例如,第五标志可以为0,0用于指示断链频率正常;第五标志可以为1,1用于指示断链频率异常。
示例性的,电子设备获取断链频率的标志的具体过程可以参见以下步骤S71至S75。
S71:电子设备判断断链频率是否异常。
进而,电子设备在确定断链频率异常时,执行步骤S73;在确定断链频率正常时,执行步骤S72。
示例性的,电子设备可以在识别到电子设备与路由设备在10分钟内断开五次时,确定断链频率异常。
需要说明的是,若路由设备频繁踢电子设备,电子设备在被踢后又自动与路由设备重连,这样往复造成较严重的功耗问题。本申请实施例中,电子设备通过获取断链频率,在断链频率过大(即异常)时关闭WiFi功能,可以避免电子设备出现频繁断链后重连导致严重功耗的情况,可以有效减少耗电。
S72:电子设备将第五标志置0。
也就是说,电子设备获取的第五标志为0。其中,0用于指示断链频率正常。
S73:电子设备判断断链频率对应的异常次数(简称第五异常次数)是否大于N5次。进而,电子设备在确定第五异常次数大于N5次时,执行步骤S75;在确定断链频率正常时,执行步骤S74。其中,N5为正整数。
在一些实施例中,电子设备可以从存储中获取记录的第五异常次数,在该异常次数加1后得到更新的第五异常次数,将更新后的第五异常次数与N5比较,从而确定TIM位错误置位的频率对应的异常次数是否大于N5次。
S74:电子设备将记录的第五异常次数加1。
S75:电子设备将第五标志置1。
也就是说,电子设备获取的第五标志为1。其中,1用于指示断链频率异常。
S8:电子设备获取AMSDU组播包的发送频率对应的标志(简称第六标志)。
其中,AMSDU组播包是路由设备发送至电子设备的组播包;AMSDU组播包的发送频率可以是指路由设备发送AMSDU组播包的频率,也即是,电子设备接收AMSDU组播包的接收频率。其中,AMSDU组播包也可以称为聚合组播包的发送频率。
需要说明的是,本申请的部分实施例中,由于实际情况等原因导致路由设备发送AMSDU组播包的频率不等于电子设备接收AMSDU组播包的接收频率,那么,电子设备可以将电子设备接收AMSDU组播包的接收频率确定为判断AMSDU组播包是否异常的频率。
其中,第六标志用于指示AMSDU组播包的发送频率是否出现异常,例如,第六标志可以为0,0用于指示AMSDU组播包的发送频率正常;第六标志可以为1,1用于指示AMSDU组播包的发送频率异常。
示例性的,电子设备获取AMSDU组播包的发送频率对应的标志的具体过程可以参见以下步骤S81至S85。
S81:电子设备判断AMSDU组播包的发送频率是否异常。
进而,电子设备在确定AMSDU组播包的发送频率异常时,执行步骤S83;在确定AMSDU组播包的发送频率正常时,执行步骤S82。
在一些实施例中,当连续K个时间段内每个时间段从无线访问接入点接收到的聚合组播包的个数均大于第三预设个数时,电子设备确定聚合组播包的发送频率异常,K为正整数。
示例性的,K为10,K个时间段内每个时间段为1分钟,第三预设个数为2,那么,若电子设备连续十分钟内每分钟接收到两次AMSDU组播包,则电子设备可以确定AMSDU组播包的发送频率异常。
需要说明的是,若电子设备频繁接收到路由设备发送的AMSDU组播包,即AMSDU组播包的发送频率过高,会导致WiFi芯片一直不休眠或休眠时间过短,导致电子设备耗电严重。本申请实施例中,电子设备通过获取AMSDU组播包的发送频率,在该频率过大(即异常)时关闭WiFi功能,可以避免电子设备出现严重功耗的情况,可以有效减少耗电。
S82:电子设备将第六标志置0。
也就是说,电子设备获取的第六标志为0。其中,0用于指示AMSDU组播包的发送频率正常。
S83:电子设备判断AMSDU组播包的发送频率对应的异常次数(简称第六异常次数)是否大于N6次。进而,电子设备在确定第六异常次数大于N6次时,执行步骤S85;在确定AMSDU组播包的发送频率正常时,执行步骤S84。其中,N6为正整数。
在一些实施例中,电子设备可以从存储中获取记录的第六异常次数,在该异常次数加1后得到更新的第六异常次数,将更新后的第六异常次数与N6比较,从而确定TIM位错误置位的频率对应的异常次数是否大于N6次。
S84:电子设备将记录的第六异常次数加1。
S85:电子设备将第六标志置1。
也就是说,电子设备获取的第六标志为1。其中,1用于指示AMSDU组播包的发送频率异常。
S9:电子设备获取APF过滤报文对应的标志(简称第七标志)。
其中,第七标志用于指示APF过滤报文是否异常,其中,报文可以包括广播包和组播包。
例如,第七标志可以为0,0用于指示APF过滤报文正常;第七标志可以为1,1用于指示APF过滤报文异常。其中,APF过滤报文也可以称为过滤后的报文情况,若APF过滤报文异常即是过滤后的报文情况出现异常。
示例性的,电子设备获取APF过滤报文对应的标志的具体过程可以参见以下步骤S91至S95。
S91:电子设备判断APF过滤报文是否异常。
进而,电子设备在确定APF过滤报文出现异常时,执行步骤S93;在确定APF过滤报 文正常时,执行步骤S92。
在一些实施例中,当连续L个时间段内每个时间段中数据包唤醒WiFi芯片的次数均大于第二预设次数时,电子设备确定过滤后的报文情况出现异常,L为正整数。
示例性的,L为10,L个时间段内每个时间段为1分钟,第二预设次数为2,电子设备连续十分钟内每分钟有两次广播包或组播包唤醒WiFi芯片,则电子设备可以确定APF过滤报文出现异常。
需要说明的是,若APF过滤报文异常,会导致WiFi芯片被唤醒,WiFi芯片处于一直不休眠或休眠时间过短的状态,导致电子设备耗电严重。本申请实施例中,电子设备通过判断APF过滤报文是否异常,在APF过滤报文异常时关闭WiFi功能,可以避免电子设备出现严重功耗的情况,可以有效减少耗电。
S92:电子设备将第七标志置0。
也就是说,电子设备获取的第七标志为0。其中,0用于指示APF过滤报文正常。
S93:电子设备判断APF过滤报文对应的异常次数(简称第七异常次数)是否大于N7次。进而,电子设备在确定第七异常次数大于N7次时,执行步骤S95;在确定APF过滤报文正常时,执行步骤S94。其中,N7为正整数。
在一些实施例中,电子设备可以从存储中获取记录的第七异常次数,在该异常次数加1后得到更新的第七异常次数,将更新后的第七异常次数与N7比较,从而确定APF过滤报文对应的异常次数是否大于N7次。
S94:电子设备将记录的第七异常次数加1。
S95:电子设备将第七标志置1。
也就是说,电子设备获取的第七标志为1。其中,1用于指示APF过滤报文异常。
需要说明的是,本申请实施例对上述步骤S3至步骤S9的执行先后不做限定,例如步骤S3至步骤S9可以是同时执行的;本申请实施例对上述N1至N7这7个数值的大小不作限定,例如这7个数值可以均不同。
S10:电子设备判断第一标志至第七标志这七个标志中是否有标志置1。
进而,在存在至少一个标志置1时,执行步骤S11;在不存在任一标志置1时,执行步骤S12。
S11:电子设备将WiFi芯片的芯片状态异常上报省电精灵。
在一些实施例中,电子设备在上述七个标志中存在至少一个标志置1,确定WiFi芯片的芯片状态异常,进而,向省电精灵发送指示WiFi芯片的芯片状态异常的指示信息,示例性的,该指示信息可以为1。
在一种实现中,WiFi驱动在确定WiFi芯片的芯片状态异常时,可以向WiFi FWK发送指示WiFi芯片的芯片状态异常的通知;进而,WiFi FWK在接收到WiFi驱动发送的指示WiFi芯片的芯片状态异常的通知时,可以向省电精灵发送通知消息,该通知消息可以包括指示芯片状态异常的指示信息,如指示信息为1代表芯片状态异常。
S12:电子设备结束执行该方法。
S13:电子设备判断当前是否有可感知业务。
在一些实施例中,电子设备的省电精灵中的异常识别模块在接收到WiFi芯片的芯片状 态异常的通知时,可以判断当前是否有可感知业务(也可以称为第一业务)。进而,在有可感知业务时,执行步骤S12;在没有可感知业务时,执行步骤S14。
S14:电子设备关闭WiFi。
在一些实施例中,电子设备可以通过上述WiFi FWK调用相关接口关闭WiFi功能。
本申请实施例提供的降低功耗的方法在电子设备上可体现成一种“省电”功能。
在一些实施例中,上述“省电”功能可以是电子设备默认执行的,即电子设备没有提供给用户选择是否开启该“省电”功能的开关;上述“省电”功能也可以是通过电子设备上提供的“省电”功能对应的开关开启的,也就是说,用户可以自行决定是否开启该“省电”功能,即是否执行上述降低功耗的方法。
示例性的,该“省电”功能可以由省电精灵对应的应用实现,用户可以安装或卸载该应用;也可以为电子设备中系统应用(如设置应用)中的一个功能,例如,设置应用中包括该“省电”功能对应的开关,用户通过该开关可以打开或关闭该“省电”功能。
以下示例性的介绍电子设备提供该“省电”功能时的用户交互(user interface,UI)界面。
需要说明的是,本申请实施例中,用户操作可以为用户的触控操作(例如点击操作、长按操作、上滑操作、下滑操作或侧滑操作),也可以为非接触操作(例如隔空手势),还可以为用户的语音指令,本申请实施例对此不做具体限制。
图6A至图6C示例性示出一种电子设备开启“省电”功能的相关UI。其中:
图6A示出了电子设备上的用于展示已安装应用程序的示例性用户界面61。
该用户界面61显示有:状态栏、省电精灵应用的图标610、时钟应用的图标以及其他应用程序的图标等。其中,状态栏可包括:移动通信信号(又可称为蜂窝信号)的一个或多个信号强度指示符、Wi-Fi信号的一个或多个信号强度指示符,电池状态指示符、时间指示符等。
如图6A所示,电子设备可以检测到作用于图标610的用户操作,响应于该操作,电子设备可以显示如图6B所示的用户界面62。应理解,该用户界面62为示例性示出的省电精灵应用的应用界面,不应造成本申请实施例的限定。
如图6B所示,该用户界面62可包括WiFi省电开关620。该WiFi省电开关620用于开启或关闭上述“省电”功能。需要说明的是,该用户界面62还可以包括其它省电功能,本申请实施例对此不作限定。用户界面62示例性示出了WiFi省电开关620为关闭状态,在本申请的其它实施例中,用户打开省电精灵时,该WiFi省电开关也可以为开启状态,即WiFi省电开关为开启状态。
如图6B所示,电子设备可以检测到作用于WiFi省电开关620的用户操作,响应于该操作,电子设备可以启动上述“省电”功能(即执行上述降低功耗的方法),显示如图6C所示的用户界面63。该用户界面63可包括WiFi省电开关630,其中,WiFi省电开关630为开启状态,用于指示WiFi省电开关为开启状态。
图7A至图7C示例性示出另一种电子设备开启“省电”功能的相关UI。其中:
图7A示出了电子设备上的用于展示已安装应用程序的示例性用户界面71。
该用户界面71显示有:状态栏、设置应用的图标710、时钟应用的图标以及其他应用程序的图标等。其中,状态栏可包括:移动通信信号(又可称为蜂窝信号)的一个或多个信号强度指示符、Wi-Fi信号的一个或多个信号强度指示符,电池状态指示符、时间指示符等。
如图7A所示,电子设备可以检测到作用于图标710的用户操作,响应于该操作,电子设备可以显示如图7B所示的用户界面72。应理解,该用户界面72为示例性示出的设置应用的应用界面,不应造成本申请实施例的限定。
如图7B所示,该用户界面72可包括WiFi省电开关720、移动网络开关721和搜索栏722。其中,该WiFi省电开关720用于开启或关闭上述“省电”功能;移动网络开关721用于开启蜂窝数据,移动网络开关721可以为上述数据业务开关;搜索栏722用于搜索设置应用中的设置项。
需要说明的是,在本申请的其它实施例中,移动网络开关721可以还包括选择SIM卡的选项等,本申请实施例对此不作限定;该用户界面72还可以包括其它设置功能,如WiFi功能开关,该开关用于开启WiFi功能以接入WiFi网络,本申请实施例对其它设置功能不作限定。
用户界面72示例性示出了WiFi省电开关720为关闭状态,在本申请的其它实施例中,用户打开设置应用时,该WiFi省电开关也可以为开启状态,即WiFi省电开关为开启状态。
如图7B所示,电子设备可以检测到作用于WiFi省电开关720的用户操作,响应于该操作,电子设备可以启动上述“省电”功能(即执行上述降低功耗的方法),显示如图7C所示的用户界面73。该用户界面73可包括WiFi省电开关730,其中,WiFi省电开关730为开启状态,用于指示WiFi省电开关为开启状态。
本申请的说明书和权利要求书及附图中的术语“用户界面(user interface,UI)”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。应用程序的用户界面是通过java、可扩展标记语言(extensible markup language,XML)等特定计算机语言编写的源代码,界面源代码在终端设备上经过解析,渲染,最终呈现为用户可以识别的内容,比如图片、文字、按钮等控件。控件(control)也称为部件(widget),是用户界面的基本元素,典型的控件有工具栏(toolbar)、菜单栏(menu bar)、文本框(text box)、按钮(button)、滚动条(scrollbar)、图片和文本。界面中的控件的属性和内容是通过标签或者节点来定义的,比如XML通过<Textview>、<ImgView>、<VideoView>等节点来规定界面所包含的控件。一个节点对应界面中一个控件或属性,节点经过解析和渲染之后呈现为用户可视的内容。此外,很多应用程序,比如混合应用(hybrid application)的界面中通常还包含有网页。网页,也称为页面,可以理解为内嵌在应用程序界面中的一个特殊的控件,网页是通过特定计算机语言编写的源代码,例如超文本标记语言(hyper text markup language,HTML),层叠样式表(cascading style sheets,CSS),java脚本(JavaScript,JS)等,网页源代码可以由浏览器或与浏览器功能类似的网页显示组件加载和显示为用户可识别的内容。网页所包含的具体内容也是通过网页源代码中的标签或者节点来定义的,比如HTML通过<p>、<img>、<video>、<canvas>来定义网 页的元素和属性。
用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个图标、窗口、控件等界面元素,其中控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。
应理解,本申请提供的上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
本申请还提供一种电子设备,该电子设备可以包括:存储器和处理器。其中,存储器可用于存储计算机程序;处理器可用于调用存储器中的计算机程序,以使得该电子设备执行上述任意一个实施例中的方法。
本申请还提供了一种芯片系统,芯片系统包括至少一个处理器,用于实现上述任意一个实施例中电子设备执行的方法中所涉及的功能。在一种可能的设计中,芯片系统还包括存储器,存储器用于保存程序指令和数据,存储器位于处理器之内或处理器之外。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请实施例并不限定。示例性地,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型,以及存储器与处理器的设置方式不作具体限定。
示例性地,该芯片系统可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。
本申请还提供一种计算机程序产品,计算机程序产品包括:计算机程序(也可以称为代码,或指令),当计算机程序被运行时,使得计算机执行上述任一个实施例中电子设备执行的方法。
本申请还提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序(也可以称为代码,或指令)。当计算机程序被运行时,使得计算机执行上述任一个实施例中电子设备执行的方法。
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包 括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
总之,以上仅为本申请技术方案的实施例而已,并非用于限定本申请的保护范围。凡根据本申请的揭露,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (17)

  1. 一种降低功耗的方法,其特征在于,应用于电子设备,所述电子设备包括无线保真WiFi芯片,所述WiFi芯片用于实现WiFi功能,所述方法包括:
    所述电子设备开启WiFi功能;
    所述电子设备接收无线访问接入点发送的信标帧;
    所述电子设备基于接收到的信标帧,确定所述WiFi芯片的芯片状态;
    所述电子设备在所述芯片状态为异常状态时,关闭所述电子设备的WiFi功能。
  2. 根据权利要求1所述的方法,其特征在于,所述信标帧包括数据待传指示信息TIM位,所述电子设备基于接收到的信标帧,确定所述WiFi芯片的芯片状态,包括:
    所述电子设备在接收到TIM位被置位的信标帧后第一时间段内均没有接收到数据,确定所述信标帧的TIM位错误;所述TIM位被置位的信标帧用于指示所述无线访问接入点将发送数据至所述电子设备;
    当所述电子设备在第二时间段内接收到所述TIM位错误的信标帧的次数大于第一预设次数时,确定所述芯片状态为异常状态。
  3. 根据权利要求1或2所述的方法,其特征在于,所述电子设备基于接收到的信标帧,确定所述WiFi芯片的芯片状态,包括:
    所述电子设备计算第三时间段内接收到的信标帧数与预设帧数的比值,得到信标帧接收率;
    当所述信标帧接收率低于预设接收率时,所述电子设备确定所述芯片状态为异常状态。
  4. 根据权利要求1所述的方法,其特征在于,所述电子设备基于接收到的信标帧,确定所述WiFi芯片的芯片状态,包括:
    所述电子设备获取第一数据,所述第一数据包括广播密钥更新帧的发送频率、块请求帧的发送频率、断链频率、聚合组播包的发送频率和过滤后的报文情况中的至少一个;
    当所述电子设备确定所述接收到的信标帧和所述第一数据中至少一个出现异常时,确定所述芯片状态为异常状态。
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    当所述第四时间段内接收到所述TIM位错误的信标帧的次数大于所述第一预设次数,或者,所述信标帧接收率低于所述预设接收率时,所述电子设备确定所述接收到的信标帧出现异常。
  6. 根据权利要求4或5所述的方法,其特征在于,所述方法还包括:
    所述电子设备接收所述无线访问接入点发送的所述广播密钥更新帧;
    当连续N个时间段内每个时间段中所述广播密钥更新帧的个数均超过第一预设个数时,所述电子设备确定所述广播密钥更新帧的发送频率出现异常,所述N为正整数。
  7. 根据权利要求4-6中任一项所述的方法,其特征在于,所述方法还包括:
    所述电子设备接收所述无线访问接入点发送的所述块请求帧;
    当连续M个时间段内每个时间段中所述广播密钥更新帧的个数均超过第二预设个数时,所述电子设备确定所述块请求帧的发送频率出现异常,所述M为正整数。
  8. 根据权利要求4-7中任一项所述的方法,其特征在于,所述方法还包括:
    当连续K个时间段内每个时间段从所述无线访问接入点接收到的聚合组播包的个数均大于第三预设个数时,所述电子设备确定所述聚合组播包的发送频率异常,所述K为正整数。
  9. 根据权利要求4-8中任一项所述的方法,其特征在于,所述方法还包括:
    所述电子设备开启安卓包过滤APF功能;
    所述电子设备接收所述无线访问接入点发送的数据包,所述数据包包括广播包和组播包;
    当连续L个时间段内每个时间段中所述数据包唤醒所述WiFi芯片的次数均大于第二预设次数时,所述电子设备确定所述过滤后的报文情况出现异常,所述L为正整数。
  10. 根据权利要求1-9中任一项所述的方法,其特征在于,所述电子设备基于接收到的信标帧,确定所述WiFi芯片的芯片状态,包括:
    所述电子设备在进入睡眠模式后,基于所述接收到的信标帧确定所述WiFi芯片的芯片状态。
  11. 根据权利要求10所述的方法,其特征在于,在所述关闭所述电子设备的WiFi功能之后,所述方法还包括:
    当所述电子设备在退出所述睡眠模式后,开启所述WiFi功能。
  12. 根据权利要求1-11中任一项所述的方法,其特征在于,所述电子设备基于接收到的信标帧,确定所述WiFi芯片的芯片状态,包括:
    所述电子设备确定所述电子设备的移动网络的开启情况;
    当所述电子设备在所述移动网络开启时,基于所述接收到的信标帧确定所述WiFi芯片的芯片状态。
  13. 根据权利要求1-12中任一项所述的方法,其特征在于,所述电子设备在所述芯片状态为异常状态时,关闭所述电子设备的WiFi功能,包括:
    所述电子设备在WiFi芯片的芯片状态为异常状态时,确定第一业务的执行情况;所述第一业务为WiFi功能关闭时无法执行的业务;
    所述电子设备在确定当前未执行所述第一业务时,关闭所述电子设备的WiFi功能。
  14. 根据权利要求1-13中任一项所述的方法,其特征在于,所述电子设备基于接收到的信标帧,确定所述WiFi芯片的芯片状态,包括:
    所述电子设备周期性通过WiFi驱动获取所述WiFi芯片的芯片状态。
  15. 根据权利要求14所述的方法,其特征在于,在所述关闭所述电子设备的WiFi功能之后,所述方法还包括:
    所述电子设备停止周期性通过WiFi驱动获取所述WiFi芯片的芯片状态。
  16. 一种电子设备,其特征在于,包括一个或多个处理器和一个或多个存储器;其中,一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得执行如权利要求1-15任一项的方法。
  17. 一种计算机可读存储介质,包括指令,其特征在于,当指令在电子设备上运行时,使得执行如权利要求1-15任一项的方法。
PCT/CN2024/081171 2023-06-15 2024-03-12 一种降低功耗的方法、设备和系统 Ceased WO2024255345A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310713807.9 2023-06-15
CN202310713807.9A CN119155774A (zh) 2023-06-15 2023-06-15 一种降低功耗的方法、设备和系统

Publications (2)

Publication Number Publication Date
WO2024255345A1 true WO2024255345A1 (zh) 2024-12-19
WO2024255345A9 WO2024255345A9 (zh) 2025-02-20

Family

ID=93813999

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/081171 Ceased WO2024255345A1 (zh) 2023-06-15 2024-03-12 一种降低功耗的方法、设备和系统

Country Status (2)

Country Link
CN (1) CN119155774A (zh)
WO (1) WO2024255345A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110703897A (zh) * 2019-08-29 2020-01-17 华为技术有限公司 控制方法、装置、芯片与设备
CN112867107A (zh) * 2019-11-28 2021-05-28 华为技术有限公司 一种无线保真wifi芯片控制方法及其相关设备
CN114650625A (zh) * 2022-03-18 2022-06-21 爱科微半导体(上海)有限公司 wifi接收机的工作模式确定方法、装置、设备及存储介质
CN114650624A (zh) * 2022-03-18 2022-06-21 爱科微半导体(上海)有限公司 wifi接收机的工作模式确定方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110703897A (zh) * 2019-08-29 2020-01-17 华为技术有限公司 控制方法、装置、芯片与设备
CN112867107A (zh) * 2019-11-28 2021-05-28 华为技术有限公司 一种无线保真wifi芯片控制方法及其相关设备
WO2021103893A1 (zh) * 2019-11-28 2021-06-03 华为技术有限公司 一种无线保真wifi芯片控制方法及其相关设备
CN114650625A (zh) * 2022-03-18 2022-06-21 爱科微半导体(上海)有限公司 wifi接收机的工作模式确定方法、装置、设备及存储介质
CN114650624A (zh) * 2022-03-18 2022-06-21 爱科微半导体(上海)有限公司 wifi接收机的工作模式确定方法、装置、设备及存储介质

Also Published As

Publication number Publication date
WO2024255345A9 (zh) 2025-02-20
CN119155774A (zh) 2024-12-17

Similar Documents

Publication Publication Date Title
CN110312985B (zh) 电子设备和用于显示其屏幕的方法
US11861382B2 (en) Application starting method and apparatus, and electronic device
CN114286165B (zh) 一种显示设备、移动终端、投屏数据传输方法及系统
US10631361B2 (en) Method and apparatus for providing user with information received by electronic device
WO2021227770A1 (zh) 应用窗口显示方法和电子设备
WO2021129253A1 (zh) 显示多窗口的方法、电子设备和系统
US11995317B2 (en) Method and apparatus for adjusting memory configuration parameter
WO2022127661A1 (zh) 应用共享方法、电子设备和存储介质
JP7571961B2 (ja) インターフェースディスプレイ方法及び電子デバイス
US20240264882A1 (en) Application running method and related device
WO2023207761A1 (zh) 外设控制方法、电子设备及系统
EP2818971A2 (en) Electronic device, method for controlling electronic device, and program
CN116450069A (zh) 熄屏显示的控制方法、电子设备及介质
US20150135136A1 (en) Information processing apparatus, information processing method, and storage medium
CN114816031B (zh) 终端设备的省电方法、终端设备及介质
CN115421662A (zh) 内存数据的回写方法、装置及设备
WO2024255345A9 (zh) 一种降低功耗的方法、设备和系统
CN117727254B (zh) 一种显示控制方法及电子设备
EP4610821A1 (en) Window adjustment method and related apparatus
CN114339966B (zh) 用于数据传输的界面控制方法、装置、介质与电子设备
CN115100994B (zh) 一种医用阅片显示器的控制方法、上位机及终端
EP4246308A1 (en) Always-on display control method, electronic device and storage medium
CN113641431B (zh) 二维码的增强显示的方法和终端设备
WO2023130927A1 (zh) 熄屏显示的控制方法、电子设备及存储介质
WO2021115080A1 (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: 24822303

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE