Power consumption reducing method, device, and system

By receiving beacon frames to determine the status of the WiFi chip and turn off the WiFi function, the high power consumption problem of electronic devices due to the lack of sleep or short sleep time of the WiFi chip, achieving a significant reduction in power consumption.

WO2024255345A9PCT designated stage expired Publication Date: 2025-02-20HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/081171
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-15
Filing Date
2024-03-12
Publication Date
2025-02-20

AI Technical Summary

Technical Problem

When an electronic device is connected to a Wi-Fi router, due to the mismatch between the device and the router or the router configuration problem, the WiFi chip does not sleep or has a short sleep time, resulting in high success and significant power consumption.

Method used

By receiving beacon frames sent by the wireless access access point, the electronic device determines the chip status of the WiFi chip. If the status is abnormal, the WiFi function will be turned off to avoid the situation of not sleeping or the sleeping time is short.

Benefits of technology

It effectively reduces the serious power consumption problems caused by WiFi abnormalities, reduces the power consumption and power consumption of electronic devices, and significantly reduces the power consumption during standby time at night.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024081171_20022025_PF_FP_ABST
    Figure CN2024081171_20022025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a power consumption reducing method, a device, and a system. An electronic device comprises a wireless fidelity (WiFi) chip, and the WiFi chip is used for realizing a WiFi function. The method comprises: an electronic device enables a WiFi function; the electronic device receives a beacon frame sent by a wireless access point; on the basis of the received beacon frame, the electronic device determines a chip state of a WiFi chip; and if the chip state is an abnormal state, the electronic device disables its WiFi function. According to the method, a WiFi function can be disabled if an anomaly occurs in a WiFi chip, thereby effectively reducing large power consumption caused by WiFi anomalies.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device and system for reducing power consumption

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on June 15, 2023, with application number 202310713807.9 and application name “A method, device and system for reducing power consumption”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of electronic technology, and in particular to a method, device, and system for reducing power consumption. Background Art

[0003] With the development of communication technology, more and more electronic devices are connected to wireless local area networks through network devices such as routing devices. For example, Wireless Fidelity (Wi-Fi) routers are used to provide Wi-Fi network services to various electronic devices within the coverage area of ​​the Wi-Fi signal. Electronic devices can access the Wi-Fi network through the Wi-Fi routers.

[0004] However, due to the mismatch between electronic devices and Wi-Fi routers or problems with the configuration of the router itself, 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.

[0005] Summary of the Invention

[0006] This application provides a method, device, and system for reducing power consumption. In this method, an electronic device can determine the chip status of a WiFi chip based on received beacon frames, and then disable the WiFi function when an abnormality occurs in the WiFi chip. This method can avoid situations where the WiFi chip does not sleep or has a short sleep time when an abnormality occurs, thereby effectively reducing the severe power consumption caused by WiFi abnormalities.

[0007] In a first aspect, 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:

[0008] Turn on the WiFi function of the electronic device;

[0009] The electronic device receives a beacon frame sent by a wireless access point;

[0010] The electronic device determines a chip status of the WiFi chip based on the received beacon frame;

[0011] When the chip status of the electronic device is abnormal, the WiFi function of the electronic device is turned off.

[0012] In an embodiment of the present application, the electronic device can identify whether the chip status of the WiFi chip is abnormal based on the beacon frame (i.e., beacon frame), where 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 electricity consumption of the electronic device.

[0013] For example, if the Wi-Fi chip of an electronic device cannot sleep during the screen-off standby period and the power consumption of the electronic device exceeds 60mA, implementing the method provided in the embodiments of this application can reduce the nighttime standby power consumption, and after successful control, a benefit of more than 20mA can be achieved. The specific benefit depends on the wake-up frequency and system status before the control.

[0014] Optionally, turning off the WiFi function of the electronic device may be that the electronic device powers off a Wi-Fi chip.

[0015] In conjunction with the first aspect, in one possible implementation, the beacon frame includes a data transmission indication information TIM bit, and the electronic device determines the chip status of the WiFi chip based on the received beacon frame, including:

[0016] 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 incorrect; the beacon frame with the TIM bit set is used to indicate that the wireless access point will send data to the electronic device;

[0017] When the electronic device receives beacon frames with TIM bit errors for a number greater than a first preset number within the second time period, it is determined that the chip state is an abnormal state.

[0018] The TIM bit being set may also be referred to as the TIM bit being set.

[0019] In an embodiment of the present application, the electronic device can identify the 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 the frequent setting errors of the TIM bit, thereby reducing the power consumption and electricity consumption of the electronic device.

[0020] In conjunction with the first aspect, in one possible implementation, the electronic device determines the chip status of the WiFi chip based on a received beacon frame, including:

[0021] The electronic device calculates a ratio of the number of beacon frames received in the third time period to a preset number of frames to obtain a beacon frame reception rate;

[0022] When the beacon frame reception rate is lower than a preset reception rate, the electronic device determines that the chip state is an abnormal state.

[0023] It should be noted that if an electronic device receives a small number of beacon frames, the WiFi chip will operate for a long time, resulting in serious power consumption of the electronic device. For example, an electronic device with a reception rate of less than 60% may be called a problem user, and the power consumption of a problem user from 0 to 6 o'clock is approximately 7% to 8%. The embodiment of the present application can identify this problem user and turn off 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 prevent the WiFi chip from operating for a long time and effectively reduce the power consumption of the electronic device.

[0024] In conjunction with the first aspect, in one possible implementation, the electronic device determines the chip status of the WiFi chip based on a received beacon frame, including:

[0025] The electronic device obtains 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;

[0026] When 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.

[0027] In an embodiment of the present application, the electronic device can identify any abnormality in the received beacon frames, the sending frequency of broadcast key update frames, the sending frequency of block request frames, the link disconnection frequency, the sending frequency of 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.

[0028] In combination with the first aspect, in one possible implementation, the method further includes:

[0029] When the number of beacon frames with TIM bit errors received in the fourth time period is greater than the first preset number, or the beacon frame reception rate is lower than the preset reception rate, the electronic device determines that the received beacon frame is abnormal.

[0030] In combination with the first aspect, in one possible implementation, the method further includes:

[0031] The electronic device receives a broadcast key update frame sent by a wireless access point;

[0032] When the number of broadcast key update frames in each time period in N consecutive time periods exceeds a first preset number, the electronic device determines that the sending frequency of the broadcast key update frames is abnormal, where N is a positive integer.

[0033] In an embodiment of the present application, an electronic device can identify whether a wireless access point frequently sends broadcast key update frames, and then turn off the WiFi function when 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 electricity consumption of the electronic device.

[0034] In combination with the first aspect, in one possible implementation, the method further includes:

[0035] The electronic device receives a block request frame sent by the wireless access point;

[0036] When the number of broadcast key update frames in each of M consecutive time periods exceeds a second preset number, the electronic device determines that the sending frequency of the block request frames is abnormal, where M is a positive integer.

[0037] In an embodiment of the present application, an electronic device can identify whether a wireless access point frequently sends block request frames, and then turn off the WiFi function when 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 electricity consumption of the electronic device.

[0038] In combination with the first aspect, in one possible implementation, the method further includes:

[0039] When the number of aggregated multicast packets received from the wireless access point in each time period within K consecutive time periods is greater than a third preset number, the electronic device determines that the sending frequency of the aggregated multicast packets is abnormal, where K is a positive integer.

[0040] In an embodiment of the present application, 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 electricity consumption of the electronic device.

[0041] In combination with the first aspect, in one possible implementation, the method further includes:

[0042] The Android packet filtering (APF) function is enabled on the electronic device. The Android packet filtering (APF) function is used to filter broadcast packets and multicast packets.

[0043] The electronic device receives a data packet sent by a wireless access point, the data packet including a broadcast packet and a multicast packet;

[0044] When the number of times the WiFi chip is awakened by the data packet in each time period within L consecutive time periods is greater than a second preset number, the electronic device determines that the filtered message situation is abnormal, where L is a positive integer.

[0045] Optionally, the electronic device may automatically enable the Android packet filtering (APF) function when the WiFi function is enabled.

[0046] It is understood that if the filtered message situation is abnormal, that is, the Android packet filtering APF function is abnormal, the broadcast packets and multicast packets that cannot be filtered will wake up the WiFi chip. In the embodiment of the present application, the electronic device can identify whether the filtered message situation is abnormal and turn off the WiFi function when the WiFi chip is frequently woken by messages that cannot be filtered, thereby reducing the power consumption and electricity consumption of the electronic device.

[0047] In conjunction with the first aspect, in one possible implementation, the electronic device determines the chip status of the WiFi chip based on a received beacon frame, including:

[0048] After entering the sleep mode, the electronic device determines the chip status of the WiFi chip based on the received beacon frame.

[0049] Optionally, the electronic device may enter sleep mode when it recognizes that the user is in a sleep state. For example, the electronic device may exit sleep mode when it recognizes through a sensor that its position has moved or the surrounding brightness has changed.

[0050] In an embodiment of the present application, the WiFi monitoring function (i.e., the chip status of the WiFi chip is determined as described above) is activated only when the user is in a sleep state. This method can avoid network interruptions that affect user use while the user is using the electronic device, and reduce the problem of excessive power consumption caused by WiFi abnormalities when the user is in a sleep state.

[0051] In conjunction with the first aspect, in one possible implementation, the electronic device determines the chip status of the WiFi chip based on a received beacon frame, including:

[0052] The electronic device determines whether the mobile network of the electronic device is enabled;

[0053] When the electronic device is turned on in a mobile network, the chip status of the WiFi chip is determined based on the received beacon frame.

[0054] In an embodiment of the present application, the electronic device only starts the WiFi monitoring function (i.e., the chip status of the WiFi chip is determined as described above) when the mobile network is turned on. This can avoid the situation where the WiFi is turned off when the data service switch is turned off, resulting in the electronic device not being able to connect to the Internet. As a result, 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 connect 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.

[0055] In conjunction with the first aspect, in one possible implementation, after turning off the WiFi function of the electronic device, the method further includes:

[0056] When the electronic device exits sleep mode, turn on the WiFi function.

[0057] Optionally, the electronic device may exit the sleep mode when recognizing that the user switches from the sleep state to the non-sleep state.

[0058] In an embodiment of the present application, 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.

[0059] In conjunction with the first aspect, in one possible implementation, when a chip status of the electronic device is abnormal, turning off a WiFi function of the electronic device includes:

[0060] The electronic device determines, when the chip status of the WiFi chip is abnormal, an execution status of a first service; the first service is a service that cannot be executed when the WiFi function is turned off;

[0061] When the electronic device determines that the first service is not currently being executed, the electronic device turns off the WiFi function of the electronic device.

[0062] In the embodiment of the present application, when the electronic device is executing a perceptible service, not turning off WiFi can ensure that the perceptible service is not interrupted, thereby avoiding affecting the user experience after the perceptible service is interrupted.

[0063] In conjunction with the first aspect, in one possible implementation, the electronic device determines the chip status of the WiFi chip based on a received beacon frame, including:

[0064] The electronic device periodically obtains the chip status of the WiFi chip through the WiFi driver.

[0065] In an embodiment of the present application, the electronic device can periodically monitor the chip status of the WiFi chip when the WiFi function is turned on. When the WiFi chip has an abnormality 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.

[0066] In a possible embodiment, after entering sleep mode, the electronic device can periodically monitor the chip status of the WiFi chip. When the WiFi chip has an abnormality at any time during the entire process, the WiFi can be managed, thereby effectively reducing the power consumption of the electronic device and avoiding severe power consumption.

[0067] In conjunction with the first aspect, in one possible implementation, after turning off the WiFi function of the electronic device, the method further includes:

[0068] The electronic device stops periodically obtaining the chip status of the WiFi chip through the WiFi driver.

[0069] In an embodiment of the present application, 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.

[0070] In a second aspect, the present application provides an electronic device, which includes a processor and a WiFi chip; wherein:

[0071] The processor is used to enable the WiFi function;

[0072] The WiFi chip is used to receive beacon frames sent by a wireless access point when the WiFi function is turned on;

[0073] The WiFi chip is used to determine a chip status of the WiFi chip based on the received beacon frame; the WiFi chip is also used to notify the processor when the chip status is abnormal;

[0074] The processor is used to turn off the WiFi function when the chip status is abnormal.

[0075] In an embodiment of the present application, the electronic device can identify whether the chip status of the WiFi chip is abnormal based on the beacon frame, where 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 electricity consumption of the electronic device.

[0076] For example, if the Wi-Fi chip of an electronic device cannot sleep during the screen-off standby period and the power consumption of the electronic device exceeds 60mA, implementing the method provided in the embodiments of this application can reduce the nighttime standby power consumption, and after successful control, a benefit of more than 20mA can be achieved. The specific benefit depends on the wake-up frequency and system status before the control.

[0077] In conjunction with the second aspect, in one possible implementation, the beacon frame includes a data transmission indication information TIM bit, and the WiFi chip is specifically configured to:

[0078] After receiving a beacon frame with a TIM bit set, no data is received within a first time period, determining that the TIM bit of the beacon frame is erroneous; the beacon frame with the TIM bit set is used to indicate that the wireless access point will send data to the electronic device;

[0079] When the number of beacon frames with TIM bit errors received within the second time period is greater than a first preset number, it is determined that the chip state is an abnormal state.

[0080] In conjunction with the second aspect, in one possible implementation, the WiFi chip is specifically configured to:

[0081] Calculating a ratio of the number of beacon frames received in the third time period to a preset number of frames to obtain a beacon frame reception rate;

[0082] When the beacon frame receiving rate is lower than a preset receiving rate, it is determined that the chip state is an abnormal state.

[0083] In an embodiment of the present application, the electronic device can identify the 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 the frequent setting errors of the TIM bit, thereby reducing the power consumption and electricity consumption of the electronic device.

[0084] In conjunction with the second aspect, in one possible implementation, the WiFi chip is specifically configured to:

[0085] Acquire first data, where the first data includes at least one of a sending frequency of broadcast key update frames, a sending frequency of block request frames, a link disconnection frequency, a sending frequency of aggregated multicast packets, and a filtered message status;

[0086] When it is determined that at least one of the received beacon frame and the first data is abnormal, the chip state is determined to be an abnormal state.

[0087] In an embodiment of the present application, the electronic device can identify any abnormal situation of the sending frequency of broadcast key update frames, the sending frequency of block request frames, the link disconnection frequency, the sending frequency of aggregated multicast packets 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.

[0088] In a third aspect, 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 comprises 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.

[0089] In a fourth 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 to enable the electronic device to execute the method described in the first aspect and any possible implementation method of the first aspect.

[0090] In a fifth aspect, the present application provides a computer-readable storage medium 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.

[0091] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when the computer program product is run 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.

[0092] It is understandable that 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 perform the methods provided in this application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0093] FIG1 is a schematic diagram of an application scenario exemplarily shown in an embodiment of the present application;

[0094] FIG2 is a schematic diagram of the hardware structure of an electronic device exemplarily provided in an embodiment of the present application;

[0095] FIG3 is a schematic block diagram of the system architecture of an electronic device 100 exemplarily provided in an embodiment of the present application;

[0096] FIG4 is a flow chart of a method for reducing power consumption exemplarily provided in an embodiment of the present application;

[0097] FIG5 is a flowchart of another method for reducing power consumption provided by an embodiment of the present application;

[0098] 6A to 6C are user interfaces for enabling the "power saving" function of an electronic device provided by an embodiment of the present application;

[0099] 7A to 7C are user interfaces for enabling the “power saving” function of another electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0100] The terms used in the following examples of the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular expressions "a," "an," "said," "above," "the," and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and encompasses any or all possible combinations of one or more of the listed items.

[0101] FIG1 is a schematic diagram of an application scenario exemplarily shown in an embodiment of the present application.

[0102] As shown in Figure 1, the scenario includes an electronic device 100 and a routing device 200. The electronic device 100 is a Wi-Fi enabled device, meaning it supports Wireless Fidelity (WiFi) technology and can connect to a wireless network via WiFi to send and receive network data. The routing device 200 is used to provide a Wi-Fi hotspot.

[0103] For example, the routing device 200 may be a Wi-Fi router that provides a Wi-Fi hotspot, and the electronic device 100 may be a device that includes a Wi-Fi module (or Wi-Fi chip) and other structures to provide WiFi functionality. The electronic device may connect to the routing device 200 via its own Wi-Fi module and communicate with an external network via the routing device 200. For ease of description, in the following embodiments, Wi-Fi is abbreviated as WiFi, and for example, a Wi-Fi chip or Wi-Fi module is referred to as a WiFi chip.

[0104] For example, when the WiFi function of the electronic device 100 is set to "on" (i.e., the WiFi function is turned on), the electronic device 100 can periodically scan for WiFi signals within the current environment. For example, the electronic device 100 can display information such as one or more currently detected WiFi signals and corresponding signal strengths to the user. In addition, the electronic device 100 can also implement operations such as automatic WiFi access based on preset WiFi automatic access settings and saved successfully accessed WiFi accounts. When 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 for WiFi signals within the current environment, saving the device's power consumption, thereby effectively saving the power consumption of the electronic device 100.

[0105] Among them, 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.

[0106] Optionally, the electronic device 100 may further include a cellular data module, and the electronic device 100 may communicate with an external network via its own cellular data module. For example, the cellular data module may be the mobile communication module 150 in FIG. 2 . It should be noted that the cellular data module and the WiFi chip may be located on the same hardware module (e.g., a chip); or they may be separate hardware modules, which is not limited in this embodiment of the present application.

[0107] In the scenario shown in Figure 1, if there is a mismatch between the electronic device 100 and the routing device 200 or there is a problem with the configuration of the routing device 200 itself, 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 woken up, resulting in serious power consumption of the electronic device 100.

[0108] The inventors of the embodiments of the present application have discovered through research that the following situations can cause serious power consumption in electronic devices, as follows:

[0109] Case 1: The routing device sends a beacon frame.

[0110] Inaccurate cycle causes the WiFi chip to not sleep or sleep for a short time.

[0111] In some embodiments, the routing device may send a management frame, such as a Beacon frame, to the electronic device.

[0112] The main reasons for 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 beacon frames or a large number of beacon frames being unable to be received.

[0113] If a small number of beacon frames are received, the WiFi chip will work for a long time, resulting in serious power consumption of the electronic device. For example, the power consumption of an electronic device with this problem from 0:00 to 6:00 may be between 7% and 8%.

[0114] Case 2: The traffic indication map (TIM) bit of the beacon frame sent by the router is incorrectly set. The electronic device mistakenly believes that the wireless access point (AP) (i.e., the router) is still sending data, and the WiFi chip does not sleep.

[0115] Among them, the TIM bit refers to the association ID assigned when the device is connected to the AP. 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, and it will wake up the WiFi chip and wait for the data.

[0116] When the TIM bit in a beacon frame is incorrectly set or remains set (even when no data is being sent), the WiFi chip will not power down, causing serious power consumption issues. Currently, TIM bit setting is the top power consumption issue. The power consumption of electronic devices (problematic users) with this problem depends on the 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 an 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 device manufacturer.

[0117] Case 3: The routing device rekeys configuration keys too frequently, frequently waking up the host, such as waking up the central processing unit.

[0118] 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).

[0119] However, if the update interval of the broadcast key is set very short, the routing device will frequently send rekey packets (such as updating once every 30 seconds) to the electronic device, causing the WiFi chip to be awakened from sleep interruption, resulting in serious power consumption of the electronic device.

[0120] It should be noted that in some embodiments of the present application, the broadcast key update interval is a configurable item on the routing device. However, due to users being unaware of this and few knowing how to reconfigure this item on the routing device to restore it to normal operation, this issue affects the power consumption of the electronic device. The extremely short broadcast key update interval may be caused by non-compliant routing devices or configuration errors.

[0121] Case 4: The routing device frequently kicks out the electronic device, which then re-initiates a WiFi connection, causing abnormal power consumption in the electronic device.

[0122] Due to the design of the routing device itself and other reasons, the routing device will kick out electronic devices (such as mobile phones) when there is no data traffic, and the link between the electronic device and the routing device will be disconnected. Some routing devices will kick out electronic devices hundreds of times a night, which means frequent disconnection. The electronic devices will automatically reconnect after being kicked out. This back and forth process causes serious power consumption problems. Problem users (that is, electronic devices with this problem) generally consume more than 15% of power.

[0123] Case 5: Block request frames (ADDBA request, referred to as addba req frames) frequently wake up the host.

[0124] The Addbareq action frame is used to establish a block acknowledgment (Block Ack) mechanism. However, some routers frequently send Addbareq action frames, waking up the host and preventing the Wi-Fi chip from going to sleep. Since these are management frames, the Wi-Fi chip doesn't filter them, causing the device to consume approximately 10% of its power overnight.

[0125] Case 6: Aggregated multicast packets frequently wake up the host, but the WiFi chip does not sleep or the sleep time is short.

[0126] The aggregation multicast packet may 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).

[0127] Currently, when performing Android Packet Filter (APF) on the WiFi chip side, it can only filter a single multicast packet or a single broadcast packet. For aggregated frames, the WiFi chip side can only filter small aggregated frames from a single network buffer (netbuffer), where the IP address header of each subframe is a multicast address or a broadcast address. Aggregated frames from multiple netbuffers (large packet aggregation, such as AMSDU multicast packets) or aggregated frames where any subframe has a unicast address in the IP address header cannot be filtered.

[0128] In this case, the user will be frequently awakened, the power consumption when the screen is off can reach several hundred milliampere hours (mAh), and the WiFi chip does not sleep or the sleep time is short, causing the electronic device to consume about 10% of the power overnight.

[0129] Case 7: APF filtering message is abnormal, and the chip is still frequently awakened.

[0130] Assume that APF filtering of multicast and broadcast packets is enabled on the chip. If multicast and broadcast packets still frequently wake up the WiFi chip, it indicates that the APF filtering message is abnormal.

[0131] In view of this, 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.

[0132] In an embodiment of the present application, an electronic device can disable the WiFi function when a WiFi chip anomaly occurs. This method can prevent the device from not going into sleep mode or from going into sleep mode for a short period of time when a WiFi chip anomaly occurs, thereby effectively reducing the significant power consumption caused by WiFi anomalies. For ease of description, disabling the WiFi function will be referred to as turning off WiFi.

[0133] In an embodiment of the present application, the electronic device can also perform WiFi abnormality monitoring and management while in deep sleep mode. WiFi monitoring is to identify whether the WiFi chip has abnormalities, and management includes turning WiFi off and on. This method can avoid affecting the user experience due to turning off the WiFi function.

[0134] In an embodiment of the present application, the electronic device can also perform WiFi anomaly monitoring and management when no perceptible services are being performed. WiFi monitoring involves identifying whether the WiFi chip has an anomaly, and management involves turning the WiFi function off and on. Perceptible services may be services that are suspended when the WiFi function is interrupted. This method can avoid affecting the user experience due to the disabling of the WiFi function.

[0135] In the embodiments of the present application, electronic devices include but are not limited to mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, etc. Exemplary embodiments of electronic devices include but are not limited to devices equipped with The portable electronic device may be a Linux or other operating system. The electronic device may also be other portable electronic devices, such as a laptop computer.

[0136] Next, the software and hardware architecture of the electronic device provided in the embodiments of the present application is exemplarily introduced.

[0137] FIG2 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. FIG2 takes the electronic device 100 as an example for illustration.

[0138] As shown in FIG2 , 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.

[0139] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0140] 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. Among them, different processing units can be independent devices or integrated into one or more processors. Among them, the controller can be the nerve center and command center of the electronic device 100. The controller can generate an operation control signal based on the instruction opcode and the timing signal to complete the control of instruction fetching and execution. A memory can also be set in the processor 110 for storing instructions and data.

[0141] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes the instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device 100.

[0142] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 150 can provide a wireless communication solution including 2G / 3G / 4G / 5G etc. applied to the electronic device 100.

[0143] In the embodiment of the present application, the processor 110 can control the mobile communication module 150 to turn on or off the mobile network.

[0144] The wireless communication module 160 can provide wireless communication solutions for the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), etc. Optionally, the electronic device 100 can also provide wireless communication solutions such as near field communication (NFC) and infrared technology (IR), which will not be expanded here.

[0145] The WiFi chip involved in the embodiments of the present application can be, for example, the 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 ).

[0146] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0147] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), organic light-emitting diode (OLED), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (FLED), Mini LED, Micro LED, Micro-OLED, quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0148] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image or video. The ISP can also perform algorithmic optimization on image noise, brightness, and color. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0149] 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. 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. In some embodiments, the electronic device 100 may include multiple cameras 193.

[0150] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG1, and MPEG4.

[0151] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. 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 applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0152] It should be noted that the functions of other modules not mentioned in the electronic device 100 shown in FIG. 2 can be referred to relevant technical documents, and this application will not elaborate on them.

[0153] The structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, 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. For example, the electronic device 100 may also include buttons, motors, indicators, and a subscriber identification module (SIM) card interface, etc. For another example, 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.

[0154] In the embodiment provided in the present application, the electronic device 100 may execute the method for reducing power consumption through the processor 110 and the wireless communication module 160 .

[0155] FIG3 is a schematic block diagram of the system architecture of the electronic device 100 exemplarily provided in an embodiment of the present application.

[0156] The system architecture of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0157] A layered architecture divides the system into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer (APP layer), the application framework layer (FWK layer), the system layer, and the kernel layer.

[0158] As shown in Figure 3, the APP layer may include a series of application packages, such as a power saving wizard. In the embodiment of the present application, the APP layer may run the "power saving wizard" application.

[0159] In the embodiment of the present application, the power saving wizard is used to notify the WiFi FWK to start or stop WiFi monitoring of the chip status of the WiFi chip, and to notify the WiFi FWK to turn on or off the WiFi function.

[0160] Optionally, 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.

[0161] For example, the power saving wizard can intelligently learn user habits, identify whether the user is in sleep mode based on the current time, ambient light, the static state of the electronic device 100 and the screen off state, and obtain the mobile phone status to determine whether the user has turned on WiFi and data services, or has no perceptible services, etc.; when the WiFi chip abnormal conditions are met, turn off WiFi, for example, the WiFi chip abnormal conditions may include any of the seven flags 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.

[0162] Optionally, 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 FIG3 ), which are not limited here.

[0163] The system layer can include multiple functional modules, such as the surface manager, media libraries, 3D image processing libraries (such as OpenGL ES), and 2D graphics engines (such as SGL).

[0164] The surface manager is used to manage the display subsystem and provide the fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications.

[0165] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0166] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing and layer processing.

[0167] A 2D graphics engine is a drawing engine for 2D drawings.

[0168] The FWK layer provides an application programming interface (API) and programming framework for the applications in the APP layer. As shown in Figure 3, the FWK layer may include a WiFi FWK.

[0169] In the embodiment of the present application, 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 on or off WiFi.

[0170] 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 ).

[0171] The window manager is used to manage window programs. It can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, and more. The content provider is used to store and retrieve data and make it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book. The view system includes visual controls, such as controls for displaying text and controls for displaying images. 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 notification icon can include a view for displaying text and a view for displaying images. The call manager is used to provide communication functions for the electronic device 100. For example, this manages call status (including connected and hung up). The resource manager provides various resources to applications, such as localized strings, icons, images, layout files, video files, and more. The notification manager enables applications to display notification information in the status bar. This can be used to convey notification-type messages and can automatically disappear after a short period of time without user interaction. For example, the notification manager is used to notify download completion, message reminders, and so on. The notification manager can also be a notification that appears in the form of an icon or scrolling text in the status bar at the top of the system, such as a notification from 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 displayed in the status bar, a prompt sound is emitted, the electronic device 100 vibrates, an indicator light flashes, etc.

[0172] The kernel layer is the layer between hardware and software. The kernel layer includes various hardware drivers, such as the WiFi driver for WiFi modules.

[0173] In the embodiment of the present application, 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 and 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.

[0174] The kernel layer may also include camera drivers, audio drivers, and sensor drivers. The kernel layer may also include digital signal processor drivers (not shown) and image processor drivers (not shown). The camera driver drives the image sensors of one or more cameras in the camera module to capture images and drives the image signal processor to pre-process the images. The digital signal processor driver drives the digital signal processor to process images. The image processor driver drives the graphics processor to process images.

[0175] The software architecture may further include a hardware abstraction layer (HAL) not shown in FIG3 . The HAL is an interface layer located between the application framework layer and the kernel layer, and provides a virtual hardware platform for the operating system.

[0176] Based on the application scenario shown in FIG1 and the software and hardware architecture of the electronic device introduced in FIG2 and FIG3, the following uses FIG4 and FIG5 to illustrate the architecture in depth to respectively explain the method for reducing power consumption provided by each embodiment of the present application.

[0177] FIG4 shows a flow chart of 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:

[0178] S11: Power Saver enters deep sleep mode.

[0179] In some embodiments, before executing S11, the electronic device may activate the WiFi function in response to a user operation. For example, the electronic device's settings application includes a WiFi switch, or the electronic device's main interface includes a WiFi switch in a drop-down taskbar. The electronic device activates the WiFi function in response to the user operation on the WiFi switch, that is, the electronic device may establish a connection with the routing device via the WiFi chip.

[0180] In some embodiments, the power saving wizard may enter a deep sleep mode (also referred to as a night mode or sleep mode) when it is determined that the user is in a sleep state. The user may be a user of the electronic device.

[0181] In one implementation, 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, it enters a deep sleep mode.

[0182] For example, the Power Saver uses its intelligent night mode algorithm to assess the user's status every ten minutes. If it determines the user is asleep, it can predict their wake-up time based on their habits. If the user suddenly unlocks the device while in night mode, the algorithm can immediately exit night mode. If the user suddenly turns on the lights while in night mode, the algorithm can exit night mode the next time it determines the user is asleep.

[0183] Among them, 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 over the past period of time.

[0184] In an embodiment of the present application, the WiFi monitoring function is activated only when the user is in sleep mode. 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 sleep mode.

[0185] In other embodiments of the present application, 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). 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.

[0186] S12: The power saving wizard determines whether the data service switch is turned on.

[0187] Furthermore, the power saving wizard executes step S13 when the data service data switch is not turned on; and executes step S14 when the data service data switch is turned on.

[0188] In some embodiments, the power saving wizard can determine whether the data service switch is on when entering deep sleep mode. The data service switch is used to enable cellular data. For example, 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" menu.

[0189] Illustratively, the data service switch may be shown as the mobile network switch 721 in the user interface in FIG. 7B .

[0190] In some other embodiments of the present application, 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 .

[0191] S13: The electronic device ends executing the method.

[0192] In some embodiments, the power saving wizard may not execute steps S12 and S13, but directly execute S14, that is, WiFi monitoring and management (hereinafter referred to as control) of WiFi is performed regardless of whether the data service switch is turned on.

[0193] It should be noted that, in the embodiment shown in FIG4 , the power saving wizard executes the above S12 and S13 to avoid turning off 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 process, and the electronic device will not be disconnected from the Internet, thereby ensuring the user experience effect.

[0194] S14: Power Saver notifies WiFi FWK to start WiFi monitoring.

[0195] In some embodiments, the power saving wizard may notify the WiFi FWK to start WiFi monitoring when the data service data switch is turned on.

[0196] S15: When the WiFi FWK receives the notification from the power saving wizard to start WiFi monitoring, it starts WiFi monitoring.

[0197] S16: The WiFi FWK periodically queries the chip status of the WiFi chip.

[0198] In some embodiments, when the WiFi FWK receives the notification from the power saving wizard to start WiFi monitoring, it periodically queries the chip status of the WiFi chip.

[0199] The chip status may include a normal state and an abnormal state. The embodiment of the present application does not limit the cycle duration. For example, the WiFi FWK may query the chip status of the WiFi chip once every five minutes.

[0200] In other embodiments of the present application, the WiFi FWK may also perform a single query upon receiving a notification from the Power Saver to initiate WiFi monitoring. In this case, 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 monitors the WiFi chip status when the device enters deep sleep mode.

[0201] It should be noted that in the embodiment shown in Figure 4, the WiFi FWK periodically monitors the WiFi chip's status after the power-saving wizard enters deep sleep mode. This method allows for continuous WiFi chip status monitoring throughout deep sleep mode. If the WiFi chip experiences an anomaly at any point during this process, WiFi management can be implemented, effectively reducing the electronic device's power consumption and preventing excessive power consumption.

[0202] S17: The WiFi driver determines the chip status of the WiFi chip based on the routing data.

[0203] 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.

[0204] The specific process of the WiFi driver determining the chip status of the WiFi chip can be found in the relevant content in Figure 5, which will not be expanded here.

[0205] S18: When the WiFi driver determines that the chip status of the WiFi chip is abnormal, it notifies the WiFi FWK.

[0206] In some embodiments, when the WiFi driver determines that the chip status of the WiFi chip is abnormal, it can send a notification message to the WiFi FWK. 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.

[0207] Optionally, 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, which is not limited in this embodiment of the present application.

[0208] It is understandable that since the WiFi chip does not cause a large amount of power consumption when the chip status is normal, the electronic device does not need to manage WiFi when the WiFi chip is in a normal state. Therefore, in the embodiment of the present application, the WiFi FWK is not notified when the chip status of the WiFi chip is normal, which can reduce the power consumption caused by the notification.

[0209] S19: WiFi FWK notifies Power Saver that the WiFi chip status is abnormal.

[0210] In some embodiments, when the WiFi FWK receives a notification from the WiFi driver indicating that the chip status of the WiFi chip is abnormal, it can 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.

[0211] S20: The power saving wizard determines whether there is any perceptible service currently.

[0212] The perceptible service may be a service that is perceptible to the user, that is, the user will be aware of the service if it is suspended. For example, the perceptible service may include background playback, downloading, and navigation services.

[0213] In some embodiments, when 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.

[0214] Exemplarily, the power saving wizard may include an abnormality identification module, and S20 is specifically executed by the abnormality identification module. For example, in S19, the WiFi FWK may notify the abnormality identification module in the power saving wizard that the chip status of the WiFi chip is abnormal; then, the abnormality identification module may determine whether there is currently any perceptible service.

[0215] In the embodiment of the present application, when the electronic device is executing a perceptible service, not turning off WiFi can ensure that the perceptible service is not interrupted, thereby avoiding affecting the user experience after the perceptible service is interrupted.

[0216] In some other embodiments of the present application, the WiFi FWK may not execute the above-mentioned S20 and S13, and directly execute the following step S21.

[0217] S21: Power Saver notifies WiFi FWK to turn off WiFi monitoring and WiFi.

[0218] S22: WiFi FWK turns off WiFi and stops WiFi monitoring.

[0219] In some embodiments, the WiFi FWK may call a WiFi shutdown interface to disable the WiFi function.

[0220] In the embodiment of the present application, when 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.

[0221] S23: The power saving wizard exits deep sleep mode.

[0222] In some embodiments, the power saving wizard periodically determines whether the user is in a sleep state through the intelligent night mode algorithm; when it is determined that the user is not in a sleep state, the power saving wizard exits the deep sleep mode.

[0223] S24: The power saving wizard notifies the WiFi FWK to stop WiFi monitoring.

[0224] In some embodiments, when the power saving wizard exits the deep sleep mode, it notifies the WiFi FWK to stop WiFi monitoring.

[0225] S25: The WiFi FWK determines whether WiFi monitoring is currently being performed.

[0226] In some embodiments, after receiving the notification from the power saving wizard instructing to stop WiFi monitoring, the WiFi FWK may determine whether WiFi monitoring has been enabled; if WiFi monitoring is enabled, step S26 is executed; if WiFi monitoring is not enabled, step S13 is executed.

[0227] S26: WiFi FWK stops WiFi monitoring.

[0228] In some embodiments, the WiFi FWK stops WiFi monitoring when determining that WiFi monitoring is enabled.

[0229] S27: The WiFi FWK determines whether the current WiFi is turned off.

[0230] In some embodiments, the WiFi FWK may determine whether the WiFi has been turned off (or is currently turned off); if the WiFi is turned off, step S28 is executed; if the WiFi is not turned off, step S13 is executed.

[0231] S28: WiFi FWK starts WiFi.

[0232] In some embodiments, the WiFi FWK may execute step S27 to activate WiFi when determining that WiFi is turned off.

[0233] In an embodiment of the present application, 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 WiFi is turned on when WiFi is turned off. This can avoid network interruptions 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.

[0234] 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:

[0235] S1: The electronic device starts monitoring for WiFi anomalies.

[0236] In some embodiments, the electronic device may start monitoring for WiFi anomalies after turning on the WiFi function.

[0237] In other embodiments, 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 notify the WiFi FWK to start WiFi monitoring when the data service switch is turned on.

[0238] S2: The electronic device queries the chip status of the WiFi chip.

[0239] In some embodiments, when the WiFi FWK receives a notification from the power saving wizard to start WiFi monitoring, it starts WiFi monitoring, that is, it begins to periodically query the WiFi driver for the chip status of the WiFi chip; the WiFi driver can determine the chip status of the WiFi chip by following steps S3 to S10 (which is a specific implementation of step S17 in Figure 4).

[0240] S3: The electronic device obtains a flag corresponding to the reception rate of the beacon frame (referred to as the first flag).

[0241] A beacon frame is a management frame sent by a routing device to an electronic device. The first flag indicates whether the beacon frame reception rate is abnormal. For example, the first flag can be 0, indicating a normal beacon frame reception rate; the first flag can be 1, indicating an abnormal beacon frame reception rate. The beacon frame reception rate is also referred to as the beacon frame reception rate.

[0242] For example, the specific process of the electronic device obtaining the flag corresponding to the beacon frame reception rate can be referred to the following steps S31 to S35.

[0243] S31: The electronic device determines whether the reception rate of the beacon frame is abnormal.

[0244] Furthermore, when the electronic device determines that the reception rate of the beacon frame is abnormal, it executes step S33; when it determines that the reception rate of the beacon frame is normal, it executes step S32.

[0245] In some embodiments, the electronic device may divide the number of beacon frames actually received within a preset time period by the expected number of beacon frames (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 expected number of beacon frames may be the preset number of frames.

[0246] For example, the preset time is 5 minutes and the preset reception rate can be 60%. Then, after starting WiFi monitoring, the electronic device can calculate the beacon reception rate every five minutes. If the calculated beacon reception rate is lower than 60%, it is determined that the reception rate of the beacon frame is abnormal.

[0247] It should be noted that if an electronic device receives a small number of beacon frames, the WiFi chip will operate for a long time, resulting in serious power consumption of the electronic device. For example, a user with a reception rate below 60% may be called a problem user, and the power consumption of a problem user from 0 to 6 o'clock is approximately 7% to 8%. The embodiment of the present application can identify such a problem user and turn off WiFi when certain conditions are met (such as the data switch is turned on and / or there is no perceptible service as shown in Figure 4), thereby avoiding the WiFi chip from operating for a long time and effectively reducing the power consumption of the electronic device.

[0248] S32: The electronic device sets the first flag to 0.

[0249] That is, 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.

[0250] S33: The electronic device determines whether the number of abnormalities corresponding to the beacon frame reception rate (hereinafter referred to as the first abnormality number) is greater than N1. If the electronic device determines that the first abnormality number is greater than N1, it executes step S35; if the electronic device determines that the beacon frame reception rate is normal, it executes step S34. N1 is a positive integer.

[0251] In some embodiments, the electronic device can obtain the recorded first abnormality number from the storage, add 1 to the abnormality number to obtain an updated first abnormality number, and compare the updated first abnormality number with N1 to determine whether the abnormality number corresponding to the beacon frame reception rate is greater than N1.

[0252] S34: The electronic device adds 1 to the recorded first abnormality count.

[0253] S35: The electronic device sets the first flag to 1.

[0254] That is, 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.

[0255] S4: The electronic device obtains a flag corresponding to the frequency of the TIM bit being erroneously set (referred to as the second flag).

[0256] The TIM bit refers to a flag bit corresponding to the electronic device in a beacon frame sent by a routing device to the electronic device. When set, this flag bit indicates that the routing device will send data to the electronic device within the next preset time. The second flag indicates whether the frequency of incorrectly setting the TIM bit is abnormal. For example, the second flag can be 0, indicating that the frequency of incorrectly setting the TIM bit is normal, and the second flag can be 1, indicating that the frequency of incorrectly setting the TIM bit is abnormal.

[0257] If the TIM bit in the beacon frame of the electronic device is set but no data is received from the routing device within a preset time period (also referred to as a first time period), the TIM bit is considered to be incorrectly set. The frequency of the TIM bit incorrect setting refers to the number of times the TIM bit is incorrectly set within the preset time period. For example, the first time period can be 60ms.

[0258] For example, 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 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.

[0259] It should be noted that if the TIM bit in the beacon frame is incorrectly set or is always set (even when no data is being sent), the WiFi chip will not be powered off, which can cause serious power consumption problems. In the embodiment of the present application, the electronic device can avoid serious power consumption by detecting the frequency of incorrectly set TIM bits and shutting down the WiFi function when the frequency is too high, that is, shutting down the WiFi chip. This can effectively reduce power consumption.

[0260] For example, 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.

[0261] S41: The electronic device determines whether the frequency of the TIM bit erroneously set is abnormal. Furthermore, if the electronic device determines that the frequency of the TIM bit erroneously set is abnormal, it executes step S43; if the electronic device determines that the frequency of the TIM bit erroneously set is normal, it executes step S42.

[0262] In some embodiments, the electronic device may calculate the frequency of TIM bit errors in beacon frames received within a preset time period (also referred to as a second time period). If the frequency is greater than the preset frequency, the frequency of TIM bit errors is determined to be abnormal; otherwise, it is normal. If the electronic device does not receive data within the preset time period after receiving a beacon frame, the electronic device determines that the TIM bit in the beacon frame is incorrect.

[0263] That is, when the number of beacon frames with TIM bit errors received in the second time period is greater than the first preset number, it is determined that the frequency of the TIM bit error setting is abnormal.

[0264] For example, if the second time period can be 1s and the first preset number of times is 8, then if the electronic device can calculate the frequency of the 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, then the electronic device can determine that the frequency of the TIM bit error setting is abnormal.

[0265] S42: The electronic device sets the second flag to 0.

[0266] That is, the second flag obtained by the electronic device is 0. 0 is used to indicate that the frequency of the TIM bit being erroneously set is normal.

[0267] S43: The electronic device determines whether the number of abnormal times corresponding to the frequency of the TIM bit being incorrectly set (hereinafter referred to as the second abnormal number) is greater than N2. If the electronic device determines that the second abnormal number is greater than N2, it executes step S45; if the electronic device determines that the frequency of the TIM bit being incorrectly set is normal, it executes step S44. N2 is a positive integer.

[0268] In some embodiments, the electronic device can obtain the recorded second abnormality number from the storage, add 1 to the abnormality number to obtain an updated second abnormality number, and compare the updated second abnormality number with N2 to determine whether the abnormality number corresponding to the frequency of the TIM bit erroneous setting is greater than N2 times.

[0269] S44: The electronic device adds 1 to the recorded second abnormality number.

[0270] S45: The electronic device sets the second flag to 1.

[0271] That is, 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.

[0272] S5: The electronic device obtains a flag corresponding to the sending frequency of the rekey packet (referred to as the third flag).

[0273] Among them, 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 can refer to the sending frequency of the rekey package configured by the routing device (that is, 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. It should be noted that in some embodiments of the present application, due to actual conditions and other reasons, 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. Then, the electronic device can determine the receiving frequency at which the electronic device receives the rekey package as the frequency for determining whether the rekey package is abnormal. Among them, the sending frequency of the rekey package can also be referred to as the sending frequency of the broadcast key update frame.

[0274] Among them, the third flag is used to indicate whether the sending frequency of the rekey packet is abnormal. For example, 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.

[0275] Exemplarily, the specific process of the electronic device obtaining the flag corresponding to the sending frequency of the rekey packet can be referred to the following steps S51 to S55.

[0276] S51: The electronic device determines whether the sending frequency of the rekey packet is abnormal.

[0277] Furthermore, when the electronic device determines that the sending frequency of the rekey packet is abnormal, it executes step S53; when it determines that the sending frequency of the rekey packet is normal, it executes step S52.

[0278] In some embodiments, the electronic device may calculate the rekey packet sending interval time, and if the rekey packet sending interval time is less than a preset time interval (eg, 30s), it is determined that the rekey packet sending frequency is abnormal, otherwise it is normal.

[0279] In other embodiments, when the number of broadcast key update frames in each time period in N consecutive time periods exceeds a first preset number, the electronic device determines that the sending frequency of the broadcast key update frames is abnormal, where N is a positive integer.

[0280] For example, if N is 10, each of the N time periods is 1 minute, and the first preset number is 2, if the electronic device can count the number of rekey packets received per minute, if at least two rekey packets are received per minute for ten consecutive minutes, it is determined that the frequency of sending rekey packets is abnormal, otherwise it is normal.

[0281] It should be noted that if an electronic device frequently receives rekey packets sent by a routing device, that is, the rekey packet transmission frequency is too high, it will cause the WiFi chip to be awakened from sleep interruption, resulting in serious power consumption of the electronic device. In the embodiment of the present application, the electronic device can avoid serious power consumption of the electronic device by obtaining the transmission 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.

[0282] S52: The electronic device sets the third flag to 0.

[0283] That is, 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.

[0284] S53: The electronic device determines whether the number of abnormal times corresponding to the rekey packet transmission frequency (hereinafter referred to as the third abnormal number) is greater than N3. If the electronic device determines that the third abnormal number is greater than N3, it executes step S55; if it determines that the rekey packet transmission frequency is normal, it executes step S54. Where N3 is a positive integer.

[0285] In some embodiments, 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.

[0286] S54: The electronic device adds 1 to the recorded third abnormality number.

[0287] S55: The electronic device sets the third flag to 1.

[0288] That is, 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.

[0289] S6: The electronic device obtains a flag corresponding to the sending frequency of the addba req frame (referred to as the fourth flag).

[0290] The AddBa-REQ frame is a management frame sent by a routing device to an electronic device. The AddBa-REQ frame transmission frequency can refer to the frequency at which the routing device sends ReKey packets, that is, the frequency at which the electronic device receives ReKey packets. The AddBa-REQ frame transmission frequency can also be called the block request frame transmission frequency.

[0291] It should be noted that in some embodiments of the present application, due to actual conditions or other reasons, the frequency at which the routing device sends the Addba-Req frame is not equal to the receiving frequency at which the electronic device receives the Addba-Req frame. In this case, the electronic device may determine the receiving frequency at which the electronic device receives the Addba-Req frame as the frequency for determining whether the Rekey packet is abnormal.

[0292] The fourth flag is used to indicate whether the sending frequency of the addba req frame is abnormal. For example, the fourth flag may be 0, which indicates that the sending frequency of the addba req frame is normal. When the fourth flag is 1, it indicates that the sending frequency of the addba req frame is abnormal.

[0293] For example, the specific process of the electronic device acquiring the flag of the sending frequency of the addba req frame may refer to the following steps S61 to S65.

[0294] S61: The electronic device determines whether the sending frequency of the addba req frame is abnormal.

[0295] Furthermore, when the electronic device determines that the sending frequency of the addba req frame is abnormal, the electronic device executes step S63; when the electronic device determines that the sending frequency of the addba req frame is normal, the electronic device executes step S62.

[0296] In some embodiments, 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.

[0297] In other embodiments, when the number of broadcast key update frames in each of M consecutive time periods exceeds a second preset number, the electronic device determines that the frequency of sending block request frames is abnormal, where M is a positive integer.

[0298] For example, M is 10, each of the M time periods is 1 minute, and 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.

[0299] It should be noted that if an electronic device frequently receives Addba-req frames sent by a routing device, that is, the frequency of sending Addba-req frames 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. In the embodiment of the present application, the electronic device can avoid serious power consumption of the electronic device by obtaining the frequency of sending Addba-req frames and turning off the WiFi function when the frequency is too high (i.e., abnormal), which can effectively reduce power consumption.

[0300] S62: The electronic device sets the fourth flag to 0.

[0301] That is, 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.

[0302] S63: The electronic device determines whether the number of abnormalities corresponding to the frequency of sending the Addba-req frame (hereinafter referred to as the fourth abnormality number) is greater than N4. If the electronic device determines that the fourth abnormality number is greater than N4, it executes step S65; if the electronic device determines that the frequency of sending the Addba-req frame is normal, it executes step S64. N4 is a positive integer.

[0303] In some embodiments, 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.

[0304] S64: The electronic device adds 1 to the recorded fourth abnormality number.

[0305] S65: The electronic device sets the fourth flag to 1.

[0306] That is, the fourth flag obtained by the electronic device is 1. 1 is used to indicate that the sending frequency of the addba req frame is abnormal.

[0307] S7: The electronic device obtains a flag corresponding to the disconnection frequency (referred to as the fifth flag).

[0308] A disconnection refers to a disconnection between an electronic device and a routing device, and a disconnection frequency refers to the number of disconnections between the electronic device and the routing device within a preset time period. It should be noted that frequent disconnections can be caused by frequent disconnections of electronic devices due to routing device settings, or other reasons.

[0309] The fifth flag is used to indicate whether the link disconnection frequency is abnormal. For example, the fifth flag may be 0, indicating that the link disconnection frequency is normal; the fifth flag may be 1, indicating that the link disconnection frequency is abnormal.

[0310] For example, the specific process of the electronic device obtaining the flag of the disconnection frequency can be referred to the following steps S71 to S75.

[0311] S71: The electronic device determines whether the link disconnection frequency is abnormal.

[0312] Furthermore, 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.

[0313] For example, 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.

[0314] It should be noted that if the routing device frequently kicks out electronic devices, the electronic devices will automatically reconnect to the routing device after being kicked, and this back-and-forth will cause serious power consumption problems. In the embodiment of the present application, the electronic devices can obtain the link disconnection frequency and turn off the WiFi function when the link disconnection frequency is too high (i.e., abnormal). This can avoid the situation where the electronic devices frequently disconnect and reconnect, resulting in serious power consumption, and can effectively reduce power consumption.

[0315] S72: The electronic device sets the fifth flag to 0.

[0316] That is, the fifth flag obtained by the electronic device is 0. 0 is used to indicate that the link disconnection frequency is normal.

[0317] S73: The electronic device determines whether the number of abnormal times corresponding to the link-break frequency (hereinafter referred to as the fifth abnormal number) is greater than N5. If the electronic device determines that the fifth abnormal number is greater than N5, it executes step S75; if it determines that the link-break frequency is normal, it executes step S74. N5 is a positive integer.

[0318] In some embodiments, 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.

[0319] S74: The electronic device adds 1 to the recorded fifth abnormality number.

[0320] S75: The electronic device sets the fifth flag to 1.

[0321] That is, the fifth flag obtained by the electronic device is 1. 1 is used to indicate that the link disconnection frequency is abnormal.

[0322] S8: The electronic device obtains a flag corresponding to the sending frequency of the AMSDU multicast packet (referred to as the sixth flag).

[0323] The AMSDU multicast packet is a multicast packet sent by a routing device to an electronic device. The AMSDU multicast packet transmission frequency can refer to the frequency at which the routing device sends the AMSDU multicast packet, that is, the frequency at which the electronic device receives the AMSDU multicast packet. The AMSDU multicast packet can also be referred to as the transmission frequency of the aggregated multicast packet.

[0324] It should be noted that in some embodiments of the present application, due to actual conditions or other reasons, 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. In this case, the electronic device can determine the receiving frequency at which the electronic device receives the AMSDU multicast packets as the frequency for determining whether the AMSDU multicast packet is abnormal.

[0325] Among them, the sixth flag is used to indicate whether the sending frequency of the AMSDU multicast packet is abnormal. For example, 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.

[0326] Exemplarily, the specific process of the electronic device obtaining the flag corresponding to the sending frequency of the AMSDU multicast packet can be referred to the following steps S81 to S85.

[0327] S81: The electronic device determines whether the sending frequency of the AMSDU multicast packet is abnormal.

[0328] Furthermore, when the electronic device determines that the sending frequency of the AMSDU multicast packet is abnormal, it executes step S83; when it determines that the sending frequency of the AMSDU multicast packet is normal, it executes step S82.

[0329] In some embodiments, when the number of aggregated multicast packets received from the wireless access point in each time period within K consecutive time periods is greater than a third preset number, the electronic device determines that the sending frequency of the aggregated multicast packets is abnormal, where K is a positive integer.

[0330] Exemplarily, K is 10, each of the K time periods is 1 minute, and 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.

[0331] It should be noted that if an electronic device frequently receives AMSDU multicast packets sent by a routing device, that is, the frequency of sending 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. In the embodiment of the present application, the electronic device can avoid serious power consumption in the electronic device by obtaining the sending frequency of AMSDU multicast packets and turning off the WiFi function when the frequency is too high (i.e., abnormal), which can effectively reduce power consumption.

[0332] S82: The electronic device sets the sixth flag to 0.

[0333] That is, 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.

[0334] S83: The electronic device determines whether the number of abnormalities corresponding to the AMSDU multicast packet transmission frequency (hereinafter referred to as the sixth abnormality number) is greater than N6. If the electronic device determines that the sixth abnormality number is greater than N6, it executes step S85. If the electronic device determines that the AMSDU multicast packet transmission frequency is normal, it executes step S84. N6 is a positive integer.

[0335] In some embodiments, 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.

[0336] S84: The electronic device adds 1 to the recorded sixth abnormality number.

[0337] S85: The electronic device sets the sixth flag to 1.

[0338] That is, 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.

[0339] S9: The electronic device obtains a flag corresponding to the APF filtering message (referred to as the seventh flag).

[0340] 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.

[0341] For example, the seventh flag may be 0, indicating that the APF filtering message is normal; the seventh flag may be 1, indicating that the APF filtering message is abnormal. The APF filtering message may also be referred to as the message status after filtering. If the APF filtering message is abnormal, it means that the message status after filtering is abnormal.

[0342] For example, the specific process of the electronic device obtaining the flag corresponding to the APF filtering message can be referred to the following steps S91 to S95.

[0343] S91: The electronic device determines whether the APF filtering message is abnormal.

[0344] Furthermore, when the electronic device determines that the APF filtering message is abnormal, it executes step S93; when it determines that the APF filtering message is normal, it executes step S92.

[0345] In some embodiments, when the number of times the WiFi chip is awakened by the data packet in each time period within L consecutive time periods is greater than a second preset number, the electronic device determines that the filtered message situation is abnormal, where L is a positive integer.

[0346] Exemplarily, L is 10, each of the L time periods is 1 minute, the second preset number is 2, and 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.

[0347] It should be noted that if the APF filtering message is abnormal, it will cause the WiFi chip to wake up, and the WiFi chip will remain in a state of not sleeping or sleeping for too short a time, resulting in serious power consumption of the electronic device. In the embodiment of the present application, the electronic device can avoid the situation of serious power consumption of the electronic device by determining 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.

[0348] S92: The electronic device sets the seventh flag to 0.

[0349] That is, the seventh flag obtained by the electronic device is 0. 0 is used to indicate that the APF filtering message is normal.

[0350] S93: The electronic device determines whether the number of anomalies corresponding to the APF filtered message (hereinafter referred to as the seventh anomaly number) is greater than N7. If the electronic device determines that the seventh anomaly number is greater than N7, it executes step S95; if it determines that the APF filtered message is normal, it executes step S94. N7 is a positive integer.

[0351] In some embodiments, the electronic device can obtain the recorded seventh abnormal number from the storage, add 1 to the abnormal number to obtain the updated seventh abnormal number, compare the updated seventh abnormal number with N7, and thus determine whether the abnormal number corresponding to the APF filtering message is greater than N7 times.

[0352] S94: The electronic device adds 1 to the seventh abnormality count recorded.

[0353] S95: The electronic device sets the seventh flag to 1.

[0354] That is, the seventh flag obtained by the electronic device is 1. 1 is used to indicate that the APF filtering message is abnormal.

[0355] It should be noted that 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 all be different.

[0356] S10: The electronic device determines whether any flag among the first to seventh flags is set to 1.

[0357] Furthermore, when at least one flag is set to 1, step S11 is executed; when no flag is set to 1, step S12 is executed.

[0358] S11: The electronic device reports the abnormal chip status of the WiFi chip to the power saving wizard.

[0359] In some embodiments, 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. Exemplarily, the indication information can be 1.

[0360] In one implementation, when the WiFi driver determines that the chip status of the WiFi chip is abnormal, it can 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 from the WiFi driver, it can send a notification message to the power saving wizard. The notification message may include indication information indicating that the chip status is abnormal, such as the indication information being 1 indicating that the chip status is abnormal.

[0361] S12: The electronic device ends executing the method.

[0362] S13: The electronic device determines whether there is a perceptible service currently.

[0363] In some embodiments, upon receiving a notification indicating an abnormal WiFi chip status, the abnormality identification module in the power saving wizard of the electronic device can determine whether there is currently a perceptible service (also referred to as a first service). If there is a perceptible service, step S12 is executed; if there is no perceptible service, step S14 is executed.

[0364] S14: The electronic device turns off WiFi.

[0365] In some embodiments, the electronic device can call the relevant interface through the above-mentioned WiFi FWK to turn off the WiFi function.

[0366] The method for reducing power consumption provided in the embodiments of the present application can be embodied as a "power saving" function on electronic devices.

[0367] In some embodiments, 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 through 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.

[0368] Exemplarily, 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. For example, 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.

[0369] The following is an exemplary introduction to a user interface (UI) when an electronic device provides the “power saving” function.

[0370] It should be noted that in the embodiment of the present application, the user operation can be a user's touch operation (such as a click operation, a long press operation, an up-swipe operation, a down-swipe operation, or a side-swipe operation), or a non-contact operation (such as an air gesture), or a user's voice command. The embodiment of the present application does not impose any specific restrictions on this.

[0371] Figures 6A to 6C exemplarily illustrate UIs related to an electronic device turning on the "power saving" function.

[0372] FIG. 6A shows an exemplary user interface 61 on an electronic device for displaying installed applications.

[0373] The user interface 61 displays a status bar, an icon 610 for the power saving wizard application, an icon for the clock application, and icons for other applications. The status bar may include one or more signal strength indicators for mobile communication signals (also known as cellular signals), one or more signal strength indicators for Wi-Fi signals, a battery status indicator, a time indicator, and the like.

[0374] As shown in Figure 6A, the electronic device can detect a user operation on icon 610. In response to the operation, the electronic device can display a user interface 62 as shown in Figure 6B. It should be understood that the user interface 62 is an exemplary application interface of the power saving wizard application and should not limit the embodiments of the present application.

[0375] As shown in Figure 6B, 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 this embodiment 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 opens 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.

[0376] As shown in Figure 6B, the electronic device can detect a user operation on the WiFi power saving switch 620. In response to the operation, the electronic device can activate 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 Figure 6C. The user interface 63 may include the WiFi power saving switch 630, wherein the WiFi power saving switch 630 is in the on state, which is used to indicate that the WiFi power saving switch is in the on state.

[0377] Figures 7A to 7C exemplarily illustrate UIs related to turning on the "power saving" function in another electronic device.

[0378] FIG. 7A shows an exemplary user interface 71 on an electronic device for displaying installed applications.

[0379] The user interface 71 displays a status bar, a settings application icon 710, a clock application icon, and icons of other applications. The status bar may include one or more signal strength indicators for mobile communication signals (also known as cellular signals), one or more signal strength indicators for Wi-Fi signals, a battery status indicator, a time indicator, and the like.

[0380] As shown in Figure 7A, the electronic device can detect a user operation on icon 710. In response to the operation, the electronic device can display a user interface 72 as shown in Figure 7B. It should be understood that the user interface 72 is an exemplary application interface of a settings application and should not limit the embodiments of the present application.

[0381] As shown in Figure 7B, 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 the "power saving" function on or off; the mobile network switch 721 is used to turn on cellular data, which may be the data service switch; and the search bar 722 is used to search for settings in the settings application.

[0382] It should be noted that in other embodiments of the present application, the mobile network switch 721 may also include an option for selecting a SIM card, etc., which is not limited in this embodiment 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. This embodiment of the present application does not limit other setting functions.

[0383] The user interface 72 exemplarily shows that the WiFi power saving switch 720 is in the off state. In other embodiments of the present application, when the user opens the settings application, the WiFi power saving switch may also be in the on state, that is, the WiFi power saving switch is in the on state.

[0384] As shown in Figure 7B, the electronic device can detect a user operation on the WiFi power saving switch 720. In response to the operation, the electronic device can activate 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 Figure 7C. The user interface 73 may include the WiFi power saving switch 730, wherein the WiFi power saving switch 730 is in the on state, which is used to indicate that the WiFi power saving switch is in the on state.

[0385] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the media 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 the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the 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, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as <head> and <body>. A node corresponds to a control or attribute in the interface, and the node is presented as user-visible content after parsing and rendering. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as 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, such as HTML through <body>. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0386] A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations that uses graphics. It can be an icon, window, control, or other interface element displayed on the display of an electronic device. Controls can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and other visual interface elements.

[0387] It should be understood that each step in the above method embodiments provided herein can be implemented by hardware integrated logic circuits in a processor or by software instructions. The method steps disclosed in the embodiments of this application can be directly implemented as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0388] 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.

[0389] This 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. In one possible design, the chip system also includes a memory for storing program instructions and data, and the memory is located within or outside the processor. The chip system can be composed of a chip or can include a chip and other discrete devices.

[0390] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0391] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in the embodiments of the present application. For example, 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 provided on different chips. The embodiments of the present application do not specifically limit the type of memory or the configuration of the memory and the processor.

[0392] Exemplarily, the chip system may 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.

[0393] 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.

[0394] The present application also provides a computer-readable storage medium storing a computer program (also referred to as code or instruction). When the computer program is executed, the computer executes the method executed by the electronic device in any of the above embodiments.

[0395] The various implementation modes of this application can be combined arbitrarily to achieve different technical effects.

[0396] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The 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. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The 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 integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).

[0397] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0398] In short, the above are only embodiments of the technical solution of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of this application should be included in the scope of protection of this application.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A method for reducing power consumption, characterized in that: Applied to an electronic device, the electronic device includes a wireless fidelity WiFi chip, the WiFi chip is used to implement a WiFi function, and the method includes: The electronic device turns on the WiFi function; The electronic device receives a beacon frame sent by a wireless access point; The electronic device determines the chip status of the WiFi chip based on the received beacon frame; When the chip is in an abnormal state, the electronic device turns off the WiFi function of the electronic device.

2. The method according to claim 1, characterized in that: The beacon frame includes a data transmission indication information TIM bit, and 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 the TIM bit set is used to indicate that the wireless access point will send data to the electronic device; When the number of times that the electronic device receives the beacon frame with the TIM bit error within the second time period is greater than a first preset number, it is determined that the chip state is an abnormal state.

3. The method according to claim 1 or 2, characterized in that: 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; When the beacon frame reception rate is lower than a preset reception rate, the electronic device determines that the chip state is an abnormal state.

4. The method according to claim 1, characterized in that The electronic device determines the chip state of the WiFi chip based on the received beacon frame, including: The electronic device acquires first data, 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; When 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.

5. The method according to claim 4, characterized in that The method further comprises: When the number of beacon frames with TIM bit errors received in the fourth time period is greater than the first preset number, or the beacon frame reception rate is lower than the preset reception rate, the electronic device determines that an abnormality occurs in the received beacon frame.

6. The method according to claim 4 or 5, characterized in that: The method further comprises: The electronic device receives the broadcast key update frame sent by the wireless access point; When the number of the broadcast key update frames in each time period in N consecutive time periods exceeds a first preset number, the electronic device determines that the sending frequency of the broadcast key update frames is abnormal, where N is a positive integer.

7. The method according to any one of claims 4 to 6, characterized in that: The method further comprises: The electronic device receives the block request frame sent by the wireless access point; When the number of the broadcast key update frames in each time period in M ​​consecutive time periods exceeds a second preset number, the electronic device determines that the sending frequency of the block request frame is abnormal, where M is a positive integer.

8. The method according to any one of claims 4 to 7, characterized in that: The method further comprises: When the number of aggregated multicast packets received from the wireless access point in each time period in K consecutive time periods is greater than a third preset number, the electronic device determines that the sending frequency of the aggregated multicast packets is abnormal, where K is a positive integer.

9. The method according to any one of claims 4 to 8, characterized in that: The method further comprises: The electronic device enables the Android packet filtering APF function; The electronic device receives a data packet sent by the wireless access point, wherein the data packet includes a broadcast packet and a multicast packet; When the number of times the data packet wakes up the WiFi chip in each time period within L consecutive time periods is greater than a second preset number, the electronic device determines that the filtered message situation is abnormal, and L is a positive integer.

10. The method according to any one of claims 1 to 9, characterized in that The electronic device determines the chip state of the WiFi chip based on the received beacon frame, including: After entering the sleep mode, the electronic device determines the chip state of the WiFi chip based on the received beacon frame.

11. The method according to claim 10, characterized in that After shutting down the WiFi function of the electronic device, the method further includes: When the electronic device exits the sleep mode, the WiFi function is turned on.

12. The method according to any one of claims 1 to 11, characterized in that The electronic device determines the chip state of the WiFi chip based on the received beacon frame, including: The electronic device determines the activation status of the mobile network of the electronic device; When the electronic device is turned on in the mobile network, the chip status of the WiFi chip is determined based on the received beacon frame.

13. The method according to any one of claims 1 to 12, characterized in that When the chip state is in an abnormal state, the electronic device turns off the WiFi function of the electronic device, including: The electronic device determines, when the chip state of the WiFi chip is in an abnormal state, an execution status of a first service; the first service is a service that cannot be executed when the WiFi function is turned off; When the electronic device determines that the first service is not currently being executed, the WiFi function of the electronic device is turned off.

14. The method according to any one of claims 1 to 13, characterized in that 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 a WiFi driver.

15. The method according to claim 14, characterized in that After shutting down the WiFi function of the electronic device, the method further includes: The electronic device stops periodically acquiring the chip status of the WiFi chip through the WiFi driver.

16. An electronic device, characterized in that: The method comprises 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 codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the method as claimed in any one of claims 1 to 15 is executed.

17. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the method according to any one of claims 1 to 15 is executed.