Data measurement and storage method and system

By judging the working state of the lithium battery and performing linear prediction, combined with XOR difference encoding, the problem of low data compression rate of BMS is solved, achieving higher compression efficiency and cost reduction.

CN120979462AActive Publication Date: 2025-11-18SHANDONG SHENGYANG LITHIUM NEW ENERGY CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511483736.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2025-11-18
Estimated Expiration
2045-10-17

AI Technical Summary

Technical Problem

Existing general compression algorithms cannot effectively utilize the multi-state and strongly correlated characteristics of lithium battery management system (BMS) data, resulting in low compression rates and increased storage and transmission costs.

Method used

By determining the working state of the lithium battery, calculating the prediction coefficient and performing linear prediction, and combining the XOR difference encoding of the timestamp and voltage value, only the core bit information is encoded, and the timestamp and data value encoding are associated and stored.

Benefits of technology

It improves data compression rate, reduces storage and transmission costs, and alleviates hardware pressure on BMS.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120979462A_ABST
    Figure CN120979462A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of measurement and storage, and particularly relates to a data measurement and storage method and system to solve the technical problem that in the prior art, the compression rate of BMS time series data is low. The data measurement and storage method comprises the following steps: S1, judging the working state of the lithium battery; obtaining a timestamp code; s2, converting the actually measured voltage value Vn and the predicted voltage value Vp at the current moment into binary systems, and calculating an XOR difference value between the two values; s3, encoding the XOR difference value to generate a data value code; and S4, associatively storing the timestamp code and the data value code. By introducing judgment on the working state of the lithium battery, the prediction coefficient of the voltage change trend matched with the actual condition can be calculated according to different working conditions of charging, discharging and standing; when the lithium battery data is processed, the data storage and transmission cost can be reduced, and the hardware pressure of a battery management system is relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of measurement and storage, and specifically relates to a data measurement and storage method and system. Background Technology

[0002] To ensure the safe and reliable operation of lithium-ion batteries and extend their lifespan, battery management systems (BMS) need to perform high-frequency real-time monitoring of key state parameters such as voltage and current. With increasing monitoring accuracy and sampling frequency, BMS generates a large amount of time-series data during operation. This data is crucial for battery state estimation, fault diagnosis, and lifespan prediction; however, its large size also puts enormous pressure on data storage and long-distance wireless transmission, especially in automotive or IoT environments where storage capacity and communication bandwidth are limited. Storage and transmission costs become key constraints on the further expansion of BMS.

[0003] General compression algorithms (such as the Gorilla algorithm) leverage the continuity and similarity of time-series data in terms of timestamps and values. Compression is achieved through difference calculations of timestamps and linear prediction and XOR operations on data values. However, this compression is for general-purpose data. Unlike general time-series data, battery management system (BMS) data possesses unique physical and chemical characteristics. For example, battery parameters exhibit drastically different variation patterns under different operating states (such as charging, resting, and discharging), and the correlation between parameters is extremely strong, subject to strict physical constraints. The single prediction model in general compression algorithms cannot fully utilize the multi-state and strongly correlated characteristics of BMS data. Therefore, there is no optimized data compression method specifically for the characteristics of BMS, and the compression ratio needs further improvement. Summary of the Invention

[0004] This invention provides a data measurement and storage method and system to solve the technical problem of low compression rate of BMS time-series data in the prior art.

[0005] In a first aspect, the present invention provides a data measurement and storage method, comprising the following steps: S1, obtain the current timestamp, voltage value, and current value of the lithium battery; based on the sign and magnitude of the current value at the current moment, determine the working state of the lithium battery, which includes charging, resting, and discharging; calculate the difference between the current timestamp and the previous timestamp, and encode the timestamp code based on the change in the difference between the current timestamp and the previous timestamp. S2, calculate the prediction coefficient based on the lithium battery's operating state and the current change between the current value at the current moment and the previous moment; use the prediction coefficient and the voltage values ​​V from the previous two moments. n-1 and V n-2Linear prediction of the predicted voltage value V at the current moment p The measured voltage value V at the current moment. n With the predicted voltage value V p Convert to binary and calculate the XOR difference between the two; S3, Encode the XOR difference to generate data value encoding: When the sum of the number of consecutive zero bits at the beginning and the number of consecutive zero bits at the end of the XOR difference meets the preset compression conditions, only the core bit and position information in the XOR difference are encoded, where the core bit is located between the consecutive zero bits at the beginning and the consecutive zero bits at the end; when the sum of the number of consecutive zero bits at the beginning and the number of consecutive zero bits at the end of the XOR difference does not meet the preset compression conditions, the complete XOR difference is directly encoded. S4 associates and stores the timestamp encoding with the data value encoding.

[0006] Furthermore, in S1, a static current threshold I is set. th Then the charging judgment threshold is I. th The discharge judgment threshold is -I th : If the current value at the current moment is greater than the charging judgment threshold I th If so, the lithium battery is determined to be in a charging state. If the current value at the current moment is less than the discharge judgment threshold -I th If so, the lithium battery is determined to be in a discharging state. If the current value at the current moment is within the discharge judgment threshold - I th And charging judgment threshold I th If the reading is between these values, the lithium battery is considered to be in a static state.

[0007] Furthermore, in S1, the timestamp t of the current moment is calculated. n timestamp t of the previous moment n-1 The difference D n The timestamp t of the previous moment n-1 The timestamp t of the previous time n-2 The difference D n-1 ; Calculate D n and D n-1 The difference is denoted as D. of According to D of Encode the value: If D of =0, encoded using a single bit 0; if -63≤D of ≤63 and D of If -256 ≤ D, it is encoded using control code 10 plus 7 bits; of ≤255 and D of [-63, 63], encoded using control code 110 plus 9 bits; if -2047 ≤ D of ≤2048 and D of [-256, 256], encoded using control code 1110 plus 12 bits; if D of <-2047 or D of >2047, encoded using control code 1111 plus 32 bits.

[0008] Furthermore, in S2, reference coefficients are pre-set for the three working states of charging, resting, and discharging; Calculate the current value I at the current moment. n The current value I at the previous moment n-1 The change in current ΔI; The prediction coefficient k is the product of the baseline coefficient, the weighting factor, and the change in current ΔI.

[0009] Furthermore, using the prediction coefficients and the voltage values ​​V from the previous two time points... n-1 and V n-2 Linear prediction of the predicted voltage value V at the current moment. p The calculation formula is: V p =V n-1 +k×(V n-1 -V n-2 ); Where V p V is the predicted voltage value at the current moment. n-1 The voltage value at the previous moment, V n-2 is the voltage value at the time two moments ago, and k is the prediction coefficient.

[0010] Furthermore, the current measured voltage value V n and predicted voltage value V p Both are converted into binary sequences. The two binary sequences are then XORed bitwise to obtain the XOR difference between them.

[0011] Furthermore, in S3, the preset compression condition is the compression threshold.

[0012] Furthermore, in S3, if the sum of the number of consecutive zero bits at the beginning and the number of consecutive zero bits at the end is greater than or equal to the compression threshold, then the compression condition is met. In this case, the control code and the number of consecutive zero bits at the beginning are encoded using a specific method. z The value, the length of the core bit, and the core bit itself are stored; if the compression conditions are not met, the encoding method is to write the control code and follow it with the XOR difference of the complete binary sequence.

[0013] Furthermore, in S4, the data value encoding generated in S3 is immediately followed by the timestamp encoding generated in S1, and concatenated into a continuous bit stream.

[0014] Secondly, the present invention provides a data measurement and storage system, including a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-described data measurement and storage method is implemented.

[0015] The beneficial effects are as follows: By introducing the judgment of the lithium battery's operating state, this invention can calculate predictive coefficients that accurately reflect actual voltage change trends under different operating conditions such as charging, discharging, and resting. Furthermore, when the error value is small and the bits exhibit a zero-to-zero characteristic at the beginning and end, only the core effective bits and their positional information in the middle are encoded, reducing the data storage space. When processing lithium battery data, it achieves a compression ratio higher than the existing Gorilla compression technology, reducing data storage and transmission costs and alleviating the hardware pressure on the battery management system. Attached Figure Description

[0016] Figure 1 A flowchart for the data measurement and storage method; Figure 2 This is a schematic diagram of lithium battery data acquisition. Figure 3 This is a schematic diagram for determining the working status; Figure 4 This is a schematic diagram of voltage prediction. Figure 5 The first schematic diagram for encoding data values; Figure 6 A second schematic diagram for encoding data values; Figure 7 This is a diagram illustrating the association between timestamps and data values. Figure 8 This is a block diagram of the data measurement and storage system. Detailed Implementation

[0017] An embodiment of the data measurement and storage method provided by the present invention: like Figure 1 The data measurement and storage method includes the following steps: S1. Obtain the current timestamp, voltage value, and current value of the lithium battery. Based on the sign and magnitude of the current value at the current moment, determine the working state of the lithium battery, which includes charging, resting, and discharging. Calculate the difference between the current timestamp and the previous timestamp, and encode the timestamp code based on the change in the difference between the current and previous timestamps.

[0018] The implementation details of step S1 are as follows: Key parameters of lithium batteries include voltage and current, which need to be monitored in real time to ensure battery safety. The battery management system (BMS) uses sensors to collect analog signals from the lithium battery at a preset sampling frequency. An analog-to-digital converter (ADC) then converts these analog signals into digital timestamps, voltage values, and current values, such as... Figure 2 As shown.

[0019] Set a resting current threshold I th , static current threshold I th This is also the charging threshold; the discharging threshold is -I. th When the current current value I is collected... n Greater than I th When I is in a charging state, it is determined that the lithium battery is in a charging state; when I n The absolute value is less than or equal to I th When I is in a static state, it is determined that the lithium battery is in a quiescent state; when I n Less than -I th At this time, it is determined that the lithium battery is in a discharging state.

[0020] Among them, the static current threshold I th The following steps are usually used to obtain the current: (1) Conduct a static test: After the lithium battery is fully charged or fully discharged, let the lithium battery remain static for a sufficient period of time under no load or slight load. During the entire static test, continuously and frequently collect and record the current value of the lithium battery; (2) Calculate the maximum absolute value of the collected static current data and use the maximum absolute value as the static current threshold I. th .

[0021] In an optional embodiment, a resting current threshold I is set. th If the value is 0.1A, then the charging threshold is 0.1A and the discharging threshold is -0.1A. When the current value is greater than 0.1A, the lithium battery is in the charging state. When the current value is less than 0.1A, the lithium battery is in the discharge state. When the current value is between -0.1A and 0.1A, the lithium battery is in a static state. Figure 3 As shown.

[0022] The current varies depending on the lithium battery's state. By setting resting current thresholds, discharge thresholds, and charging current thresholds, the battery's operating state can be distinguished. For example, when a current value of 2A is detected, because the current value is greater than the preset charging threshold of 0.1A, the battery is determined to be charging. If a current value of -5A is detected, because the current value is less than the discharge threshold of -0.1A, it is determined to be discharging. And when the current value is 0.05A, because the current value is between -0.1A and 0.1A, the battery state is determined to be resting.

[0023] Calculate the timestamp t of the current time. n timestamp t of the previous moment n-1 The difference D n The timestamp t of the previous moment n-1 The timestamp t of the previous time n-2 The difference D n-1 ; Calculate D n and D n-1 The difference is denoted as D. of .

[0024] According to D of Encode the value: If D of =0, encoded using a single bit 0; If -63≤D of ≤63 and D of ≠0, use control code 10 plus 7 bits for encoding; If -256 ≤ D of ≤255 and D of [-63, 63] is encoded using control code 110 plus 9 bits; If -2047 ≤ D of ≤2048 and D of [-256, 256] is encoded using control code 1110 plus 12 bits; If D of <-2047 or D of >2047, encoded using control code 1111 plus 32 bits.

[0025] This embodiment addresses the change in timestamp difference D. of Hierarchical coding is used to improve compression efficiency. If the sampling interval is the same for three consecutive times, D of If it is 0, then only one bit of control code 0 is used to represent it. If D of If the value is 50, falling within the range of -64 to 63, then the encoding is control code 10 plus a 7-bit data value; if D ofIf the value is 200, then the encoding is control code 110 and 9 bits of data value.

[0026] S2, calculate the prediction coefficient based on the lithium battery's operating state and the current change between the current value at the current moment and the previous moment; use the prediction coefficient and the voltage values ​​V from the previous two moments. n-1 and V n-2 Linear prediction of the predicted voltage value V at the current moment p The measured voltage value V at the current moment. n With the predicted voltage value V p Convert to binary and calculate the XOR difference between the two.

[0027] The implementation details of step S2 are as follows: Pre-set reference coefficients for the three operating states: charging, resting, and discharging. Simultaneously calculate the current value I at the current moment. n The current value I at the previous moment n-1 The current change ΔI. The prediction coefficient k is determined by the baseline coefficient and the current change ΔI. Specifically, k is the baseline coefficient plus the product of the weighting factor and the current change ΔI.

[0028] The baseline coefficient represents the average or typical trend of voltage change in the battery under each operating condition, and its acquisition steps are as follows: (1) Allow the lithium battery to be charged, left to stand, and discharged for extended periods under controlled conditions. Throughout the process, continuously record high-precision voltage, current, and timestamp data.

[0029] (2) Based on the recorded current values, the data are divided into three groups, corresponding to the charging, resting and discharging states respectively.

[0030] (3) In each set of data, analyze the average relationship between voltage change and time; for example, the average voltage change per second can be calculated.

[0031] (4) The average voltage change rate of each state is calculated and used as the reference coefficient for that state.

[0032] The weighting factor is used to modify the baseline coefficient to accommodate the impact of current fluctuations on voltage prediction. The steps to obtain it are as follows: (1) Construct a linear mathematical model to model the deviation of voltage change as a linear function of current change (ΔI).

[0033] (2) Solve the slope in the linear mathematical model by the least squares method. This slope is the weight factor.

[0034] In an optional embodiment, the prediction coefficients and the voltage values ​​V at the previous two time points are used. n-1 and Vn-2 Linear prediction of the predicted voltage value V at the current moment. p The calculation formula is: V p =V n-1 +k×(V n-1 -V n-2 ); Where V p V is the predicted voltage value at the current moment. n-1 The voltage value at the previous moment, V n-2 is the voltage value at the time two moments ago, and k is the prediction coefficient.

[0035] Assume the voltage V at the time two moments ago n-2 It is 3.70V, and the voltage V at the previous moment is... n-1 The voltage is 3.71V, and the prediction coefficient k calculated based on the current operating conditions is 1.1. Therefore, the predicted voltage V... p It is 3.721V, such as Figure 4 As shown, the predicted voltage value represents a dynamic acceleration of the voltage based on the recent trend. The current measured voltage value V... n and predicted voltage value V p Both are converted to 32-bit floating-point binary representations according to the IEEE 754 standard. The two binary sequences are then XORed bitwise to obtain the XOR difference between the binary sequences.

[0036] S3, Encode the XOR difference to generate data value encoding: When the sum of the number of consecutive zero bits at the beginning and the number of consecutive zero bits at the end of the XOR difference meets the preset compression conditions, only the core bit and position information in the XOR difference are encoded, where the core bit is located between the consecutive zero bits at the beginning and the consecutive zero bits at the end; when the sum of the number of consecutive zero bits at the beginning and the number of consecutive zero bits at the end of the XOR difference does not meet the preset compression conditions, the complete XOR difference is directly encoded.

[0037] The preset compression condition is the compression threshold, and the number of consecutive zero bits in the first part of the XOR difference, starting from the most significant bit, is calculated as l. z and the number of consecutive zero bits at the tail starting from the least significant bit t z If l z With t z If the sum is greater than or equal to the compression threshold, the compression condition is met. In this case, the control code and l are encoded. z The value, the length of the core bit, and the core bit itself are stored. If the compression conditions are not met, the encoding method is to write the control code followed by the XOR difference of the complete binary sequence.

[0038] The steps for obtaining the compression threshold are as follows: (1) Collect a large amount of voltage data, perform prediction and XOR operation on these data to obtain a large amount of XOR difference values.

[0039] (2) Perform statistics on all binary sequences of XOR differences. For each binary sequence, calculate the number of consecutive zero bits at the beginning. z and the number of consecutive zero bits at the tail t z ; will l z +t z A histogram is plotted with the sum of the values ​​on the x-axis and the frequency of that sum on the y-axis. Most XOR differences are represented by l. z +t z The sum will be concentrated in a relatively small range.

[0040] (3) If you want to achieve the highest compression ratio, you can increase the compression threshold, such as 80%. z +t z If the sum is greater than 15, the compression threshold can be set to 15; if you want more stable performance, you can set the threshold slightly lower, such as to 12.

[0041] In an optional embodiment, the XOR difference is set to a 32-bit binary sequence, and the number of consecutive zero bits at the beginning of the XOR difference is calculated. z and the number of consecutive zero bits at the tail t z ; Set the compression threshold to 12, if l z With t z If the sum is greater than or equal to 12, it is determined that the compression condition is met. The encoding method is: write 1 bit of control code 1, followed by 6 bits of l. z The value, along with the 6-bit core bit length value, and the core bit itself, where the core bit is the bit located between consecutive zero bits at the beginning and end, and the core bit length is equal to 32-1. z -t z ,like Figure 5 As shown; If l z With t z If the sum is less than 12, it is determined that the compression condition is not met. The encoding method is: write 1 bit of control code 0, followed by a 32-bit complete XOR difference, such as... Figure 6 As shown.

[0042] S4 associates and stores the timestamp encoding with the data value encoding.

[0043] The data value generated by S3 is immediately followed by the timestamp generated by S1, and the two are concatenated into a continuous bit stream. This bit stream is then written to flash memory or sent over a network, completing the compressed storage of the data points. Figure 7 As shown.

[0044] Embodiments of the data measurement and storage system provided by the present invention: like Figure 8 As shown, the data measurement and storage system includes a processor and a memory. The memory stores computer program instructions, which are executed by the processor to implement the data measurement and storage method described above.

[0045] The data measurement and storage system also includes other components well known to those skilled in the art, such as communication interfaces, the setup and functions of which are known in the art and will not be described in detail here.

[0046] In addition, in the description of this specification, "multiple" means at least two, such as two, three or more, etc., unless otherwise expressly and specifically defined.

Claims

1. A data measurement and storage method, characterized in that, Includes the following steps: S1, obtain the current timestamp, voltage value, and current value of the lithium battery; based on the sign and magnitude of the current value at the current moment, determine the working state of the lithium battery, which includes charging, resting, and discharging; Calculate the difference between the current timestamp and the previous timestamp, and encode the timestamp based on the change in the difference between the current timestamp and the previous timestamp. S2, calculate the prediction coefficient based on the lithium battery's operating state and the current change between the current value at the current moment and the previous moment; use the prediction coefficient and the voltage values ​​V from the previous two moments. n-1 and V n-2 Linear prediction of the predicted voltage value V at the current moment p The measured voltage value V at the current moment. n With the predicted voltage value V p Convert to binary and calculate the XOR difference between the two; S3, Encode the XOR difference to generate data value encoding: When the sum of the number of consecutive zero bits at the beginning and the number of consecutive zero bits at the end of the XOR difference meets the preset compression conditions, only the core bit and position information in the XOR difference are encoded, where the core bit is located between the consecutive zero bits at the beginning and the consecutive zero bits at the end; when the sum of the number of consecutive zero bits at the beginning and the number of consecutive zero bits at the end of the XOR difference does not meet the preset compression conditions, the complete XOR difference is directly encoded. S4 associates and stores the timestamp encoding with the data value encoding.

2. The data measurement and storage method according to claim 1, characterized in that, In S1, a static current threshold I is set. th Then the charging judgment threshold is I. th The discharge judgment threshold is -I th : If the current value at the current moment is greater than the charging judgment threshold I th If so, the lithium battery is determined to be in a charging state. If the current value at the current moment is less than the discharge judgment threshold -I th If so, the lithium battery is determined to be in a discharging state. If the current value at the current moment is within the discharge judgment threshold - I th And charging judgment threshold I th If the reading is between these values, the lithium battery is considered to be in a static state.

3. The data measurement and storage method according to claim 1, characterized in that, In S1, the timestamp t of the current moment is calculated. n timestamp t of the previous moment n-1 The difference D n The timestamp t of the previous moment n-1 The timestamp t of the previous time n-2 The difference D n-1 ; Calculate D n and D n-1 The difference is denoted as D. of According to D of Encode the value: If D of =0, encoded using a single bit 0; if -63≤D of ≤63 and D of If -256 ≤ D, it is encoded using control code 10 plus 7 bits; of ≤255 and D of [-63, 63], encoded using control code 110 plus 9 bits; if -2047 ≤ D of ≤2048 and D of [-256, 256], encoded using control code 1110 plus 12 bits; if D of <-2047 or D of >2047, encoded using control code 1111 plus 32 bits.

4. The data measurement and storage method according to claim 1, characterized in that, In S2, reference coefficients are pre-set for the three working states of charging, resting, and discharging. Calculate the current value I at the current moment. n The current value I at the previous moment n-1 The change in current ΔI; The prediction coefficient k is the product of the baseline coefficient, the weighting factor, and the change in current ΔI.

5. The data measurement and storage method according to claim 4, characterized in that, Using the prediction coefficients and the voltage values ​​V at the previous two time points n-1 and V n-2 Linear prediction of the predicted voltage value V at the current moment. p The calculation formula is: V p =V n-1 +k×(V n-1 -V n-2 ); Where V p V is the predicted voltage value at the current moment. n-1 The voltage value at the previous moment, V n-2 is the voltage value at the time two moments ago, and k is the prediction coefficient.

6. The data measurement and storage method according to claim 5, characterized in that, The current measured voltage value V n and predicted voltage value V p Both are converted into binary sequences. The two binary sequences are then XORed bitwise to obtain the XOR difference between them.

7. The data measurement and storage method according to claim 1, characterized in that, In S3, the preset compression condition is the compression threshold.

8. The data measurement and storage method according to claim 7, characterized in that, In S3, if the sum of the number of consecutive zero bits at the beginning and the number of consecutive zero bits at the end is greater than or equal to the compression threshold, then the compression condition is met. In this case, the control code and the number of consecutive zero bits at the beginning are encoded. z The value, the length of the core bit, and the core bit itself are stored; if the compression conditions are not met, the encoding method is to write the control code and follow it with the XOR difference of the complete binary sequence.

9. The data measurement and storage method according to any one of claims 1-8, characterized in that, In S4, the data value generated in S3 is encoded and then immediately followed by the timestamp encoding generated in S1, concatenating them into a continuous bit stream.

10. A data measurement and storage system, characterized in that, It includes a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the data measurement and storage method according to any one of claims 1-9 is implemented.

Citation Information

Patent Citations

  • Multi-dimensional optimization of electrical parameters for memory training

    CN109643577A

  • Data compression method and device for power database, equipment and medium

    CN110995273A

  • Battery charging safety early warning method, electronic equipment and storage medium

    CN114325411A

  • Compression method and device for time sequence data of Internet of Vehicles and electronic equipment

    CN114759929A

  • Method, apparatus and computer program product for determining residual value of battery energy store

    CN115684969A