Method for burning sec firmware of charging pile, burning system and running method

By generating SECCID in the charging pile and using RSA encryption algorithm and signature certificate, the problem of charging pile SECC firmware being easily illegally ported and stolen is solved, realizing deep binding between firmware and hardware, ensuring the safety and efficiency of equipment operation, and adapting to large-scale mass production.

CN121957622BActive Publication Date: 2026-07-31WANBANG DIGITAL ENERGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WANBANG DIGITAL ENERGY CO LTD
Filing Date
2026-04-02
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

The SECC firmware in charging piles lacks a dedicated encryption adaptation design, making it easy to be illegally ported and stolen, resulting in serious economic losses and security risks for equipment operators.

Method used

SECCID is generated by combining the UID and MAC address of the charging pile MCU/SOC. It is then encrypted using the RSA encryption algorithm and a signature certificate to generate an encrypted SECC. This encrypted SECC is combined with the unique hardware identifier for differentiated encryption, ensuring that the firmware is bound to the hardware and preventing unauthorized replacement and theft.

Benefits of technology

It achieves deep integration between firmware and hardware, preventing firmware from being tampered with or illegally replaced, reducing hardware computing power overhead, ensuring the security and efficiency of device operation, and adapting to the needs of large-scale mass production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121957622B_ABST
    Figure CN121957622B_ABST
Patent Text Reader

Abstract

This invention provides a method, system, and operating method for burning SECC firmware for charging piles. The invention generates a SECCID based on the hardware's unique physical identifier (UID) and MAC address, achieving "one identifier per device." It verifies the firmware's legitimacy through a signature certificate and digital signature, preventing tampering and unauthorized replacement. A differentiated encryption strategy is employed, based on the RSA encryption algorithm, combined with the hardware's unique identifier (UID) to determine key encrypted segments in the firmware, ensuring encryption security while reducing hardware computing power overhead. It achieves a three-in-one binding of "identifier-certificate-firmware," ensuring that illegally copied firmware cannot operate normally on other SECC devices, thus preventing firmware theft at its source. Furthermore, this invention deeply integrates the hardware's unique physical identifier into the entire lifecycle of SECC application firmware—startup, operation, encryption, and decryption—ensuring that tampered firmware cannot pass verification, thus blocking malicious firmware injection at its source.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security technology, specifically to a method for burning firmware for a charging pile SECC, a system for burning firmware for a charging pile SECC, and a method for running firmware for a charging pile SECC. Background Technology

[0002] Currently, the firmware of the SECC (Supply Equipment Communication Controller) in most charging piles can be directly called by the system without integrating a security encryption protection mechanism, which poses a significant security risk.

[0003] While there are solutions for encrypting SECC firmware in related technologies, existing solutions fail to achieve deep integration between software-level encryption logic and the hardware platform. Firmware and hardware compatibility remains at the basic operational level, lacking customized encryption adaptation design. This makes the firmware vulnerable to unauthorized porting to similar hardware. Furthermore, to reduce development and mass production costs, most equipment manufacturers use a uniform encryption strategy and key system for devices of the same batch and model, without differentiated security configurations. These issues mean that once attackers breach the protection mechanism of a single device through brute-force attacks or reverse engineering, they can obtain firmware from multiple devices of the same type and reuse it. This not only leads to the leakage of manufacturers' technological achievements and damage to core intellectual property rights but may also trigger subsequent security problems such as firmware tampering and unauthorized function implantation, causing serious economic losses and security risks to equipment operators and related industries. Summary of the Invention

[0004] To solve the above-mentioned technical problems, the first objective of this invention is to propose a method for burning SECC firmware for charging piles.

[0005] The second objective of this invention is to provide a firmware burning system for charging piles (SECC).

[0006] The third objective of this invention is to provide a method for operating the SECC firmware of a charging pile.

[0007] The technical solution adopted in this invention is as follows:

[0008] An embodiment of the present invention proposes a method for burning SECC firmware to a charging pile, comprising the following steps: generating a SECCID based on the UID (User Identification) and MAC (Media Access Control) address of the charging pile's MCU (Microcontroller Unit) / SOC (System on Chip), and writing the SECCID into a CSR file; generating a key pair, and using the key pair to burn the CSR (Certificate Signing System) firmware. The process involves: signing the SECCID in the Certificate Signing Request (CSC) file to generate a signing certificate; signing the SECC firmware based on the signing certificate to generate a signing file; encrypting the key pair using the RSA (Asymmetric Encryption Algorithm) to generate an encrypted key pair, which includes an RSA decryption private key and an RSA encryption public key; generating an offset position based on the SECCID, and extracting fragments from the SECC firmware based on the offset position; encrypting the extracted SECC firmware fragments using the RSA encryption public key to generate an encrypted SECC; storing the signing certificate, the signing file, and the encrypted SECC in the SECC firmware package; and burning the SECC firmware package and the RSA decryption private key onto the SECC board.

[0009] The method for burning the SECC firmware of the charging pile proposed above in this invention may also have the following additional technical features:

[0010] According to one embodiment of the present invention, generating SECCID based on the UID and MAC address of the charging pile MCU / SOC specifically includes: obtaining the high 4 bytes and low 4 bytes of the UID of the MCU / SOC and the low 4 bytes of the MAC address of the MCU / SOC, and then concatenating them to generate the SECCID.

[0011] According to one embodiment of the present invention, the key pair is used to sign the SECCID in the CSR file to generate a signing certificate, specifically including:

[0012] Establish a Certificate Authority (CA) for the signing certificate; use SECCID as the CN field of the signing certificate, and embed the hash values ​​of the UID and MAC address in the extended fields of the signing certificate; control the CA to digitally sign the SECCID in the CN field using the private key of the key pair to generate a complete signing certificate, and harden the signing certificate to the Flash secure sector of the SECC board.

[0013] According to one embodiment of the present invention, signing the SECC firmware based on the signing certificate to generate a signature file specifically includes: performing a full hash operation on the SECC firmware using the SHA-256 (Secure Hash Algorithm) algorithm to generate a hash value of the firmware; digitally signing the hash value using the private key of the signing certificate to generate a signature file; packaging the signature file with the SECC firmware and embedding the SECCID in the header.

[0014] According to one embodiment of the present invention, an offset position is generated based on the SECCID, and fragment extraction is performed on the SECC firmware based on the offset position. Specifically, this includes: extracting the 1st byte, 3rd byte, 7th byte, and 11th byte of the SECCID; for each of the four extracted bytes, the high 4 bits are truncated and concatenated in the order of "high 4 bits of 1st byte → high 4 bits of 3rd byte → high 4 bits of 7th byte → high 4 bits of 11th byte" to form a 16-bit unsigned integer as the offset position; reading the SECC firmware, offsetting the SECC firmware according to the offset position, and continuously reading 1000 bytes of firmware content from the offset position as the starting position to complete the fragment extraction of the SECC firmware.

[0015] According to one embodiment of the present invention, the RSA decryption private key is burned once using OTP (One-Time Password), and the CA and the RSA encryption public key are pre-installed in the device bootloader.

[0016] A second aspect of the present invention provides a system for burning SECC firmware for charging piles, comprising: a first generation module, configured to generate a SECCID based on the UID and MAC address of the charging pile MCU / SOC, and write the SECCID into a CSR file; a second generation module, configured to generate a key pair, and use the key pair to sign the SECCID in the CSR file to generate a signing certificate; a third generation module, configured to sign the SECC firmware based on the signing certificate to generate a signing file; and a fourth generation module, configured to use the RSA algorithm. The key pair is encrypted to generate an encrypted key pair, which includes an RSA decryption private key and an RSA encryption public key; an extraction module is used to generate an offset position based on the SECCID and extract fragments of the SECC firmware based on the offset position; an encryption module is used to encrypt the extracted SECC firmware fragments using the RSA encryption public key to generate an encrypted SECC; and a burning module is used to store the signing certificate, the signing file, and the encrypted SECC into a SECC firmware package, and burn the SECC firmware package and the RSA decryption private key onto the SECC board.

[0017] The charging pile SECC firmware burning system described above in this invention also has the following additional technical features:

[0018] According to one embodiment of the present invention, the first generation module is specifically used to: obtain the high 4 bytes and low 4 bytes of the UID of the MCU / SOC and the low 4 bytes of the MAC address of the MCU / SOC, and then concatenate them to generate the SECCID.

[0019] According to one embodiment of the present invention, the second generation module is specifically used to: establish the issuing authority (CA) of the signing certificate; use SECCID as the CN field of the signing certificate, and embed the hash values ​​of the UID and MAC address in the extended fields of the signing certificate; control the CA to digitally sign the SECCID in the CN field using the private key of the key pair, generate a complete signing certificate, and the signing certificate is fixed to the Flash security sector of the SECC board.

[0020] According to one embodiment of the present invention, the third generation module is specifically used to: perform a full hash operation on the SECC firmware using the SHA-256 (Secure Hash Algorithm) algorithm to generate a hash value of the firmware; digitally sign the hash value using the private key of the signing certificate to generate a signature file; package the signature file with the SECC firmware and embed the SECCID in the header.

[0021] According to one embodiment of the present invention, the extraction module is specifically used for: extracting the 1st byte, 3rd byte, 7th byte, and 11th byte of the SECCID; for the extracted 4 bytes, extracting the high 4 bits of each byte, and concatenating them in the order of "high 4 bits of 1st byte → high 4 bits of 3rd byte → high 4 bits of 7th byte → high 4 bits of 11th byte" to form a 16-bit unsigned integer as the offset position; reading the SECC firmware, offsetting the firmware packet according to the offset position, and continuously reading 1000 bytes of firmware content from the offset position as the starting position to complete the fragment extraction of the SECC firmware.

[0022] According to one embodiment of the present invention, the RSA decryption private key is burned once using OTP, and the CA and the RSA encryption public key are pre-installed in the device bootloader.

[0023] A third aspect of the present invention provides a method for running the SECC firmware of a charging pile. The SECC firmware is burned using the charging pile SECC firmware burning method described in the first aspect of the present invention. The running method includes the following steps: when the charging pile SOC / MCU starts up, read the UID and MAC address of the current charging pile MCU / SOC to generate the current charging pile SECCID; read the SECCID in the SECC board signature certificate; perform a matching verification between the current charging pile SECCID and the SECCID in the signature certificate; if the verification passes, read the RSA decryption private key; if reading the RSA decryption private key is successful, read the encrypted SECC; if reading the encrypted SECC is successful, obtain the encrypted data of the read SECC; if the encrypted... Data reading is successful. The signature certificate is verified using the RSA encryption public key. If the signature certificate verification passes, the signature file is verified using the public key of the signature certificate. If the signature file verification passes, the offset position of the current SECCID is generated based on the current charging pile SECCID. The encrypted SECC is decrypted using the offset position of the current SECCID and the RSA decryption private key. If decryption is successful, a temporary SECC file is generated and executed. After detecting the progress of the temporary SECC file, the temporary SECC file is deleted. The execution process of the temporary SECC file is monitored in real time. If the process exits abnormally and does not exist, the process returns to the "read RSA decryption private key" step and re-executes the subsequent related verification and decryption steps to ensure the secure operation of the firmware.

[0024] The beneficial effects of this invention are:

[0025] The SECC ID is generated based on the hardware's unique physical identifier UID and MAC address, laying the foundation for exclusive firmware binding and realizing "one device, one identifier".

[0026] A signing certificate is generated by generating a SECCID, and the SECC firmware is signed based on the signing certificate. The certificate cannot be illegally modified or replaced, which can realize the legality verification of the firmware and prevent the firmware from being tampered with or illegally replaced.

[0027] By adopting a differentiated RSA encryption strategy and determining the encrypted segment based on the unique hardware identifier, encryption security can be guaranteed while reducing hardware computing power consumption and solving the problem of excessive encryption and decryption time affecting the operating efficiency of the device.

[0028] By implementing a three-in-one binding of "identity-certificate-firmware", we ensure that illegally copied firmware cannot function properly on other SECC devices, thus eliminating firmware theft at its source.

[0029] The unique physical identifier of the hardware is deeply integrated into the entire lifecycle of SECC firmware, including startup, operation, encryption, and decryption, ensuring that the firmware cannot pass verification after being tampered with, thus blocking malicious firmware injection at the source.

[0030] No additional external encryption chip is required, reducing development and mass production costs and adapting to the large-scale mass production needs of charging piles SECC. Attached Figure Description

[0031] Figure 1 This is a flowchart of a method for burning the SECC firmware of a charging pile according to an embodiment of the present invention;

[0032] Figure 2 This is a schematic diagram of a method for burning the SECC firmware of a charging pile according to an embodiment of the present invention;

[0033] Figure 3 This is a block diagram of a charging pile SECC firmware burning system according to an embodiment of the present invention;

[0034] Figure 4 This is a flowchart of the operation method of the charging pile SECC firmware according to an embodiment of the present invention. Detailed Implementation

[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0036] Figure 1 This is a flowchart of a method for burning the SECC firmware of a charging pile according to an embodiment of the present invention, as follows: Figure 1 As shown, the programming method includes the following steps:

[0037] S1 generates a SECCID based on the UID and MAC address of the charging pile MCU / SOC, and writes the SECCID into the CSR file.

[0038] In one embodiment of the present invention, the SECCID is generated based on the UID and MAC address of the charging pile MCU / SOC. Specifically, this includes: obtaining the high 4 bytes and low 4 bytes of the MCU / SOC's UID and the low 4 bytes of the MCU / SOC's MAC address, and then concatenating them to generate the SECCID.

[0039] Specifically, the UID of the MCU / SOC is obtained and formed into a 64-bit array. The last 4 bytes of the unique MAC address of the MCU / SOC are obtained and formed into a 32-bit array. The arrays of the obtained UID and MAC address are combined to form the SECCID, which serves as the identity verification for the SECC firmware.

[0040] For example, the high 4 bytes of the UID can be obtained via command: 0x1f4a31d4; the low 4 bytes of the UID can be obtained via command: 0xd5ae5cd7; the MAC address can be obtained via command, and the low 4 bytes of the MAC address can be obtained: 00-50-56-C0-00-08. The resulting SECCID is: 0x1f4a31d4d5ae5cd756C0 0008.

[0041] S2, Generate a key pair, use the key pair to sign the SECCID in the CSR file, and generate a signing certificate.

[0042] In one embodiment of the present invention, a signature certificate is generated by signing the SECCID in the CSR file using a key pair. Specifically, this includes: establishing a Certificate Authority (CA) for the signature certificate; using the SECCID as the CN field of the signature certificate, and embedding the hash values ​​of the UID and MAC address in the extended fields of the signature certificate; controlling the CA to digitally sign the SECCID in the CN field using the private key of the key pair, generating a complete signature certificate, and then hardening the signature certificate to the Flash security sector of the SECC board.

[0043] Specifically, an X.509 v3 certificate is used to establish a dedicated Certificate Authority (CA). The CA is responsible for certificate generation, signing, and management, ensuring the legality and authority of the certificate. The SECCID generated in step S1 is used as the Common Name (CN) field of the signing certificate. Simultaneously, the hash values ​​of UID and MAC are embedded in the extended fields of the signing certificate, achieving a deep binding between "SECCID-UID-MAC" and the signing certificate. This makes the signing certificate a unique identity credential for each SECC firmware device, realizing a three-in-one binding of "identity-certificate-firmware," ensuring that illegally copied firmware cannot function properly on other SECC devices, thus preventing firmware theft at its source. The CA uses the private key of the signing certificate to digitally sign the certificate content (including the SECCID in the CN field), generating a complete X.509 signing certificate. The certificate format can be PEM (Privacy-Enhanced Mail) or DER (Distinguished Encoding Rules) format, containing core information such as the public key, CA signature, SECCID, and validity period. The generated exclusive X.509 signature certificate is embedded into the Flash security sector of the SECC device. At the same time, the CA and public key are pre-installed in the device bootloader for subsequent certificate validity verification. The certificate cannot be illegally modified or replaced. The private key is stored on the certificate server and is used to generate a signature for the SECC firmware to prove its identity.

[0044] S3 signs the SECC firmware based on the signing certificate and generates a signature file.

[0045] In one embodiment of the present invention, signing the SECC firmware based on the signing certificate to generate a signing file specifically includes: performing a full hash operation on the SECC firmware using the SHA-256 algorithm to generate a hash value of the firmware; digitally signing the hash value using the private key of the signing certificate to generate a signing file; packaging the signing file with the SECC firmware and embedding the SECCID in the header.

[0046] Specifically, the compiled SECC firmware (binary file) is subjected to a full hash operation using the SHA-256 algorithm to generate a unique hash value (32 bytes) for the firmware. This hash value can uniquely represent the integrity of the firmware. If the firmware is tampered with, the hash value will change significantly. Then, the private key corresponding to the SECC exclusive signature certificate generated in step S2 (which is paired with the certificate's public key) is used to digitally sign the SHA-256 hash value of the firmware to generate a signature file (containing signature information, hash value, and certificate digest).

[0047] The signing file is packaged with the SECC firmware to form a complete firmware package consisting of "firmware body + signing file". At the same time, the SECCID is embedded in the header of the firmware package to ensure that the firmware corresponds one-to-one with the exclusive certificate and device identifier.

[0048] S4 uses the RSA algorithm to encrypt the key pair to generate an encrypted key pair, which includes an RSA decryption private key and an RSA encryption public key.

[0049] S5 generates an offset position based on the SECCID, and extracts fragments from the SECC firmware based on the offset position.

[0050] S6 uses an RSA public key to encrypt the extracted SECC firmware fragment using RSA, generating an encrypted SECC.

[0051] In one embodiment of the present invention, an offset position is generated based on the SECCID, and fragment extraction of the SECC firmware is performed based on the offset position. Specifically, this includes: extracting the 1st byte, 3rd byte, 7th byte, and 11th byte of the SECCID; for each of the four extracted bytes, the high 4 bits are truncated and concatenated in the order of "high 4 bits of 1st byte → high 4 bits of 3rd byte → high 4 bits of 7th byte → high 4 bits of 11th byte" to form a 16-bit unsigned integer as the offset position; reading the SECC firmware, offsetting the SECC firmware according to the offset position, and continuously reading 1000 bytes of firmware content from the offset position as the starting position to complete the fragment extraction of the SECC firmware.

[0052] Specifically, this invention employs a differentiated encryption strategy, encrypting only the core firmware segments to avoid excessive computational power consumption and long encryption / decryption times caused by encrypting the entire packet. This addresses the pain point of excessive encryption / decryption time in existing technologies. The specific encryption rules and implementation are as follows:

[0053] (1) Generate the offset position OffsetPosition: 1. Extract the high four bits of the specified byte of SECCID: Read the 16-byte SECCID generated in step 2 and extract its 1st byte, 3rd byte, 7th byte, and 11th byte (byte counting starts from 0 or 1, which needs to be standardized; here, it defaults to starting from 1). 2. Combine to generate a 16-bit integer: For the extracted 4 bytes, extract the high 4 bits of each byte (4×4=16 bits in total), and concatenate them in the order of "high 4 bits of 1st byte → high 4 bits of 3rd byte → high 4 bits of 7th byte → high 4 bits of 11th byte" to form a 16-bit unsigned integer, which is the offset position OffsetPosition.

[0054] (2) Firmware core fragment extraction: Read the SECC application firmware, offset the firmware package according to the generated OffsetPosition, and continuously read 1000 bytes of firmware content starting from the offset starting position.

[0055] To ensure that 1000 bytes of data can be read after the offset, the value of OffsetPosition is logically determined to be within the range of [0, total firmware length - 1000]. If it exceeds the range, a modulo operation is performed on it (the modulo value is the total firmware length - 1000). Alternatively, the high four bits of three bytes can be extracted when generating the offset position and concatenated to calculate the offset value. The specific strategy is adjusted according to the actual situation to avoid the inability to read 1000 bytes of firmware content after the offset.

[0056] (3) RSA encryption implementation: 1. Key selection: The RSA asymmetric encryption algorithm is adopted, and the key length is selected as 2048 bits (to balance security and embedded computing power, and avoid the excessive computation time caused by the 4096-bit key). The encryption key is the public key corresponding to the signature certificate in step S2; 2. Core fragment encryption: The extracted 1000-byte firmware core fragment is encrypted using the RSA-2048 algorithm to generate the encrypted ciphertext fragment; 3. Firmware reconstruction: The encrypted ciphertext fragment replaces the 1000-byte plaintext fragment at the corresponding offset position in the original firmware package, and the final encrypted firmware package is reconstructed. The rest of the firmware package remains in plaintext state to achieve differentiated encryption.

[0057] Therefore, this invention generates a pseudo-random position based on the SECCID as the encryption starting position, thereby enabling different SECC products to have different encrypted content.

[0058] S7 stores the signing certificate, signing file, and encrypted SECC in the SECC firmware package, and burns the SECC firmware package and RSA decryption private key onto the SECC board.

[0059] To enable those skilled in the art to more clearly understand the charging pile SECC firmware burning method of the present invention, the following is provided: Figure 2 The diagram shows the principle of the SECC firmware burning method for the charging pile.

[0060] During the burning process, the SECCID, RSA encryption public key, and signature certificate private key can be stored in the database for subsequent OTA (Over-the-Air Technology).

[0061] In summary, the charging pile SECC firmware burning method according to embodiments of the present invention generates a unique SECC device identifier (SECCID) based on the hardware's unique physical identifier (UID) and MAC address, laying the foundation for exclusive firmware binding and achieving "one device, one identifier"; a signing certificate is generated through the SECCID, and the SECC firmware is signed based on the signing certificate. The certificate cannot be illegally modified or replaced, enabling firmware legitimacy verification and preventing firmware tampering or illegal replacement; a differentiated RSA encryption strategy is adopted, using a pseudo-random position generated based on the SECCID as the encryption start position, thereby ensuring that different SECC products have unique identifiers. The same encrypted content can reduce hardware computing power consumption while ensuring encryption security, solving the problem of excessive encryption and decryption time affecting the operating efficiency of the device; it realizes the three-in-one binding of "identifier-certificate-firmware", ensuring that illegally copied firmware cannot run normally on other SECC devices, eliminating firmware theft at the source; it deeply integrates the unique physical identifier of the hardware into the entire life cycle of SECC application firmware startup, operation, encryption, and decryption, ensuring that the firmware cannot pass verification after being tampered with, blocking malicious firmware injection at the source; it eliminates the need for additional external encryption chips, reducing development and mass production costs, and adapting to the large-scale mass production needs of charging pile SECC.

[0062] Corresponding to the aforementioned method for burning the SECC firmware of charging piles, this invention also proposes a system for burning the SECC firmware of charging piles. Since the embodiments of the burning system of this invention correspond to the embodiments of the burning method described above, details not disclosed in the system embodiments can be referred to in the above method embodiments, and will not be repeated here.

[0063] Figure 3 This is a block diagram of a charging pile SECC firmware burning system according to an embodiment of the present invention, as shown below. Figure 3 As shown, the system includes: a first generation module 10, a second generation module 20, a third generation module 30, a fourth generation module 40, an extraction module 50, an encryption module 60, and a burning module 70.

[0064] The system comprises the following modules: First generation module 10 generates a SECCID based on the UID and MAC address of the charging pile MCU / SOC and writes the SECCID into a CSR file; Second generation module 20 generates a key pair and uses the key pair to sign the SECCID in the CSR file to generate a signature certificate; Third generation module 30 signs the SECC firmware based on the signature certificate to generate a signature file; Fourth generation module 40 uses the RSA algorithm to encrypt the key pair to generate an encrypted key pair, which includes an RSA decryption private key and an RSA encryption public key; Extraction module 50 generates an offset position based on the SECCID and extracts fragments of the SECC firmware based on the offset position; Encryption module 60 uses the RSA encryption public key to encrypt the extracted SECC firmware fragments to generate an encrypted SECC; and Burning module 70 stores the signature certificate, signature file, and encrypted SECC into the SECC firmware package and burns the SECC firmware package and RSA decryption private key onto the SECC board.

[0065] According to one embodiment of the present invention, the first generation module 10 is specifically used to: obtain the high 4 bytes and low 4 bytes of the UID of the MCU / SOC and the low 4 bytes of the MAC address of the MCU / SOC, and then concatenate them to generate SECCID.

[0066] According to one embodiment of the present invention, the second generation module 20 is specifically used to: establish a Certificate Authority (CA) for the signing certificate; use SECCID as the CN field of the signing certificate, and embed the hash values ​​of UID and MAC address in the extended fields of the signing certificate; control the CA to digitally sign the SECCID in the CN field using the private key of the key pair, generate a complete signing certificate, and harden the signing certificate to the Flash security sector of the SECC board.

[0067] According to one embodiment of the present invention, the third generation module 30 is specifically used to: perform a full hash operation on the SECC firmware using the SHA-256 algorithm to generate a hash value of the firmware; digitally sign the hash value using the private key of the signing certificate to generate a signature file; package the signature file with the SECC firmware and embed the SECCID in the header.

[0068] According to one embodiment of the present invention, the extraction module 50 is specifically used for: extracting the 1st byte, 3rd byte, 7th byte, and 11th byte of SECCID; for the extracted 4 bytes, extracting the high 4 bits of each byte, and concatenating them in the order of "high 4 bits of 1st byte → high 4 bits of 3rd byte → high 4 bits of 7th byte → high 4 bits of 11th byte" to form a 16-bit unsigned integer as the offset position; reading the SECC firmware, offsetting the SECC firmware according to the offset position, and continuously reading 1000 bytes of firmware content from the offset position as the starting position to complete the fragment extraction of the SECC firmware.

[0069] According to one embodiment of the present invention, the RSA decryption private key is burned once using OTP, and the CA and RSA encryption public keys are pre-installed in the device bootloader.

[0070] According to the charging pile SECC firmware burning system of this invention, a unique identifier SECCID for each SECC device is generated based on the unique physical identifier UID and MAC address of the hardware, laying the foundation for exclusive firmware binding and realizing "one device, one identifier". A signature certificate is generated through the SECCID, and the SECC firmware is signed based on the signature certificate. The certificate cannot be illegally modified or replaced, which can realize firmware legality verification and prevent firmware from being tampered with or illegally replaced. A differentiated RSA encryption strategy is adopted, and a pseudo-random position is generated based on the SECCID as the encryption start position, so that different SECC products have different encryption content. This can reduce low computing power while ensuring encryption security and solve the problem of excessive encryption and decryption time affecting the operating efficiency of the device. The "identifier-certificate-firmware" three-in-one binding is realized to ensure that illegally copied firmware cannot run normally on other SECC devices, thus eliminating firmware theft at the source.

[0071] In addition, such as Figure 4 As shown, this invention also proposes a method for running the SECC firmware of a charging pile. The SECC firmware is burned using the charging pile SECC firmware burning method described above in this invention. The running method includes the following steps:

[0072] S101: When the charging pile SOC / MCU starts up, read the UID and MAC address of the current charging pile MCU / SOC to generate the current charging pile SECCID.

[0073] S102, read the SECCID from the SECC board signature certificate.

[0074] S103, perform a match verification between the current charging pile's SECCID and the SECCID in the signature certificate.

[0075] S104: If the verification passes, read the RSA decryption private key. If the verification fails, terminate the process.

[0076] S105, if the RSA decryption private key is successfully read, then the encrypted SECC is read.

[0077] S106: If reading the RSA decryption private key fails, then read the backup RSA decryption private key. If the backup RSA decryption private key is read successfully, proceed to step S107; otherwise, terminate the process.

[0078] S107, If reading the encrypted SECC is successful, then read the encrypted data of the encrypted SECC.

[0079] If reading the encrypted SECC fails, the process terminates.

[0080] Calculate the position offset based on the SECCID, and start from the offset position to continuously read 1000 bytes of firmware content, reading the encrypted data of SECC.

[0081] S108. If the encrypted data is successfully read, the signature certificate is verified using the RSA encryption public key.

[0082] S109. If the signature certificate verification passes, the signature file is verified based on the public key of the signature certificate.

[0083] Specifically, the signature verification logic is pre-configured in the bootloader of the SECC firmware, and the verification process is clearly defined: the legality of the signature certificate is verified by the CA and public key, and then the consistency between the firmware digital signature and hash value is verified by the certificate public key. If the verification fails, the firmware will be refused to start.

[0084] S110, if the signature file verification passes, then generate the offset position of the current SECCID based on the current charging pile SECCID, and decrypt the encrypted SECC based on the offset position of the current SECCID and the RSA decryption private key.

[0085] S111, if decryption is successful, a temporary SECC file is generated and executed.

[0086] Specifically, during startup, the system first obtains its own SECCID by generating rules using SECCID, generates an offset position according to the same rules, reads the encrypted 1000-byte segment from the firmware package, and uses the RSA decryption private key (paired with the encryption public key and embedded in the OTP area) to perform RSA decryption. After decryption, it is concatenated with other plaintext segments of the firmware to generate a temporary SECC file.

[0087] If decryption fails, the process will terminate.

[0088] S112, after detecting the process of the temporary SECC file, delete the temporary SECC file.

[0089] S113, Real-time monitoring process.

[0090] S114 If the process exits abnormally and does not exist, return to the step of reading the RSA decryption private key (S104) and re-execute the subsequent related verification and decryption steps to ensure the secure operation of the firmware.

[0091] According to the charging pile SECC firmware operation method of this invention, the firmware sequentially completes "SECCID matching verification → signature certificate validity verification → signature certificate verification → encrypted fragment decryption → firmware integrity verification" during startup. If any verification fails, the firmware startup is immediately terminated, preventing unauthorized operation of the firmware through tampering or theft. The unique physical identifier of the hardware is deeply integrated into the entire lifecycle of the SECC application firmware, including startup, operation, encryption, and decryption, ensuring that the firmware cannot pass verification after tampering, thus blocking malicious firmware injection at the source. No additional external encryption chip is required, reducing development and mass production costs and adapting to the large-scale mass production needs of charging pile SECC.

[0092] In the description of this invention, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.

[0093] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for burning SECC firmware for a charging pile, characterized in that, Includes the following steps: A SECCID is generated based on the UID and MAC address of the charging pile MCU / SOC, and the SECCID is written into the CSR file; Generate a key pair, and use the key pair to sign the SECCID in the CSR file to generate a signing certificate; The SECC firmware is signed based on the signing certificate to generate a signature file; The key pair is encrypted using the RSA algorithm to generate an encrypted key pair, which includes: an RSA decryption private key and an RSA encryption public key; An offset position is generated based on the SECCID, and fragments are extracted from the SECC firmware based on the offset position; The extracted SECC firmware fragment is encrypted using the RSA encryption public key to generate an encrypted SECC; The signing certificate, the signing file, and the encrypted SECC are stored in the SECC firmware package, and the SECC firmware package and the RSA decryption private key are burned onto the SECC board; An offset position is generated based on the SECCID, and fragment extraction is performed on the SECC firmware based on the offset position, specifically including: Extract the 1st, 3rd, 7th, and 11th bytes of the SECCID; For the extracted 4 bytes, the high 4 bits of each byte are truncated and concatenated in the order of "high 4 bits of byte 1 → high 4 bits of byte 3 → high 4 bits of byte 7 → high 4 bits of byte 11" to form a 16-bit unsigned integer as the offset position. The SECC firmware is read, and its position is offset according to the offset position. Starting from the offset position, 1000 bytes of firmware content are read continuously to complete the segment extraction of the SECC firmware.

2. The method for burning the SECC firmware of a charging pile according to claim 1, characterized in that, The SECCID is generated based on the UID and MAC address of the charging pile MCU / SOC, specifically including: After obtaining the high 4 bytes and low 4 bytes of the UID of the MCU / SOC and the low 4 bytes of the MAC address of the MCU / SOC, they are concatenated to generate the SECCID.

3. The method for burning the SECC firmware of a charging pile according to claim 1, characterized in that, The key pair is used to sign the SECCID in the CSR file to generate a signing certificate, specifically including: Establish the Certificate Authority (CA) for the signature certificate; Use SECCID as the CN field of the signing certificate, and embed the hash values ​​of the UID and MAC address in the extended fields of the signing certificate; The CA is controlled to digitally sign the SECCID in the CN field using the private key of the key pair, generating a complete signature certificate, which is then embedded into the Flash security sector of the SECC board.

4. The method for burning the SECC firmware of a charging pile according to claim 1, characterized in that, The SECC firmware is signed based on the signing certificate to generate a signature file, specifically including: The SECC firmware is subjected to a full hash operation using the SHA-256 algorithm to generate the firmware's hash value; The hash value is digitally signed using the private key of the signature certificate to generate a signature file; The signature file is packaged with the SECC firmware, and the SECCID is embedded in the header.

5. The method for burning the SECC firmware of a charging pile according to claim 3, characterized in that, The RSA decryption private key is burned once using OTP, and the CA and the RSA encryption public key are pre-installed in the device bootloader.

6. A firmware burning system for a charging pile SECC (Secondary Cylinder Control) system, characterized in that, include: The first generation module is used to generate a SECCID based on the UID and MAC address of the charging pile MCU / SOC, and write the SECCID into the CSR file; The second generation module is used to generate a key pair and use the key pair to sign the SECCID in the CSR file to generate a signing certificate. The third generation module is used to sign the SECC firmware based on the signing certificate and generate a signature file; The fourth generation module is used to encrypt the key pair using the RSA algorithm to generate an encrypted key pair, wherein the encrypted key pair includes: an RSA decryption private key and an RSA encryption public key; The extraction module is used to generate an offset position based on the SECCID and extract fragments from the SECC firmware based on the offset position. The encryption module is used to perform RSA encryption on the extracted SECC firmware fragment using the RSA encryption public key to generate an encrypted SECC; The programming module is used to store the signature certificate, the signature file and the encrypted SECC into the SECC firmware package, and to program the SECC firmware package and the RSA decryption private key onto the SECC board; Specifically, the extraction module is used to: extract the 1st, 3rd, 7th, and 11th bytes of the SECCID; for each of the four extracted bytes, extract the high 4 bits and concatenate them in the order of "high 4 bits of 1st byte → high 4 bits of 3rd byte → high 4 bits of 7th byte → high 4 bits of 11th byte" to form a 16-bit unsigned integer as the offset position; read the SECC firmware, offset the SECC firmware according to the offset position, and continuously read 1000 bytes of firmware content from the offset position as the starting position to complete the fragment extraction of the SECC firmware.

7. The charging pile SECC firmware burning system according to claim 6, characterized in that, The first generation module is specifically used for: After obtaining the high 4 bytes and low 4 bytes of the UID of the MCU / SOC and the low 4 bytes of the MAC address of the MCU / SOC, they are concatenated to generate the SECCID.

8. The charging pile SECC firmware burning system according to claim 6, characterized in that, The second generation module is specifically used for: Establish the Certificate Authority (CA) for the signature certificate; Use SECCID as the CN field of the signing certificate, and embed the hash values ​​of the UID and MAC address in the extended fields of the signing certificate; The CA is controlled to digitally sign the SECCID in the CN field using the private key of the key pair, generating a complete signature certificate, which is then embedded into the Flash security sector of the SECC board.

9. A method for operating the SECC firmware of a charging pile, characterized in that, The SECC firmware is burned using the burning method for charging pile SECC firmware according to any one of claims 1-5, and the running method includes the following steps: When the charging pile SOC / MCU starts up, the UID and MAC address of the current charging pile MCU / SOC are read to generate the current charging pile SECCID; Read the SECCID from the SECC board signature certificate; The current charging pile's SECCID is matched and verified with the SECCID in the signature certificate; If the verification passes, the RSA decryption private key is read. If the RSA decryption private key is successfully read, then the encrypted SECC is read; If the encrypted SECC is read successfully, then the encrypted data of the encrypted SECC is read. If the encrypted data is successfully read, the signature certificate is verified using the RSA encryption public key; If the signature certificate verification passes, the signature file is verified using the public key of the signature certificate; If the signature file verification passes, the offset position of the current SECCID is generated based on the current charging pile SECCID, and the encrypted SECCID is decrypted based on the offset position of the current SECCID and the RSA decryption private key. If decryption is successful, a temporary SECC file will be generated and executed. After detecting the process of the temporary SECC file, delete the temporary SECC file; Monitor the execution process of the temporary SECC file in real time. If the process exits abnormally and does not exist, return to the "Read RSA decryption private key" step and re-execute the subsequent steps.