ECU flashing system and method and storage medium
By introducing two-way authentication of digital certificates and separation of authorization files into the ECU flashing system, the security loopholes in the existing ECU flashing methods are solved and higher vehicle information security and stability are achieved.
Patent Information
- Application Number
- CN202411378620.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
The existing ECU flashing method has security loopholes and no authentication and authorization mechanism is implemented, resulting in the risk of information leakage and abuse of flashing permissions, seriously threatening the vehicle's information security.
An ECU flashing system is designed, including PKI certificate management module, vehicle software management module, flash authentication module, gateway module and ECU module. Through the two-way authentication of digital certificates and the separation of authorization files, the security of the flashing process is ensured. sex.
Effectively prevent the access of illegal devices, reduce the risk of attacking the ECU brush in the car during the upgrade, improve the security of data transmission, and ensure the security and stability of vehicle information.
Smart Images

Figure CN119363394A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of vehicle electronic control, and in particular relates to an ECU flashing system, method and storage medium. Background Art
[0002] With the development of intelligent connected cars, more and more people are buying intelligent connected cars. During the maintenance and upgrade of intelligent connected cars, flashing the ECU in the car is a common operation in the industry. Compared with traditional cars, the electronic system of intelligent connected cars is more complex, and the corresponding means of network attacks have also increased, so there are higher requirements for the network security protection of the whole vehicle. When using flashing tools to flash the ECU in the car, the existing flashing methods have certain security loopholes that are easy to be cracked and exploited. Once a malicious attack occurs during flashing, the vehicle will malfunction, and in serious cases, it will directly threaten the life and property of the owner.
[0003] In the current flashing scenario, general flashing tools do not have an authentication and authorization mechanism, and there are risks of information leakage and abuse of flashing permissions during the flashing process; the software flashing package and the decryption key are not effectively separated, which makes the software flashing package easy to be leaked, posing a great threat to the information security of the vehicle. The existing ECU flashing method has many deficiencies in terms of security and other aspects, and needs to be improved urgently. Summary of the invention
[0004] The present invention provides an ECU flashing system, which includes: a PKI certificate management module, a vehicle software management module, a flashing authentication module, a gateway module and an ECU module;
[0005] PKI certificate management module: reviews digital certificate applications submitted by the flash authentication module; generates a digital certificate with a signature based on the application information, and sends the digital certificate to the flash authentication module;
[0006] Vehicle software management module: Generates and issues authorization files and updates ECU software version information based on the flash-related information uploaded by the flash-authentication module;
[0007] Flashing authentication module: submitting digital certificate application to PKI certificate management module; storing digital certificates issued by PKI certificate management module; uploading flashing related information to vehicle software management module; sending authorization files and software flashing packages to gateway module;
[0008] Gateway module: pre-sets the digital certificate issued by the PKI certificate management module; verifies the digital certificate of the flash authentication module; establishes communication with the ECU module according to the authorization file;
[0009] ECU module: receives the authorization file and software flash package transmitted by the gateway module, flashes the ECU software, and returns an ECU flash success signal to the gateway module.
[0010] Furthermore, the digital certificate includes the validity period of the certificate, the issuing authority, and the public key information of the PKI certificate management module.
[0011] Furthermore, the authorization file issued by the vehicle software management module includes information on whether the vehicle software management module authorizes the vehicle to be flashed, and a decryption key for the software flashing package.
[0012] Furthermore, the flashing information uploaded by the flashing authentication module to the vehicle software management module includes the read vehicle VIN, the software and hardware number of the flashing ECU, the part number, and the information of the software flashing package.
[0013] Furthermore, the digital certificate in the flash authentication module has a time limit, and the time limit of the digital certificate is controlled by the PKI certificate management module. The flash authentication module reapplies for the digital certificate from the PKI certificate management module at regular intervals.
[0014] Furthermore, the digital certificate of the gateway module is permanent, and the digital certificate of the gateway module is written in the read-only memory of the gateway module and cannot be updated or tampered with.
[0015] Furthermore, the flash authentication module and the gateway module have a keep-alive mechanism for communication. If there is no data transmission for a period of time, the gateway module will actively close the communication channel and cut off the communication with the flash authentication module.
[0016] The present invention provides an ECU flashing method, comprising:
[0017] The flash authentication module realizes communication between the two by logging into the PKI certificate management module account;
[0018] The PKI certificate management module generates and issues the corresponding digital certificate according to the application information submitted by the flash authentication module, and the flash authentication module receives the digital certificate;
[0019] The gateway module verifies the legitimacy of the identity of the flash authentication module through the digital certificate, and determines whether the certificate is expired according to the content of the digital certificate. If it is not expired, a communication connection is established with the flash authentication module;
[0020] The flash authentication module reads the vehicle information and the ECU information to be flashed, and uploads the read information and software flash package information to the vehicle software management module. The software management module decides whether to establish a connection based on the digital certificate obtained by the flash authentication module from the PKI certificate management module:
[0021] The vehicle software management module determines in the database whether the vehicle meets the upgrade conditions based on the information uploaded by the flash authentication module. If so, it sends the authorization file to the flash authentication module.
[0022] The flash authentication module sends the software flash package and authorization file to the gateway module, and the gateway module opens the corresponding ECU communication channel according to the content of the authorization file;
[0023] The ECU receives the authorization file and software flash package, and then flashes the ECU software. After the ECU is successfully flashed, it will return an ECU flash success signal to the gateway module, and the gateway module will transfer it to the flash authentication module;
[0024] When the flash authentication module receives the flash success signal, it will send it to the vehicle software management module. The vehicle software management module will update the relevant ECU software version information of the vehicle according to the most recent software flash information.
[0025] Furthermore, the vehicle software management module determines in the database whether the vehicle meets the upgrade conditions based on the uploaded information, and if so, sends an authorization file to the flash authentication module, including:
[0026] The vehicle software management module matches the software version information that can be upgraded to the current model ECU according to the vehicle VIN, ECU part number, software and hardware number;
[0027] Compare the ECU software flashing package information uploaded by the flashing authentication module with the queried vehicle software version information. If the flashing package information is in the queried vehicle software version information, the software management platform can generate an authorization file;
[0028] The generated authorization file contains the decryption key of the software flash package and the ECU flash operation authorization switch information.
[0029] The present invention provides a storage medium, on which a system program of an ECU flashing method is stored, and the system program of the ECU flashing method is executed by a processor to implement the steps of the ECU flashing method.
[0030] Compared with the prior art, the present invention has the following advantages:
[0031] The flash authentication module and the gateway module use digital certificates to perform two-way authentication and encrypted communication, effectively preventing access to illegal devices and reducing the risk of attacks when the ECU in the vehicle is flashed and upgraded. The software flash package is separated from the decryption key, which effectively protects the security of the software flash package. The software management module can update the vehicle-related ECU software version information in a timely manner according to the latest software flash information, which is convenient for vehicle management and maintenance. Two-way authentication can prevent man-in-the-middle attacks and improve the security of data transmission. The keep-alive mechanism of the communication between the flash authentication module and the gateway module, when there is no data transmission for a period of time, the gateway module actively closes the communication channel and cuts off the communication with the flash authentication module, ensuring the stability of communication.
[0032] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 A schematic diagram of an ECU flashing system architecture provided by an embodiment of the present invention is shown;
[0035] Figure 2 A flow chart of an ECU flashing method provided by an embodiment of the present invention is shown;
[0036] Figure 3 A flow chart of step S5 of an ECU flashing method provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Figure 1 This is a schematic diagram of the architecture of an ECU flashing system provided by an embodiment of the present invention, including the following modules:
[0039] PKI (Public Key Infrastructure) certificate management module: reviews digital certificate applications submitted by the flash authentication module; generates a digital certificate with a signature based on the application information, and sends the digital certificate to the flash authentication module.
[0040] After the PKI certificate management module approves the application, it will generate a digital certificate signed by the PKI certificate management platform based on the application information uploaded by the flash authentication module. The digital certificate includes the certificate's validity period, issuing authority, and the PKI certificate management module's own public key information.
[0041] Vehicle software management module: Generates and issues authorization files and updates ECU software version information based on the flash-related information uploaded by the flash-authentication module.
[0042] In order to control the vehicle ECU version information and prevent the ECU from being maliciously flashed, this embodiment controls the flashing of the ECU through the vehicle software management module of the host manufacturer.
[0043] The vehicle software management module issues an authorization file based on the information uploaded by the flash authentication module, and the authorization file contains information on whether the vehicle software management module authorizes the vehicle to flash or not, as well as the decryption key of the software flash package. In this embodiment, the software flash package used by the flash authentication module is an encrypted file using a symmetric encryption key.
[0044] Flashing authentication module: submitting an application for a digital certificate to the PKI certificate management module; storing the digital certificate issued by the PKI certificate management module; uploading flashing-related information to the vehicle software management module; and sending the authorization file and software flashing package to the gateway module.
[0045] The flash authentication module is the part that is connected to the vehicle system through the vehicle's OBD (On-Board Diagnostics) port.
[0046] The flash authentication module submits an application for a digital certificate to the PKI certificate management module. The application information includes the device serial number of the flash authentication module, the device login account and password, operator-related information, and the public key used by the flash authentication module for external communication. The key is an asymmetric key.
[0047] The flash authentication module obtains the digital certificate issued by the PKI certificate management module. There are two ways to receive the digital certificate. One is that the flash authentication module communicates with the PKI certificate management module through the HTTPS protocol, and the digital certificate is transmitted to the flash authentication module through the established HTTPS protocol; the other way is to download the digital certificate in the PKI certificate management module and write it directly into the flash authentication module through a mobile device such as a USB flash drive.
[0048] The flash authentication module uploads the read vehicle VIN (Vehicle Identification Number), the flash ECU's hardware and software numbers, part numbers, and software flash package information to the vehicle software management module.
[0049] Gateway module: pre-sets the digital certificate issued by the PKI certificate management module; verifies the digital certificate of the flash authentication module; establishes communication with the ECU module according to the authorization file.
[0050] The gateway module is pre-set with the digital certificate issued by the PKI certificate management module by canning on the production line. The content and form of the certificate are consistent with the certificate applied for and issued by the flash authentication module. When the gateway module receives the connection request sent by the flash authentication module, it will establish encrypted communication based on digital certificate authentication with the flash authentication module by verifying the digital certificate of the flash authentication module.
[0051] In particular, the digital certificates contained in the gateway module are installed in advance by electrical testing equipment on the production line of the vehicle. These digital certificates are uniformly produced and generated by the PKI certificate management platform.
[0052] It should be noted that the digital certificate of the flash authentication module is time-limited, and the timeliness of the digital certificate is controlled by the PKI certificate management module. The PKI certificate management module will comprehensively evaluate the information uploaded by the flash authentication module and issue digital certificates with different validity periods. Therefore, the flash authentication module needs to reapply for the digital certificate from the PKI certificate management module every once in a while, and the digital certificate of the gateway module is permanent and is written in the gateway's read-only memory and cannot be updated or tampered with.
[0053] When the gateway module and the flash authentication module verify each other, they will first check the timeliness of the digital certificate obtained by the flash authentication module from the PKI certificate management platform. Once the time verification fails, the flash authentication module will not be able to establish communication with the gateway module.
[0054] After the validity check of the digital certificate is passed, the gateway module and the flash authentication module will further verify the legitimacy of each other's identity. In order to confirm that both certificates are issued by the same PKI platform, since the public key of the PKI certificate management platform is included in the issued digital certificate, the flash authentication module and the gateway module can use the public key in the digital certificate to decrypt the signature of the received digital certificate. Then, the decrypted summary is compared with the calculated hash value. If the two are the same, it means that the identity legitimacy check has passed; otherwise, the identity check fails, and the flash authentication module and the gateway module will be disconnected. The benefit of this two-way authentication is that it can prevent man-in-the-middle attacks, thereby improving the security of data transmission.
[0055] In addition, the communication between the flash authentication module and the gateway module has a keep-alive mechanism. If there is no data transmission for a period of time, the gateway module will actively close the communication channel and cut off the communication with the flash authentication module.
[0056] When the gateway module receives the authorization file and software flash package, it will parse the authorization file. If the ECU flash operation authorization switch in the authorization file is turned on, the gateway module will establish communication with the corresponding ECU based on the ECU information in the authorization file.
[0057] ECU module: receives the authorization file and software flash package transmitted by the gateway module, flashes the ECU software, and returns an ECU flash success signal to the gateway module.
[0058] The software flashing package is decrypted according to the key in the authorization file to flash the ECU software. The decrypted software flashing package contains plain text and summary. The ECU can check the integrity of data transmission by calculating the summary.
[0059] In particular, since the software flashing package is encrypted, what is received is actually the hash value generated by the software flashing package through a hash algorithm.
[0060] Figure 2 : is a flow chart of an ECU flashing method provided by an embodiment of the present invention, including:
[0061] S1: The flash authentication module realizes communication between the two by logging into the PKI certificate management module account;
[0062] S2: The PKI certificate management module generates and issues the corresponding digital certificate according to the application information submitted by the flash authentication module, and the flash authentication module receives the digital certificate;
[0063] S3: The gateway module verifies the legitimacy of the identity of the flash authentication module through the digital certificate, and determines whether the certificate is expired based on the content of the digital certificate. If it is not expired, a communication connection is established with the flash authentication module.
[0064] S4: The flash authentication module reads the vehicle information and the ECU information to be flashed, and uploads the read information and the software flash package information to the vehicle software management module. The software management module decides whether to establish a connection based on the digital certificate obtained by the flash authentication module from the PKI certificate management module:
[0065] S5: The vehicle software management module determines in the database whether the vehicle meets the upgrade conditions based on the information uploaded by the flash authentication module. If so, the authorization file is issued to the flash authentication module.
[0066] Reference Figure 3 As shown, in S5 of this embodiment, the vehicle software management module generates and issues the authorization file according to the following steps:
[0067] S51: The vehicle software management module matches the software version information that can be upgraded to the current vehicle model ECU according to the vehicle VIN, ECU part number, and software and hardware numbers.
[0068] S52: Compare the ECU software flashing package information uploaded by the flashing authentication module with the queried vehicle software version information. If the flashing package information is in the queried vehicle software version information, the software management platform can generate an authorization file.
[0069] S53: The generated authorization file includes the decryption key of the software flashing package and the ECU flashing operation authorization switch information.
[0070] S6: The flashing authentication module sends the software flashing package and the authorization file to the gateway module, and the gateway module opens the corresponding ECU communication channel according to the content of the authorization file.
[0071] S7: The ECU receives the authorization file and software flash package, and then flashes the ECU software. After the ECU is flashed successfully, it will return an ECU flash success signal to the gateway module, and the gateway module will transfer it to the flash authentication module.
[0072] S8: When the flash authentication module receives the flash success signal, it will send it to the vehicle software management module. The vehicle software management module will update the relevant ECU software version information of the vehicle according to the latest software flash information.
[0073] The present invention also includes a computer-readable storage medium, on which a data processing program is stored, and the data processing program is executed by a processor to implement an ECU flashing method.
[0074] It will be appreciated by those skilled in the art that the embodiments herein may be provided as methods, devices (equipment), or computer program products. Therefore, this article may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Including but not limited to RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer, etc. In addition, it is well known to those of ordinary skill in the art that communication media generally contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0075] This document is described with reference to flowcharts and / or block diagrams of systems, methods, apparatus (devices), and computer program products according to the embodiments of this document. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0076] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0077] The embodiments and / or implementation methods described above are only used to illustrate the preferred embodiments and / or implementation methods for realizing the technology of the present invention, and are not intended to limit the implementation methods of the technology of the present invention in any form. Any technical personnel in this field may make slight changes or modifications to other equivalent embodiments without departing from the scope of the technical means disclosed in the content of the present invention, but they should still be regarded as technologies or embodiments that are essentially the same as the present invention.
Claims
1. An ECU flashing system, characterized in that: The system includes: a PKI certificate management module, a vehicle software management module, a flash authentication module, a gateway module and an ECU module; PKI certificate management module: reviews digital certificate applications submitted by the flash authentication module; generates a digital certificate with a signature based on the application information, and sends the digital certificate to the flash authentication module; Vehicle software management module: Generates and issues authorization files and updates ECU software version information based on the flash-related information uploaded by the flash-authentication module; Flashing authentication module: submitting digital certificate application to PKI certificate management module; storing digital certificates issued by PKI certificate management module; uploading flashing related information to vehicle software management module; sending authorization files and software flashing packages to gateway module; Gateway module: pre-sets the digital certificate issued by the PKI certificate management module; verifies the digital certificate of the flash authentication module; establishes communication with the ECU module according to the authorization file; ECU module: receives the authorization file and software flash package transmitted by the gateway module, flashes the ECU software, and returns an ECU flash success signal to the gateway module.
2. The ECU flashing system according to claim 1, characterized in that: The digital certificate includes the validity period of the certificate, the issuing authority, and the public key information of the PKI certificate management module.
3. The ECU flashing system according to claim 1, characterized in that: The authorization file issued by the vehicle software management module includes information on whether the vehicle software management module authorizes the vehicle to be flashed, and a decryption key for the software flashing package.
4. The ECU flashing system according to claim 1, characterized in that: The flashing information uploaded by the flashing authentication module to the vehicle software management module includes the read vehicle VIN, the software and hardware number of the flashing ECU, the part number, and the information of the software flashing package.
5. The ECU flashing system according to claim 1, characterized in that: The digital certificate in the flash authentication module has a time limit, and the time limit of the digital certificate is controlled by the PKI certificate management module. The flash authentication module re-applies for a digital certificate from the PKI certificate management module at regular intervals.
6. The ECU flashing system according to claim 1, characterized in that: The digital certificate of the gateway module is permanent and is written in the read-only memory of the gateway module and cannot be updated or tampered with.
7. The ECU flashing system according to claim 1, characterized in that: The communication between the flash authentication module and the gateway module has a keep-alive mechanism. If there is no data transmission for a period of time, the gateway module will actively close the communication channel and cut off the communication with the flash authentication module.
8. An ECU flashing method, characterized in that: include: The flash authentication module realizes communication between the two by logging into the PKI certificate management module account; The PKI certificate management module generates and issues the corresponding digital certificate according to the application information submitted by the flash authentication module, and the flash authentication module receives the digital certificate; The gateway module verifies the legitimacy of the identity of the flash authentication module through the digital certificate, and determines whether the certificate is expired according to the content of the digital certificate. If it is not expired, a communication connection is established with the flash authentication module; The flash authentication module reads the vehicle information and the ECU information to be flashed, and uploads the read information and software flash package information to the vehicle software management module. The software management module decides whether to establish a connection based on the digital certificate obtained by the flash authentication module from the PKI certificate management module. The vehicle software management module determines in the database whether the vehicle meets the upgrade conditions based on the information uploaded by the flash authentication module. If so, it sends the authorization file to the flash authentication module. The flash authentication module sends the software flash package and authorization file to the gateway module, and the gateway module opens the corresponding ECU communication channel according to the content of the authorization file; The ECU receives the authorization file and software flash package, and then flashes the ECU software. After the ECU is successfully flashed, it will return an ECU flash success signal to the gateway module, and the gateway module will transfer it to the flash authentication module; When the flash authentication module receives the flash success signal, it will send it to the vehicle software management module. The vehicle software management module will update the relevant ECU software version information of the vehicle according to the most recent software flash information.
9. The ECU flashing method according to claim 8, characterized in that: The vehicle software management module determines in the database whether the vehicle meets the upgrade conditions based on the uploaded information, and if so, sends an authorization file to the flash authentication module, including: The vehicle software management module matches the software version information that can be upgraded to the current model ECU according to the vehicle VIN, ECU part number, software and hardware number; Compare the ECU software flashing package information uploaded by the flashing authentication module with the queried vehicle software version information. If the flashing package information is in the queried vehicle software version information, the software management platform can generate an authorization file; The generated authorization file contains the decryption key of the software flash package and the ECU flash operation authorization switch information.
10. A storage medium, characterized in that: The storage medium stores a system program of the ECU flashing method, and the system program of the ECU flashing method is executed by a processor to implement the steps of the ECU flashing method as described in any one of claims 8 to 9.
Citation Information
Cited By
An electric control system software security brush writing method and device
CN122816658A