Method and device for displaying available duration of battery, electronic equipment and storage medium
By using the battery's historical usage data to determine the discharge parameters when the battery's visible power is lower than the preset threshold, the battery's available time is solved, and the problem of inaccurate prediction of battery usage time in the prior art is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202311169907.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, due to inaccurate residual power, discharge power or discharge current of the battery, the prediction of the battery life time is inaccurate, and the user experience is poor.
By displaying the available time of the battery in response to the battery's visible power level below the preset threshold, the battery's historical usage data is used to determine the discharge parameters, and the available time is calculated in combination with the current remaining power level and discharge parameters.
Improves the accuracy of battery life, allowing users to more accurately understand the available battery life, thereby improving the user experience.
Smart Images

Figure CN119596146A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of battery technology, and in particular to a method, device, electronic device and storage medium for displaying the usable life of a battery. Background Art
[0002] Electronic devices have become an indispensable part of people's work and life. People use electronic devices to realize various functions, and the battery power is consumed very quickly. In order to enable users to understand the battery usage, the battery life can be predicted. In the related art, due to the inaccurate remaining battery power and discharge power or discharge current, the predicted battery life is inaccurate, and the user experience is poor. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a method, device, electronic device and storage medium for displaying the usable life of a battery.
[0004] According to a first aspect of an embodiment of the present disclosure, a method for displaying the available time of a battery is provided, the method comprising:
[0005] In response to the visible power level of the battery being lower than a preset threshold, displaying the usable time of the battery;
[0006] Among them, the available time is determined based on the current remaining power and discharge parameters of the battery, and the discharge parameters are determined based on the historical usage data of the battery. The historical usage data is used to characterize the historical discharge parameters of the battery under different visible power levels during the historical use of the battery.
[0007] In some embodiments, the process of determining the discharge parameters includes:
[0008] In response to the battery being in the first operating mode, the average value of M historical discharge parameters in the historical usage data is determined as the discharge parameter; wherein M is greater than or equal to 1, and the M historical discharge parameters are historical discharge parameters of each historical visible power in the first power range, and the upper limit value of the first power range is the current visible power of the battery, and the lower limit value is a preset power.
[0009] In some embodiments, the current visible power of the battery corresponds to N second power ranges, where N is greater than or equal to 1, and the upper limit value of the N second power ranges is the current visible power of the battery, and the lower limit value is a preset power; the process of determining the discharge parameter of each second power range includes:
[0010] In response to the battery being in the first operating mode, an average value of K historical discharge parameters corresponding to the second power range in the historical usage data is determined as the discharge parameter; wherein K is greater than or equal to 1.
[0011] In some embodiments, the method further comprises:
[0012] The N second power ranges are divided according to a preset rule and the current visible power of the battery.
[0013] In some embodiments, the process of determining the discharge parameters includes:
[0014] In response to the battery being in the second operating mode, determining an average value of M historical discharge parameters in the historical usage data; wherein M is greater than or equal to 1, and the M historical discharge parameters are historical discharge parameters of each historical visible power in a first power range, and an upper limit value of the first power range is the current visible power of the battery, and a lower limit value is a preset power;
[0015] When the average value of the M historical discharge parameters is less than or equal to the upper limit discharge parameter in the second operation mode, the average value of the M historical discharge parameters is determined as the discharge parameter; or,
[0016] When the average value of the M historical discharge parameters is greater than the upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter.
[0017] In some embodiments, the current visible power level of the battery corresponds to N second power level ranges, where N is greater than or equal to 1, and the upper limit value of the N second power level ranges is the current visible power level of the battery, and the lower limit value is a preset power level;
[0018] The process of determining the discharge parameter of each of the second power ranges includes:
[0019] In response to the battery being in the second operating mode, determining an average value of K historical discharge parameters corresponding to the second power range in the historical usage data; wherein K is greater than or equal to 1;
[0020] When the average value of the K historical discharge parameters corresponding to the second power range is less than or equal to the corresponding upper limit discharge parameter, the average value of the K historical discharge parameters is determined as the discharge parameter; or,
[0021] When an average value of K historical discharge parameters corresponding to the second power range is greater than a corresponding upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter.
[0022] In some embodiments, the process of determining the available time includes:
[0023] The available time is determined based on the discharge parameters of each of the second power ranges, the remaining power and the power ratio corresponding to each of the second power ranges; wherein the power ratio corresponding to the second power range is used to characterize the proportion of the available power corresponding to the second power range in the remaining power.
[0024] In some embodiments, determining the available time according to the discharge parameter of each second power range, the remaining power, and the power ratio corresponding to each second power range includes:
[0025] Determine the available power corresponding to each second power range by multiplying the remaining power by the power proportion corresponding to each second power range;
[0026] The sum of the ratios of the available power corresponding to the plurality of the second power ranges to the corresponding discharge parameters is determined as the available time.
[0027] In some embodiments, the method further comprises:
[0028] For each second power range, based on the historical usage data, determine a historical power difference and a historical remaining power corresponding to the second power range, wherein the historical power difference is a difference between a first historical power corresponding to an upper limit value of the second power range and a second historical power corresponding to a lower limit value of the second power range, and the historical remaining power is the remaining power of the battery when the historical visible power is the current visible power;
[0029] The ratio of the historical power difference to the historical remaining power is determined as the power proportion corresponding to the second power range.
[0030] In some embodiments, the method further comprises:
[0031] The remaining power is determined according to the discharge parameter of the third power range.
[0032] According to a second aspect of an embodiment of the present disclosure, a device for displaying the usable duration of a battery is provided, the device comprising:
[0033] an available time display module, configured to display the available time of the battery in response to the visible power level of the battery being lower than a preset threshold;
[0034] Among them, the available time is determined based on the current remaining power and discharge parameters of the battery, and the discharge parameters are determined based on the historical usage data of the battery. The historical usage data is used to characterize the historical discharge parameters of the battery under different visible power levels during the historical use of the battery.
[0035] In some embodiments, the apparatus further comprises:
[0036] The parameter acquisition module is configured to determine the discharge parameter as the average value of M historical discharge parameters in the historical usage data in response to the battery being in the first operating mode; wherein M is greater than or equal to 1, and the M historical discharge parameters are historical discharge parameters of each historical visible power in the first power range, and the upper limit value of the first power range is the current visible power of the battery, and the lower limit value is a preset power.
[0037] In some embodiments, the current visible power of the battery corresponds to N second power ranges, where N is greater than or equal to 1, and the upper limit value of the N second power ranges is the current visible power of the battery, and the lower limit value is a preset power; the device further includes:
[0038] The parameter acquisition module is configured to determine the average value of K historical discharge parameters corresponding to the second power range in the historical usage data as the discharge parameter in response to the battery being in the first operating mode; wherein K is greater than or equal to 1.
[0039] In some embodiments, the apparatus further comprises:
[0040] The range division module is configured to divide the N second power ranges according to a preset rule and the current visible power of the battery.
[0041] In some embodiments, the apparatus further comprises:
[0042] The parameter acquisition module is configured as follows:
[0043] In response to the battery being in the second operating mode, determining an average value of M historical discharge parameters in the historical usage data; wherein M is greater than or equal to 1, and the M historical discharge parameters are historical discharge parameters of each historical visible power in a first power range, and an upper limit value of the first power range is the current visible power of the battery, and a lower limit value is a preset power;
[0044] When the average value of the M historical discharge parameters is less than or equal to the upper limit discharge parameter in the second operation mode, the average value of the M historical discharge parameters is determined as the discharge parameter; or,
[0045] When the average value of the M historical discharge parameters is greater than the upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter.
[0046] In some embodiments, the current visible power of the battery corresponds to N second power ranges, where N is greater than or equal to 1, and the upper limit value of the N second power ranges is the current visible power of the battery, and the lower limit value is a preset power; the device further includes:
[0047] The parameter acquisition module is configured as follows:
[0048] In response to the battery being in the second operating mode, determining an average value of K historical discharge parameters corresponding to the second power range in the historical usage data; wherein K is greater than or equal to 1;
[0049] When the average value of the K historical discharge parameters corresponding to the second power range is less than or equal to the corresponding upper limit discharge parameter, the average value of the K historical discharge parameters is determined as the discharge parameter; or,
[0050] When an average value of K historical discharge parameters corresponding to the second power range is greater than a corresponding upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter.
[0051] In some embodiments, the apparatus further comprises:
[0052] The duration determination module is configured to determine the available duration based on the discharge parameters of each of the second power ranges, the remaining power and the power ratio corresponding to each of the second power ranges; wherein the power ratio corresponding to the second power range is used to characterize the proportion of the available power corresponding to the second power range in the remaining power.
[0053] In some embodiments, the duration determination module is configured to:
[0054] Determine the available power corresponding to each second power range by multiplying the remaining power by the power proportion corresponding to each second power range;
[0055] The sum of the ratios of the available power corresponding to the plurality of the second power ranges to the corresponding discharge parameters is determined as the available time.
[0056] In some embodiments, the apparatus further comprises:
[0057] a historical power acquisition module, configured to determine, for each second power range, a historical power difference and a historical remaining power corresponding to the second power range based on the historical usage data, wherein the historical power difference is a difference between a first historical power corresponding to an upper limit value of the second power range and a second historical power corresponding to a lower limit value of the second power range, and the historical remaining power is the remaining power of the battery when the historical visible power is the current visible power;
[0058] The power proportion determination module is configured to determine the ratio of the historical power difference to the historical remaining power as the power proportion corresponding to the second power range.
[0059] In some embodiments, the apparatus further comprises:
[0060] The power determination module is configured to determine the remaining power according to the discharge parameters of the third power range.
[0061] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0062] processor;
[0063] a memory for storing processor-executable instructions;
[0064] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.
[0065] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect of the embodiment of the present disclosure.
[0066] The above method of the present disclosure has the following beneficial effects:
[0067] The method provided by the embodiment of the present disclosure displays the available time of the battery in response to the visible power level of the battery being lower than a preset threshold value; wherein the available time is determined based on the current remaining power level of the battery and the discharge parameters, and the discharge parameters are determined based on the historical usage data of the battery, and the historical usage data is used to characterize the historical discharge parameters of the battery at different visible power levels during its historical use. The discharge parameters determined based on the historical usage data of the battery take into account the user's usage habits and more accurately represent the battery's usage at the remaining power level, thereby determining a more accurate available time of the battery. When the available time is displayed to the user, the user can be informed of a more accurate available time, thereby improving the user experience.
[0068] 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
[0069] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0070] Figure 1is a schematic diagram showing the capacities corresponding to different cut-off voltages and different discharge currents in a low temperature environment according to an exemplary embodiment;
[0071] Figure 2 is a schematic diagram showing the capacities corresponding to different cut-off voltages and different discharge currents in a normal temperature environment according to an exemplary embodiment;
[0072] Figure 3 is a flow chart showing a method for displaying the usable duration of a battery according to an exemplary embodiment;
[0073] Figure 4 is a flow chart showing another method for displaying the usable duration of a battery according to an exemplary embodiment;
[0074] Figure 5 is a flow chart showing another method for displaying the usable duration of a battery according to an exemplary embodiment;
[0075] Figure 6 is a flow chart showing another method for displaying the usable duration of a battery according to an exemplary embodiment;
[0076] Figure 7 is a flow chart showing another method for displaying the usable duration of a battery according to an exemplary embodiment;
[0077] Figure 8 is a block diagram of a device for displaying the usable life of a battery according to an exemplary embodiment;
[0078] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0079] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0080] The parameters for calculating the usable time of the battery include: the remaining battery power R M and the predicted subsequent discharge power P M , the battery life is: t = R M / P M .
[0081] Remaining power R MIt is obtained by the simulation of the fuel gauge. Since the internal resistance of lithium batteries is higher when RSOC (Relative State Of Charge) is lower, that is, when RSOC is lower, the greater the load, the lower the battery output voltage. If the battery voltage drops to the system shutdown voltage of 3.4V under normal load, it can be switched to a smaller load than the normal load. At this time, the battery voltage will rebound slightly, and the voltage rebound will provide the system with longer additional battery life. For example, see Figure 1 The schematic diagram of the capacity corresponding to different cut-off voltages and different discharge currents in a low temperature environment is shown, or refer to Figure 2 The schematic diagram of the capacity corresponding to different cut-off voltages and different discharge currents in a normal temperature environment is shown. In a low temperature or normal temperature environment, at the same cut-off voltage, the smaller the discharge current (i.e., the lower the discharge power, the smaller the load), the larger the capacity that can be discharged by the battery (i.e., the more remaining power), and the longer the battery can be used. Moreover, at the same discharge current, the smaller the cut-off voltage, the larger the capacity that can be discharged by the battery, and the longer the battery can be used. In other words, in the final discharge stage, the lower the discharge power, the more remaining power the battery can discharge, and when switching from a larger load to a smaller load, the battery voltage will rebound.
[0082] In the related art, the power meter calculates the remaining power R M The method is: simulate according to the average discharge power of the first 4% of the power, the first 4% of the power refers to the 4% of the power before the current visible power, for example, the current visible power is 20, and the first 4% of the power is 20%-24%. However, when the power is low, most users will stop high-power loads (such as playing games, video chatting, etc.), and the lower the power, the more afraid the user is to shut down, and the frequency of using electronic devices will be lower; when the BCL (Battery Current Limit) mode is turned on, that is, the power saving mode is turned on, the lower the power, the lower the limited power usage. Therefore, using the average discharge power of the first 4% of the power to simulate the remaining power will result in a smaller simulated remaining power, which will result in a smaller calculated battery usable time.
[0083] Discharge power P M It is the predicted average discharge power in the next period. Currently, it uses the average discharge power in the previous period, and does not take into account the changes in user usage under low power and the BCL strategy. Therefore, the discharge power is too large, resulting in a shorter calculated battery life.
[0084] To sum up, in the related technology, the remaining power is too small and the discharge power is too large, so the calculated available battery life is too long and inaccurate. When the available time is displayed to the user, the user receives an erroneous available time, which affects the user's usage experience.
[0085] In response to the above-mentioned problems, the embodiments of the present disclosure take into account the user's usage habits and determine the discharge parameters and the remaining power to more accurately represent the battery usage under the remaining power, thereby determining the battery's available time more accurately, thereby improving the accuracy of the available time. When the available time is displayed to the user, the user can understand the more accurate available time, thereby improving the user experience.
[0086] The method for displaying the available battery life provided by the embodiment of the present disclosure is executed by an electronic device, which may be a mobile phone, a tablet computer, a laptop computer, a wearable device, a smart home device, or other device that includes a battery.
[0087] In the embodiment of the present disclosure, in response to the visible power level of the battery being lower than a preset threshold, the electronic device displays the available time of the battery, wherein the available time is determined based on the current remaining power level of the battery and the discharge parameter, and the discharge parameter is determined based on the historical usage data of the battery, and the historical usage data is used to characterize the historical discharge parameters of the battery at different visible power levels during the historical use of the battery.
[0088] Under the same visible power level, the battery usage this time is likely to be similar to the usage in the previous historical usage process. Then, the discharge parameters determined based on the historical usage data can more accurately represent the next discharge parameters. Therefore, compared with the related art, the average value of the discharge power in the previous period is taken as the next discharge parameter, and the discharge parameters determined based on the historical usage data are obviously more accurate. For the remaining power of the battery, the remaining power is simulated based on the discharge parameters, wherein the simulated remaining power will be different for different discharge parameters. Therefore, when more accurate discharge parameters are obtained, the simulated remaining power will also be more accurate. Therefore, after determining the accurate discharge parameters and remaining power, the available time determined based on the remaining power and discharge parameters is also more accurate. When the available time is displayed to the user, the user can understand the more accurate available time, which improves the user experience.
[0089] The process of determining the available time and displaying the available time is described in detail below through the following embodiments.
[0090] Figure 3 is a flow chart showing a method for displaying the available battery life according to an exemplary embodiment, which is executed by an electronic device, see Figure 3 , the method comprises the following steps:
[0091] Step S301 , in response to the visible power level of the battery being lower than a preset power level, a discharge parameter of the battery is determined based on historical usage data of the battery.
[0092] The visible power level of the battery is the power level displayed to the user, and the preset threshold is a preset value, for example, the preset threshold is 40%, 30%, 20%, etc. Optionally, the user may be more concerned about the available battery life when the battery is low, so the preset threshold can be set to a smaller value, so that when the battery is low, the available battery life is determined in the manner provided by the embodiment of the present disclosure, so that the user receives a more accurate available battery life.
[0093] In the embodiment of the present disclosure, considering that the discharge parameters of the battery are different in different operating modes, the corresponding discharge parameters are obtained for the operating mode the battery is currently in. Optionally, the operating mode is divided into a first operating mode and a second operating mode, the first operating mode may also be referred to as a non-power saving mode, and the second operating mode may also be referred to as a power saving mode, wherein the power saving mode refers to a mode for saving the battery power by limiting the discharge current or discharge power, and the non-power saving mode does not limit the discharge current or discharge power. Among them, the discharge parameter is the discharge current or discharge power.
[0094] In some embodiments, in the first operating mode, the discharge parameter determined based on the historical usage data is directly used as the discharge parameter of the battery. In the second operating mode, an upper limit discharge parameter is set. If the discharge determined based on the historical usage data is greater than the upper limit discharge parameter, the upper limit discharge parameter is used as the discharge parameter of the battery. If the discharge parameter determined based on the historical usage data is less than or equal to the upper limit discharge parameter, the discharge parameter determined based on the historical usage data is used as the discharge parameter of the battery.
[0095] Step S302: determining the current remaining power of the battery based on the discharge parameters.
[0096] Step S303, determining the usable time of the battery according to the discharge parameters and the remaining power.
[0097] The usable time of the battery is determined based on the ratio of the remaining power to the discharge parameter.
[0098] Step S304, displaying the available time.
[0099] The method provided by the embodiment of the present disclosure determines the discharge parameters based on the historical usage data of the battery, takes into account the user's usage habits, and more accurately represents the usage of the battery under the remaining power, so that the determined available battery life is more accurate. When the available time is displayed to the user, the user can understand the more accurate available time, thereby improving the user experience.
[0100] In some embodiments, in different operating modes, different methods are used to determine the discharge parameters corresponding to the battery.
[0101] Figure 4 is a flow chart showing another method for displaying the available battery life according to an exemplary embodiment, which is executed by an electronic device, see Figure 4 , the method comprises the following steps:
[0102] Step S401 , in response to the visible power level of the battery being lower than a preset threshold, determining the operating mode of the battery.
[0103] The operating mode of the battery is the first operating mode or the second operating mode.
[0104] In some embodiments, when it is detected that the power saving mode is turned on, it is determined that the battery is in the second operating mode, and when it is detected that the power saving mode is not turned on, it is determined that the battery is in the first operating mode.
[0105] When the battery is in the first operating mode, step S402 is executed, and when the battery is in the second operating mode, step S403 is executed.
[0106] Step S402: in response to the battery being in the first operation mode, determining an average value of M historical discharge parameters in the historical usage data as a discharge parameter of the battery.
[0107] In some embodiments, the average value of M historical discharge parameters in the historical usage data is determined as the discharge parameter; wherein M is greater than or equal to 1, and the M historical discharge parameters are historical discharge parameters for each historical visible power in the first power range, and the upper limit value of the first power range is the current visible power of the battery, and the lower limit value is the preset power. In other words, the historical discharge parameters of the battery under the same historical visible power as the current visible power and the subsequent historical visible power in the historical usage data are obtained, wherein the historical discharge parameters under different historical visible powers may be the same or different. Wherein, the preset power is 0%.
[0108] Optionally, taking into account that the historical discharge parameters may suddenly increase or decrease during historical use, when determining the discharge parameters, M+2 historical discharge parameters are obtained, and then the maximum and minimum values of the M+2 historical discharge parameters are removed, and then the remaining M historical discharge parameters are averaged to obtain the discharge parameters.
[0109] In some embodiments, historical usage data of the battery is obtained for L times, and for each historical usage data, the corresponding average values of M historical discharge parameters are obtained respectively, and then the L average values are averaged to obtain the discharge parameter. Optionally, considering that the historical discharge parameter may suddenly increase or decrease during the historical usage process, when determining the discharge parameter, L+2 historical usage data are obtained, and then the average value of the M historical discharge parameters corresponding to each historical usage data is determined, and then the maximum and minimum values of the L+2 average values are removed, and then the remaining L average values are averaged to obtain the discharge parameter.
[0110] Step S403, in response to the battery being in the second operating mode, determining an average value of M historical discharge parameters in the historical usage data, and determining a discharge parameter of the battery according to the average value of the M historical discharge parameters and an upper limit discharge parameter in the second operating mode.
[0111] The process of determining the average values of the M historical discharge parameters refers to the above step S402 and will not be described in detail here.
[0112] In some embodiments, the discharge parameter of the battery is determined according to the average value of M historical discharge parameters and the upper limit discharge parameter in the second operating mode, including: when the average value of the M historical discharge parameters is less than or equal to the upper limit discharge parameter in the second operating mode, the average value of the M historical discharge parameters is determined as the discharge parameter; when the average value of the M historical discharge parameters is greater than the upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter. In other words, the minimum value of the average value of the M historical discharge parameters and the upper limit discharge parameter is determined as the discharge parameter of the battery in the second operating mode, thereby ensuring that the discharge parameter is as small as possible in the second operating mode, so as to increase the usable time of the battery as much as possible.
[0113] Step S404: determining the current remaining power of the battery based on the discharge parameters.
[0114] In some embodiments, a current remaining capacity of the battery is obtained by simulating the discharge parameters through a power meter.
[0115] Step S405, determining the usable time of the battery according to the discharge parameters and the remaining power.
[0116] The ratio of the remaining power to the discharge parameter is used to determine the usable time of the battery.
[0117] Step S406, displaying the available time.
[0118] After the available time is obtained, the available time is displayed so that the user can check the available time to understand the battery usage.
[0119] It should be noted that, in some embodiments, when the visible power of the battery is less than or equal to a preset threshold, the discharge parameter corresponding to the mode in which the battery is located is obtained. That is, first determine whether the current visible power of the battery is less than or equal to the preset threshold, if the visible power is less than or equal to the preset threshold, then start to execute the above step S401, if the visible power is greater than the preset threshold, then do not execute the above step. The preset threshold is a preset value.
[0120] Optionally, when the battery level is high, the user does not worry about insufficient available time, but when the battery level is low, the user will pay more attention to the available battery time and hope that the available battery time is more accurate. Therefore, when the battery level is low, the available time can be determined using the method provided in the embodiment of the present disclosure, so that the preset threshold can be a smaller value, for example, the preset threshold is a smaller value such as 25%, 20%, 15%, etc.
[0121] In the method provided by the embodiment of the present disclosure, the discharge parameter is determined based on the user's historical usage or the upper limit discharge parameter in the second operating mode, taking into account the user's usage habits and the operating mode of the battery. The corresponding discharge parameters are used in different operating modes, which can more accurately represent the usage of the battery under the remaining power, so that the available time of the battery determined based on the discharge parameter and the remaining power is also more accurate, thereby improving the accuracy of the available time and enhancing the user experience.
[0122] In one example, Figure 4 The embodiment shown can be Figure 5 As shown, taking the preset threshold of 20% as an example, see Figure 5 , including the following steps:
[0123] 1. Make sure the visible power level of the electronic device is less than or equal to 20%.
[0124] 2. Determine whether the power saving mode is turned on. If the power saving mode is not turned on, go to step 3. If the power saving mode is turned on, go to step 4.
[0125] 3. Based on the historical usage data, determine the average value of M historical discharge parameters, and based on the average value of the M historical discharge parameters, determine the usable time of the battery.
[0126] The implementation of step 3 refers to the above steps S402 and S404-S405, which will not be repeated here.
[0127] 4. Based on the historical usage data, determine the average value of M historical discharge parameters, and obtain the upper limit discharge parameter in the power saving mode. Based on the average value of the M historical discharge parameters and the upper limit discharge parameter, determine the usable time of the battery.
[0128] The implementation of step 4 refers to the above steps S403-S405, which will not be described in detail here.
[0129] 5. Display the available time.
[0130] In some embodiments, the discharge parameters may be different within different power ranges. For example, when the visible power level of the battery is low, the user will try to reduce its usage as much as possible. That is, the higher the visible power level in the power range, the larger the discharge parameter, and the lower the visible power level in the power range, the smaller the discharge parameter. Therefore, in order to make the determined available time more accurate, corresponding discharge parameters are determined for each power range.
[0131] Figure 6 is a flow chart showing another method for displaying the available battery life according to an exemplary embodiment, which is executed by an electronic device, see Figure 6 , the method comprises the following steps:
[0132] Step S601 , in response to the visible power level of the battery being lower than a preset threshold, determining the operating mode of the battery.
[0133] The implementation of step S601 refers to the above step S401 and will not be described in detail here.
[0134] Step S602 , in response to the battery being in the first operating mode, for each second power range, an average value of K historical discharge parameters corresponding to the second power range in the historical usage data is determined as a discharge parameter.
[0135] In some embodiments, the current visible power of the battery corresponds to N second power ranges, where N is greater than or equal to 1, and the upper limit value of the N second power ranges is the current visible power of the battery, and the lower limit value is the preset power. For each second power range, the average value of the K historical discharge parameters corresponding to the second power range in the historical usage data is determined as the discharge parameter of the second power range; where K is greater than or equal to 1. That is, the discharge parameters of the battery include the discharge parameters of the N second power ranges.
[0136] Optionally, taking into account the possibility that historical discharge parameters may suddenly increase or decrease during historical use, for each second power range, when determining the discharge parameters of the second power range, N+2 historical discharge parameters corresponding to the second power range are obtained, and then the maximum and minimum values of the N+2 historical discharge parameters are removed, and then the remaining N historical discharge parameters are averaged to obtain the discharge parameters of the second power range.
[0137] In some embodiments, historical usage data of the battery is obtained for L times, and for each historical usage data, the average value of N historical discharge parameters corresponding to each second power range is obtained respectively, and then the L average values are averaged to obtain the discharge parameters of the second power range. Optionally, considering that the historical discharge parameters may suddenly increase or decrease during the historical use process, for each second power range, when determining the discharge parameters of the second power range, L+2 historical usage data are obtained, and then the average value of N historical discharge parameters corresponding to each historical usage data is determined, and then the maximum and minimum values of the L+2 average values are removed, and then the remaining L average values are averaged to obtain the discharge parameters of the second power range.
[0138] In some embodiments, N second power ranges are divided according to preset rules and the current visible power of the battery. The preset rule is to evenly divide the current visible power into N second power ranges, for example, if the current visible power is 20%, it can be divided into four power ranges of 20%-15%, 15%-10%, 10%-5% and 5-0%; or the current visible power is divided into N second power ranges in descending order, that is, the N second power ranges obtained by division are descending in order, for example, if the current visible power is 20%, it can be divided into four power ranges of 20%-5%, 5%-3%, 3%-1% and 0%.
[0139] Step S603, in response to the battery being in the second operating mode, for each second power range, determine the average value of K historical discharge parameters corresponding to the second power range in the historical usage data, and determine the discharge parameter based on the average value of the K historical discharge parameters and the corresponding upper limit discharge parameter.
[0140] The process of determining the average values of the K historical discharge parameters is as described in the above step S602, which will not be described in detail here. The current visible power of the battery corresponds to N second power ranges.
[0141] In some embodiments, for each second power range, when the average value of the K historical discharge parameters corresponding to the second power range is less than or equal to the corresponding upper limit discharge parameter, the average value of the K historical discharge parameters is determined as the discharge parameter of the second power range; or, when the average value of the K historical discharge parameters corresponding to the second power range is greater than the corresponding upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter of the second power range. That is to say, for each second power range, the minimum value of the average value of the K historical discharge parameters corresponding to the second power range and the corresponding upper limit discharge parameter is determined as the discharge parameter of the second power range in the second operating mode, thereby ensuring that in the second operating mode, the discharge parameter is as small as possible, so that the usable time of the battery is increased as much as possible.
[0142] Step S604: determining the current remaining power of the battery based on the discharge parameters of the third power range.
[0143] When simulating the remaining power, when the discharge parameter at the end of discharge is fixed, no matter how the discharge parameter changes during the discharge process, the discharge parameter at the end of discharge is fixed, and therefore, the current remaining power of the battery is simulated directly based on the discharge parameter of the third power range. The third power range is the smallest power range among the N second power ranges, for example, the third power range is 0%.
[0144] Step S605, the product of the remaining power and the power proportion corresponding to each second power range is determined as the available power corresponding to each second power range, and the sum of the ratios of the available power corresponding to multiple second power ranges and the corresponding discharge parameters is determined as the available time of the battery.
[0145] The remaining power determined in step S604 is the total remaining power of the battery. For each second power range, the available power corresponding to each second power range is a part of the remaining power, that is, the product of the remaining power and the power percentage corresponding to each second power range is determined as the available power corresponding to each second power range. The power percentage corresponding to the second power range is used to characterize the proportion of the available power corresponding to the second power range in the remaining power. Then, for each second power range, the ratio of the available power corresponding to the second power range to the corresponding discharge parameter is determined as the available time corresponding to the second power range, and the sum of the available time corresponding to multiple second power ranges is determined as the available time of the battery.
[0146] In some embodiments, for each second power range, based on historical usage data, a historical power difference and a historical remaining power corresponding to the second power range are determined, wherein the historical power difference is the difference between a first historical power corresponding to the upper limit value of the second power range and a second historical power corresponding to the lower limit value of the second power range, and the historical remaining power is the remaining power of the battery when the historical visible power is the current visible power; the ratio of the historical power difference to the historical remaining power is determined as the power ratio corresponding to the second power range.
[0147] Optionally, obtain historical usage data of the battery L times, obtain the historical remaining power when the visible power in each historical usage data is the current visible power of the battery, and the historical power difference corresponding to each second power range; for each second power range, obtain the ratio of each historical power difference corresponding to the second power range to the historical remaining power, obtain L ratios, and determine the average of the L ratios as the power ratio corresponding to the second power range.
[0148] For example, taking the current visible power as 20%, the second power range includes 20%-5%, 5%-3%, 3%-1% and 0% as an example, the average values of K historical discharge parameters, upper limit discharge parameters and power proportions corresponding to different second power ranges are shown in Table 1:
[0149] Table 1
[0150]
[0151]
[0152] According to the parameters shown in Table 1, in the first operating mode, the calculation formula for the available time is:
[0153] t=μ1*R M / P1+μ2*R M / P2+μ3*R M / P3+μ4*R M / P4
[0154] Among them, t is the available time, R M is the remaining power, and the other parameters are the parameters shown in Table 1.
[0155] In the second operating mode, the calculation formula for the available time is:
[0156] t=μ1*R M / P N1 +μ2*R M / P N2 +μ3*R M / P N3 +μ4*R M / P N4
[0157] Among them, t is the available time, R M is the remaining power, P N1 For P1 and P M1 The minimum value in P N2 For P2 and P M2 The minimum value in P N3 For P3 and P M3 The minimum value in P N4 For P4 and P M4 The minimum value in .
[0158] Step S606, displaying the available time.
[0159] In the method provided by the embodiment of the present disclosure, the discharge parameter is determined based on the user's historical usage or the upper limit discharge parameter in the second operating mode, taking into account the user's usage habits and the operating mode of the battery, and adopting corresponding discharge parameters in different operating modes. In addition, in order to more accurately represent the usage of the battery under the remaining power, it is also considered that the user's usage of the electronic device may be different under different power levels, and the corresponding discharge parameters are determined for each second power range respectively, so that the available time of the battery determined based on the discharge parameters and the remaining power of each second power range is more accurate, thereby improving the accuracy of the available time and enhancing the user experience.
[0160] In one example, Figure 6 The embodiment shown can be Figure 7 As shown, the preset threshold is 20%, and four second power ranges are divided into 20%-5%, 5%-3%, 3%-1% and 0%, see Figure 7 , including the following steps:
[0161] 1. Make sure the visible power level of the electronic device is less than or equal to 20%.
[0162] 2. Determine whether the power saving mode is turned on. If the power saving mode is not turned on, go to step 3. If the power saving mode is turned on, go to step 6.
[0163] 3. Based on the historical usage data, the discharge parameters of the four second power ranges are determined respectively.
[0164] The implementation of step 3 refers to the above step S602 and will not be repeated here.
[0165] 4. Calculate the remaining power based on the discharge parameters of the second minimum power range.
[0166] 5. Calculate the usable time of the battery based on the discharge parameters, power percentage and remaining power of the four second power ranges.
[0167] The implementation of steps 4 and 5 refers to the above steps S604 and S605, which will not be described in detail here.
[0168] 6. Obtain upper limit discharge parameters corresponding to four second power ranges, and determine discharge parameters of the four second power ranges respectively based on historical usage data.
[0169] 7. Compare the upper limit discharge parameter corresponding to each second power range with the discharge parameter determined based on historical data to determine the discharge parameter of each second power range.
[0170] The implementation of steps 6 and 7 refers to the above step S603 and will not be repeated here.
[0171] 8. Calculate the remaining power based on the discharge parameters of the second minimum power range.
[0172] 9. Calculate the usable time of the battery based on the discharge parameters, power percentage and remaining power of the four second power ranges.
[0173] The implementation of steps 8 and 9 refers to the above steps S604 and S605, which will not be described in detail here.
[0174] 10. Display the available time.
[0175] In addition, it should be noted that the above implementation is only described by taking the prediction of the available battery life under the current visible power as an example. In another embodiment, the same implementation can also be used to predict the available battery life under other visible power levels. Optionally, the above implementation is used to predict the available battery life once every preset time, so that the user can obtain the latest available time. The preset time is any preset time, for example, the preset time is 5 minutes, 10 minutes or other time.
[0176] Figure 8 is a block diagram of a device for displaying the usable life of a battery according to an exemplary embodiment, which is configured in an electronic device, see Figure 8 , the device comprises:
[0177] The available time display module 801 is configured to display the available time of the battery in response to the visible power level of the battery being lower than a preset threshold;
[0178] The available time is determined based on the current remaining power of the battery and the discharge parameters. The discharge parameters are determined based on the historical usage data of the battery. The historical usage data is used to characterize the historical discharge parameters of the battery at different visible power levels during its historical use.
[0179] In some embodiments, the apparatus further comprises:
[0180] The parameter acquisition module is configured to determine the average value of M historical discharge parameters in the historical usage data as the discharge parameter in response to the battery being in the first operating mode; wherein M is greater than or equal to 1, the M historical discharge parameters are the historical discharge parameters of each historical visible power in the first power range, and the upper limit value of the first power range is the current visible power of the battery, and the lower limit value is the preset power.
[0181] In some embodiments, the current visible power level of the battery corresponds to N second power level ranges, where N is greater than or equal to 1, and the upper limit value of the N second power level ranges is the current visible power level of the battery, and the lower limit value is the preset power level; the device further includes:
[0182] The parameter acquisition module is configured to determine the average value of K historical discharge parameters corresponding to the second power range in the historical usage data as the discharge parameter in response to the battery being in the first operating mode; wherein K is greater than or equal to 1.
[0183] In some embodiments, the apparatus further comprises:
[0184] The range division module is configured to divide the battery into N second power ranges according to a preset rule and the current visible power of the battery.
[0185] In some embodiments, the apparatus further comprises:
[0186] The parameter acquisition module is configured as follows:
[0187] In response to the battery being in the second operating mode, determining an average value of M historical discharge parameters in the historical usage data; wherein M is greater than or equal to 1, the M historical discharge parameters are historical discharge parameters of each historical visible power in the first power range, and the upper limit value of the first power range is the current visible power of the battery, and the lower limit value is the preset power;
[0188] When the average value of the M historical discharge parameters is less than or equal to the upper limit discharge parameter in the second operation mode, the average value of the M historical discharge parameters is determined as the discharge parameter; or,
[0189] When the average value of the M historical discharge parameters is greater than the upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter.
[0190] In some embodiments, the current visible power level of the battery corresponds to N second power level ranges, where N is greater than or equal to 1, and the upper limit value of the N second power level ranges is the current visible power level of the battery, and the lower limit value is the preset power level; the device further includes:
[0191] The parameter acquisition module is configured as follows:
[0192] In response to the battery being in the second operating mode, determining an average value of K historical discharge parameters corresponding to the second power range in the historical usage data; wherein K is greater than or equal to 1;
[0193] When the average value of the K historical discharge parameters corresponding to the second power range is less than or equal to the corresponding upper limit discharge parameter, the average value of the K historical discharge parameters is determined as the discharge parameter; or,
[0194] When the average value of the K historical discharge parameters corresponding to the second power range is greater than the corresponding upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter.
[0195] In some embodiments, the apparatus further comprises:
[0196] The duration determination module is configured to determine the available duration based on the discharge parameters of each second power range, the remaining power and the power ratio corresponding to each second power range; wherein the power ratio corresponding to the second power range is used to characterize the proportion of the available power corresponding to the second power range in the remaining power.
[0197] In some embodiments, the duration determination module is configured to:
[0198] The product of the remaining power and the power proportion corresponding to each second power range is determined as the available power corresponding to each second power range;
[0199] The sum of the ratios of the available power corresponding to the plurality of second power ranges to the corresponding discharge parameters is determined as the available time.
[0200] In some embodiments, the apparatus further comprises:
[0201] a historical power acquisition module, configured to determine, for each second power range, a historical power difference and a historical remaining power corresponding to the second power range based on the historical usage data, wherein the historical power difference is a difference between a first historical power corresponding to an upper limit value of the second power range and a second historical power corresponding to a lower limit value of the second power range, and the historical remaining power is a remaining power of the battery when the historical visible power is the current visible power;
[0202] The power proportion determination module is configured to determine the ratio of the historical power difference to the historical remaining power as the power proportion corresponding to the second power range.
[0203] In some embodiments, the apparatus further comprises:
[0204] The power determination module is configured to determine the remaining power according to the discharge parameters of the third power range.
[0205] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0206] An embodiment of the present disclosure further provides an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the method for displaying the usable time of a battery in the above embodiment.
[0207] Fig. 9 is a block diagram of an electronic device 900 according to an exemplary embodiment.
[0208] Reference Fig. 9, the electronic device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output (I / O) interface 912 , a sensor component 914 , and a communication component 916 .
[0209] The processing component 902 generally controls the overall operation of the electronic device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
[0210] The memory 904 is configured to store various types of data to support operations on the electronic device 900. Examples of such data include instructions for any application or method operating on the electronic device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 may 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.
[0211] The power supply component 906 provides power to various components of the electronic device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 900.
[0212] The multimedia component 908 includes a screen that provides an output interface between the electronic device 900 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 908 includes a front camera and / or a rear camera. When the electronic device 900 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.
[0213] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the electronic device 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.
[0214] I / O interface 912 provides an interface between processing component 902 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.
[0215] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the electronic device 900. For example, the sensor assembly 914 can detect the open / closed state of the electronic device 900, the relative positioning of components, such as the display and keypad of the electronic device 900, and the sensor assembly 914 can also detect the position change of the electronic device 900 or a component of the electronic device 900, the presence or absence of user contact with the electronic device 900, the orientation or acceleration / deceleration of the electronic device 900, and the temperature change of the electronic device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 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 914 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0216] The communication component 916 is configured to facilitate wired or wireless communication between the electronic device 900 and other devices. The electronic device 900 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 916 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 916 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.
[0217] In an exemplary embodiment, the electronic device 900 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 methods.
[0218] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by a processor 920 of an electronic device 900 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.
[0219] The embodiments of the present disclosure also provide a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method for displaying the available battery life in the above embodiment.
[0220] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0221] It should be understood that the present invention is not limited to the exact construction that has 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 invention is limited only by the appended claims.
Claims
1. A method for displaying the usable time of a battery, characterized in that: The method comprises: In response to the visible power level of the battery being lower than a preset threshold, displaying the usable time of the battery; Among them, the available time is determined based on the current remaining power and discharge parameters of the battery, and the discharge parameters are determined based on the historical usage data of the battery. The historical usage data is used to characterize the historical discharge parameters of the battery under different visible power levels during the historical use of the battery.
2. The method for displaying the usable duration of a battery according to claim 1, characterized in that: The process of determining the discharge parameters includes: In response to the battery being in the first operating mode, the average value of M historical discharge parameters in the historical usage data is determined as the discharge parameter; wherein M is greater than or equal to 1, and the M historical discharge parameters are historical discharge parameters of each historical visible power in the first power range, and the upper limit value of the first power range is the current visible power of the battery, and the lower limit value is a preset power.
3. The method for displaying the usable duration of a battery according to claim 1, characterized in that: The current visible power of the battery corresponds to N second power ranges, where N is greater than or equal to 1, and the upper limit value of the N second power ranges is the current visible power of the battery, and the lower limit value is a preset power; the process of determining the discharge parameter of each second power range includes: In response to the battery being in the first operating mode, an average value of K historical discharge parameters corresponding to the second power range in the historical usage data is determined as the discharge parameter; wherein K is greater than or equal to 1.
4. The method for displaying the usable duration of a battery according to claim 3, characterized in that: The method further comprises: The N second power ranges are divided according to a preset rule and the current visible power of the battery.
5. The method for displaying the usable duration of a battery according to claim 1, characterized in that: The process of determining the discharge parameters includes: In response to the battery being in the second operating mode, determining an average value of M historical discharge parameters in the historical usage data; wherein M is greater than or equal to 1, and the M historical discharge parameters are historical discharge parameters of each historical visible power in a first power range, and an upper limit value of the first power range is the current visible power of the battery, and a lower limit value is a preset power; When the average value of the M historical discharge parameters is less than or equal to the upper limit discharge parameter in the second operation mode, the average value of the M historical discharge parameters is determined as the discharge parameter; or, When the average value of the M historical discharge parameters is greater than the upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter.
6. The method for displaying the usable duration of a battery according to claim 1, characterized in that: The current visible power level of the battery corresponds to N second power level ranges, where N is greater than or equal to 1, and the upper limit value of the N second power level ranges is the current visible power level of the battery, and the lower limit value is the preset power level; The process of determining the discharge parameter of each of the second power ranges includes: In response to the battery being in the second operating mode, determining an average value of K historical discharge parameters corresponding to the second power range in the historical usage data; wherein K is greater than or equal to 1; When the average value of the K historical discharge parameters corresponding to the second power range is less than or equal to the corresponding upper limit discharge parameter, the average value of the K historical discharge parameters is determined as the discharge parameter; or, When an average value of K historical discharge parameters corresponding to the second power range is greater than a corresponding upper limit discharge parameter, the upper limit discharge parameter is determined as the discharge parameter.
7. The method for displaying the usable duration of a battery according to claim 3 or 6, characterized in that: The process of determining the available time includes: The available time is determined based on the discharge parameters of each of the second power ranges, the remaining power and the power ratio corresponding to each of the second power ranges; wherein the power ratio corresponding to the second power range is used to characterize the proportion of the available power corresponding to the second power range in the remaining power.
8. The method for displaying the usable duration of a battery according to claim 7, characterized in that: The determining the available time according to the discharge parameter of each second power range, the remaining power, and the power ratio corresponding to each second power range includes: Determine the available power corresponding to each second power range by multiplying the remaining power by the power proportion corresponding to each second power range; The sum of the ratios of the available power corresponding to the plurality of the second power ranges to the corresponding discharge parameters is determined as the available time.
9. The method for displaying the usable duration of a battery according to claim 7, characterized in that: The method further comprises: For each second power range, based on the historical usage data, determine a historical power difference and a historical remaining power corresponding to the second power range, wherein the historical power difference is a difference between a first historical power corresponding to an upper limit value of the second power range and a second historical power corresponding to a lower limit value of the second power range, and the historical remaining power is the remaining power of the battery when the historical visible power is the current visible power; The ratio of the historical power difference to the historical remaining power is determined as the power proportion corresponding to the second power range.
10. The method for displaying the usable duration of a battery according to claim 3 or 6, characterized in that: The method further comprises: The remaining power is determined according to the discharge parameters of the third power range.
11. A device for displaying the usable life of a battery, characterized in that: The device comprises: an available time display module, configured to display the available time of the battery in response to the visible power level of the battery being lower than a preset threshold; Among them, the available time is determined based on the current remaining power and discharge parameters of the battery, and the discharge parameters are determined based on the historical usage data of the battery. The historical usage data is used to characterize the historical discharge parameters of the battery under different visible power levels during the historical use of the battery.
12. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method according to any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 10.