Safety communication method of battery management system
By establishing an encrypted communication channel between the battery management system and the mobile terminal APP, and using key negotiation and encryption technology, the secure communication problem of the battery management system is solved and high security of battery data transmission is achieved.
Patent Information
- Application Number
- CN202411421166.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-01-24
AI Technical Summary
The prior art has failed to effectively solve the problem of safe communication in the battery management system, resulting in insufficient security in viewing of battery data status.
By establishing an encrypted communication channel between the battery management system and the app in the mobile terminal, the key negotiation and Sha256, AES-128 encryption technology are used to ensure the security of communication.
It realizes secure communication between the battery management system and the mobile terminal APP, and improves the anti-attack and anti-tampering effect of battery data transmission.
Smart Images

Figure CN119363327A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to the field of secure communications of a battery management system. Background Art
[0002] With the rapid development of the new energy industry, energy storage batteries are being used more and more widely, and the requirements for viewing various data status of batteries are becoming higher and higher. Safety is one of the key points. However, there are no reports on related safety communications.
[0003] In view of this, this application is proposed. Summary of the invention
[0004] The present application provides a secure communication method for a battery management system to fill the gap in the prior art.
[0005] The present application provides a secure communication method for a battery management system, comprising the following steps:
[0006] Step 1: The battery management system establishes a communication channel with the APP in the mobile terminal;
[0007] Step 2: The battery management system communicates with the APP via the communication channel in encrypted form.
[0008] Optionally, in step 1, a communication channel is established between the battery management system and the APP by means of key negotiation.
[0009] Optionally, in step 1, the battery management system establishes a communication channel with the APP via Bluetooth.
[0010] Optionally, in step 1, the battery management system establishing a communication channel with an APP in the mobile terminal includes:
[0011] Step 1.1, the battery management system starts Bluetooth broadcasting;
[0012] Step 1.2, the mobile terminal uses the APP to perform a Bluetooth search, and when the broadcast is found, connect and jump to step 1.3; otherwise, repeat step 1.2;
[0013] Step 1.3, the APP parses the broadcast data to obtain the device SN code of the battery management system; at the same time, the APP generates a hexadecimal random number string with a length of 16 digits, which is recorded as the first random string;
[0014] Step 1.4, the APP generates a string using the first random string and the device SN code, recorded as the first string, and encrypts the first string with SHA256 to generate a first key;
[0015] Step 1.5, the APP repeatedly sends the first random string to the battery management system until the battery management system returns a message indicating that the first random string has been received;
[0016] Step 1.6, the battery management system generates a second character string using the first random character string and the device SN code, encrypts the second character string using SHA256, and generates a second key;
[0017] Step 1.7, verify whether the keys of the APP and the battery management system are consistent: the battery management system uses the second key to perform AES-128 encryption on the first random string to generate a first ciphertext, and sends it to the APP; the APP uses the first key to decrypt the received first ciphertext to obtain a second random string. If the second random string is consistent with the original first random string of the APP, it means that the signature verification of both parties is successful, the communication channel is established, and jump to step 1.8; if they are inconsistent, it means that the signature verification of both parties fails, and repeat steps 1.3-1.7;
[0018] Step 1.8: After the signature verification, whether successful or failed, the APP packages the signature verification result data and sends it to the battery management system.
[0019] Optionally, the encrypted communication between the battery management system and the APP through the communication channel in step 2 includes:
[0020] Step 2.1, communication preparation;
[0021] Step 2.2, send and receive data.
[0022] Optionally, the communication preparation in step 2.1 includes:
[0023] Step 2.1.1: The APP or the battery management system adjusts the source data to be sent according to the Modbus protocol to obtain the first source data.
[0024] Optionally, the step 2.1 further includes:
[0025] Step 2.1.2, add a CRC check bit to the end of the first source data that conforms to the Modbus protocol format to obtain the second source data.
[0026] Optionally, the sending and receiving data in step 2.2 includes:
[0027] Step 2.2.1: The APP or the battery management system uses AES-128 with the first key or the second key to symmetrically encrypt the second source data to generate a second ciphertext.
[0028] Optionally, in step 2.2.2, the APP or the battery management system sends the second ciphertext to the other party through the communication channel.
[0029] Step 2.2.3: After receiving the second ciphertext, the APP or the battery management system uses the first key or the second key to decrypt the second ciphertext to obtain the second source data.
[0030] Step 2.2.4, perform CRC check on the second source data.
[0031] Step 2.2.5: If the verification passes, the second source data is received; if the verification fails, the second source data is discarded.
[0032] Optionally, the method further includes step 3, performing logical processing on the first source data that has passed verification.
[0033] Optionally, the size of the CRC check bit in step 2.1.2 is two bytes.
[0034] Compared with the prior art, the present invention has the following advantages:
[0035] The character string generated each time the present invention is connected is random, and the keys generated based on the character string are different, thereby having excellent anti-attack and anti-tampering effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 Schematic diagram of the overall process of the method of this embodiment;
[0038] Figure 2 This is a schematic diagram of the workflow of step 1 of this embodiment;
[0039] Figure 3 This is a schematic diagram of the overall process of step 2 of this embodiment;
[0040] Figure 4 Schematic diagram of the workflow of step 2.1 and step 2.2 of this embodiment. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] Figure 1 The overall process diagram of this embodiment is shown in FIG. Figure 1 As shown, the secure communication method of the battery management system (BMS) provided in this implementation includes:
[0043] Step 1: The battery management system establishes a communication channel with the APP in the mobile terminal.
[0044] Step 2: The battery management system and the APP communicate encrypted through the communication channel.
[0045] Optionally, the BMS and the APP may be connected wirelessly, such as Bluetooth or a local area network, or may be connected by a wire, such as through a USB or Type-C interface.
[0046] Optionally, the BMS and the APP are connected through key negotiation.
[0047] Figure 2 The figure shows the process flow of establishing a communication channel between BMS and APP through Bluetooth in a key negotiation manner. Figure 2 As shown, in step 1, the battery management system establishes a communication channel with the APP in the mobile terminal, including:
[0048] Step 1.1, the battery management system turns on Bluetooth broadcasting;
[0049] Step 1.2: The user searches for Bluetooth through the APP in the mobile terminal. When the broadcast is found, the user connects and jumps to step 1.3. Otherwise, the user repeats step 1.2.
[0050] Step 1.3, the APP parses the broadcast data and obtains the device SN code of the battery management system; at the same time, the APP generates a hexadecimal random number string with a length of 16 digits, which is recorded as the first random string;
[0051] Step 1.4, the APP generates a string using the first random string and the device SN code, recorded as the first string, and encrypts the first string with SHA256 to generate a first key;
[0052] Step 1.5, the APP repeatedly sends the first random string to the battery management system until the battery management system returns that it has received the first random string;
[0053] Step 1.6, the battery management system generates a second string using the first random string and the device SN code, encrypts the second string using SHA256, and generates a second key;
[0054] Step 1.7, verify whether the keys of the APP and the battery management system are consistent: the battery management system uses the second key to perform AES-128 encryption on the first random string, generates the first ciphertext, and sends it to the APP; the APP uses the first key to decrypt the received first ciphertext to obtain the second random string. If the second random string is consistent with the original first random string of the APP, it means that the signature verification of both parties is successful, the communication channel is established, and jump to step 1.8; if they are inconsistent, it means that the signature verification of both parties fails, and repeat steps 1.3-1.7;
[0055] Step 1.8: After the signature verification, whether successful or failed, the APP sends the signature verification result data packet to the battery management system.
[0056] Figure 3 The overall flow chart of the communication between BMS and APP is shown. Figure 3 As shown, in step 2, the encrypted communication between the battery management system and the APP through the communication channel includes:
[0057] Step 2.1, communication preparation;
[0058] Step 2.2, send and receive data.
[0059] Figure 4 The flowchart of step 2.1, communication preparation is shown. Figure 4 As shown, the communication preparation in step 2.1 includes:
[0060] Step 2.1.1, the APP or the battery management system adjusts the source data to be sent according to the Modbus protocol to obtain the first source data.
[0061] Step 2.1.2, add a CRC check bit to the end of the first source data that conforms to the Modbus protocol format to obtain the second source data.
[0062] Step 2.2.1, the APP or the battery management system uses AES-128 with the first key or the second key to symmetrically encrypt the second source data to generate a second ciphertext.
[0063] Step 2.2.2, the APP or the battery management system sends the second ciphertext to the other party through the communication channel.
[0064] Step 2.2.3: After receiving the second ciphertext, the APP or the battery management system uses the first key or the second key to decrypt the second ciphertext to obtain the second source data.
[0065] Step 2.2.4, perform CRC check on the second source data.
[0066] Step 2.2.5: If the verification passes, the second source data is received; if the verification fails, the second source data is discarded.
[0067] Optionally, the method further includes step 3, performing logical processing on the verified second source data, such as extracting the first source data, or performing comparison operations with a preset threshold value, etc.
[0068] Optionally, the size of the CRC check bit in step 2.1.2 is two bytes.
[0069] It should be noted that this embodiment adopts the CRC verification method, but is not limited to this, and other verification methods may also be used.
[0070] The "equal" or "same" or "equal" disclosed in the present invention must take into account the distribution of engineering parameters, and the error distribution is within ±30%; the definition of "parallel" of two line segments or two straight lines is that the angle between the two line segments or two straight lines is less than or equal to 45 degrees; the definition of "perpendicular" of two line segments or two straight lines is that the angle between the two line segments or two straight lines is within the range of [60, 120] degrees; the definition of "phase mismatch" also needs to take into account the distribution of engineering parameters, and the error distribution of the degree of mismatch is within ±30%. In addition, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. Without more constraints, an element defined by the phrase "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.
[0071] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0072] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A secure communication method for a battery management system, applied to energy storage batteries, characterized in that: The following steps are involved: Step 1: The battery management system establishes a communication channel with the APP in the mobile terminal; Step 2: The battery management system communicates with the APP via the communication channel in encrypted form.
2. The secure communication method according to claim 1, wherein: In step 1, a communication channel is established between the battery management system and the APP by means of key negotiation.
3. The secure communication method according to claim 2, characterized in that: In step 1, the battery management system and the APP establish a communication channel via Bluetooth.
4. The secure communication method according to claim 3, characterized in that: The battery management system in step 1 establishes a communication channel with the APP in the mobile terminal, including: Step 1.1, the battery management system starts Bluetooth broadcasting; Step 1.2, the mobile terminal uses the APP to perform a Bluetooth search, and when the broadcast is found, it connects and jumps to step 1.3; otherwise, repeat step 1.2; Step 1.3, the APP parses the broadcast data to obtain the device SN code of the battery management system; at the same time, the APP generates a hexadecimal random number string with a length of 16 digits, which is recorded as the first random string; Step 1.4, the APP generates a string using the first random string and the device SN code, recorded as the first string, and encrypts the first string with SHA256 to generate a first key; Step 1.5, the APP repeatedly sends the first random string to the battery management system until the battery management system returns a message indicating that the first random string has been received; Step 1.6, the battery management system generates a second character string using the first random character string and the device SN code, encrypts the second character string using SHA256, and generates a second key; Step 1.7, verify whether the keys of the APP and the battery management system are consistent: the battery management system uses the second key to perform AES-128 encryption on the first random string to generate a first ciphertext, and sends it to the APP; the APP uses the first key to decrypt the received first ciphertext to obtain a second random string. If the second random string is consistent with the original first random string of the APP, it means that the signature verification of both parties is successful, the communication channel is established, and jump to step 1.8; if they are inconsistent, it means that the signature verification of both parties fails, and repeat steps 1.3-1.7; Step 1.8: After the signature verification, whether successful or failed, the APP packages the signature verification result data and sends it to the battery management system.
5. The secure communication method according to claim 4, characterized in that: The encrypted communication between the battery management system and the APP through the communication channel in step 2 includes: Step 2.1, communication preparation; Step 2.2, send and receive data.
6. The secure communication method according to claim 5, characterized in that: The communication preparation in step 2.1 includes: Step 2.1.1, the APP or the battery management system adjusts the source data to be sent according to the Modbus protocol to obtain the first source data; Step 2.1.2, add a CRC check bit to the end of the first source data that conforms to the Modbus protocol format to obtain the second source data.
7. The secure communication method according to claim 5, characterized in that: The sending and receiving data in step 2.2 includes: Step 2.2.1, the APP or the battery management system uses AES-128 to symmetrically encrypt the second source data using the first key or the second key to generate a second ciphertext; Step 2.2.2, the APP or the battery management system sends the second ciphertext to the other party through the communication channel; Step 2.2.3: After receiving the second ciphertext, the APP or the battery management system uses the first key or the second key to decrypt the second ciphertext to obtain the second source data; Step 2.2.4, performing CRC check on the second source data; Step 2.2.5: If the verification passes, the second source data is received; if the verification fails, the second source data is discarded.
8. The secure communication method according to claim 1, wherein: Also includes: Step 3: Perform logical processing on the first source data that has passed verification.
9. The secure communication method according to claim 6, wherein: In the step 2.1.2, the size of the CRC check bit is two bytes.