Method and electronic device for calculating Wi-Fi power consumption
By obtaining the working time and power consumption information of the Wi-Fi chip in various states, the Wi-Fi power consumption is calculated, which solves the problem of inaccurate calculation in the existing technology and improves the battery life and user experience of electronic devices.
Patent Information
- Application Number
- CN202011197195.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-10-30
AI Technical Summary
It is difficult to accurately calculate Wi-Fi power consumption with existing technology, which affects the battery life and user experience of electronic devices.
By obtaining the working time and power consumption information of various Wi-Fi digital circuit states and analog circuit states from the Wi-Fi chip, the Wi-Fi power consumption is calculated, and the power consumption difference between the power amplifier and sleep state is taken into account. Improve calculation accuracy.
It improves the calculation accuracy of Wi-Fi power consumption and can perform exception handling when abnormal power consumption is identified, extending the battery life of electronic devices and improving user experience.
Smart Images

Figure CN114449622B
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a method for calculating Wi-Fi power consumption and an electronic device. Background Art
[0002] With the rapid development of smart technology, electronic devices (such as mobile phones, computers, headphones, etc.) have become indispensable tools in people's daily lives. In addition, with the continuous development of electronic device manufacturing technology, electronic devices have more and more functions, such as various instant messaging applications, game software, etc. During user use, the battery life of electronic devices is a key factor affecting user experience.
[0003] In order to improve the battery life of electronic devices and ensure the battery life experience of users, electronic devices can calculate power consumption and output prompt information or perform power consumption control based on the power consumption. Wireless Fidelity (Wi-Fi) is an important power consumption part of electronic devices. Electronic devices can calculate Wi-Fi power consumption, output prompt information about Wi-Fi power consumption, and perform power consumption control based on Wi-Fi power consumption.
[0004] Therefore, how to accurately calculate Wi-Fi power consumption is an urgent problem that needs to be solved. Summary of the invention
[0005] The embodiments of the present application provide a method for calculating Wi-Fi power consumption and an electronic device, by which the accuracy of calculating Wi-Fi power consumption by the electronic device can be improved.
[0006] In a first aspect, a method for calculating Wi-Fi power consumption is provided, which is applied to an electronic device, where the electronic device includes a Wi-Fi chip. The method includes: the electronic device obtains first reference information from the Wi-Fi chip, where the first reference information includes working time of the electronic device working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states within a calculation cycle; the electronic device calculates first Wi-Fi power consumption according to the first reference information and first power consumption information, where the first power consumption information is used to indicate the power consumption of the electronic device when working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states.
[0007] In this way, when calculating Wi-Fi power consumption, the electronic device obtains first reference information including the working time of the electronic device in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states during the calculation cycle, and calculates the first Wi-Fi power consumption according to the first reference information and the first power consumption information. In this way, the calculated Wi-Fi power consumption distinguishes the difference in Wi-Fi power consumption in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states, which can improve the accuracy of calculating Wi-Fi power consumption.
[0008] In combination with the first aspect, in a possible implementation manner, the multiple Wi-Fi digital circuit states include the Wi-Fi digital circuit operating at multiple frequencies; the multiple Wi-Fi analog circuit states include: the Wi-Fi analog circuit operating at multiple bandwidths, and the Wi-Fi analog circuit operating in one or more of multiple radio frequency states.
[0009] In combination with the first aspect, in a possible implementation manner, the electronic device further includes a power amplifier, and the method further includes:
[0010] The electronic device obtains second reference information from the Wi-Fi chip, the second reference information includes the working time of the power amplifier working in multiple states or the number of frames of data frames sent in the calculation cycle, and the number of data packets received by the electronic device; the electronic device calculates the second Wi-Fi power consumption according to the second reference information and the second power consumption information, the second power consumption information is used to indicate the power consumption of the power amplifier working in multiple states, and the power consumption of the electronic device receiving a single data packet. When calculating the Wi-Fi power consumption, the electronic device takes into account the power consumption differences in multiple states of sending and receiving data packets, which can improve the accuracy of calculating the Wi-Fi power consumption.
[0011] In combination with the first aspect, in a possible implementation manner, the multiple states include the power amplifier operating at multiple transmission powers or the power amplifier operating at multiple transmission rates.
[0012] In combination with the first aspect, in a possible implementation, the method further includes: the electronic device obtains third reference information from the Wi-Fi chip, the third reference information includes the working time of the electronic device in the Wi-Fi light sleep state and the Wi-Fi deep sleep state within the calculation cycle; the electronic device calculates the third Wi-Fi power consumption according to the third reference information and the third power consumption information, and the third power consumption information is used to indicate the power consumption of the electronic device when working in the Wi-Fi light sleep state and the Wi-Fi deep sleep state. When calculating the Wi-Fi power consumption, the electronic device takes into account the power consumption difference in the sleep state, which can improve the accuracy of calculating the Wi-Fi power consumption.
[0013] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0014] The electronic device determines the total power consumption of Wi-Fi in the calculation period according to the first Wi-Fi power consumption, the second Wi-Fi power consumption and the third Wi-Fi power consumption.
[0015] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0016] If the ratio of the second power consumption to the total power consumption of Wi-Fi is less than a preset value, the electronic device outputs a prompt message, the prompt message is used to prompt the user that the power consumption of Wi-Fi is abnormal; and / or the electronic device performs an operation of clearing processes or applications that abnormally access the Wi-Fi chip; and / or the electronic device reports the abnormal power consumption event of Wi-Fi to the server. Exception handling can be performed when abnormal Wi-Fi power consumption is identified.
[0017] In combination with the first aspect, in a possible implementation manner, the method further includes:
[0018] The electronic device obtains a first data volume of a data packet sent and / or received by an application through Wi-Fi within a calculation cycle; the electronic device calculates a ratio of the first data volume to a total data volume, where the total data volume is a data volume of a data packet sent and / or received by the electronic device through Wi-Fi within the calculation cycle; the electronic device determines a Wi-Fi power consumption of an application within the calculation cycle based on the ratio of the first data volume to the total data volume and the total power consumption of Wi-Fi.
[0019] In a second aspect, an embodiment of the present application provides an electronic device, including one or more memories and one or more processors, 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. When the one or more processors execute the computer instructions, the electronic device performs the following operations:
[0020] First reference information is obtained from the Wi-Fi chip, where the first reference information includes working time of the electronic device working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states within a calculation cycle; first Wi-Fi power consumption is calculated according to the first reference information and the first power consumption information, where the first power consumption information is used to indicate the power consumption of the electronic device when working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states.
[0021] In conjunction with the second aspect, in a possible implementation manner, the multiple Wi-Fi digital circuit states include the Wi-Fi digital circuit operating at multiple frequencies; the multiple Wi-Fi analog circuit states include: the Wi-Fi analog circuit operating at multiple bandwidths, and the Wi-Fi analog circuit operating in one or more of multiple radio frequency states.
[0022] In conjunction with the second aspect, in a possible implementation manner, the electronic device further includes a power amplifier, and when the one or more processors execute the computer instructions, the electronic device further performs the following operations:
[0023] Acquire second reference information from the Wi-Fi chip, where the second reference information includes a working time of the power amplifier working in multiple states or a number of frames of sent data frames within a calculation period, and a number of data packets received by the electronic device;
[0024] The second Wi-Fi power consumption is calculated according to the second reference information and the second power consumption information, where the second power consumption information is used to indicate the power consumption of the power amplifier when operating in multiple states and the power consumption of the electronic device when receiving a single data packet. When calculating the Wi-Fi power consumption, the electronic device takes into account the power consumption differences in multiple states of sending and receiving data packets, which can improve the accuracy of calculating the Wi-Fi power consumption.
[0025] In conjunction with the second aspect, in a possible implementation manner, the multiple states include the power amplifier operating at multiple transmission powers or the power amplifier operating at multiple transmission rates.
[0026] In combination with the second aspect, in a possible implementation, when the one or more processors execute the computer instructions, the electronic device further performs the following operations: obtaining third reference information from the Wi-Fi chip, the third reference information including the working time of the electronic device in the Wi-Fi light sleep state and the Wi-Fi deep sleep state within the calculation cycle; calculating the third Wi-Fi power consumption according to the third reference information and the third power consumption information, the third power consumption information is used to indicate the power consumption of the electronic device when working in the Wi-Fi light sleep state and the Wi-Fi deep sleep state. When calculating the Wi-Fi power consumption, the electronic device takes into account the power consumption difference in the sleep state, which can improve the accuracy of calculating the Wi-Fi power consumption.
[0027] In conjunction with the second aspect, in a possible implementation manner, when the one or more processors execute the computer instructions, the electronic device further performs the following operations:
[0028] The total power consumption of Wi-Fi in the calculation period is determined according to the first Wi-Fi power consumption, the second Wi-Fi power consumption, and the third Wi-Fi power consumption.
[0029] In conjunction with the second aspect, in a possible implementation manner, when the one or more processors execute the computer instructions, the electronic device further performs the following operations:
[0030] If the ratio of the second power consumption to the total power consumption of Wi-Fi is less than a preset value, a prompt message is output, and the prompt message is used to prompt the user that the power consumption of the Wi-Fi is abnormal; and / or, an operation of clearing the process or application that abnormally accesses the Wi-Fi chip is performed; and / or, the abnormal power consumption event of Wi-Fi is reported to the server. Exception handling can be performed when abnormal Wi-Fi power consumption is identified.
[0031] In conjunction with the second aspect, in a possible implementation manner, when the one or more processors execute the computer instructions, the electronic device further performs the following operations:
[0032] Obtain a first data volume of data packets sent and / or received by an application through Wi-Fi during a calculation period; calculate a ratio of the first data volume to a total data volume, where the total data volume is a data volume of data packets sent and / or received by the electronic device through Wi-Fi during the calculation period; and determine Wi-Fi power consumption of an application during the calculation period according to the ratio of the first data volume to the total data volume and the total power consumption of Wi-Fi.
[0033] According to a third aspect, a computer storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect or any possible implementation of the first aspect.
[0034] According to a fourth aspect, a computer program product is provided. When the computer program product runs on a computer, the computer is enabled to execute the method described in the first aspect or any possible implementation of the first aspect.
[0035] In an embodiment of the present application, the electronic device obtains first reference information including the working time of the electronic device in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states within a calculation cycle from the Wi-Fi chip, and calculates the first Wi-Fi power consumption according to the first reference information and the first power consumption information. In this way, the electronic device takes into account the power consumption differences of multiple Wi-Fi digital circuit states and / or multiple Wi-Fi analog circuit states when calculating the Wi-Fi power consumption, thereby effectively improving the accuracy of calculating the Wi-Fi power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments of the present application will be described below.
[0037] Figure 1A is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0038] Figure 1B It is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0039] Figure 2 is a flow chart of a method for calculating Wi-Fi power consumption provided by an embodiment of the present application;
[0040] Figure 3A-3C is a schematic diagram of a user interface for obtaining permission to access a Wi-Fi chip provided in an embodiment of the present application;
[0041] Figure 4 is a flowchart of another method for calculating Wi-Fi power consumption provided by an embodiment of the present application;
[0042] Figure 5A-Figure 5B This is a user interface diagram of a visual prompt information provided by an embodiment of the present application;
[0043] Figure 6 is a flowchart of another method for calculating Wi-Fi power consumption provided by an embodiment of the present application;
[0044] Figure 7A-7EIt is a schematic diagram of a user interface for displaying power consumption rankings provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0046] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0047] In an embodiment of the present application, the electronic device includes a wireless fidelity (Wi-Fi) module, which can provide a solution for wireless communications including Wi-Fi networks applied to electronic devices. The Wi-Fi module includes a Wi-Fi digital circuit and a Wi-Fi analog circuit. Among them, the digital circuit of Wi-Fi can refer to a microprocessor that runs Wi-Fi related tasks in an electronic device, and the digital circuit of Wi-Fi can also be called a Wi-Fi chip. The analog circuit of Wi-Fi refers to a hardware circuit that implements Wi-Fi related tasks. For example, the physical layer (Physical layer, PHY), the data link layer, the radio frequency circuit, the power amplifier (Power Amplifier, PA), etc.
[0048] In order to calculate the Wi-Fi power consumption in an electronic device, an embodiment of the present application proposes a method for calculating the Wi-Fi power consumption, where the Wi-Fi power consumption refers to the power consumed by the electronic device when running Wi-Fi related tasks. In this method, the electronic device obtains first reference information including the working time of the electronic device in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states during the calculation cycle from the Wi-Fi chip, and calculates the first Wi-Fi power consumption based on the first reference information and the first power consumption information. Among them, the first power consumption information is used to indicate the power consumption of the electronic device when it works in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states. In this method, the electronic device distinguishes the power consumption differences caused by multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states, which can improve the accuracy of calculating the Wi-Fi power consumption.
[0049] Wi-Fi in an electronic device can be in a variety of overall states. Among them, the overall state of Wi-Fi is related to the on or off state of the digital circuit of Wi-Fi and the analog circuit of Wi-Fi. In a feasible implementation, when the digital circuit of Wi-Fi and the analog circuit of Wi-Fi are turned on, Wi-Fi is in a working state. When the digital circuit of Wi-Fi is turned on and the analog circuit of Wi-Fi is turned off, Wi-Fi is in a light sleep state. When the digital circuit of Wi-Fi is turned off and the analog circuit of Wi-Fi is turned off, Wi-Fi is in a deep sleep state.
[0050] The concepts involved in the embodiments of the present application (such as the Wi-Fi digital circuit state, the Wi-Fi analog circuit state, and multiple states of the power amplifier) are explained below.
[0051] (1) Wi-Fi digital circuit status
[0052] The Wi-Fi digital circuit state includes the frequency at which the Wi-Fi digital circuit operates. Accordingly, the multiple Wi-Fi digital circuit states include the Wi-Fi digital circuit operating at multiple frequencies.
[0053] The frequency points of the Wi-Fi digital circuit in the electronic device are related to the configuration of the software and hardware. The frequency points of the Wi-Fi digital circuit in the electronic device with different software and hardware configurations are different. For example, the frequency points of the Wi-Fi digital circuit in the electronic devices of different manufacturers are different. Generally, the frequency points of the Wi-Fi digital circuit supported by the electronic device can be 1, 2, 3, 4, 5, 6 or other positive integers, which are not limited here.
[0054] Among them, one frequency point corresponds to the frequency of a frequency band. For example, in the GSM network, the frequency interval is 200KHz. In this way, 890MHz, 890.2MHz, 890.4MHz, 890.6MHz, 890.8MHz, 891MHz...915MHz are divided into 125 frequency bands according to the frequency interval of 200KHz. The frequency point of an electronic device in the GSM network is 3, which means that the carrier of the electronic device will receive signals at a frequency of 890.4MHz and transmit signals at a frequency of 935.4MHz.
[0055] For an electronic device with a frequency number greater than 1, the Wi-Fi digital circuit can operate at different frequencies and the power consumption of the Wi-Fi digital circuit at different frequencies is different. In the same time, the higher the frequency corresponding to the operating frequency of the Wi-Fi digital circuit, the more power the Wi-Fi consumes.
[0056] (2) Wi-Fi simulation circuit status
[0057] The Wi-Fi simulation circuit state includes the bandwidth and / or radio frequency state of the Wi-Fi simulation circuit. Accordingly, the multiple Wi-Fi simulation circuit states include the Wi-Fi simulation circuit operating in multiple bandwidths and the Wi-Fi simulation circuit operating in one or more of multiple radio frequency states.
[0058] The bandwidth of the Wi-Fi analog circuit in an electronic device is related to the configuration of the software and hardware. The bandwidth of the Wi-Fi analog circuit of electronic devices with different software and hardware configurations is different. Normally, the bandwidth of the Wi-Fi analog circuit supported by the electronic device can be one or more of 20M, 40M, 80M, and 160M. It can also be other bandwidths, which are not limited here. For an electronic device that supports multiple Wi-Fi analog circuit bandwidths, the Wi-Fi analog circuit can operate at different bandwidths and the power consumption of the Wi-Fi analog circuit when operating at different bandwidths is different. The larger the bandwidth of the Wi-Fi analog circuit in the same time, the faster the data transmission rate of the physical layer and / or data link layer of the Wi-Fi analog circuit, and the more power Wi-Fi consumes.
[0059] The radio frequency state of the Wi-Fi analog circuit in an electronic device is related to the configuration of software and hardware, and electronic devices with different software and hardware configurations support different radio frequency states of the Wi-Fi digital circuit. Normally, the radio frequency state of the Wi-Fi analog circuit supported by the electronic device may be one or more of a single radio frequency state and a dual radio frequency state. For an electronic device that supports multiple radio frequency states of Wi-Fi analog circuits, the Wi-Fi analog circuit can operate in different radio frequency states and the power consumption of the Wi-Fi analog circuit when operating in different radio frequency states is different. In the same period of time, the greater the number of radio frequency paths in the radio frequency state of the Wi-Fi analog circuit, the greater the power consumption of Wi-Fi. For example, in the same period of time, the power consumption of Wi-Fi when the Wi-Fi analog circuit operates in a dual radio frequency state is greater than the power consumption of Wi-Fi when the Wi-Fi analog circuit operates in a single radio frequency state.
[0060] (3) Various states of the power amplifier
[0061] The Wi-Fi analog circuit in the electronic device includes a power amplifier, which is used to amplify the transmission signal containing the data packet sent by the electronic device through Wi-Fi. The state of the power amplifier of the Wi-Fi analog circuit in the electronic device is related to the transmission power of the power amplifier or the transmission rate of the power amplifier. The multiple states of the power amplifier include the power amplifier working at multiple transmission powers or the power amplifier working at multiple transmission rates. The power amplifier of the Wi-Fi analog circuit can work in different states, and the power consumption when working in different states is different. When sending a data packet through Wi-Fi, the higher the transmission power of the power amplifier in the same time, the more power consumption of Wi-Fi. Or, in the same time, the faster the transmission rate of the power amplifier, the more power consumption of Wi-Fi. Or, in the process of sending the same data frame, the higher the transmission power of the power amplifier, the more power consumption of Wi-Fi. Or, in the process of sending the same data frame, the faster the transmission rate of the power amplifier, the more power consumption of Wi-Fi.
[0062] An exemplary electronic device 100 provided in an embodiment of the present application is introduced below, and the electronic device 100 includes a Wi-Fi chip.
[0063] Figure 1A A schematic structural diagram of an electronic device 100 is shown.
[0064] The embodiment is described in detail below by taking the electronic device 100 as an example. It should be understood that the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0065] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, 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 speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0066] 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.
[0067] 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 processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0068] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0069] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0070] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0071] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0072] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0073] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0074] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0075] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0076] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0077] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0078] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0079] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0080] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0081] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0082] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0083] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0084] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0085] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. Among them, the wireless communication module 160 includes a Wi-Fi module.
[0086] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0087] 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.
[0088] 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 visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin 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.
[0089] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0090] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0091] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0092] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0093] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0094] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, applications required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0095] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0096] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0097] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0098] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0099] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0100] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0101] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0102] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0103] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0104] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0105] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0106] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0107] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0108] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0109] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0110] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0111] 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.
[0112] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0113] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0114] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0115] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0116] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0117] The software system 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.
[0118] Figure 1B It is a software structure block diagram of an electronic device 100 provided in an embodiment of the present application.
[0119] The layered architecture divides the software 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: application layer, application framework layer, Android runtime and system library, and kernel layer.
[0120] The application layer may include a series of application packages.
[0121] like Figure 1B As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, setting, etc.
[0122] Settings is an application of the electronic device 100. The user can customize the various functional options of the electronic device 100 through settings, such as Bluetooth, GPS (Global Positioning System), Wi-Fi, etc. The user can also customize the various setting options of the electronic device through settings, such as display brightness, volume, display font size, etc. Optionally, in some embodiments of the present application, the electronic device can display the battery power through settings. Optionally, in some embodiments of the present application, the user can customize the battery through settings, for example, you can choose whether to turn on the power saving mode, etc. Optionally, in some embodiments of the present application, the user can display the power consumption ranking of each hardware and the power consumption ranking of each software through settings. Optionally, in some embodiments of the present application, the user can customize the hardware and software through settings, for example, you can choose whether to turn on Wi-Fi, you can choose the running permissions of the software application, etc.
[0123] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0124] like Figure 1B As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0125] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0126] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0127] 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 can include a view for displaying text and a view for displaying pictures. In an embodiment of the present application, a view of the total Wi-Fi power consumption during a calculation cycle can be displayed, a view of the Wi-Fi power consumption of each application during a calculation cycle can be displayed, and a view of prompt information including text or pictures can also be displayed.
[0128] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0129] The resource manager provides various resources for the application, such as localized strings, icons, images, layout files, video files, and so on.
[0130] The notification manager enables applications to display notification information in the status bar. It 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 download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the smart terminal vibrates, and the indicator light flashes.
[0131] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0132] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0133] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0134] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), daemon, etc.
[0135] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0136] 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, G.264, MP3, AAC, AMR, JPG, PNG, etc.
[0137] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0138] A 2D graphics engine is a drawing engine for 2D drawings.
[0139] The daemon process includes processes such as polling reading, energy calculation, and power consumption anomaly. In some embodiments of the present application, the electronic device can obtain reference information from the Wi-Fi chip through polling reading. Optionally, after obtaining the reference information, the electronic device can obtain the Wi-Fi power consumption corresponding to the reference information through energy calculation. Optionally, the electronic device can use power consumption anomaly to perform abnormal detection on Wi-Fi power consumption, etc.
[0140] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, and computing driver.
[0141] Figure 1B The software system shown involves application presentation using sharing capabilities (such as gallery, file manager), an instant sharing module that provides sharing capabilities, a print service (print service) and a print spooler that provide printing capabilities, and an application framework layer that provides a printing framework, WLAN services, and Bluetooth services, as well as the kernel and bottom layers that provide WLAN Bluetooth capabilities and basic communication protocols.
[0142] The computing driver is connected to the wireless communication module 160. When the electronic device is allowed to access the Wi-Fi chip, the computing driver can detect the control instructions issued by the polling in the daemon process, and obtain reference information including the Wi-Fi digital circuit state and the Wi-Fi analog circuit state from the Wi-Fi chip of the Wi-Fi module in the wireless communication module 160.
[0143] The following is an example of the workflow of the software and hardware of the electronic device 100 in conjunction with the scenario of calculating Wi-Fi power consumption.
[0144] When the touch sensor 180A receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation, and other information). The original input event is stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch operation and the control corresponding to the touch operation as a power consumption ranking control as an example, the kernel layer is called to start the calculation driver of the Wi-Fi chip, obtain the reference information in the Wi-Fi chip, calculate the Wi-Fi power consumption, and display the view including the Wi-Fi power consumption through the display interface.
[0145] A method for calculating Wi-Fi power consumption provided in an embodiment of the present application is introduced below in conjunction with the accompanying drawings. Figure 2 A flowchart of a method for calculating Wi-Fi power consumption provided in an embodiment of the present application. Figure 2 , a method for calculating Wi-Fi power consumption proposed in an embodiment of the present application includes steps S201-S202:
[0146] S201: The electronic device obtains first reference information from a Wi-Fi chip.
[0147] In a feasible implementation, after the electronic device obtains permission to access the Wi-Fi chip, the electronic device can obtain first reference information from the Wi-Fi chip. The first reference information includes the working time of the electronic device in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states during the calculation cycle. For example, the first reference information includes one or more of the working time of the Wi-Fi digital circuit working at the first frequency point, the working time of the Wi-Fi digital circuit working at the second frequency point, the working time of the Wi-Fi digital circuit working at the third frequency point, the working time of the Wi-Fi analog circuit working at the first bandwidth, the working time of the Wi-Fi analog circuit working at the second bandwidth, the working time of the Wi-Fi analog circuit working at the third bandwidth, the working time of the Wi-Fi analog circuit working at the fourth bandwidth, the working time of the Wi-Fi analog circuit working in a single radio frequency state, and the working time of the Wi-Fi analog circuit working in a dual radio frequency state.
[0148] In another feasible implementation, after the electronic device obtains permission to access the Wi-Fi chip in response to a user operation, the electronic device may obtain the first reference information from the Wi-Fi chip. Figure 3A-3B As shown by way of example, it is a schematic diagram of a user interface for some electronic devices provided in an embodiment of the present application to obtain permission to access a Wi-Fi chip.
[0149] like Figure 3AAs shown in FIG. 1 , it is a schematic diagram of a user interface (ie, user interface 31) for obtaining permission to access a Wi-Fi chip provided in an embodiment of the present application. Figure 3A In the user interface 31 shown, the user interface 31 may include: one or more signal strength indicators 301 of mobile communication signals (also referred to as cellular signals), a signal strength indicator 302 of wireless network communication signals, a battery status indicator 303, time indicators 304 and 305, a touch control 306 for powering on, a pop-up window 307 for outputting permission request information, and controls 308 and 309.
[0150] Specifically, in response to the user's operation on the touch control 306, the electronic device becomes powered on and displays the user interface 31. In the user interface 31, the electronic device outputs the request information including the permission to access the Wi-Fi chip through the pop-up window 307, and in response to the user's click operation on the control 309, the electronic device obtains the permission to access the Wi-Fi chip. The electronic device can obtain the first reference information from the Wi-Fi chip.
[0151] like Figure 3B FIG. 1 is a schematic diagram of another user interface (ie, user interface 32) for obtaining permission to access a Wi-Fi chip provided by an embodiment of the present application. Figure 3B In the user interface 32 shown, the user interface 32 may include: icons of multiple applications, such as an icon 311 of the instant messaging application "WeChat", a pop-up window 312 for outputting permission request information, a control 313, and a control 314. When the electronic device displays the user interface 32 for the first time, the electronic device may output request information including permission to access the Wi-Fi chip through the pop-up window 312, and in response to a user clicking operation on the control 313, the electronic device obtains permission to access the Wi-Fi chip. The electronic device may obtain the first reference information from the Wi-Fi chip.
[0152] like Figure 3C As shown, it is a schematic diagram of another user interface (i.e., user interface 33) for obtaining permission to access a Wi-Fi chip provided in an embodiment of the present application. The user interface 33 includes a control 321, a pop-up window 322 for outputting permission request information, a control 323, and a control 324. When the electronic device receives a user operation on the control 321, the electronic device can output a pop-up window 322 containing permission request information in response to the user operation, and in response to the user's click operation on the control 313, the electronic device obtains permission to access the Wi-Fi chip. The electronic device can obtain the first reference information from the Wi-Fi chip.
[0153] Optionally, the electronic device may obtain the first reference information from the Wi-Fi chip in each calculation cycle. The calculation cycle may be a pre-stored cycle. The cycle may be 1 hour, 90 minutes, 12 hours, etc. The calculation cycle may be a pre-stored time period, such as 12:00-24:00 every day, 9:00-24:00 every day, etc. The calculation cycle may also be a cycle or time period set according to user habits.
[0154] S202: The electronic device calculates the first Wi-Fi power consumption according to the first reference information and the first power consumption information.
[0155] Among them, the first power consumption information is used to indicate the power consumption of the electronic device when it works in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states. The first power consumption information corresponds to the first reference information. If the first reference information includes the working time of the electronic device working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states within the calculation cycle, then correspondingly, the first power consumption information includes the power consumption of the electronic device working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states per unit time. Optionally, the first power consumption information is pre-stored in the electronic device. The pre-stored first power consumption information can be set based on experience, or it can be measured by technical means.
[0156] In a feasible implementation, the first Wi-Fi power consumption includes the product of the working time in multiple Wi-Fi digital circuit states and the power consumption in multiple Wi-Fi digital circuit states, and the sum of the working time in multiple Wi-Fi analog circuit states and the power consumption in multiple Wi-Fi analog circuit states. For ease of description, illustratively, the working time in multiple Wi-Fi digital circuit states in the present application embodiment includes the working time of the Wi-Fi digital circuit working at multiple frequency points (expressed as T cpu The power consumption of various Wi-Fi digital circuit states includes the power consumption of Wi-Fi digital circuits working at multiple frequencies per unit time (denoted by P cpu The working time of various Wi-Fi simulation circuit states includes the working time of the Wi-Fi simulation circuit working in multiple bandwidths (expressed by T band The working time of the Wi-Fi simulation circuit in each RF state (expressed by T RF The power consumption under various Wi-Fi simulation circuit states includes the power consumption of the Wi-Fi simulation circuit working in multiple bandwidths per unit time (denoted by P band The power consumption of the Wi-Fi simulation circuit in each radio frequency state per unit time (expressed by P RFBased on this, the first Wi-Fi power consumption E can be calculated by the following formula 1-1: 1 :
[0157]
[0158] In an embodiment of the present application, the electronic device obtains first reference information from the Wi-Fi chip, including the working time of the electronic device in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states within a calculation cycle. Then, the first Wi-Fi power consumption is calculated based on the first reference information and the first power consumption information, and the first power consumption information is used to indicate the power consumption of the electronic device when it works in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states. Since the power consumption differences of multiple Wi-Fi digital circuit states and / or multiple Wi-Fi analog circuit states are taken into account when calculating the Wi-Fi power consumption, this can effectively improve the accuracy of calculating the Wi-Fi power consumption.
[0159] When the Wi-Fi of the electronic device is in working state, the electronic device can send and / or receive data packets via Wi-Fi. When the electronic device sends and / or receives data packets via Wi-Fi, Wi-Fi consumes power. Therefore, within the calculation cycle, it is also necessary to calculate the second Wi-Fi power consumption of sending and / or receiving data packets via Wi-Fi. Based on this, an embodiment of the present application provides another method for calculating Wi-Fi power consumption. Figure 4 A flowchart of another method for calculating Wi-Fi power consumption provided in an embodiment of the present application. Figure 4 , a method for calculating Wi-Fi power consumption proposed in an embodiment of the present application includes steps S401-S403:
[0160] S401: The electronic device obtains first reference information and second reference information from a Wi-Fi chip.
[0161] After the electronic device obtains permission to access the Wi-Fi chip, the electronic device can obtain the second reference information from the Wi-Fi chip. The method for the electronic device to obtain the second reference information from the Wi-Fi chip is similar to the method for the electronic device to obtain the first reference information from the Wi-Fi chip. The specific operation of the electronic device to obtain the first reference information from the Wi-Fi chip can be referred to step S201, which will not be repeated here.
[0162] In order to send data packets via Wi-Fi, the electronic device includes a power amplifier for amplifying a transmission signal containing a data packet sent by the electronic device via Wi-Fi.
[0163] The second reference information includes the working time of the power amplifier working in multiple states or the number of frames of data frames sent during the calculation cycle, and the number of data packets received by the electronic device. For example, the second reference information includes the working time of the power amplifier in the Wi-Fi analog circuit working at the first transmission power, the working time of the power amplifier in the Wi-Fi analog circuit working at the second transmission power, the working time of the power amplifier in the Wi-Fi analog circuit working at the third transmission power, and the number of data packets received by the electronic device. For another example, the second reference information includes the working time of the power amplifier in the Wi-Fi analog circuit working at the first transmission rate, the working time of the power amplifier in the Wi-Fi analog circuit working at the second transmission rate, the working time of the power amplifier in the Wi-Fi analog circuit working at the third transmission rate, and the number of data packets received by the electronic device. For another example, the second reference information includes the number of frames of data frames sent by the power amplifier in the Wi-Fi analog circuit working at the first transmission power, the number of frames of data frames sent by the power amplifier in the Wi-Fi analog circuit working at the second transmission power, the number of frames of data frames sent by the power amplifier in the Wi-Fi analog circuit working at the third transmission power, and the number of data packets received by the electronic device. For another example, the second reference information includes the number of data frames sent by the power amplifier in the Wi-Fi simulation circuit at the first transmission rate, the number of data frames sent by the power amplifier in the Wi-Fi simulation circuit at the second transmission rate, the number of data frames sent by the power amplifier in the Wi-Fi simulation circuit at the third transmission rate, and the number of data packets received by the electronic device.
[0164] S402: The electronic device calculates the first Wi-Fi power consumption according to the first reference information and the first power consumption information, and calculates the second Wi-Fi power consumption according to the second reference information and the second power consumption information.
[0165] The electronic device calculates the first Wi-Fi power consumption according to the first reference information and the first power consumption information, which can be referred to as step S202 and will not be described in detail here.
[0166] Among them, the second power consumption information is used to indicate the power consumption of the power amplifier when working in multiple states, and the power consumption of the electronic device receiving a single data packet. If the second reference information includes the working time of the power amplifier working in multiple states within the calculation cycle, then correspondingly, the second power consumption information includes the power consumption of the power amplifier working in multiple states per unit time. If the second reference information includes the number of frames of sent data frames when the power amplifier works in multiple states within the calculation cycle, then correspondingly, the second power consumption information includes the power consumption used by the power amplifier to send unit frames when working in multiple states. Optionally, the second power consumption information is pre-stored in the electronic device. The pre-stored second power consumption information can be set based on experience, or can be measured by technical means.
[0167] In a feasible implementation, the second Wi-Fi power consumption includes the product of the working time of the power amplifier in multiple states and the power consumption of the power amplifier in multiple states, and the sum of the product of the number of data packets received by the electronic device and the power consumption of the electronic device receiving a single data packet.
[0168] Exemplarily, the working time of the power amplifier in various states of the embodiment of the present application includes the working time of the power amplifier working at multiple transmit powers (expressed as T PA-p The power consumption of the power amplifier in various states includes the power consumption of the power amplifier working at multiple transmission powers per unit time (denoted by P PA-p The number of data packets received by the electronic device (denoted by N rx The power consumption of an electronic device receiving a single data packet (expressed by P rx Based on this, the second Wi-Fi power consumption E can be calculated by the following formula 2-1: 2 :
[0169]
[0170] Exemplarily, the working time of the power amplifier in various states of the embodiment of the present application includes the working time of the power amplifier working at multiple transmission rates (expressed as T PA-v The power consumption of the power amplifier in various states includes the power consumption of the power amplifier working at multiple transmission rates per unit time (denoted by P PA-v The number of data packets received by the electronic device (denoted by N rx The power consumption of an electronic device receiving a single data packet (expressed by P rx Based on this, the second Wi-Fi power consumption E can be calculated by the following formula 2-2: 2 :
[0171]
[0172] In another feasible implementation, the second Wi-Fi power consumption includes the product of the number of frames of sent data frames in multiple states of the power amplifier and the power consumption of the power amplifier in multiple states, and the sum of the product of the number of data packets received by the electronic device and the power consumption of the electronic device receiving a single data packet.
[0173] Exemplarily, the number of frames of transmitted data frames in multiple states of the power amplifier in the embodiment of the present application includes the number of frames of transmitted data frames when the power amplifier operates at multiple transmit powers (expressed as F PA-p The power consumption of the power amplifier in various states includes the power consumption of the power amplifier working at multiple transmit powers within a unit frame (denoted by P' PA-p The number of data packets received by the electronic device (denoted by N rx The power consumption of an electronic device receiving a single data packet (expressed by P rx Based on this, the second Wi-Fi power consumption E can be calculated by the following formula 2-3: 2 :
[0174]
[0175] Exemplarily, the number of frames of transmitted data frames in multiple states of the power amplifier in the embodiment of the present application includes the number of frames of transmitted data frames when the power amplifier operates at multiple transmission rates (expressed as F PA-v The power consumption of the power amplifier in various states includes the power consumption of the power amplifier working at multiple transmission rates within a unit frame (denoted by P' PA-v The number of data packets received by the electronic device (denoted by N rx The power consumption of an electronic device receiving a single data packet (expressed by P rx Based on this, the second Wi-Fi power consumption E can be calculated by the following formula 2-4: 2 :
[0176]
[0177] S403: The electronic device determines whether the ratio of the second Wi-Fi power consumption to the sum of the first Wi-Fi power consumption and the second Wi-Fi power consumption is less than a preset value, and if so, performs an exception handling operation, and if not, ends the step.
[0178] The second Wi-Fi power consumption represents the power consumption of the electronic device sending and / or receiving data via Wi-Fi. If the ratio of the second Wi-Fi power consumption to the sum of the first Wi-Fi power consumption and the second Wi-Fi power consumption is less than a preset value, the electronic device can detect that the electronic device does not consume power when sending and / or receiving data via Wi-Fi when the Wi-Fi power consumption is very high, and the electronic device can determine that the Wi-Fi is abnormal. The preset value can be a percentage preset based on experience or business.
[0179] The exception handling operation includes one or more of outputting prompt information, executing the operation of clearing processes or applications that abnormally access the Wi-Fi chip, and reporting abnormal power consumption events of the Wi-Fi to the server.
[0180] In some feasible embodiments, the output prompt information is used to prompt the user that the power consumption of Wi-Fi in the electronic device is abnormal. The prompt information may include one or more of visual information on the display screen, voice information, and vibration information.
[0181] When the prompt information is visual information on a display screen, there may be a variety of user interfaces. Figure 5A-Figure 5B As shown exemplarily, it is a schematic diagram of visual prompt information outputted by an electronic device through a display screen provided in an embodiment of the present application.
[0182] like Figure 5A As shown, it is a schematic diagram of a user interface (i.e., user interface 51) of a visual prompt information provided in an embodiment of the present application. Specifically, in the user interface 51, the user interface 51 may include a notification bar 501. If the electronic device finds that the power consumption of Wi-Fi is abnormal, the electronic device can output a prompt message through the notification bar 501 in the user interface 51, and the prompt message can be a text message (such as "Wi-Fi power consumption is abnormal!"). The electronic device can jump to the user interface 50 in response to the user's click operation on the notification bar 501. The electronic device can output abnormal power consumption events and prompt information for handling abnormal power consumption events through the user interface 50. For example, the prompt information for handling abnormal power consumption events is used to prompt the user to turn off Wi-Fi. The electronic device can directly turn off Wi-Fi in response to the user operation of the user on the control 502.
[0183] like Figure 5B FIG. 5 is a schematic diagram of another user interface (i.e., user interface 52) for visual prompt information provided in an embodiment of the present application. In some embodiments, if the electronic device finds that the power consumption of Wi-Fi is abnormal, the electronic device may display indication information indicating the abnormal power consumption of Wi-Fi in the user interface 52. For example, Figure 5BAs shown in the example, the indication information may be a red circular indicator 504 displayed in the upper right corner of the Wi-Fi icon 503. Figure 5B As shown in the example, the indication information may also be displayed as a text message "abnormal" in red font below the Wi-Fi icon 503, indicating abnormal power consumption of Wi-Fi. These examples are only some implementations provided by the present application, and may be different in actual applications. For example, abnormal power consumption of Wi-Fi may be indicated by setting the display status of Wi-Fi, such as the Wi-Fi icon being red, the Wi-Fi icon presenting an animation effect similar to a heartbeat, etc., which should not constitute a limitation.
[0184] Similarly, the electronic device can also jump to the user interface 50 in response to the user clicking operation on the Wi-Fi icon 503. The electronic device can output the abnormal power consumption event and the prompt information for handling the abnormal power consumption event through the user interface 50.
[0185] In an embodiment of the present application, the electronic device obtains from the Wi-Fi chip first reference information including the working time of the electronic device working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states within the calculation cycle, and second reference information including the working time of the power amplifier working in multiple states or the number of frames of the sent data frame within the calculation cycle, and the number of data packets received by the electronic device. Then the first Wi-Fi power consumption is calculated according to the first reference information and the first power consumption information, and the second Wi-Fi power consumption is calculated according to the second reference information and the second power consumption information. And the Wi-Fi is detected abnormally according to the second Wi-Fi power consumption and the sum of the first Wi-Fi power consumption and the second Wi-Fi power consumption. Not only the power consumption differences of multiple Wi-Fi digital circuit states and / or multiple Wi-Fi analog circuit states, as well as the power consumption differences of multiple states of the power amplifier when sending data packets are considered when calculating the Wi-Fi power consumption, the accuracy of calculating the Wi-Fi power consumption is effectively improved. It also detects abnormalities on Wi-Fi and performs abnormal processing operations, effectively controls the electronic device, improves the battery life of the electronic device, and improves the user experience.
[0186] During the calculation cycle, the Wi-Fi of the electronic device may also be in a light sleep state or a deep sleep state. Based on this, the embodiment of the present application also provides another method for calculating Wi-Fi power consumption. Figure 6 A flowchart of another method for calculating Wi-Fi power consumption provided in an embodiment of the present application. Figure 6 , a method for calculating Wi-Fi power consumption proposed in an embodiment of the present application includes steps S601-S606:
[0187] S601: The electronic device obtains first reference information, second reference information and third reference information from a Wi-Fi chip.
[0188] After the electronic device obtains permission to access the Wi-Fi chip, the electronic device can obtain the first reference information, the second reference information, and the third reference information from the Wi-Fi chip. The method for the electronic device to obtain the second reference information and the third reference information from the Wi-Fi chip is similar to the method for the electronic device to obtain the first reference information from the Wi-Fi chip. The specific operation of the electronic device to obtain the first reference information from the Wi-Fi chip can be referred to step S201, which will not be repeated here.
[0189] The third reference information includes the working time of the electronic device working in the Wi-Fi light sleep state and the Wi-Fi deep sleep state within the calculation cycle.
[0190] Table 1 exemplarily shows the first reference information, the second reference information and the third reference information in a case. Table 1 is only for illustrating the embodiment of the present application and should not be construed as limiting.
[0191] Table 1
[0192]
[0193] S602: The electronic device calculates a first Wi-Fi power consumption according to the first reference information and the first power consumption information, calculates a second Wi-Fi power consumption according to the second reference information and the second power consumption information, and calculates a third Wi-Fi power consumption according to the third reference information and the third power consumption information.
[0194] The third power consumption information is used to indicate the power consumption of the electronic device when it is operating in the Wi-Fi light sleep state and the Wi-Fi light sleep state.
[0195] In a feasible implementation, the third Wi-Fi power consumption includes the product of the working time of the electronic device in the Wi-Fi lightsleep state and the power consumption in the Wi-Fi light sleep state, and the sum of the product of the working time of the electronic device in the Wi-Fi deep sleep state and the power consumption in the Wi-Fi deep sleep state.
[0196] For example, the working time of the Wi-Fi light sleep state in the embodiment of the present application is represented by T light Indicates the power consumption of Wi-Fi light sleep state per unit time by P light The working time of Wi-Fi sleep state is expressed as T.deep Indicates that the power consumption of Wi-Fi sleep state per unit time is expressed as P deep The third Wi-Fi power consumption E can be calculated by the following formula 3-1: 3 :
[0197] E 3 =T light *P light +T deep *P deep 3-1
[0198] S603: The electronic device determines a total Wi-Fi power consumption within a calculation period according to the first Wi-Fi power consumption, the second Wi-Fi power consumption, and the third Wi-Fi power consumption.
[0199] In a feasible implementation manner, the sum of the first Wi-Fi power consumption, the second Wi-Fi power consumption and the third Wi-Fi power consumption is directly taken as the total Wi-Fi power consumption.
[0200] In another feasible implementation, the weights of the first Wi-Fi power consumption, the second Wi-Fi power consumption, and the third Wi-Fi power consumption may be used as the total Wi-Fi power consumption. The weight of the first Wi-Fi power consumption, the weight of the second Wi-Fi power consumption, and the weight of the third Wi-Fi power consumption may be set according to business requirements or based on experience.
[0201] S604: The electronic device determines whether the ratio of the second Wi-Fi power consumption to the total Wi-Fi power consumption is less than a preset value, and if so, performs an exception handling operation.
[0202] The exception handling operation may refer to step S403 and will not be described in detail here.
[0203] S605: The electronic device obtains a first data volume of data packets sent and / or received by an application via Wi-Fi within a calculation period, and calculates a ratio of the first data volume to the total data volume.
[0204] In some feasible implementations, a first data volume of data packets sent and / or received by an application via Wi-Fi and a total data volume of data packets sent and / or received by the electronic device via Wi-Fi may be obtained from the operating system, and then a ratio of the first data volume to the total data volume may be calculated.
[0205] S606: The electronic device determines the Wi-Fi power consumption of an application within the calculation period according to the ratio of the first data volume to the total data volume and the total Wi-Fi power consumption.
[0206] In a feasible implementation, the electronic device may use steps S605 and S606 to obtain the Wi-Fi power consumption of each application in the calculation cycle.
[0207] Exemplarily, it is assumed that the total Wi-Fi power consumption determined according to the first Wi-Fi power consumption, the second Wi-Fi power consumption, and the third Wi-Fi power consumption is E. The electronic device obtains a first data volume of a data packet sent and / or received by an application through Wi-Fi as S 1 , and the total amount of data obtained is S. Then the Wi-Fi power consumption E' of an application can be calculated by formula 4-1.
[0208]
[0209] The power consumption ranking is used as an interface for electronic devices and users to exchange battery life information. Electronic devices can display relevant information about the power consumption ranking through the user interface. Fig. 7A FIG. 7 is a schematic diagram of a user interface (i.e., user interface 71) for displaying power consumption rankings provided in an embodiment of the present application. User interface 71 includes controls 701 and 702. The electronic device can display the power consumption of each hardware in a computing cycle by responding to user operations on control 701, for example Figure 7B The user interface 72 shown. Figure 7B As shown, the user interface 72 displays the power consumption of the screen, the power consumption of voice calls, the power consumption of signal standby, the power consumption of mobile phone standby, the power consumption of wireless network (i.e., Wi-Fi power consumption), and the power consumption of Bluetooth. The electronic device can display the power consumption of each application in the computing cycle by responding to the user operation on the control 702, for example, Figure 7C As shown, the user interface 73 displays the power consumption of Baidu, the power consumption of WeChat, the power consumption of Didi Chuxing, the power consumption of the system user interface, the power consumption of the dial-up service, the power consumption of the phone, and the power consumption of the mobile phone manager. The power consumption within the calculation cycle can also be referred to as power consumption.
[0210] When the electronic device calculates the Wi-Fi power consumption of each application in the calculation cycle, the electronic device can output the Wi-Fi power consumption of each application in the calculation cycle in the Wi-Fi related user interface. In a feasible implementation, the electronic device can receive a user operation on the Wi-Fi icon 703 of the user interface 72, and display the user interface 74 in response to the operation. The Wi-Fi power consumption of each application in the calculation cycle is displayed in the user interface 74. Optionally, the electronic device can also jump to the user interface 74 by responding to the user's click operation on the notification bar 501. Fig.7DAs shown, the user interface 74 displays the Wi-Fi power consumption of Baidu, the Wi-Fi power consumption of WeChat, and the Wi-Fi power consumption of Didi Chuxing. This is not limited here.
[0211] In another feasible implementation, the electronic device may output the Wi-Fi power consumption during the calculation cycle in the user interface related to each application. For example, the electronic device may receive a user operation on the Baidu icon 704 of the user interface 73, and display the user interface 75 in response to the operation. The user interface 75 is used to display the power consumption information of Baidu. The user interface 75 displays the Wi-Fi power consumption of Baidu, for example, Fig. 7E As shown, the electronic device can display "Baidu's Wi-Fi power consumption is 20%" through part 705. It is important to understand that Fig. 7E For exemplary purposes only, the electronic device may also display the Wi-Fi power consumption of an application in an application-related user interface in other ways.
[0212] In an embodiment of the present application, the electronic device obtains from the Wi-Fi chip first reference information including the working time of the electronic device in various Wi-Fi digital circuit states and various Wi-Fi analog circuit states during the calculation cycle, second reference information including the working time of the power amplifier in various states or the number of frames of the sent data frame during the calculation cycle, and the number of data packets received by the electronic device, and third reference information including the sleep state. Not only the power consumption differences of various Wi-Fi digital circuit states and / or various Wi-Fi analog circuit states and the power consumption differences of various states of the power amplifier when sending data packets are considered when calculating the Wi-Fi power consumption, but also the power consumption differences of the sleep state are considered, which can effectively improve the accuracy of calculating the Wi-Fi power consumption. In addition, the Wi-Fi power consumption of each application can be calculated, and abnormal detection of Wi-Fi can be performed, so as to effectively control the electronic device, improve the battery life of the electronic device, and improve the user experience.
[0213] The electronic device, the user interface for such an electronic device, and the embodiments for using such an electronic device are introduced above. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or a display function, such as a mobile phone, a tablet computer, a laptop computer, a wearable electronic device with a Wi-Fi communication function (such as a smart watch, a smart bracelet, a smart wristband), etc. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer (Laptop) with a touch-sensitive surface or a touch panel, etc. It should also be understood that in some other embodiments, the above-mentioned electronic device may also be a desktop computer with a touch-sensitive surface or a touch panel.
[0214] The present application also provides a computer-readable storage medium, which includes a computer program or instructions. When the computer program or instructions are executed on an electronic device, the electronic device executes the method for calculating Wi-Fi power consumption as described in the above embodiment.
[0215] The present application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed on an electronic device, the electronic device executes the method for calculating Wi-Fi power consumption as described in the above embodiment.
[0216] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0217] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0218] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0219] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0220] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0221] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for calculating power consumption of wireless fidelity Wi-Fi, characterized in that: Applied to an electronic device, the electronic device includes a Wi-Fi chip, and the method includes: The electronic device obtains first reference information from the Wi-Fi chip, where the first reference information includes working time of the electronic device working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states within a calculation cycle; the multiple Wi-Fi digital circuit states include the Wi-Fi digital circuit working in multiple frequency points; the multiple Wi-Fi analog circuit states include: the Wi-Fi analog circuit working in multiple bandwidths, and the Wi-Fi analog circuit working in one or more of multiple radio frequency states; The electronic device calculates a first Wi-Fi power consumption according to the first reference information and first power consumption information, where the first power consumption information is used to indicate the power consumption of the electronic device when operating in the multiple Wi-Fi digital circuit states and the multiple Wi-Fi analog circuit states.
2. The method according to claim 1, characterized in that The electronic device further includes a power amplifier, and the method further includes: The electronic device obtains second reference information from the Wi-Fi chip, where the second reference information includes the working time of the power amplifier working in multiple states or the number of frames of sent data frames within the calculation cycle, and the number of data packets received by the electronic device; The electronic device calculates a second Wi-Fi power consumption according to the second reference information and the second power consumption information, where the second power consumption information is used to indicate the power consumption of the power amplifier when operating in the multiple states and the power consumption of the electronic device when receiving a single data packet.
3. The method according to claim 2, characterized in that The multiple states include the power amplifier operating at multiple transmit powers or the power amplifier operating at multiple transmit rates.
4. The method according to claim 2 or 3, characterized in that: The method further comprises: The electronic device obtains third reference information from the Wi-Fi chip, where the third reference information includes working time of the electronic device in the Wi-Fi light sleep state and the Wi-Fi deep sleep state during the calculation cycle; The electronic device calculates a third Wi-Fi power consumption according to the third reference information and the third power consumption information, where the third power consumption information is used to indicate the power consumption of the electronic device when operating in the Wi-Fi light sleep state and the Wi-Fi deepsleep state.
5. The method according to claim 4, characterized in that The method further comprises: The electronic device determines the total power consumption of the Wi-Fi in the calculation cycle according to the first Wi-Fi power consumption, the second Wi-Fi power consumption, and the third Wi-Fi power consumption.
6. The method according to claim 5, characterized in that The method further comprises: If the ratio of the power consumption of the second Wi-Fi to the total power consumption of the Wi-Fi is less than a preset value, the electronic device outputs a prompt message, where the prompt message is used to prompt a user that the power consumption of the Wi-Fi is abnormal; and / or, The electronic device performs an operation of clearing processes or applications that abnormally access the Wi-Fi chip; and / or, The electronic device reports the abnormal power consumption event of the Wi-Fi to the server.
7. The method according to claim 5 or 6, characterized in that: The method further comprises: The electronic device obtains a first data volume of data packets sent and / or received by an application via the Wi-Fi within the calculation period; The electronic device calculates a ratio of the first data volume to a total data volume, where the total data volume is a data volume of data packets sent and / or received by the electronic device via the Wi-Fi during the calculation period; The electronic device determines the Wi-Fi power consumption of the one application in the calculation cycle according to the ratio of the first data amount to the total data amount and the total power consumption of the Wi-Fi.
8. An electronic device, characterized in that: The electronic device includes one or more memories and one or more processors, 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, wherein the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs the following operations: Acquire first reference information from a Wi-Fi chip, where the first reference information includes working time of the electronic device working in multiple Wi-Fi digital circuit states and multiple Wi-Fi analog circuit states within a calculation cycle; The multiple Wi-Fi digital circuit states include: the Wi-Fi digital circuit operates at multiple frequencies; the multiple Wi-Fi analog circuit states include: the Wi-Fi analog circuit operates at multiple bandwidths, and the Wi-Fi analog circuit operates in one or more of multiple radio frequency states; A first Wi-Fi power consumption is calculated according to the first reference information and the first power consumption information, where the first power consumption information is used to indicate the power consumption of the electronic device when operating in the multiple Wi-Fi digital circuit states and the multiple Wi-Fi analog circuit states.
9. The electronic device according to claim 8, characterized in that: The electronic device further includes a power amplifier. When the one or more processors execute the computer instructions, the electronic device further performs the following operations: Acquire second reference information from the Wi-Fi chip, where the second reference information includes the working time of the power amplifier working in multiple states or the number of frames of sent data frames within the calculation cycle, and the number of data packets received by the electronic device; The second Wi-Fi power consumption is calculated according to the second reference information and the second power consumption information, where the second power consumption information is used to indicate the power consumption of the power amplifier when operating in the multiple states and the power consumption of the electronic device when receiving a single data packet.
10. The electronic device according to claim 9, characterized in that: The multiple states include the power amplifier operating at multiple transmit powers or the power amplifier operating at multiple transmit rates.
11. The electronic device according to claim 9 or 10, characterized in that: When the one or more processors execute the computer instructions, the electronic device further performs the following operations: Acquire third reference information from the Wi-Fi chip, the third reference information including working time of the electronic device in the Wi-Fi light sleep state and the Wi-Fi deep sleep state during the calculation cycle; A third Wi-Fi power consumption is calculated according to the third reference information and the third power consumption information, where the third power consumption information is used to indicate the power consumption of the electronic device when operating in the Wi-Fi light sleep state and the Wi-Fi deep sleep state.
12. The electronic device according to claim 11, characterized in that: When the one or more processors execute the computer instructions, the electronic device further performs the following operations: The total power consumption of the Wi-Fi in the calculation cycle is determined according to the first Wi-Fi power consumption, the second Wi-Fi power consumption, and the third Wi-Fi power consumption.
13. The electronic device according to claim 12, characterized in that: When the one or more processors execute the computer instructions, the electronic device further performs the following operations: If the ratio of the power consumption of the second Wi-Fi to the total power consumption of the Wi-Fi is less than a preset value, output a prompt message, where the prompt message is used to prompt a user that the power consumption of the Wi-Fi is abnormal; and / or, Execute an operation of clearing processes or applications that abnormally access the Wi-Fi chip; and / or, Report abnormal Wi-Fi power consumption events to the server.
14. The electronic device according to claim 12 or 13, characterized in that: When the one or more processors execute the computer instructions, the electronic device further performs the following operations: Acquire a first data volume of data packets sent and / or received by an application through the Wi-Fi during the calculation period; Calculating a ratio of the first data volume to a total data volume, where the total data volume is a data volume of data packets sent and / or received by the electronic device through the Wi-Fi during the calculation period; The Wi-Fi power consumption of the one application in the calculation cycle is determined according to the ratio of the first data amount to the total data amount and the total power consumption of the Wi-Fi.
15. A computer storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 7.
16. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 7.
