Electric quantity metering method and device, electronic equipment and medium
During the discharge process of the battery pack, the maximum voltage and minimum voltage are used to determine the normal discharge state and correct the actual voltage in the previous sampling period, the problem of voltage instability due to path switching is solved, and the accuracy and stability of power detection are achieved sex.
Patent Information
- Application Number
- CN202310974820.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
AI Technical Summary
During the discharge process of battery pack, the voltage is unstable due to the path switching. When directly calculating the SOC using the voltage lookup method, the real battery capacity information cannot be accurately obtained.
By determining the maximum voltage and minimum voltage of the current sampling period, we judge whether the battery pack is in a normal discharge state, and correct it based on the actual voltage and voltage drop voltage of the previous sampling period to obtain the actual voltage of the current sampling period, so as to accurately determine the battery pack power.
It improves the stability and accuracy of the actual voltage, ensures the accuracy and stability of power detection, and solves the problem of inaccurate power detection caused by path switching.
Smart Images

Figure CN119438926A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electric quantity detection, and in particular to an electric quantity measurement method, device, electronic equipment and medium. Background Art
[0002] The voltage lookup table method is a commonly used method for calculating the battery state of charge (SOC). The mapping relationship between the terminal voltage and the power can be obtained in advance, and the current power value can be inferred by collecting the battery terminal voltage during the charging and discharging process. To ensure that the battery is in a safe working state, the battery management system (BMS) in the battery pack will automatically turn on and off the battery's charging and discharging field effect tube (Metal-Oxide-Semiconductor, MOS) according to the battery voltage status. During the charging process, when the battery voltage reaches the overcharge protection voltage threshold set by the BMS, the BMS will disconnect the charging MOS to prevent the battery from overcharging. When the battery voltage drops to the overcharge protection recovery voltage set by the BMS, the charging MOS is turned on, and the battery is allowed to continue charging.
[0003] If the battery voltage is between the overcharge protection voltage and the overcharge protection recovery voltage, the battery pack is in a discharge state. When the current is small, the current passes through the diode in parallel with the MOS tube, and the voltage at the battery pack end will have a voltage drop of about 0.6V. When the current is large, the MOS tube is turned on, and the current passes through the MOS tube without a voltage drop. If the battery pack is connected to a constant power load, the current is just near the critical current that determines whether to switch the path. The MOS tube will be frequently turned on and off, and there will be a random error of 0-0.6v when sampling the battery pack terminal voltage. In this process, if the voltage lookup table method is used to directly calculate the SOC of the terminal voltage, the SOC will change continuously with the terminal voltage, and the true battery power information cannot be accurately obtained. Summary of the invention
[0004] The present application provides a power measurement method, device, electronic device and medium to accurately determine the actual voltage within a sampling period when the voltage changes, and further accurately determine the power of a battery pack.
[0005] According to one aspect of the present application, a power measurement method is provided, the method comprising:
[0006] Determine the maximum voltage and the minimum voltage among the voltages collected in the current sampling period;
[0007] Determining whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle;
[0008] If the battery pack is in a normal discharge state, the actual voltage of the previous sampling cycle is corrected according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle to obtain the actual voltage of the current sampling cycle;
[0009] According to the actual voltage of the current sampling period, the power of the battery pack in the current sampling period is determined.
[0010] According to another aspect of the present application, there is provided an electric quantity metering device, the device comprising:
[0011] The voltage acquisition module determines the maximum voltage and the minimum voltage among the voltages collected in the current sampling period;
[0012] A state determination module, used to determine whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle;
[0013] an actual voltage determination module, configured to correct the actual voltage of the previous sampling cycle according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle, to obtain the actual voltage of the current sampling cycle if the battery pack is in a normal discharge state;
[0014] The power determination module is used to determine the power of the battery pack in the current sampling period according to the actual voltage in the current sampling period.
[0015] According to another aspect of the present application, an electronic device is provided, the device comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the electricity metering method of any embodiment of the present application.
[0019] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the electricity metering method of any embodiment of the present application when executed.
[0020] The technical solution of the embodiment of the present application determines the maximum voltage and the minimum voltage of the voltage collected in the current sampling period; determines whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling period, and / or the minimum voltage and the voltage drop voltage of the previous sampling period; if the battery pack is in a normal discharge state, the actual voltage of the previous sampling period is corrected according to the maximum voltage and the actual voltage of the previous sampling period, and / or the minimum voltage and the voltage drop voltage of the previous sampling period to obtain the actual voltage of the current sampling period; and determines the power of the battery pack in the current sampling period according to the actual voltage of the current sampling period. The above scheme solves the problem of inaccurate power detection due to unstable path switching voltage during the discharge process of the battery pack. The actual voltage of the current sampling period is obtained by correcting the actual voltage of the previous sampling period, thereby improving the stability and accuracy of the actual voltage, and thus improving the accuracy of the detected power.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments 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 drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flow chart of an electricity metering method provided according to Embodiment 1 of the present application;
[0024] Figure 2 is a schematic diagram of the system structure of a battery pack charging and discharging according to the first embodiment of the present application;
[0025] Figure 3 is a flow chart of an electricity metering method provided according to Embodiment 2 of the present application;
[0026] Figure 4 is a flow chart of an electricity metering method provided according to Embodiment 3 of the present application;
[0027] Figure 5 is a structural schematic diagram of an electricity metering device provided according to Embodiment 4 of the present application;
[0028] Figure 6 It is a structural schematic diagram of an electronic device provided according to Embodiment 5 of the present application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first", "second", "third", "fourth", "actual", "preset", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] Embodiment 1
[0032] Figure 1 This is a flow chart of a power metering method provided in the first embodiment of the present application. The embodiment of the present application can be applied to the case of detecting the power of a battery pack. Typically, it can be applied to the case where the discharge path of the battery pack is frequently switched, resulting in unstable voltage. The method can be executed by a power metering device, which can be implemented in the form of hardware and / or software, and the power metering device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0033] S110 . Determine the maximum voltage and the minimum voltage among the voltages collected in the current sampling period.
[0034] Among them, the current sampling period can be any period that needs to determine the actual voltage. The specific value of the acquisition period can be determined according to the actual situation. For example, a suitable acquisition period is set so that the number of voltages collected during the acquisition period meets the requirements. For another example, a suitable acquisition period is set so that the minimum voltage to the maximum voltage collected during the acquisition period reaches a preset span. In addition, in order to reflect the instantaneous nature of the voltage, the current sampling period can be as short as possible on the basis of ensuring other conditions.
[0035] For example, the schematic diagram of the battery pack charging and discharging system is as follows: Figure 2As shown. To ensure that the battery is in a safe working state, the battery management system BMS in the battery pack will automatically turn on and off the battery's charging and discharging field effect tube MOS according to the battery voltage status. During the charging process, when the battery voltage reaches the overcharge protection voltage threshold set by the BMS, the BMS will disconnect the charging MOS to prevent the battery from overcharging. When the battery voltage drops to the overcharge protection recovery voltage set by the BMS, the charging MOS is turned on, and the battery is allowed to continue charging. The voltage between the positive and negative poles of the battery cell is the real voltage of the battery pack. During the discharge process, the collected voltage is the voltage of the battery cell after passing through the discharge control MOS. During the discharge process of the battery pack, that is, when the battery pack is not charged, it means that the battery voltage has reached the overcharge protection voltage threshold set by the BMS, and the MOS tube in the discharge control MOS is disconnected. When the current discharged by the battery pack is less than the preset current threshold, the current passes through the diode in the discharge control MOS. At this time, there will be a voltage drop, which is generally 0.6V, where V is the unit of voltage volts. If the current is greater than or equal to the preset current threshold, the MOS tube in the discharge control MOS is controlled to be turned on to prevent the large current from damaging the diode. At this time, there is no voltage drop. If the load connected to the battery pack is a constant power load, the current is near the preset current threshold, and the change in current will cause the current path to switch frequently, the MOS tube to switch frequently, and the collected voltage to fluctuate frequently. In this case, the embodiment of the present application does not directly use the collected voltage value to determine the power value, but first determines the maximum voltage and minimum voltage in the voltage collected in the current sampling period to determine whether there is a frequent switching of the discharge path in the current sampling period, and in the case of frequent switching, further judges the discharge state of the battery pack based on the maximum voltage and minimum voltage.
[0036] Specifically, during the process of voltage acquisition in the current acquisition cycle, each voltage is collected and compared with the voltages that have been collected and retained, and the larger voltage and the smaller voltage are retained. Each time a voltage is collected, it is compared with the retained larger voltage and the smaller voltage to obtain the maximum voltage and the minimum voltage in the current acquisition cycle. It is also possible to compare all voltages after all voltages are collected at the end of the current acquisition cycle to obtain the maximum voltage and the minimum voltage among them.
[0037] S120: Determine whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle.
[0038] Among them, the previous sampling cycle is a sampling cycle adjacent to the current sampling cycle and earlier than the current sampling cycle. The actual voltage of the previous sampling cycle is the voltage used to determine the battery pack power in the previous sampling cycle, which is the voltage between the positive and negative poles of the battery cell, that is, the voltage when there is no voltage drop when the voltage is transmitted by the MOS tube path. The voltage drop voltage of the previous sampling cycle is the voltage that reaches the load end when the actual voltage of the previous sampling cycle is transmitted through the diode path in the discharge control MOS. Since there is a voltage drop when the voltage is transmitted through the diode, the voltage drop voltage is generally 0.6V less than the actual voltage.
[0039] During the discharge process of the battery pack, the voltage will generally decrease gradually, so the actual voltage of the current sampling cycle will be less than the actual voltage of the previous sampling cycle. There is a limit to the amplitude of the voltage reduction, and the limit can be determined based on the performance of the battery pack and the specific value of the sampling cycle. If the battery pack is in a normal discharge state, the amplitude of the voltage reduction should be less than the limit. In an embodiment of the present application, the maximum voltage can be preset to the voltage value when there is no voltage drop in the current acquisition cycle, and the amplitude of the voltage reduction is determined based on the maximum voltage and the actual voltage of the previous sampling cycle, thereby determining whether the battery pack is in a normal discharge state. And / or the minimum voltage can be preset to the voltage value when there is a voltage drop in the current acquisition cycle, and the amplitude of the voltage reduction is determined based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, thereby determining whether the battery pack is in a normal discharge state.
[0040] In the embodiment of the present application, if the current sampling period is the first sampling period, the method further includes:
[0041] The maximum voltage is used as the actual voltage of the current sampling period, and the minimum voltage is used as the voltage drop voltage in the current sampling period.
[0042] In the embodiment of the present application, if the current sampling cycle is not the first sampling cycle, there is a previous sampling cycle of the current sampling cycle. If the current sampling cycle is the first sampling cycle, there is no previous sampling cycle of the current sampling cycle. Therefore, the maximum voltage in the first sampling cycle can be directly used as the actual voltage, and the minimum voltage can be used as the voltage drop voltage for use in subsequent actual voltage calculations. The actual voltage and the voltage drop voltage are initialized in the above manner to ensure that the actual voltage can also be determined in the first sampling cycle to determine the battery pack power, and provide a reference for the calculation of the actual voltage in subsequent sampling cycles.
[0043] In an embodiment of the present application, determining whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle includes:
[0044] determining a voltage difference between the maximum voltage and the minimum voltage;
[0045] If the voltage difference is greater than a preset voltage difference threshold, determining whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle;
[0046] The preset difference threshold is determined according to the voltage drop value when the voltage passes through different paths during the discharge process of the battery pack.
[0047] Exemplarily, the maximum voltage should reflect the voltage when there is no voltage drop during the discharge process, and the minimum voltage should reflect the voltage when there is a voltage drop during the discharge process. In general, the voltage drop should be 0.6V. If the voltage difference between the maximum voltage and the minimum voltage is greater than the preset voltage difference threshold, it means that there is a problem of path switching during the discharge process of the battery pack, and there is a voltage change. The preset voltage difference threshold can be determined based on the voltage drop of 0.6V and the voltage acquisition error, for example, it can be set to 0.55V. If it is determined that there is a voltage change, it is determined whether the battery pack is in a normal discharge state based on the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle. If the voltage difference is less than or equal to the preset voltage difference threshold, it is determined that there is no voltage drop change in the voltage. At this time, there is no frequent path switching during the discharge process of the battery pack, and the collected voltage is relatively stable. The MOS tube is in a stable on or off state, so the power can be directly determined based on the voltage collected in the current sampling cycle.
[0048] S130. If the battery pack is in a normal discharge state, the actual voltage of the previous sampling cycle is corrected according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle to obtain the actual voltage of the current sampling cycle.
[0049] For example, if the battery pack is in a normal discharge state, the voltage value gradually decreases, and the actual voltage of the current sampling cycle should be less than the actual voltage of the previous sampling cycle. The maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle, can reflect the voltage difference between the current sampling cycle and the previous sampling cycle. The actual voltage of the previous sampling cycle can be corrected according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle, so as to obtain the actual voltage of the current sampling cycle. If the discharge path of the battery pack is frequently switched, the instantaneous voltage value obtained by sampling will be unstable. Directly determining the battery pack power level based on the instantaneous voltage value obtained by sampling cannot reflect the true value of the stable battery pack. The above scheme can be used to address the situation where the discharge path is frequently switched. The maximum voltage collected in the current sampling cycle and the actual voltage of the previous sampling cycle, and / or the minimum voltage collected in the current sampling cycle and the voltage drop voltage of the previous sampling cycle are used to calculate the voltage difference between the current sampling cycle and the previous sampling cycle, and then the actual voltage of the previous sampling cycle is corrected, thereby ensuring the stability of the actual voltage and solving the problem of unstable instantaneous voltage sampled, thereby improving the accuracy and stability of battery pack power detection.
[0050] S140: Determine the power level of the battery pack in the current sampling period according to the actual voltage in the current sampling period.
[0051] In the embodiment of the present application, the voltage table lookup method can be used to calculate the battery pack power. The mapping relationship between the terminal voltage and the power is obtained in advance, and the power corresponding to the actual voltage of the current sampling period is determined according to the mapping relationship as the battery pack power of the current sampling period.
[0052] The technical solution of the embodiment of the present application determines the maximum voltage and the minimum voltage of the voltage collected in the current sampling period; determines whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling period, and / or the minimum voltage and the voltage drop voltage of the previous sampling period; if the battery pack is in a normal discharge state, the actual voltage of the previous sampling period is corrected according to the maximum voltage and the actual voltage of the previous sampling period, and / or the minimum voltage and the voltage drop voltage of the previous sampling period to obtain the actual voltage of the current sampling period; and determines the power of the battery pack in the current sampling period according to the actual voltage of the current sampling period. The above scheme solves the problem of inaccurate power detection due to unstable path switching voltage during the discharge process of the battery pack. The actual voltage of the current sampling period is obtained by correcting the actual voltage of the previous sampling period, thereby improving the stability and accuracy of the actual voltage, and thus improving the accuracy of the detected power.
[0053] Embodiment 2
[0054] Figure 3 This is a flow chart of a power metering method provided in the second embodiment of the present application. The present embodiment is optimized based on the above embodiment. For solutions not described in detail in the present embodiment, please refer to the above embodiment. Figure 3 As shown, the method of the embodiment of the present application specifically includes the following steps:
[0055] S210: Determine the maximum voltage and the minimum voltage among the voltages collected in the current sampling period.
[0056] S220: Determine a first difference between the actual voltage in the previous sampling period and the maximum voltage.
[0057] For example, the voltage of the battery pack decreases gradually during discharge, and the actual voltage of the previous sampling period should be greater than the maximum voltage. The actual voltage of the previous sampling period can be subtracted from the maximum voltage to obtain the first difference. In the actual calculation process, the actual voltage of the previous sampling period can be subtracted from the maximum voltage to obtain the difference and then take the absolute value as the first difference.
[0058] S230: If the first difference is less than a first preset difference threshold, determine that the battery pack is in a normal discharge state.
[0059] Exemplarily, the voltage of the battery pack gradually decreases during discharge, and the magnitude of the voltage reduction is determined by the performance of the battery pack and the length of the sampling period. The first preset difference threshold value, for example, 0.05V, can be determined based on the magnitude of the voltage reduction, the length of the sampling period, and the voltage acquisition error. If the first difference value is less than the first preset difference threshold value, it is determined that the difference between the actual voltage of the previous sampling period and the maximum voltage of the current sampling period satisfies the magnitude of the voltage reduction, and the battery pack is determined to be in a normal discharge state.
[0060] S240: Determine a second difference between the voltage drop in the previous sampling period and the minimum voltage.
[0061] For example, the voltage of the battery pack decreases gradually during discharge, and the actual voltage drop in the previous sampling cycle should be greater than the minimum voltage. The voltage drop in the previous sampling cycle minus the minimum voltage can be used to obtain the second difference. In the actual calculation process, the voltage drop in the previous sampling cycle minus the minimum voltage can be used to obtain the absolute value of the difference, which is used as the second difference.
[0062] S250: If the second difference is less than a second preset difference threshold, determine that the battery pack is in a normal discharge state.
[0063] Exemplarily, the second preset difference threshold value may be determined according to the voltage reduction amplitude and the voltage acquisition error, for example, it may be 0.05 V. If the second difference value is less than the second preset difference threshold value, it is determined that the difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage of the current sampling cycle satisfies the voltage reduction amplitude, and it is determined that the battery pack is in a normal discharge state.
[0064] In the embodiment of the present application, if the maximum voltage in the current acquisition cycle is actually the voltage collected when there is no voltage drop when the battery pack is discharged, the first difference between the actual voltage and the maximum voltage in the previous sampling cycle is less than the first preset difference threshold. If the maximum voltage in the current acquisition cycle is actually the voltage collected when there is a voltage drop when the battery pack is discharged, the first difference between the actual voltage and the maximum voltage in the previous sampling cycle is greater than the preset voltage difference threshold. If the maximum voltage in the current sampling cycle is not actually the voltage collected when there is no voltage drop when the battery pack is discharged, but the voltage collected under other circumstances, such as the intermediate process voltage value collected during path switching or other unstable moments, the first difference between the actual voltage and the maximum voltage in the previous sampling cycle may be greater than or equal to the first preset difference threshold, and less than the preset voltage difference threshold. Therefore, S220-S230 can be executed first. If the first difference is less than the first preset difference threshold, it is determined that the battery pack is in a normal discharge state, and S240-S250 does not need to be executed again. If the first difference is greater than the preset voltage difference threshold, S240-S250 is executed. If the first difference is greater than or equal to the first preset difference threshold and less than the preset voltage difference threshold, the voltage value of the current sampling period is directly discarded, and the actual voltage of the previous sampling period is directly used as the actual voltage of the current sampling period.
[0065] If the minimum voltage in the current acquisition cycle is actually the voltage collected when the battery pack is discharged with a voltage drop, the second difference between the voltage drop voltage and the minimum voltage in the previous sampling cycle is less than the second preset difference threshold. If the maximum voltage in the current acquisition cycle is actually the voltage collected when the battery pack is discharged without a voltage drop, the first difference between the voltage drop voltage and the minimum voltage in the previous sampling cycle is greater than the preset voltage difference threshold. If the minimum voltage in the current sampling cycle is actually not the voltage collected when the battery pack is discharged with a voltage drop, but the voltage collected in other cases, such as the intermediate process voltage value collected during channel switching or other unstable moments, the second difference between the voltage drop voltage and the minimum voltage in the previous sampling cycle may be greater than or equal to the second preset difference threshold, and less than the preset voltage difference threshold. Therefore, S240-S250 can be executed first. If the second difference is less than the second preset difference threshold, it is determined that the battery pack is in a normal discharge state, and S220-S230 does not need to be executed again. If the second difference is greater than the preset voltage difference threshold, S220-S230 is executed. If the second difference is greater than or equal to the second preset difference threshold and less than the preset voltage difference threshold, the voltage value of the current sampling period is directly discarded, and the actual voltage of the previous sampling period is directly used as the actual voltage of the current sampling period.
[0066] S260. If it is determined that the battery pack is in a normal discharge state based on the maximum voltage and the actual voltage of the previous sampling cycle, the actual voltage of the previous sampling cycle is corrected based on the first difference between the actual voltage of the previous sampling cycle and the maximum voltage to obtain the actual voltage of the current sampling cycle.
[0067] Exemplarily, if the battery pack is determined to be in a normal discharge state based on the maximum voltage and the actual voltage of the previous sampling cycle, that is, the first difference is less than the first preset difference threshold, then the first difference is determined to be able to reflect the voltage difference between the previous sampling cycle and the current sampling cycle. Based on the first difference between the actual voltage of the previous sampling cycle and the maximum voltage, the actual voltage of the previous sampling cycle is corrected to obtain the actual voltage of the current sampling cycle.
[0068] In the embodiment of the present application, the actual voltage of the previous sampling period is corrected according to the first difference between the actual voltage of the previous sampling period and the maximum voltage to obtain the actual voltage of the current sampling period, including:
[0069] The actual voltage of the previous sampling period is subtracted from the first difference to obtain the actual voltage of the current sampling period.
[0070] For example, since the voltage of the battery pack gradually decreases during the discharge process, that is, the actual voltage of the current sampling cycle is less than the actual voltage of the previous sampling cycle, and the first difference reflects the voltage difference between the previous sampling cycle and the current sampling cycle, the actual voltage of the previous sampling cycle is subtracted from the first difference to obtain the actual voltage of the current sampling cycle.
[0071] S270. If it is determined that the battery pack is in a normal discharge state based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, the actual voltage of the previous sampling cycle is corrected based on the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage to obtain the actual voltage of the current sampling cycle.
[0072] Exemplarily, if the battery pack is determined to be in a normal discharge state based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, that is, the second difference is less than the second preset difference threshold, then the second difference is determined to be able to reflect the voltage difference between the previous sampling cycle and the current sampling cycle. According to the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage, the actual voltage of the previous sampling cycle is corrected to obtain the actual voltage of the current sampling cycle.
[0073] In the embodiment of the present application, the actual voltage of the previous sampling period is corrected according to the second difference between the voltage drop voltage of the previous sampling period and the minimum voltage to obtain the actual voltage of the current sampling period, including:
[0074] The actual voltage of the previous sampling period is subtracted from the second difference to obtain the actual voltage of the current sampling period.
[0075] For example, since the voltage of the battery pack gradually decreases during the discharge process, that is, the actual voltage of the current sampling cycle is less than the actual voltage of the previous sampling cycle, and the second difference reflects the voltage difference between the previous sampling cycle and the current sampling cycle, the actual voltage of the previous sampling cycle is subtracted from the second difference to obtain the actual voltage of the current sampling cycle.
[0076] S280: Determine the power level of the battery pack in the current sampling period according to the actual voltage in the current sampling period.
[0077] The embodiment of the present application provides a method for measuring electric quantity, which determines a first difference between the actual voltage of the previous sampling cycle and the maximum voltage; if the first difference is less than a first preset difference threshold, it is determined that the battery pack is in a normal discharge state; and / or, determines a second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage; if the second difference is less than a second preset difference threshold, it is determined that the battery pack is in a normal discharge state. If the battery pack is determined to be in a normal discharge state based on the maximum voltage and the actual voltage of the previous sampling cycle, the actual voltage of the previous sampling cycle is corrected based on the first difference between the actual voltage of the previous sampling cycle and the maximum voltage to obtain the actual voltage of the current sampling cycle. If the battery pack is determined to be in a normal discharge state based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, the actual voltage of the previous sampling cycle is corrected based on the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage to obtain the actual voltage of the current sampling cycle. The above solution solves the problem that the collected instantaneous voltage value has poor stability and the power determined based on the instantaneous voltage is difficult to reflect the actual power of the battery pack. Therefore, when it is determined that the battery pack is in a normal discharge state, the actual voltage of the previous sampling cycle is corrected to determine the actual voltage of the current sampling cycle, thereby improving the stability and accuracy of the voltage, and further improving the accuracy and stability of the power determined based on the voltage.
[0078] Embodiment 3
[0079] Figure 4 This is a flow chart of a power metering method provided in the third embodiment of the present application. The present embodiment is optimized based on the above embodiment. For solutions not described in detail in the present embodiment, please refer to the above embodiment. Figure 4 As shown, the method of the embodiment of the present application specifically includes the following steps:
[0080] S310: Determine the maximum voltage and the minimum voltage among the voltages collected in the current sampling period.
[0081] S320: Determine whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle.
[0082] S330. If the battery pack is in a normal discharge state, the actual voltage of the previous sampling cycle is corrected according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle to obtain the actual voltage of the current sampling cycle.
[0083] S340. If it is determined that the battery pack is in a normal discharge state based on the maximum voltage and the actual voltage of the previous sampling cycle, the voltage drop voltage of the previous sampling cycle is corrected based on the first difference between the actual voltage of the previous sampling cycle and the maximum voltage to obtain the voltage drop voltage of the current sampling cycle.
[0084] Exemplarily, if the battery pack is in a normal discharge state, the discharge voltage is gradually reduced. If the discharge path is a path with a voltage drop, the minimum voltage reflecting the voltage drop in the current sampling cycle should be less than the voltage drop in the previous sampling cycle. If the battery pack is determined to be in a normal discharge state based on the maximum voltage and the actual voltage of the previous sampling cycle, that is, the first difference is less than the first preset difference threshold, then the first difference can reflect the voltage difference between the current sampling cycle and the previous sampling cycle. Therefore, the voltage drop voltage of the previous sampling cycle can be corrected according to the first difference to obtain the voltage drop voltage of the current sampling cycle. Specifically, the voltage drop voltage of the previous sampling cycle is subtracted from the first difference to obtain the voltage drop voltage of the current sampling cycle.
[0085] S350. If it is determined that the battery pack is in a normal discharge state based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, the voltage drop voltage of the previous sampling cycle is corrected based on the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage to obtain the voltage drop voltage of the current sampling cycle.
[0086] Exemplarily, if the battery pack is determined to be in a normal discharge state based on the minimum voltage and the voltage drop of the previous sampling cycle, that is, the second difference is less than the second preset difference threshold, then the second difference can reflect the voltage difference between the current sampling cycle and the previous sampling cycle, so the voltage drop of the previous sampling cycle can be corrected according to the second difference to obtain the voltage drop of the current sampling cycle. Specifically, the voltage drop of the previous sampling cycle is subtracted from the second difference to obtain the voltage drop of the current sampling cycle. The voltage drop of the current sampling cycle is determined by the above scheme, which facilitates the calculation of the actual voltage in the subsequent sampling cycles.
[0087] S360: Determine the power level of the battery pack in the current sampling period according to the actual voltage in the current sampling period.
[0088] The embodiment of the present application provides a method for measuring electric quantity. If the battery pack is determined to be in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, the voltage drop voltage of the previous sampling cycle is corrected according to the first difference between the actual voltage of the previous sampling cycle and the maximum voltage to obtain the voltage drop voltage of the current sampling cycle; if the battery pack is determined to be in a normal discharge state according to the minimum voltage and the voltage drop voltage of the previous sampling cycle, the voltage drop voltage of the previous sampling cycle is corrected according to the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage to obtain the voltage drop voltage of the current sampling cycle. The above scheme can accurately determine the voltage drop voltage of the current sampling cycle according to the discharge state of the battery pack and the voltage difference in different cycles, which is convenient for calculating the actual voltage in subsequent sampling cycles.
[0089] Embodiment 4
[0090] Figure 5 This is a schematic diagram of the structure of an electric power metering device provided in the fourth embodiment of the present application. The device can execute the electric power metering method provided in any embodiment of the present application and has the corresponding functional modules and beneficial effects of the execution method. Figure 5 As shown, the device comprises:
[0091] The voltage acquisition module 410 determines the maximum voltage and the minimum voltage among the voltages acquired in the current sampling period;
[0092] A state determination module 420, configured to determine whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle;
[0093] The actual voltage determination module 430 is used to correct the actual voltage of the previous sampling cycle according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle, to obtain the actual voltage of the current sampling cycle if the battery pack is in a normal discharge state;
[0094] The power determination module 440 is used to determine the power of the battery pack in the current sampling period according to the actual voltage in the current sampling period.
[0095] In the embodiment of the present application, the state determination module 420 includes:
[0096] a voltage difference determination unit, configured to determine a voltage difference between the maximum voltage and the minimum voltage;
[0097] a state judgment unit, configured to determine whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling period, and / or the minimum voltage and the voltage drop voltage of the previous sampling period, if the voltage difference is greater than a preset voltage difference threshold;
[0098] The preset difference threshold is determined according to the voltage drop value when the voltage passes through different paths during the discharge process of the battery pack.
[0099] In the embodiment of the present application, the state determination module 420 includes:
[0100] A first difference determination unit, used to determine a first difference between the actual voltage in the previous sampling period and the maximum voltage;
[0101] a first judgment unit, configured to determine that the battery pack is in a normal discharge state if the first difference is less than a first preset difference threshold; and / or,
[0102] A second difference determination unit, used to determine a second difference between the voltage drop in the previous sampling period and the minimum voltage;
[0103] The second judgment unit is used to determine that the battery pack is in a normal discharge state if the second difference is less than a second preset difference threshold.
[0104] In the embodiment of the present application, the actual voltage determination module 430 includes:
[0105] A first correction unit, configured to correct the actual voltage of the previous sampling cycle according to a first difference between the actual voltage of the previous sampling cycle and the maximum voltage, if it is determined that the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, to obtain the actual voltage of the current sampling cycle;
[0106] The second correction unit is used to correct the actual voltage of the previous sampling cycle according to the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage, if it is determined that the battery pack is in a normal discharge state based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, to obtain the actual voltage of the current sampling cycle.
[0107] In the embodiment of the present application, the first correction unit is specifically used to:
[0108] Subtract the first difference from the actual voltage of the previous sampling period to obtain the actual voltage of the current sampling period;
[0109] The second correction unit is specifically used for:
[0110] The actual voltage of the previous sampling period is subtracted from the second difference to obtain the actual voltage of the current sampling period.
[0111] In the embodiment of the present application, the device further includes:
[0112] A first voltage drop correction module, configured to correct the voltage drop voltage of the previous sampling cycle according to a first difference between the actual voltage of the previous sampling cycle and the maximum voltage, if it is determined that the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, to obtain the voltage drop voltage of the current sampling cycle;
[0113] The second voltage drop correction module is used to correct the voltage drop voltage of the previous sampling cycle according to the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage, if it is determined that the battery pack is in a normal discharge state based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, to obtain the voltage drop voltage of the current sampling cycle.
[0114] In the embodiment of the present application, the device further includes:
[0115] The initialization module is used to use the maximum voltage as the actual voltage of the current sampling period and the minimum voltage as the voltage drop voltage within the current sampling period.
[0116] An electricity metering device provided in an embodiment of the present application can execute an electricity metering method provided in any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method.
[0117] Embodiment 5
[0118] Figure 6 A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0119] like Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0120] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0121] The processor 11 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the power measurement method.
[0122] In some embodiments, the power metering method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the power metering method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the power metering method in any other appropriate manner (e.g., by means of firmware).
[0123] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable electricity metering device, so that when the computer programs are executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0125] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0127] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0128] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the information expected by the technical solution of this application can be achieved, and this document is not limited here.
[0130] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for measuring electricity, characterized in that: The method comprises: Determine the maximum voltage and the minimum voltage among the voltages collected in the current sampling period; Determining whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle; If the battery pack is in a normal discharge state, the actual voltage of the previous sampling cycle is corrected according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle to obtain the actual voltage of the current sampling cycle; According to the actual voltage of the current sampling period, the power of the battery pack in the current sampling period is determined.
2. The method according to claim 1, characterized in that Determining whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle, includes: determining a voltage difference between the maximum voltage and the minimum voltage; If the voltage difference is greater than a preset voltage difference threshold, determining whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle; The preset difference threshold is determined according to the voltage drop value when the voltage passes through different paths during the discharge process of the battery pack.
3. The method according to claim 1 or 2, characterized in that: Determining whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop of the previous sampling cycle includes: Determine a first difference between an actual voltage in a previous sampling period and the maximum voltage; If the first difference is less than a first preset difference threshold, it is determined that the battery pack is in a normal discharge state; and / or, Determine a second difference between the voltage drop in the previous sampling period and the minimum voltage; If the second difference is less than a second preset difference threshold, it is determined that the battery pack is in a normal discharge state.
4. The method according to claim 1, characterized in that: If the battery pack is in a normal discharge state, the actual voltage of the previous sampling cycle is corrected according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle to obtain the actual voltage of the current sampling cycle, including: If it is determined that the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, the actual voltage of the previous sampling cycle is corrected according to a first difference between the actual voltage of the previous sampling cycle and the maximum voltage to obtain the actual voltage of the current sampling cycle; If the battery pack is determined to be in a normal discharge state based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, the actual voltage of the previous sampling cycle is corrected based on the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage to obtain the actual voltage of the current sampling cycle.
5. The method according to claim 4, characterized in that According to a first difference between an actual voltage in a previous sampling period and the maximum voltage, the actual voltage in the previous sampling period is corrected to obtain an actual voltage in a current sampling period, including: Subtract the first difference from the actual voltage of the previous sampling period to obtain the actual voltage of the current sampling period; According to the second difference between the voltage drop voltage in the previous sampling period and the minimum voltage, the actual voltage in the previous sampling period is corrected to obtain the actual voltage in the current sampling period, including: The actual voltage of the previous sampling period is subtracted from the second difference to obtain the actual voltage of the current sampling period.
6. The method according to claim 1, characterized in that The method further comprises: If it is determined that the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, the voltage drop of the previous sampling cycle is corrected according to a first difference between the actual voltage of the previous sampling cycle and the maximum voltage to obtain the voltage drop of the current sampling cycle; If the battery pack is determined to be in a normal discharge state based on the minimum voltage and the voltage drop voltage of the previous sampling cycle, the voltage drop voltage of the previous sampling cycle is corrected based on the second difference between the voltage drop voltage of the previous sampling cycle and the minimum voltage to obtain the voltage drop voltage of the current sampling cycle.
7. The method according to claim 1, characterized in that If the current sampling period is the first sampling period, the method further includes: The maximum voltage is used as the actual voltage of the current sampling period, and the minimum voltage is used as the voltage drop voltage in the current sampling period.
8. An electric quantity measuring device, characterized in that: The device comprises: The voltage acquisition module determines the maximum voltage and the minimum voltage among the voltages collected in the current sampling period; A state determination module, used to determine whether the battery pack is in a normal discharge state according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle; an actual voltage determination module, configured to correct the actual voltage of the previous sampling cycle according to the maximum voltage and the actual voltage of the previous sampling cycle, and / or the minimum voltage and the voltage drop voltage of the previous sampling cycle, to obtain the actual voltage of the current sampling cycle if the battery pack is in a normal discharge state; The power determination module is used to determine the power of the battery pack in the current sampling period according to the actual voltage in the current sampling period.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the electricity measurement method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the electricity metering method according to any one of claims 1 to 7 when executed.