Battery voltage threshold determination method and device, equipment and readable storage medium
By adjusting the heating power of the heating element when the battery is fully charged and obtaining the voltage value, determining the voltage threshold of the battery level, the problem of inaccurate battery level after the battery ages is solved, and the accurate representation of the battery level and matching the battery level is achieved.
Patent Information
- Application Number
- CN202411289482.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-11-19
AI Technical Summary
In the prior art, the battery level determined after aging is inaccurate, resulting in the battery power display that does not match the actual power, and the remaining battery power cannot be accurately represented.
When the battery is fully charged, the heating power of the heating element is adjusted to heat it through the preset power, and the voltage value of the heating element is obtained. The voltage threshold corresponding to the battery level is determined according to the voltage value. , thereby achieving accurate determination of voltage threshold.
It improves the accuracy of the battery level, ensures that the battery power can be accurately represented when the battery ages, and matches the power level with the actual battery power, solving the problem of inaccurate battery power display after the battery ages.
Smart Images

Figure CN118980950A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery technology, and in particular to a method, device, electronic device, computer-readable storage medium and computer program product for determining a battery voltage threshold. Background Art
[0002] With the development of electronic technology, batteries are increasingly used in portable devices. Users are more concerned about the battery power and need to make arrangements in advance according to the battery power during use. The battery power of electronic devices can be expressed using power levels, and the corresponding power levels can be determined by the output voltage of the battery.
[0003] In the related art, a uniform correspondence between voltage threshold and power level is set. According to the correspondence, the corresponding power level can be determined according to the output voltage of the battery. However, the battery will age after the device has been used for a period of time, resulting in inaccurate power level determined after the battery ages. Summary of the invention
[0004] Based on this, it is necessary to provide a battery voltage threshold determination method, device, electronic device, computer-readable storage medium and computer program product that can improve the accuracy of power level determination in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a method for determining a battery voltage threshold, comprising:
[0006] When the battery is fully charged, instruct the battery to discharge to the heating element according to a preset power until the battery power reaches zero;
[0007] During the discharge of the battery, the heating power of the heating element is adjusted so that the heating element is heated by the preset power;
[0008] Obtaining a voltage value of the heating element during the heating process;
[0009] A voltage threshold corresponding to the battery power level is determined according to the voltage value.
[0010] In one embodiment, before instructing the battery to discharge to the heating element according to the preset power until the battery power is zero, the method further includes:
[0011] In response to triggering a threshold setting operation, determining a power state of the battery;
[0012] If the battery power status is not fully charged, a charging reminder is issued;
[0013] In response to a charging trigger, charging the battery;
[0014] When the battery is fully charged, instructing the battery to discharge to the heating element according to a preset power until the battery power is zero, including:
[0015] When the battery is fully charged, the charging of the battery is stopped, and the battery is instructed to discharge to the heating element according to a preset power until the battery power is zero.
[0016] In one embodiment, the step of adjusting the heating power of the heating element so that the heating element is heated by the preset power includes:
[0017] Detecting the voltage value and resistance value of the heating element during the heating process;
[0018] Calculate the actual power of the heating element according to the voltage value and the resistance value;
[0019] Calculating a duty cycle according to the actual power and the preset power;
[0020] The heating power of the heating element is adjusted according to the duty cycle so that the heating element is heated by the preset power.
[0021] In one embodiment, determining a voltage threshold corresponding to a battery power level according to the voltage value includes:
[0022] Obtaining a voltage value sequence consisting of voltage values arranged in order of detection time;
[0023] Dividing the voltage value sequence into levels to obtain voltage value subsequences corresponding to a preset number of levels;
[0024] The voltage threshold corresponding to each of the battery power levels is obtained according to the voltage boundary value of the voltage value range corresponding to the voltage value subsequence.
[0025] In one embodiment, obtaining the voltage value of the heating element during the heating process includes:
[0026] Obtaining the voltage value of the heating element during the heating process detected at each preset time interval;
[0027] The step of dividing the voltage value sequence into different levels to obtain voltage value subsequences corresponding to a preset number of levels includes:
[0028] Obtaining a target duration; the target duration is greater than the preset duration and less than the discharge duration of the battery;
[0029] In the voltage value sequence, starting from the last detected voltage value, a target voltage value detected within the target time period is selected;
[0030] The voltage value sequence excluding the target voltage value is used as a target voltage value sequence, and the target voltage value sequence is graded to obtain voltage value subsequences corresponding to the preset number of grades.
[0031] In one embodiment, the method further comprises:
[0032] Detect the status of the threshold calibration flag;
[0033] Determining the voltage threshold according to the state of the threshold calibration flag;
[0034] After the voltage threshold is determined, the threshold calibration flag is cleared.
[0035] In a second aspect, the present application also provides a battery voltage threshold determination device, comprising:
[0036] A battery discharge module, used for instructing the battery to discharge to the heating element according to a preset power when the battery is fully charged, until the battery power reaches zero;
[0037] A heating power adjustment module, used for adjusting the heating power of the heating element during the discharge of the battery, so that the heating element is heated by the preset power;
[0038] A voltage value acquisition module, used to acquire the voltage value of the heating element during the heating process;
[0039] The voltage threshold determination module is used to determine the voltage threshold corresponding to the battery power level according to the voltage value.
[0040] In a third aspect, the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the battery voltage threshold determination method provided in the first aspect are implemented.
[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the battery voltage threshold determination method provided in the first aspect are implemented.
[0042] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the battery voltage threshold determination method provided in the first aspect.
[0043] The above-mentioned battery voltage threshold determination method, device, electronic device, computer-readable storage medium and computer program product, when the battery is fully charged, instruct the battery to discharge to the heating element according to the preset power until the battery power is zero, and during the battery discharge process, the heating power of the heating element is adjusted so that the heating element is heated by the preset power; the voltage value of the heating element during the heating process is obtained, and the voltage threshold corresponding to the battery power level is determined according to the voltage value, so that the heating element can be heated by the discharge power of the battery, and the voltage threshold corresponding to the power level can be accurately determined according to the voltage across the heating element; in addition, the battery voltage threshold can be determined in real time, so that when the battery is aged, the voltage threshold determined when it is not aged can be corrected according to the determined voltage threshold, so that after the battery is aged, the corresponding power level can be accurately determined according to the voltage threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0045] FIG1 is a diagram showing an application environment of a method for determining a battery voltage threshold in one embodiment;
[0046] FIG2 is a schematic flow chart of a method for determining a battery voltage threshold in one embodiment;
[0047] FIG3 is a schematic flow chart of a method for determining a battery voltage threshold in another embodiment;
[0048] FIG4 is a structural block diagram of a device for determining a battery voltage threshold in one embodiment;
[0049] FIG. 5 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] The battery power level of the heating non-combustion appliance is displayed in different levels to prompt the user of the current remaining power. The discharge capacity corresponding to each level of battery power should be consistent. For example, the power level corresponding to the battery voltage of 3.5V (volts) -3.65V is level one, the power level corresponding to the battery voltage of 3.65V to 3.75V is level two, the power level corresponding to the battery voltage greater than 3.75V and not greater than 3.88V is level three, the power level corresponding to the battery voltage greater than 3.88V and not greater than 3.96V is level four, and greater than 3.96V is level five. The corresponding levels of power can be displayed using the corresponding number of lights. For example, 5 lights are on to indicate a level five power level.
[0052] If the same batch of heat-not-burn appliances use a fixed voltage threshold, different heat-not-burn appliances will display different power levels when the actual power levels are the same, i.e. the power levels are inaccurate. After the battery ages, the fixed voltage threshold is no longer applicable to the aged battery, and the battery power display will not match the actual power level.
[0053] Based on the above-mentioned technical problem of inaccurate power level, an embodiment of the present application provides a method for determining a battery voltage threshold. When the battery is fully charged, the battery is instructed to discharge to the heating element according to a preset power until the battery power is zero. During the battery discharge process, the heating power of the heating element is adjusted so that the heating element is heated by the preset power. The voltage value of the heating element during the heating process is obtained, and the voltage threshold corresponding to the battery power level is determined according to the voltage value. This can achieve accurate determination of the voltage threshold and accurate determination of the actual power level of the battery based on the voltage threshold, thereby improving the accuracy of the power level.
[0054] The battery voltage threshold determination method provided in the embodiment of the present application is described by taking the application to the electronic device shown in FIG. 1 as an example, wherein the electronic device 100 includes a heating element 102, a controller 104 and a battery 106, and the controller 104 is connected to the battery 106 and the heating element 102 respectively. When the battery is fully charged, the controller 104 instructs the battery 106 to discharge to the heating element 102 according to the preset power until the battery 106 is charged to zero. During the discharge of the battery 106, the heating power of the heating element 102 is adjusted so that the heating element 102 is heated by the preset power, and the voltage value of the heating element 102 during the heating process is obtained, and the voltage threshold corresponding to the battery charge level is determined according to the voltage value. The electronic device may include a heating-not-burning appliance.
[0055] In an exemplary embodiment, as shown in FIG2 , a method for determining a battery voltage threshold is provided, including the following steps 202 to 208 . Among them:
[0056] Step 202, when the battery is fully charged, instruct the battery to discharge to the heating element according to a preset power until the battery power reaches zero.
[0057] When the battery of the electronic device is fully charged, the battery is instructed to discharge to the heating element according to a preset power, wherein the preset power refers to the power with which the battery discharges to the heating element. The preset power can be set according to the actual application scenario, for example, 3.7V, until the battery power is zero.
[0058] In actual application scenarios, by responding to a trigger operation determined by a threshold, the electronic device can enter a voltage threshold determination mode to determine the battery power status. If the battery power status is fully charged, the battery is instructed to discharge to the heating element at a preset power until the battery power is zero; if the battery power status is not fully charged, a charging reminder is issued, charging is stopped after the battery is fully charged, and then the battery is instructed to discharge to the heating element at a preset power until the battery power is zero.
[0059] Step 204: During the discharge of the battery, the heating power of the heating element is adjusted so that the heating element is heated by a preset power.
[0060] When the battery is discharged at a preset power, the heating element receives the electric energy released by the battery and generates heat. The heating power of the heating element needs to be adjusted so that the heating element is heated at the preset power. As the temperature of the heating element increases during the battery discharge process, the resistance of the heating element changes, and thus the heating power of the heating element also changes. Therefore, the heating power of the heating element needs to be adjusted so that the heating element is heated at the preset power.
[0061] Optionally, the voltage value and resistance value at both ends of the heating element can be detected, the actual heating power of the heating element can be calculated according to the voltage value and the resistance value, the duty cycle can be calculated according to the actual power and the preset power, and the heating power of the heating element can be adjusted according to the duty cycle so that the heating element is heated by the preset power.
[0062] In actual application scenarios, during the process of the battery discharging the heating element, the heating power of the heating element can be adjusted at intervals of target duration, that is, the actual power of the heating element is calculated at each interval of target duration, and the duty cycle is calculated based on the actual power and the preset power, and the actual power of the heating element is adjusted according to the duty cycle, so that the heating element is heated by the preset power until the battery power is zero. The target duration can be set according to the actual application scenario.
[0063] Step 206, obtaining the voltage value of the heating element during the heating process.
[0064] The battery discharges to the heating element at a preset power, and by adjusting the heating power of the heating element, the heating element is heated by the preset power. During this heating process, the voltage value at both ends of the heating element can be detected at intervals of a preset time length, and a voltage value sequence formed according to the detection time can be obtained. It can be understood that the smaller the preset time length, the finer the corresponding voltage detection granularity, and the higher the accuracy of the voltage threshold determined based on the detected voltage value.
[0065] The electronic device can store the detected voltage value of the heating element in a storage medium, and when determining the voltage threshold, obtain the voltage value of the heating element during the heating process from the storage medium, or obtain a sequence of voltage values arranged in order of detection time.
[0066] Step 208: Determine a voltage threshold corresponding to the battery power level according to the voltage value.
[0067] The power level is used to characterize the level corresponding to the battery power. The power level is used to indicate the size of the battery power. Generally, the higher the power level, the more battery power it corresponds to, and the lower the power level, the less battery power it corresponds to; or, the higher the power level, the lower the corresponding battery power, and the lower the power level, the more battery power it corresponds to. You can set it according to actual needs.
[0068] The voltage thresholds corresponding to different battery power levels may be different or the same, but the voltage intervals formed by the voltage thresholds of each level corresponding to the same battery are continuous, and there is no intersection between the voltage intervals corresponding to the voltage thresholds of different levels. For example, the battery power levels include level 4, level 3, level 2, and level 1. The voltage threshold corresponding to level 4 is 3.87V, the voltage threshold corresponding to level 3 is 3.71V and 3.87V, the voltage threshold corresponding to level 2 is 3.55V and 3.71V, and the voltage threshold corresponding to level 1 is 3.55V. It can be understood that in actual application scenarios, the level 4 power may not have a corresponding power display, that is, the power indicator light is not on, or a low power prompt message is issued, etc., which can be set according to the actual application scenario.
[0069] Optionally, a voltage threshold corresponding to the battery power level may be selected from voltage values detected by the heating element during the heating process.
[0070] In the above-mentioned method for determining the battery voltage threshold, when the battery is fully charged, the battery discharges to the heating element according to the preset power until the battery is out of power, and at the same time the heating power of the heating element is adjusted so that the heating element is heated by the preset power, and the voltage value of the heating element during the heating process is detected, and the voltage threshold corresponding to the battery power level is determined according to the voltage value, so that the heating element is discharged and heated by the battery output power. The voltage across the heating element is the battery voltage, which can improve the accuracy of the voltage threshold determined based on the voltage; in addition, the voltage threshold can be determined according to the actual situation of the battery, so that the battery power can be accurately represented even when the battery is aged, and the power level can be accurately matched with the actual battery power, thereby improving the accuracy of the power level.
[0071] In some embodiments, before instructing the battery to discharge to the heating element according to the preset power until the battery power is zero, it also includes:
[0072] In response to a trigger of a threshold setting operation, determining a battery power state; if the battery power state is not fully charged, issuing a charging prompt; in response to a charging trigger, charging the battery;
[0073] When the battery is fully charged, the battery is instructed to discharge to the heating element according to the preset power until the battery power is zero, including: when the battery power state is fully charged, the battery is stopped from being charged, and the battery is instructed to discharge to the heating element according to the preset power until the battery power is zero.
[0074] The threshold setting operation refers to an operation for triggering the threshold determination. Exemplarily, the threshold setting operation may be long pressing the power key for a specified time, continuously pressing the power key for a specified number of times, or pressing the threshold trigger key, for example, long pressing the power key for 6 seconds.
[0075] In response to the triggering of the threshold setting operation, the electronic device enters the voltage threshold determination mode, and the electronic device determines the battery power state. If the battery power state is fully charged, the battery is instructed to discharge to the heating element at a preset power until the battery power is zero; if the battery power state is not fully charged, a charging prompt is issued, and the electronic device responds to the charging trigger to charge the battery, stops charging after the battery is fully charged, and then instructs the battery to discharge to the heating element at a preset power until the battery power is zero. It can be understood that the battery power state includes a fully charged state and a not fully charged state.
[0076] In one example, the power button is pressed and held for 6 seconds, and the electronic device determines the battery charge state. If the battery charge state is fully charged, the electronic device vibrates and flashes a light to issue a charging reminder. After the user connects the charger and the power supply, the electronic device responds to the trigger of connecting the power supply and charges the battery until the battery is fully charged. That is, when the battery charge state is fully charged, the electronic device disconnects from the power supply and stops charging the battery. Then, the step of instructing the battery to discharge to the heating element at a preset power until the battery charge is zero is implemented.
[0077] In this embodiment, the battery power state is judged by responding to the trigger of the threshold setting operation. If the battery power state is not fully charged, a charging prompt is issued, and the battery is charged in response to the charging trigger. When the battery is fully charged, the charging of the battery is stopped, and then the battery is instructed to discharge to the heating element at a preset power until the battery power is zero. This can ensure that in the process of determining the battery voltage threshold, the battery discharges to the heating element from a fully charged state, so that the heating element is heated at the preset power until the battery power is zero, thereby improving the accuracy of the determined voltage threshold.
[0078] In an exemplary embodiment, in step 204, the heating power of the heating element is adjusted so that the heating element is heated by a preset power, including:
[0079] Detect the voltage value and resistance value of the heating element during the heating process; calculate the actual power of the heating element according to the voltage value and the resistance value; calculate the duty cycle according to the actual power and the preset power; adjust the heating power of the heating element according to the duty cycle so that the heating element is heated by the preset power.
[0080] The voltage value and resistance value of the heating element during the heating process can be detected at preset intervals. The actual power of the heating element can be calculated based on the voltage value and resistance value obtained each time. When calculating the actual power of the heating element, the ratio of the square of the voltage value of the heating element obtained by the detection to the resistance value can be calculated to obtain the actual power. The calculation method of the actual power can be shown in the following formula (1):
[0081] (1)
[0082] In formula (1), P r It represents actual power, U represents voltage value, and R represents resistance value.
[0083] The duty cycle is calculated according to the actual power and the preset power. Optionally, the ratio of the preset power to the actual power can be used as the duty cycle, as shown in the following formula (2).
[0084] (2)
[0085] in, Indicates duty cycle, P0 indicates preset power.
[0086] Pulse width modulation (PWM) is a way to reduce the average power transmitted by the electrical signal by dispersing the effective electrical signal into discrete forms. According to the area equivalence rule, the waveform of the corresponding amplitude and frequency required for synthesis can be equivalently obtained by changing the time width of the pulse. The duty cycle is the percentage of the time that the pulse is at a higher voltage in the entire pulse period. The heating power of the heating element can be adjusted by the PWM signal corresponding to the duty cycle, so that the heating element is heated by the preset power.
[0087] In actual application scenarios, during the heating process of the heating element, for the first detection, the actual heating power of the heating element is calculated based on the voltage value and resistance value of the heating element obtained by the first detection, the duty cycle is calculated, and the heating power of the heating element is adjusted according to the duty cycle, so that the heating element is heated by the preset power; a preset time is set from the detection moment of the first detection, and a second detection is performed, and the actual power of the heating element is calculated based on the voltage value and resistance value of the heating element obtained by the second detection, and the duty cycle is calculated, and the heating power of the heating element is adjusted according to the duty cycle, so that the heating element is heated by the preset power; a preset time is set from the detection moment of the second detection, and a third detection is performed, and so on, until the battery power is zero. It can be understood that the shorter the preset time, the higher the frequency of detecting the voltage value and the resistance value, and the more times the heating power of the heating element is adjusted, then the higher the possibility that the heating element will continue to be heated by the preset power, and the preset time can be set according to actual needs, for example, the preset time is 20ms (milliseconds)-100ms (milliseconds).
[0088] In this embodiment, by detecting the voltage value and resistance value of the heating element during the heating process, the actual power of the heating element is calculated according to the voltage value and the resistance value, and the duty cycle is calculated according to the actual power and the preset power. The heating power of the heating element is adjusted according to the duty cycle so that the heating element is heated by the preset power. The length of time that the heating element is heated by the preset power can be increased, so that the heating power of the heating element is equal to the output power of the battery, thereby improving the accuracy of the voltage threshold.
[0089] In some embodiments, step 208 of determining a voltage threshold corresponding to a battery power level according to the voltage value includes:
[0090] A voltage value sequence consisting of voltage values arranged in order of detection time is obtained; the voltage value sequence is graded to obtain a voltage value subsequence corresponding to a preset number of grades; and a voltage threshold corresponding to each battery power level is obtained according to a voltage boundary value of a voltage value range corresponding to the voltage value subsequence.
[0091] During the process of the battery discharging the heating element, the heating power of the heating element is adjusted so that the heating element is heated by the preset power, and the voltage value at both ends of the heating element is detected at the same time until the battery power is zero. Obtain a voltage value sequence composed of voltage values arranged in the order of detection time. It can be understood that as the discharge time of the battery increases, the output voltage of the battery gradually decreases, and correspondingly, the voltage value at both ends of the heating element also gradually decreases. Therefore, as time goes by, the voltage value in the voltage value sequence shows a trend from large to small. The voltage value sequence can be divided into levels according to time to obtain a voltage value subsequence corresponding to a preset number of levels, wherein the preset number of levels can be set according to actual needs, for example, the preset number of levels is 3, 4 or 5, etc. The voltage value sequence can be divided into uniform or uneven levels according to time to obtain a voltage value subsequence corresponding to a preset number of levels.
[0092] The voltage boundary value of the voltage value range corresponding to the voltage value subsequence can be used as the voltage threshold corresponding to each battery power level. For example, the voltage value range corresponding to the voltage value subsequence is [2.1,3.5], then the voltage boundary values 2.1 and 3.5 can be used as the voltage thresholds of the corresponding power levels. The selection of the voltage threshold is related to the number of preset levels. The voltage threshold corresponding to the power level at the end can include one, but the voltage threshold corresponding to the power level in the middle can include 2. Exemplarily, the number of preset levels is 5, that is, the 5 power levels include level one, level two, level three, level four and level five, then, level one and level five are the power levels at the ends, and level two, level three and level four are the power levels in the middle.
[0093] In an example, assuming that the number of preset levels is 3, the voltage value of the heating element is detected once at a preset time interval, and a total of 120 voltage values are detected. The voltage value sequence composed of the 120 voltage values is evenly divided into levels, and each level corresponds to 40 voltage values, that is, the 1st to 40th voltage values in the 120 voltage value sequence constitute a first voltage value subsequence corresponding to the first level, the 41st to 80th voltage values constitute a second voltage value subsequence corresponding to the second level, and the 81st to 120th voltage values constitute a third voltage value subsequence corresponding to the third level. If the voltage value range corresponding to the first voltage value subsequence is [3.87V, 3.90V], then the corresponding threshold value is 3.87V, that is, the power level corresponding to the voltage greater than 3.87V is the first level; if the voltage value range corresponding to the second voltage value subsequence is [3.71V, 3.87V], then the corresponding threshold values are 3.71V and 3.87V, that is, the power level corresponding to the voltage greater than or equal to 3.71V and not greater than 3.87V is the second level; if the voltage value range corresponding to the third voltage value subsequence is [3.55V, 3.71V), then the corresponding threshold values are 3.55V and 3.71V, that is, the power level corresponding to the voltage less than 3.71V and greater than or equal to 3.55V is the third level, and the voltage lower than 3.55V can be set to not start heating.
[0094] In this embodiment, by dividing the voltage value sequence into levels, a voltage value sub-sequence corresponding to a preset number of levels is obtained, and the voltage threshold corresponding to each battery power level is obtained according to the voltage boundary value of the voltage value range corresponding to the voltage value sub-sequence. This can achieve fast and accurate acquisition of the voltage threshold corresponding to the power level, thereby improving the accuracy and determination efficiency of the voltage threshold.
[0095] In an exemplary embodiment, obtaining the voltage value of the heating element during the heating process includes: obtaining the voltage value of the heating element during the heating process detected at each preset time interval;
[0096] The voltage value sequence is divided into levels to obtain voltage value subsequences corresponding to a preset number of levels, including:
[0097] Obtain a target duration; the target duration is greater than a preset duration and less than a discharge duration of the battery; in a voltage value sequence, select a target voltage value detected within the target duration starting from the voltage value detected last time; use the voltage value sequence excluding the target voltage value as a target voltage value sequence, and divide the target voltage value sequence into levels to obtain a voltage value subsequence corresponding to a preset number of levels.
[0098] The target duration can be a duration input by the user or a preset duration. In one example, the target duration can be the working duration corresponding to one or more activations of the heating without burning appliance. The target duration is greater than the preset duration and less than the discharge duration of the battery, wherein the preset duration refers to the interval between two detection voltage values, and the discharge duration refers to the duration of the battery discharging the heating element from a fully charged state at a preset power until the battery power is zero. It can be understood that the size of the target duration can be set according to actual needs.
[0099] In this embodiment, the voltage value of the heating element during the heating process is detected at intervals of a preset time. The voltage values are arranged in order of detection time to form a voltage value series. The target voltage value detected within the target time is selected from the voltage value series after the last detection, and the target voltage value is removed from the voltage value series to obtain a target voltage value series. The target voltage value series is graded to obtain a preset number of voltage value sub-series, thereby obtaining the voltage threshold of the power level corresponding to the voltage value sub-series.
[0100] Optionally, a target voltage value detected within the target duration can be determined according to a preset duration and a target duration. The number of target voltage values detected within the target duration is obtained according to a ratio of the target duration to the preset duration, and in the voltage value series, starting from the voltage value detected last time, voltage values with the same number of target voltage values are selected as the target voltage value.
[0101] In an example, if the voltage value of the heating element is detected every 20 milliseconds and the target time is 60 milliseconds, the number of target voltage values detected within the target time is 3. Then, 3 target voltage values are selected from the voltage value series starting from the last detected voltage value, and these three target voltage values are removed from the voltage value series to obtain the target voltage value series.
[0102] In this embodiment, the target voltage value detected within the target time length is selected from the voltage value sequence starting from the voltage value detected last time, and the voltage value sequence without the target voltage value is used as the target voltage value series. The target voltage value series is then graded to obtain a voltage value sub-series with a preset number of grades, thereby obtaining the voltage threshold of the power level corresponding to the voltage value sub-series. In the obtained voltage threshold, the power level corresponding to each power level can support the startup and operation of the electronic device, so that the obtained voltage threshold can match the corresponding power level and actual usage, thereby improving the accuracy of the voltage threshold.
[0103] In some embodiments, the above method further comprises:
[0104] Detecting the state of the threshold calibration flag; determining the voltage threshold according to the state of the threshold calibration flag; and clearing the threshold calibration flag after determining the voltage threshold.
[0105] The threshold calibration flag refers to a flag corresponding to the voltage threshold determination. The states of the threshold calibration flag include on and off, where on can be represented by 1 and off by 0, or on by 0 and off by 1. An application scenario corresponding to this implementation may be that the battery of the electronic device has been working for a period of time, and after the electronic device receives a trigger for the threshold determination operation, it re-determines the threshold of the battery to obtain a re-determined voltage threshold, and corrects the original voltage threshold by the re-determined voltage threshold.
[0106] Optionally, the electronic device detects the state of the threshold calibration flag, and if the state of the threshold calibration flag is on, the voltage threshold is determined, and after the voltage threshold is determined, the threshold calibration flag is cleared. It can be understood that the voltage threshold can be determined by the voltage threshold determination method in the above embodiment.
[0107] In this embodiment, the voltage threshold is determined by detecting the state of the threshold calibration flag and, after the voltage threshold is determined, the threshold calibration flag is cleared. It is possible to determine whether the voltage threshold is determined based on the state of the threshold calibration flag, thereby achieving accurate and rapid judgment on whether the voltage value needs to be determined.
[0108] In one embodiment, as shown in FIG. 3 , the battery voltage threshold determination method includes steps 302 to 330 .
[0109] Step 302 : The electronic device enters a voltage threshold determination mode in response to a trigger of long pressing a power key for 6 seconds.
[0110] Step 304, determining the battery power status.
[0111] Step 306: If the battery power status is not fully charged, a charging reminder is issued.
[0112] Step 308 , in response to the charging trigger, charging the battery, and returning to step 304 .
[0113] Step 310: If the battery power state is fully charged, the threshold calibration flag is set to 1.
[0114] The threshold calibration flag is set to 1, indicating that the voltage threshold determination is in progress.
[0115] Step 312: the electronic device instructs the battery to discharge to the heating element at a preset power until the battery power reaches zero.
[0116] Step 314, detecting the voltage value and resistance value of the heating element during the heating process.
[0117] Step 316, calculating the actual power of the heating element according to the voltage value and the resistance value.
[0118] Step 318, calculating the duty cycle according to the preset power and the actual power of the heating element.
[0119] Step 320, adjusting the heating power of the heating element according to the duty cycle.
[0120] Step 322, obtaining a voltage value sequence arranged in order of detection time.
[0121] Step 324 , in the voltage value sequence, select the target voltage value detected within the target time period starting from the voltage value detected last time.
[0122] Step 326 , taking the voltage value sequence excluding the target voltage value as the target voltage value sequence, and dividing the target voltage value sequence into levels to obtain voltage value sub-sequences corresponding to a preset number of levels.
[0123] Step 328: Obtain a voltage threshold corresponding to each battery power level according to the voltage boundary value of the voltage value range corresponding to the voltage value subsequence.
[0124] Step 330: clear the threshold calibration flag.
[0125] In the above embodiment, the heating element is discharged from a fully charged battery state at a preset power until the battery power is zero, and at the same time, the actual power of the heating element is determined by detecting the voltage and resistance of the heating element, and the duty cycle is calculated according to the actual power and the preset power. The heating power of the heating element is adjusted according to the duty cycle so that the heating power of the heating element is the preset power, that is, the voltage value across the heating element is detected in a battery discharge cycle at a fixed power, and the voltage threshold corresponding to the battery power level is determined by a voltage value sequence formed by the voltage values, so that an accurate battery voltage threshold can be obtained. In addition, the determination of the voltage threshold can be flexibly implemented, so that the voltage threshold can be corrected so that the battery power level matches the voltage threshold, thereby improving the accuracy of the power level.
[0126] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0127] Based on the same inventive concept, the embodiment of the present application also provides a battery voltage threshold determination device for implementing the battery voltage threshold determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the battery voltage threshold determination device provided below can refer to the limitations of the battery voltage threshold determination method above, and will not be repeated here.
[0128] In an exemplary embodiment, as shown in FIG4 , a battery voltage threshold determination device is provided, comprising: a battery discharging module 402 , a heating power adjustment module 404 , a voltage value acquisition module 406 and a voltage threshold determination module 408 , wherein:
[0129] The battery discharging module 402 is used to instruct the battery to discharge to the heating element according to a preset power when the battery is fully charged until the battery power reaches zero;
[0130] A heating power adjustment module 404 is used to adjust the heating power of the heating element during the battery discharge process so that the heating element is heated by a preset power;
[0131] The voltage value acquisition module 406 is used to obtain the voltage value of the heating element during the heating process;
[0132] The voltage threshold determination module 408 is used to determine the voltage threshold corresponding to the battery power level according to the voltage value.
[0133] In some embodiments, the above device further includes a charging module, which is used to determine the battery power state in response to a trigger of a threshold setting operation before instructing the battery to discharge to the heating element according to a preset power until the battery power is zero; if the battery power state is not fully charged, issue a charging reminder; and charge the battery in response to a charging trigger;
[0134] The battery discharging module 402 is also used to stop charging the battery when the battery is fully charged, and instruct the battery to discharge to the heating element according to a preset power until the battery power is zero.
[0135] In some embodiments, the heating power adjustment module 404 is also used to detect the voltage value and resistance value of the heating element during the heating process; calculate the actual power of the heating element based on the voltage value and the resistance value; calculate the duty cycle based on the actual power and the preset power; and adjust the heating power of the heating element according to the duty cycle so that the heating element is heated by the preset power.
[0136] In some embodiments, the voltage threshold determination module 408 is also used to obtain a voltage value sequence consisting of voltage values arranged in order of detection time; divide the voltage value sequence into levels to obtain a voltage value sub-sequence corresponding to a preset number of levels; and obtain the voltage threshold corresponding to each battery power level based on the voltage boundary value of the voltage value range corresponding to the voltage value sub-sequence.
[0137] In some embodiments, the voltage value acquisition module 406 is further used to acquire the voltage value of the heating element during the heating process detected at each preset time interval;
[0138] The voltage threshold determination module 408 is also used to obtain the target duration; the target duration is greater than the preset duration and less than the discharge duration of the battery; in the voltage value sequence, the target voltage value detected within the target duration is selected starting from the voltage value detected last time; the voltage value sequence excluding the target voltage value is used as the target voltage value sequence, and the target voltage value sequence is graded to obtain a voltage value subsequence corresponding to the preset number of grades.
[0139] In some embodiments, the above-mentioned device also includes a flag management module for detecting the state of the threshold calibration flag; determining the voltage threshold according to the state of the threshold calibration flag; and clearing the threshold calibration flag after determining the voltage threshold.
[0140] Each module in the above-mentioned battery voltage threshold determination device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0141] In an exemplary embodiment, an electronic device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The electronic device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a battery voltage threshold determination method is implemented.
[0142] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0143] In an exemplary embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method for determining a battery voltage threshold in the above embodiment are implemented.
[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for determining a battery voltage threshold in the above embodiment are implemented.
[0145] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the battery voltage threshold determination method in the above embodiment.
[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0147] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0148] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0149] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for determining battery voltage threshold, characterized in that The method comprises: When the battery is fully charged, the battery is instructed to discharge the heating element at a preset power until the battery power is zero; During the discharge of the battery, the heating power of the heating element is adjusted so that the heating element is heated by the preset power; Obtain the voltage value of the heating element during heating; According to the voltage value, a voltage threshold value corresponding to the battery level is determined.
2. The method according to claim 1, characterized in that The instructing the battery to discharge the heating element at a preset power until the battery power reaches zero, further includes: In response to the trigger of the threshold setting operation, the battery power status is determined; If the battery power state is not fully charged, a charging prompt is issued; Responsive to a charging trigger, the battery is charged; When the battery is fully charged, the battery is instructed to discharge the heating element at a preset power until the battery power is zero, including: When the battery's power state is in a full-charge state, charging of the battery is stopped, and the battery is instructed to discharge the heating element at a preset power until the battery power is zero.
3. The method according to claim 1, characterized in that The heating power of the heating element is adjusted so that the heating element is heated by the preset power, including: Detect the voltage value and resistance value of the heating element during heating; Calculate the actual power of the heating element based on the voltage value and resistance value; The duty cycle is calculated based on the actual power and the preset power; The heating power of the heating element is adjusted according to the duty cycle, so that the heating element is heated by the preset power.
4. The method according to claim 1, characterized in that: According to the voltage value, the voltage threshold corresponding to the battery level is determined, including: Obtain a voltage value sequence composed of voltage values arranged in the order of detection time; The voltage value sequence is divided into grades to obtain a voltage value sub-sequence corresponding to the preset number of levels; According to the voltage boundary value of the voltage range corresponding to the voltage value sub-sequence, a voltage threshold value corresponding to each of the battery level is obtained.
5. The method according to claim 4, characterized in that Obtain the voltage value of the heating element during heating, including: Obtain the voltage value of the heating element detected for each preset time interval during heating; The voltage value sequence is divided into grades to obtain a voltage value sub-sequence corresponding to the preset number of grades, including: Obtaining a target duration; the target duration is greater than the preset duration and less than the discharge duration of the battery; In the voltage value sequence, the target voltage value detected within the target duration is selected from the last detected voltage value; The voltage value sequence at which the target voltage value is removed is used as the target voltage value sequence, and the target voltage value sequence is divided into grades to obtain a voltage value sub-sequence corresponding to the preset number of levels.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Detect the status of the threshold calibration flag; The voltage threshold is determined according to the state of the threshold calibration flag bit; After determining the voltage threshold, the threshold calibration flag bit is cleared.
7. A battery voltage threshold determination device, characterized in that The device comprises: The battery discharge module is used to instruct the battery to discharge the heating element according to the preset power when the battery is fully charged until the battery power is zero; The heating power adjustment module is used to adjust the heating power of the heating element during the discharge of the battery, so that the heating element is heated by the preset power; A voltage value acquisition module is used to obtain the voltage value of the heating element during heating; The voltage threshold determination module is configured to determine a voltage threshold corresponding to the battery level according to the voltage value.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
