Method, device and system for reducing power consumption
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 caused by the WiFi chip not sleeping or the sleep time is too short, and the power consumption is significantly reduced.
Patent Information
- Application Number
- CN202310713807.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2024-12-17
AI Technical Summary
When an electronic device is connected to a wireless router, due to matching problems or router configuration errors, the WiFi chip cannot sleep or the sleep time is too short, resulting in high power consumption and obvious power consumption.
By receiving beacon frames sent by the wireless access access point, the status of the WiFi chip is determined, and if abnormal, the WiFi function is turned off, avoiding the situation of not sleeping or short sleep time, thereby reducing power consumption.
It effectively reduces the power consumption caused by WiFi abnormalities and reduces the power consumption of electronic devices, especially during standby time at night, which is significantly reduced, and is controlled above 20mA.
Smart Images

Figure CN119155774A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] 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 of Wi-Fi signals. Electronic devices can access Wi-Fi networks through Wi-Fi routers.
[0003] 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. Summary of the invention
[0004] The present application provides a method, device and system for reducing power consumption, in which the electronic device can determine the chip status of the WiFi chip based on the received beacon frame, and then turn off the WiFi function when the WiFi chip is abnormal. The method can avoid the situation where the WiFi chip does not sleep or the sleep time is short when the WiFi chip is abnormal, thereby effectively reducing the serious power consumption caused by the WiFi abnormality.
[0005] 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:
[0006] Turn on the WiFi function of the electronic device;
[0007] The electronic device receives a beacon frame sent by a wireless access point;
[0008] The electronic device determines a chip state of the WiFi chip based on the received beacon frame;
[0009] When the chip status of the electronic device is abnormal, the WiFi function of the electronic device is turned off.
[0010] 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), wherein the abnormal chip status includes the chip not being in sleep mode, the sleep time being too short, and being frequently awakened, etc. This method can reduce the power consumption and power consumption of the electronic device.
[0011] For example, if the WiFi chip cannot sleep during the screen-off standby period of an electronic device, and the power consumption of the electronic device exceeds 60mA, the method provided in the embodiment of the present application can reduce the nighttime standby power consumption, and after successful control, there will be a benefit of more than 20mA. The specific benefit depends on the wake-up frequency and system status before control.
[0012] Optionally, turning off the WiFi function of the electronic device may be that the electronic device powers off a Wi-Fi chip.
[0013] In combination with the first aspect, in a possible implementation, 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:
[0014] The electronic device does not receive any data within a first time period after receiving a beacon frame with a TIM bit set, and determines that the TIM bit of the beacon frame is wrong; the beacon frame with a TIM bit set is used to indicate that the wireless access point will send data to the electronic device;
[0015] When the number of beacon frames with TIM bit errors received by the electronic device within the second time period is greater than the first preset number, it is determined that the chip state is an abnormal state.
[0016] The TIM bit being set may also be referred to as TIM bit being set.
[0017] In an embodiment of the present application, the electronic device can identify frequent setting errors of the TIM bit in the beacon frame, and then turn off the WiFi function. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent setting errors of the TIM bit, thereby reducing the power consumption and power consumption of the electronic device.
[0018] In combination with the first aspect, in a possible implementation manner, the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
[0019] 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;
[0020] 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.
[0021] It should be noted that if an electronic device receives a small number of beacon frames, the WiFi chip will work for a long time, resulting in serious power consumption of the electronic device. For example, an electronic device with a reception rate of less than 60% can be called a problem user. The power consumption of a problem user at 0-6 o'clock is about 7% to 8%. The embodiment of the present application can identify the problem user and identify the problem user when certain conditions are met (such as Figure 4Turning off WiFi when the data switch shown is turned on and / or there is no perceptible business, etc., can avoid the WiFi chip working for a long time and effectively reduce the power consumption of the electronic device.
[0022] In combination with the first aspect, in a possible implementation manner, the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
[0023] The electronic device acquires first data, where the first data includes at least one of a sending frequency of a broadcast key update frame, a sending frequency of a block request frame, a link disconnection frequency, a sending frequency of an aggregated multicast packet, and a filtered message condition;
[0024] 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.
[0025] In an embodiment of the present application, the electronic device can identify any abnormal situation of the received beacon frames, the sending frequency of the broadcast key update frames, the sending frequency of the block request frames, the link disconnection frequency, the sending frequency of the aggregated multicast packets and the filtered message conditions, and then turn off the WiFi function. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short, thereby reducing the power consumption and power consumption of the electronic device.
[0026] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0027] 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.
[0028] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0029] The electronic device receives a broadcast key update frame sent by a wireless access point;
[0030] 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.
[0031] In an embodiment of the present application, the electronic device can identify whether the wireless access point frequently sends broadcast key update frames, and then turn off the WiFi function when the broadcast key update frames are frequently received. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent reception of broadcast key update frames, thereby reducing the power consumption and power consumption of the electronic device.
[0032] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0033] The electronic device receives a block request frame sent by a wireless access point;
[0034] When the number of 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.
[0035] In an embodiment of the present application, the electronic device can identify whether the wireless access point frequently sends block request frames, and then turn off the WiFi function when the block request frames are frequently received. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent reception of block request frames, thereby reducing the power consumption and power consumption of the electronic device.
[0036] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0037] 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.
[0038] 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 power consumption of the electronic device.
[0039] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0040] The electronic device turns on the Android packet filtering APF function; the Android packet filtering APF function is used to filter broadcast packets and multicast packets;
[0041] The electronic device receives a data packet sent by a wireless access point, the data packet including a broadcast packet and a multicast packet;
[0042] When the number of times that the data packet wakes up the WiFi chip in each time period in L consecutive time periods is greater than the second preset number, the electronic device determines that the filtered message situation is abnormal, and L is a positive integer.
[0043] Optionally, the electronic device may automatically enable the Android packet filtering APF function when the WiFi function is enabled.
[0044] It is understandable 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 awakened by the unfiltered messages, thereby reducing the power consumption and power consumption of the electronic device.
[0045] In combination with the first aspect, in a possible implementation manner, the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
[0046] After entering the sleep mode, the electronic device determines the chip state of the WiFi chip based on the received beacon frame.
[0047] Optionally, the electronic device may enter the sleep mode when it recognizes that the user is in a sleep state. For example, the electronic device may exit the sleep mode when it recognizes through a sensor that its position has moved or the surrounding brightness has changed.
[0048] In an embodiment of the present application, the WiFi monitoring function (i.e., determining the chip status of the WiFi chip as described above) is activated only when the user is in a sleep state. This method can avoid network interruptions that affect user use during the user's use of the electronic device, and reduce the problem of excessive power consumption caused by WiFi anomalies when the user is in a sleep state.
[0049] In combination with the first aspect, in a possible implementation manner, the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
[0050] The electronic device determines whether the mobile network of the electronic device is turned on;
[0051] 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.
[0052] In the embodiment of the present application, the electronic device starts the WiFi monitoring function (i.e., the chip status of the WiFi chip is determined as mentioned above) only when the mobile network is turned on. This can avoid turning off the WiFi when the data service switch is turned off, resulting in the electronic device not being connected to the Internet, and the electronic device's time, location, and other data that need to be updated online cannot be updated, thereby affecting the user experience. This method can ensure that the electronic device can at least be connected to the Internet through cellular data during the WiFi management and control process, and the electronic device will not be disconnected from the Internet, thereby ensuring the user experience effect.
[0053] In combination with the first aspect, in a possible implementation, after turning off the WiFi function of the electronic device, the method further includes:
[0054] When the electronic device exits sleep mode, turn on the WiFi function.
[0055] Optionally, the electronic device may exit the sleep mode when recognizing that the user switches from the sleep state to the non-sleep state.
[0056] 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.
[0057] In combination with the first aspect, in a possible implementation, when the chip status of the electronic device is an abnormal status, turning off the WiFi function of the electronic device includes:
[0058] The electronic device determines the execution status of the first service when the chip status of the WiFi chip is in an abnormal status; the first service is a service that cannot be executed when the WiFi function is turned off;
[0059] When the electronic device determines that the first service is not currently being executed, the WiFi function of the electronic device is turned off.
[0060] In the embodiment of the present application, when the electronic device executes the perceptible service, not shutting down the WiFi can ensure that the perceptible service is not interrupted, and can avoid affecting the user experience after the perceptible service is interrupted.
[0061] In combination with the first aspect, in a possible implementation manner, the electronic device determines the chip state of the WiFi chip based on the received beacon frame, including:
[0062] The electronic device periodically obtains the chip status of the WiFi chip through the WiFi driver.
[0063] 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 is abnormal at any time during the entire process, the WiFi can be managed, thereby effectively reducing the power consumption of the electronic device and avoiding serious power consumption.
[0064] In a possible embodiment, the electronic device can periodically monitor the chip status of the WiFi chip after entering the sleep mode, and manage the WiFi when an abnormality occurs in the WiFi chip at any time during the entire process, thereby effectively reducing the power consumption of the electronic device and avoiding severe power consumption.
[0065] In combination with the first aspect, in a possible implementation, after turning off the WiFi function of the electronic device, the method further includes:
[0066] The electronic device stops periodically obtaining the chip status of the WiFi chip through the WiFi driver.
[0067] 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.
[0068] In a second aspect, the present application provides an electronic device, the electronic device comprising a processor and a WiFi chip; wherein:
[0069] The processor is used to enable the WiFi function;
[0070] The WiFi chip is used to receive beacon frames sent by a wireless access point when the WiFi function is turned on;
[0071] The WiFi chip is used to determine the chip state of the WiFi chip based on the received beacon frame; the WiFi chip is also used to notify the processor when the chip state is abnormal;
[0072] The processor is used to turn off the WiFi function when the chip status is abnormal.
[0073] 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, wherein the abnormal chip status includes the chip not being in sleep mode, the sleep time being too short, and being frequently awakened, etc. This method can reduce the power consumption and power consumption of the electronic device.
[0074] For example, if the WiFi chip cannot sleep during the screen-off standby period of an electronic device, and the power consumption of the electronic device exceeds 60mA, the method provided in the embodiment of the present application can reduce the nighttime standby power consumption, and after successful control, there will be a benefit of more than 20mA. The specific benefit depends on the wake-up frequency and system status before control.
[0075] In conjunction with the second aspect, in a possible implementation manner, the beacon frame includes a data to be transmitted indication information TIM bit, and the WiFi chip is specifically used for:
[0076] After receiving the beacon frame with the TIM bit set, no data is received within a first time period, determining that the TIM bit of the beacon frame is wrong; the beacon frame with the TIM bit set is used to indicate that the wireless access point will send data to the electronic device;
[0077] 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 chip state is an abnormal state.
[0078] In conjunction with the second aspect, in a possible implementation manner, the WiFi chip is specifically used for:
[0079] Calculate 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;
[0080] When the beacon frame receiving rate is lower than a preset receiving rate, it is determined that the chip state is an abnormal state.
[0081] In an embodiment of the present application, the electronic device can identify frequent setting errors of the TIM bit in the beacon frame, and then turn off the WiFi function. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short due to frequent setting errors of the TIM bit, thereby reducing the power consumption and power consumption of the electronic device.
[0082] In conjunction with the second aspect, in a possible implementation manner, the WiFi chip is specifically used for:
[0083] Acquire 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;
[0084] 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.
[0085] In an embodiment of the present application, the electronic device can identify any abnormal situation of the sending frequency of the broadcast key update frame, the sending frequency of the block request frame, the link disconnection frequency, the sending frequency of the aggregated multicast packet and the filtered message status, and then turn off the WiFi function. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is too short, thereby reducing the power consumption and power consumption of the electronic device.
[0086] 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 includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.
[0087] 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 so that the electronic device executes the method described in the first aspect and any possible implementation method of the first aspect.
[0088] In a fifth aspect, the present application provides a computer-readable storage medium comprising instructions. When the instructions are executed on an electronic device, the electronic device executes the method described in the first aspect and any possible implementation manner of the first aspect.
[0089] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.
[0090] It can be understood 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 execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Figure 1 is a schematic diagram of an application scenario exemplarily shown in an embodiment of the present application;
[0092] Figure 2 is a schematic diagram of the hardware structure of an electronic device exemplarily provided in an embodiment of the present application;
[0093] Figure 3 is a schematic block diagram of the system architecture of an electronic device 100 exemplarily provided in an embodiment of the present application;
[0094] Figure 4 is a flow chart of a method for reducing power consumption exemplarily provided in an embodiment of the present application;
[0095] Figure 5 is a flowchart of another method for reducing power consumption provided by an embodiment of the present application;
[0096] FIG. 6A to FIG. 6C A user interface for enabling a "power saving" function of an electronic device provided in an embodiment of the present application;
[0097] FIG. 7A to FIG. 7C This is another user interface for enabling the “power saving” function of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0098] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0099] Figure 1It is a schematic diagram of an application scenario exemplarily shown in an embodiment of the present application.
[0100] like Figure 1 As shown, the scenario includes an electronic device 100 and a routing device 200. The electronic device 100 is a device with a Wi-Fi function, that is, the electronic device 100 supports Wireless Fidelity (WiFi) technology, and can achieve wireless network connection through WiFi to send and receive network data; the routing device 200 is used to provide a Wi-Fi hotspot.
[0101] Exemplarily, the routing device 200 may be a Wi-Fi router that provides a Wi-Fi hotspot, and the electronic device 100 is a device that includes a Wi-Fi module (or a Wi-Fi chip) and other structures to provide a WiFi function. The electronic device can connect to the routing device 200 through its own Wi-Fi module and communicate with an external network through the routing device 200. For ease of description, Wi-Fi is abbreviated as WiFi in the following embodiments, such as a Wi-Fi chip or a Wi-Fi module is referred to as a WiFi chip.
[0102] Exemplarily, when the WiFi function of the electronic device 100 is set to "on" (i.e., the WiFi function is on), the electronic device 100 can periodically scan the WiFi signals within the current environment. For example, the electronic device 100 can display one or more currently detected WiFi signals and corresponding signal strength information to the user; in addition, the electronic device 100 can also implement WiFi automatic access and other operations according to the preset WiFi automatic access settings and the saved successfully accessed WiFi accounts. 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 the WiFi signals within the current environment, saving the power consumption of the device, thereby effectively saving the power consumption of the electronic device 100.
[0103] 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.
[0104] Optionally, the electronic device 100 may further include a cellular data module, and then the electronic device 100 may communicate with an external network through its own cellular data module. Figure 2The mobile communication module 150 in FIG. 1 is a mobile communication module 150. It should be noted that the cellular data module and the WiFi chip can be located on the same hardware module (such as a chip); or they can be separate hardware modules, which is not limited in the embodiment of the present application.
[0105] exist Figure 1 In the scenario shown, 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 awakened, resulting in serious power consumption of the electronic device 100.
[0106] The inventors of the embodiments of the present application have found through research that the following situations will cause serious power consumption of electronic devices, as follows:
[0107] Case 1: The routing device sends a beacon frame.
[0108] The cycle is inaccurate, causing the WiFi chip to not sleep or sleep for a short time.
[0109] In some embodiments, the routing device may send a management frame, such as a Beacon frame, to the electronic device.
[0110] The main reasons for the inaccurate beacon frame period include: the timestamps between the electronic device and the routing device are not aligned, resulting in the electronic device being unable to receive the beacon frame or a large number of beacon frames being unable to be received.
[0111] If a small number of beacon frames are received, the WiFi chip will work for a long time, causing serious power consumption of the electronic device. For example, the power consumption of the electronic device with this problem from 0:00 to 6:00 may be between 7% and 8%.
[0112] Case 2: The traffic indication map (TIM) bit of the beacon frame sent by the routing device is incorrectly set, and the electronic device mistakenly believes that the wireless access point (AP) side (i.e., the routing device) still has data to send, and the WiFi chip does not sleep.
[0113] 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, the TIM bit corresponding to the electronic device can be set in the beacon frame (such as set 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 data.
[0114] When the TIM bit in the beacon frame is set incorrectly or is always set (the TIM bit is set even if there is no data to send), the WiFi chip will not be powered off, causing serious power consumption problems. Currently, the TIM setting problem is the top power consumption problem. The power consumption of electronic devices (problem users) with this problem depends on the error frequency of the incorrect setting. An error frequency of 1 time / s can cause the electronic device to consume more than 10% of its power, and an error frequency of 0.5 times / s can cause the electronic device to consume 5%-7% of its power. It should be understood that the incorrect setting of the TIM bit may be related to factors such as the design of the routing equipment manufacturer.
[0115] Case 3: The routing device configuration key is updated (rekey) too frequently, frequently waking up the host (host), such as waking up the central processor.
[0116] 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).
[0117] However, if the update interval of the broadcast key is set very short, the routing device will frequently send rekey packets (such as updating every 30 seconds) to the electronic device, causing the WiFi chip sleep interrupt to be awakened, resulting in serious power consumption of the electronic device.
[0118] It should be noted that in some embodiments of the present application, the update interval of the broadcast key is a configurable item of the routing device, but since the user is not aware of it and few users know how to reconfigure the configuration item of the routing device to return to normal, this problem affects the power consumption of the electronic device. Among them, the update interval of the broadcast key is set very short, which may be caused by reasons such as non-standard routing equipment or setting errors.
[0119] Case 4: The routing device frequently kicks out the electronic device, which then re-initiates the WiFi connection, causing abnormal power consumption of the electronic device.
[0120] Due to the design of the routing device itself and other reasons, the routing device will kick out the electronic device (such as a mobile phone) 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 the electronic device hundreds of times a night, which means frequent disconnections. The electronic device will automatically reconnect after being kicked out, causing serious power consumption problems. Problem users (that is, electronic devices with this problem) generally consume more than 15% of power.
[0121] Case 5: ADDBA request frames (ADDBA request, referred to as addba req frames) frequently wake up the host.
[0122] The addbareq action frame is used to establish a block acknowledgment mechanism (Block Ack), but some routing devices frequently send addbareq action frame requests, which wakes up the host and keeps the WiFi chip awake. It should be understood that since this is a management frame, the WiFi chip will not filter it, causing the electronic device to consume about 10% of its power overnight.
[0123] Case 6: Aggregate multicast packets frequently wake up the host, and the WiFi chip does not sleep or sleeps for a short time.
[0124] 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).
[0125] At present, when the Android Packet Filter (APF) is performed on the WiFi chip side, only a single multicast packet or a single broadcast packet can be filtered; for aggregated frames, the WiFi chip side can only filter small packet aggregated frames of a single network buffer (netbuffer, netbuf), and the IP address header of each subframe is a multicast address or a broadcast address, while aggregated frames of multiple netbufs (large packet aggregation, such as AMSDU multicast packets) or any subframe in the aggregated frame with an IP address header of a unicast address cannot be filtered.
[0126] In this case, the user will be frequently awakened, the power consumption when the screen is turned off can reach several hundred milliampere hours (mAh), and the WiFi chip does not sleep or sleeps for a short time, causing the electronic device to consume about 10% of power per night.
[0127] Case 7: APF filtering message is abnormal, and the chip is still frequently awakened.
[0128] Assume that APF filtering of multicast and broadcast packets has been enabled on the chip side. If multicast and broadcast packets still frequently wake up the WiFi chip, it means that the APF filtering message is abnormal.
[0129] 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.
[0130] In the embodiment of the present application, the electronic device can turn off the WiFi function when the WiFi chip is abnormal. This method can avoid the situation where the WiFi chip does not sleep or the sleep time is short when the WiFi chip is abnormal, thereby effectively reducing the serious power consumption caused by the WiFi abnormality. For the convenience of description, turning off the WiFi function is also referred to as turning off WiFi below.
[0131] In the embodiment of the present application, the electronic device can also perform WiFi abnormality and WiFi monitoring and management when in deep sleep mode, wherein WiFi monitoring is to identify whether the WiFi chip is abnormal, and management includes turning off and on the WiFi function. This method can avoid turning off the WiFi function and affecting the user experience.
[0132] In the embodiment of the present application, the electronic device can also perform WiFi abnormality WiFi monitoring and management when no perceptible service is performed, wherein WiFi monitoring is to identify whether the WiFi chip is abnormal, management includes turning off and on the WiFi function, and the perceptible service can be the service that is suspended when the WiFi function is interrupted. This method can avoid affecting the user experience due to turning off the WiFi function.
[0133] In the embodiments of the present application, the electronic devices include but are not limited to mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPC), netbooks, etc. Exemplary embodiments of electronic devices include but are not limited to devices equipped with The portable electronic device of Linux or other operating system. The electronic device may also be other portable electronic devices, such as a laptop computer (Laptop) and the like.
[0134] Next, the software and hardware architecture of the electronic device provided in the embodiments of the present application is exemplarily introduced.
[0135] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. Figure 2 The electronic device 100 is taken as an example for description.
[0136] like Figure 2 As shown, 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, etc. Among them, the sensor module 180 may include a touch sensor 180K.
[0137] It is to be understood that 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 some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0138] 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 in 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 according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. A memory can also be set in the processor 110 for storing instructions and data.
[0139] The internal memory 121 may be used to store computer executable program codes, wherein the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121 .
[0140] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G etc. applied to the electronic device 100.
[0141] 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.
[0142] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), etc., which are applied to the electronic device 100. Optionally, the electronic device 100 can also provide wireless communication solutions such as near field communication technology (NFC), infrared technology (IR), etc., which will not be expanded here.
[0143] The WiFi chip involved in the embodiments of the present application may be exemplarily as follows Figure 2 The wireless communication module 160 shown in the figure may include a firmware program (fireware) for realizing the recognition of whether the chip status of the WiFi chip is abnormal (such as Figure 4 Steps S17 and S18 shown).
[0144] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0145] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini LED, Micro LED, Micro-OLED, quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0146] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image or video visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0147] 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 transmits 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.
[0148] The video codec is used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG1, MPEG4, etc.
[0149] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0150] It should be noted that Figure 2 The functions of other modules not mentioned in the electronic device 100 shown can be referred to relevant technical documents, and this application will not elaborate on them.
[0151] 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.
[0152] In the embodiment provided in the present application, the electronic device 100 can execute the method for reducing power consumption through the processor 110 and the wireless communication module 160.
[0153] Figure 3 It is a schematic block diagram of the system architecture of the electronic device 100 exemplarily provided in an embodiment of the present application.
[0154] The system architecture of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0155] The layered architecture divides the system into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer (APP layer), the application framework layer (FWK layer), the system layer and the kernel layer.
[0156] like Figure 3 As shown, the APP layer can include a series of application packages, such as Power Saving Wizard. In the embodiment of the present application, the APP layer can run the "Power Saving Wizard" application.
[0157] In the embodiment of the present application, the power saving wizard is used to notify the WiFi FWK to start or shut down the WiFi monitoring of the chip status of the WiFi chip, and to notify the WiFi FWK to turn on or off the WiFi function.
[0158] 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.
[0159] For example, the power saving wizard can intelligently learn user habits, identify whether the user is in sleep mode through the current time, ambient light, the static state of the electronic device 100 and the screen off state, and obtain the status of the mobile phone to determine whether the user has turned on WiFi and data services, has no perceptible services, and other scenarios; turn off WiFi when the WiFi chip abnormal conditions are met, for example, the WiFi chip abnormal conditions may include any of the seven flags listed below being set to 1; restore WiFi (i.e., turn on WiFi) when exiting deep sleep mode or charging, moving, or turning on the screen.
[0160] Optionally, the application packages installed in the APP layer may also include applications such as gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. ( Figure 3 ), which is not shown in the figure and is not limited here.
[0161] The system layer may include multiple functional modules, such as: Surface Manager, Media Libraries, 3D image processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0162] The surface manager is used to manage the display subsystem and provides the fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications.
[0163] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0164] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc.
[0165] A 2D graphics engine is a drawing engine for 2D drawings.
[0166] The FWK layer provides application programming interfaces (APIs) and programming frameworks for applications in the APP layer. Figure 3 As shown, the FWK layer may include a WiFi FWK.
[0167] 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 the WiFi.
[0168] The FWK layer can include some predefined functions, and can also include window managers, content providers, view systems, phone managers, resource managers, notification managers, etc. ( Figure 3 not shown).
[0169] Among them, the window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to the application. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text notification icon may include a view for displaying text and a view for displaying pictures. The phone manager is used to provide communication functions for the electronic device 100. For example, the management of call status (including connecting, hanging up, etc.). The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the top status bar of the system in the form of an icon or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window, such as a text message prompt in the status bar, a prompt sound, vibration of the electronic device 100, flashing of an indicator light, etc.
[0170] The kernel layer is the layer between hardware and software. The kernel layer includes drivers for various hardware, such as the WiFi driver corresponding to the WiFi module.
[0171] 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, which will not be expanded here. The specific process of obtaining the chip status of the WiFi chip can be implemented by the firmware program (fireware) of the WiFi driver.
[0172] The kernel layer may also include a camera driver, an audio driver, and a sensor driver. The kernel layer may also include a digital signal processor driver (not shown) and an image processor driver (not shown). The camera driver is used to drive the image sensor of one or more cameras in the camera module to collect images and drive the image signal processor to pre-process the image. The digital signal processor driver is used to drive the digital signal processor to process images. The image processor driver is used to drive the graphics processor to process images.
[0173] The software architecture may also include Figure 3 The hardware abstraction layer (HAL), not shown in the figure, is an interface layer located between the application framework layer and the kernel layer, and provides a virtual hardware platform for the operating system.
[0174] Based on the above Figure 1 The application scenarios shown and Figure 2 and Figure 3 The hardware and software architecture of the electronic device introduced above is Figure 4 and Figure 5 The description goes into depth with the architecture to explain respectively the methods for reducing power consumption provided by various embodiments of the present application.
[0175] Figure 4 FIG. 1 is a flow chart showing a method for reducing power consumption provided by an embodiment of the present application. Figure 4 As shown, the method includes some or all of the following steps:
[0176] S11: The power saving wizard enters deep sleep mode.
[0177] In some embodiments, before executing S11, the electronic device may start the WiFi function in response to a user operation. For example, the setting application of the electronic device includes a WiFi switch or the pull-down task bar of the main interface of the electronic device includes a WiFi switch, and the electronic device starts the WiFi function in response to the user operation acting on the WiFi switch, that is, the electronic device can establish a connection with the routing device through the WiFi chip.
[0178] In some embodiments, the power saving wizard may enter a deep sleep mode (also referred to as a night mode or a sleep mode) when determining that the user is in a sleep state. The user may be a user of the electronic device.
[0179] 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, the power saving wizard enters a deep sleep mode.
[0180] For example, Power Saver can use the smart night mode algorithm to determine the user's status every ten minutes. If it determines that the user is currently asleep, it can predict the user's wake-up time based on the user's habits. If the user suddenly unlocks the device while in night mode, the smart night mode algorithm can immediately exit night mode. If the user suddenly turns on the light while in night mode, the smart night mode algorithm can exit night mode at the next determination.
[0181] 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 in the past period of time.
[0182] In an embodiment of the present application, the WiFi monitoring function is activated only when the user is in a sleep state. This method can avoid network interruption during the user's use of the electronic device and affect the user's use, and reduce the problem of excessive power consumption caused by WiFi abnormalities when the user is in a sleep state.
[0183] 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.
[0184] S12: The power saving wizard determines whether the data service switch is turned on.
[0185] Furthermore, when the data service data switch is not turned on, the power saving wizard executes step S13; when the data service data switch is turned on, the power saving wizard executes step S14.
[0186] In some embodiments, the power saving wizard can determine whether the data service switch is turned on when entering the deep sleep mode. The data service switch is used to turn on cellular data. 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".
[0187] Exemplarily, the data service switch may be as follows: Figure 7B As shown in the mobile network switch 721 in the user interface.
[0188] 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 .
[0189] S13: The electronic device ends executing the method.
[0190] In some embodiments, the power saving wizard may not execute steps S12 and S13, but directly execute S14, that is, WiFi monitoring and management (referred to as control) of WiFi is performed regardless of whether the data service switch is turned on.
[0191] It should be noted that Figure 4 In the illustrated embodiment, the power saving wizard executes the above S12 and S13 to avoid turning off the WiFi when the data service switch is turned off, resulting in the electronic device not being connected to the Internet, and the time, location and other data of the electronic device that need to be updated online cannot be updated, thereby affecting the user experience. The method can ensure that the electronic device can at least be connected to the Internet through cellular data during the WiFi management and control process, and the electronic device will not be disconnected from the Internet, thereby ensuring the user experience effect.
[0192] S14: Power Saving Wizard notifies WiFi FWK to start WiFi monitoring.
[0193] 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.
[0194] S15: When the WiFi FWK receives the notification of starting WiFi monitoring from the power saving wizard, it starts WiFi monitoring.
[0195] S16: The WiFi FWK periodically queries the chip status of the WiFi chip.
[0196] In some embodiments, when the WiFi FWK receives the notification of starting WiFi monitoring sent by the power saving wizard, it periodically queries the chip status of the WiFi chip.
[0197] The chip status may include a normal status and an abnormal status. 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.
[0198] In some other embodiments of the present application, the WiFi FWK may also query only once when receiving the notification of starting WiFi monitoring sent by the power saving wizard. Then, the WiFi FWK does not need to stop WiFi monitoring when executing steps S21 and S22; nor does it need to execute steps S25 and S26. This method only performs WiFi monitoring on the chip status of the WiFi chip when entering the deep sleep mode.
[0199] It should be noted that Figure 4In the embodiment shown, the WiFi FWK periodically monitors the chip status of the WiFi chip after the power saving wizard enters the deep sleep mode. The method can continuously monitor the chip status of the WiFi chip during the entire process of the deep sleep mode, and manage the WiFi when the WiFi chip is abnormal at any time during the entire process, thereby effectively reducing the power consumption of the electronic device and avoiding serious power consumption.
[0200] S17: The WiFi driver determines the chip status of the WiFi chip based on the routing data.
[0201] 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.
[0202] For the specific process of the WiFi driver determining the chip status of the WiFi chip, please refer to Figure 5 The relevant content in will not be expanded here.
[0203] S18: When the WiFi driver determines that the chip status of the WiFi chip is abnormal, it notifies the WiFi FWK.
[0204] In some embodiments, when the WiFi driver determines that the chip state 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 state, such as the indication information is 1, which means the chip state is abnormal, and the indication information is 0, which means the chip state is normal.
[0205] 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.
[0206] It is understandable that since the WiFi chip will not cause a large amount of power consumption when the chip status is normal, the electronic device does not need to manage the WiFi when the WiFi chip is in a normal state. Therefore, in the embodiment of the present application, when the chip status of the WiFi chip is normal, the WiFi FWK is not notified, which can reduce the power consumption caused by the notification.
[0207] S19: WiFi FWK notifies Power Saver that the WiFi chip status is abnormal.
[0208] In some embodiments, when the WiFi FWK receives a notification sent by 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, which means that the chip status is abnormal, and the indication information is 0, which means that the chip status is normal.
[0209] S20: The power saving wizard determines whether there is any perceptible service currently.
[0210] The perceptible service may be a service that is perceptible to the user, that is, the user may perceive the suspension of the service. For example, the perceptible service may include background playback, downloading, navigation, and other services.
[0211] 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.
[0212] 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; further, the abnormality identification module may determine whether there is currently a perceptible service.
[0213] In the embodiment of the present application, when the electronic device executes the perceptible service, not shutting down the WiFi can ensure that the perceptible service is not interrupted, and can avoid affecting the user experience after the perceptible service is interrupted.
[0214] 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.
[0215] S21: Power Saving Wizard notifies WiFi FWK to turn off WiFi monitoring and WiFi.
[0216] S22: WiFi FWK turns off WiFi and stops WiFi monitoring.
[0217] In some embodiments, the WiFi FWK may call a WiFi shutdown interface to shut down the WiFi function.
[0218] 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.
[0219] S23: The power saving wizard exits deep sleep mode.
[0220] In some embodiments, the power saving wizard periodically determines whether the user is in a sleeping state through an intelligent night mode algorithm; when it is identified that the user is not in a sleeping state, the deep sleep mode is exited.
[0221] S24: The power saving wizard notifies the WiFi FWK to stop WiFi monitoring.
[0222] In some embodiments, when the power saving wizard exits the deep sleep mode, it notifies the WiFi FWK to stop WiFi monitoring.
[0223] S25: The WiFi FWK determines whether WiFi monitoring is currently being performed.
[0224] In some embodiments, after receiving the notification sent by the power saving wizard to instruct to stop WiFi monitoring, the WiFi FWK can determine whether WiFi monitoring has been started; when WiFi monitoring is started, step S26 is executed, and when WiFi monitoring is not started, step S13 is executed.
[0225] S26: WiFi FWK stops WiFi monitoring.
[0226] In some embodiments, when the WiFi FWK determines that the WiFi monitoring is started, the WiFi FWK stops the WiFi monitoring.
[0227] S27: The WiFi FWK determines whether the current WiFi is turned off.
[0228] In some embodiments, the WiFi FWK may determine whether the WiFi has been turned off (or is currently turned off); when the WiFi is turned off, step S28 is executed, and when the WiFi is not turned off, step S13 is executed.
[0229] S28: WiFi FWK starts WiFi.
[0230] In some embodiments, the WiFi FWK may execute step S27 to start WiFi when determining that the WiFi is turned off.
[0231] 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 the WiFi is turned on when the WiFi is turned off, so as to avoid network interruption when the user is using the electronic device. This method can reduce the problem of excessive power consumption caused by WiFi abnormalities when the user is in a sleep state.
[0232] Figure 5 FIG. 2 is a flow chart showing another method for reducing power consumption provided by an embodiment of the present application. Figure 5 As shown, the method includes some or all of the following steps:
[0233] S1: The electronic device starts monitoring of WiFi abnormalities.
[0234] In some embodiments, the electronic device may start monitoring for WiFi anomalies after turning on the WiFi function.
[0235] 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.
[0236] S2: The electronic device queries the chip status of the WiFi chip.
[0237] In some embodiments, when the WiFi FWK receives the notification of starting WiFi monitoring from the power saving wizard, the WiFi monitoring is started, that is, the WiFi driver begins to periodically query the chip status of the WiFi chip from the WiFi driver; the WiFi driver can determine the chip status of the WiFi chip through the following steps S3 to S10 (for Figure 4 A specific implementation of step S17 in ).
[0238] S3: The electronic device obtains a flag corresponding to the reception rate of the beacon frame (referred to as the first flag).
[0239] The beacon frame is a management frame sent by the routing device to the electronic device; the first flag is used to indicate whether the reception rate of the beacon frame is abnormal, for example, the first flag can be 0, 0 is used to indicate that the reception rate of the beacon frame is normal; the first flag can be 1, 1 is used to indicate that the reception rate of the beacon frame is abnormal. The reception rate of the beacon frame can also be called the beacon frame reception rate.
[0240] Exemplarily, the specific process of the electronic device obtaining the flag corresponding to the reception rate of the beacon frame can refer to the following steps S31 to S35.
[0241] S31: The electronic device determines whether the reception rate of the beacon frame is abnormal.
[0242] Furthermore, when the electronic device determines that the reception rate of the beacon frame is abnormal, the electronic device executes step S33; when the electronic device determines that the reception rate of the beacon frame is normal, the electronic device executes step S32.
[0243] In some embodiments, the electronic device may divide the number of beacon frames actually received within a preset time by the number of beacon frames that should be received (also referred to as the preset number of frames) to obtain a beacon reception rate (also referred to as a beacon frame reception rate). If the calculated beacon reception rate is lower than the preset reception rate, the beacon frame reception rate is considered abnormal. The number of beacon frames that should be received may be the preset number of frames.
[0244] For example, the preset time is 5 minutes and the preset reception rate can be 60%. Then, the electronic device can calculate the beacon reception rate every five minutes after starting WiFi monitoring. If the calculated beacon reception rate is lower than 60%, it is determined that the reception rate of the beacon frame is abnormal.
[0245] It should be noted that if an electronic device receives a small number of beacon frames, the WiFi chip will work for a long time, resulting in serious power consumption of the electronic device. For example, a user with a reception rate of less than 60% may be called a problem user. The power consumption of a problem user at 0-6 o'clock is about 7% to 8%. The embodiment of the present application can identify the problem user and, if certain conditions are met (such as Figure 4 Turning off WiFi when the data switch shown is turned on and / or there is no perceptible business, etc., can avoid the WiFi chip working for a long time and effectively reduce the power consumption of the electronic device.
[0246] S32: The electronic device sets the first flag to 0.
[0247] That is, the first flag obtained by the electronic device is 0. Wherein, 0 is used to indicate that the reception rate of the beacon frame is normal.
[0248] S33: The electronic device determines whether the number of abnormalities corresponding to the beacon frame reception rate (hereinafter referred to as the first abnormal number) is greater than N1 times. Further, when the electronic device determines that the first abnormal number is greater than N1 times, it executes step S35; when it determines that the beacon frame reception rate is normal, it executes step S34. Wherein, N1 is a positive integer.
[0249] In some embodiments, the electronic device can obtain the recorded first abnormal number from the storage, add 1 to the abnormal number to obtain an updated first abnormal number, and compare the updated first abnormal number with N1 to determine whether the abnormal number corresponding to the beacon frame reception rate is greater than N1.
[0250] S34: The electronic device adds 1 to the recorded first abnormal number.
[0251] S35: The electronic device sets the first flag to 1.
[0252] 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.
[0253] S4: The electronic device obtains a flag (referred to as the second flag) corresponding to the frequency of the TIM bit being erroneously set.
[0254] 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, and the flag bit is set to indicate that the routing device will send data to the electronic device within the next preset time. The second flag is used to indicate whether the frequency of the TIM bit being incorrectly set is abnormal. For example, the second flag can be 0, which is used to indicate that the frequency of the TIM bit being incorrectly set is normal, and the second flag can be 1, which is used to indicate that the frequency of the TIM bit being incorrectly set is abnormal.
[0255] If the TIM bit in the beacon frame of the electronic device is set, but no data is received from the routing device after waiting for a preset time (also referred to as a first time period), it is considered that the TIM bit is set incorrectly; the frequency of the TIM bit being set incorrectly refers to the number of times the TIM bit is set incorrectly within a preset time period. For example, the first time period may be 60ms.
[0256] 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 the data sent by the routing device within 60ms, the beacon is not misplaced, otherwise it is misplaced. If the electronic device receives 10 beacon frames in 1 second and 8 of the 10 beacon frames are wrong, the electronic device can determine that the frequency of the TIM bit being incorrectly set is 8 frames per second.
[0257] It should be noted that if the TIM bit in the beacon frame is set incorrectly or is always set (the TIM bit is set even if there is no data to be sent), the WiFi chip will not be powered off, which will cause serious power consumption problems. In the embodiment of the present application, the electronic device obtains the frequency of the TIM bit being set incorrectly, and turns off the WiFi function when the frequency is too high, that is, the WiFi chip is powered off, which can avoid serious power consumption and effectively reduce power consumption.
[0258] Exemplarily, 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.
[0259] S41: The electronic device determines whether the frequency of the TIM bit erroneous setting is abnormal. Further, the electronic device executes step S43 when determining that the frequency of the TIM bit erroneous setting is abnormal; and executes step S42 when determining that the frequency of the TIM bit erroneous setting is normal.
[0260] In some embodiments, the electronic device may calculate the frequency of TIM bit errors in beacon frames received within a preset time (also referred to as a second time period), and if the frequency is greater than the preset frequency, it is determined that the frequency of TIM bit error is abnormal, otherwise it is normal. If the electronic device does not receive data within a preset time after receiving a beacon frame, it is determined that the TIM bit in the beacon frame is wrong.
[0261] 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.
[0262] Exemplarily, if the second time period can be 1s and the first preset number of times is 8, if the electronic device can calculate the frequency of TIM bit error setting once per second, assuming that 10 beacon frames are received in 1s and 8 of the 10 beacon frames are wrong, the electronic device can determine that the frequency of TIM bit error setting is abnormal.
[0263] S42: The electronic device sets the second flag to 0.
[0264] That is, the second flag obtained by the electronic device is 0. Wherein, 0 is used to indicate that the frequency of the TIM bit erroneous setting is normal.
[0265] S43: The electronic device determines whether the number of abnormal times (hereinafter referred to as the second abnormal times) corresponding to the frequency of the TIM bit being incorrectly set is greater than N2 times. Further, when the electronic device determines that the second abnormal times is greater than N2 times, it executes step S45; when it determines that the frequency of the TIM bit being incorrectly set is normal, it executes step S44. Wherein, N2 is a positive integer.
[0266] In some embodiments, the electronic device can obtain the recorded second abnormal number from the storage, add 1 to the abnormal number to obtain an updated second abnormal number, and compare the updated second abnormal number with N2 to determine whether the abnormal number corresponding to the frequency of the TIM bit erroneous setting is greater than N2 times.
[0267] S44: The electronic device adds 1 to the recorded second abnormal number.
[0268] S45: The electronic device sets the second flag to 1.
[0269] 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.
[0270] S5: The electronic device obtains a flag (referred to as the third flag) corresponding to the sending frequency of the rekey packet.
[0271] 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 may refer to the sending frequency of the rekey package configured by the routing device (i.e., the frequency at which the routing device sends the rekey package), that is, the receiving frequency at which the electronic device receives the rekey package. 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 may determine the receiving frequency at which the electronic device receives the rekey package as the frequency for determining whether the rekey package is abnormal. Among them, the sending frequency of the rekey package may also be referred to as the sending frequency of the broadcast key update frame.
[0272] 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.
[0273] Exemplarily, the specific process of the electronic device obtaining the flag corresponding to the sending frequency of the rekey packet can refer to the following steps S51 to S55.
[0274] S51: The electronic device determines whether the sending frequency of the rekey packet is abnormal.
[0275] Furthermore, when the electronic device determines that the sending frequency of the rekey packet is abnormal, the electronic device executes step S53; when the electronic device determines that the sending frequency of the rekey packet is normal, the electronic device executes step S52.
[0276] In some embodiments, the electronic device may calculate the sending interval of the rekey package. If the sending interval of the rekey package is less than a preset time interval (such as 30s), it is determined that the sending frequency of the rekey package is abnormal, otherwise it is normal.
[0277] 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.
[0278] For example, N is 10, each of the N time periods is 1 minute, and the first preset number is 2. If the electronic device can calculate the number of rekey packages received per minute, if at least two rekey packages are received per minute for ten consecutive minutes, it is determined that the sending frequency of the rekey packages is abnormal, otherwise it is normal.
[0279] It should be noted that if the electronic device frequently receives rekey packets sent by the routing device, that is, the frequency of sending rekey packets is too high, the WiFi chip sleep interrupt will be awakened, 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 sending frequency of the rekey packet and turning off the WiFi function when the frequency is too high (i.e. abnormal), which can effectively reduce power consumption.
[0280] S52: The electronic device sets the third flag to 0.
[0281] That is, the third flag obtained by the electronic device is 0. Wherein, 0 is used to indicate that the sending frequency of the rekey packet is normal.
[0282] S53: The electronic device determines whether the number of abnormal times (referred to as the third abnormal number) corresponding to the frequency of sending the rekey packet is greater than N3 times. Further, when the electronic device determines that the third abnormal number is greater than N3 times, it executes step S55; when it determines that the frequency of sending the rekey packet is normal, it executes step S54. Wherein, N3 is a positive integer.
[0283] 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 times.
[0284] S54: The electronic device adds 1 to the recorded third abnormal number.
[0285] S55: The electronic device sets the third flag to 1.
[0286] 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.
[0287] S6: The electronic device obtains a flag (referred to as the fourth flag) corresponding to the sending frequency of the addba req frame.
[0288] The addba req frame is a management frame sent by the routing device to the electronic device; the sending frequency of the addba req frame may refer to the frequency at which the routing device sends the rekey packet, that is, the receiving frequency at which the electronic device receives the rekey packet. The sending frequency of the addba req frame may also be referred to as the sending frequency of the block request frame.
[0289] It should be noted that in some embodiments of the present application, due to actual conditions and other reasons, the frequency of the routing device sending the Addba Req frame is not equal to the receiving frequency of the electronic device receiving the Addba Req frame. In this case, the electronic device can determine the receiving frequency of the electronic device receiving the Addba Req frame as the frequency for determining whether the Rekey packet is abnormal.
[0290] 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.
[0291] Exemplarily, 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.
[0292] S61: The electronic device determines whether the sending frequency of the addba req frame is abnormal.
[0293] 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.
[0294] In some embodiments, the electronic device may calculate the sending interval of the addba req frame, and 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.
[0295] In other embodiments, when the number of 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, and M is a positive integer.
[0296] 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 frame is abnormal, otherwise it is normal.
[0297] It should be noted that if the electronic device frequently receives the AddBa Req frame sent by the routing device, that is, the sending frequency of the AddBa Req frame is too high, the WiFi chip will not sleep or the sleep time will be too short, resulting in serious power consumption of the electronic device. In the embodiment of the present application, the electronic device obtains the sending frequency of the AddBa Req frame and turns off the WiFi function when the frequency is too high (i.e. abnormal), which can avoid serious power consumption of the electronic device and effectively reduce power consumption.
[0298] S62: The electronic device sets the fourth flag to 0.
[0299] That is, the fourth flag acquired by the electronic device is 0. 0 is used to indicate that the sending frequency of the addba req frame is normal.
[0300] S63: The electronic device determines whether the number of abnormal times (hereinafter referred to as the fourth abnormal number) corresponding to the sending frequency of the addba req frame is greater than N4 times. Further, when the electronic device determines that the fourth abnormal number is greater than N4 times, it executes step S65; when it determines that the sending frequency of the addba req frame is normal, it executes step S64. Wherein, N4 is a positive integer.
[0301] 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 times.
[0302] S64: The electronic device adds 1 to the recorded fourth abnormal number.
[0303] S65: The electronic device sets the fourth flag to 1.
[0304] That is, the fourth flag acquired by the electronic device is 1. 1 is used to indicate that the sending frequency of the addba req frame is abnormal.
[0305] S7: The electronic device obtains a flag corresponding to the disconnection frequency (referred to as the fifth flag).
[0306] Among them, disconnection refers to the disconnection of communication between the electronic device and the routing device, and the disconnection frequency refers to the number of times the electronic device and the routing device disconnect communication within a preset time period. It should be noted that frequent disconnection can be caused by frequent kicking of electronic devices due to the settings of the routing device, or it can be other reasons.
[0307] The fifth flag is used to indicate whether the link breaking frequency is abnormal. For example, the fifth flag may be 0, which indicates that the link breaking frequency is normal; the fifth flag may be 1, which indicates that the link breaking frequency is abnormal.
[0308] Exemplarily, the specific process of the electronic device obtaining the flag of the disconnection frequency can refer to the following steps S71 to S75.
[0309] S71: The electronic device determines whether the link disconnection frequency is abnormal.
[0310] 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.
[0311] Exemplarily, 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.
[0312] It should be noted that if the routing device frequently kicks the electronic device, the electronic device will automatically reconnect to the routing device after being kicked, which will cause a serious power consumption problem. In the embodiment of the present application, the electronic device obtains the link disconnection frequency and turns off the WiFi function when the link disconnection frequency is too large (i.e. abnormal), which can avoid the situation where the electronic device frequently disconnects and then reconnects, resulting in serious power consumption, and can effectively reduce power consumption.
[0313] S72: The electronic device sets the fifth flag to 0.
[0314] That is, the fifth flag obtained by the electronic device is 0. 0 is used to indicate that the link disconnection frequency is normal.
[0315] S73: The electronic device determines whether the number of abnormal times corresponding to the link-breaking frequency (hereinafter referred to as the fifth abnormal number) is greater than N5 times. Further, when the electronic device determines that the fifth abnormal number is greater than N5 times, it executes step S75; when it determines that the link-breaking frequency is normal, it executes step S74. Wherein, N5 is a positive integer.
[0316] 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 times.
[0317] S74: The electronic device adds 1 to the fifth abnormal number recorded.
[0318] S75: The electronic device sets the fifth flag to 1.
[0319] That is, the fifth flag obtained by the electronic device is 1. 1 is used to indicate that the link disconnection frequency is abnormal.
[0320] S8: The electronic device obtains a flag corresponding to the sending frequency of the AMSDU multicast packet (referred to as the sixth flag).
[0321] The AMSDU multicast packet is a multicast packet sent by a routing device to an electronic device; the sending frequency of the AMSDU multicast packet may refer to the frequency at which the routing device sends the AMSDU multicast packet, that is, the receiving frequency at which the electronic device receives the AMSDU multicast packet. The AMSDU multicast packet may also be referred to as the sending frequency of the aggregated multicast packet.
[0322] 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 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 may determine the receiving frequency at which the electronic device receives the AMSDU multicast packets as the frequency for determining whether the AMSDU multicast packets are abnormal.
[0323] 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.
[0324] Exemplarily, the specific process of the electronic device obtaining the flag corresponding to the sending frequency of the AMSDU multicast packet can refer to the following steps S81 to S85.
[0325] S81: The electronic device determines whether the sending frequency of the AMSDU multicast packet is abnormal.
[0326] Furthermore, when the electronic device determines that the sending frequency of the AMSDU multicast packet is abnormal, the electronic device executes step S83; when the electronic device determines that the sending frequency of the AMSDU multicast packet is normal, the electronic device executes step S82.
[0327] In some embodiments, 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, and K is a positive integer.
[0328] 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.
[0329] It should be noted that if the electronic device frequently receives AMSDU multicast packets sent by the routing device, that is, the sending frequency of the AMSDU multicast packets is too high, the WiFi chip will not sleep or the sleep time will be too short, resulting in serious power consumption of the electronic device. In the embodiment of the present application, the electronic device obtains the sending frequency of the AMSDU multicast packets and turns off the WiFi function when the frequency is too high (i.e., abnormal), which can avoid serious power consumption of the electronic device and effectively reduce power consumption.
[0330] S82: The electronic device sets the sixth flag to 0.
[0331] 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.
[0332] S83: The electronic device determines whether the number of abnormal times (referred to as the sixth abnormal number) corresponding to the sending frequency of the AMSDU multicast packet is greater than N6 times. Further, when the electronic device determines that the sixth abnormal number is greater than N6 times, it executes step S85; when it determines that the sending frequency of the AMSDU multicast packet is normal, it executes step S84. Wherein, N6 is a positive integer.
[0333] 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.
[0334] S84: The electronic device adds 1 to the recorded sixth abnormal number.
[0335] S85: The electronic device sets the sixth flag to 1.
[0336] 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.
[0337] S9: The electronic device obtains a flag corresponding to the APF filtering message (referred to as the seventh flag).
[0338] 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.
[0339] For example, the seventh flag may be 0, which indicates that the APF filtering message is normal; the seventh flag may be 1, which indicates that the APF filtering message is abnormal. The APF filtering message may also be referred to as the message condition after filtering. If the APF filtering message is abnormal, the message condition after filtering is abnormal.
[0340] Exemplarily, the specific process of the electronic device obtaining the flag corresponding to the APF filtering message can refer to the following steps S91 to S95.
[0341] S91: The electronic device determines whether the APF filtering message is abnormal.
[0342] 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.
[0343] In some embodiments, 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.
[0344] 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.
[0345] It should be noted that if the APF filtering message is abnormal, the WiFi chip will be awakened, and the WiFi chip will be 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 serious power consumption of the electronic device by judging whether the APF filtering message is abnormal and turning off the WiFi function when the APF filtering message is abnormal, which can effectively reduce power consumption.
[0346] S92: The electronic device sets the seventh flag to 0.
[0347] That is, the seventh flag obtained by the electronic device is 0. 0 is used to indicate that the APF filtering message is normal.
[0348] S93: The electronic device determines whether the number of abnormalities corresponding to the APF filtering message (hereinafter referred to as the seventh abnormality number) is greater than N7 times. Further, when the electronic device determines that the seventh abnormality number is greater than N7 times, it executes step S95; when it determines that the APF filtering message is normal, it executes step S94. Wherein, N7 is a positive integer.
[0349] In some embodiments, the electronic device can obtain the recorded seventh abnormal number from the storage, add 1 to the abnormal number to obtain an updated seventh abnormal number, and compare the updated seventh abnormal number with N7 to determine whether the abnormal number corresponding to the APF filtering message is greater than N7 times.
[0350] S94: The electronic device adds 1 to the seventh abnormality count recorded.
[0351] S95: The electronic device sets the seventh flag to 1.
[0352] That is, the seventh flag obtained by the electronic device is 1. 1 is used to indicate that the APF filtering message is abnormal.
[0353] 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 be different.
[0354] S10: The electronic device determines whether any flag among the first to seventh flags is set to 1.
[0355] 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.
[0356] S11: The electronic device reports the abnormal chip status of the WiFi chip to the power saving wizard.
[0357] 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.
[0358] In one implementation, when the WiFi driver determines that the chip state of the WiFi chip is abnormal, the WiFi driver may send a notification indicating that the chip state of the WiFi chip is abnormal to the WiFi FWK; further, when the WiFi FWK receives the notification indicating that the chip state of the WiFi chip is abnormal sent by the WiFi driver, the WiFi FWK may send a notification message to the power saving wizard, and the notification message may include indication information indicating that the chip state is abnormal, such as the indication information is 1, which means that the chip state is abnormal.
[0359] S12: The electronic device ends executing the method.
[0360] S13: The electronic device determines whether there is a perceptible service currently.
[0361] In some embodiments, when receiving a notification of abnormal chip status of a WiFi chip, the abnormality identification module in the power saving wizard of the electronic device can determine whether there is a perceptible service (also referred to as a first service) at present. Then, if there is a perceptible service, step S12 is executed; if there is no perceptible service, step S14 is executed.
[0362] S14: The electronic device turns off WiFi.
[0363] In some embodiments, the electronic device can call the relevant interface through the above-mentioned WiFi FWK to turn off the WiFi function.
[0364] The method for reducing power consumption provided in the embodiment of the present application can be embodied as a "power saving" function on an electronic device.
[0365] 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 by a switch corresponding to the "power saving" function provided on the electronic device, that is, the user can decide whether to turn on the "power saving" function, that is, whether to execute the above-mentioned method of reducing power consumption.
[0366] 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.
[0367] The following is an exemplary introduction to a user interface (UI) when an electronic device provides the “power saving” function.
[0368] It should be noted that in the embodiments of the present application, the user operation can be a touch operation (such as a click operation, a long press operation, an up slide operation, a down slide operation or a side slide operation) or a contactless operation (such as an air gesture) or a voice command. The embodiments of the present application do not impose any specific restrictions on this.
[0369] FIG. 6A to FIG. 6C The following is an example of a UI related to turning on the "power saving" function of an electronic device.
[0370] Fig. 6A An exemplary user interface 61 for displaying installed applications on an electronic device is shown.
[0371] The user interface 61 displays: a status bar, an icon 610 of a power saving wizard application, an icon of a clock application, and icons of other applications, etc. The status bar may include: one or more signal strength indicators of a mobile communication signal (also referred to as a cellular signal), one or more signal strength indicators of a Wi-Fi signal, a battery status indicator, a time indicator, etc.
[0372] like Fig. 6A As shown, the electronic device can detect a user operation acting on icon 610, and in response to the operation, the electronic device can display Figure 6BThe user interface 62 shown. It should be understood that the user interface 62 is an application interface of the power saving wizard application shown as an example, and should not cause any limitation to the embodiments of the present application.
[0373] like Figure 6B As shown, the user interface 62 may include a WiFi power saving switch 620. The WiFi power saving switch 620 is used to turn on or off the above-mentioned "power saving" function. It should be noted that the user interface 62 may also include other power saving functions, which are not limited in the embodiments of the present application. The user interface 62 exemplarily shows that the WiFi power saving switch 620 is in the off state. In other embodiments of the present application, when the user turns on the power saving wizard, the WiFi power saving switch may also be in the on state, that is, the WiFi power saving switch is in the on state.
[0374] like Figure 6B As shown, the electronic device can detect the user operation acting on the WiFi power saving switch 620. In response to the operation, the electronic device can start the above-mentioned "power saving" function (that is, execute the above-mentioned method for reducing power consumption), and display as shown in FIG. Figure 6C The user interface 63 shown. The user interface 63 may include a WiFi power saving switch 630, wherein the WiFi power saving switch 630 is in an on state, for indicating that the WiFi power saving switch is in an on state.
[0375] FIG. 7A to FIG. 7C Another example of a UI related to turning on the "power saving" function of another electronic device is shown.
[0376] Fig. 7A An exemplary user interface 71 for displaying installed applications on an electronic device is shown.
[0377] The user interface 71 displays: a status bar, an icon 710 of a setting application, an icon of a clock application, and icons of other applications, etc. The status bar may include: one or more signal strength indicators of a mobile communication signal (also referred to as a cellular signal), one or more signal strength indicators of a Wi-Fi signal, a battery status indicator, a time indicator, etc.
[0378] like Fig. 7A As shown, the electronic device can detect a user operation on icon 710, and in response to the operation, the electronic device can display a Figure 7B The user interface 72 shown. It should be understood that the user interface 72 is an exemplary application interface for setting an application and should not limit the embodiments of the present application.
[0379] like Figure 7BAs shown, the user interface 72 may include a WiFi power saving switch 720, a mobile network switch 721, and a search bar 722. The WiFi power saving switch 720 is used to turn on or off the above-mentioned "power saving" function; the mobile network switch 721 is used to turn on cellular data, and the mobile network switch 721 may be the above-mentioned data service switch; the search bar 722 is used to search for setting items in the setting application.
[0380] 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 the embodiments of the present application; the user interface 72 may also include other setting functions, such as a WiFi function switch, which is used to turn on the WiFi function to access the WiFi network, which is not limited in the embodiments of the present application.
[0381] 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.
[0382] like Figure 7B As shown, the electronic device can detect the user operation acting on the WiFi power saving switch 720. In response to the operation, the electronic device can start the above-mentioned "power saving" function (that is, execute the above-mentioned method for reducing power consumption), and display as shown in FIG. Figure 7C The user interface 73 shown. The user interface 73 may include a WiFi power saving switch 730, wherein the WiFi power saving switch 730 is in an on state, for indicating that the WiFi power saving switch is in an on state.
[0383] The term "user interface (UI)" in the specification, claims and drawings of this application refers to the medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is 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 . A node corresponds to a control or attribute in the interface. After parsing and rendering, the node is presented as user-visible content. 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 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. For example, HTML is defined by 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.
[0384] The most common form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operation that is displayed in a graphical manner. It can be an icon, window, control or other interface element displayed on the display screen of an electronic device, where a control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.
[0385] It should be understood that each step in the above method embodiment provided by the present application can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0386] 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.
[0387] The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method performed by the electronic device in any of the above embodiments. In one possible design, the chip system also includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor. The chip system can be composed of chips, or it can include chips and other discrete devices.
[0388] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0389] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.
[0390] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0391] 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.
[0392] The present application also provides a computer-readable storage medium, which stores 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.
[0393] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0394] 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 the 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 devices. 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 a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. 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 a data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.
[0395] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0396] In short, the above are only embodiments of the technical solution of this application, and are not intended to limit the protection scope of this application. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of this application should be included in the protection scope 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, by the electronic device, a status of enabling a 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 is in an abnormal state, the electronic device turns off a 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.
