CN114296819A - Program flashing method and device of vehicle body controller, computer equipment and medium - Google Patents

Program flashing method and device of vehicle body controller, computer equipment and medium Download PDF

Info

Publication number
CN114296819A
CN114296819A CN202111588261.6A CN202111588261A CN114296819A CN 114296819 A CN114296819 A CN 114296819A CN 202111588261 A CN202111588261 A CN 202111588261A CN 114296819 A CN114296819 A CN 114296819A
Authority
CN
China
Prior art keywords
memory area
flash memory
data file
program
check
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
CN202111588261.6A
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.)
Shanghai E Car Technology Co ltd
Original Assignee
Shanghai E Car Technology 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 Shanghai E Car Technology Co ltd filed Critical Shanghai E Car Technology Co ltd
Priority to CN202111588261.6A priority Critical patent/CN114296819A/en
Publication of CN114296819A publication Critical patent/CN114296819A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a program flashing method and device of a vehicle body controller, computer equipment and a medium. The method comprises the following steps: entering an upgrading state for executing the user program according to the mark upgrading bit; receiving a data file sent by an upper computer, and sending the data file to a ROM memory area; verifying a data file in a ROM memory area; if the verification is successful, erasing the user program in the second Flash memory area, and sending the data file from the ROM memory area to the second Flash memory area; verifying the data file in the second Flash memory area; if the verification is successful, erasing the user program in the third Flash memory area, and sending the data file from the second Flash memory area to the third Flash memory area; if the verification fails, executing a Bootloader bootstrap program to jump to execute a user program in a third Flash memory area; checking a data file in a third Flash memory area; and if the verification is successful, jumping to execute the data file in the third Flash memory area by executing the Bootloader bootstrap program to complete program Flash.

Description

Program flashing method and device of vehicle body controller, computer equipment and medium
Technical Field
The embodiment of the invention relates to the technology of a vehicle body controller, in particular to a program flashing method and device of the vehicle body controller, computer equipment and a medium.
Background
With the improvement of the electronization degree of the unmanned logistics vehicle, bugs inevitably exist for application programs of different controllers in the vehicle, and generally, the application program software codes in the vehicle body controller are updated through an automobile CAN network by using Bootloader software.
In the prior art, the risk of brushing bricks by a controller exists due to accidental interruption of a vehicle body controller in the process of updating an application program by the Bootloader.
Disclosure of Invention
The invention provides a program flashing method, a device, computer equipment and a medium of a vehicle body controller, which can ensure the integrity of an original user program when any one time of verification fails in the program flashing process and avoid the 'brick-changing' dead halt of the controller caused by the accidental interruption of the flashing in the program flashing process.
In a first aspect, an embodiment of the present invention provides a program flashing method for a vehicle body controller; the vehicle body controller comprises a ROM memory area and a Flash memory area; the Flash memory area comprises a first Flash memory area, a second Flash memory area, a third Flash memory area and a fourth Flash memory area; solidifying a Bootloader bootstrap program in the first Flash memory area; storing a user program in the second Flash memory area; the third Flash memory area stores the user program; the fourth Flash memory area stores a flag upgrade bit; the program flashing method comprises the following steps:
entering an upgrading state for executing the user program according to the mark upgrading bit;
receiving a data file sent by an upper computer, and sending the data file to the ROM memory area;
carrying out one-time security check on the data file in the ROM memory area;
if the one-time safety verification is successful, erasing the user program in the second Flash memory area according to an erasing instruction of the upper computer, and sending the data file from the ROM memory area to the second Flash memory;
performing secondary safety check on the data file in the second Flash memory;
if the second safety verification is successful, erasing the user program in the third Flash memory area according to an erasing instruction of the upper computer, and sending the data file from the second Flash memory area to the third Flash memory area; if the secondary security check fails, executing the Bootloader bootstrap program to jump to executing the user program in the third Flash memory area;
carrying out security verification on the data file in the third Flash memory area for three times;
and if the third security check is successful, executing the Bootloader bootstrap program to jump to execute the data file in the third Flash memory area to finish program Flash.
Optionally, the fourth Flash memory area further stores a flag status bit; after the data file in the ROM memory area is subjected to security check for one time, the method further comprises the following steps:
if the one-time security check fails, judging the flag status bit;
if the flag state bit is a first flag state bit, executing the Bootloader bootstrap program to jump to executing the user program in the second Flash memory area;
and if the flag state bit is a second flag state bit, executing the Bootloader bootstrap program to jump to executing the user program in the third Flash memory area.
Optionally, after performing security check on the data file in the third Flash memory area for three times, the method further includes:
and if the third security check fails, executing the Bootloader bootstrap program to jump to executing the user program in the second Flash memory area.
Optionally, performing security check on the data file in the ROM memory area for one time includes:
receiving a check code obtained by the upper computer performing CRC-16 check on the data file;
performing the CRC-16 check on the data file received by the ROM memory area to obtain a first check result;
and carrying out one-time safety check on the data file in the ROM memory area according to the first check result and the check code.
Optionally, performing secondary security check on the data file in the second Flash memory area, including:
performing the CRC-16 check on the data file in the second Flash memory area to obtain a second check result;
performing secondary safety check on the data file in the second Flash memory area according to the first check result and the second check result;
and carrying out security check on the data file in the third Flash memory area for three times, wherein the security check comprises the following steps:
performing the CRC-16 check on the data file in the third Flash memory area to obtain a third check result;
and carrying out security check on the data file in the third Flash memory area for three times according to the second check result and the third check result.
Optionally, before receiving the data file sent by the upper computer and sending the data file to the ROM memory area, the method further includes:
and sending different identifications to the upper computer through a CAN network.
Optionally, after executing the Bootloader bootstrap program and jumping to execute a data file in a third Flash memory area to complete program Flash, the method further includes:
and outputting a mark upgrading bit and storing the mark upgrading bit into the fourth Flash memory area.
In a second aspect, an embodiment of the present invention further provides a program flashing module of a vehicle body controller, where the program flashing module includes:
the upgrading state entering module is used for entering the upgrading state of executing the user program according to the mark upgrading bit;
the first data file sending module is used for receiving a data file sent by an upper computer and sending the data file to a ROM memory area;
the primary security check module is used for performing primary security check on the data file in the ROM memory area;
the second data file sending module is used for erasing the user program in the second Flash memory area according to the erasing instruction of the upper computer when the one-time safety verification is successful, and sending the data file from the ROM memory area to the second Flash memory area;
the secondary security check module is used for carrying out secondary security check on the data file in the second Flash memory area;
the data file third sending module is used for erasing the user program in a third Flash memory area according to an erasing instruction of the upper computer when the secondary security verification is successful, and sending the data file from the second Flash memory area to the third Flash memory area;
the skip execution module is used for skipping to execute the user program in the third Flash memory area by executing a Bootloader bootstrap program when the secondary security check fails;
the secondary security check module is used for carrying out tertiary security check on the data file in the third Flash memory area;
and the program flashing module is used for jumping to execute the data file in the third Flash memory area by executing the Bootloader bootstrap program to finish program flashing when the third security verification is successful.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the one or more processors to implement the program flashing method for the vehicle body controller according to any one of the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a program flashing method for a vehicle body controller according to any one of the first aspect.
According to the embodiment of the invention, the upgrading state of the user program is executed by entering the upgrading state according to the mark upgrading bit; receiving a data file sent by an upper computer, and sending the data file to a ROM memory area; carrying out one-time security check on a data file in a ROM memory area; if the first safety verification is successful, erasing the user program in the second Flash memory area according to an erasing instruction of the upper computer, and sending the data file from the ROM memory area to the second Flash memory area; performing secondary safety check on the data file in the second Flash memory area; if the second safety verification is successful, erasing the user program in the third Flash memory area according to the erasing instruction of the upper computer, and sending the data file from the second Flash memory area to the third Flash memory area; if the secondary security check fails, executing a Bootloader bootstrap program to jump to execute a user program in a third Flash memory area; carrying out security check on the data file in the third Flash memory area for three times; if the third safety verification is successful, the Bootloader bootstrap program is executed to jump to the data file in the third Flash memory area to complete program flashing, so that the completeness of the original user program can be ensured if the second verification fails in the process of completing program flashing through the ROM memory area, the second Flash memory area and the third Flash memory area, and the phenomenon that the controller is halted due to 'brick change' caused by accidental interruption of flashing in the process of program flashing is avoided.
Drawings
Fig. 1 is a flowchart of a program flashing method of a vehicle body controller according to an embodiment of the present invention;
fig. 2 is a flowchart of another program flashing method of a vehicle body controller according to an embodiment of the present invention;
fig. 3 is a block diagram of a program flashing device of a vehicle body controller according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to an 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.
Fig. 1 is a flowchart of a program flashing method of a vehicle body controller according to an embodiment of the present invention, where the embodiment is applicable to a situation of the program flashing of the vehicle body controller, and the method may be executed by a program flashing device of the vehicle body controller, as shown in fig. 1, the program flashing method specifically includes the following steps:
and S110, entering an upgrading state for executing the user program according to the mark upgrading bit.
The vehicle body controller comprises a ROM memory area and a Flash memory area; the Flash memory area comprises a first Flash memory area, a second Flash memory area, a third Flash memory area and a fourth Flash memory area; a Bootloader bootstrap program is solidified in a first Flash memory area; storing a user program in a second Flash memory area; storing a user program in a third Flash memory area; the fourth Flash memory area stores the flag upgrade bit; if the flag upgrade bit is not empty, the user program has completed the update work; if the mark upgrading bit is empty, the user program does not finish the updating work, and the user program is in a state to be upgraded; in this embodiment, when the flag upgrade bit is not empty, the Bootloader directs the program to enter an upgrade state for executing the user program. Meanwhile, the Bootloader bootstrap program completes the handshake action with the upper computer through the CAN communication network.
And S120, receiving the data file sent by the upper computer, and sending the data file to a ROM memory area.
When the Bootloader bootstrap program finishes a handshake action with the upper computer through the CAN communication network, the Bootloader bootstrap program enters a data receiving mode, receives a data file sent by the upper computer, and temporarily caches the data file in a ROM memory area.
S130, carrying out primary security check on the data file in the ROM memory area.
The upper computer performs CRC-16 verification on the data file to obtain a check code, the check code is sent to the automobile body controller, a Bootloader bootstrap program in the automobile body controller receives the check code sent by the upper computer, and meanwhile CRC-16 verification is performed on the data file received by the ROM memory area to obtain a first verification result; and then, when the first verification result is consistent with the verification code, completing the security verification of the data file in the ROM memory area.
And S140, if the security verification is successful, erasing the user program in the second Flash memory area according to the erasing instruction of the upper computer, and sending the data file from the ROM memory area to the second Flash memory area.
When the first check result is consistent with the check code, the data file sent to the ROM memory area by the upper computer is not lost, and the safety check is successful once, so that the integrity of the data file sent to the ROM memory area by the upper computer is ensured; and then the Bootloader bootstrap program returns to the upper computer, the upper computer sends an erasing command, the Bootloader bootstrap program erases the user program in the second Flash memory area according to the erasing command of the upper computer, and the data file is sent to the second Flash memory area from the ROM memory area.
S150, performing secondary safety check on the data file in the second Flash memory area.
In order to ensure the integrity of the data file sent to the second Flash memory area, the Bootloader boot lead program performs secondary security check on the data file in the second Flash memory area; specifically, performing CRC-16 check on the data file in the second Flash memory area to obtain a second check result; and then comparing the second check result with a first check result obtained by performing CRC-16 check on the data file received by the ROM memory area so as to complete secondary security check on the data file in the second Flash memory area.
And S160, if the second safety verification is successful, erasing the user program in the third Flash area according to the erasing instruction of the upper computer, and sending the data file from the second Flash area to the third Flash memory.
When the second check result is consistent with the first check result obtained by performing CRC-16 check on the data file received by the ROM memory area, the secondary safety check is successful, and the integrity of the data file sent to the second Flash area by the ROM memory area is ensured; and then the Bootloader bootstrap program returns to the upper computer, the upper computer sends an erasing command again, the Bootloader bootstrap program erases the user program in the third Flash memory area according to the erasing command of the upper computer, and the data file is sent from the second Flash memory area to the third Flash memory area.
And S170, if the secondary security check fails, executing a Bootloader bootstrap program to jump to execute a user program in a third Flash memory area.
When the second check result is inconsistent with a first check result obtained by performing CRC-16 check on the data file received by the ROM memory area, the secondary security check fails, the data file sent by the ROM memory area to the second Flash memory area is incomplete, and the user program fails to be upgraded; because the user program is reserved in the third Flash memory area, at this time, the execution of the Bootloader bootstrap program can jump to the execution of the user program in the third Flash memory area, and the 'brick-changing' crash of the controller caused by the unexpected interruption of the Flash in the program Flash process is avoided.
And S180, carrying out security check on the data file in the third Flash memory area for three times.
When the third safety check is successful and the data file is sent from the second Flash memory area to the third Flash memory area, carrying out the third safety check on the data file in the third Flash memory area in order to ensure the integrity of the data file sent to the third Flash memory area, and specifically, carrying out CRC-16 check on the data file in the third Flash memory area to obtain a third check result; and comparing the third check result with a second check result obtained by performing CRC-16 check on the data file received by the second Flash memory area to complete the security check on the data file in the third Flash memory area for three times.
And S190, if the security verification is successful for the third time, jumping to execute the data file in the third Flash memory area by the Bootloader bootstrap program to finish the program Flash.
When the third check result is consistent with a second check result obtained by performing CRC-16 check on the data file received by the second Flash memory area, the third safety check is successful, and the execution of the Bootloader bootstrap program jumps to the execution of the data file in the third Flash memory area to complete the program Flash. Therefore, the program is written and rewritten through the ROM memory area, the second Flash memory area and the third Flash memory area; in the process of completing program flashing, if the secondary verification fails, the integrity of the original user program can be ensured, and the phenomenon that the controller crashes due to the fact that flashing is interrupted accidentally in the program flashing process is avoided.
Based on the foregoing embodiment, further optimization is performed, and fig. 2 is a flowchart of another program flashing method for a vehicle body controller according to an embodiment of the present invention, where as shown in fig. 2, the program flashing method includes the following steps:
and S210, entering an upgrading state for executing the user program according to the mark upgrading bit.
And S220, sending different identifications to the upper computer through the CAN network.
After the Bootloader bootstrap program is controlled to enter a user program upgrading state, the Bootloader bootstrap program sends different identifications through a CAN communication network, and the upper computer sends different data files to different vehicle body controllers according to the different identifications; the Bootloader bootstrap program in the subsequent vehicle body controller completes the upgrading process of skipping to execute the user program in the third Flash memory area by the Bootloader bootstrap program according to the received data file, so that the program Flash is performed on different vehicle body controllers through the Bootloader bootstrap program, the Flash methods for different vehicle body controllers are unified, the one-key Flash of the user programs for different vehicle body controllers is realized, the problem that different Flash methods are adopted for the program Flash of different vehicle body controllers in the prior art is solved,
and S230, receiving the data file sent by the upper computer, and sending the data file to a ROM memory area.
S240, carrying out one-time security check on the data file in the ROM memory area.
And S250, if the security verification is successful, erasing the user program in the second Flash memory area according to the erasing instruction of the upper computer, and sending the data file from the ROM memory area to the second Flash memory area.
And S260, if the one-time security check fails, judging the flag state bit.
When the first check result is inconsistent with the check code, the data file sent to the ROM memory area by the upper computer is lost, the one-time safety check fails, and the subsequent user program upgrading fails; at this time, the flag status bits are determined, and it should be noted here that the flag status bits include a first flag status bit and a second flag status bit; the first flag status bit represents that the user program in the second Flash memory area is executed last time; the second flag status bit represents that the user program in the third Flash memory area was executed last time.
And S261, if the flag state bit is the first flag state bit, executing a Bootloader bootstrap program to jump to execute a user program in the second Flash memory area.
When one-time security check fails, the inquiry flag state bit is the first flag state bit, and the current Bootloader bootstrap program is executed to jump to execute the user program in the second Flash memory area, so that the 'brick change' crash of the controller caused by accidental interruption of the Flash in the program Flash process is avoided.
And S262, if the flag state bit is the second flag state bit, jumping to execute the user program in the third Flash memory area by executing the Bootloader bootstrap program.
When the first security check fails, the query flag status bit is the second flag status bit, the current Bootloader bootstrap program is executed to jump to execute the user program in the third Flash memory area, and the phenomenon that the controller is 'changed into bricks' and crashed due to accidental interruption of the Flash in the program Flash process is avoided.
And S270, performing secondary safety check on the data file in the second Flash memory.
And S280, if the second safety verification is successful, erasing the user program in the third Flash memory area according to the erasing instruction of the upper computer, and sending the data file from the second Flash memory area to the third Flash memory area.
And S290, if the secondary security check fails, executing a Bootloader bootstrap program to jump to execute a user program in a third Flash memory area.
S300, carrying out security verification on the data file in the third Flash memory area for three times.
And S310, if the security verification is successful for three times, jumping to execute a data file in a third Flash memory area by executing a Bootloader bootstrap program to finish program flashing.
And S320, if the security verification fails for three times, jumping to execute the user program in the second Flash memory area by executing the Bootloader bootstrap program.
When the third check result is inconsistent with a second check result obtained by performing CRC-16 check on the data file received by the second Flash memory area, the third security check fails, the data file sent from the second Flash memory area to the third Flash memory area is incomplete, and the user program fails to be upgraded; because the user program is reserved in the second Flash memory area and the user program in the third Flash memory area is erased, the execution of the Bootloader bootstrap program jumps to the execution of the user program in the second Flash memory area, and the 'brick-changing' dead halt of the controller caused by the accidental interruption of the Flash in the program Flash process is avoided.
And S330, outputting the mark upgrading bit and storing the mark upgrading bit into a fourth Flash memory area.
After the first safety check, the second safety check and the third safety check are passed, the program completes the Flash, outputs the mark upgrade bit and stores the mark upgrade bit in the fourth Flash memory area. According to the scheme, on the basis of the embodiment, different identifications are sent to the upper computer through the Bootloader bootstrap program, the upper computer sends different data files to complete a one-key program flashing process to different automobile body controllers subsequently, complex flashing processes are reduced, and the program updating efficiency is improved to a great extent; meanwhile, the data file completes primary safety check, secondary safety check and tertiary safety check in the transmission process; and the completeness of the original user program can be ensured in one-time safety check and three-time safety check failure, and the 'brick-changing' crash of the controller caused by accidental interruption of the flash is avoided.
The embodiment of the invention also provides a program flashing device of the vehicle body controller, and the program flashing device of the vehicle body controller can execute the program flashing method of the vehicle body controller provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. Fig. 3 is a block diagram of a structure of a program flashing device of a vehicle body controller according to an embodiment of the present invention, and as shown in fig. 3, the program flashing device of the vehicle body controller includes:
an upgrade state entering module 10, configured to enter an upgrade state for executing a user program according to the flag upgrade bit;
the data file first sending module 20 is configured to receive a data file sent by an upper computer and send the data file to a ROM memory area;
a primary security check module 30, configured to perform primary security check on a data file in the ROM memory area;
the second data file sending module 40 is used for erasing the user program in the second Flash memory area according to the erasing instruction of the upper computer when the security verification is successful, and sending the data file from the ROM memory area to the second Flash memory area;
the secondary security check module 50 is used for performing secondary security check on the data file in the second Flash memory area;
the third data file sending module 60 is configured to erase the user program in the third Flash memory area according to an erase instruction of the upper computer when the second security check is successful, and send the data file from the second Flash memory area to the third Flash memory area;
the skip execution module 70 is used for skipping to execute the user program in the third Flash memory area by executing the Bootloader bootstrap program when the secondary security verification is unsuccessful;
the secondary security check module 80 is used for carrying out tertiary security check on the data file in the third Flash memory;
and the program flashing module 90 is used for jumping to execute the data file in the third Flash memory by executing the Bootloader bootstrap program to complete program flashing when the third security check is successful.
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and as shown in fig. 4, the computer device includes a processor 70, a memory 71, an input device 72, and an output device 73; the number of processors 70 in the device may be one or more, and one processor 70 is taken as an example in fig. 3; the processor 70, the memory 71, the input device 72 and the output device 73 of the apparatus may be connected by a bus or other means, as exemplified by the bus connection in fig. 4.
The memory 71 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the program flashing method of the vehicle body controller in the embodiment of the present invention. The processor 70 executes various functional applications of the device and data processing by running software programs, instructions, and modules stored in the memory 71, that is, implements the above-described program flashing method of the vehicle body controller.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 71 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 71 may further include memory located remotely from the processor 70, which may be connected to the device/terminal/server via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 72 may be used to receive entered numeric or character information and to generate key signal inputs relating to user settings and function controls of the apparatus. The output device 73 may include a display device such as a display screen.
Embodiments of the present invention also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for program flashing of a vehicle body controller, the method including:
entering an upgrading state for executing the user program according to the mark upgrading bit;
receiving a data file sent by an upper computer, and sending the data file to the ROM memory area;
carrying out one-time security check on the data file in the ROM memory area;
if the one-time safety verification is successful, erasing the user program in the second Flash memory area according to an erasing instruction of the upper computer, and sending the data file from the ROM memory area to the second Flash memory area;
performing secondary safety check on the data file in the second Flash memory;
if the second safety verification is successful, erasing the user program in the third Flash memory area according to an erasing instruction of the upper computer, and sending the data file from the second Flash memory area to the third Flash memory area; if the secondary security check is unsuccessful, the Bootloader bootstrap program jumps to execute the user program in the third Flash memory area;
carrying out security verification on the data file in the third Flash memory area for three times;
and if the third security check is successful, executing a Bootloader bootstrap program to jump to execute a data file in a third Flash memory area to finish program Flash.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in a program flashing method of a vehicle body controller provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above search apparatus, each included unit and module are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
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 program flashing method of a vehicle body controller is characterized in that the vehicle body controller comprises a ROM memory area and a Flash memory area; the Flash memory area comprises a first Flash memory area, a second Flash memory area, a third Flash memory area and a fourth Flash memory area; solidifying a Bootloader bootstrap program in the first Flash memory area; storing a user program in the second Flash memory area; the third Flash memory area stores the user program; the fourth Flash memory area stores a flag upgrade bit; the program flashing method comprises the following steps:
entering an upgrading state for executing the user program according to the mark upgrading bit;
receiving a data file sent by an upper computer, and sending the data file to the ROM memory area;
carrying out one-time security check on the data file in the ROM memory area;
if the one-time safety verification is successful, erasing the user program in the second Flash memory area according to an erasing instruction of the upper computer, and sending the data file from the ROM memory area to the second Flash memory;
performing secondary safety check on the data file in the second Flash memory;
if the second safety verification is successful, erasing the user program in the third Flash memory area according to an erasing instruction of the upper computer, and sending the data file from the second Flash memory area to the third Flash memory area; if the secondary security check fails, executing the Bootloader bootstrap program to jump to executing the user program in the third Flash memory area;
carrying out security verification on the data file in the third Flash memory area for three times;
and if the third security check is successful, executing the Bootloader bootstrap program to jump to execute the data file in the third Flash memory area to finish program Flash.
2. The program flashing method of the vehicle body controller according to claim 1, wherein the fourth Flash memory area further stores a flag status bit; after the data file in the ROM memory area is subjected to security check for one time, the method further comprises the following steps:
if the one-time security check fails, judging the flag status bit;
if the flag state bit is a first flag state bit, executing the Bootloader bootstrap program to jump to executing the user program in the second Flash memory area;
and if the flag state bit is a second flag state bit, executing the Bootloader bootstrap program to jump to executing the user program in the third Flash memory area.
3. The program flashing method of the vehicle body controller according to claim 1, wherein after performing security check on the data file in the third Flash memory area for three times, further comprising:
and if the third security check fails, executing the Bootloader bootstrap program to jump to executing the user program in the second Flash memory area.
4. The program flashing method of the vehicle body controller according to claim 1, wherein the performing of the security check on the data file of the ROM memory area comprises:
receiving a check code obtained by the upper computer performing CRC-16 check on the data file;
performing the CRC-16 check on the data file received by the ROM memory area to obtain a first check result;
and carrying out one-time safety check on the data file in the ROM memory area according to the first check result and the check code.
5. The program flashing method of the vehicle body controller according to claim 4, wherein performing a secondary security check on the data file in the second Flash memory area comprises:
performing the CRC-16 check on the data file in the second Flash memory area to obtain a second check result;
performing secondary safety check on the data file in the second Flash memory area according to the first check result and the second check result;
and carrying out security check on the data file in the third Flash memory area for three times, wherein the security check comprises the following steps:
performing the CRC-16 check on the data file in the third Flash memory area to obtain a third check result;
and carrying out security check on the data file in the third Flash memory area for three times according to the second check result and the third check result.
6. The program flashing method of the vehicle body controller according to claim 1, wherein before receiving the data file transmitted from the upper computer and transmitting the data file to the ROM memory area, further comprising:
and sending different identifications to the upper computer through a CAN network.
7. The program flashing method of the vehicle body controller according to claim 1, wherein after executing the Bootloader boot program to jump to executing the data file in the third Flash memory area to complete the program flashing, the method further comprises:
and outputting a mark upgrading bit and storing the mark upgrading bit into the fourth Flash memory area.
8. A program flashing module of a vehicle body controller, comprising:
the upgrading state entering module is used for entering the upgrading state of executing the user program according to the mark upgrading bit;
the first data file sending module is used for receiving a data file sent by an upper computer and sending the data file to a ROM memory area;
the primary security check module is used for performing primary security check on the data file in the ROM memory area;
the second data file sending module is used for erasing the user program in the second Flash memory area according to the erasing instruction of the upper computer when the one-time safety verification is successful, and sending the data file from the ROM memory area to the second Flash memory area;
the secondary security check module is used for carrying out secondary security check on the data file in the second Flash memory area;
the data file third sending module is used for erasing the user program in a third Flash memory area according to an erasing instruction of the upper computer when the secondary security verification is successful, and sending the data file from the second Flash memory area to the third Flash memory area;
the skip execution module is used for skipping to execute the user program in the third Flash memory area by executing a Bootloader bootstrap program when the secondary security check fails;
the secondary security check module is used for carrying out tertiary security check on the data file in the third Flash memory area;
and the program flashing module is used for jumping to execute the data file in the third Flash memory area by executing the Bootloader bootstrap program to finish program flashing when the third security verification is successful.
9. A computer device, characterized in that the computer device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a program flashing method for a vehicle body controller as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium on which a computer program is stored, characterized in that the program, when executed by a processor, implements a program flashing method of a vehicle body controller according to any one of claims 1-7.
CN202111588261.6A 2021-12-23 2021-12-23 Program flashing method and device of vehicle body controller, computer equipment and medium Pending CN114296819A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111588261.6A CN114296819A (en) 2021-12-23 2021-12-23 Program flashing method and device of vehicle body controller, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111588261.6A CN114296819A (en) 2021-12-23 2021-12-23 Program flashing method and device of vehicle body controller, computer equipment and medium

Publications (1)

Publication Number Publication Date
CN114296819A true CN114296819A (en) 2022-04-08

Family

ID=80968638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111588261.6A Pending CN114296819A (en) 2021-12-23 2021-12-23 Program flashing method and device of vehicle body controller, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN114296819A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101826027A (en) * 2010-05-28 2010-09-08 深圳市融创天下科技发展有限公司 Embedded system and updating method thereof
CN103092647A (en) * 2012-12-29 2013-05-08 聚光科技(杭州)股份有限公司 Online upgrade method of embedded system
CN107402847A (en) * 2017-07-28 2017-11-28 安徽江淮汽车集团股份有限公司 A kind of remote upgrade method and system of entire car controller software
CN108376077A (en) * 2018-02-11 2018-08-07 广东美的厨房电器制造有限公司 The upgrade method and device of control unit
CN111857788A (en) * 2020-07-23 2020-10-30 天津易鼎丰动力科技有限公司 Method for reading back historical version program of whole vehicle controller
CN112506535A (en) * 2020-05-22 2021-03-16 上海擎度汽车科技有限公司 Method for updating Bootloader software by automobile ECU controller
WO2021115477A1 (en) * 2019-12-13 2021-06-17 中兴通讯股份有限公司 Program upgrade method and apparatus, electronic device and storage medium
CN113467813A (en) * 2021-05-19 2021-10-01 深圳拓邦股份有限公司 Controller online upgrading method and device, electronic equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101826027A (en) * 2010-05-28 2010-09-08 深圳市融创天下科技发展有限公司 Embedded system and updating method thereof
CN103092647A (en) * 2012-12-29 2013-05-08 聚光科技(杭州)股份有限公司 Online upgrade method of embedded system
CN107402847A (en) * 2017-07-28 2017-11-28 安徽江淮汽车集团股份有限公司 A kind of remote upgrade method and system of entire car controller software
CN108376077A (en) * 2018-02-11 2018-08-07 广东美的厨房电器制造有限公司 The upgrade method and device of control unit
WO2021115477A1 (en) * 2019-12-13 2021-06-17 中兴通讯股份有限公司 Program upgrade method and apparatus, electronic device and storage medium
CN112506535A (en) * 2020-05-22 2021-03-16 上海擎度汽车科技有限公司 Method for updating Bootloader software by automobile ECU controller
CN111857788A (en) * 2020-07-23 2020-10-30 天津易鼎丰动力科技有限公司 Method for reading back historical version program of whole vehicle controller
CN113467813A (en) * 2021-05-19 2021-10-01 深圳拓邦股份有限公司 Controller online upgrading method and device, electronic equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
刘军等: "《"十三五"江苏省高等学校重点教材 汽车嵌入式系统设计》", 31 July 2021, 北京:机械工业出版社, pages: 55 - 57 *
林海;赵凯;张淑舫;刘志兵;: "基于LPC1700系列微控制器的一种高可靠性软件升级方法", 新技术新工艺, no. 06, 25 June 2020 (2020-06-25), pages 72 - 75 *
苏诗荐;章杰;程树英;戴曼娜;林汉伟;: "一种基于Web的远程在线升级技术的实现", 有线电视技术, no. 01, 15 January 2015 (2015-01-15), pages 72 - 74 *

Similar Documents

Publication Publication Date Title
CN110347412B (en) Electronic control unit firmware upgrade management method, device, equipment and storage medium
CN106569847B (en) Method for vehicle-mounted system to realize IAP remote upgrade based on mobile network
CN109933348B (en) Method and device for updating Bootloader in electronic control unit
CN108958787B (en) Block chain system upgrading method, device, equipment and storage medium
CN109358887B (en) On-line upgrading method, device and system for single chip microcomputer program
CN104102518B (en) double-CPU system and program upgrading method thereof
CN107193593B (en) Upgrading method of upgradable file, set top box and storage medium
CN110928567A (en) Vehicle system upgrading method, terminal device and computer-readable storage medium
CN111796848A (en) Bootloader software updating method and device, embedded controller and storage medium
CN110196727A (en) Electric vehicle Oftware updating method, device, handheld device and storage medium
CN111736873B (en) Program updating method, device, equipment and storage medium of electronic control unit
CN112000358A (en) Charging pile upgrading method and intelligent charging pile
CN105320529A (en) Boot method and device based on NAND-Flash double-boot guidance
CN113127285A (en) Error data debugging method, device, chip and computer equipment
CN114840235A (en) Vehicle controller firmware upgrading method and system, vehicle controller and storage medium
CN108845823B (en) Software online upgrading method based on F2812 chip
CN112230848B (en) NVM automatic configuration method, device and equipment
CN114296819A (en) Program flashing method and device of vehicle body controller, computer equipment and medium
CN114385202A (en) Server, software update system, distribution method, and non-temporary storage medium
CN113220319A (en) Data updating method and device and vehicle
CN113608769B (en) Method for parallel processing and self-upgrading based on multiple single-chip microcomputer
CN114996717A (en) Upgrade program design method for preventing error erasure
CN111221556B (en) Remote upgrade RSU mirror image method and system
JP2018180869A (en) Rewrite system, rewrite device and computer
JP2018200599A (en) Rewriting system, rewriting device, and computer

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