CN113342374A - Battery management system upgrading method and electronic device - Google Patents

Battery management system upgrading method and electronic device Download PDF

Info

Publication number
CN113342374A
CN113342374A CN202110661437.XA CN202110661437A CN113342374A CN 113342374 A CN113342374 A CN 113342374A CN 202110661437 A CN202110661437 A CN 202110661437A CN 113342374 A CN113342374 A CN 113342374A
Authority
CN
China
Prior art keywords
battery management
management system
upgrade
digital signature
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110661437.XA
Other languages
Chinese (zh)
Other versions
CN113342374B (en
Inventor
费鑫
廖代瑛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongguan Poweramp Technology Ltd
Original Assignee
Dongguan Poweramp Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dongguan Poweramp Technology Ltd filed Critical Dongguan Poweramp Technology Ltd
Priority to CN202110661437.XA priority Critical patent/CN113342374B/en
Publication of CN113342374A publication Critical patent/CN113342374A/en
Application granted granted Critical
Publication of CN113342374B publication Critical patent/CN113342374B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/60Other road transportation technologies with climate change mitigation effect
    • Y02T10/70Energy storage systems for electromobility, e.g. batteries

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Power Sources (AREA)

Abstract

The application provides a battery management system upgrading method and an electronic device. The method comprises the following steps: reading an upgrade file in the mobile storage device; and determining a control unit needing to be upgraded in the battery management system according to the upgrading configuration file in the upgrading file so as to upgrade the control unit needing to be upgraded. According to the method and the device, the upgrading file in the mobile storage device can be read, the software of the battery management system can be automatically upgraded, the software upgrading is controlled according to the configuration file, and the efficiency of upgrading the system software is effectively improved.

Description

Battery management system upgrading method and electronic device
Technical Field
The present disclosure relates to the field of battery technologies, and in particular, to a method for upgrading a battery management system and an electronic device.
Background
The Battery Management System (BMS) is used for performing intelligent Management and maintenance on a Battery, monitoring the state of the Battery in real time, and preventing the Battery from being overcharged and overdischarged, and is widely applied to new energy equipment such as electric automobiles, AI robots, intelligent production lines and the like. The battery management system realizes the battery management function by combining software and hardware, and the software of the battery management system needs to be upgraded in order to guarantee the system stability, expand the system function and eliminate the system fault. When software of the battery management system is upgraded, a special interface, a communication line or a mobile storage device needs to be accessed into the battery management system, and an upgrade file is transmitted to the battery management system to realize software upgrading, the degree of manual participation is high, and the upgrade file is not controlled, so that the upgrade file is easily tampered or illegally used, and the safety of the software of the battery management system cannot be guaranteed.
Disclosure of Invention
In view of the above, it is desirable to provide a method for upgrading a battery management system and an electronic device, which can automatically upgrade software of the battery management system and effectively control software upgrading.
An embodiment of the present application provides a method for upgrading a battery management system, where the method includes: and reading an upgrade file in the mobile storage device, and determining a control unit to be upgraded in the battery management system according to an upgrade configuration file in the upgrade file so as to upgrade the control unit to be upgraded. The method and the device for upgrading the battery management system can automatically upgrade the control unit needing to be upgraded in the battery management system based on the upgrade in the mobile storage device.
According to some embodiments of the present application, upgrading the control unit to be upgraded according to an upgrade configuration file in an upgrade file includes: acquiring a first digital signature and a second digital signature, wherein the first digital signature comprises an upgrade file in the mobile storage device, and the second digital signature comprises a signature according to an upgrade time t2And the serial code in the battery management system determines whether the first digital signature is matched with the second digital signature, and if so, the control unit needing to be upgraded is upgraded. According to some embodiments of the application, the control unit is upgraded when the digital signature in the upgrade file passes verification, so that the upgrade safety is improved.
According to some embodiments of the application, the determining whether the first digital signature and the second digital signature match comprises: if the upgrade time t in the second digital signature2And t in the first digital signature1The difference in time values is less than or equal to a preset time threshold,and the sequence code in the second digital signature is the same as the sequence code in the first digital signature, determining that the first digital signature matches the second digital signature. According to some embodiments of the application, the control unit is upgraded when the digital signature of the upgrade file passes verification, so that the upgrade safety is improved. According to some embodiments of the application, the control unit is upgraded when the upgrade file is in the valid period and the sequence code passes verification, so that the upgrade safety is improved.
According to some embodiments of the present application, before reading the upgrade file in the mobile storage device, the method further comprises: at t1Generating an original matching code at a moment, wherein the original matching code comprises the t1And generating the first digital signature according to the original matching code and the time value and the sequence code in the battery management system, and generating the upgrade file according to the upgrade program of the battery management system and the first digital signature. According to some embodiments of the application, the upgrade file is generated according to the upgrade program and the digital signature, so that the upgrade safety is improved.
According to some embodiments of the present application, before reading the upgrade file in the mobile storage device, the method further comprises: at t1Generating an original matching code at a moment, wherein the original matching code comprises the t1And generating the first digital signature according to the original matching code, generating a verification information code according to verification information and the first digital signature, wherein the verification information is used for identifying at least two battery management systems, and generating the upgrade file according to an upgrade program of the battery management systems and the verification information code. According to some embodiments of the application, the upgrade file is generated according to the upgrade program and the verification information, so that the upgrade safety is improved.
According to some embodiments of the application, the method further comprises: and carrying out time calibration on the battery management system in real time. Some embodiments of the present application eliminate timing errors of the battery management system.
According to some embodiments of the present applicationThe method further comprises the following steps: and when the first digital signature is determined to be matched with the second digital signature, the battery management system generates a feature number based on the second digital signature, determines whether the feature number is larger than the feature number stored after the last upgrade, wherein the feature number is 0 before the first upgrade, and verifies the upgrade file when the feature number is determined to be larger than the feature number stored after the last upgrade. Some embodiments of the present application may prevent human tampering with the current time t of the battery management system2So that the current time t2With time t in the first digital signature1The difference value between the two is less than or equal to the preset time threshold value, and the same upgrading file is used for upgrading again, so that the upgrading safety is guaranteed.
According to some embodiments of the present application, the verifying the upgrade file includes: and determining whether the version of the upgrade file is more recent than the current software version of the battery management system, and if so, determining that the upgrade file passes the verification. Some embodiments of the present application ensure the security of the upgrade by only allowing the battery management system to be upgraded with an updated version of the upgrade file.
According to some embodiments of the application, the method further comprises: and after the upgrade file is confirmed to pass the verification, checking the current working states of the electronic device and the battery management system, and when the electronic device and/or the battery management system are in a standing state, executing upgrade by the battery management system. Some embodiments of the present application are upgraded when the electronic device and/or the battery management system is in a static state, so as to avoid affecting the normal operation of the electronic device and/or the battery management system.
According to some embodiments of the application, the method further comprises: and transmitting the operation data of the battery management system to the mobile storage equipment according to the upgrade configuration file. Some embodiments of the application can enable the battery management system to transmit the operation data to the mobile storage device by setting the upgrade configuration file, so that the battery management system is convenient to manage.
According to some embodiments of the application, the method further comprises: and outputting prompt information to indicate the upgrading progress in the process of upgrading the software of the battery management system. According to some embodiments of the application, when the battery management system performs software upgrading, the upgrading progress is prompted to a user by outputting prompt information, and the user experience is improved.
An embodiment of the present application provides an electronic device, which includes a processor for executing the battery management system upgrade method as described above.
One or more of the above embodiments include the following advantageous effects: the software of the battery management system is automatically upgraded by reading the upgrade file in the mobile storage device, and the software upgrade can be managed and controlled based on the configuration file in the upgrade file, so that the efficiency of the system software upgrade is effectively improved.
Drawings
Fig. 1 is a schematic diagram of an electronic device according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a battery management system according to an embodiment of the present application.
Fig. 3 is a flowchart of generating and importing upgrade software according to an embodiment of the present application.
Fig. 4 is a flowchart of generating and importing upgrade software according to another embodiment of the present application.
Fig. 5 is a schematic diagram illustrating generation of a fool-proof information code according to an embodiment of the present disclosure.
Fig. 6 is a schematic diagram of a fool-proof information code according to an embodiment of the present application.
Fig. 7 is a schematic diagram of a BIN file according to an embodiment of the present application.
Fig. 8 is a flowchart of a method for upgrading a battery management system according to an embodiment of the present application.
Fig. 9 is a flowchart illustrating software upgrading performed by the battery management system according to an embodiment of the present application based on upgrade software.
Fig. 10 is a flowchart illustrating software upgrade based on upgrade software in a battery management system according to another embodiment of the present application.
Description of the main elements
Electronic device 100
Memory 11
Processor 12
Battery management system 13
Main controller 131
Slave controller 132
USB interface circuit 133
Display screen 134
Indicator lamp 135
Mobile storage device 200
The following detailed description will explain the present application in further detail in conjunction with the above-described figures.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application.
Referring to fig. 1, fig. 1 is a schematic view of an electronic device according to an embodiment of the present disclosure. The electronic device 100 includes, but is not limited to, a memory 11, at least one processor 12, and a battery management system 13, and the above elements may be connected via a bus or directly.
It should be noted that fig. 1 is only an example of the electronic device 100. In other embodiments, electronic device 100 may include more or fewer elements, or have a different configuration of elements. The electronic device 100 may be an electric motorcycle, an electric bicycle, an electric automobile, a mobile phone, a tablet computer, a personal digital assistant, a personal computer, or any other suitable rechargeable device.
In one embodiment, the battery management system 13 is used to manage the charging and discharging functions of the battery and monitor the operating status of the battery. The battery management System 13 may be in communication connection with a Power Conversion System (PCS) through CAN or RS 485. It is understood that the electronic device 100 may also include other devices, such as pressure sensors, light sensors, gyroscopes, hygrometers, infrared sensors, etc.
Referring to fig. 2, fig. 2 is a schematic diagram of a battery management system according to an embodiment of the present application. The battery management system 13 includes, but is not limited to, a master controller 131, a slave controller 132, a USB interface circuit 133, a display 134, and an indicator light 135, and these elements may be connected via a bus or directly. The USB interface circuit 133 includes a USB bus interface chip, which is communicatively connected to the master controller 131 and the slave controller 132. The USB interface circuit 133 is communicatively coupled to the mobile storage device 200. The mobile storage device 200 may be a usb disk, a mobile hard disk, or the like. The display screen 134 is an LCD display screen. The indicator light 135 is an LED indicator light.
Referring to fig. 3, fig. 3 is a flowchart of generating and importing upgrade software according to an embodiment of the present application.
Step S30: the battery management system 13 is time calibrated in real time.
In one embodiment, the battery management system 13 includes a Real Time Clock (RTC) for acquiring the current Time. And time calibration is carried out on the battery management system 13 in real time, and the current display time of the battery management system 13 is kept to be the same as the current actual time, so that the time error of the battery management system 13 is eliminated. For example, the current actual time is the current beijing time.
Step S31: at t1And generating an original matching code at any moment, and generating the first digital signature according to the original matching code. Wherein the original matching code comprises the t1Time of day values and serial codes in the battery management system 13. Specifically, the original matching code is generated according to the time t1 and a sequence code preset in the battery management system 13An encryption algorithm is performed on the original match code to generate a first digital signature. The serial code is a unique serial code, the unique serial code is a controller serial number or an electronic box serial number of the battery management system 13, the controller serial number and the electronic box serial number are serial numbers distributed to the battery management system 13 in the production process, and the unique serial number is recorded into the battery management system 13 in the production process of the battery management system 13.
In one embodiment, t1The time is the current time, and the format of the time for generating the first digital signature is time of year, month, day, and hour, for example 202104091550. And generating the first digital signature by the original matching through the encryption algorithm, wherein the original matching code is the unique sequence code at the time t 1. The first digital signature is a hexadecimal number, and the encryption algorithm can be an MD5 algorithm, an SHA1 algorithm, a DES algorithm, an AES algorithm, an RSA algorithm and the like.
Step S32: and generating an upgrade file according to the upgrade program of the battery management system 13 and the first digital signature.
Specifically, a BIN file is generated according to the upgrade program of the battery management system 13 and the first digital signature, the generated BIN file is the upgrade file, and then the BIN file is imported into the mobile storage device 200 in communication connection with the electronic apparatus 100.
Referring to fig. 4, fig. 4 is a flowchart of generating and importing upgrade software according to another embodiment of the present application.
Step S40: and generating a verification information code according to the verification information and the first digital signature. Step S41: and generating the upgrade file according to the upgrade program of the battery management system 13 and the verification information code, and importing the upgrade file into the mobile storage device 200. The verification information is used to identify the at least two battery management systems 13, that is, to record basic information of the at least two battery management systems 13. The verification information includes, but is not limited to, vendor information and operating mode.
Referring to fig. 5, specifically, the verification information code may be generated by inputting information such as a path of the upgrade program, vendor information, a unique serial number, a working mode, a version number, a value of a reserved bit, and the like, on an interface of the BIN file generation program, and the verification information code may be added to the BIN file, so as to generate the upgrade file.
Referring to fig. 6, the check information code is 32-bit data. In the Check information code, B0-B2 bits record manufacturer information, B3-B14 bits record the first digital signature, wherein B13-B14 are reserved bits corresponding to the digital signature, B15 bits record the working mode of the battery management system, B16-B18 bits record the version number, B19-B21 are reserved bits, B22-B25 bits record the file capacity, B26-B29 bits record the file Check code, the file Check code is CRC (Cyclic Redundancy Check) 32 and is used for checking the integrity of the whole BIN file, and B30-B31 bits record Check information code Check codes, wherein the Check information code Check codes comprise CRC16_ Hi and CRC16_ Lo and are used for checking the Check information code. The added check information codes in the BIN file are shown in fig. 7, specifically, the contents of the first and second lines in fig. 7.
In one embodiment, when generating the BIN file, a CRC32 code is generated based on the BIN file and a generator polynomial. When the BIN file is transmitted, that is, stored or read, the storage end or the reading end recalculates the CRC32 code of the obtained BIN file, compares the recalculated CRC32 code with the CRC32 code in the obtained BIN file, and if the two CRC32 codes are the same, it indicates that the check information code is complete. The CRC32 code is a CRC code generated based on a generator polynomial of highest exponent 32.
In one embodiment, each bit of the CRC16 code is preset to 1 when the BIN file is generated, and then the CRC16_ Lo (the lower byte in the CRC16 code) is exclusive-ored with 8-bit data of the check information code, the CRC16 code is shifted from high to low, zero is padded at the position of the highest bit, and if the lowest bit is 1, the CRC16 code is exclusive-ored with a predefined polynomial code, and if the lowest bit is zero, no exclusive-or operation is required. Repeating the shifting from high to low for 8 times, finishing the processing of the first 8-bit data of the check information code, performing XOR between the value of the CRC16 code and the next 8-bit data of the check information code, and shifting for 8 times similar to the previous data, and generating the CRC16 code after all data in the check information code are processed. When the BIN file is transmitted, that is, stored or read, the storage end or the reading end recalculates the CRC16 code of the obtained BIN file based on the above method, compares the recalculated CRC16 code with the CRC16 code in the obtained BIN file, and if the two CRC16 codes are the same, it indicates that the check information code is complete.
Referring to fig. 8, fig. 8 is a flowchart illustrating a method for upgrading a battery management system according to an embodiment of the present disclosure. The battery management system upgrading method is applied to the electronic device 100.
Step S80: and reading the upgrade file in the mobile storage device 200.
In one embodiment, step S80 includes: and connecting the battery management system 13 with an external mobile storage device 200 in a communication manner, and reading the upgrade file in the mobile storage device 200. The mobile storage device 200 includes a USB interface (not shown), and a user can electrically connect the USB interface of the mobile storage device 200 with the USB interface of the battery management system 13 by manual operation, so that the USB interface of the mobile storage device 200 is communicatively connected with the USB interface circuit 133. At this time, the USB interface circuit 133 generates a level interrupt event, and executes an enumeration process on the mobile storage device 200 when the controller of the battery management system 13 recognizes the level interrupt event.
In an embodiment, in the enumeration process, the battery management system 13 establishes an information channel with the mobile storage device 200, acquires a device descriptor of the mobile storage device 200, and configures the mobile storage device 200. After the enumeration is completed, that is, after the battery management system 13 completes the configuration of the mobile storage device 200, the mobile storage device 200 is loaded, and the upgrade file, that is, the BIN file in the mobile storage device 200 is read.
Step S81: and determining a control unit to be upgraded in the battery management system 13 according to the upgrade configuration file in the upgrade file, so as to upgrade the control unit to be upgraded. The control unit includes the master controller 131 and the slave controller 132, and the upgrade operation may include upgrading the master controller 131, upgrading the slave controller 132, or upgrading the master controller 131 and the slave controller 132 simultaneously.
Referring to fig. 9, in one embodiment, the step S81 includes: step S810, acquiring a first digital signature and a second digital signature. Wherein the first digital signature comprises an upgrade file in the mobile storage device 200. The second digital signature comprises an upgrade time t2And a serial code in the battery management system 13.
Specifically, the battery management system 13 obtains the upgrade time t through a real-time clock2As the time when the battery management system 13 performs software upgrade. The upgrade time t is encrypted by an encryption algorithm built in the battery management system 132And encrypting the serial code to generate the second digital signature. In one embodiment, the built-in encryption algorithm may be the same as the encryption algorithm used to encrypt the original match code. The first digital signature is obtained by parsing the BIN file in the mobile storage device 200 or parsing the check information code in the BIN file.
In one embodiment, the step 81 further comprises: step S811 determines whether the first digital signature and the second digital signature match.
Specifically, the battery management system 13 obtains t in the first digital signature1Time of day and sequence code. If the upgrade time t in the second digital signature2And t in the first digital signature1And determining that the first digital signature is matched with the second digital signature when the difference of the time values is smaller than or equal to a preset time threshold and the sequence code in the second digital signature is the same as the sequence code in the first digital signature. Wherein the preset time threshold is an effective period of the upgrade file, such as a week, a day, or an hour. The preset time threshold may be managed by the batteryThe system 13 may be configured to uniformly preset all the upgrade files, or may be configured to be individually preset by the electronic apparatus 100 when the electronic apparatus 100 generates the upgrade files.
In one embodiment, the step 81 further comprises: and step S812, if the first digital signature is matched with the second digital signature, upgrading the control unit needing to be upgraded.
In an embodiment, the upgrade file further includes an upgrade configuration file, where the upgrade configuration file is a CONFIG file and is generated according to an upgrade operation that needs to be executed by the battery management system 13. In one embodiment, the electronic device 100 presets an upgrade operation to be performed by the battery management system 13. The electronic device 100 generates a CONFIG file based on a preset upgrade operation, and imports the CONFIG file into the mobile storage device 200 along with the upgrade file, and the battery management system 13 determines a control unit to be upgraded by reading the upgrade operation preset in the CONFIG file.
Specifically, if the upgrade operation preset in the CONFIG file is to upgrade the main controller 131, the battery management system 13 determines that the control unit to be upgraded is the main controller 131, and then executes the upgrade file to upgrade the main controller 131. If the preset upgrade operation in the CONFIG file is to upgrade the slave controller 132, the battery management system 13 determines that the control unit to be upgraded is the slave controller 132, and then executes the upgrade file to upgrade the slave controller 132. If the upgrade operation preset in the CONFIG file is to upgrade the master controller 131 and the slave controller 132, the battery management system 13 determines that the control unit to be upgraded includes the master controller 131 and the slave controller 132, and then executes the upgrade file to upgrade the master controller 131 and the slave controller 132, respectively.
In other embodiments, the upgrade operation to be performed by the battery management system 13 in the upgrade configuration file further includes transmitting operation data, and optionally, the operation data is historical fault data recorded in the battery management system 13. The upgrade operation preset in the CONFIG file is to transmit the operation data, and the battery management system 13 transmits the operation data to the mobile storage device 200 after reading the CONFIG file.
In one embodiment, in step S813, if the first digital signature does not match the second digital signature, that is, if the upgrade time t in the second digital signature2And t in the first digital signature1And outputting alarm information to prompt a user that illegal upgrading operation possibly exists.
Referring to fig. 10, in other embodiments, upon determining that the first digital signature matches the second digital signature, the method further comprises: in step S90, the battery management system 13 generates a feature number based on the second digital signature. Specifically, the battery management system 13 executes an incremental encryption algorithm to generate a feature number based on the second digital signature. Step S91, determine whether the feature number is greater than the feature number stored in the battery management system 13 after the last upgrade. Step S92, when it is determined that the feature number is less than or equal to the feature number stored in the battery management system 13 after the last upgrade, outputting alarm information to prompt the user that there may be an illegal upgrade operation. Step S93, when it is determined that the feature number is greater than the feature number stored in the battery management system 13 after the last upgrade, the read upgrade file is verified.
In the other embodiments, the incremental encryption algorithm is a time-based accumulation algorithm, and the generated characteristic number may reflect a passage of time. When the software upgrade is not performed, the battery management system 13 generates an initial value of the feature number to be 0, and records a time when the initial value of the feature number is generated.
For example, when it is determined that the second digital signature matches the first digital signature during the first upgrade, it is determined whether the time in the second digital signature is later than the time at which the initial value of the feature number is generated. If the time in the second digital signature is later than the time for generating the initial value of the feature number, the incremental encryption algorithm calculates the feature number as the initial value plus one, and the feature number at this time is larger than the feature number currently stored by the battery management system 13. If the time in the second digital signature is equal to the time for generating the initial value of the feature number, the incremental encryption algorithm calculates that the feature number is equal to the initial value, and the feature number at this time is equal to the feature number currently stored by the battery management system 13. If the time in the second digital signature is earlier than the time for generating the initial value of the feature number, the incremental encryption algorithm calculates that the feature number is the initial value minus one, and the feature number at this time is smaller than the feature number currently stored by the battery management system 13. When the feature number is larger than the feature number stored in the battery management system 13, the feature number is stored in the battery management system 13 in place of the initial value.
For another example, when it is determined that the second digital signature matches the first digital signature during the second upgrade, it is determined whether the time in the second digital signature is later than the time when the incremental encryption algorithm calculates the feature number currently stored by the battery management system 13. If the time in the second digital signature is later than the time for calculating the feature number currently stored by the battery management system 13 through the incremental encryption algorithm, the feature number calculated by the incremental encryption algorithm is the feature number currently stored by the battery management system 13 plus one, and the feature number at this time is greater than the feature number currently stored by the battery management system 13. If the time in the second digital signature is equal to the time for calculating the feature number currently stored by the battery management system 13 through the incremental encryption algorithm, the feature number calculated by the incremental encryption algorithm is equal to the feature number currently stored by the battery management system 13, and the feature number at this time is equal to the feature number currently stored by the battery management system 13. If the time in the second digital signature is earlier than the time for calculating the feature number currently stored by the battery management system 13 through the incremental encryption algorithm, the feature number calculated through the incremental encryption algorithm is the feature number currently stored by the battery management system 13 minus one, and the feature number at this time is smaller than the feature number currently stored by the battery management system 13. And when the feature number is larger than the feature number currently stored in the battery management system 13, storing the feature number in the battery management system 13 to replace the feature number currently stored in the battery management system 13. According to the above example, the subsequent feature number calculation method, comparison method and storage method can be obtained by analogy.
In an embodiment, if it is determined that the feature number currently calculated by the incremental encryption algorithm is smaller than or equal to the feature number currently stored by the battery management system 13 (i.e., the feature number stored after the last upgrade), an alarm message is output to prompt a user that there may be an illegal upgrade operation.
It should be noted that the design of non-repetitive and incremental feature numbers can prevent the time information of the battery management system 13 from being manually modified to match the time of the first digital signature of the upgrade file, i.e. prevent the current time t of the battery management system 13 from being manually tampered with2So that the current time t2With time t in the first digital signature1The difference value between the two is less than or equal to the preset time threshold value, and the same upgrading file is used for upgrading again, so that the safety of software upgrading operation is guaranteed.
In an embodiment, an upgrade limit that only an updated version can be performed may be further added to the upgrade file. When it is determined that the feature number is greater than the feature number stored in the battery management system 13 after the last upgrade, the step of verifying the read upgrade file includes: and determining whether the version of the upgrade file is newer than the current software version of the battery management system 13, and determining that the read upgrade file passes verification when the version of the upgrade file is determined to be newer than the current software version of the battery management system 13.
Specifically, the verification information code of the upgrade file is obtained from the read upgrade file, the version number of the upgrade file is obtained from bits B16-B18 of the verification information code, for example, the version number in fig. 7 is 1.0, and the obtained version number of the upgrade file is compared with the current software version number of the battery management system 13. And when the version number of the obtained upgrade file is determined to be greater than the current software version number of the battery management system 13, determining whether the version of the upgrade file is more recent than the current software version of the battery management system 13. And when the acquired version number of the upgrade file is determined to be less than or equal to the current software version number of the battery management system 13, determining whether the version of the upgrade file is more recent than the current software version of the battery management system 13.
In an embodiment, the method further comprises: step S94, after it is determined that the read upgrade file passes the verification, checking the current working status of the electronic device 100 and the battery management system 13, and step S95, when the electronic device 100 and/or the battery management system 13 is in the static status, the battery management system 13 performs the upgrade.
Specifically, after it is determined that the upgrade file passes the verification, the battery management system 13 checks the current working state, and when it is checked that the battery is not charged or discharged and the high voltage is in the safe state, it is determined that the battery management system 13 is in the static state, and the battery management system 13 transmits an upgrade instruction to the electronic device 100. The upgrading instruction CAN be a CAN signal, an RS485 signal, a wireless communication signal, a PWM signal dry contact point signal, an analog quantity voltage change and the like. When the electronic device 100 receives the upgrade instruction, it checks its working state, and when it is checked that the electronic device 100 has no external load, it determines that the electronic device 100 is in a static state, and the electronic device 100 transmits an upgrade permission instruction to the battery management system 13. The upgrading permission instruction CAN be a CAN signal, an RS485 signal, a wireless communication signal, a PWM signal dry contact point signal, an analog quantity voltage change and the like. And when receiving the upgrade permission instruction, the battery management system 13 executes the upgrade file to perform software upgrade.
In an embodiment, the method further comprises: step S96, in the process of upgrading the software of the battery management system 13, outputting a prompt message to indicate the progress of upgrading.
Specifically, the battery management system 13 may display an upgrade progress percentage on the display screen 134 as the prompt message. In other embodiments, the battery management system 13 controls the blinking frequency of the indicator light 135 as the prompting message. For example, as the percentage of upgrade progress increases, the frequency of flashing the indicator light 135 is controlled to be higher and higher.
In one embodiment, the battery management system 13 may further send an upgrade progress instruction to the electronic device 100, so as to output a prompt of the upgrade progress through the electronic device 100. The upgrading progress instruction CAN be a CAN signal, an RS485 signal, a wireless communication signal, a PWM signal dry contact point signal, an analog quantity voltage change and the like. After the software upgrade is completed, the battery management system 13 automatically resets and enters a normal operating state again.
Referring to fig. 1, in the present embodiment, the memory 11 may be an internal memory of an electronic device, that is, a memory built in the electronic device. In other embodiments, the memory 11 may also be an external memory of the electronic device, i.e. a memory externally connected to the electronic device.
In some embodiments, the memory 11 is used for storing program codes and various data, and realizes high-speed and automatic access to programs or data during the operation of the electronic device.
The memory 11 may include random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
In one embodiment, the Processor 12 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any other conventional processor or the like.
The program code and various data in the memory 11 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the processes in the methods of the embodiments described above, for example, the steps in the method for upgrading the battery management system, may also be implemented by instructing the relevant hardware by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the embodiments of the methods described above may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), or the like.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present application and not for limiting, and although the present application is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application.

Claims (12)

1. A battery management system upgrade method, the method comprising:
reading an upgrade file in the mobile storage device;
and determining a control unit needing to be upgraded in the battery management system according to the upgrading configuration file in the upgrading file so as to upgrade the control unit needing to be upgraded.
2. The method for upgrading a battery management system according to claim 1, wherein the upgrading the control unit to be upgraded according to an upgrade configuration file in an upgrade file comprises:
acquiring a first digital signature and a second digital signature; wherein the first digital signature comprises an upgrade file in the mobile storage device; the second digital signature comprises a signature according to an upgrade time t2And a serial code in the battery management system;
and determining whether the first digital signature is matched with the second digital signature, and if so, upgrading the control unit to be upgraded.
3. The battery management system upgrade method of claim 2, wherein said determining whether the first digital signature and the second digital signature match comprises:
if the upgrade time t in the second digital signature2And t in the first digital signature1And determining that the first digital signature is matched with the second digital signature when the difference of the time values is smaller than or equal to a preset time threshold and the sequence code in the second digital signature is the same as the sequence code in the first digital signature.
4. The battery management system upgrade method of claim 3, wherein prior to reading the upgrade file in the mobile storage device, the method further comprises:
at t1Generating an original matching code at a moment, wherein the original matching code comprises the t1A time value and a sequence code in the battery management system;
generating the first digital signature according to the original matching code;
and generating the upgrade file according to the upgrade program of the battery management system and the first digital signature.
5. The battery management system upgrade method of claim 3, wherein prior to reading the upgrade file in the mobile storage device, the method further comprises:
at t1Generating an original matching code at a moment, wherein the original matching code comprises the t1A time value and a sequence code in the battery management system;
generating the first digital signature according to the original matching code;
generating a verification information code according to verification information and the first digital signature, wherein the verification information is used for identifying at least two battery management systems;
and generating the upgrade file according to the upgrade program of the battery management system and the verification information code.
6. The battery management system upgrade method according to claim 4 or 5, wherein the method further comprises:
and carrying out time calibration on the battery management system in real time.
7. The battery management system upgrade method of claim 2, wherein the method further comprises:
upon determining that the first digital signature matches the second digital signature, the battery management system generates a characteristic number based on the second digital signature;
determining whether the characteristic number is larger than the characteristic number stored after the last upgrade, wherein the characteristic number is 0 before the first upgrade;
and when the characteristic number is determined to be larger than the characteristic number stored after the last upgrade, verifying the upgrade file.
8. The battery management system upgrade method according to claim 7, wherein the verifying the upgrade file comprises:
and determining whether the version of the upgrade file is more recent than the current software version of the battery management system, and if so, determining that the upgrade file passes the verification.
9. The battery management system upgrade method of claim 8, wherein the method further comprises:
checking the current working states of the electronic device and the battery management system after the upgrade file is confirmed to pass the verification;
when the electronic device and/or the battery management system are in a static state, the battery management system performs upgrading.
10. The battery management system upgrade method of claim 1, wherein the method further comprises:
and transmitting the operation data of the battery management system to the mobile storage equipment according to the upgrade configuration file.
11. The battery management system upgrade method of claim 1, wherein the method further comprises:
and outputting prompt information to indicate the upgrading progress in the process of upgrading the software of the battery management system.
12. An electronic device, comprising:
a processor for performing the battery management system upgrade method of any one of claims 1 to 11.
CN202110661437.XA 2021-06-15 2021-06-15 Battery management system upgrading method and electronic device Active CN113342374B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110661437.XA CN113342374B (en) 2021-06-15 2021-06-15 Battery management system upgrading method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110661437.XA CN113342374B (en) 2021-06-15 2021-06-15 Battery management system upgrading method and electronic device

Publications (2)

Publication Number Publication Date
CN113342374A true CN113342374A (en) 2021-09-03
CN113342374B CN113342374B (en) 2022-12-13

Family

ID=77477125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110661437.XA Active CN113342374B (en) 2021-06-15 2021-06-15 Battery management system upgrading method and electronic device

Country Status (1)

Country Link
CN (1) CN113342374B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024049138A1 (en) * 2022-08-29 2024-03-07 주식회사 엘지에너지솔루션 Battery pack and method for updating firmware thereof

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003067229A (en) * 2001-08-24 2003-03-07 Sharp Corp Electronic data content certifying method and information processor
JP2016178458A (en) * 2015-03-19 2016-10-06 株式会社リコー Electronic apparatus and automatic update method of electronic certificate
CN106648784A (en) * 2016-12-27 2017-05-10 Tcl集团股份有限公司 OTA upgrading method and system based on android system and android terminal
CN109582325A (en) * 2017-09-28 2019-04-05 深圳市优必选科技有限公司 Robot software upgrading method, robot and computer readable storage medium
CN109753044A (en) * 2017-11-07 2019-05-14 北京长城华冠汽车科技股份有限公司 Controller of battery management system upgrade method and device
CN110830256A (en) * 2018-08-14 2020-02-21 珠海金山办公软件有限公司 File signature method and device, electronic equipment and readable storage medium
CN110830257A (en) * 2018-08-14 2020-02-21 珠海金山办公软件有限公司 File signature method and device, electronic equipment and readable storage medium
CN111694579A (en) * 2019-03-11 2020-09-22 宁德时代新能源科技股份有限公司 Remote upgrading method of energy storage system, energy management system and battery management system
CN112540781A (en) * 2020-12-15 2021-03-23 东莞新能安科技有限公司 Software upgrading method of battery management system, electric equipment and storage medium
CN112579130A (en) * 2020-12-28 2021-03-30 河南城拜检测技术有限公司 Interactive IAP (Internet access protocol) upgrading method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003067229A (en) * 2001-08-24 2003-03-07 Sharp Corp Electronic data content certifying method and information processor
JP2016178458A (en) * 2015-03-19 2016-10-06 株式会社リコー Electronic apparatus and automatic update method of electronic certificate
CN106648784A (en) * 2016-12-27 2017-05-10 Tcl集团股份有限公司 OTA upgrading method and system based on android system and android terminal
CN109582325A (en) * 2017-09-28 2019-04-05 深圳市优必选科技有限公司 Robot software upgrading method, robot and computer readable storage medium
CN109753044A (en) * 2017-11-07 2019-05-14 北京长城华冠汽车科技股份有限公司 Controller of battery management system upgrade method and device
CN110830256A (en) * 2018-08-14 2020-02-21 珠海金山办公软件有限公司 File signature method and device, electronic equipment and readable storage medium
CN110830257A (en) * 2018-08-14 2020-02-21 珠海金山办公软件有限公司 File signature method and device, electronic equipment and readable storage medium
CN111694579A (en) * 2019-03-11 2020-09-22 宁德时代新能源科技股份有限公司 Remote upgrading method of energy storage system, energy management system and battery management system
CN112540781A (en) * 2020-12-15 2021-03-23 东莞新能安科技有限公司 Software upgrading method of battery management system, electric equipment and storage medium
CN112579130A (en) * 2020-12-28 2021-03-30 河南城拜检测技术有限公司 Interactive IAP (Internet access protocol) upgrading method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024049138A1 (en) * 2022-08-29 2024-03-07 주식회사 엘지에너지솔루션 Battery pack and method for updating firmware thereof

Also Published As

Publication number Publication date
CN113342374B (en) 2022-12-13

Similar Documents

Publication Publication Date Title
CN107924443B (en) Firmware upgrading method and system for process control device
US6972542B2 (en) System and method for battery verification
EP2876553A1 (en) Information processing program, information processing method, and information processing apparatus
CN102819706B (en) Device and method for implementing credible embedded system on existing embedded equipment
CN106682518A (en) Method for guaranteeing firmware security of management controller and computer apparatus
US7613931B2 (en) Copy protection method and system for programmable gate array
US8433956B2 (en) Instruction sequence verification to protect secured data
US20040073846A1 (en) Memory device, terminal apparatus, and data repair system
CN103186434A (en) Method and system for recovering basic input/output system
EP2958017A1 (en) Computerized systems and methods for installing upgraded software on electronic devices
CN115033294A (en) System, method, and apparatus for secure non-volatile memory
CN113342374B (en) Battery management system upgrading method and electronic device
TW200307207A (en) Management system, method and apparatus for licensed delivery and accounting of electronic circuits
EP2568655A2 (en) Method for authenticating a storage device, machine-readable storage medium, and host device
CN103425932B (en) Signature calibration method and terminal device
CN116842517A (en) Trusted verification method and device
US20220350891A1 (en) Fast secure booting method and system
CN111046389A (en) Method for securely updating firmware components and portable computer station for implementation
JP2020027341A (en) Storage device and data tampering verification method
CN115220755A (en) Router online upgrading system based on credibility measurement
CN112394967B (en) Electronic device, method and computer readable medium for mass production of software tools
CN107292172B (en) Method for automatically verifying a target computer file with respect to a reference computer file
CN117172924B (en) Gas transaction method, device, computer equipment, chip and storage medium
JP2011145768A (en) Authentication system, method, and program
CN117708896A (en) Method for protecting firmware data of embedded device and embedded device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant