Battery parameter management method, controller, storage medium and program product

By using the preset structure format and reserved area design in binary files, the problem of cumbersome battery parameter management process in the prior art is solved, and efficient battery parameter management and good scalability are achieved.

CN119208779BActive Publication Date: 2025-05-16SHENZHEN PEICHENG ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411659413.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-05-16
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

In the prior art, when using parameter management methods such as EEPROM, configuration files, databases, etc. to manage battery parameters, the management process is complicated and it is difficult to expand parameters.

Method used

A battery parameter management method is proposed. By storing data using preset structure format in a binary file, the battery parameters are structured, and a reserved area is left at the tail of the parameter block, supporting the independence and expansion of the parameter block.

Benefits of technology

It improves the reading and processing efficiency of battery parameters, reduces the overhead of data format judgment and conversion, simplifies the management process of battery parameters, and provides high scalability of parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119208779B_ABST
    Figure CN119208779B_ABST
Patent Text Reader

Abstract

The present application discloses a battery parameter management method, a controller, a storage medium and a program product, which relates to the technical field of battery parameter management, and includes: receiving a data processing instruction for a target battery parameter; based on the data processing instruction, determining a target parameter block from a binary file; wherein the binary file includes a plurality of parameter blocks of fixed length, the tail of each parameter block is a reserved area, and the parameter block is configured to store data using a preset structure format; based on the address information of the target parameter block, executing a data processing action corresponding to the data processing instruction on the target parameter block to obtain a processing result. The present application can simplify the management process of battery parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of battery parameter management, and in particular to a battery parameter management method, a controller, a storage medium and a program product. Background Art

[0002] As voltage levels continue to increase, BMS (Battery Management System) mainly uses parameter management methods such as EEPROM, configuration files, and databases to manage hundreds of battery parameters.

[0003] However, when using the above parameter management method to manage battery parameters, additional hardware assistance is required or it is difficult to expand the parameters, resulting in a more complicated management process. Summary of the invention

[0004] The main purpose of this application is to provide a battery parameter management method, controller, storage medium and program product, aiming to solve the technical problem of cumbersome management process when managing battery parameters using parameter management methods such as EEPROM, configuration files, databases, etc.

[0005] To achieve the above objectives, the present application proposes a battery parameter management method, wherein the battery parameter management includes:

[0006] receiving a data processing instruction for a target battery parameter;

[0007] Based on the data processing instruction, a target parameter block is determined from a binary file; wherein the binary file includes a plurality of parameter blocks of fixed length, the tail of each parameter block is a reserved area, and the parameter block is configured to store data using a preset structure format;

[0008] Based on the address information of the target parameter block, a data processing action corresponding to the data processing instruction is executed on the target parameter block to obtain a processing result.

[0009] In one embodiment, based on the address information of the target parameter block, the step of executing the data processing action corresponding to the data processing instruction on the target parameter block to obtain the processing result includes:

[0010] If the data processing instruction is a data storage instruction, the target battery parameters are written into a reserved area of ​​the target parameter block; wherein the arrangement order of the battery parameters written into the target parameter block remains unchanged.

[0011] In one embodiment, the initial value of the data in the reserved area is 0.

[0012] In one embodiment, the step of writing the target battery parameter into the reserved area of ​​the target parameter block includes:

[0013] Based on the address information of the target parameter block, read the target cyclic redundancy check CRC code corresponding to the target parameter block and the byte information of the target parameter block; wherein the byte information includes the battery parameter byte information stored in the target parameter block and the byte information of the reserved area;

[0014] Calculate the current cyclic redundancy check CRC code of the target parameter block using the byte information;

[0015] Determine whether the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code;

[0016] If the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code, the target battery parameters are written into the reserved area, and after the target battery parameters are written into the reserved area, the new byte information in the target parameter block is read, and the new current cyclic redundancy check CRC code of the target parameter block is calculated using the new byte information, and the new cyclic redundancy check CRC code is used as the target cyclic redundancy check CRC code;

[0017] If the current cyclic redundancy check CRC code is inconsistent with the target cyclic redundancy check CRC code, the target parameter block is initialized.

[0018] In one embodiment, based on the data processing instruction, the step of determining the target parameter block from the binary file includes:

[0019] If the data processing instruction is a data read instruction, determining target identification information of the target parameter block;

[0020] Finding a mapping relationship to determine the target address information corresponding to the target identification information; wherein the mapping relationship includes a corresponding relationship between the identification information and the address information;

[0021] Based on the target address information, the target parameter block is read from the binary file.

[0022] In one embodiment, based on the data processing instruction, the step of determining the target parameter block from the binary file includes:

[0023] Read the current file configuration information of the binary file from the common parameter block of the binary file; wherein the common parameter block is the first parameter block of the binary file, and the current file configuration information includes file version number information and magic number information;

[0024] Determine whether the current file configuration information is consistent with the preset file configuration information;

[0025] If the current file configuration information is consistent with the preset file configuration information, determining a target parameter block from the binary file based on the data processing instruction;

[0026] If the current file configuration information is inconsistent with the preset file configuration information, all parameter blocks in the binary file are initialized.

[0027] In one embodiment, the parameter block is configured to store data using a preset structure format and a one-byte alignment.

[0028] In addition, to achieve the above objectives, the present application also proposes a controller, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the battery parameter management method as described above.

[0029] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the battery parameter management method described above are implemented.

[0030] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the battery parameter management method described above are implemented.

[0031] One or more technical solutions proposed in this application have at least the following technical effects:

[0032] In the present application, compared with the parameter management method using EEPROM, configuration files, databases, etc. in the related art to manage battery parameters, the present application uses a preset structure format to store the battery parameters in the parameter block when managing the battery parameters, ensuring that the data layout of each parameter block is known, and at the same time, the battery parameters are structured, and can be directly read and written in binary, making the reading and processing operations of the battery parameters more efficient, reducing the overhead of the program to judge and convert the data format at runtime, and improving the efficiency of reading and writing battery parameters. At the same time, the parameter blocks are dispersed in the binary file, and a reserved area is reserved in the tail area of ​​the parameter block to ensure the independence of the parameter block, so that on the basis of ensuring stability and reliability, the reserved area provides scalability for the subsequent expansion of the reference block, that is, when new battery parameters need to be added later, the new battery parameters can be written into the reserved area without redesigning the entire data structure, while reducing the maintenance cost and complexity, it also improves the scalability of the parameters, thereby simplifying the management process of the battery parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0035] Figure 1 A flowchart of the first embodiment of the battery parameter management method of the present application is provided;

[0036] Figure 2 This is a schematic diagram of the overall layout of the binary file of this application;

[0037] Figure 3 The positional relationship between the target parameter block and the target cyclic redundancy check CRC code of this application;

[0038] Figure 4 This is an extended schematic diagram of the target parameter block of this application;

[0039] Figure 5 A schematic diagram of the process of managing battery parameters using binary files for this application;

[0040] Figure 6 A flow chart of reading parameter blocks from a binary file for this application;

[0041] Figure 7 A schematic diagram of the process of writing the target battery parameters into the target parameter block for this application;

[0042] Figure 8 Schematic diagram of the device structure of the hardware operating environment involved in the battery parameter management method in the embodiment of the present application.

[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0046] The main solution of the embodiment of the present application is: receiving a data processing instruction for a target battery parameter; based on the data processing instruction, determining a target parameter block from a binary file; wherein the binary file includes a plurality of parameter blocks of fixed length, the tail of each parameter block is a reserved area, and the parameter block is configured to store data using a preset structure format; based on the address information of the target parameter block, executing a data processing action corresponding to the data processing instruction on the target parameter block to obtain a processing result.

[0047] In this embodiment, for the convenience of description, the following description is made with the controller as the execution subject.

[0048] At present, with the continuous increase in voltage levels, BMS (Battery Management System) mainly uses parameter management methods such as EEPROM, configuration files, and databases to manage hundreds or thousands of battery parameters.

[0049] However, when using parameter management methods such as EEPROM, configuration files, and databases to manage battery parameters, the following problems exist:

[0050] 1. When using EEPROM as storage, additional EEPROM chips and communication interfaces are required, which not only has high hardware costs but also slow reading and writing speeds;

[0051] 2. When using the configuration file, the BMS software needs to handle the complex correspondence between parameter characters, and the parameters cannot be modified directly and conveniently, and a copy needs to be used, etc., which makes the software implementation more complicated;

[0052] 3. When using the database, if there are many battery parameters, the software needs to process more complex SQL statements. At the same time, when adding battery parameters, the data table in the database needs to be rebuilt, resulting in the loss of stored battery parameters, and poor scalability and ease of use.

[0053] Therefore, when the battery parameters are managed using the above parameter management method, the management process is relatively complicated.

[0054] The present application provides a solution. Compared with the parameter management method of using EEPROM, configuration files, databases, etc. in the related art to manage battery parameters, the present application uses a preset structure format to store battery parameters in parameter blocks when managing battery parameters, ensuring that the data layout of each parameter block is known. At the same time, the battery parameters are structured, and binary can be used for direct reading and writing, making the reading and processing operations of battery parameters more efficient, reducing the overhead of the program to judge and convert the data format at runtime, and improving the efficiency of reading and writing battery parameters. At the same time, the parameter blocks are dispersed in the binary file, and a reserved area is reserved in the tail area of ​​the parameter block to ensure the independence of the parameter block, so that on the basis of ensuring stability and reliability, the reserved area provides scalability for the subsequent expansion of the reference block, that is, when new battery parameters need to be added later, the new battery parameters can be written into the reserved area without redesigning the entire data structure, while reducing the maintenance cost and complexity, it also improves the scalability of the parameters, thereby simplifying the management process of battery parameters.

[0055] It should be noted that the execution subject of this embodiment may be an electronic device, a controller, etc. capable of realizing the above functions. The controller is taken as an example to illustrate this embodiment and the following embodiments.

[0056] Based on this, the present application embodiment provides a battery parameter management method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the battery parameter management method of the present application.

[0057] In this embodiment, the battery parameter management method includes steps S10 to S30:

[0058] Step S10, receiving a data processing instruction for a target battery parameter.

[0059] Step S20: determining a target parameter block from the binary file based on the data processing instruction.

[0060] The binary file includes a plurality of parameter blocks of fixed length, the tail of each parameter block is a reserved area, and the parameter block is configured to store data using a preset structure format.

[0061] In this embodiment, the data processing instructions may be data storage instructions, or data reading instructions, etc., and the parameter block configuration may use a preset structure format and a one-byte alignment to store data, so as to improve the efficiency of battery parameter access and the security of processing.

[0062] Specifically, the user may input the data processing instruction by interacting with the user interface of the controller. After receiving the data processing instruction, in order to quickly determine the target parameter block from the binary file, the controller further, as an optional implementation, specifically includes:

[0063] Step S201A: if the data processing instruction is a data read instruction, then determine the target identification information of the target parameter block.

[0064] Step S202A, searching for a mapping relationship, and determining the target address information corresponding to the target identification information.

[0065] The mapping relationship includes the corresponding relationship between the identification information and the address information.

[0066] Step S203A: read the target parameter block from the binary file based on the target address information.

[0067] In this embodiment, the target address information may be a file offset address, that is, a position identifier of the target parameter block in the binary file, which is used to indicate the distance of the target parameter block relative to the beginning of the binary file.

[0068] It should be noted that with the continuous increase in voltage levels, the number of batteries managed by BMS has reached hundreds and thousands, and accordingly, the battery parameters managed by BMS have also increased sharply, from the original dozens of battery parameters to hundreds of parameters. In order to better manage a large number of battery parameters, the correspondence between parameter blocks and battery parameters and batteries can be pre-set, that is, the parameter blocks are used to store which battery parameters of which batteries, such as parameter block 1 is used to store the current parameters, voltage parameters, temperature parameters, capacity parameters, etc. of battery A and battery B, and parameter block 2 is used to store the internal resistance parameters, charging time parameters, operating voltage range parameters, etc. of battery A and battery B. After setting the battery parameters of which batteries the parameter blocks are used to store, an identification information can be assigned to each parameter block, and the identification information can be bound to the address information, so that the corresponding parameter block can be quickly read from the binary file according to the identification information, or the battery parameters can be written into the corresponding parameter block.

[0069] Specifically, when the data processing instruction is a data reading instruction, the battery information corresponding to the target battery parameter can be determined, and the target identification information of the target parameter block storing the target battery parameter, that is, the ID information of the target parameter block, can be determined based on the target battery parameter and the battery information. After the target identification information of the target parameter block is determined, the target address information corresponding to the target identification information can be determined based on the correspondence between the identification information and the address information, and the target parameter block can be read from the binary file based on the target address information.

[0070] In this embodiment, when reading the target parameter block from the binary file, the position of the target parameter block in the binary file can be quickly found through the target identification information of the target parameter block, and the required battery parameters can be directly accessed without having to read them one by one from the beginning of the file, thereby reducing unnecessary search and traversal time, thereby improving the processing efficiency of the battery parameters.

[0071] It should be noted that, in order to ensure the correctness of data and the stability of the system, and to avoid binary file corruption or format errors, which may cause more serious problems in subsequent processing, further, as an optional implementation, step S20 further specifically includes:

[0072] Step S201B, reading the current file configuration information of the binary file from the common parameter block of the binary file.

[0073] The public parameter block is the first parameter block of the binary file, and the current file configuration information includes file version number information and magic number information.

[0074] Step S202B, determining whether the current file configuration information is consistent with the preset file configuration information.

[0075] Step S203B: if the current file configuration information is consistent with the preset file configuration information, a target parameter block is determined from the binary file based on the data processing instruction.

[0076] Step S204B: if the current file configuration information is inconsistent with the preset file configuration information, all parameter blocks in the binary file are initialized.

[0077] In this embodiment, the magic number may be a special byte sequence used for file format identification, located at the beginning of the file, which can help the program identify the type and format of the file.

[0078] Specifically, refer to Figure 2 As shown, Figure 2 This is a schematic diagram of the overall layout of the binary file. Figure 2In order to ensure the stability and reliability of the parameter block, there is a space between any two adjacent parameter blocks stored in the binary file, that is, a reserved area. The first parameter block of the binary file is a public parameter block, that is, a shared parameter block, and the current version information of the binary file can be written into the public parameter block. When reading the target parameter block from the binary file, the current file configuration information of the binary file can be read from the public parameter block. After reading the current file configuration information of the binary file from the public parameter block of the binary file, it is determined whether the current file configuration information is consistent with the preset file configuration information, that is, whether the current file version information and the current magic number are consistent with the preset file version information and the preset magic number information. When the current file configuration information is consistent with the preset file configuration information, the target parameter block is determined from the binary file based on the data processing instruction. When the current file configuration information is inconsistent with the preset file configuration information, all parameter blocks in the binary file are initialized.

[0079] In this embodiment, by checking the consistency between the current file configuration information and the preset file configuration information, it can be ensured that the battery parameters processed subsequently are valid and can be correctly parsed. At the same time, when the current file configuration information is inconsistent with the preset file configuration information, the battery parameters in all parameter blocks are automatically restored to the default values, ensuring that the system can operate in a known and stable state and reducing the risk of failure.

[0080] Step S30, based on the address information of the target parameter block, executing the data processing action corresponding to the data processing instruction on the target parameter block to obtain a processing result.

[0081] Specifically, when executing the data processing action corresponding to the data processing instruction on the target parameter block, when the data processing instruction is a data reading instruction, the data processing action corresponding to the data processing instruction is to read the target parameter block from the binary file. When the data processing instruction is a data storage instruction, the data processing action corresponding to the data processing instruction is to write the target battery parameters into the target parameter block. When writing the target battery parameters into the target parameter block, in order to avoid disrupting the arrangement order of the battery parameters already existing in the target parameter block when writing the target battery parameters, further, as an optional implementation, step S30 specifically includes:

[0082] Step S301: if the data processing instruction is a data storage instruction, the target battery parameter is written into a reserved area of ​​the target parameter block.

[0083] The arrangement order of the battery parameters written into the target parameter block remains unchanged.

[0084] In this embodiment, in order to facilitate subsequent expansion of the parameter process, the initial value of the data in the reserved area may be set to 0.

[0085] When the data processing instruction is a data storage instruction, when writing the target battery parameters into the reserved area of ​​the target parameter block, in order to ensure the accuracy of the battery parameters stored in the target parameter block and avoid tampering, further, as an optional implementation, step S301 specifically includes:

[0086] Step S3011, based on the address information of the target parameter block, read the target cyclic redundancy check CRC code corresponding to the target parameter block and the byte information of the target parameter block.

[0087] The byte information includes the battery parameter byte information stored in the target parameter block and the byte information in the reserved area.

[0088] Step S3011, using the byte information to calculate the current cyclic redundancy check CRC code of the target parameter block.

[0089] Step S3012, determining whether the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code.

[0090] Step S3013, if the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code, the target battery parameters are written into the reserved area, and after the target battery parameters are written into the reserved area, the new byte information in the target parameter block is read, and the new current cyclic redundancy check CRC code of the target parameter block is calculated using the new byte information, and the new cyclic redundancy check CRC code is used as the target cyclic redundancy check CRC code.

[0091] Step S3014: If the current cyclic redundancy check CRC code is inconsistent with the target cyclic redundancy check CRC code, the target parameter block is initialized.

[0092] In this embodiment, the total length of the target parameter block and the reserved area can be pre-set, such as setting the total length of the target parameter block and the reserved area to 256 bytes. When the battery parameters are not written in the target parameter block and the reserved area, the initial values ​​of the data in the target parameter block and the reserved area are both 0.

[0093] Specifically, refer to Figure 3 As shown, Figure 3 is the positional relationship between the target parameter block and the target cyclic redundancy check CRC (CyclicRedundancy Check) code. Figure 3In the example, the target parameter block and the reserved area are used as areas for writing battery parameters. Assuming that the battery parameters written into the target parameter block for the first time are parameter 1 and parameter 2, the initial value of the target parameter block changes, but the initial value of the data in the reserved area is still 0. At this time, the byte information of the target parameter block after writing the battery parameters is combined with the byte information in the reserved area to calculate the cyclic redundancy check CRC code, and the cyclic redundancy check CRC code is written into the header position of the target parameter block as the target current cyclic redundancy check CRC code of the target parameter block, that is, the cyclic redundancy check CRC code is used as the fixed header of the target parameter block.

[0094] For example, after the target parameter block stores 10 bytes of battery parameters for the first time, the initial values ​​of the 10 bytes in the target parameter block change, that is, they are no longer 0, but the initial values ​​of the remaining 246 bytes are still 0. At this time, the 256 bytes are taken as a whole to calculate the cyclic redundancy check CRC code of the target parameter block after the battery parameters are stored for the first time, and the cyclic redundancy check CRC code is used as the target cyclic redundancy check CRC code. According to the address of the target parameter block in the binary file, the target cyclic redundancy check CRC code is written into the header position of the target parameter block.

[0095] After receiving the data storage instruction and determining the target parameter block according to the data storage instruction, the target cyclic redundancy check CRC code corresponding to the target parameter block and the byte information of the target parameter block can be read from the binary file according to the address information of the target parameter block.

[0096] After obtaining the byte information, the current cyclic redundancy check CRC code of the target parameter block can be calculated using the byte information. After calculating the current cyclic redundancy check CRC code of the target parameter block, it can be determined whether the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code. When the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code, it is determined that the battery parameters written into the target parameter block have not been tampered with, and the target battery parameters are written into the reserved area at this time. After the target battery parameters are written into the reserved area, the new byte information in the target parameter block can be read, and the new current cyclic redundancy check CRC code of the target parameter block can be calculated using the new byte information, and the new current cyclic redundancy check CRC code is used as the target cyclic redundancy check CRC code. When the current cyclic redundancy check CRC code is inconsistent with the target cyclic redundancy check CRC code, it is determined that the battery parameters stored in the target parameter block have been tampered with, and in order to ensure the correctness of the battery parameters, the target parameter block is initialized at this time to avoid the occurrence of erroneous analysis results when the battery parameters are subsequently used for analysis and processing.

[0097] It should be noted that when the target parameter block needs to write new battery parameters, the new battery parameters are written into the reserved area at the end of the target parameter block, as shown in FIG. Figure 4 As shown, Figure 4 The figure is a schematic diagram of the expansion of the target parameter block. The total bytes of the target parameter block and the reserved area are 256. Before writing the new battery parameters, the target parameter block and the reserved area have used 128 bytes. When the battery parameters are expanded from 128 bytes to 200 bytes, the expanded 72 bytes of new battery parameters are written into the reserved area, and the size of the reserved area is reduced, that is, the size of the reserved area is changed from 128 bytes to 56 bytes, and it will not affect the 128 bytes of battery parameters written previously. That is, after the battery parameters are expanded and the program is updated, the battery parameters previously saved in the target parameter block will not change, and only the new battery parameters written need to be reconfigured.

[0098] In addition, when writing new battery parameters, the application can update safely in the reserved area at the end of the target parameter block when the new battery parameters do not completely use up the target parameter block, without affecting the original battery parameters in the target parameter block. At the same time, since the parameter blocks are distributed in different areas in the binary file and the segmentation does not overlap, when the target parameter block is expanded, it will not affect other parameter blocks, thus meeting the high scalability requirements for battery parameters.

[0099] In this embodiment, when writing the target battery parameters into the target parameter block, the target cyclic redundancy check CRC code in the header of the target parameter block is used to check the current cyclic redundancy check CRC code of the target parameter block, which can ensure the correctness of the battery parameters stored in the target parameter block and prevent the battery parameters stored in the target parameter block from being tampered with. At the same time, when writing the target battery parameters into the target parameter block, the target battery parameters are written into the reserved area, that is, the reserved area is used as a buffer for subsequent parameter expansion. When the battery parameters in the target parameter block need to be expanded, as long as the length of the expanded battery parameters does not exceed the length of the reserved area, it will not affect the parameter blocks adjacent to the target parameter block, thereby ensuring the stability of the stored parameters and improving the extensibility of the target parameter block.

[0100] In this embodiment, compared with the related art, the battery parameters are managed by the parameter management method using EEPROM, configuration files, databases, etc. When managing the battery parameters, the battery parameters are stored in the parameter block using a preset structure format to ensure that the data layout of each parameter block is known. At the same time, the battery parameters are structured, and binary direct reading and writing can be used, making the reading and processing operations of the battery parameters more efficient, reducing the overhead of the program to judge and convert the data format during operation, and improving the efficiency of reading and writing battery parameters. At the same time, the parameter blocks are dispersed in the binary file, and a reserved area is reserved in the tail area of ​​the parameter block to ensure the independence of the parameter block, so that on the basis of ensuring stability and reliability, the reserved area provides scalability for the subsequent expansion of the reference block, that is, when new battery parameters need to be added later, the new battery parameters can be written into the reserved area without redesigning the entire data structure, while reducing the maintenance cost and complexity, and also improving the scalability of the parameters, thereby simplifying the management process of the battery parameters.

[0101] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the battery parameter management method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0102] Specifically, to facilitate a better understanding of this embodiment, a specific example is provided below.

[0103] Reference Figure 5 As shown, Figure 5The flowchart for managing battery parameters using binary files is shown in FIG. 1 . When managing battery parameters, it is possible to predefine which parameters of which batteries are stored in each parameter block, and assign an identification information and an address in the binary file to each parameter block, and bind the identification information and the address so that the corresponding parameter block can be directly read from the binary file according to the identification information, or the battery parameters can be written into the corresponding parameter block. After assigning identification information to the parameter block, it is also necessary to determine whether there is a corresponding binary file in the file system. If there is no corresponding binary file, it is necessary to create the corresponding binary file and write the parameter block into the file according to the pre-allocation according to the registered default parameters, that is, determine the position of each parameter block in the binary file according to the address information of each parameter block in the binary file. If there is a corresponding binary file, check whether the public header magic number and the file version have changed, that is, read the current file configuration information of the binary file from the public parameter block of the binary file, and determine whether the current file configuration information is consistent with the preset file configuration information. When the current file configuration information is inconsistent with the preset file configuration information, the parameter block is written into the file according to the pre-allocation based on the registered default parameters; when the current file configuration information is consistent with the preset file configuration information, the battery parameters are initialized and the battery parameters are written to the corresponding location according to the address information of the parameter block, or the corresponding parameter block is read from the binary file according to the address information of the parameter block.

[0104] It is understandable that in order to prevent the battery parameters stored in the binary file from being tampered with and ensure the correctness of the battery parameters, a cyclic redundancy check CRC code can be used for verification when reading the parameter block or writing the battery parameters into the parameter block, that is, referring to Figure 6-Figure 7 As shown, Figure 6 The following is a flowchart of reading parameter blocks from a binary file. Figure 7 The figure is a flowchart for writing battery parameters into parameter blocks.

[0105] Reference Figure 6As shown, in the scenario of reading the target parameter block from the binary file, the ID of the target parameter block, that is, the target identification information of the target parameter block, is first determined, and the target address information corresponding to the target identification information of the target parameter block is determined according to the mapping relationship, and the target parameter block and the target cyclic redundancy check CRC code corresponding to the target parameter block are read from the binary file according to the target address information. After reading the target parameter block and the target cyclic redundancy check CRC code corresponding to the target parameter block, calculate whether the CRC16 of the application parameter area is consistent with the CRC16 stored in the header, that is, use the byte information of the target parameter block to calculate the current cyclic redundancy check CRC code of the target parameter block, and judge whether the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code. In the case where the current cyclic redundancy check CRC code and the target cyclic redundancy check CRC code are inconsistent, the reading fails at this time, that is, the battery parameters stored in the parameter block are tampered with, and the correct battery parameters cannot be read. At this time, the target parameter block is initialized and the battery parameters stored in the target parameter block are restored to the default parameters. When the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code, it is determined that the battery parameters in the parameter block have not been tampered with, and the correct battery parameters can be successfully read from the target parameter block.

[0106] Reference Figure 7As shown, for the scenario of writing the target battery parameters into the target parameter block, based on the above operation, after reading the target cyclic redundancy check CRC code corresponding to the target parameter block and the byte information of the target parameter block from the binary file, first use the byte information to calculate the current cyclic redundancy check CRC code of the target parameter block, and determine whether the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code. In the case where the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code, the target battery parameters are written into the reserved area at the end of the target parameter block. After the target battery parameters are written into the reserved area at the end of the target parameter block, the new byte information in the target parameter block can be read, and the new current cyclic redundancy check CRC code of the target parameter block can be calculated using the new byte information, and the new current cyclic redundancy check CRC code is used as the target cyclic redundancy check CRC code, that is, the fixed-length application parameter area CRC16 is calculated, and the fixed-length application parameter area + CRC16 constitutes a complete parameter block, and the parameter block is written into the binary file. After the new cyclic redundancy check CRC code is used as the target cyclic redundancy check CRC code and the target battery parameters are written into the target parameter block, a status code is returned to indicate whether the target battery parameters are successfully written into the target parameter block. If the target battery parameters are not successfully written into the target parameter block, the target parameter block is initialized and the battery parameters in the target parameter block are restored to the default parameters; if the target battery parameters are successfully written into the target parameter block, the operation process ends.

[0107] The present application provides a controller, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the battery parameter management method in the above-mentioned embodiment 1.

[0108] Reference below Figure 8 , which shows a schematic diagram of the structure of a controller suitable for implementing the embodiment of the present application. The controller in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), PMPs (Portable Media Players: portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The controller shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0109] like Figure 8 As shown, the controller may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the controller are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the controller to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a controller with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0110] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0111] The controller provided by the present application adopts the battery parameter management method in the above embodiment, which can solve the technical problem of cumbersome management process when using parameter management methods such as EEPROM, configuration files, and databases to manage battery parameters. Compared with the prior art, the beneficial effects of the controller provided by the present application are the same as the beneficial effects of the battery parameter management method provided by the above embodiment, and the other technical features in the controller are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0112] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0113] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0114] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the battery parameter management method in the above-mentioned embodiment.

[0115] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0116] The computer-readable storage medium may be included in the controller; or may exist independently without being assembled into the controller.

[0117] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the controller, the controller: receives data processing instructions for target battery parameters; based on the data processing instructions, determines a target parameter block from a binary file; wherein the binary file includes multiple parameter blocks of fixed length, the tail of each parameter block is a reserved area, and the parameter block is configured to store data using a preset structure format; based on the address information of the target parameter block, executes a data processing action corresponding to the data processing instruction on the target parameter block to obtain a processing result.

[0118] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0119] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0120] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0121] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned battery parameter management method, and can solve the technical problem of cumbersome management process when using parameter management methods such as EEPROM, configuration files, and databases to manage battery parameters. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the battery parameter management method provided in the above-mentioned embodiment, and will not be repeated here.

[0122] The present application also provides a computer program product, including a computer program, which implements the steps of the battery parameter management method as described above when executed by a processor.

[0123] The computer program product provided by the present application can solve the technical problem of cumbersome management process when the battery parameters are managed by the parameter management method using EEPROM, configuration files, databases, etc. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the battery parameter management method provided by the above embodiment, and will not be repeated here.

[0124] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A battery parameter management method, characterized in that: The battery parameter management method comprises: receiving a data processing instruction for a target battery parameter; Based on the data processing instruction, a target parameter block is determined from a binary file; wherein the binary file includes a plurality of parameter blocks of fixed length, the tail of each parameter block is a reserved area, and the parameter block is configured to store data using a preset structure format; each parameter block has a preset corresponding relationship with a battery parameter and a battery; the target parameter block is used to store the target battery parameter; Based on the address information of the target parameter block, executing the data processing action corresponding to the data processing instruction on the target parameter block to obtain a processing result; The step of executing the data processing action corresponding to the data processing instruction on the target parameter block based on the address information of the target parameter block to obtain the processing result includes: If the data processing instruction is a data storage instruction, the target battery parameters are written into the reserved area of ​​the target parameter block; wherein the arrangement order of the battery parameters written into the target parameter block remains unchanged.

2. The battery parameter management method according to claim 1, characterized in that: The initial value of the data in the reserved area is 0.

3. The battery parameter management method according to claim 2, characterized in that: The step of writing the target battery parameter into the reserved area of ​​the target parameter block comprises: Based on the address information of the target parameter block, read the target cyclic redundancy check CRC code corresponding to the target parameter block and the byte information of the target parameter block; wherein the byte information includes the battery parameter byte information stored in the target parameter block and the byte information of the reserved area; Calculate the current cyclic redundancy check CRC code of the target parameter block using the byte information; Determine whether the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code; If the current cyclic redundancy check CRC code is inconsistent with the target cyclic redundancy check CRC code, initializing the target parameter block; If the current cyclic redundancy check CRC code is consistent with the target cyclic redundancy check CRC code, the target battery parameters are written into the reserved area, and after the target battery parameters are written into the reserved area, the new byte information in the target parameter block is read, and a new cyclic redundancy check CRC code of the target parameter block is calculated using the new byte information, and the new cyclic redundancy check CRC code is used as the target cyclic redundancy check CRC code.

4. The battery parameter management method according to claim 1, characterized in that: The step of determining a target parameter block from a binary file based on the data processing instruction comprises: If the data processing instruction is a data read instruction, determining target identification information of the target parameter block; Searching for a mapping relationship to determine target address information corresponding to the target identification information; wherein the mapping relationship includes a corresponding relationship between identification information and address information; Based on the target address information, the target parameter block is read from the binary file.

5. The battery parameter management method according to claim 1, characterized in that: The step of determining a target parameter block from a binary file based on the data processing instruction comprises: Reading the current file configuration information of the binary file from the common parameter block of the binary file; wherein the common parameter block is the first parameter block of the binary file, and the current file configuration information includes file version number information and magic number information; Determining whether the current file configuration information is consistent with the preset file configuration information; If the current file configuration information is consistent with the preset file configuration information, determining a target parameter block from the binary file based on the data processing instruction; If the current file configuration information is inconsistent with the preset file configuration information, all parameter blocks in the binary file are initialized.

6. The battery parameter management method according to claim 1, characterized in that: The parameter block is configured to store data using a preset structure format and a one-byte alignment.

7. A controller, characterized in that: The controller comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the battery parameter management method according to any one of claims 1 to 6.

8. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the battery parameter management method according to any one of claims 1 to 6 are implemented.

9. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the battery parameter management method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and device for generating battery passport and storage medium

    CN117390016A

  • Data processing method, device and equipment applied to temporary file

    CN117762877A