Battery management system program processing method and device, equipment and readable storage medium
By dividing the original program storage area and the upgrade program storage area in the control unit of the battery management system and mapping it to the same logical partition, the problem that the battery management system program upgrade needs to be performed in the vehicle's stationary state in the prior art is solved, and the invisible upgrade is achieved during the operation of the vehicle, reducing the cost and difficulty, and avoiding the risk of death.
Patent Information
- Application Number
- CN202411625908.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-07
AI Technical Summary
During the upgrade of the existing battery management system (BMS) program, it needs to be performed at a standstill state of the vehicle, resulting in high upgrade costs, difficult control, and risk of scrubbing. It is impossible to upgrade during the vehicle operation, and users wait for the upgrade to complete for a long time.
By dividing the original program storage area and the upgrade program storage area in the control unit and mapping it to the same logical partition, it allows upgrades during the vehicle operation. Even if the upgrade fails, the programs in the original program storage area can be directly used to avoid the risk of scrubbing.
It realizes the invisible upgrade of the battery management system program during vehicle operation, reduces the upgrade cost and control difficulty, avoids the risk of death, and users do not need to wait for the upgrade to complete.
Smart Images

Figure CN119576379A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery management systems, and in particular to a battery management system program processing method, a battery management system program processing device, an electronic device and a computer-readable storage medium. Background Art
[0002] In the power battery system of new energy vehicles, the battery management system (BMS) program is used to detect the battery status and control the battery charging and discharging. The battery management system (BMS) program plays a vital role in battery safety. With the continuous development of new energy vehicles, the BMS program is also being continuously upgraded and optimized. There are two main ways to upgrade the BMS program: local and remote. Local upgrades are generally performed through the vehicle's OBD port CAN bus. The OBD (On-Board Diagnostics) port is an interface for the on-board diagnostic system that allows external devices to connect to the vehicle's electronic control unit (ECU) to read the vehicle's diagnostic information and performance data. The CAN (Controller Area Network) bus is a high-speed, high-reliability network used to enable communication between various control modules inside the vehicle. Remote upgrades send the program package to TBOX through the vehicle's remote background server, and then TBOX forwards it to BMS through the CAN bus for upgrading. TBOX is an electronic device that integrates multiple technologies such as GPS, mobile communication networks (such as GSM, CDMA, 4G / 5G) and on-board diagnostic systems).
[0003] In the prior art, when the BMS program is upgraded locally, it requires a lot of manpower and time, the upgrade cost is high, and the management and control are difficult; when the BMS program is upgraded remotely, if the flashing fails and cannot be rolled back to the previous version, it needs to be flashed again, which poses a risk of flash failure. In addition, the prior art is limited by hardware and security considerations. Whether it is a local upgrade or a remote upgrade, the vehicle must be stationary to perform, and it cannot be upgraded while the vehicle is running. Users have to wait a long time for the upgrade to complete. Summary of the invention
[0004] The present invention proposes a battery management system program processing method to solve the above problems.
[0005] In a first aspect, an embodiment of the present invention discloses a battery management system program processing method, wherein the battery management system program is processed by a control unit, the control unit includes an original program storage area and an upgrade program storage area, the original program storage area and the upgrade program storage area are mapped to the same logical partition, the original program storage area is used to store the program currently required to be run, and the upgrade program storage area is used to store the upgrade program, and the battery management system program processing method includes:
[0006] When the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, the current upgrade program storable area is updated to the original program storage area, and the current original program storage area is updated to the upgrade program storable area, and when the operation starts, the program in the updated original program storage area is run; otherwise, when the operation starts, the program in the current original program storage area is run.
[0007] By adopting the above technical scheme, in the battery management system program processing method of the present invention, by dividing the storage area of the control unit into an original program storage area and an upgrade program storage area, and mapping the original program storage area and the upgrade program storage area to the same logical partition, during the upgrade process, the upgrade program can be stored in the upgrade program storage area without affecting the operation of the program in the original program storage area. The vehicle can also be upgraded during operation. Even if the upgrade fails, the program in the original program storage area can be directly used. The user does not need to wait for the upgrade to be completed. The upgrade of the battery management system program is completed without affecting the user's use, thereby realizing a seamless upgrade.
[0008] According to another specific embodiment of the present invention, it also includes: when the information stored in the current upgrade program storage area changes and the upgrade program stored in the current upgrade program storage area is executable, if the program in the current original program storage area is currently running, it continues to run until the current operation ends.
[0009] According to another specific implementation of the present invention, the method further includes: if the upgrade program in the current upgrade program storage area is not executable, then feedback is given that the program upgrade has failed.
[0010] According to another specific embodiment of the present invention, the method further includes: if the upgrade program in the current upgrade program storage area is not executable, re-updating the upgrade program in the current upgrade program storage area.
[0011] According to another specific embodiment of the present invention, it also includes: when a battery management system program change at the remote end is detected, an upgrade program is received from the remote end, and the upgrade program is written into the current upgrade program storage area.
[0012] According to another specific embodiment of the present invention, the control unit includes a plurality of program storage areas, the plurality of program storage areas having matching identifiers;
[0013] When the identifier is an activated identifier, the program storage area corresponding to the activated identifier is the current original program storage area; when the identifier is an inactivated identifier, the program storage area corresponding to the inactivated identifier is the current upgrade program storage area.
[0014] According to another specific embodiment of the present invention, when the information stored in the current upgrade program storage area changes and the upgrade program stored in the current upgrade program storage area is executable, the current upgrade program storage area is updated to the original program storage area, and the current original program storage area is updated to the upgrade program storage area, and when the operation starts, the program in the updated original program storage area is run, specifically including:
[0015] When the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, a switching instruction is written to update the inactivated identifier corresponding to the current upgrade program storable area to an activated identifier so that the current upgrade program storable area is updated to the original program storage area, and the activated identifier corresponding to the current original program storage area is updated to an inactivated identifier so that the current original program storage area is updated to the upgrade program storable area. When the operation starts, the program in the program storage area corresponding to the updated activated identifier is run.
[0016] In a second aspect, an embodiment of the present invention discloses a battery management system program processing device, which processes the battery management system program through a control unit, the control unit includes an original program storage area and an upgrade program storage area, the original program storage area and the upgrade program storage area are mapped to the same logical partition, the original program storage area is used to store the program that needs to be run at the current time, and the upgrade program storage area is used to store the upgrade program. The battery management system program upgrade device includes:
[0017] A processing module is used for, when the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, running the upgrade program in the current upgrade program storable area at the beginning of use, updating the current upgrade program storable area to the original program storage area, and updating the current original program storage area to the upgrade program storable area; otherwise, running the original program in the current original program storage area at the beginning of use.
[0018] By adopting the above technical scheme, in the battery management system program processing device of the present invention, by dividing the storage area of the control unit into an original program storage area and an upgrade program storage area, and mapping the original program storage area and the upgrade program storage area to the same logical partition, during the upgrade process, the upgrade program can be stored in the upgrade program storage area without affecting the operation of the program in the original program storage area. The vehicle can also be upgraded during operation. Even if the upgrade fails, the program in the original program storage area can be directly used. The user does not need to wait for the upgrade to be completed. The upgrade of the battery management system program is completed without affecting the user's use, thereby realizing a seamless upgrade.
[0019] In a third aspect, an embodiment of the present invention discloses an electronic device, including a processor and a memory, wherein the memory stores at least one instruction, and when the at least one instruction is executed by the processor, the battery management system program processing method in any of the aforementioned embodiments is implemented.
[0020] By adopting the above technical solution, the electronic device divides the storage area of the control unit into an original program storage area and an upgrade program storage area, and maps the original program storage area and the upgrade program storage area to the same logical partition. During the upgrade process, the upgrade program can be stored in the upgrade program storage area without affecting the operation of the program in the original program storage area. The vehicle can also be upgraded during operation. Even if the upgrade fails, the program in the original program storage area can be directly used. The user does not need to wait for the upgrade to be completed. The upgrade of the battery management system program is completed without affecting the user's use, thereby achieving a seamless upgrade.
[0021] In a fourth aspect, an embodiment of the present invention discloses a computer-readable storage medium, in which at least one instruction is stored. When the at least one instruction is executed, the battery management system program processing method in any of the aforementioned embodiments is implemented.
[0022] By adopting the above technical solution, the computer-readable storage medium divides the storage area of the control unit into an original program storage area and an upgrade program storage area, and maps the original program storage area and the upgrade program storage area to the same logical partition. During the upgrade process, the upgrade program can be stored in the upgrade program storage area without affecting the operation of the program in the original program storage area. The vehicle can also be upgraded during operation. Even if the upgrade fails, the program in the original program storage area can be directly used. The user does not need to wait for the upgrade to be completed. The upgrade of the battery management system program is completed without affecting the user's use, thereby achieving a seamless upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 Schematic diagram showing the process of the battery management system program processing method in an embodiment of the present invention Figure 1 ;
[0024] Figure 2 Schematic diagram showing the process of the battery management system program processing method in an embodiment of the present invention Figure 2 ;
[0025] Figure 3 Schematic diagram showing the process of the battery management system program processing method in an embodiment of the present invention Figure 3 ;
[0026] Figure 4 Schematic diagram showing the process of the battery management system program processing method in an embodiment of the present invention Figure 4 ;
[0027] Figure 5 Schematic diagram showing the process of the battery management system program processing method in an embodiment of the present invention Figure 5 ;
[0028] Figure 6 A schematic diagram showing the structure of a battery management system program processing device according to an embodiment of the present invention is shown;
[0029] Figure 7 A schematic diagram showing the structure of an electronic device in an embodiment of the present invention is shown;
[0030] Figure 8 A schematic diagram showing the structure of a control unit in an embodiment of the present invention is shown;
[0031] Fig. 9 A schematic diagram of the structure of the remote end in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0032] The following specific embodiments illustrate the implementation of the present invention, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Although the description of the present invention will be introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to this implementation. On the contrary, the purpose of introducing the invention in conjunction with the implementation is to cover other options or modifications that may extend based on the claims of the present invention. In order to provide a deep understanding of the present invention, the following description will include many specific details. The present invention can also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present invention, some specific details will be omitted in the description. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0033] It should be noted that in this specification, similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0034] The terms “first”, “second”, etc. are only used for distinguishing descriptions and should not be understood as indicating or implying relative importance.
[0035] In the description of this embodiment, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this embodiment can be understood according to specific circumstances.
[0036] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0037] The inventor carefully studied the existing technology and found that the existing technology can only upgrade the battery management system program when the vehicle is stationary, which takes a long time to wait, requires a lot of manpower and time, and has the risk of flashing dead. The inventor hopes to solve the above problems.
[0038] In the first aspect, an embodiment of the present invention discloses a method for processing a battery management system program, in which a battery management system program is processed by a control unit. The control unit includes an original program storage area and an upgrade program storage area. The original program storage area and the upgrade program storage area are mirror partitions. The original program storage area and the upgrade program storage area are mapped to the same logical partition, that is, the code addresses of the original program storage area and the upgrade program storage area are the same. With this arrangement, the two storage areas are logically transparent, and the same code address can be used to access the code and data stored in the original program storage area or the upgrade program storage area. When the two storage areas are switched, the execution of the program will not be interrupted, and the program code does not need to be modified. Fast switching can be achieved, which is conducive to ensuring the continuous availability of program data. The original program storage area is used to store programs that need to be run at the current time, and the upgrade program storage area is used to store upgrade programs.
[0039] refer to Figure 1 , the battery management system program processing method includes the following steps:
[0040] S1: When the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, the current upgrade program storable area is updated to the original program storage area, and the current original program storage area is updated to the upgrade program storable area, and when the operation starts, the program in the updated original program storage area is run; otherwise, when the operation starts, the program in the current original program storage area is run.
[0041] The information stored in the current upgrade program storage area changes may refer to a program upgrade package corresponding to the upgrade program being written into the current upgrade program storage area, or may refer to an update of the program in the current upgrade program storage area. Updating the current upgrade program storage area to the original program storage area and updating the current original program storage area to the upgrade program storage area actually means swapping the current upgrade program storage area with the original program storage area. When the information stored in the current upgrade program storage area does not change and the upgrade program stored in the current upgrade program storage area is executable, the program in the current original program storage area is run at the start of the run, that is, the original old version of the program is run.
[0042] By adopting the above technical scheme, in the battery management system program processing method of the present invention, by dividing the storage area of the control unit into an original program storage area and an upgrade program storage area, and mapping the original program storage area and the upgrade program storage area to the same logical partition, during the upgrade process, the upgrade program can be stored in the upgrade program storage area without affecting the operation of the program in the original program storage area. The vehicle can also be upgraded during operation. Even if the upgrade fails, the program in the original program storage area can be directly used. The user does not need to wait for the upgrade to be completed. The upgrade of the battery management system program can be completed without affecting the user's use, thereby realizing a seamless upgrade.
[0043] Exemplarily, the battery management system program processing method may include the following steps:
[0044] S01: Obtain a program upgrade package corresponding to the upgrade program. The program upgrade package may be automatically loaded by the control unit. Further, the control unit may automatically load the program upgrade package after receiving an upgrade instruction.
[0045] S02: Determine the original program storage area and the upgrade program storage area. The storage area where the program currently needs to be run is located is determined as the original program storage area. Storage areas other than the original program storage area can be determined as the upgrade program storage area.
[0046] For example, reference Figure 8 , Figure 8The schematic diagram of the structure of the control unit 3 is shown. The control unit 3 includes a microcontroller MCU32 (hereinafter referred to as MCU32), and the MCU32 has a programmable flash memory PFLASH inside. PFLASH can support hardware division into two areas, that is, the storage space is divided into Bank_A34 and Bank_B35. For example, if the program that needs to be run at the current time is stored in Bank_A34, Bank_A34 is determined as the original program storage area, and Bank_B35 is determined as the upgrade program storage area. By using PFLASH to divide the storage space into two storage areas, when the program in one storage area is running, the other storage area can be erased without affecting the currently running program, which helps to upgrade the program while the battery management system is running, and the user does not need to spend time waiting for the upgrade.
[0047] S03: Writing the program upgrade package into the upgrade program storage area. After the program upgrade package is written into the upgrade program storage area, it can be considered that the information stored in the current upgrade program storage area has changed.
[0048] Take Bank_A34 as the original program storage area and Bank_B35 as the upgrade program storage area as an example. The original old version of the program is stored in Bank_A34. When the program is currently required to be run, the old version of the program in Bank_A34 will be run. At this time, Bank_B35 is an idle storage area and can be written into the program upgrade package. The program upgrade package includes multiple data packets. In the process of writing the program upgrade package to Bank_B35, Bank_B35 is first erased to prevent the existing information in Bank_B35 from affecting the writing of the program upgrade package. Then, the multiple data packets of the program upgrade package corresponding to the upgrade program are written into Bank_B35 in a packet-by-pack form.
[0049] S04: Determine whether the program upgrade package is successfully written into the upgrade program storage area and the verification is successful.
[0050] After the upgrade program is written, a check is performed. When the CRC (i.e., cyclic redundancy check) check value of the written upgrade program is the same as the check value calculated in the background, the check is considered successful. When the program upgrade package is successfully written into the upgrade program storage area and the check is successful, it can be considered that the upgrade program stored in the current upgrade program storage area is executable. After step S04, the aforementioned step S1 can be executed.
[0051] Further, in the above embodiments, reference is made to Figure 2 The battery management system program processing method may further include the following steps:
[0052] S2: When the information stored in the current upgrade program storage area changes and the upgrade program stored in the current upgrade program storage area is executable, if the program in the current original program storage area is currently running, the program continues to run until the current run ends.
[0053] Specifically, when the current battery management system is running, the program can be upgraded without affecting the running program or interrupting the running process. After this run is completed, when the next run starts, if the program upgrade has been completed (that is, during this run, the current upgrade program storage area has been written to the upgrade program and the upgrade program can be run), the upgrade program will be run. With this setting, users do not have to spend time waiting for the upgrade. They can use the battery management system while upgrading it, and there will be no operational confusion during use, which can save time and achieve seamless upgrades.
[0054] Further, in the above embodiments, reference is made to Figure 3 The battery management system program processing method may further include the following steps:
[0055] S3: If the upgrade program in the current upgrade program storage area cannot be run, the feedback program upgrade fails.
[0056] For example, an alarm may be issued to indicate that the program upgrade has failed, or a program upgrade failure instruction may be sent to the remote server corresponding to the vehicle to remind the relevant programmer to handle the problem. At this time, the control unit may roll back the program to the original old version of the program, and when the battery management system starts running, the original old version of the program in the original program storage area is still running. Taking Bank_A34 as the original program storage area and Bank_B35 as the upgrade program storage area as an example, the program currently running is in Bank_A34, and the upgrade program is written into Bank_B35. If the written upgrade program is not executable, the program in Bank_A34 is still running when the system starts running.
[0057] Further, in the above embodiments, reference is made to Figure 4 The battery management system program processing method may further include the following steps:
[0058] S4: If the upgrade program in the current upgrade program storage area cannot be run, then the upgrade program in the current upgrade program storage area is updated again.
[0059] Exemplarily, re-updating the upgrade program in the current upgrade program storage area may refer to rewriting the acquired program upgrade package into the current upgrade program storage area and verifying it again, or may refer to reloading a new program upgrade package, writing the reloaded program upgrade package into the current upgrade program storage area and verifying it. If the upgrade program in the current upgrade program storage area is still not executable after re-updating the upgrade program in the current upgrade program storage area for multiple times, a program upgrade failure message may be sent to relevant personnel for processing. At this time, the battery management system can still run the original old version of the program. Taking Bank_A34 as the original program storage area and Bank_B35 as the upgrade program storage area as an example, the program in Bank_A34 is currently running, and the upgrade program is written into Bank_B35. If the written upgrade program is not executable, the program in Bank_A34 will still be run when it starts running.
[0060] Further, in the above embodiments, reference is made to Figure 5 The battery management system program processing method may further include the following steps:
[0061] S5: When a battery management system program change at the remote end is detected, an upgrade program is received from the remote end, and the upgrade program is written into the current upgrade program storage area.
[0062] For example, reference Figure 8 Combined with Fig. 9 , Fig. 9 The schematic diagram of the structure of the remote terminal 4 is shown. The battery management system program processing method is implemented by the control unit 3 and the remote terminal 4. The control unit 3 is installed on the vehicle, and the control unit 3 is, for example, a BMS main control module BCU. The remote terminal 4 can be a BMS remote background monitoring system. The remote terminal 4 can remotely upgrade the battery management system program of the control unit 3 during the operation of the vehicle.
[0063] The control unit 3 includes a 4G transceiver module 33. The control unit 3 implements the wireless communication function through the MCU32 and the 4G transceiver module 33. The 4G transceiver module 33 can also be replaced by a module related to 5G or other wireless communication methods. The present invention takes 4G communication as an example for explanation. The 4G transceiver module 33 is connected to the MCU32 for communication via the UART bus. Among them, the UART (Universal Asynchronous Receiver / Transmitter) bus is an asynchronous serial communication interface, which allows two modules to communicate in full-duplex through two signal lines, that is, data can be sent and received at the same time. The characteristic of UART communication is that no clock signal line is required, and the data transmission parties are synchronized by a pre-agreed baud rate (the number of bits transmitted per second). By adopting UART communication, it helps to improve communication efficiency and speed up program upgrades.
[0064] The remote end 4 includes a 4G transceiver module 41 and a background monitoring server 42. The 4G transceiver module 41 and the background monitoring server 42 are connected and communicated via TCP / IP. The TCP / IP protocol is relatively reliable and helps to ensure the reliability of communication.
[0065] Exemplarily, the remote terminal 4 can detect whether the program has changed. When a program change is detected, it can be considered that the battery management system has a program upgrade requirement. At this time, the background monitoring server 42 of the remote terminal 4 can automatically load the program upgrade package 5. Among them, detecting whether the program has changed, for example, can refer to detecting whether the service provider's cloud platform has a new program. Exemplarily, when it is detected that the service provider's cloud platform has a new program, the cloud platform can automatically upload the program upgrade package 5 to the background monitoring server 42. In other embodiments, detecting whether the program has changed can also refer to the background monitoring server 42 detecting whether the program upgrade package 5 has been received.
[0066] When the battery management system needs a program upgrade, the background monitoring server 42 of the remote end 4 can automatically load the program upgrade package 5. Subsequently, the background monitoring server 42 can send the program upgrade package 5 to the MCU32 of the control unit 3, and the MCU32 of the control unit 3 receives the program upgrade package 5 from the background monitoring server 42.
[0067] For example, if the upgrade program in the current upgrade program storage area cannot be run, that is, the program upgrade fails, the control unit 3 can send a program upgrade failure message to the remote terminal 4. The remote terminal 4 can send instructions to personnel related to the battery management system program to remind the relevant personnel to deal with the problem of program upgrade failure. For another example, the remote terminal 4 can resend a new program upgrade package 5 to the control unit 3 so that the control unit 3 can re-flash, that is, re-upgrade the program.
[0068] If the upgrade program in the current upgrade program storage area can be run, that is, the program upgrade is successful, the control unit 3 can send a program upgrade success message to the remote end 4. The remote end 4 does not send the program upgrade package 5 corresponding to the current upgrade program to the control unit 3 until a new upgrade program is detected and a new program upgrade package corresponding to the new upgrade program is received. The control unit 3 stops flashing after the program upgrade is successful until a new program upgrade package corresponding to the new upgrade program is received.
[0069] By sending information on whether the program is successfully upgraded to the remote terminal 4, it is helpful to monitor whether the battery management systems of multiple vehicles are successfully upgraded. In addition, through wireless communication between the control unit 3 and the remote terminal 4, the remote terminal 4 can send program upgrade packages 5 to the control units 3 of multiple vehicles at the same time, and multiple battery management system programs of multiple vehicles can be upgraded at the same time without affecting each other, which helps to improve the efficiency of program upgrade.
[0070] For example, in the above embodiments, continue to refer to Figure 8 The control unit 3 may also include a CAN transceiver 31, which can be used to convert the digital signal generated by the CAN controller into a signal suitable for transmission on the CAN bus, and also convert the signal on the CAN bus back into a digital signal for use by the CAN controller. The CAN transceiver 31 is a reserved module, which can be used for local flashing or local debugging before the Internet connection is used, that is, when there is no Internet connection, or when the Internet has problems and cannot be connected, the reserved module can be used for local flashing or local debugging to upgrade the program. The CAN transceiver 31 is connected to the MCU32 via the transmitting line CAN_TX and the receiving line CAN_RX. With this setting, the program can be upgraded without being connected to the Internet as long as the control unit is automatically loaded into the program upgrade package, and the upgrade method is more comprehensive.
[0071] Furthermore, in each of the above embodiments, the control unit includes a plurality of program storage areas, and the plurality of program storage areas have matching identifiers. When the identifier is an activated identifier, the program storage area corresponding to the activated identifier is the current original program storage area. When the identifier is an inactivated identifier, the program storage area corresponding to the inactivated identifier is the current upgrade program storage area.
[0072] In this embodiment, reference Figure 8, the control unit 3 has two program storage areas, both of which are set in MCU32, namely Bank_A34 and Bank_B35. Exemplarily, when the program currently required to be run is stored in Bank_A34, the identifier of Bank_A34 is an activated identifier, and Bank_A34 corresponds to the original program storage area. At this time, the identifier of Bank_B35 is an inactivated identifier, and Bank_B35 is an upgrade program storage area. When the program currently required to be run is stored in Bank_B35, the identifier of Bank_B35 is an activated identifier, and Bank_B35 corresponds to the original program storage area. At this time, the identifier of Bank_A34 is an inactivated identifier, and Bank_A34 is an upgrade program storage area.
[0073] Further, in each of the above embodiments, the aforementioned step S1 may include the following steps: when the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, writing a switching instruction, updating the inactivated identifier corresponding to the current upgrade program storable area to an activated identifier so that the current upgrade program storable area is updated to the original program storage area, updating the activated identifier corresponding to the current original program storage area to an inactivated identifier so that the current original program storage area is updated to the upgrade program storable area, and when starting to run, running the program in the program storage area corresponding to the updated activated identifier.
[0074] Exemplarily, taking Bank_A34 as the current original program storage area and Bank_B35 as the current upgrade program storage area, when the information stored in Bank_B35 changes and the upgrade program stored in Bank_B35 is executable (i.e., when the program upgrade is successful), a switching instruction is written to the startup configuration segment of MCU32. If the program in Bank_A34 is currently running, the operation continues until the operation ends. When the next operation starts, the identifier of Bank_A34 can be changed from an activated identifier to an inactivated identifier according to the switching instruction, and Bank_A34 is changed from the current original program storage area to the upgrade program storage area (i.e., from activated to inactivated, that is, from activated state to idle state), and at the same time, the inactivated identifier of Bank_B35 is changed to an activated identifier, and Bank_B35 is changed from the current upgrade program storage area to the original program storage area (i.e., from unactivated to activated, that is, from idle state to activated state).
[0075] Accordingly, when the program is not upgraded or the program upgrade fails, the switching instruction is not written to the startup configuration segment of MCU32. Taking Bank_A34 as the current original program storage area and Bank_B35 as the current upgrade program storage area as an example, when the battery management system needs to run, the program in Bank_A34 is run.
[0076] The battery management system program processing method in the above-mentioned embodiments of the present invention does not need to detect whether the battery management system is in an idle state. The vehicle can be flashed when charging and discharging, and the user does not need to spend time waiting for the program upgrade. Wireless communication can be carried out between the control unit 3 and the remote terminal 4, remote monitoring and diagnostic control can be supported, and real-time upgrades of remote programs can be supported. In conjunction with the MCU32 in the control unit 3, program rollback can be achieved, and the foundation for big data analysis can be laid. In addition, the present invention does not erase the original program. When the upgrade program fails to be flashed, it can be rolled back to the version corresponding to the original program. There is basically no risk of flash failure, and all battery management systems can be upgraded at the same time.
[0077] Second, reference Figure 6 The embodiment of the present invention discloses a battery management system program processing device 1, which processes the battery management system program through a control unit. The control unit includes an original program storage area and an upgrade program storage area. The original program storage area and the upgrade program storage area are mapped to the same logical partition. The original program storage area is used to store the program that needs to be run at the current time, and the upgrade program storage area is used to store the upgrade program. The battery management system program processing device 1 processes the battery management system program through the battery management system program processing method in any of the aforementioned embodiments. The battery management system program upgrade device 1 includes a processing module 11.
[0078] The processing module 11 is used to run the upgrade program in the current upgrade program storable area when the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, update the current upgrade program storable area to the original program storage area, and update the current original program storage area to the upgrade program storable area when the use starts; otherwise, run the original program in the current original program storage area when the use starts.
[0079] By adopting the above technical scheme, in the battery management system program processing device 1 of the present invention, by dividing the storage area of the control unit into an original program storage area and an upgrade program storage area, and mapping the original program storage area and the upgrade program storage area to the same logical partition, during the upgrade process, the upgrade program can be stored in the upgrade program storage area without affecting the operation of the program in the original program storage area. The vehicle can also be upgraded during operation. Even if the upgrade fails, the program in the original program storage area can be directly used. The user does not need to wait for the upgrade to be completed. The upgrade of the battery management system program is completed without affecting the user's use, thereby realizing a seamless upgrade.
[0080] Furthermore, the processing module 11 may also be used to execute the aforementioned steps S2, S3, S4 and S5 and related steps.
[0081] The battery management system program processing device 1 may further include a detection and writing module (not shown in the figure), which is connected to the processing module 11 and is used to execute the aforementioned steps S01, S02, S03 and S04 and related steps.
[0082] Thirdly, reference Figure 7 The embodiment of the present invention discloses an electronic device 2, including a processor 22 and a memory 21, wherein the memory 21 stores at least one instruction, and when the at least one instruction is executed by the processor 22, the battery management system program processing method in any of the above embodiments is implemented. The memory 21 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader (BootLoader), and other programs.
[0083] By adopting the above technical solution, the electronic device 2 divides the storage area of the control unit into an original program storage area and an upgrade program storage area, and maps the original program storage area and the upgrade program storage area to the same logical partition. During the upgrade process, the upgrade program can be stored in the upgrade program storage area without affecting the operation of the program in the original program storage area. The vehicle can also be upgraded during operation. Even if the upgrade fails, the program in the original program storage area can be directly used. The user does not need to wait for the upgrade to be completed. The upgrade of the battery management system program is completed without affecting the user's use, thereby achieving a seamless upgrade.
[0084] In a fourth aspect, an embodiment of the present invention discloses a computer-readable storage medium, in which at least one instruction is stored. When the at least one instruction is executed, the battery management system program processing method in any of the aforementioned embodiments is implemented.
[0085] By adopting the above technical solution, the computer-readable storage medium divides the storage area of the control unit into an original program storage area and an upgrade program storage area, and maps the original program storage area and the upgrade program storage area to the same logical partition. During the upgrade process, the upgrade program can be stored in the upgrade program storage area without affecting the operation of the program in the original program storage area. The vehicle can also be upgraded during operation. Even if the upgrade fails, the program in the original program storage area can be directly used. The user does not need to wait for the upgrade to be completed. The upgrade of the battery management system program is completed without affecting the user's use, thereby achieving a seamless upgrade.
[0086] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0088] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0089] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0090] Although the present invention has been illustrated and described with reference to certain preferred embodiments of the present invention, it should be understood by those skilled in the art that the above is a further detailed description of the present invention in conjunction with specific embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. Those skilled in the art may make various changes in form and details, including making several simple deductions or substitutions, without departing from the spirit and scope of the present invention.
Claims
1. A battery management system program processing method, characterized in that: The battery management system program is processed by a control unit, the control unit includes an original program storage area and an upgrade program storage area, the original program storage area and the upgrade program storage area are mapped to the same logical partition, the original program storage area is used to store the program that needs to be run at the current time, and the upgrade program storage area is used to store the upgrade program. The battery management system program processing method includes: When the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, the current upgrade program storable area is updated to the original program storage area, and the current original program storage area is updated to the upgrade program storable area, and when the operation starts, the program in the updated original program storage area is run; otherwise, when the operation starts, the program in the current original program storage area is run.
2. The battery management system program processing method according to claim 1, characterized in that: Also includes: When the information stored in the current upgrade program storage area changes and the upgrade program stored in the current upgrade program storage area is executable, if the program in the current original program storage area is currently running, it continues to run until the current run ends.
3. The battery management system program processing method according to claim 1, characterized in that: Also includes: If the upgrade program in the current upgrade program storage area cannot be run, the feedback program upgrade fails.
4. The battery management system program processing method according to claim 1, characterized in that: Also includes: If the upgrade program in the current upgrade program storage area is not executable, the upgrade program in the current upgrade program storage area is updated again.
5. The battery management system program processing method according to claim 1, characterized in that: Also includes: When a battery management system program change at a remote end is detected, an upgrade program from the remote end is received and the upgrade program is written into a current upgrade program storage area.
6. The battery management system program processing method according to claim 1, characterized in that: The control unit includes a plurality of program storage areas, the plurality of program storage areas having matching identifiers; When the identifier is an activated identifier, the program storage area corresponding to the activated identifier is a current original program storage area; When the identifier is an inactivated identifier, the program storage area corresponding to the inactivated identifier is a current upgrade program storage area.
7. The method for upgrading the battery management system program according to claim 6, characterized in that: When the information stored in the current upgrade program storage area changes and the upgrade program stored in the current upgrade program storage area is executable, the current upgrade program storage area is updated to the original program storage area, the current original program storage area is updated to the upgrade program storage area, and when the operation starts, the program in the updated original program storage area is run, specifically including: When the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, a switching instruction is written to update the inactivated identifier corresponding to the current upgrade program storable area to an activated identifier so that the current upgrade program storable area is updated to the original program storage area, and the activated identifier corresponding to the current original program storage area is updated to an inactivated identifier so that the current original program storage area is updated to the upgrade program storable area. When the operation starts, the program in the program storage area corresponding to the updated activated identifier is run.
8. A battery management system program processing device, characterized in that: The battery management system program is processed by a control unit, the control unit includes an original program storage area and an upgrade program storage area, the original program storage area and the upgrade program storage area are mapped to the same logical partition, the original program storage area is used to store the original program that needs to be run at the current time, and the upgrade program storage area is used to store the upgrade program. The battery management system program upgrade device includes: A processing module is used for, when the information stored in the current upgrade program storable area changes and the upgrade program stored in the current upgrade program storable area is executable, running the upgrade program in the current upgrade program storable area at the beginning of use, updating the current upgrade program storable area to the original program storage area, and updating the current original program storage area to the upgrade program storable area; otherwise, running the original program in the current original program storage area at the beginning of use.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, and when the at least one instruction is executed by the processor, the battery management system program processing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed, the battery management system program processing method according to any one of claims 1 to 7 is implemented.