Smoothing filtering methods and apparatuses, electronic devices and storage media for galvanometers
By determining the charging and discharging state of the lithium battery, calculating the change in charge, and adjusting the displayed charge and full charge capacity of the fuel gauge, the voltage jump problem caused by the internal resistance of the lithium battery is solved, achieving accurate estimation of RC and SOC and a smooth transition in user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NATIONZ TECH INC
- Filing Date
- 2024-12-31
- Publication Date
- 2026-06-30
AI Technical Summary
The internal resistance of lithium batteries causes a voltage difference between the battery terminal voltage and the system supply voltage. Changes in ambient temperature or load current can cause the battery terminal voltage to jump, affecting the accurate estimation of RC or SOC, resulting in users experiencing counterintuitive phenomena such as charging jumps and discharging jumps.
By determining the battery's charging and discharging state, calculating the actual change in battery capacity, adjusting the displayed battery capacity and full charge capacity of the fuel gauge, and employing a smoothing filter method to stabilize user experience data, the theoretical relationship F_SOC=F_RC/F_FCC is satisfied.
It achieves accurate estimation of RC and SOC, avoids jumps in power display, improves user experience, and simplifies the data output process.
Smart Images

Figure CN122309878A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of battery power technology, and more specifically, to a smoothing filtering method and apparatus, electronic device and storage medium for a power meter. Background Technology
[0002] With the development of the new energy industry, lithium batteries are increasingly being used in automobiles, home appliances, portable industrial equipment, photovoltaic energy storage, outdoor applications, and consumer electronics such as mobile phones, computers, and even wearable devices. As an energy storage medium, lithium batteries not only have the advantages of high energy density and simple charging and discharging applications, but their price is also decreasing with the development of industrial technology, making them increasingly suitable for more and more applications.
[0003] However, in order to maximize the efficiency of lithium battery capacity utilization, it is necessary to estimate the battery pack capacity, that is, to accurately estimate the remaining capacity (RC), full charge capacity (FCC), and battery state of charge (SOC, i.e., the remaining percentage of charge). This will not only make full use of the battery pack capacity, but also avoid overcharging and over-discharging, which could lead to safety issues.
[0004] Many current applications visualize RC or SOC using digital tubes or displays, or transmit the data to mobile phones or other devices via Bluetooth. This allows users to easily perceive the current battery pack's charge status and observe the entire process of RC and SOC changes during charging and discharging. However, due to the internal resistance of lithium batteries, there is a voltage difference between the voltage displayed by the battery pack and the actual voltage of the cells. This voltage difference is primarily caused by the battery's internal resistance, which is strongly correlated with temperature. Therefore, changes in ambient temperature, heat generated during battery charging and discharging, or changes in the load current during discharge can all cause jumps in the battery terminal voltage (the voltage displayed by the battery). The voltage input from the battery pack to the system is this battery terminal voltage. Since the system's power supply voltage has a minimum requirement (e.g., a device must be powered by more than 12V), the battery pack's power supply has a minimum limit. If the battery pack voltage drops below this minimum, it means that the battery pack's RC and SOC are zero.
[0005] In other words, changes in load size or temperature can cause changes in terminal voltage, which in turn can lead to changes in RC or SOC, resulting in users experiencing counterintuitive phenomena such as jumps during charging or even jumps during discharging. Summary of the Invention
[0006] To address at least one of the aforementioned problems, this application proposes a smoothing filtering method, apparatus, electronic device, and storage medium for a fuel gauge.
[0007] According to a first aspect of this application, at least one embodiment of this application provides a smoothing filtering method for a fuel gauge, the fuel gauge being used to display the battery level, the smoothing filtering method comprising: determining whether the battery is in a charging state or a discharging state; when the battery is in a charging state, determining whether the actual battery level at a later moment is greater than the actual battery level at a previous moment; when the battery is in a discharging state, determining whether the actual battery level at a later moment is less than the actual battery level at a previous moment; when the battery is in a charging state and the actual battery level at a later moment is greater than the actual battery level at a previous moment, or when the battery is in a discharging state and the actual battery level at a later moment is less than the actual battery level at a previous moment, determining whether the change in the actual battery level at a later moment is greater than a first preset threshold; when the change in the actual battery level at a later moment is greater than the first preset threshold, determining an adjustment step size based on the change in the actual battery level, and adjusting the displayed battery level of the fuel gauge based on the adjustment step size; when the change in the actual battery level at a later moment is less than or equal to the first preset threshold, adjusting the displayed battery level of the fuel gauge proportionally.
[0008] For example, in some embodiments of this application, the adjustment step size is calculated according to the following formula:
[0009] Smooth_Current=ΔT_RC / Smooth_time+Current before
[0010] Adjust the displayed power of the fuel gauge according to the following formula:
[0011] F_RC after =F_RC before +Smooth_Current*step_time
[0012] The number of times the displayed power level of the fuel gauge is adjusted is calculated using the following formula:
[0013] N = Smooth_time / step_time
[0014] Where Smooth_Current is the adjustment step size, ΔT_RC is the actual change in battery level, Smooth_time is the set adjustment time, and Current is the adjustment time. before F_RC is the current value at the previous moment. after F_RC is used to display the battery level at a later time. before The displayed battery level is the battery level at the previous moment, step_time is the set single-step time, and N is the number of adjustments.
[0015] For example, in some embodiments of this application, when the change in the actual battery level at a later time is less than or equal to a first preset threshold, adjusting the displayed battery level of the fuel gauge proportionally includes:
[0016] The change in displayed electricity level is determined using the following formula:
[0017] ΔF_RC / F_FCC=ΔT_RC / T_FCC
[0018] Adjust the displayed power of the fuel gauge according to the following formula:
[0019] F_RC after =F_RC before +ΔF_RC
[0020] Where ΔF_RC is the change in the displayed battery level, F_FCC is the displayed full charge capacity of the fuel gauge, ΔT_RC is the actual change in battery level, T_FCC is the actual full charge capacity of the fuel gauge, and F_RC after F_RC is used to display the battery level at a later time. before This displays the battery level from the previous moment.
[0021] For example, in some embodiments of this application, the method further includes: when the battery is in a charging state and the actual charge level of the battery at a later time is less than or equal to the actual charge level at a previous time, or when the battery is in a discharging state and the actual charge level of the battery at a later time is greater than or equal to the actual charge level at a previous time, maintaining the displayed charge level of the fuel gauge at the displayed charge level of the previous time.
[0022] For example, in some embodiments of this application, it further includes: adjusting the displayed full charge capacity of the fuel gauge, including: calculating the change in the displayed full charge capacity according to the following formula:
[0023] ΔF_FCC=F_FCC-(F_RC before -ΔRC)*T_FCC / (T_RC-ΔRC)
[0024] Where ΔF_FCC is the change in the displayed full charge capacity, ΔRC is the change in a single step, ΔRC = Smooth_Current * step_time, and T_RC is the actual charge level.
[0025] For example, in some embodiments of this application, if the change in the displayed full charge capacity is less than a second set threshold, the displayed full charge capacity is adjusted according to the change in the displayed full charge capacity; if the change in the displayed full charge capacity is greater than or equal to the second set threshold, the change in the displayed full charge capacity is determined to be the second set threshold.
[0026] For example, in some embodiments of this application, the method further includes: determining the battery state of charge based on the displayed power level and the displayed full charge capacity; determining the battery state of charge as the battery state of charge at the next moment if the change in the battery state of charge at the next moment is less than or equal to a third preset threshold; and gradually adjusting the battery state of charge if the change in the battery state of charge at the next moment is greater than the third preset threshold.
[0027] According to a second aspect of this application, at least one embodiment of this application provides a smoothing filter device for a fuel gauge, used to perform the smoothing filter method as described in any one of the first aspects. The smoothing filter device includes: a determining unit, used to determine whether the battery is in a charging state or a discharging state; and used to determine, when the battery is in a charging state, whether the actual charge level of the battery at a later time is greater than the actual charge level at a previous time; or when the battery is in a discharging state, whether the actual charge level of the battery at a later time is less than the actual charge level at a previous time; and a display unit, used to display, when the battery is in a charging state and the actual charge level of the battery at a later time is less than or equal to the actual charge level at a previous time, or when the battery is in a discharging state and the actual charge level of the battery at a later time is greater than or equal to the actual charge level at a previous time. In the case of a charge, the displayed charge level of the fuel gauge is maintained at the level of the previous moment; when the battery is in a charging state and the actual charge level of the battery at the next moment is greater than the actual charge level of the previous moment, or when the battery is in a discharging state and the actual charge level of the battery at the next moment is less than the actual charge level of the previous moment, the judgment unit is further configured to determine whether the change value of the actual charge level of the battery at the next moment is greater than a first preset threshold; when the change value of the actual charge level of the battery at the next moment is greater than the first preset threshold, the display unit is further configured to determine an adjustment step size based on the change value of the actual charge level and adjust the displayed charge level of the fuel gauge according to the adjustment step size; and when the change value of the actual charge level of the battery at the next moment is less than or equal to the first preset threshold, the displayed charge level of the fuel gauge is adjusted proportionally.
[0028] According to a third aspect of this application, at least one embodiment of this application provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to perform the method as described in any one aspect of the first application.
[0029] According to a fourth aspect of this application, at least one embodiment of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method as described in any one of the first aspects.
[0030] Through the above example embodiments, the smoothing filtering method and apparatus for a fuel meter provided in this application resolves the contradiction between the actual values of RC and SOC and the user's perceived values by separating data. It eliminates the need for cumbersome calculations, simplifying data output. By separating the actual data and the user experience data, the internal calculation logic and user experience data logic can run independently. Filtering is only performed on the final output. Internally, the internal actual data is calculated, and externally, the filtered user perception is displayed. Moreover, this method can satisfy the theoretical relationship F_SOC=F_RC / F_FCC while simultaneously achieving a smooth data transition in the user's perception.
[0031] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description
[0032] The above and other objects, features, and advantages of this application will become more apparent from the detailed description of exemplary embodiments with reference to the accompanying drawings. The drawings described below are merely some embodiments of this application and are not intended to limit the scope of this application.
[0033] Figure 1 A flowchart illustrating a smoothing filtering method for a fuel gauge, as shown in an exemplary embodiment;
[0034] Figure 2 This diagram shows the filtered effect of displaying the charge level during discharge.
[0035] Figure 3 The diagram shows the filtering effect under full charge capacity in the discharge state;
[0036] Figure 4 This shows a filtered graph illustrating the battery level during charging.
[0037] Figure 5 The image shows the filtering effect when the battery is fully charged.
[0038] Figure 6 A schematic diagram of a smoothing filter device for a fuel gauge, illustrating an exemplary embodiment, is shown.
[0039] Figure 7 This diagram illustrates the structure of an electronic device provided in this application. Detailed Implementation
[0040] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this application will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.
[0041] The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of these specific details, or other methods, components, materials, devices, etc. In these cases, well-known structures, methods, devices, implementations, materials, or operations will not be shown or described in detail.
[0042] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0043] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0044] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of exemplary embodiments, and the modules or processes in the drawings are not necessarily essential for implementing this application, and therefore cannot be used to limit the scope of protection of this application.
[0045] Figure 1 A flowchart illustrating a smoothing filtering method for a fuel gauge, as shown in an exemplary embodiment, is provided.
[0046] like Figure 1 As shown, the smoothing filtering method for the fuel gauge includes steps S101-S106.
[0047] In step S101, it is determined whether the battery is in a charging state or a discharging state.
[0048] According to the example embodiment, the actual battery pack charge (T_RC), the actual full charge capacity (T_FCC), and the current currently flowing through the battery pack (CURR) are obtained. The actual charge (T_RC) and actual full charge capacity (T_FCC) are the data objects that need to be filtered. Based on the actual charge (T_RC) and actual full charge capacity (T_FCC), the battery pack's displayed charge (F_RC), displayed full charge capacity (F_FCC), and displayed state of charge (F_SOC) to the user are output.
[0049] First, initialize the displayed battery level F_RC and the displayed full charge capacity F_FCC, setting them to be equal to the actual battery level T_RC and the actual full charge capacity T_FCC, respectively. Then, determine whether the battery pack is currently charging or discharging based on the current CURR flowing through it. For example, the current is positive when charging and negative when discharging.
[0050] In step S1021, when the battery is in a charging state, it is determined whether the actual battery charge at the next moment is greater than the actual battery charge at the previous moment.
[0051] In step S1022, when the battery is in a discharging state, it is determined whether the actual charge of the battery at the next moment is less than the actual charge at the previous moment.
[0052] In step S1023, it is determined that the battery is in a static state.
[0053] According to some embodiments, when the battery is in a static state, the displayed battery level F_RC and the displayed full charge capacity F_FCC are not adjusted; or the displayed battery level F_RC and the displayed full charge capacity F_FCC are adjusted according to the discharge state.
[0054] In step S103, when the battery is in a charging state and the actual battery level at the next moment is less than or equal to the actual battery level at the previous moment, or when the battery is in a discharging state and the actual battery level at the next moment is greater than or equal to the actual battery level at the previous moment, the battery level displayed on the fuel gauge is maintained at the level displayed at the previous moment.
[0055] In step S104, if the battery is in a charging state and the actual battery charge at the next moment is greater than the actual battery charge at the previous moment, or if the battery is in a discharging state and the actual battery charge at the next moment is less than the actual battery charge at the previous moment, it is determined whether the change in the actual battery charge at the next moment is greater than a first set threshold.
[0056] According to some embodiments, the first set threshold is 1% of the actual full charge capacity. This value can be set by the user. This application is only using this as an example, but it is not limited thereto.
[0057] In step S105, if the change in the actual battery level at a later time is greater than the first set threshold, the adjustment step size is determined based on the change in the actual battery level, and the displayed battery level of the fuel gauge is adjusted according to the adjustment step size.
[0058] According to the example embodiment, the adjustment step size is calculated using the following formula:
[0059] Smooth_Current=ΔT_RC / Smooth_time+Current before
[0060] Adjust the displayed power level of the fuel gauge according to the following formula:
[0061] F_RC after =F_RC before +Smooth_Current*step_time
[0062] Furthermore, the number of times the displayed power level is adjusted is calculated according to the following formula:
[0063] N = Smooth_time / step_time
[0064] Where Smooth_Current is the adjustment step size, ΔT_RC is the actual change in battery level, Smooth_time is the set adjustment time, and Current is the adjustment time. before F_RC is the current value at the previous moment. after F_RC is used to display the battery level at a later time. before This displays the battery level at the previous moment, where step_time is the set single-step time and N is the number of adjustments.
[0065] According to some embodiments, when the battery pack is in a charging state and reaches the charging cutoff voltage, the current CURR flowing through it decreases to C / 20, where C is the total capacity of the battery pack. Therefore, Smooth_Current can be set to (T_FCC - T_RC) / ΔT.
[0066] F_RC after =F_RC before +Smooth_Current*step_time
[0067] ΔT is the adjustment time, which can be set by yourself, for example, 40 seconds. Repeating for 40 seconds will ensure that the battery pack reaches SOC=100% at the moment of full charge.
[0068] In step S106, if the actual change in battery power at the next moment is less than or equal to the first set threshold, the displayed battery power of the fuel gauge is adjusted proportionally.
[0069] According to the example embodiment, the change in displayed battery power is determined using the following formula:
[0070] ΔF_RC / F_FCC=ΔT_RC / T_FCC
[0071] Adjust the displayed power level of the fuel gauge according to the following formula:
[0072] F_RC after =F_RC before +ΔF_RC
[0073] Where ΔF_RC is the displayed change in battery level, F_FCC is the displayed full charge capacity of the fuel gauge, ΔT_RC is the actual change in battery level, T_FCC is the actual full charge capacity of the fuel gauge, and F_RC after F_RC is used to display the battery level at a later time. before This displays the battery level from the previous moment.
[0074] According to some embodiments, as the battery pack discharges, the actual charge capacity T_RC and the actual full charge capacity T_FCC will change due to temperature rise and changes in load current. If the actual full charge capacity T_FCC changes, in order to maintain a constant SOC, the displayed full charge capacity F_FCC needs to be adjusted, which must satisfy the following:
[0075] (F_RC-ΔRC) / (F_FCC-ΔF_FCC)=(T_RC-ΔRC) / T_FCC
[0076] The change in the full charge capacity is displayed as follows:
[0077] ΔF_FCC=F_FCC-(F_RCbefore-ΔRC)*T_FCC / (T_RC-ΔRC)
[0078] Where ΔF_FCC represents the change in full charge capacity, ΔRC represents the change in a single step, ΔRC = Smooth_Current * step_time, and T_RC represents the actual charge level.
[0079] Specifically, if the change in the displayed full charge capacity is less than the second set threshold, the displayed full charge capacity is adjusted according to the change in the displayed full charge capacity.
[0080] If the change in the displayed full charge capacity is greater than or equal to a second preset threshold, the change in the displayed full charge capacity is determined as the second preset threshold. Furthermore, the change in the displayed full charge capacity is substituted into the above formula to obtain a new single-step change ΔRC, and the new displayed charge capacity is determined.
[0081] F_RC after =F_RC before+ΔRC
[0082] According to some embodiments, the second set threshold is 1% of the actual full charge capacity. This value can be set by the user. This application is only using this as an example, but it is not limited thereto.
[0083] According to some embodiments, because there are adjustment limitations on the amount of change in the displayed full capacity, and it is necessary to satisfy SOC = RC / FCC, meaning that the data filtering performance for SOC may not be able to smoothly change, a second data filtering process is required for SOC, including:
[0084] The battery state of charge (SOC) is determined based on the displayed battery level and the displayed full charge capacity. If the change in SOC at a later time is less than or equal to a third set threshold, the battery SOC at the later time is determined as the battery SOC at the later time. If the change in SOC at a later time is greater than the third set threshold, the battery SOC is gradually adjusted.
[0085] For example, when the calculated F_SOC changes from one value to the next, if the change is less than 1%, the original calculated value is directly used. If the change is greater than 1%, the single-step change is limited to 0.5%, meaning more steps are needed to complete what was originally a single operation. Alternatively, if F_SOC changes by 3%, six changes are required for a smooth transition.
[0086] According to some embodiments, data filtering for RC or FCC is adjusted based on changes in the true value, while data filtering for SOC is based on the difference between the data from the previous and subsequent steps.
[0087] According to some implementations, to improve the customer experience, data needs to be limited. For example, when F_RC > F_FCC, F_RC is limited to F_FCC. Or, when F_RC is less than 0, it is limited to 0. Similarly, for SOC, when SOC is greater than 100%, it is limited to 100%, and when SOC is less than 0, it is limited to 0.
[0088] Furthermore, when the actual capacity T_RC is not 0, the minimum value of the displayed capacity F_RC is limited to 1. When the actual capacity T_RC is not equal to T_FCC, i.e., when a full charge does not occur, the maximum limit of the displayed capacity F_RC is 99% * F_FCC.
[0089] This application provides an embodiment, as shown in the table below. Each row represents one second of data, where T_RC, T_FCC, and CURR are input data, and the others are calculated or output data. Assuming the user defines Smooth_time as 10s, it means that when the real data changes, it needs to smoothly transition from the user's perceived value to the real value in about 10s:
[0090]
[0091]
[0092] Table 1. Data Table for Smoothing Filtering Methods
[0093] In the first row of data, F_RC and F_FCC are initialized to be equal to T_RC and T_FCC, respectively, and T_SOC and F_SOC are equal in the initial state. As can be seen from the data, T_RC continuously decreases with the discharge current, but a significant jump occurs in T_RC in the 13th row, which may be due to temperature changes.
[0094] When the data changes, the F_RC that the user sees is not allowed to jump significantly, because the jump is in the direction of decreasing. Therefore, according to the requirement mentioned above that when the current is negative, the downward jump of F_RC cannot exceed 1% of F_FCC.
[0095] As mentioned above, we first calculate the intermediate variable Smooth_current for this transition process.
[0096] Smooth_Current=ΔT_RC / Smooth_time+Current before
[0097] = -200mAh * 3600s / 10s + (-15000)
[0098] =-72000mA-15000=-92000mA
[0099] Therefore, F_RC after line 13 should be decremented by integrating with the current - 92000mA, i.e., F_RC in line 14 = F_RC in line 13 - 92000 / 3600. The calculation is repeated similarly thereafter until F_RC <= T_RC, at which point F_RC and T_RC remain equal. Since F_FCC also changes by 200mAh in line 13, but according to the rule mentioned earlier, only a maximum change of 1% F_FCC is allowed each time, i.e., a change of 20mAh each time. Therefore, F_SOC is calculated according to F_SOC = F_RC / F_FCC. Checking F_SOC ensures that it does not increase during discharge and decreases by no more than 1% per step, satisfying the user's perception, while also satisfying the relationship F_SOC = F_RC / F_FCC.
[0100] At line 34, T_RC and T_FCC jump upwards. Since the current is negative, it means the battery pack is discharging. At this time, keep the old value of F_RC unchanged, and F_FCC needs to change to the true value at a rate of 20 per step. Then, calculate F_SOC according to F_SOC = F_RC / F_FCC, and verify that F_SOC does not increase during the discharge process and the downward jump does not exceed 1%.
[0101] It should be noted that if the calculated change in F_SOC exceeds 1%, it needs to be limited to the position where the change range is maximum of 1%. At this point, the single-step change value of F_FCC is calculated according to F_SOC = F_RC / F_FCC when the single-step change of SOC is limited to 1%.
[0102] In other words, the ultimate goal of this filtering method is to ensure that the variation of F_SOC is limited, satisfying the user's perception while maintaining the relationship F_SOC = F_RC / F_FCC. Anything that hinders this logic must be used to deduce the changes in other variables. The result obtained after filtering is as follows: Figure 2 and Figure 3 As shown. Figure 2 The F_RC filter effect diagram is shown under discharge conditions; Figure 3 The image shows the effect of F_SOC filtering under discharge conditions.
[0103] Furthermore, the above embodiments only illustrate the filtering process of T_RC changes during the discharge state. In practical applications, there are also processes where T_RC increases or decreases significantly during the charging state, or where T_RC increases or decreases significantly during the static state (when the battery pack has no current). The same principle applies to achieve the desired effect. Figure 4 and Figure 5 . Figure 4 The F_RC filter effect diagram is shown in the charging state; Figure 5 The image shows the effect of F_SOC filtering during charging.
[0104] This application provides a smoothing filtering method for a fuel gauge. By separating data, it resolves the contradiction between the actual values of RC and SOC and the user's perceived values. It simplifies data output by eliminating the need for cumbersome calculations and separating the actual data from the user experience data. The internal calculation logic and user experience data logic can run independently, and filtering is only performed on the final output. Internally, it calculates the internal actual data, and externally, it displays the filtered user perception. Moreover, this method can satisfy the theoretical relationship F_SOC = F_RC / F_FCC while simultaneously achieving a smooth data transition in the user's perception.
[0105] This application also provides a smoothing filter device for a fuel gauge, such as... Figure 6As shown, it is used to perform the smoothing filtering method as described above. The smoothing filtering device includes a judgment unit 601 and a display unit 602.
[0106] The judgment unit 601 is used to determine whether the battery is in a charging state or a discharging state; and when the battery is in a charging state, it is used to determine whether the actual battery charge at a later moment is greater than the actual battery charge at a previous moment; or when the battery is in a discharging state, it is used to determine whether the actual battery charge at a later moment is less than the actual battery charge at a previous moment.
[0107] The display unit 602 is used to maintain the displayed battery level as the displayed battery level of the previous moment when the battery is in a charging state and the actual battery level at the next moment is less than or equal to the actual battery level at the previous moment, or when the battery is in a discharging state and the actual battery level at the next moment is greater than or equal to the actual battery level at the previous moment.
[0108] When the battery is in a charging state and the actual battery charge at a later moment is greater than the actual battery charge at a previous moment, or when the battery is in a discharging state and the actual battery charge at a later moment is less than the actual battery charge at a previous moment, the determination unit 601 is also used to determine whether the change in the actual battery charge at a later moment is greater than a first set threshold.
[0109] If the actual change in battery charge at a later time exceeds a first set threshold, the display unit 602 is further configured to determine an adjustment step size based on the actual change in battery charge and adjust the displayed charge of the fuel gauge according to the adjustment step size; and if the actual change in battery charge at a later time is less than or equal to the first set threshold, the displayed charge of the fuel gauge is adjusted proportionally.
[0110] The smoothing filter device is used to perform the smoothing filter method as described above, so it will not be described again here.
[0111] The smoothing filtering method and apparatus provided in this application have a wide range of applications. They can be used not only for lithium battery fuel gauges, but also for matching similar methods in any data display that results in a poor user experience, thereby resolving the contradiction between user perception requirements and the processing of realistic theoretical data. Examples include displaying remaining usage time on tablets, remaining charging time on mobile phones, remaining mileage in cars, and remaining lifespan of equipment; as well as signal processing, radio, motor control, data sampling, gas flow, detection, and exploration.
[0112] Figure 7 This diagram illustrates the structure of an electronic device provided in this application.
[0113] See Figure 7 , Figure 7An electronic device is provided, including a processor and a memory. The memory stores computer instructions, which, when executed by the processor, cause the processor to perform the computer instructions to achieve the following: Figure 1 The method and its detailed scheme are shown.
[0114] It should be understood that the above-described device embodiments are merely illustrative, and the device disclosed in this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0115] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0116] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor or chip can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, on-chip cache, off-chip memory, and storage can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.
[0117] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments disclosed herein. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0118] This application also provides a non-transitory computer storage medium storing a computer program, which, when executed by multiple processors, causes the processors to perform actions such as... Figure 1 The method and its detailed scheme are shown.
[0119] It should be clearly understood that this application describes how specific examples are formed and used, but this application is not limited to any details of these examples. Rather, based on the teachings of the disclosure of this application, these principles can be applied to many other embodiments.
[0120] Furthermore, it should be noted that the above figures are merely illustrative representations of the processes included in the method according to exemplary embodiments of this application, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0121] Exemplary embodiments of this application have been specifically shown and described above. It should be understood that this application is not limited to the detailed structures, arrangements, or implementation methods described herein; rather, this application is intended to cover various modifications and equivalent arrangements that fall within the objectives and scope of the appended claims.
Claims
1. A smoothing filtering method for a fuel gauge, characterized in that, The fuel gauge is used to display the battery level, and the smoothing filtering method includes: Determine whether the battery is in a charging or discharging state; When the battery is in a charging state, determine whether the actual charge level of the battery at a later moment is greater than the actual charge level at a previous moment. When the battery is in a discharging state, determine whether the actual charge of the battery at the next moment is less than the actual charge at the previous moment. When the battery is in a charging state and the actual charge level of the battery at a later time is greater than the actual charge level at a previous time, or when the battery is in a discharging state and the actual charge level of the battery at a later time is less than the actual charge level at a previous time, it is determined whether the change in the actual charge level of the battery at a later time is greater than a first preset threshold. If the change in the actual battery level at a later time exceeds the first set threshold, an adjustment step size is determined based on the change in the actual battery level, and the displayed battery level of the fuel gauge is adjusted based on the adjustment step size. If the actual change in battery power at a later time is less than or equal to the first set threshold, the displayed battery power of the fuel gauge is adjusted proportionally.
2. The smoothing filtering method as described in claim 1, characterized in that, The adjustment step size is calculated using the following formula: Smooth_Current=ΔT_RC / Smooth_time+Current before Adjust the displayed power of the fuel gauge according to the following formula: F_RC after =F_RC before +Smooth_Current*step_time The number of times the displayed power level of the fuel gauge is adjusted is calculated using the following formula: N = Smooth_time / step_time Where Smooth_Current is the adjustment step size, ΔT_RC is the actual change in battery level, Smooth_time is the set adjustment time, and Current is the adjustment time. before F_RC is the current value at the previous moment. after F_RC is used to display the battery level at a later time. before The displayed battery level is the battery level at the previous moment, step_time is the set single-step time, and N is the number of adjustments.
3. The smoothing filtering method as described in claim 2, characterized in that, When the change in the actual battery charge at a later time is less than or equal to a first preset threshold, the displayed battery charge of the fuel gauge is adjusted proportionally, including: The change in displayed electricity level is determined using the following formula: ΔF_RC / F_FCC=ΔT_RC / T_FCC Adjust the displayed power of the fuel gauge according to the following formula: F_RC after = F_RC before +ΔF_RC Where ΔF_RC is the change in the displayed battery level, F_FCC is the displayed full charge capacity of the fuel gauge, ΔT_RC is the actual change in battery level, T_FCC is the actual full charge capacity of the fuel gauge, and F_RC after F_RC is used to display the battery level at a later time. before This displays the battery level from the previous moment.
4. The smoothing filtering method as described in claim 1, characterized in that, Also includes: When the battery is in a charging state and the actual battery level at a later moment is less than or equal to the actual battery level at a previous moment, or when the battery is in a discharging state and the actual battery level at a later moment is greater than or equal to the actual battery level at a previous moment, the battery level displayed by the fuel gauge shall be maintained as the displayed battery level at the previous moment.
5. The smoothing filtering method as described in claim 3, characterized in that, Also includes: Adjusting the display of the full charge capacity on the fuel gauge includes: The change in the displayed full charge capacity is calculated using the following formula: ΔF_FCC=F_FCC-(F_RC before -ΔRC)*T_FCC / (T_RC-ΔRC) Where ΔF_FCC is the change in the displayed full charge capacity, ΔRC is the change in a single step, ΔRC = Smooth_Current * step_time, and T_RC is the actual charge level.
6. The smoothing filtering method as described in claim 5, characterized in that, If the change in the displayed full charge capacity is less than a second preset threshold, the displayed full charge capacity is adjusted according to the change in the displayed full charge capacity. If the change in the displayed full charge capacity is greater than or equal to the second set threshold, the change in the displayed full charge capacity is determined to be the second set threshold.
7. The smoothing filtering method as described in claim 1, characterized in that, Also includes: The battery state of charge is determined based on the displayed battery level and the displayed full charge capacity. If the change in the state of charge of the battery at the next time moment is less than or equal to the third set threshold, the state of charge of the battery at the next time moment is determined. If the change in the battery state of charge at a later time exceeds the third preset threshold, the battery state of charge is gradually adjusted.
8. A smoothing filter device for a fuel gauge, characterized in that, For performing the smoothing filtering method as described in any one of claims 1-7, the smoothing filtering device comprises: The determination unit is used to determine whether the battery is in a charging state or a discharging state; and is used to determine whether the actual charge level of the battery at a later moment is greater than the actual charge level at a previous moment when the battery is in a charging state; or to determine whether the actual charge level of the battery at a later moment is less than the actual charge level at a previous moment when the battery is in a discharging state. The display unit is configured to maintain the displayed battery level of the fuel gauge at the level of the previous moment when the battery is in a charging state and the actual battery level at the next moment is less than or equal to the actual battery level at the previous moment, or when the battery is in a discharging state and the actual battery level at the next moment is greater than or equal to the actual battery level at the previous moment. When the battery is in a charging state and the actual charge level of the battery at a later moment is greater than the actual charge level at a previous moment, or when the battery is in a discharging state and the actual charge level of the battery at a later moment is less than the actual charge level at a previous moment, the judgment unit is further used to determine whether the change value of the actual charge level of the battery at a later moment is greater than a first preset threshold. If the change in the actual battery charge at a later time is greater than a first preset threshold, the display unit is further configured to determine an adjustment step size based on the change in the actual battery charge and adjust the displayed battery charge of the fuel gauge based on the adjustment step size; and if the change in the actual battery charge at a later time is less than or equal to the first preset threshold, adjust the displayed battery charge of the fuel gauge proportionally.
9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.