CN112579135A - Flash control method and system for vehicle control unit and vehicle - Google Patents

Flash control method and system for vehicle control unit and vehicle Download PDF

Info

Publication number
CN112579135A
CN112579135A CN202011528647.3A CN202011528647A CN112579135A CN 112579135 A CN112579135 A CN 112579135A CN 202011528647 A CN202011528647 A CN 202011528647A CN 112579135 A CN112579135 A CN 112579135A
Authority
CN
China
Prior art keywords
program
control unit
backup
vehicle control
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011528647.3A
Other languages
Chinese (zh)
Inventor
纪小娟
孙潇
王飞飞
胡炳华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weichai Power Co Ltd
Original Assignee
Weichai Power Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weichai Power Co Ltd filed Critical Weichai Power Co Ltd
Priority to CN202011528647.3A priority Critical patent/CN112579135A/en
Publication of CN112579135A publication Critical patent/CN112579135A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1417Boot up procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention discloses a flash control method and system for a vehicle control unit and a vehicle, wherein the method comprises the following steps: writing a program to be flashed into a data storage area of an external storage module, and writing a backup program of a running program in a current vehicle control unit into an application program backup area of the external storage module; starting a program flashing flow; judging whether the program flashing process is abnormal or not; if the program flashing process is not abnormal, flashing the vehicle control unit according to the program to be flashed stored in the data storage area; and if the program flashing process is abnormal, flashing the vehicle control unit according to the backup program stored in the application program backup area. According to the invention, the external storage module is arranged to store the program to be refreshed and the backup program, and the refreshing and updating are carried out according to the backup program when the refreshing is abnormal, so that the rollback function of the remote refreshing is realized, the occupation of the memory of the control unit is reduced, and the equipment halt caused by the abnormal refreshing is avoided.

Description

Flash control method and system for vehicle control unit and vehicle
Technical Field
The invention relates to the technical field of vehicle control, in particular to a flash control method and system for a vehicle control unit and a vehicle.
Background
With the development of electronic Control technology of engines, the importance of vehicle Control units is also increasing, and typically, the vehicle Control units include an electronic Control unit (ecu) and a micro Control unit (mcu). Because the data characteristics of the programs for driving different components of the vehicle control unit are different, the program data stored in the vehicle control unit is frequently written in a brush way in the design, calibration and production processes of the electric control engine.
An Over-the-Air (OTA) remote flashing of a vehicle control unit is usually executed by a user, and in the process of program flashing, a flashing program is operated, so that an internal program of the vehicle control unit jumps to a boot loader for operation, and the flashing updating of an application program is started; if the flashing process is abnormal, the application program of the control unit is flashed, the device is halted, and the user experience is affected, so that the last correct running state needs to be returned by adopting a rollback technology.
The existing Over-the-Air (OTA) rollback technology for a vehicle control unit generally performs partition processing on a memory of the vehicle control unit, wherein one part of the memory is used for running a program, and the other part of the memory is used for storing a backup program.
Disclosure of Invention
The invention provides a flash control method for a vehicle control unit, which solves the problems that flash of the vehicle control unit occupies a large memory and is easy to generate a flash fault, and realizes a remote flash rollback function.
In a first aspect, an embodiment of the present invention provides a method for controlling a flash of a vehicle control unit, including the following steps:
writing a program to be flashed into a data storage area of an external storage module, and writing a backup program of a running program in a current vehicle control unit into an application program backup area of the external storage module;
starting a program flashing flow;
judging whether the program flashing process is abnormal or not;
if the program flashing process is not abnormal, flashing the vehicle control unit according to the program to be flashed stored in the data storage area;
and if the program flashing process is abnormal, flashing the vehicle control unit according to the backup program stored in the application program backup area.
Optionally, the writing the program to be flashed into the data storage area of the external storage module includes the following steps: acquiring to-be-flashed version information of a to-be-flashed program, wherein the to-be-flashed version information comprises a to-be-flashed program version number and a to-be-flashed program address; acquiring running version information of a running program of a current vehicle control unit, wherein the running version information comprises a running program version number and a running program address; judging whether the version information to be flashed is matched with the running version information; and if the version information to be flashed is matched with the running version information, writing the program to be flashed into the data storage area.
Optionally, the writing the backup program of the running program in the current vehicle control unit into the application program backup area of the external storage module includes the following steps: acquiring a plurality of preset checksums of a plurality of prestored backup programs in a current application program backup area, wherein the preset checksums correspond to the prestored backup programs one by one; acquiring an operation program check sum of an operation program in a current vehicle control unit; acquiring a reference pre-stored backup program of which the plurality of preset checksums are matched with an operation program in a current vehicle control unit, and acquiring a reference preset checksum corresponding to the reference pre-stored backup program; judging whether the running program checksum is consistent with the reference preset checksum or not; and if the running program checksum is consistent with the reference preset checksum, updating the reference prestored backup program according to the backup program of the running program in the current vehicle control unit.
Optionally, the flashing the vehicle control unit according to the program to be flashed stored in the data storage area includes the following steps: setting a flash state parameter in a public memory; executing the loading starting program; judging whether the flashing state parameter is equal to a preset state value or not; and if the flashing state parameter is equal to a preset state value, flashing the vehicle control unit according to the program to be flashed stored in the data storage area.
Optionally, the flashing the vehicle control unit according to the backup program stored in the application backup area includes the following steps: executing the loading starting program; judging whether the flashing state parameter is a null value; and if the flashing state parameter is a null value, flashing the vehicle control unit according to a backup program stored in the application program backup area.
Optionally, the method for controlling flashing of a vehicle control unit further comprises the steps of: acquiring a power supply state of the vehicle control unit and a communication state of the vehicle control unit and an external server; and if the power supply state and/or the communication state are abnormal, judging that the program flashing process is abnormal.
Optionally, the application program backup area comprises an engine control program backup sub-area, an engine calibration program backup sub-area and a plurality of engine offline system backup sub-areas; the running program in the current vehicle control unit comprises any one of an engine control program, an engine calibration program or an engine off-line system.
Optionally, before writing the program to be flashed into the data storage area of the external storage module, the method for controlling flashing of the vehicle control unit further includes the steps of: judging whether the program to be flashed is an illegal program to be flashed; and if the program to be flushed is an illegal program, sending an illegal embezzlement alarm.
In a second aspect, an embodiment of the present invention further provides a flash control system for a vehicle control unit, including: the system comprises an internal storage module, an external storage module, a data writing unit and a flash execution unit, wherein the internal storage module comprises a loading starting area and an application program area, and the external storage module comprises a data storage area and an application program backup area; the data writing unit is used for writing the program to be written into the data storage area of the external storage module and writing the backup program of the running program in the current vehicle control unit into the application program backup area of the external storage module; the flash execution unit is used for driving the flash flow of the loading starting area starting program, judging whether the program flash process is abnormal or not, and when the program flash process is not abnormal, performing flash on the program stored in the application program area according to the program to be flashed stored in the data storage area; and when the program flashing process is abnormal, the program stored in the application program area is flashed according to the backup program stored in the application program backup area.
In a third aspect, an embodiment of the present invention further provides a vehicle, including the above-described flash control system for a vehicle control unit.
The vehicle and the flash control system for the vehicle control unit provided by the embodiment of the invention are provided with an external storage module, a program to be flashed is stored through a data storage area of the external storage module, a backup program of a program running in the current vehicle control unit is stored through an application program backup area of the external storage module, and if the program flash process is not abnormal, the flash control system performs flash on the vehicle control unit according to the program to be flashed stored in the data storage area; if the program flashing process is abnormal, the vehicle control unit is flashed according to the backup program stored in the application program backup area, and the program data of the flashing rollback is stored through the external storage module, so that the problems that the flash of the vehicle control unit occupies a large memory and the flash fault is easy to occur are solved, the rollback function of remote flash is realized, the main chip of the control unit is not required to be subjected to partition processing, the occupation of the memory space of the control unit is reduced, and the equipment halt caused by abnormal flash is avoided.
Drawings
FIG. 1 is a flowchart of a method for controlling a flash of a vehicle control unit according to an embodiment of the present invention;
FIG. 2 is a flowchart of another flash control method for a vehicle control unit according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for controlling a vehicle control unit according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram of a flash control system for a vehicle control unit according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a vehicle according to a third embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for controlling a flash for a vehicle control unit according to an embodiment of the present invention, which is applicable to an application scenario in which the vehicle control unit performs an Over-the-Air (OTA) flash Rollback, where Over-the-Air (OTA) refers to a technology for remotely managing stored data and applications through an Air interface of mobile communication, and a Rollback (Rollback) refers to an action of recovering a program or data to a last correct state due to a program or data processing error, and the method may be implemented by a software and hardware structure configured with a specific flash Rollback program.
As shown in fig. 1, the flash control method for a vehicle control unit specifically includes the steps of:
step S1: and writing the program to be flashed into a data storage area of the external storage module, and writing the backup program of the running program in the current vehicle control unit into an application program backup area of the external storage module.
The external storage module may be a FLASH memory, which is a Non-Volatile (Non-Volatile) memory, and can hold data for a long time without current supply, and the storage characteristic of the FLASH memory is equivalent to a hard disk.
In this embodiment, the external storage module is disposed outside the main chip of the vehicle control unit, the external storage module is connected to the main chip of the vehicle control unit through the expansion interface, the main chip of the vehicle control unit is disposed with the internal storage unit, the internal storage unit may include a loading start area and an application area, the loading start area is used for storing a boot loader for updating the application area by a user, and the application area is used for storing a plurality of application data, typically, the application may be an engine management system application.
In this embodiment, the program to be flashed refers to program data sent by a server, where the program data may be used to update and flash an application program of a vehicle control unit, where the server may be a cloud server or a local server, and is not limited to this; the backup program of the running program in the current vehicle control unit refers to backup data of an application program area running at the current moment in the process of executing the flash, and the backup data can be used for driving the vehicle control unit to execute the corresponding application program. The external storage module comprises a data storage area and an application program backup area, wherein the data storage area is used for storing program data issued by the server, and the application program backup area is used for backing up backup data of the currently running application program.
Step S2: and starting a program flashing flow.
In this embodiment, a trigger command may be sent by a user or a server to trigger a program flashing process, and after the program flashing process is started, an internal program of the vehicle control unit jumps to a BootLoader of a loading start area of the vehicle control unit to run, and starts to flash and update an application program stored in an application program area of the vehicle control unit.
Step S3: and judging whether the program flashing process is abnormal or not.
If no exception occurs in the program flashing process, executing step S4; otherwise, step S5 is executed.
Step S4: and performing flash writing on the vehicle control unit according to the program to be flashed stored in the data storage area.
Step S5: and performing flash writing on the vehicle control unit according to a backup program stored in the application program backup area.
Specifically, the vehicle control unit is in communication connection with the server, after the server issues the program to be flashed, the vehicle control unit receives the program to be flashed issued by the server, an application program area of the vehicle control unit firstly judges whether the program to be flashed meets the requirements, if the program to be flashed meets the requirements, the program to be flashed is written into the data storage area, and if the program to be flashed does not meet the requirements, the subsequent steps of the flashing control method are stopped. In the process of receiving the data to be written, the application program of the application program area normally runs and writes the latest program data backup in the currently running application program area into the application program backup area of the external storage module.
After the receiving of the program to be flashed sent by the server is completed, and the program to be flashed which meets the conditions is stored in the data storage area, if a user or the server triggers a starting program flashing process, the execution program of the vehicle control unit jumps from the application program area to the loading starting area, and after the program flashing process jumps to the loading starting area, whether the program flashing process is abnormal or not is judged, if the program flashing process is not abnormal, step S4 is executed, the program to be flashed stored in the data storage area is obtained, and the application program area of the vehicle control unit is updated and flashed according to the program to be flashed; if the program flashing process is abnormal, step S5 is executed to obtain the latest backup program stored in the application program backup area, and the application program area of the vehicle control unit is flashed according to the backup program to implement data rollback in the remote flashing process.
After the program is written, the internal program of the vehicle control unit jumps to the application program area, the application program is operated according to the latest program data, and the application program in the application program area is restored to the program version which is executed last time before the current time and is operated normally.
Therefore, according to the method for controlling the flash of the vehicle control unit provided by the embodiment of the invention, the program data of the flash rollback is stored by the external storage module, so that the problems that the flash of the vehicle control unit occupies a large memory and is easy to cause a flash fault are solved, the rollback function of remote flash is realized, the main chip of the control unit is not required to be subjected to partition processing, the occupation of the memory space of the control unit is reduced, and the equipment halt caused by abnormal flash is avoided.
Fig. 2 is a flowchart of another flash control method for a vehicle control unit according to a first embodiment of the present invention.
Alternatively, as shown in fig. 2, in the step S1, writing the program to be flashed into the data storage area of the external storage module includes the following steps:
step S101: and acquiring the version information to be flashed of the program to be flashed, wherein the version information to be flashed comprises the version number of the program to be flashed and the address of the program to be flashed.
Step S102: the method comprises the steps of obtaining running version information of a running program of a current vehicle control unit, wherein the running version information comprises a running program version number and a running program address.
Step S103: and judging whether the version information to be flashed is matched with the running version information.
In this embodiment, the version number of the program to be flashed may be compared with the version number of the running program of the currently running program, and if the version number of the program to be flashed is consistent with the version number of the running program of the currently running program or the upgrade version of the version number of the running program, it is determined that the version number of the program to be flashed meets the requirement; and meanwhile, comparing the address of the program to be flashed with the address range compatible with the running program, and if the address of the program to be flashed is in the address range compatible with the running program, judging that the address of the program to be flashed is matched with the address of the running program, namely the program to be flashed meets the requirement.
Step S104: and writing the program to be flashed into the data storage area.
Step S105: sending a data mismatch response to the server.
In the present embodiment, the above steps S101 to S105 are performed in the application area of the vehicle control unit, and do not affect the normal operation of the running program in the current application area.
Specifically, after the server issues the program to be flashed, the application program area of the vehicle control unit firstly judges whether the version number of the program to be flashed meets the requirement and judges whether the address range of the program to be flashed is within the preset address range of the current vehicle control unit; and if the version number of the program to be refreshed does not meet the requirement or the address range of the program to be refreshed is not in the preset address range of the current vehicle control unit, judging that the program to be refreshed does not meet the requirement, and sending a data mismatch response to the server.
Of course, when it is determined that the program to be flashed does not meet the requirement, the subsequent steps of the flashing control method may be stopped, and no operation is performed, which is not limited.
Alternatively, as shown in fig. 2, in the step S1, the step of writing the backup program of the program currently running in the vehicle control unit into the application backup area of the external storage module includes the steps of:
step S106: and acquiring a plurality of preset checksums of a plurality of prestored backup programs in the current application program backup area, wherein the preset checksums correspond to the prestored backup programs one to one.
Wherein, the checksum: checksum, which refers to the sum used to check a group of target data items in data processing and processing procedures, each group of data may obtain a uniquely identified checksum through a certain calculation method, and when any one of the data changes, the checksum of the group of data changes.
Optionally, the application program backup area includes a plurality of application program backup sub-areas, the application program backup sub-areas include an engine control program backup sub-area, an engine calibration program backup sub-area and a plurality of engine offline system backup sub-areas, different application program backup sub-areas correspondingly store different pre-stored backup programs, and different pre-stored backup programs correspond to unique checksums, and program identification can be performed by calculating the checksums.
The engine control program backup subarea is used for storing program backup data of an engine control program, and the transmitter control program is used for controlling application program data of engine operation, monitoring and alarming; the engine calibration program backup sub-area is used for storing program backup data of an engine calibration program, the engine calibration program is used for optimizing and calibrating a vehicle control unit so as to eliminate errors and reduce engine development time, and typically, the engine calibration program comprises an INCA software program; the engine offline system backup sub-area is used for storing program backup data of an engine offline system (EOL), and the engine offline system is used for performing data management, data flashing, parameter adjustment, hardware correction and the like on a vehicle control unit, that is, a plurality of prestored backup programs comprise an engine control program, an engine calibration program and a plurality of engine offline system programs.
Step S107: and acquiring an operation program check sum of the operation program in the current vehicle control unit.
Optionally, the running program in the current vehicle control unit includes any one of an engine control program, an engine calibration program, or an engine offline system program, the running program in the current vehicle control unit is run by a corresponding application program area in the internal storage unit, if versions or types of the running programs are different, a running program checksum obtained through calculation is different, and the current running program can be identified through the running program checksum.
In this embodiment, the checksum of the running program and the program to be flashed may be calculated according to a preset rule. Illustratively, the checksum may be generated by calculating critical data and program identification codes agreed in the running program or the program to be flashed.
Step S108: and acquiring a reference pre-stored backup program matched with the current running program in the plurality of pre-stored backup programs, and acquiring a reference preset checksum corresponding to the reference pre-stored backup program.
Step S109: and judging whether the running program checksum is consistent with the reference preset checksum or not.
Specifically, a correspondence table between a prestored backup program and a preset checksum may be stored in the vehicle control unit, in the process of executing the reception of the data to be flashed, the application program of the application program area normally operates, the current running program may be any one of an engine control program, an engine calibration program or an engine off-line system, the running program checksum of the current running program is obtained through calculation, the running program checksum includes a program identification code, it may be determined by a table lookup method which one of the engine control program, the engine calibration program or the engine off-line system program matches the current running program, the prestored backup program matching the current running program is determined as a reference prestored backup program, the preset checksum corresponding to the reference prestored backup program is determined as a reference preset checksum, the running program checksum is compared with the reference preset checksum, if the running program checksum is inconsistent with the reference preset checksum, judging that the reference prestored backup program stored in the current application program backup area is not the latest program data, and executing the following step S110; if the running program checksum is consistent with the reference preset checksum, it is determined that the reference pre-stored backup program stored in the current application program backup area is the latest program data, and the following step S111 is executed.
Step S110: and updating the reference prestored backup program stored in the application program backup area according to the backup program of the running program in the current vehicle control unit.
Step S111: no operation is performed.
It should be noted that the steps S106 to S111 are executed in the application area of the vehicle control unit, and the normal operation of the running program in the current application area is not affected.
Fig. 3 is a flowchart of a further method for controlling a flash of a vehicle control unit according to an embodiment of the present invention.
Alternatively, as shown in fig. 3, in the above step S4, the flashing of the vehicle control unit according to the program to be flashed stored in the data storage area includes the steps of:
step S401: and setting a flashing state parameter in the public memory.
The public memory can be a public Random Access Memory (RAM), and can directly exchange data with the application program area, and can realize reading and writing at any time without storage after power failure.
Step S402: and executing the loading starting program.
Step S403: and judging whether the flashing state parameter is equal to a preset state value or not.
If the refresh status parameter is equal to the preset status value, go to step S404; otherwise, step S405 is executed.
Step S404: and performing flash writing on the vehicle control unit according to the program to be flashed stored in the data storage area.
Step S405: a program exception alert is sent.
Specifically, after a program flashing process is started, if no exception occurs in the program flashing process, the flashing state parameter can be set to a preset state value through a public memory, typically, the preset state value can be 1, after the program jumps to a loading starting area to execute a loading starting program, whether the flashing state parameter is equal to the preset state value or not is judged, if the flashing state parameter is equal to the preset state value, a stored program to be flashed is obtained from a data storage area, and the application program area of the vehicle control unit is refreshed and flashed; otherwise, sending program exception alarm to user or server.
Alternatively, as shown in fig. 3, in the step S5, the flashing of the vehicle control unit according to the backup program stored in the application backup area includes the following steps:
step S501: and executing the loading starting program.
Step S502: and judging whether the flash state parameter is a null value or not.
If the refresh status parameter is null, go to step S503; otherwise, step S504 is executed.
Step S503: and performing flash writing on the vehicle control unit according to a backup program stored in the application program backup area.
Step S504: a program exception alert is sent.
Specifically, after a program flashing process is started, if the program flashing process is abnormal, the public memory does not set the flashing state parameter, after the program jumps to a loading starting area to execute a loading starting program, whether the flashing state parameter is a null value or not is judged, if the flashing state parameter is the null value, a stored backup program is obtained from an application program backup area, and the application program area of the vehicle control unit is updated and flashed; otherwise, sending program exception alarm to user or server.
Optionally, the method for controlling flashing of a vehicle control unit further comprises the steps of: acquiring a power supply state of a vehicle control unit and a communication state of the vehicle control unit and an external server; and if the power supply state and/or the communication state are abnormal, judging that the program flashing process is abnormal.
Specifically, in the program running process, the application program area of the vehicle control unit may obtain the power supply state of the vehicle control unit and the communication state of the vehicle control unit and the external server at preset intervals, if the vehicle control unit is abnormally powered off or the server downloads data abnormally, it is determined that the program flashing process is abnormal, step S5 is executed, the backup program stored in the application program backup area is obtained, and the application program area of the vehicle control unit is flashed, which is beneficial to improving the system reliability and preventing the equipment from being shut down due to the flashing abnormality.
Optionally, before writing the program to be flashed into the data storage area of the external storage module, the method further includes the following steps: judging whether the program to be flashed is an illegal program to be flashed; and if the program to be flushed is an illegal program, sending an illegal embezzlement alarm.
Specifically, after the server issues the program to be flushed, the application program area of the vehicle control unit further determines whether the program to be flushed is an illegal program, and if the program to be flushed is an illegal program, an illegal embezzlement alarm is issued to the server or the user, and the step of writing the program to be flushed into the data storage area of the external storage module is not executed, which is beneficial to improving the system security.
For example, whether the program to be flashed is an illegal flash program can be determined by the checksum of the program to be flashed.
Example two
The second embodiment of the invention provides a flash control system for a vehicle control unit, and fig. 4 is a schematic structural diagram of the flash control system for the vehicle control unit provided by the second embodiment of the invention.
As shown in fig. 4, the flash control system 100 for a vehicle control unit includes: the system comprises an internal storage module 10, an external storage module 20, a data writing unit 30 and a flash execution unit 40, wherein the internal storage module 10 comprises a loading start area 101 and an application program area 102, and the external storage module 20 comprises a data storage area 201 and an application program backup area 202; the data writing unit 30 is configured to write the program to be flashed into the data storage area 201 of the external storage module 20, and write the backup program of the running program in the current vehicle control unit into the application program backup area 202 of the external storage module 20; the flash execution unit 40 is configured to drive the loading start area 101 to start a program flash process, determine whether a program flash process is abnormal, and perform flash on a program stored in the application program area 102 according to a program to be flashed stored in the data storage area 201 when the program flash process is not abnormal; and when the program flashing process is abnormal, the program stored in the application program area 102 is flashed according to the backup program stored in the application program backup area 202.
In the present embodiment, the internal memory module 10 is disposed inside a main chip of the vehicle control unit, the external memory module 20 is disposed outside the main chip of the vehicle control unit, and the external memory module 20 is connected to the main chip of the vehicle control unit through an expansion interface. Wherein, the main chip of the vehicle control unit can be an ECU.
Optionally, the application program backup area 202 includes an engine control program backup sub-area, an engine calibration program backup sub-area, and a plurality of engine offline system backup sub-areas; the operating program in the present vehicle control unit includes any one of an engine control program, an engine calibration program, or an engine off-line system.
Optionally, the data writing unit 30 includes a program analyzing unit, and the program analyzing unit is configured to obtain version information to be flashed of the program to be flashed and running version information of the running program of the current vehicle control unit, where the version information to be flashed includes a version number of the program to be flashed and an address of the program to be flashed, and the running version information includes a version number of the running program and an address of the running program; the program analyzing unit is further configured to determine whether the version information to be flashed is matched with the running version information, and write the program to be flashed into the data storage area 201 when the version information to be flashed is matched with the running version information.
Optionally, the data writing unit 30 further includes a calculating unit, a matching unit and a determining unit, where the calculating unit is configured to obtain a plurality of preset checksums of a plurality of pre-stored backup programs in the current application program backup area and an operating program checksum of an operating program in the current vehicle control unit, where the preset checksums correspond to the pre-stored backup programs one to one; the matching unit is used for acquiring a reference pre-stored backup program matched with an operation program in the current vehicle control unit from a plurality of pre-stored backup programs and acquiring a reference preset check sum corresponding to the reference pre-stored backup program; the judging unit is used for judging whether the running program checksum is consistent with the reference preset checksum or not and updating the reference prestored backup program according to the backup program of the running program in the current vehicle control unit when the running program checksum is consistent with the reference preset checksum.
Optionally, the flash control system 100 further includes a common memory, the application area 102 is further configured to set a flash status parameter through the common memory, after the loading start area 101 executes the loading start program, the application area 102 is further configured to determine whether the flash status parameter is equal to a preset status value, and when the flash status parameter is equal to the preset status value, flash the vehicle control unit according to the to-be-flashed program stored in the data storage area.
Optionally, the application area 102 is further configured to determine whether the refresh status parameter is a null value after the loading start-up area 101 executes the loading start-up program, and when the refresh status parameter is a null value, perform refresh on the vehicle control unit according to a backup program stored in the application backup area.
Optionally, the flash control system 100 further includes a detection unit, configured to obtain a power supply state of the vehicle control unit and a communication state of the vehicle control unit and the external server, and send a detection result to the flash execution unit 40, where the flash execution unit 40 is configured to determine that the program flash process is abnormal when the power supply state and/or the communication state are abnormal.
Optionally, the system 100 further includes a program detecting unit, configured to detect whether the program to be flushed is an illegal flushing program, and send a detection result to the application program area 102, where the application program area 102 is configured to issue an illegal embezzlement alarm to the server or the user when the program to be flushed is an illegal flushing program.
The flash control system for the vehicle control unit provided by the embodiment of the invention is provided with an external storage module, a program to be flashed is stored through a data storage area of the external storage module, a backup program of a program running in the current vehicle control unit is stored through an application program backup area of the external storage module, and if the program flash process is not abnormal, the flash control system flashes the vehicle control unit according to the program to be flashed stored in the data storage area; if the program flashing process is abnormal, the vehicle control unit is flashed according to a backup program stored in the application program backup area, and the program data of the flashing rollback is stored through the external storage module, so that the problems that the flash of the vehicle control unit occupies a large memory and is easy to cause a flash fault are solved, the rollback function of remote flash is realized, the main chip of the control unit is not required to be subjected to partition processing, the occupation of the memory space of the control unit is reduced, and the equipment shutdown caused by abnormal flash is avoided.
EXAMPLE III
The third embodiment of the invention provides a vehicle, and fig. 5 is a schematic structural diagram of the vehicle provided by the third embodiment of the invention.
As shown in fig. 5, the vehicle 200 includes the above-described flash control system 100 for a vehicle control unit.
The vehicle provided by the embodiment of the invention is provided with the external storage module, the program to be flashed is stored through the data storage area of the external storage module, the backup program of the running program in the current vehicle control unit is stored through the application program backup area of the external storage module, and if the program flashing process is not abnormal, the vehicle control unit is flashed according to the program to be flashed stored in the data storage area; if the program flashing process is abnormal, the vehicle control unit is flashed according to a backup program stored in the application program backup area, and the program data of the flashing rollback is stored through the external storage module, so that the problems that the flash of the vehicle control unit occupies a large memory and is easy to cause a flash fault are solved, the rollback function of remote flash is realized, the main chip of the control unit is not required to be subjected to partition processing, the occupation of the memory space of the control unit is reduced, and the equipment shutdown caused by abnormal flash is avoided.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A flash control method for a vehicle control unit, characterized by comprising the steps of:
writing a program to be flashed into a data storage area of an external storage module, and writing a backup program of a running program in a current vehicle control unit into an application program backup area of the external storage module;
starting a program flashing flow;
judging whether the program flashing process is abnormal or not;
if the program flashing process is not abnormal, flashing the vehicle control unit according to the program to be flashed stored in the data storage area;
and if the program flashing process is abnormal, flashing the vehicle control unit according to the backup program stored in the application program backup area.
2. The swipe control method for a vehicle control unit according to claim 1, wherein the writing of the program to be swiped into the data storage area of the external storage module includes the steps of:
acquiring to-be-flashed version information of a to-be-flashed program, wherein the to-be-flashed version information comprises a to-be-flashed program version number and a to-be-flashed program address;
acquiring running version information of a running program of a current vehicle control unit, wherein the running version information comprises a running program version number and a running program address;
judging whether the version information to be flashed is matched with the running version information;
and if the version information to be flashed is matched with the running version information, writing the program to be flashed into the data storage area.
3. The flash control method for a vehicle control unit according to claim 1, wherein the writing of the backup program of the program running in the current vehicle control unit into the application backup area of the external storage module comprises the steps of:
acquiring a plurality of preset checksums of a plurality of prestored backup programs in a current application program backup area, wherein the preset checksums correspond to the prestored backup programs one by one;
acquiring an operation program check sum of an operation program in a current vehicle control unit;
acquiring a reference pre-stored backup program matched with an operation program in a current vehicle control unit in the plurality of pre-stored backup programs, and acquiring a reference preset checksum corresponding to the reference pre-stored backup program;
judging whether the running program checksum is consistent with the reference preset checksum or not;
and if the running program checksum is consistent with the reference preset checksum, updating the reference prestored backup program according to the backup program of the running program in the current vehicle control unit.
4. The flash control method for a vehicle control unit according to claim 1, wherein the flash of the vehicle control unit according to the program to be flashed stored in the data storage area comprises the steps of:
setting a flash state parameter in a public memory;
executing the loading starting program;
judging whether the flashing state parameter is equal to a preset state value or not;
and if the flashing state parameter is equal to a preset state value, flashing the vehicle control unit according to the program to be flashed stored in the data storage area.
5. The method of claim 1, wherein the flashing the vehicle control unit according to the backup program stored in the application backup area comprises the steps of:
executing the loading starting program;
judging whether the flashing state parameter is a null value;
and if the flashing state parameter is a null value, flashing the vehicle control unit according to a backup program stored in the application program backup area.
6. The flash control method for a vehicle control unit according to any one of claims 1 to 5, characterized by further comprising the steps of:
acquiring a power supply state of the vehicle control unit and a communication state of the vehicle control unit and an external server;
and if the power supply state and/or the communication state are abnormal, judging that the program flashing process is abnormal.
7. The flash control method for a vehicle control unit according to any one of claims 1-5, wherein the application program backup area comprises an engine control program backup sub-area, an engine calibration program backup sub-area, and a plurality of engine offline system backup sub-areas; the running program in the current vehicle control unit comprises any one of an engine control program, an engine calibration program or an engine off-line system.
8. The swipe control method for a vehicle control unit according to any one of claims 1 to 5, further comprising, before the writing of the program to be swiped into the data storage area of the external storage module, the steps of:
judging whether the program to be flashed is an illegal program to be flashed;
and if the program to be flushed is an illegal program, sending an illegal embezzlement alarm.
9. A flash control system for a vehicle control unit, comprising: the system comprises an internal storage module, an external storage module, a data writing unit and a flash execution unit, wherein the internal storage module comprises a loading starting area and an application program area, and the external storage module comprises a data storage area and an application program backup area;
the data writing unit is used for writing the program to be written into the data storage area of the external storage module and writing the backup program of the running program in the current vehicle control unit into the application program backup area of the external storage module;
the flash execution unit is used for driving the flash flow of the loading starting area starting program, judging whether the program flash process is abnormal or not, and when the program flash process is not abnormal, performing flash on the program stored in the application program area according to the program to be flashed stored in the data storage area; and when the program flashing process is abnormal, the program stored in the application program area is flashed according to the backup program stored in the application program backup area.
10. A vehicle characterized by comprising the flash control system for a vehicle control unit of claim 9.
CN202011528647.3A 2020-12-22 2020-12-22 Flash control method and system for vehicle control unit and vehicle Pending CN112579135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011528647.3A CN112579135A (en) 2020-12-22 2020-12-22 Flash control method and system for vehicle control unit and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011528647.3A CN112579135A (en) 2020-12-22 2020-12-22 Flash control method and system for vehicle control unit and vehicle

Publications (1)

Publication Number Publication Date
CN112579135A true CN112579135A (en) 2021-03-30

Family

ID=75138928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011528647.3A Pending CN112579135A (en) 2020-12-22 2020-12-22 Flash control method and system for vehicle control unit and vehicle

Country Status (1)

Country Link
CN (1) CN112579135A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360175A (en) * 2021-08-11 2021-09-07 新石器慧通(北京)科技有限公司 Application updating method of vehicle controller and vehicle controller
CN114265382A (en) * 2021-11-12 2022-04-01 潍柴动力股份有限公司 ECU (electronic control Unit) flash fault processing method and device, electronic equipment and storage medium
WO2023066233A1 (en) * 2021-10-18 2023-04-27 中国第一汽车股份有限公司 Program flashing method and apparatus for controller, and controller and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461654A (en) * 2014-12-27 2015-03-25 西安大唐电信有限公司 OBD equipment function unit and firmware classification optional upgrading method
CN108228212A (en) * 2017-12-28 2018-06-29 宁德时代新能源科技股份有限公司 Program updating method and device
CN111198705A (en) * 2019-12-19 2020-05-26 潍柴动力股份有限公司 Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment
US20200174779A1 (en) * 2018-11-30 2020-06-04 Paccar Inc Error-resilient over-the-air software updates for vehicles
US20200183674A1 (en) * 2016-08-05 2020-06-11 Autonetworks Technologies, Ltd. On-board update device, on-board update system, and communication device update method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461654A (en) * 2014-12-27 2015-03-25 西安大唐电信有限公司 OBD equipment function unit and firmware classification optional upgrading method
US20200183674A1 (en) * 2016-08-05 2020-06-11 Autonetworks Technologies, Ltd. On-board update device, on-board update system, and communication device update method
CN108228212A (en) * 2017-12-28 2018-06-29 宁德时代新能源科技股份有限公司 Program updating method and device
US20200174779A1 (en) * 2018-11-30 2020-06-04 Paccar Inc Error-resilient over-the-air software updates for vehicles
CN111198705A (en) * 2019-12-19 2020-05-26 潍柴动力股份有限公司 Memory backup method and device for preventing ECU from being swiped up, storage medium and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360175A (en) * 2021-08-11 2021-09-07 新石器慧通(北京)科技有限公司 Application updating method of vehicle controller and vehicle controller
WO2023066233A1 (en) * 2021-10-18 2023-04-27 中国第一汽车股份有限公司 Program flashing method and apparatus for controller, and controller and storage medium
CN114265382A (en) * 2021-11-12 2022-04-01 潍柴动力股份有限公司 ECU (electronic control Unit) flash fault processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112579135A (en) Flash control method and system for vehicle control unit and vehicle
US10545469B2 (en) Systems and methods for self provisioning building equipment
US6904457B2 (en) Automatic firmware update of processor nodes
US8930931B2 (en) Information processing apparatus using updated firmware and system setting method
US6715106B1 (en) Bios corruption detection system and method
US20080046780A1 (en) Nonvolatile memory
US20150089479A1 (en) Method for pre-testing software compatibility and system thereof
US20100169709A1 (en) System Of Updating Firmware And Method Thereof, And Method Of Creating Firmware
AU2018374925B2 (en) Starting method of energy storage system and energy storage device
US20140310698A1 (en) Apparatus and method for upgrading firmware of mobile terminal
CN105930236A (en) Application program version returning method based on BMS Bootloaderupgrade
US20080028386A1 (en) Transmission apparatus and method of automatically updating software
US20080072030A1 (en) Computer System and Method for Updating Program Code
CN113064757A (en) Server firmware self-recovery system and server
CN111552592A (en) Double-backup starting method and system
CN111651304A (en) Software recovery method and device based on double-core intelligent electric meter and computer equipment
JP2009271737A (en) Information processor
CN114064084A (en) ONU upgrade management method, storage medium, electronic device, and ONU
JP2006244269A (en) Facility managing device, program update system, facility management program updating method, starting program and facility management program
CN113157303A (en) Upgrading method, embedded system, terminal and computer storage medium
CN113377425B (en) BMC firmware generation method and device, BMC starting method and device and storage medium
US11768669B2 (en) Installing application program code on a vehicle control system
CN109901117B (en) Radar restarting method and device
CN113176891A (en) Program programming method of ECU with backup function based on Bootloader
TW201604781A (en) Circuit and method for writing BIOS code into BIOS

Legal Events

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