Electric quantity statistical information updating method and device and storage medium

By selecting real-time or non-real-time update of power statistics in mobile communication devices based on terminal status, the power consumption problem caused by frequent modem wake-up is solved, and more efficient power statistics update is achieved, and the battery life of the device is extended.

CN119865878APending Publication Date: 2025-04-22BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311367904.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-20
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

In mobile communication devices, every time the power statistics interface is requested, the Modem will be awakened, resulting in higher power consumption and affecting the battery life of the device.

Method used

By determining the terminal status when receiving the power statistics update request, it is selected to update the power statistics information using the first method or the second method. The first method is to obtain the power statistics information at the current moment through the modem, and the second method is to obtain the power statistics information that has been counted the most recently before the current moment.

Benefits of technology

While ensuring the accuracy of power statistics, this method flexibly selects the update method according to the status of the terminal equipment, which can not only realize real-time updates, but also reduce resource consumption, improve update efficiency, and extend the battery life of the equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865878A_ABST
    Figure CN119865878A_ABST
Patent Text Reader

Abstract

The invention relates to an electric quantity statistical information updating method and device and a storage medium. The electric quantity statistical information updating method comprises the following steps: in response to determining that a modem of the electronic equipment receives an electric quantity statistical information updating request, determining a terminal state, the electric quantity statistical information updating request being used for requesting to update consumed electric quantity in a wireless mobile network communication process of the electronic equipment; based on the terminal state, determining to use a first mode to update the electric quantity statistical information or use a second mode to update the electric quantity statistical information; the first mode comprises the following steps: acquiring electric quantity statistical information at the current moment through the modem, and updating the electric quantity statistical information based on the electric quantity statistical information at the current moment; the second mode comprises the steps of obtaining the last counted electric quantity statistical information before the current moment, and updating the electric quantity statistical information based on the counted electric quantity statistical information. According to the invention, the electric quantity consumption of the equipment can be reduced on the premise of ensuring the effectiveness of the electric quantity statistical information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of mobile terminals, and in particular to a method, device and storage medium for updating power statistics information. Background Art

[0002] In mobile communication devices, the wireless mobile network communication module is usually the main part of battery consumption. Therefore, counting the power consumption of the wireless mobile network communication module is of great significance for analyzing the energy efficiency, performance and network management of the device. In order to improve the battery life of the device, it is necessary to identify and solve the problems that may increase the power consumption of the device. In a mobile communication device, the power consumption statistics of the wireless mobile network communication module can be obtained through the modem power statistics information interface. These statistics include the usage time of the wireless mobile network communication module in different states and the total energy consumed.

[0003] However, each time the wireless mobile network communication module requests a resource interface, the Modem will be awakened, which will result in higher power consumption. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a method, device and storage medium for updating power statistical information.

[0005] According to a first aspect of an embodiment of the present disclosure, a method for updating power statistics information is provided, comprising: determining a terminal state in response to determining that a modem of an electronic device has received a power statistics information update request, wherein the power statistics information update request is used to request an update of power consumption during wireless mobile network communication of the electronic device; based on the terminal state, determining whether to update the power statistics information in a first manner or in a second manner; the first manner comprising: obtaining power statistics information at a current moment through the modem, and updating the power statistics information based on the power statistics information at the current moment; the second manner comprising: obtaining the most recent power statistics information that has been counted before the current moment, and updating the power statistics information based on the counted power statistics information.

[0006] In one embodiment, determining whether to use a first method or a second method to update the power statistics information based on the terminal status includes: determining whether to use a first method or a second method to update the power statistics information based on the terminal status and the power consumption type; the power consumption type includes at least one of the following: power consumption based on power supply statistics, power consumption based on log statistics, and power consumption based on bandwidth estimation.

[0007] In one embodiment, the power consumption type includes power consumption based on power supply statistics; the determination of using a first method to update the power statistics information or a second method to update the power statistics information based on the terminal state and the power consumption type includes at least one of the following: if the terminal state is a sleep state, the power statistics information is updated using the second method; if the terminal state is not a sleep state, the determination of using the first method to update the power statistics information or the second method to update the power statistics information is based on attribute information of an application that issues the power statistics information update request.

[0008] In one embodiment, determining whether to use the first method or the second method to update the power statistics information based on the attribute information of the application that issues the power statistics information update request includes: generating a frequency control rule based on the attribute information of the application that issues the power statistics information update request and the terminal status, the frequency control rule indicating the frequency of using the first method; and determining whether to use the first method or the second method to update the power statistics information based on the frequency control rule.

[0009] In one embodiment, the determination of using the first method or the second method to update the power statistics information based on the frequency control rule includes: if the current update of the power statistics information meets the frequency of using the first method, determining to use the first method to update the power statistics information; if the current update of the power statistics information does not meet the frequency of using the first method, determining to use the second method to update the power statistics information.

[0010] In one embodiment, the power consumption type includes power consumption based on bandwidth estimation; the determination of using the first method to update the power statistics information or using the second method to update the power statistics information based on the terminal state and the power consumption type includes at least one of the following: if the terminal state is a sleep state, using the second method to update the power statistics information; if the terminal state is a screen-off state, using the second method to update the power statistics information; if the terminal state is a screen-on state, using the first method to update the power statistics information.

[0011] In one embodiment, the power consumption type includes power consumption based on log statistics; the determination of using the first method to update the power statistics information or using the second method to update the power statistics information based on the terminal status and the power consumption type includes at least one of the following: if the terminal status is a sleep state, using the second method to update the power statistics information; if the terminal status is a screen-off state, using the first method to update the power statistics information; if the terminal status is a screen-on state, using the first method to update the power statistics information.

[0012] According to a second aspect of an embodiment of the present disclosure, a power statistics information updating device is provided, comprising a determining unit for determining a terminal state in response to determining that a modem of an electronic device has received a power statistics information update request, wherein the power statistics information update request is used to request an update of power consumption of the electronic device during wireless mobile network communication; a processing unit for determining, based on the terminal state, whether to update the power statistics information using a first method or a second method; the first method comprising: obtaining power statistics information at a current moment through the modem, and updating the power statistics information based on the power statistics information at the current moment; the second method comprising: obtaining the most recent power statistics information that has been counted before the current moment, and updating the power statistics information based on the counted power statistics information.

[0013] In one embodiment, the processing unit determines whether to use the first method or the second method to update the power statistics information based on the terminal status in the following manner: based on the terminal status and the power consumption type, determines whether to use the first method or the second method to update the power statistics information; the power consumption type includes at least one of the following: power consumption based on power supply statistics, power consumption based on log statistics, and power consumption based on bandwidth estimation.

[0014] In one embodiment, the power consumption type includes power consumption based on power statistics; the processing unit uses at least one of the following methods to determine whether to use a first method to update the power statistics information or a second method to update the power statistics information based on the terminal state and the power consumption type, including: if the terminal state is a sleep state, then the second method is used to update the power statistics information; if the terminal state is not a sleep state, then based on the attribute information of the application that issues the power statistics information update request, it is determined to use the first method to update the power statistics information or the second method to update the power statistics information.

[0015] In one embodiment, the processing unit determines whether to use the first method to update the power statistics information or the second method to update the power statistics information based on the attribute information of the application that issues the power statistics information update request in the following manner: based on the attribute information of the application that issues the power statistics information update request and the terminal status, a frequency control rule is generated, and the frequency control rule indicates the frequency of using the first method; based on the frequency control rule, it is determined whether to use the first method to update the power statistics information or the second method to update the power statistics information.

[0016] In one embodiment, the processing unit determines whether to use the first method or the second method to update the power statistical information based on the frequency control rule in the following manner: if the current update of the power statistical information meets the frequency of using the first method, then determine to use the first method to update the power statistical information; if the current update of the power statistical information does not meet the frequency of using the first method, then determine to use the second method to update the power statistical information.

[0017] In one embodiment, the power consumption type includes power consumption based on bandwidth estimation; the processing unit uses at least one of the following methods to determine whether to use the first method to update the power statistics information or the second method to update the power statistics information based on the terminal state and the power consumption type, including: if the terminal state is a sleep state, then the second method is used to update the power statistics information; if the terminal state is a screen-off state, then the second method is used to update the power statistics information; if the terminal state is a screen-on state, then the first method is used to update the power statistics information.

[0018] In one embodiment, the power consumption type includes power consumption based on log statistics; the processing unit uses at least one of the following methods to determine whether to use a first method to update the power statistics information or a second method to update the power statistics information based on the terminal status and the power consumption type, including: if the terminal status is a sleep state, use the second method to update the power statistics information; if the terminal status is a screen-off state, use the first method to update the power statistics information; if the terminal status is a screen-on state, use the first method to update the power statistics information.

[0019] According to a third aspect of an embodiment of the present disclosure, a power statistics information updating device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to: execute the method described in any one of the first aspect of the embodiment of the present disclosure.

[0020] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute any one of the methods described in the first aspect of the embodiment of the present disclosure.

[0021] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: in response to receiving a request to update power statistics information, determining the terminal state, and selecting to use the first method or the second method to update the power statistics information based on the terminal state. The first method is to obtain the power statistics information at the current moment through a modem, and update the power statistics information based on this. This method can reflect the power consumption of the device in real time, which is conducive to accurate statistics. The second method is to obtain the most recent statistical power statistics information before the current moment, and update the power statistics information based on this. This method is suitable for scenarios with low real-time requirements and can save resources. The technical solution provided by the embodiments of the present disclosure selects to obtain the power statistics information at the current moment through a modem according to the terminal state of the device, and update the power statistics information based on this, or to obtain the most recent statistical power statistics information before the current moment, and update the power statistics information based on this, so as to save power when power needs to be saved, and can ensure the validity of the power statistics information.

[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0024] Figure 1 It is a schematic diagram of a wireless mobile network communication architecture.

[0025] Figure 2 It is a schematic diagram of a power statistics information updating device in the related art.

[0026] Figure 3 The figure is a flow chart of a method for updating power statistics information according to an exemplary embodiment.

[0027] Figure 4 The flowchart of another method for updating power statistics information is shown according to an exemplary embodiment.

[0028] Figure 5 The flowchart of another method for updating power statistics information is shown according to an exemplary embodiment.

[0029] Figure 6 The flowchart of another method for updating power statistics information is shown according to an exemplary embodiment.

[0030] Figure 7 The flowchart of another method for updating power statistics information is shown according to an exemplary embodiment.

[0031] Figure 8 The flowchart of another method for updating power statistics information is shown according to an exemplary embodiment.

[0032] Fig. 9 The flowchart of another method for updating power statistics information is shown according to an exemplary embodiment.

[0033] Fig.10 The figure is a block diagram of a device for updating power statistics information according to an exemplary embodiment.

[0034] Fig.11 The figure is a schematic diagram showing a device for updating power statistics information according to an exemplary embodiment.

[0035] Fig.12 The present invention is a statistical graph showing the number of daily electricity statistics information accesses according to an exemplary real-time example.

[0036] Fig.13 The figure is a block diagram of a device for updating power statistics information according to an exemplary embodiment. DETAILED DESCRIPTION

[0037] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.

[0038] In the accompanying drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limitations on the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure. The embodiments of the present disclosure are described in detail below in conjunction with the accompanying drawings.

[0039] The power statistics information updating method provided in the embodiments of the present disclosure can be applied to scenarios related to power consumption of wireless mobile network communications, for example, when obtaining power consumption statistics information of a wireless mobile network communication module through a modem power statistics information interface.

[0040] Wireless mobile network communication, also known as wireless mobile network communication. In the process of wireless mobile network communication, the wireless mobile network communication module is usually the main part of battery consumption. Statistics on the power consumption of the wireless mobile network communication module are of great significance for analyzing the energy efficiency, performance and network management of the device. In order to improve the battery life of the device, it is necessary to identify and solve the problems that may increase the power consumption of the device. In electronic devices, the power consumption statistics of the wireless mobile network communication module can be obtained through the modem (Modem) power statistics information interface. These statistics include the usage time of the wireless mobile network communication module in different states and the total energy consumed.

[0041] Figure 1 It is a schematic diagram of a wireless mobile network communication architecture.

[0042] like Figure 1 As shown in the figure, the wireless mobile network communication architecture mainly includes the following layers:

[0043] 1) Application layer: mainly includes typical applications of various scenarios, such as voice call application, including call tracker, SMS sending, service tracker and data tracker.

[0044] 2) Application framework layer: responsible for obtaining basic communication information such as modem signal parameters, network status, etc. from the bottom layer, as well as the selection of each network link, the control of various scenarios and the transmission of data packets. It is mainly composed of telephone and radio interface layers, of which the telephone part includes code, operating system and telecommunication technology related information, and the radio interface layer includes code, operating system, telecommunication technology and mobile communication technology standards.

[0045] 3) Library (user space layer): mainly responsible for device startup, routing parameters and firewall settings, sending data packets to the operating system kernel layer, and sending voice and control commands to the baseband layer. This layer is mainly composed of the radio daemon and the vendor radio interface layer in the operating system, where the radio daemon includes the command line interface daemon, and the vendor radio interface layer includes the system, library, and vendor library shared objects.

[0046] 4) Operating system kernel layer: mainly responsible for device drivers and protocol processing, including the operating system Internet protocol stack and data packet driver, where the data packet driver includes the point-to-point protocol.

[0047] 5) Baseband layer: the main part of communication protocol processing

[0048] Depend on Figure 1It can be seen that the process of obtaining the power consumption statistics information of the wireless mobile network communication module through the Modem power statistics information interface occurs in the step of the framework layer obtaining the reported Modem signal parameters from the bottom layer.

[0049] The structure of the power consumption statistics of the wireless mobile network communication module is as follows:

[0050] Timestamp: The timestamp for recording the power statistics of this modem.

[0051] Sleep statistics time: the time (milliseconds) that the modem is in sleep state.

[0052] Idle statistics time: The time (in milliseconds) that the modem is in idle state.

[0053] Receiving state statistical time: the time (in milliseconds) that the modem is in the receiving (Receive, Rx) state.

[0054] Transmission status statistics time: This is an array that represents the time of the Modem at different transmission (Transmit, Tx) levels.

[0055] In a wireless mobile network, depending on the signal quality, the modem may use different Tx levels. This array records the time the modem spends for each possible Tx level.

[0056] Figure 2 is a schematic diagram of a power statistics information updating device in the related art. The power statistics updating device may be an electronic device, for example, a mobile terminal such as a smart phone. Figure 2 As shown, the power statistics information updating device includes a power statistics module, a bandwidth estimation module, a log statistics module, a communication management module, a communication interface module, a communication module, and a modem module. The power statistics updating device updates the power statistics information in the following manner.

[0057] The power statistics module sends a request to the communication management module to update the power statistics information. The power statistics module is responsible for collecting and managing power usage statistics.

[0058] When the device is in the screen-on state, the bandwidth estimation module sends a request to the communication management module to update the power statistics information. The bandwidth estimation module is mainly responsible for estimating the network bandwidth.

[0059] The log statistics module sends a request to the communication management module to update the power statistics information. The log statistics module is mainly responsible for the collection and analysis of logs.

[0060] Call the communication interface module to request the latest modem power statistics. The communication management module is mainly responsible for coordinating and managing communication requests.

[0061] The communication interface module calls the communication module to request the latest power statistics information of the Modem, and obtains the power statistics information from the Modem. The communication interface module is a module that processes communication-related requests.

[0062] The modem processes the request and returns the updated power statistics to the communication module. The communication module communicates with the modem through the Radio Interface Layer (RIL) corresponding to the communication module. RIL is a library used to communicate with the modem on the mobile device and is responsible for processing commands and responses between the modem and the communication module. In the RIL, the modem power statistics are assembled and sent to the communication module.

[0063] The communication module returns the power statistics information to the communication interface module.

[0064] The communication management module returns the acquired power statistics information to the power statistics module, the bandwidth estimation module and the log statistics module, thereby completing the update of the power statistics information.

[0065] like Figure 2 As shown, when requesting to update the Modem power statistics information, the Modem power statistics information interface served by the communication management module is accessed from the communication status tracking module to exchange data with the Modem, and finally the required Modem power statistics information is obtained.

[0066] It is understandable that the Modem power statistics interface is system-level and can only be accessed by system applications. The three modules, the power statistics module, the bandwidth estimation module, and the log statistics module, are responsible for calling the Modem power statistics. Each module has its own unique role and function. The power statistics module is mainly responsible for obtaining data from external sources (such as modems, WiFi controllers, and Bluetooth chips) and updating this information to the power statistics class. In order to improve efficiency, this update process is completed as much as possible without holding the power statistics module lock. The lock is held and the data is pushed into the power statistics module only when the data is ready. The bandwidth estimation module is mainly used to provide bandwidth estimation functions when accessing the network, while the log statistics module is a native service running in the background to collect various indicator data, such as application usage, battery and process statistics, and crash data. During these processes, the log statistics module will access the Modem power statistics interface.

[0067] Depend on Figure 3As we can see, power management covers many components and categories, among which the power management related to modem is mainly the power statistics of modem. The function of the modem power statistics interface is to obtain the power consumption statistics of the wireless mobile network communication module, including the usage time and total energy consumed by the wireless mobile network communication module in different states.

[0068] However, there are some problems with the related technology. For example, each time the power statistics interface is requested, the modem will be awakened once. If the modem is awakened frequently, it will increase the energy consumption of the device. After a big data analysis of the access to the modem power statistics information, it was found that the average number of accesses per machine per day exceeded 1,000 times, and extreme models even reached 1,600 times, which resulted in greater power consumption. In the power consumption test, a laboratory measured that the current consumption of a power query was 170mA, which lasted for 1.6 seconds.

[0069] In view of this, an embodiment of the present disclosure provides a method for updating power statistics information. In the method for updating power statistics information provided by the present disclosure, in response to receiving a request to update power statistics information, the terminal state is determined, and the first method or the second method is selected to update the power statistics information based on the terminal state. The first method is to obtain the power statistics information at the current moment through a modem, and update the power statistics information based on this. This method can reflect the power consumption of the device in real time, which is conducive to accurate statistics. The second method is to obtain the most recently counted power statistics information before the current moment, and update the power statistics information based on this. This method is suitable for scenarios with low real-time requirements and can save resources. The technical solution provided by the embodiment of the present disclosure can flexibly select the update method according to actual needs while ensuring the accuracy of the power statistics information by selecting real-time or non-real-time update of power statistics information according to the terminal state of the device, which can not only achieve real-time update, but also reduce resource consumption and improve update efficiency.

[0070] Figure 3 is a flow chart of a method for updating power statistics information according to an exemplary embodiment. Figure 3 As shown, the following steps are included.

[0071] In step S11, in response to determining that the modem of the electronic device receives a power statistics information update request, the terminal state is determined, and the power statistics information update request is used to request an update of power consumption of the electronic device during wireless mobile network communication.

[0072] In the disclosed embodiment, the modem of the electronic device receives a request to update power statistics. This request may come from the operating system of the device or from a specific application, and its purpose is to request the modem to update its power consumption statistics during the communication process. The modem will re-determine the terminal status of the device based on the new request received. The terminal status may be information such as the remaining power of the device and whether the device is being charged. The modem will update the power statistics of the device based on the new terminal status.

[0073] In step S12, based on the terminal state, it is determined whether to update the power statistics information using the first method or the second method.

[0074] In the embodiment of the present disclosure, the terminal status includes information such as the remaining power of the device and whether the device is being charged. According to the terminal status, the first method or the second method can be selected to update the power statistics information. The terminal status includes: sleep state, screen off state and screen on state.

[0075] In the disclosed embodiment, the first method includes: obtaining power statistics information at the current moment through a modem, and updating the power statistics information based on the power statistics information at the current moment. The second method includes: obtaining the most recently counted power statistics information before the current moment, and updating the power statistics information based on the counted power statistics information. The specific implementation and operation of these two methods are different, but the ultimate purpose is to update the power consumption statistics information of the device.

[0076] In the power statistics information updating method provided in the embodiment of the present disclosure, by selecting real-time or non-real-time updating of power statistics information according to the terminal status of the device, the accuracy of the power statistics information can be ensured while flexibly selecting the updating method according to actual needs, which can not only realize real-time updating, but also reduce resource consumption and improve update efficiency.

[0077] In a mobile communication device, various modules may consume power of a wireless mobile network communication module. Moreover, the types of power consumption of the wireless mobile network communication module caused by these different modules may be different. Therefore, when obtaining power consumption statistics of the wireless mobile network communication module, different power statistics information updating methods should be used for different types of power consumption. In view of this, the embodiments of the present disclosure provide another power statistics information updating method.

[0078] Figure 4 is a flow chart showing another method for updating power statistics information according to an exemplary embodiment. Figure 4 As shown, the following steps are included.

[0079] In step S21 , the type of power consumption is determined.

[0080] In the embodiment of the present disclosure, the power consumption type includes at least one of the following: power consumption based on power supply statistics, power consumption based on log statistics, and power consumption based on bandwidth estimation.

[0081] In step S22, based on the terminal state and the power consumption type, it is determined whether to update the power statistics information using the first method or the second method.

[0082] In the power statistics information updating method provided in the embodiment of the present disclosure, by selecting real-time or non-real-time updating of power statistics information according to the device terminal status and power consumption type, resource consumption can be further reduced and update efficiency can be improved.

[0083] In view of the situation of power consumption based on power supply statistics, the embodiment of the present disclosure provides another method for updating power statistics information.

[0084] Figure 5 FIG. 1 is a flow chart of another method for updating power statistics information according to an exemplary embodiment. Figure 5 As shown, the following steps are included.

[0085] In step S31, the terminal status is determined.

[0086] In step S32a, if the terminal is in the sleep state, the power statistics information is updated using the second method.

[0087] In the disclosed embodiment, if the terminal is in a sleep state, the user cannot know the power consumption of the terminal. If the user needs to know the power consumption of the terminal, the terminal needs to be awakened to make the terminal out of the sleep state. Therefore, if the terminal is in a sleep state, there is no need to access the interface to obtain real-time power statistics information, and the second method can be used to update the power statistics information.

[0088] In step S32b, if the terminal is not in the sleep state, it is determined whether to update the power statistics information in the first manner or in the second manner based on the attribute information of the application that issues the power statistics information update request.

[0089] In the disclosed embodiment, if the terminal is not in a sleep state, the user may need to obtain real-time power statistics information for power consumption based on power statistics. It is understandable that most applications can cause power consumption based on power statistics. However, different applications have different attribute information. And the user's urgency to obtain power statistics information for applications with different attribute information is different. For applications with certain attribute information, the user will not be eager to know the power statistics information of these applications. For these applications, the second method can be used to update the power statistics information. For applications with certain other attributes, the user will be eager to know the power statistics information of these applications. Therefore, it is necessary to use the first method to update the power statistics information.

[0090] In the method for updating power statistics information provided by the embodiment of the present disclosure, for the case of power consumption based on power supply statistics, the method for updating power statistics information is flexibly selected according to the terminal device state and application program attributes, thereby improving the accuracy and real-time performance of power statistics information. When the terminal device is in a sleep state, the second method is used to update the power statistics information, thereby avoiding waste of resources and reducing energy consumption. In a non-sleep state, the first method is used to update the power statistics information, thereby ensuring the accuracy of the power statistics information and effectively improving the performance of the device.

[0091] In the above embodiment, for applications with certain attribute information, the second method is used to update the power statistics information. However, although the user is not eager to know the power statistics information of these applications, the terminal needs to obtain the real-time power statistics information of these applications every once in a while. In view of this, the embodiment of the present disclosure provides another method for updating power statistics information.

[0092] Figure 6 FIG. 1 is a flow chart of another method for updating power statistics information according to an exemplary embodiment. Figure 6 As shown, the following steps are included.

[0093] In step S41, the terminal status is determined.

[0094] In step S42a, if the terminal is in the sleep state, the power statistics information is updated using the second method.

[0095] The above steps have been Figure 5 The corresponding embodiments are described in detail and will not be repeated here.

[0096] In step S42b1, if the terminal state is not the sleep state, a frequency control rule is generated based on the attribute information of the application that issues the power statistics information update request and the terminal state.

[0097] In step S42b2, based on the frequency control rule, it is determined whether to update the power statistics information in the first manner or in the second manner.

[0098] In the disclosed embodiment, a frequency control rule is generated based on the attribute information of the application that issues the power statistics information update request and the terminal state, and the frequency control rule indicates the frequency of using the first method. Based on the frequency control rule, for applications with certain attribute information, among multiple power statistics information update requests, the first method is used to update the power statistics information for some of the requests, and the second method is used to update the power statistics information for the other requests. In this way, it can be ensured that the terminal can obtain the real-time power statistics information of these applications at a certain moment in a period of time.

[0099] In the method for updating power statistics information provided by the embodiment of the present disclosure, a frequency control rule is generated according to the application attributes and the terminal device status, and based on the frequency control rule, the first method or the second method is selectively used to update the power statistics information. This strategy can not only avoid resource waste and reduce energy consumption, but also ensure that the terminal can obtain the power statistics information of these applications in real time.

[0100] In the above embodiment, only the method of updating the power statistics information using the first method for some of the multiple power statistics information update requests and using the second method for the other part of the requests is disclosed, but it is not disclosed how to determine whether to use the first method or the second method to update the power statistics information for a certain power statistics information update request received. In view of this, the embodiment of the present disclosure provides another method for updating power statistics information.

[0101] Figure 7 is a flow chart of another method for updating power statistics information according to an exemplary embodiment. Figure 7 As shown, the following steps are included.

[0102] In step S51, the terminal status is determined.

[0103] In step S52a, if the terminal is in the sleep state, the power statistics information is updated using the second method.

[0104] In step S52b, if the terminal state is not the sleep state, a frequency control rule is generated based on the attribute information of the application that issues the power statistics information update request and the terminal state.

[0105] The above steps have been Figure 5 The corresponding embodiments are described in detail and will not be repeated here.

[0106] In step S53a, if the current updating of the power statistics information meets the frequency of using the first method, it is determined to use the first method to update the power statistics information.

[0107] In step S53b, if the current update of the power statistics information does not meet the frequency of using the first method, it is determined to use the second method to update the power statistics information.

[0108] In the method for updating power statistics information provided by the embodiment of the present disclosure, the updating strategy of power statistics information is dynamically adjusted according to the application attributes and the terminal device status, and the judgment logic of updating power statistics information is further refined. When a power statistics information update request is received once, it is determined by a specific frequency control rule whether to use the first method or the second method for updating. This improvement helps to further balance system performance and user experience and avoid unnecessary system resource pressure.

[0109] In view of the situation of power consumption based on bandwidth estimation, the embodiment of the present disclosure provides another method for updating power statistics information.

[0110] Figure 8 is a flow chart showing another method for updating power statistics information according to an exemplary embodiment. Figure 8 As shown, the following steps are included.

[0111] In step S61, the terminal status is determined.

[0112] In step S62a, if the terminal is in the sleep state, the power statistics information is updated using the second method.

[0113] The above steps have been Figure 5 The corresponding embodiments are described in detail and will not be described again here.

[0114] In step S62b, if the terminal is in the screen-off state, the power statistics information is updated using the second method.

[0115] In step S62c, if the terminal is in the screen-on state, the power statistics information is updated using the first method.

[0116] It is understandable that the bandwidth estimation is performed only when the terminal is in the screen-on state. Therefore, for the power consumption based on bandwidth estimation, it is necessary to use the first method to update the power statistics information only when the terminal is in the screen-on state. When the terminal is in the screen-off state or sleep state, the second method can be used to update the power statistics information.

[0117] In the method for updating power statistics information provided by the embodiment of the present disclosure, for the case of power consumption based on bandwidth estimation, the method for updating power statistics information is flexibly selected according to the terminal device state attributes to improve the accuracy and real-time performance of power statistics information. When the terminal device is not in the screen-on state, the second method is used to update the power statistics information, thereby avoiding waste of resources and reducing energy consumption. When the terminal device is in the screen-on state, the first method is used to update the power statistics information. This can not only ensure the accuracy of the power statistics information, but also effectively improve the performance of the device.

[0118] In view of the situation of power consumption based on log statistics, the embodiment of the present disclosure provides another method for updating power statistics information.

[0119] Fig. 9 is a flow chart of another method for updating power statistics information according to an exemplary embodiment. Fig. 9 As shown, the following steps are included.

[0120] In step S71, the terminal status is determined.

[0121] In step S72a, if the terminal is in the sleep state, the power statistics information is updated using the second method.

[0122] The above steps have been Figure 5 The corresponding embodiments are described in detail and will not be described again here.

[0123] In step S72b, if the terminal is in the screen-off state, the power statistics information is updated using the first method.

[0124] In step S72c, if the terminal is in the screen-on state, the power statistics information is updated using the first method.

[0125] It is understandable that the log statistics will be stopped only when the terminal is in sleep state. Therefore, for the power consumption based on log statistics, it is necessary to use the second method to update the power statistics information only when the terminal is in sleep state. When the terminal is in the screen off state or the screen on state, the first method can be used to update the power statistics information.

[0126] In the method for updating power statistics information provided by the embodiment of the present disclosure, for the case of power consumption based on log statistics, the method for updating power statistics information is flexibly selected according to the state attributes of the terminal device, thereby improving the accuracy and real-time performance of the power statistics information. When the terminal device is in a sleep state, the second method is used to update the power statistics information, thereby avoiding waste of resources and reducing energy consumption. When the terminal device is not in a sleep state, the first method is used to update the power statistics information. This can not only ensure the accuracy of the power statistics information, but also effectively improve the performance of the device.

[0127] Based on the same concept, an embodiment of the present disclosure also provides a device for updating power statistics information.

[0128] It is understandable that in order to realize the above functions, a power statistics information updating device provided by the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.

[0129] Fig.10 is a block diagram of a device for updating power statistics information according to an exemplary embodiment. Fig.10 As shown, the device includes a determining unit 101 and a processing unit 102 .

[0130] The determining unit 101 is used to determine the terminal state in response to determining that the modem of the electronic device receives a power statistics information update request, where the power statistics information update request is used to request to update the power consumption of the electronic device during wireless mobile network communication.

[0131] The processing unit 102 is used to determine whether to update the power statistics information using a first method or a second method based on the terminal state. The first method includes: obtaining the power statistics information at the current moment through the modem, and updating the power statistics information based on the power statistics information at the current moment. The second method includes: obtaining the most recently counted power statistics information before the current moment, and updating the power statistics information based on the counted power statistics information.

[0132] In one embodiment, the processing unit 102 determines to update the power statistics information in the first manner or in the second manner based on the terminal state in the following manner, including: determining to update the power statistics information in the first manner or in the second manner based on the terminal state and the power consumption type. The power consumption type includes at least one of the following: power consumption based on power supply statistics, power consumption based on log statistics, and power consumption based on bandwidth estimation.

[0133] In one embodiment, the power consumption type includes power consumption based on power statistics. The processing unit 102 determines whether to update the power statistics information in the first manner or in the second manner based on the terminal state and the power consumption type in the following manner, including at least one of the following: if the terminal state is a sleep state, the power statistics information is updated in the second manner. If the terminal state is not a sleep state, it is determined whether to update the power statistics information in the first manner or in the second manner based on the attribute information of the application that issues the power statistics update request.

[0134] In one embodiment, the processing unit 102 determines whether to update the power statistics information in the first manner or in the second manner based on the attribute information of the application that issues the power statistics information update request in the following manner, including: generating a frequency control rule based on the attribute information of the application that issues the power statistics information update request and the terminal state, the frequency control rule indicating the frequency of using the first manner. Based on the frequency control rule, determining whether to update the power statistics information in the first manner or in the second manner.

[0135] In one embodiment, the processing unit 102 determines whether to update the power statistics information in the first manner or in the second manner based on the frequency control rule in the following manner, including: if the current update of the power statistics information meets the frequency of using the first manner, then determine to update the power statistics information in the first manner. If the current update of the power statistics information does not meet the frequency of using the first manner, then determine to update the power statistics information in the second manner.

[0136] In one embodiment, the power consumption type includes power consumption based on bandwidth estimation. The processing unit 102 determines whether to update the power statistics information using the first method or the second method based on the terminal state and the power consumption type in the following manner, including at least one of the following: if the terminal state is a sleep state, the power statistics information is updated using the second method. If the terminal state is a screen-off state, the power statistics information is updated using the second method. If the terminal state is a screen-on state, the power statistics information is updated using the first method.

[0137] In one embodiment, the power consumption type includes power consumption based on log statistics. The processing unit 102 determines whether to update the power statistics information using the first method or the second method based on the terminal state and the power consumption type in the following manner, including at least one of the following: if the terminal state is a sleep state, the power statistics information is updated using the second method. If the terminal state is a screen-off state, the power statistics information is updated using the first method. If the terminal state is a screen-on state, the power statistics information is updated using the first method.

[0138] Fig.11 FIG. 1 is a schematic diagram of a device for updating power statistics information according to an exemplary embodiment. Fig.11 As shown, the power statistics information updating device updates the power statistics information in the following manner.

[0139] The communication module calls the interface of the data tracking module to collect data, including collecting information such as the application package name, access times and access time of the calling interface.

[0140] In the disclosed embodiment, information such as the application package name, access count, and access time is the attribute information of the application.

[0141] The data tracking module sends the collected information such as the application package name, access times and access time of the calling interface and the generated rules to the cloud control module. The cloud control module analyzes this data and generates access frequency control rules.

[0142] In the disclosed embodiment, the generation rule is stored in the data embedding module. The rule is used to generate the access frequency control rule. The access frequency control rule is generated by the cloud control module. The purpose of this is to save terminal computing resources and reduce power consumption.

[0143] The cloud control module sends the generated frequency control rules to the access optimization module.

[0144] In the disclosed embodiment, the access optimization module loads the frequency control rules for subsequent optimization.

[0145] The access optimization module will update the sleep mode status and screen status in real time, and accept the frequency control rules issued by the cloud control.

[0146] When receiving the request from the power statistics module to access the Modem to update the power statistics information, the power statistics module accesses the optimization module to start the power optimization work.

[0147] In the embodiment of the present disclosure, the power consumption type of the power statistics module is power consumption based on power statistics.

[0148] If the current mode is sleep mode, accessing the optimization module will directly perform optimization using the power statistics information cached last time.

[0149] In the embodiment of the present disclosure, directly performing optimization and using the power statistics information cached last time is to update the power statistics information using the second method.

[0150] If the current mode is not sleep mode, the access optimization module will further process the frequency control logic.

[0151] In non-sleep mode and when frequency control is required, the access optimization module executes different optimized instructions at different frequencies according to the current screen status and the frequency control rules issued by the cloud control.

[0152] When the mode is not in sleep mode and frequency control is not required, the access optimization module sends a request to the communication module to update the power statistics information.

[0153] After receiving the request to update the power statistics information, the communication module will send a request to the Modem to obtain the latest power statistics information.

[0154] In the embodiment of the present disclosure, sending a request to the modem to obtain the latest power statistics information is to update the power statistics information using the first method.

[0155] The modem returns the latest power statistics information to the communication module.

[0156] After acquiring the power statistics information, the access optimization module sends the optimized power statistics information or the latest power statistics information back to the power statistics module.

[0157] For the log statistics module to access the Modem power statistics information: the log statistics module enters the access optimization module and starts the optimization work. This process is similar to the optimization work of the power statistics module, and it will also have different behaviors according to the current sleep mode state.

[0158] In the disclosed embodiment, the power consumption type of the log statistics module is power consumption based on log statistics.

[0159] If the current mode is sleep mode, accessing the optimization module will directly perform optimization using the power statistics information cached last time.

[0160] In non-sleep mode, the access optimization module sends a request to the communication module to update the power statistics information.

[0161] After receiving the request to update the power statistics information, the communication module will send a request to the Modem to obtain the latest power statistics information.

[0162] The modem returns the latest power statistics information to the communication module.

[0163] After obtaining the power statistics information, the access optimization module sends the optimized power statistics information or the latest power statistics information back to the log statistics module.

[0164] In the disclosed embodiment, the optimization of the three calling modules, namely, the bandwidth estimation module, the power statistics module and the log statistics module, is as follows: the sleep mode is a mode with lower power consumption than the screen-off state, and its conditions include the screen-off for more than a certain period of time, uncharged, at night and low light intensity, etc., to ensure that the mobile phone is in the sleep state. Since the bandwidth estimation module does not access the resource interface in the screen-off state, it needs to access the Modem power statistics information in the screen-on state to perform bandwidth estimation. No restrictions are imposed on the module call and no optimization is performed. There are three cases for the power statistics module, namely, sleep mode, screen-off state and screen-on state. Cache optimization is performed in sleep mode, and the update is updated once after exiting the sleep mode, which has no impact or perception on the user. In the case of screen-off and screen-on, update permissions are given at a certain frequency according to the frequency control rules of cloud control big data statistics, and access is more frequent in the case of screen-on state. There are two cases for the log statistics module, namely, sleep mode and non-sleep mode. Cache optimization is performed in sleep mode, and the update is updated once after exiting the sleep mode, which has no impact or perception on the user. No optimization is required in non-sleep mode to ensure the recording of battery logs.

[0165] Based on the energy statistics information updating device provided in the embodiment of the present disclosure, the Modem wake-up phenomenon of each machine is reduced by 11% on average, and this reduction ratio is based on all applications accessing the Modem power statistics information resource.

[0166] In order to explain this conclusion in more detail, an embodiment of the present disclosure provides a statistical graph of the number of accesses to daily electricity statistical information.

[0167] Fig.12 is a statistical graph showing the number of daily accesses to electricity statistics information according to an exemplary real-time example. Fig.12 In the above table, success means that the power statistics information is updated successfully, while optimization means that the power statistics information is not updated successfully but is optimized.

[0168] Depend on Fig.12 It can be seen that the Modem wake-up phenomenon is reduced by 11% on average for each machine. This means that the optimization scheme has achieved significant results in large-scale applications and has made a significant contribution to reducing the power consumption of Modem wake-up.

[0169] Fig.13 1 is a block diagram of an apparatus 200 for updating power statistics information according to an exemplary embodiment. For example, the apparatus 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0170] See also Fig.13, the device 200 may include one or more of the following components: a processing component 202 , a memory 204 , a power component 206 , a multimedia component 208 , an audio component 210 , an input / output (I / O) interface 212 , a sensor component 214 , and a communication component 216 .

[0171] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.

[0172] The memory 204 is configured to store various types of data to support operations on the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0173] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 200.

[0174] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0175] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC), and when the device 200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 204 or sent via the communication component 216. In some embodiments, the audio component 210 also includes a speaker for outputting audio signals.

[0176] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0177] The sensor assembly 214 includes one or more sensors for providing various aspects of the status assessment of the device 200. For example, the sensor assembly 214 can detect the open / closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, and the sensor assembly 214 can also detect the position change of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200, and the temperature change of the device 200. The sensor assembly 214 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 214 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0178] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0179] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0180] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, and the instructions can be executed by the processor 220 of the device 200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0181] It is to be understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.

[0182] It is further understood that the terms "first", "second", etc. are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a specific order or degree of importance. In fact, the expressions "first", "second", etc. can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.

[0183] It can be further understood that, unless otherwise specified, “connection” includes a direct connection without other components between the two, and also includes an indirect connection with other components between the two.

[0184] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order shown or in a serial order, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.

[0185] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.

[0186] It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.

Claims

1. A method for updating power statistics information, characterized in that: include: In response to determining that a modem of the electronic device receives a power statistics information update request, determining a terminal state, wherein the power statistics information update request is used to request an update of power consumption of the electronic device during wireless mobile network communication; Based on the terminal state, determining to update the power statistics information using a first method or using a second method; The first method includes: obtaining power statistics information at a current moment through the modem, and updating the power statistics information based on the power statistics information at the current moment; The second method includes: obtaining the most recently counted power statistical information before the current moment, and updating the power statistical information based on the most recently counted power statistical information.

2. The method for updating power statistics information according to claim 1, characterized in that: The determining, based on the terminal state, to update the power statistics information in a first manner or in a second manner includes: Based on the terminal state and the power consumption type, determining to update the power statistics information using a first method or using a second method; The power consumption type includes at least one of the following: power consumption based on power supply statistics, power consumption based on log statistics, and power consumption based on bandwidth estimation.

3. The method for updating power statistics information according to claim 2, characterized in that: The power consumption type includes power consumption based on power supply statistics; The determining, based on the terminal state and the power consumption type, to update the power statistics information in a first manner or in a second manner comprises at least one of the following: If the terminal is in a sleep state, the power statistics information is updated using a second method; If the terminal state is not the sleep state, it is determined whether to update the power statistics information in the first manner or in the second manner based on the attribute information of the application program that issues the power statistics information update request.

4. The method for updating power statistics information according to claim 3, characterized in that: The determining, based on the attribute information of the application program that issues the request for updating the power statistics information, to update the power statistics information in the first manner or in the second manner comprises: generating a frequency control rule based on the attribute information of the application program that issues the power statistics information update request and the terminal state, wherein the frequency control rule indicates the frequency of using the first mode; Based on the frequency control rule, it is determined whether to update the power statistics information in the first manner or in the second manner.

5. The method for updating power statistics information according to claim 4, wherein determining whether to update the power statistics information in the first manner or in the second manner based on the frequency control rule comprises: If the current update of the power statistics information meets the frequency of using the first method, determine to use the first method to update the power statistics information; If the current updating of the power statistics information does not meet the frequency of using the first method, it is determined to use the second method to update the power statistics information.

6. The method for updating power statistics information according to claim 2, characterized in that: The power consumption type includes power consumption based on bandwidth estimation; The determining, based on the terminal state and the power consumption type, to update the power statistics information in a first manner or in a second manner comprises at least one of the following: If the terminal is in a sleep state, the power statistics information is updated using a second method; If the terminal is in a screen-off state, the power statistics information is updated using the second method; If the terminal is in a screen-on state, the power statistics information is updated using a first method.

7. The method for updating power statistics information according to claim 2, characterized in that: The power consumption type includes power consumption based on log statistics; The determining, based on the terminal state and the power consumption type, to update the power statistics information in a first manner or in a second manner comprises at least one of the following: If the terminal is in a sleep state, the power statistics information is updated using a second method; If the terminal is in a screen-off state, the power statistics information is updated using the first method; If the terminal is in a screen-on state, the power statistics information is updated using a first method.

8. A device for updating power statistics information, characterized in that: include: a determining unit, configured to determine a terminal state in response to determining that a modem of the electronic device receives a power statistics information update request, wherein the power statistics information update request is used to request an update of power consumption of the electronic device during wireless mobile network communication; a processing unit, configured to determine, based on the terminal state, whether to update the power statistics information in a first manner or in a second manner; The first method includes: obtaining power statistics information at a current moment through the modem, and updating the power statistics information based on the power statistics information at the current moment; The second method includes: obtaining the most recently counted power statistical information before the current moment, and updating the power statistical information based on the most recently counted power statistical information.

9. The device for updating power statistics information according to claim 8, characterized in that: The processing unit determines, based on the terminal state, whether to update the power statistics information in the first manner or in the second manner: Based on the terminal state and the power consumption type, determining to update the power statistics information using a first method or using a second method; The power consumption type includes at least one of the following: power consumption based on power supply statistics, power consumption based on log statistics, and power consumption based on bandwidth estimation.

10. The device for updating power statistics information according to claim 9, characterized in that: The power consumption type includes power consumption based on power supply statistics; The processing unit determines, based on the terminal state and the power consumption type, whether to update the power statistics information in a first manner or in a second manner by using at least one of the following methods, including: If the terminal is in a sleep state, the power statistics information is updated using a second method; If the terminal state is not the sleep state, it is determined whether to update the power statistics information in the first manner or in the second manner based on the attribute information of the application program that issues the power statistics information update request.

11. The device for updating power statistics information according to claim 10, characterized in that: The processing unit determines to update the power statistics information in the first manner or in the second manner based on the attribute information of the application program that issues the power statistics information update request in the following manner: generating a frequency control rule based on the attribute information of the application program that issues the power statistics information update request and the terminal state, wherein the frequency control rule indicates the frequency of using the first mode; Based on the frequency control rule, it is determined whether to update the power statistics information in the first manner or in the second manner.

12. The apparatus for updating power statistics information according to claim 11, wherein the processing unit determines whether to update the power statistics information in the first manner or in the second manner based on the frequency control rule in the following manner: If the current update of the power statistics information meets the frequency of using the first method, determine to use the first method to update the power statistics information; If the current updating of the power statistics information does not meet the frequency of using the first method, it is determined to use the second method to update the power statistics information.

13. The device for updating power statistics information according to claim 9, characterized in that: The power consumption types include power consumption based on bandwidth estimation; The processing unit determines, based on the terminal state and the power consumption type, whether to update the power statistics information in a first manner or in a second manner by using at least one of the following methods, including: If the terminal is in a sleep state, the power statistics information is updated using a second method; If the terminal is in a screen-off state, the power statistics information is updated using the second method; If the terminal is in a screen-on state, the power statistics information is updated using a first method.

14. The device for updating power statistics information according to claim 9, characterized in that: The power consumption type includes power consumption based on log statistics; The processing unit determines, based on the terminal state and the power consumption type, whether to update the power statistics information in a first manner or in a second manner by using at least one of the following methods, including: If the terminal is in a sleep state, the power statistics information is updated using a second method; If the terminal is in a screen-off state, the power statistics information is updated using the first method; If the terminal is in a screen-on state, the power statistics information is updated using a first method.

15. A device for updating power statistics information, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to: execute the method described in any one of claims 1 to 7.

16. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions in the storage medium are executed by a processor of the terminal, the terminal is enabled to execute the method according to any one of claims 1 to 7.