A safety verification method suitable for power product communication

By using RTC and Timer modules to generate high-entropy random numbers in power product communication, and combining TEA encryption and two-way verification mechanisms, the problem of easy cracking of fixed keys and easy reverse protocols is solved, and a high-security and low-cost communication verification method is achieved.

CN119766450APending Publication Date: 2025-04-04HUANGSHAN DOART-ENERGY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411992387.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the communication of existing power supply products, fixed keys are easily cracked, protocol verification is easily reversely analyzed, lacking dynamic and high-precision random number support, resulting in insufficient communication security.

Method used

The RTC module and Timer module inside the MCU are used to generate a 64-bit random number with high entropy value as the root key, and the encryption is performed through the TEA lightweight encryption algorithm. A two-way identity verification mechanism is adopted, and random numbers are dynamically generated and instantly used during each communication to avoid retention in the storage medium.

Benefits of technology

It significantly improves the unpredictability and uniqueness of the root key, enhances the security of communication, avoids man-in-the-middle attacks, playback attacks and brute-force cracking, and meets the needs of embedded scenarios for low power consumption and high real-time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766450A_ABST
    Figure CN119766450A_ABST
Patent Text Reader

Abstract

The present invention discloses a security verification method suitable for power product communication. Through the multi-source data fusion of the RTC module and the Timer module, a 64-bit random number with high entropy value is dynamically generated as a root key. The uniqueness and unpredictability of the random number are further enhanced in combination with the device unique identifier. The root key is discarded immediately after use and is not stored in any medium, which fundamentally eliminates the risk of leakage. Through a two-way identity verification mechanism combined with dynamic key updates, the identities of both communicating parties are ensured to be credible and encryption keys are updated regularly, significantly improving the communication's anti-attack capability. In addition, the multidimensional data fusion algorithm in random number generation enhances the complexity of random numbers through displacement, weighting, masking and XOR processing. At the same time, a dynamic adjustment mechanism of the protocol frame format is introduced on the basis of dynamic key updates to flexibly optimize encryption parameters. The overall solution has significant security, reliability and adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power product communication, and in particular to a safety verification method suitable for power product communication. Background Art

[0002] With the rapid development of the new energy industry, the intelligentization of power products has become an irreversible trend, and the security demand for power communication has become increasingly urgent. In traditional power product communications, in order to ensure the identity trustworthiness and data security of both communicating parties, communication verification is usually achieved through fixed secret keys or protocol interactions. Its working principle is that the sub-device extracts the device ID information from the processor, encrypts it and sends it to the main device. After receiving it, the main device decrypts and verifies the identity. If it matches, a communication connection is established. This method is widely used in embedded scenarios and resource-constrained power device communications due to its low computing and resource consumption.

[0003] However, the following problems generally exist in the prior art:

[0004] 1. Fixed keys have high security risks: Although the solution of using device ID as the root key is simple and easy to use, the device ID is usually inherent in the processor and can be read. It can be easily obtained through reverse engineering or consulting the official manual, making the root key of communication extremely easy to crack.

[0005] 2. Protocol verification is easily captured and reversed by logic analyzers: Communication protocol data is packaged and sent in a certain format, and the receiving end decodes and verifies it. However, the protocol content is easily captured by tools such as logic analyzers. Attackers can grasp the communication protocol through packet capture and analysis, and then perform camouflage or man-in-the-middle attacks.

[0006] 3. Lack of dynamic and high-precision random number support: The root keys in existing technologies are mostly statically generated or stored in the device and cannot change dynamically with the communication. At the same time, the accuracy of random number generation is usually low, only supporting the second level, which makes the key highly predictable, further reducing the security of communication.

[0007] In order to solve the above problems, some improvement methods have been proposed in the industry. For example, some technologies try to replace the device ID with a software pseudo-random number generator to improve the randomness of the root key. However, the generation of pseudo-random numbers depends on the algorithm, and attackers can crack the entire system by obtaining the pseudo-random number seed or reversing the generation rules. In addition, some technologies improve data security by complicating protocol design, but complex protocols often bring higher computing overhead and transmission delay, which makes it difficult to meet the requirements of embedded systems for low power consumption and high real-time performance.

[0008] Therefore, how to design a communication verification method that can dynamically generate a high-security root key in a resource-constrained embedded scenario and simultaneously achieve a balance between high efficiency and low cost has become a technical problem to be solved by the present invention. Summary of the invention

[0009] The technical problem solved by the present invention is to provide a security verification method suitable for power product communication in response to the defects existing in the above-mentioned prior art, so as to solve the problems of easy leakage of secret keys, easy cracking of verification and insufficient dynamics in power communication proposed in the above-mentioned background technology.

[0010] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:

[0011] A safety verification method applicable to power supply product communication includes the following steps:

[0012] Step 1: Use the RTC module and Timer module inside the MCU to generate a random number as the root key:

[0013] The RTC module provides time information, including year, month, day, hour, minute, and second. The Timer module improves the time accuracy to microsecond level through frequency division operation.

[0014] Through the preset fusion algorithm, the time data of the RTC module is combined with the high-precision timing data of the Timer module to generate a 64-bit random number with high entropy value, which is used as the root key;

[0015] Step 2: Encrypt the generated root key in real time:

[0016] Use the TEA lightweight encryption algorithm to encrypt the root key and generate encrypted key data;

[0017] Splitting the encrypted key data into multiple data packets according to a predetermined protocol and sending the data packets to the sub-device one by one;

[0018] Step 3: Implement two-way identity verification during communication:

[0019] The slave device initiates a communication authentication request to the master device using the encrypted root key. The master device decrypts and verifies the validity of the root key after receiving it.

[0020] After verification, the master device sends the encrypted root key and authentication information to the slave device to initiate a reverse verification request. The slave device decrypts and verifies the identity of the master device.

[0021] After the two-way verification is completed, the master device and the slave device establish a communication connection, and both parties use dynamically updated encryption keys in subsequent communication processes;

[0022] Step 4: Real-time generation and immediate use of dynamic root keys:

[0023] A random number is regenerated as the root key for each communication, and the root key is discarded immediately after use;

[0024] The root key is not stored in any medium, ensuring its unpredictability and resistance to cracking.

[0025] As a further solution of the present invention, the time information of the RTC module comes from the stable clock signal of the low-frequency crystal oscillator, which is used to provide a time base including year, month, day, hour, minute and second; the timing data of the Timer module is used to increase the resolution of the time base to microsecond level to achieve high-precision generation of random numbers.

[0026] As a further solution of the present invention, the preset fusion algorithm generates a high entropy random number by bit-level operation and data fusion processing of the time data of the RTC module and the timing data of the Timer module, and the data fusion processing includes the following steps:

[0027] S1, bit-level grouping and masking of the time data of the RTC module to increase randomness;

[0028] S2, performs displacement operation and weight superposition on the timing data of the Timer module to improve the accuracy;

[0029] S3, performing an XOR operation on the processed time data and the timing data to generate a final random number.

[0030] As a further solution of the present invention, the encryption process of the TEA lightweight encryption algorithm includes: using a 64-bit random number as a key to perform a cyclic encryption operation on the data; splitting the encrypted data into multiple sub-data packets according to a predetermined protocol, each data packet has a fixed size, and sending them to the sub-device one by one.

[0031] As a further solution of the present invention, the process of two-way identity verification includes: the sub-device sends the root key and communication request encrypted by TEA to the main device; the main device decrypts and verifies the validity of the root key after receiving it, and returns the verification result to the sub-device; the main device generates a new random number as the return key, sends it to the sub-device after encryption, and the sub-device completes the verification of the identity of the main device after decryption.

[0032] As a further solution of the present invention, the conditions for dynamically updating the encryption key during the subsequent communication process include: triggering the key update mechanism every preset time interval during the communication process; or when a preset number of communications is reached, generating a new root key and replacing the old key after performing a two-way identity verification.

[0033] As a further solution of the present invention, the instant generation and use process of the random number includes: generating a new random number as a root key in real time at the beginning of each communication; the root key is discarded immediately after being used for encryption operations and is not stored in any medium.

[0034] As a further solution of the present invention, the format of the predetermined protocol includes a frame block sequence field, a check value field, a command word field, a sender ID field and a receiver ID field, and the receiving end completes the verification of data integrity by parsing and checking the protocol format.

[0035] As a further solution of the present invention, in the root key generation process, the data fusion of the RTC module and the Timer module is further combined with the unique identifier of the device to enhance the uniqueness and anti-prediction of the random number, and the combination process includes the following steps:

[0036] Extract the time data of the RTC module, including year, month, day, hour, minute, second, and the high-precision timing data of the Timer module;

[0037] Obtain a unique identifier for the device, which is a hardware characteristic parameter of the device or an initial value randomly generated during system initialization;

[0038] The extracted time data, timing data, and unique identifier are weighted together, where:

[0039] Perform shift processing on the time data of the RTC module;

[0040] Perform weighted calculation on the timing data of the Timer module;

[0041] Extract specific bits from the device unique identifier by masking;

[0042] The weighted time data, timing data and identifier data are XORed to generate a high-entropy 64-bit random number, which is used as the root key.

[0043] As a further solution of the present invention, in the process of dynamically updating the encryption key, after the main device and the sub-device confirm the new encryption key through a two-way handshake, the frame format parameters of the protocol are dynamically adjusted. The frame format parameters include: the length of the frame block sequence field of the data packet; the rounds of the encryption algorithm and the ciphertext packet size; and the verification rules of the check value field. The dynamic adjustment is used to enhance the security and flexibility of encryption and parsing during the communication process.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] 1. Through the fusion of multi-source data from the RTC module and the Timer module, a 64-bit random number with high entropy value is dynamically generated as the root key. Combined with the unique identifier of the device, the unpredictability and uniqueness of the random number are further enhanced. The generated root key is immediately discarded after being used for encryption operations and is not retained in any storage medium, eliminating the key leakage problem caused by the reverse cracking of the storage medium from the source. At the same time, the random number generation process is completed using the existing hardware modules of the embedded device, achieving a low-cost use effect.

[0046] 2. Based on the traditional one-way verification, a two-way identity verification mechanism is proposed to ensure mutual trust between the main device and the sub-device. The two-way verification confirms the identities of both parties through two encryption and decryption handshakes, and combines the dynamic root key update mechanism to ensure that the communication key is regularly updated over time or with the accumulation of communication times, thereby effectively resisting man-in-the-middle attacks, replay attacks and brute force cracking.

[0047] 3. In the process of random number generation, the present invention constructs a multi-dimensional fusion algorithm through the displacement, weighting, masking and XOR processing of multi-source data, which not only greatly improves the entropy value and complexity of random numbers, but also increases the difficulty for attackers to reversely infer the source of data. In addition, on the basis of dynamically updating the encryption key, the present invention further introduces a dynamic adjustment mechanism of the protocol frame format, which can flexibly set parameters such as frame block sequence, encryption rounds and packet size according to different communication requirements, thereby enhancing the security of the communication process.

[0048] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] 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 labor.

[0050] Figure 1 : Schematic diagram of the existing read ID as the root key.

[0051] Figure 2 : Protocol format block diagram of existing protocol verification.

[0052] Figure 3 : Block diagram of the present invention.

[0053] Figure 4 : Schematic diagram of the communication verification process of the present invention.

[0054] Figure 5 : Block diagram of the hardware random number generator of the present invention.

[0055] Figure 6 : The root key encryption control process of the present invention.

[0056] Figure 7 : Schematic diagram of the two-way authentication of the present invention. DETAILED DESCRIPTION

[0057] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. 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.

[0058] See also Figure 1 — Figure 7 In an embodiment of the present invention, a security verification method applicable to power supply product communication includes the following steps:

[0059] Step 1: Use the RTC module and Timer module inside the MCU to generate a random number as the root key:

[0060] The RTC module provides time information, including year, month, day, hour, minute, and second. The Timer module improves the time accuracy to microsecond level through frequency division operation.

[0061] Through the preset fusion algorithm, the time data of the RTC module is combined with the high-precision timing data of the Timer module to generate a 64-bit random number with high entropy value, which is used as the root key;

[0062] Step 2: Encrypt the generated root key in real time:

[0063] Use the TEA lightweight encryption algorithm to encrypt the root key and generate encrypted key data;

[0064] Splitting the encrypted key data into multiple data packets according to a predetermined protocol and sending the data packets to the sub-device one by one;

[0065] Step 3: Implement two-way identity verification during communication:

[0066] The slave device initiates a communication authentication request to the master device using the encrypted root key. The master device decrypts and verifies the validity of the root key after receiving it.

[0067] After verification, the master device sends the encrypted root key and authentication information to the slave device to initiate a reverse verification request. The slave device decrypts and verifies the identity of the master device.

[0068] After the two-way verification is completed, the master device and the slave device establish a communication connection, and both parties use dynamically updated encryption keys in subsequent communication processes;

[0069] Step 4: Real-time generation and immediate use of dynamic root keys:

[0070] A random number is regenerated as the root key for each communication, and the root key is discarded immediately after use;

[0071] The root key is not stored in any medium, ensuring its unpredictability and resistance to cracking.

[0072] As a further solution of the present invention, the time information of the RTC module comes from the stable clock signal of the low-frequency crystal oscillator, which is used to provide a time base including year, month, day, hour, minute and second; the timing data of the Timer module is used to increase the resolution of the time base to microsecond level to achieve high-precision generation of random numbers.

[0073] As a further solution of the present invention, the preset fusion algorithm generates a high entropy random number by bit-level operation and data fusion processing of the time data of the RTC module and the timing data of the Timer module, and the data fusion processing includes the following steps:

[0074] S1, bit-level grouping and masking of the time data of the RTC module to increase randomness;

[0075] S2, performs displacement operation and weight superposition on the timing data of the Timer module to improve the accuracy;

[0076] S3, performing an XOR operation on the processed time data and the timing data to generate a final random number.

[0077] As a further solution of the present invention, the encryption process of the TEA lightweight encryption algorithm includes: using a 64-bit random number as a key to perform a cyclic encryption operation on the data; splitting the encrypted data into multiple sub-data packets according to a predetermined protocol, each data packet has a fixed size, and sending them to the sub-device one by one.

[0078] As a further solution of the present invention, the process of two-way identity verification includes: the sub-device sends the root key and communication request encrypted by TEA to the main device; the main device decrypts and verifies the validity of the root key after receiving it, and returns the verification result to the sub-device; the main device generates a new random number as the return key, sends it to the sub-device after encryption, and the sub-device completes the verification of the identity of the main device after decryption.

[0079] As a further solution of the present invention, the conditions for dynamically updating the encryption key during the subsequent communication process include: triggering the key update mechanism every preset time interval during the communication process; or when a preset number of communications is reached, generating a new root key and replacing the old key after performing a two-way identity verification.

[0080] As a further solution of the present invention, the instant generation and use process of the random number includes: generating a new random number as a root key in real time at the beginning of each communication; the root key is discarded immediately after being used for encryption operations and is not stored in any medium.

[0081] As a further solution of the present invention, the format of the predetermined protocol includes a frame block sequence field, a check value field, a command word field, a sender ID field and a receiver ID field, and the receiving end completes the verification of data integrity by parsing and checking the protocol format.

[0082] As a further solution of the present invention, in the root key generation process, the data fusion of the RTC module and the Timer module is further combined with the unique identifier of the device to enhance the uniqueness and anti-prediction of the random number, and the combination process includes the following steps:

[0083] Extract the time data of the RTC module, including year, month, day, hour, minute, second, and the high-precision timing data of the Timer module;

[0084] Obtain a unique identifier for the device, which is a hardware characteristic parameter of the device or an initial value randomly generated during system initialization;

[0085] The extracted time data, timing data, and unique identifier are weighted together, where:

[0086] Perform shift processing on the time data of the RTC module;

[0087] Perform weighted calculation on the timing data of the Timer module;

[0088] Extract specific bits from the device unique identifier by masking;

[0089] The weighted time data, timing data and identifier data are XORed to generate a high-entropy 64-bit random number, which is used as the root key.

[0090] As a further solution of the present invention, in the process of dynamically updating the encryption key, after the main device and the sub-device confirm the new encryption key through a two-way handshake, the frame format parameters of the protocol are dynamically adjusted. The frame format parameters include: the length of the frame block sequence field of the data packet; the rounds of the encryption algorithm and the ciphertext packet size; and the verification rules of the check value field. The dynamic adjustment is used to enhance the security and flexibility of encryption and parsing during the communication process.

[0091] Embodiment 1:

[0092] See also Figure 1 At present, the mainstream power supply communication identity verification mainly uses ID as verification or software random number as verification. For its protocol verification, see Figure 2 , power supply equipment generally uses embedded processors, the main frequency and performance of the processor are generally not high, and protocol verification is often used for identity confirmation. Based on this situation, the existing processor ID is used as the root key: the uniqueness of the processor ID is the advantage of the ID. However, the processor ID can be read, and the reading method of the ID can be obtained by consulting the official technical manual of the processor. Therefore, there is a great security risk in using the ID as the root key. Protocol verification scheme: The communication data is packaged and sent through a certain protocol or format, and the receiver is demodulated in the same format. This method can obtain the protocol of the communication interaction after capturing the packet through a logic analyzer, so there is still a great security risk.

[0093] Based on this, the technical solution of the present invention refers to Figure 3 — Figure 7 , Figure 3 The principle of hardware random number generation is demonstrated. This system uses the year, month, day, hour, minute, and second time information provided by the RTC module and the high-precision timing data generated by the Timer module, and fuses the data from the two sources through a hardware random number generator (TRNG) to generate high-entropy random numbers. The RTC time information is used as the basic time reference, and the microsecond timing data of the Timer further improves the accuracy and unpredictability of random numbers. This hardware random number generation method avoids the predictability defects that may exist in traditional pseudo-random number generation methods and significantly improves security. Figure 4 The communication security process based on random number generation and TEA encryption is demonstrated. The data of the RTC and Timer modules are processed by TRNG to generate random numbers, which are input into the TEA encryption module as the root key. During the encryption process, the encryption control module regulates the execution of the encryption algorithm to ensure the secure transmission of the data packet. The final encrypted data packet is sent to the communication target device. This system generates random numbers through hardware and combines the TEA encryption algorithm to achieve efficient and secure data encryption, which is particularly suitable for resource-constrained embedded system scenarios.

[0094] and Figure 5The data structure of the RTC module and the Timer module and the process of hardware random number generation are shown in detail. The RTC module provides basic time information, including year, month, day, hour, minute and second, while the Timer module provides high-precision microsecond timing signals. The data of the two are fused through the hardware random number generator to generate random numbers with high entropy values. This design not only makes full use of existing hardware resources, but also ensures the dynamic and unpredictable nature of random number generation, providing a basic guarantee for subsequent encryption and communication security. Figure 6 The specific process of TEA encryption and the interaction between its core components are shown. The random number is input into the TEA encryption module as the root key, and the encryption control module is used to complete the dynamic encryption process. Through the adjustment of the control module, TEA encryption outputs the ciphertext and sends it to the target device as part of the communication security data packet. This design ensures the dynamic nature of the key and optimizes the efficiency of the encryption algorithm in embedded scenarios.

[0095] Figure 7 The communication interaction process between the main device and the sub-device is described. The communication starts with the sub-device sending the secret key and communication request. After the main device responds, the sub-device continues to send its ID information. After the main device completes the authentication, it sends the communication secret key to the sub-device. The communication connection is completed after both parties pass the two-way identity authentication. This process design makes full use of random number generation and two-way verification mechanisms to ensure the identity credibility of both parties in communication and avoid the risks of man-in-the-middle attacks and data forgery. This process is suitable for power supply communication scenarios that require high-security authentication.

[0096] Embodiment 2:

[0097] In a new energy power management system, in order to achieve secure communication between multiple power sub-devices and the main device, identity verification and data encryption are usually required. However, the traditional method of using fixed keys or protocol verification has high security risks when facing scenarios such as data interception, logic analyzer packet capture, and processor ID leakage. In addition, this type of solution lacks dynamism and sufficient randomness, and it is difficult to meet the power management system's requirements for high security and high reliability. In order to solve the above problems, the present invention provides a secure communication method based on dynamic random number generation and two-way verification, and is implemented through the following specific implementation methods.

[0098] In this embodiment, the communication between the power sub-device and the main device is performed using the following steps:

[0099] First, the MCU built-in RTC module and Timer module of the master device and slave device are initialized respectively. The RTC module generates stable time information, including year, month, day, hour, minute, and second, through a low-frequency crystal oscillator; the Timer module provides high-precision timing data through a phase-locked loop circuit (PLL), which increases the time resolution to microseconds. Taking the slave device as an example, it combines the second-level time data provided by the RTC with the microsecond-level timing data generated by the Timer through a fusion algorithm, and uses bit-level grouping, shift processing, and weighted superposition to generate a 64-bit high-entropy random number as the root key. The random number is dynamically generated each time a communication is initiated and used immediately for encryption operations. It is not retained in the storage medium, which fundamentally eliminates the possibility of root key leakage.

[0100] The sub-device encrypts the generated root key using the TEA lightweight encryption algorithm. The encrypted key data is split into 4 data packets (such as fixed byte length) according to the predetermined protocol format and sent to the main device packet by packet. After receiving the data packet, the main device first performs a data integrity check, and decrypts the received key data using the same TEA algorithm, and compares and verifies it with its preset encryption rules. If the check passes, the main device will generate a new random number as the return key and send it to the sub-device in the same encryption and packetization method. After receiving it, the sub-device completes the verification of the main device's identity.

[0101] After the two-way verification is completed, the main device and the sub-device begin secure communication and agree on the use cycle of the dynamic encryption key, such as updating the encryption key every 10 communications or every 1 minute. When updating the key, both parties regenerate their own dynamic random numbers, complete the identity verification and key update according to the above steps, replace the old key, and ensure that the key is always in a high security state during the entire communication cycle.

[0102] In actual applications, when the sub-device of the power management system is connected to the main device, it actively initiates a communication authentication request. At this time, the high entropy of the random number generation ensures the unpredictability of the secret key; the two-way verification and dynamic key update mechanism further enhance the reliability of the identities of the two communicating parties and the security of data encryption. For example, in an electric vehicle battery management system, multiple battery modules (sub-devices) need to synchronize data with the main control unit (main device). If the traditional fixed secret key or protocol verification method is used, the attacker can capture the communication data through a logic analyzer and reverse crack the root secret key, and then disguise the communication module for malicious manipulation. This embodiment significantly improves the system's anti-attack capability through dynamically generated high-entropy random numbers and a two-way verification mechanism, avoiding the risk of the communication protocol being intercepted or the data being tampered with.

[0103] In addition, since this embodiment adopts the TEA lightweight encryption algorithm, it has high computational efficiency and occupies few resources, and can ensure the real-time and reliability of communication even in the low-power mode of embedded devices. At the same time, the protocol subpacketization design further reduces the risk of interception of single data transmission. For example, in some new energy scenarios, the power module needs to periodically report operating parameters such as voltage, current and temperature to the main device. Through the subpacketization encryption and dynamic key mechanism of the present invention, not only the independence of each data transmission is guaranteed, but also the possibility of attackers inferring the system encryption rules by repeatedly analyzing the content of the data packet is eliminated.

[0104] To summarize, this embodiment introduces dynamic random number generation, two-way verification, dynamic key update and lightweight encryption algorithm into the power management system, which not only solves the security problems of easy leakage of root keys and easy reversal of protocols in traditional fixed key methods, but also realizes efficient encryption and identity verification in resource-constrained scenarios, significantly improves the security and reliability of power communication, and provides a low-cost, high-security innovative solution for intelligent power communication systems.

[0105] Embodiment 3:

[0106] In the new energy charging pile system, frequent data interaction is required between multiple charging modules (sub-devices) and the central control unit (main device), such as the transmission of key parameters such as voltage, current, and temperature, to ensure the safety and efficiency of the charging process. However, in the traditional communication verification method, the device ID of the embedded processor is usually used as the root key, and the identity verification is implemented in conjunction with a fixed protocol. This method is easy to be reverse parsed when using tools such as logic analyzers to capture protocol packets, and the static nature of the device ID leads to key leakage, thereby threatening the communication security of the system. In order to solve the above problems, the technical solution of the present invention is applied to the charging pile system, and the specific implementation method is as follows:

[0107] When a new charging module is connected to the charging pile, the module first generates a random number as the root key for communication through the RTC module and Timer module of the built-in MCU. The RTC module provides time data including year, month, day, hour, minute, and second, and the Timer module provides microsecond-level high-precision timing data. The random number generation algorithm generates a 64-bit high-entropy random number by combining the unique identifier of the device (such as the hardware serial number or random initialization value) through bit-level grouping, weighted processing, and shift operations of the RTC data and Timer data. The generated root key is highly unique and unpredictable, and is discarded immediately after the communication is completed and is not saved in any storage medium.

[0108] Next, the charging module encrypts the generated root key using the TEA lightweight encryption algorithm. The encrypted key data is split into fixed-size data packets according to the packet format specified by the protocol, and sent to the central control unit packet by packet. After receiving the data packet, the central control unit first performs verification and analysis to verify the integrity and legitimacy of the data packet, and then uses the same TEA algorithm to decrypt the received key data, and compares the decryption result with the preset rules. If the verification passes, the central control unit generates a new random number as the communication key and sends it to the charging module according to the same encryption and transmission rules. After the charging module decrypts the new key and verifies its legitimacy, it completes the identity authentication of the central control unit.

[0109] In the subsequent charging process communication, the charging module and the central control unit use dynamic encryption keys to encrypt and decrypt data. The key update mechanism is triggered according to preset conditions. For example, after every 10 communications or a time interval of 1 minute, both parties regenerate a random number as a new key and update the existing communication encryption key to ensure the continuous security of communication.

[0110] In addition, this technical solution also optimizes the design of the communication protocol. When the key is updated, the protocol frame format will be dynamically adjusted synchronously. For example, the length of the frame block sequence field, the packet size, the encryption round and other parameters can be flexibly configured according to actual needs to increase the difficulty of cracking the communication protocol and improve the adaptability of the system in different scenarios.

[0111] In actual operation, the security of the charging pile system has been significantly improved. For example, in the complex communication network of multiple charging modules and control units, even if individual communication data is intercepted, attackers cannot obtain the root key or restore the random number generation rules, and cannot disguise legitimate devices to perform malicious operations. At the same time, the dynamic key and protocol adjustment mechanism further improves the anti-attack capability of the data transmission process, ensuring the safety and reliability of the entire charging process.

[0112] In summary, this embodiment realizes the security verification function of the new energy charging pile communication system through dynamic random number generation, efficient two-way verification mechanism and dynamic protocol optimization. While avoiding device ID leakage and storage medium attack, it also ensures the real-time performance and efficient resource utilization in the embedded system, providing a practical solution for power communication scenarios with high security requirements.

[0113] In the present invention, unless otherwise clearly stipulated and limited, the terms such as "installation", "setting", "connection", "fixation" and "screw-on" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. Unless otherwise clearly defined, ordinary technicians in this field can understand the specific meanings of the above terms in the present invention according to the specific circumstances.

[0114] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.

Claims

1. A security verification method suitable for power product communication, characterized in that: The following steps are involved: Step 1: Use the RTC module and Timer module inside the MCU to generate a random number as the root key: The RTC module provides time information, including year, month, day, hour, minute, and second. The Timer module improves the time accuracy to microsecond level through frequency division operation. Through the preset fusion algorithm, the time data of the RTC module is combined with the high-precision timing data of the Timer module to generate a 64-bit random number with high entropy value, which is used as the root key; Step 2: Encrypt the generated root key in real time: Use the TEA lightweight encryption algorithm to encrypt the root key and generate encrypted key data; Splitting the encrypted key data into multiple data packets according to a predetermined protocol and sending the data packets to the sub-device one by one; Step 3: Implement two-way identity verification during communication: The slave device initiates a communication authentication request to the master device using the encrypted root key. The master device decrypts and verifies the validity of the root key after receiving it. After verification, the master device sends the encrypted root key and authentication information to the slave device to initiate a reverse verification request. The slave device decrypts and verifies the identity of the master device. After the two-way verification is completed, the master device and the slave device establish a communication connection, and both parties use dynamically updated encryption keys in subsequent communication processes; Step 4: Real-time generation and immediate use of dynamic root keys: A random number is regenerated as the root key for each communication, and the root key is discarded immediately after use; The root key is not stored in any medium, ensuring its unpredictability and resistance to cracking.

2. A security verification method applicable to power product communication according to claim 1, characterized in that: The time information of the RTC module comes from the stable clock signal of the low-frequency crystal oscillator, which is used to provide a time base including year, month, day, hour, minute and second; the timing data of the Timer module is used to increase the resolution of the time base to microsecond level.

3. A security verification method applicable to power product communication according to claim 1, characterized in that: The preset fusion algorithm generates a high entropy random number by bit-level operation and data fusion processing of the time data of the RTC module and the timing data of the Timer module. The data fusion processing includes the following steps: S1, bit-level grouping and masking of the time data of the RTC module to increase randomness; S2, performs displacement operation and weight superposition on the timing data of the Timer module to improve the accuracy; S3, performing an XOR operation on the processed time data and the timing data to generate a final random number.

4. A security verification method applicable to power product communication according to claim 1, characterized in that: The encryption process of the TEA lightweight encryption algorithm includes: using a 64-bit random number as a key to perform a cyclic encryption operation on the data; splitting the encrypted data into multiple sub-data packets according to a predetermined protocol, each data packet has a fixed size, and sending them to the sub-device one by one.

5. A security verification method applicable to power product communication according to claim 1, characterized in that: The process of two-way identity verification includes: the sub-device sends the root key and communication request encrypted by TEA to the main device; the main device decrypts and verifies the validity of the root key after receiving it, and returns the verification result to the sub-device; the main device generates a new random number as the return key, encrypts it and sends it to the sub-device, and the sub-device completes the verification of the main device's identity after decryption.

6. A security verification method applicable to power product communication according to claim 1, characterized in that: The conditions for dynamically updating the encryption key during the subsequent communication process include: triggering the key update mechanism every preset time interval during the communication process; or when a preset number of communications is reached, generating a new root key and replacing the old key after performing a two-way identity verification.

7. A security verification method applicable to power product communication according to claim 1, characterized in that: The instant generation and use process of the random number includes: generating a new random number as a root key in real time at the beginning of each communication; the root key is discarded immediately after being used for encryption operations and is not stored in any medium.

8. A security verification method applicable to power product communication according to claim 1, characterized in that: The format of the predetermined protocol includes a frame block sequence field, a check value field, a command word field, a sender ID field and a receiver ID field. The receiving end completes the verification of data integrity by parsing and checking the protocol format.

9. A security verification method applicable to power product communication according to claim 1, characterized in that: In the root key generation process, the data fusion of the RTC module and the Timer module is further combined with the unique identifier of the device to enhance the uniqueness and anti-prediction of the random number. The combination process includes the following steps: Extract the time data of the RTC module, including year, month, day, hour, minute, second, and the high-precision timing data of the Timer module; Obtain a unique identifier for the device, which is a hardware characteristic parameter of the device or an initial value randomly generated during system initialization; The extracted time data, timing data, and unique identifier are weighted together, where: Perform shift processing on the time data of the RTC module; Perform weighted calculation on the timing data of the Timer module; Extract specific bits from the device unique identifier by masking; The weighted time data, timing data, and identifier data are XORed to generate a high-entropy 64-bit random number, which is used as the root key.

10. A security verification method applicable to power product communication according to claim 1, characterized in that: In the process of dynamically updating the encryption key, after the main device and the sub-device confirm the new encryption key through a two-way handshake, the frame format parameters of the protocol are dynamically adjusted. The frame format parameters include: the length of the frame block sequence field of the data packet; the rounds of the encryption algorithm and the ciphertext packet size; and the verification rules of the check value field.