CN115268960A - Safe upgrading method and system for automobile instrument software - Google Patents
Safe upgrading method and system for automobile instrument software Download PDFInfo
- Publication number
- CN115268960A CN115268960A CN202210715597.2A CN202210715597A CN115268960A CN 115268960 A CN115268960 A CN 115268960A CN 202210715597 A CN202210715597 A CN 202210715597A CN 115268960 A CN115268960 A CN 115268960A
- Authority
- CN
- China
- Prior art keywords
- upgrade file
- file
- upgrading
- upgrade
- sdram
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Abstract
The invention relates to the technical field of automobile instrument software, in particular to a safe upgrading method and system of automobile instrument software. The method solves the problems that the capacity of an internal RAM in the existing MCU is limited, the data of the whole upgrade file cannot be temporarily stored through the RAM in the upgrade process, the received data packet can be directly written into an external flash, and the integrity check and other operations on the data of the whole upgrade file are not carried out, so that the normal upgrade process of the automobile instrument cannot be ensured.
Description
Technical Field
The invention relates to the technical field of automobile instrument software, in particular to a safe upgrading method and system of automobile instrument software.
Background
At present, the technical specifications of domestic and foreign automobile factories do not clearly provide a safety upgrading function, and abnormal upgrading of instrument software causes phenomena such as abnormal instrument function, black screen, screen splash and the like, so that the judgment of driving information and states by drivers is directly influenced; in more serious conditions, the abnormal instruments can directly influence the operation of other ECUs of the whole vehicle, thereby causing traffic accidents and threatening property and personal safety.
The current method for judging whether the upgrading of the automobile instrument is normal mainly comprises the following steps: 1) Whether a progress bar displays the upgrading progress or not; 2) Whether a prompt for displaying successful upgrade exists; 3) Reading the version number of the software for judgment; 4) Whether the screen has the phenomenon of screen blooming or not. The judgment methods are judged by vision subjectively, and no strict method and flow are provided to ensure the normal upgrading. In the existing MCU, the capacity of the internal RAM is limited, the data of the whole upgrading file cannot be temporarily stored through the RAM in the upgrading process, the received data packet can be directly written into the external flash, and the operations such as integrity check and the like are not performed on the data of the whole upgrading file.
Therefore, a safe upgrading method and system for automobile instrument software are produced.
Disclosure of Invention
The invention provides a safe upgrading method and system for automobile instrument software, which mainly solve the problems that the capacity of an internal RAM in the existing MCU is limited, data of a whole upgrading file cannot be temporarily stored through the RAM in the upgrading process, a received data packet can be directly written into an external flash, and the integrity of the data of the whole upgrading file is not checked and the like, so that the normal upgrading process of an automobile instrument cannot be ensured.
The invention provides a safe upgrading method of automobile instrument software, which comprises the following steps:
s1, powering on a storage device with an upgrade file;
s2, detecting the size of the upgrade file in the storage device, and reading configuration information;
s3, transmitting the upgrade file to a temporary storage space;
s4, checking whether the transmission of the upgrade file in the temporary storage space is finished or not, if so, further judging whether a current frame is the last frame of the upgrade file or not, if so, transferring the data of the temporary storage space to a partition corresponding to an external flash, emptying the temporary storage space, executing the next step, and if not, determining that the data of the upgrade file is incomplete, and terminating the upgrade;
and S5, restarting the instrument MCU, entering an upgrading mode, and operating the upgrading file.
Preferably, the upgrade files in steps S1 to S3 include a plurality of bin files of different types, and a check value is set at the end of each of the bin files of each type, and the check values of the different bin files are different;
in step S4, it is determined whether the current frame is the last frame of the upgrade file, specifically, it is determined whether the check value of the current frame is the same as the check value of the last bin file in the upgrade file, if so, the current frame is determined to be the last frame of the upgrade file, otherwise, the current frame is determined not to be the last frame of the upgrade file.
Preferably, in step S4, it is checked whether the transmission of the upgrade file is completed, specifically, a progress bar is formed by using a size ratio of the currently transmitted data to the upgrade file, and the progress bar is checked to complete the loading, and if so, the transmission of the upgrade file is completed.
Preferably, a step SX is set between step S4 and step S5, and it is determined whether the size of the upgrade file in the flash partition is consistent with the size of the upgrade file in the storage device, if so, the transmission is completed and step S5 is executed, otherwise, the step S2 is returned and the configuration information is continuously read.
Preferably, the check value in step S4 is an MD5 value.
The invention also provides a safety upgrading system of the automobile instrument software, which comprises an instrument MCU, a USB chip, a TFT display screen, an SDRAM and an external flash, wherein the USB chip, the TFT display screen, the SDRAM and the external flash are respectively and electrically connected with the instrument MCU; the USB chip is also externally connected with a storage device;
the storage equipment is used for storing the upgrading file;
the USB chip is used for reading the size of the upgrade file and the configuration signal of the storage equipment; the upgrading file is also used for sending the upgrading file to the instrument MCU;
the instrument MCU is used for receiving the upgrade file and transferring the upgrade file to the SDRAM; the system is also used for generating progress data and transmitting the progress data to the TFT display screen during the transmission of the upgrade file; the system is also used for verifying whether the last transmission frame data of the upgrade file is the last frame data of the upgrade file or not after the transmission of the upgrade file is terminated; the SDRAM upgrading file is also used for transferring the SDRAM upgrading file to an external flash and emptying the SDRAM when the last transmission frame data of the upgrading file is detected to be the last frame data of the upgrading file; the system is also used for judging that the upgrade file is incomplete and terminating the upgrade when detecting that the last transmission frame data of the upgrade file is not the last frame data of the upgrade file; the SDRAM is also used for restarting and running the upgrade file after the upgrade file of the SDRAM is completely transferred to the external flash;
and the TFT display screen is used for displaying the transmission progress of the upgrade file.
Preferably, the upgrade file includes a plurality of bin files of different types;
different check values are formed at the tail ends of a plurality of bin files of the upgrade file;
the instrument MCU is used for updating the value of the instrument MCU when receiving each check value; and the SDRAM controller is also used for judging whether the last check value of the upgrade file is equal to the value or not after the transmission of the upgrade file is terminated, if so, migrating the upgrade file of the SDRAM to an external flash and emptying the SDRAM, and otherwise, judging that the upgrade file is incomplete and terminating the upgrade.
Preferably, the TFT display screen is configured to display a transmission progress of the upgrade file in a form of a progress bar.
Preferably, the instrument MCU is configured to check whether the size of the upgrade file in the external flash is consistent with the size of the upgrade file in the usb disk, and if so, determine that transmission of the upgrade file is terminated.
Preferably, the SDRAM is configured to, when receiving the upgrade file, temporarily store a part of the upgrade file, and load an upgrade progress bar on another part of the upgrade file.
From the above, the following beneficial effects can be obtained by applying the technical scheme provided by the invention:
firstly, the technical scheme provided by the invention adopts SDRAM to store upgrade file data in a transferring way, and the data flash of the external flash is carried out after the upgrade file is verified, so that the data interference, data loss and data tampering in the upgrading process are prevented, and the safe upgrading of instrument software is further ensured;
secondly, the SDRAM is used for loading image material data, and can be expanded according to the use of the SDRAM in an upgrading state, so that safe upgrading can be realized without additionally adding a memory, and the upgrading cost can be greatly reduced;
thirdly, the SDRAM in the technical scheme provided by the invention has a partition function, can simultaneously realize temporary storage of data and prompt of the upgrading progress and the reason of upgrading failure in a text alarm mode in the upgrading state, and is beneficial to a user to acquire the upgrading progress and the state thereof in real time.
Drawings
In order to more clearly illustrate the embodiments or prior art solutions of the present invention, the drawings that are needed in the description of the embodiments or prior art will be briefly described, and it will be apparent that, the drawings in the following description are only some embodiments of the invention, and other drawings can be derived by those skilled in the art without inventive exercise.
Fig. 1 is a flowchart of a security upgrade method in embodiment 1 of the present invention;
fig. 2 is a block diagram of a security upgrade system in embodiment 2 of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.
The capacity of an internal RAM in the existing MCU is limited, data of the whole upgrading file cannot be temporarily stored through the RAM in the upgrading process, a received data packet can be directly written into an external flash, and operations such as integrity verification and the like are not carried out on the data of the whole upgrading file, so that the normal upgrading process of the automobile instrument cannot be guaranteed.
Example 1
As shown in fig. 1, in order to solve the foregoing problem, the present embodiment provides a method for safely upgrading automobile meter software, which mainly includes the following steps:
s1, powering on a storage device with an upgrade file;
s2, detecting the size of the upgrade file in the storage device, and reading configuration information;
s3, transmitting the upgrade file to a temporary storage space;
s4, checking whether the transmission of the upgrade file in the temporary storage space is completed, if so, further judging whether the current frame is the last frame of the upgrade file, if so, transferring the data in the temporary storage space to a partition corresponding to an external flash, emptying the temporary storage space, executing the next step, and if not, considering that the upgrade file data is incomplete, and terminating the upgrade;
and S5, restarting the instrument MCU, entering an upgrading mode, and running an upgrading file.
Preferably, but not limited to, in step S1 in this embodiment, the upgrade file is stored in a root directory of the storage device, and the upgrade operation is triggered by a key.
Preferably, but not limited to, the configuration information in step S2 in this embodiment includes the size and address information of the file to be transmitted.
Preferably, but not limited to, in this embodiment, the step S5 is specifically that the meter MCU restarts to enter a boot mode, and if there is an APP file to be updated, the code-flash needs to be programmed.
In this embodiment, the storage device is a usb disk, and the temporary storage space is an SDRAM.
More specifically, the upgrade files in steps S1 to S3 include a plurality of bin files of different types, and a check value is set at the end of each bin file of each type, and the check values of the different bin files are different;
in step S4, it is determined whether the current frame is the last frame of the upgrade file, specifically, it is determined whether the check value of the current frame is the same as the check value of the last bin file in the upgrade file, if so, the current frame is determined to be the last frame of the upgrade file, otherwise, the current frame is determined not to be the last frame of the upgrade file.
Preferably, the check value at the end of the different bin file in this embodiment is an MD5 value, and is a result of automatically generating the calculation.
Preferably, but not limited to, the upgrade file in this embodiment includes a function code app.bin, an image material him.bin, an alarm sound sound.bin, and the like.
Preferably, but not limited to, in this embodiment, after receiving data of each upgrade file, the instrument MCU in this embodiment performs an MD5 check algorithm on each packet of data to update the check value1, and then temporarily stores each packet of data in the SDRAM in sequence, where the upgrade file carries the MD5 value2 of the file when the upgrade file is the last packet of data, and when the value1 is equal to the value2, the temporary storage data of the SDRAM is moved to an external flash.
More specifically, in step S4, it is checked whether the transmission of the upgrade file is completed, specifically, a progress bar is formed according to a size ratio of the currently transmitted data to the upgrade file, and whether the loading of the progress bar is completed is checked, and if so, the transmission of the upgrade file is completed.
More specifically, a step SX is set between step S4 and step S5, and it is determined whether the size of the upgrade file in the flash partition is consistent with the size of the upgrade file in the storage device, if yes, the transmission is completed and step S5 is executed, otherwise, step S2 is returned and the configuration information is continuously read.
Preferably, but not limited to, in this embodiment, if the SX determines that the size of the upgrade file in the flash partition is not consistent with the size of the upgrade file in the storage device, it is necessary to store other files and perform upgrade transmission.
Example 2
As shown in fig. 2, in order to solve the foregoing problems, the present embodiment provides a system for safely upgrading automobile instrument software, which mainly includes an instrument MCU, and a USB chip, a TFT display screen, an SDRAM, and an external flash, which are electrically connected to the instrument MCU; the USB chip is also externally connected with a storage device.
The storage device is used for storing the upgrade file; the USB chip is used for reading the size of an upgrade file and a configuration signal of the storage equipment; the system is also used for sending the upgrade file to the instrument MCU; the instrument MCU is used for receiving the upgrade file and storing the upgrade file in the SDRAM; the device is also used for generating progress data and transmitting the progress data to the TFT display screen during the transmission of the upgrade file; the system is also used for verifying whether the last transmission data of the upgrade file is the last frame data of the upgrade file or not after the transmission of the upgrade file is terminated; the device is also used for transferring the upgrading file of the SDRAM to an external flash and emptying the SDRAM when the last transmission frame data of the upgrading file is detected to be the last frame data of the upgrading file; the system is also used for judging that the upgrade file is incomplete and terminating the upgrade when detecting that the last transmission frame data of the upgrade file is not the last frame data of the upgrade file; the SDRAM is also used for restarting and running the upgrading file after the upgrading file of the SDRAM is completely transferred to the external flash; the SDRAM is used for generating progress data in an upgrade file transmission interval and transmitting the progress data to the TFT display screen; and the TFT display screen is used for displaying the transmission progress of the upgrade file.
Preferably, the TFT display screen is used to display the transmission progress of the upgrade file in the form of a progress bar.
Preferably, the storage device in this embodiment is a usb disk, and the upgrade file is stored in a usb disk directory, and the upgrade process is started according to a button.
In the embodiment, the SDRAM loads flash material data into the SDRAM to run in the running state of the normal work of the instrument, so that higher-efficiency access data is achieved; when the instrument software is upgraded, the SDRAM space is divided into two parts, one part is used for displaying the upgrading progress and an upgrading prompt loading area, and the other part is a temporary storage area for upgrading file data. The temporary storage area of the SDRAM upgrade file data must be larger than the size of each upgrade file.
In this embodiment, the storage structure of the external flash is as follows: the image material starts at the address 0 of the flash, and the length of the image material is 46M; the sound material starts at the address 0x2E00000 of the flash, and the length of the sound material is 14M; the application APP starts at the 0x3C00000 address and is 4M in length. During upgrading, data are temporarily stored in the SDRAM, MD5 integrity check is carried out after each upgrading file is received, and the data of the SDRAM are moved to an external flash, so that safe upgrading is realized. Correspondingly, the upgrading prompt loading area in the SDRAM starts from the address of 0x2E00000 and has the length of 18M; the upgrade data scratch pad starts from 0x0000000 addresses and is 46M in length.
More specifically, the upgrade file includes a plurality of bin files of different types; the tail ends of a plurality of bin files in the upgrade file are all provided with check values MD5 of the butcherless dragon; the instrument MCU is used for updating the value of the instrument MCU when each check value is received; and the device is also used for judging whether the last check value of the upgrade file is equal to the value or not after the transmission of the upgrade file is terminated, if so, transferring the upgrade file of the SDRAM to an external flash and emptying the SDRAM, otherwise, judging that the upgrade file is incomplete and terminating the upgrade.
In this embodiment, after receiving data of each upgrade file, the instrument MCU performs an MD5 check algorithm on each packet of data to update a check value1, and then temporarily stores each packet of data in the SDRAM in sequence, where the upgrade file carries the MD5 value2 of the file when the upgrade file is the last packet of data, and when the value1 is equal to the value2, the temporarily stored data of the SDRAM is moved to an external flash.
More specifically, the instrument MCU is configured to check whether the size of the upgrade file in the external flash is consistent with the size of the upgrade file in the usb disk, and if so, determine that the transmission of the upgrade file is terminated.
To sum up, in the method and system for safely upgrading the meter software of the automobile provided in embodiments 1 and 2, the SDRAM is called to temporarily store the upgrade data, and the upgrade data is migrated to the external flash only when the upgrade data is completely verified, so that data interference, data loss and data tampering during the upgrade process are prevented, and the safe upgrade process of the meter software is ensured.
The above-described embodiments do not limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the above-described embodiments should be included in the protection scope of the technical solution.
Claims (10)
1. A safe upgrading method of automobile instrument software is characterized by comprising the following steps:
s1, powering on a storage device with an upgrade file;
s2, detecting the size of the upgrade file in the storage device, and reading configuration information;
s3, transmitting the upgrade file to a temporary storage space;
s4, checking whether the upgrade file in the temporary storage space is completely transmitted, if so, further judging whether a current frame is the last frame of the upgrade file, if so, transferring the data in the temporary storage space to a partition corresponding to an external flash, emptying the temporary storage space, executing the next step, and if not, considering that the upgrade file data is incomplete, and terminating upgrading;
and S5, restarting the instrument MCU, entering an upgrading mode, and operating the upgrading file.
2. The method for safely upgrading the automobile instrument software according to claim 1, characterized in that:
the upgrade files in the steps S1 to S3 comprise a plurality of bin files of different types, and the tail of each type of the bin file is provided with a check value, and the check values of the different bin files are different;
in step S4, it is determined whether the current frame is the last frame of the upgrade file, specifically, it is determined whether the check value of the current frame is the same as the check value of the last bin file in the upgrade file, if so, the current frame is determined to be the last frame of the upgrade file, otherwise, the current frame is determined not to be the last frame of the upgrade file.
3. The method for safely upgrading the automobile instrument software according to claim 2, characterized in that:
in the step S4, it is checked whether the transmission of the upgrade file is completed, specifically, a progress bar is formed by using a size ratio of the currently transmitted data to the upgrade file, and whether the loading of the progress bar is completed is checked, if yes, the transmission of the upgrade file is completed.
4. The method for safely upgrading automobile instrument software according to any one of claims 1 to 3, characterized by comprising the following steps:
and a step SX is arranged between the step S4 and the step S5, whether the size of the upgrade file in the flash partition is consistent with that of the upgrade file in the storage device or not is judged, if yes, the transmission is finished, the step S5 is executed, and if not, the step S2 is returned, and the configuration information is continuously read.
5. The method for safely upgrading the automobile instrument software according to claim 4, wherein the method comprises the following steps: the check value in step S4 is an MD5 value.
6. A safe upgrading system of motormeter software is characterized in that: the system comprises an instrument MCU, a USB chip, a TFT display screen, an SDRAM and an external flash, wherein the USB chip, the TFT display screen, the SDRAM and the external flash are respectively and electrically connected with the instrument MCU; the USB chip is also externally connected with a storage device;
the storage equipment is used for storing the upgrading file;
the USB chip is used for reading the size of the upgrade file and the configuration signal of the storage equipment; the upgrading file is also used for sending the upgrading file to the instrument MCU;
the instrument MCU is used for receiving the upgrade file and transferring the upgrade file to the SDRAM; the system is also used for verifying whether the last transmission frame data of the upgrade file is the last frame data of the upgrade file or not after the transmission of the upgrade file is terminated; the SDRAM upgrading file is also used for transferring the SDRAM upgrading file to an external flash and emptying the SDRAM when the last transmission frame data of the upgrading file is detected to be the last frame data of the upgrading file; the system is also used for judging that the upgrade file is incomplete and terminating the upgrade when detecting that the last transmission frame data of the upgrade file is not the last frame data of the upgrade file; the SDRAM is also used for restarting and running the upgrade file after the upgrade file of the SDRAM is completely transferred to the external flash;
the SDRAM is used for generating progress data and transmitting the progress data to the TFT display screen during the transmission of the upgrade file;
and the TFT display screen is used for displaying the transmission progress of the upgrade file.
7. The system for safely upgrading the automobile instrument software according to claim 6, wherein:
the upgrade file comprises a plurality of bin files with different types;
different check values are formed at the tail ends of a plurality of bin files of the upgrade file;
the instrument MCU is used for updating the value of the instrument MCU when receiving each check value; and the SDRAM controller is also used for judging whether the last check value of the upgrade file is equal to the value or not after the transmission of the upgrade file is terminated, if so, migrating the upgrade file of the SDRAM to an external flash and emptying the SDRAM, and otherwise, judging that the upgrade file is incomplete and terminating the upgrade.
8. The system for safely upgrading the automobile instrument software according to claim 7, is characterized in that: and the TFT display screen is used for displaying the transmission progress of the upgrade file in a progress bar mode.
9. The system for safely upgrading automobile instrument software according to claim 8, is characterized in that:
and the instrument MCU is used for verifying whether the size of the upgrading file in the external flash is consistent with that of the upgrading file in the storage device or not, and if so, judging that the transmission of the upgrading file is terminated.
10. The system for safely upgrading automobile instrument software according to any one of claims 6 to 9, wherein:
and the SDRAM is used for temporarily storing the upgrade file when receiving the upgrade file, and the SDRAM is used for loading an upgrade progress bar.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210715597.2A CN115268960A (en) | 2022-06-23 | 2022-06-23 | Safe upgrading method and system for automobile instrument software |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210715597.2A CN115268960A (en) | 2022-06-23 | 2022-06-23 | Safe upgrading method and system for automobile instrument software |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115268960A true CN115268960A (en) | 2022-11-01 |
Family
ID=83762245
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210715597.2A Pending CN115268960A (en) | 2022-06-23 | 2022-06-23 | Safe upgrading method and system for automobile instrument software |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115268960A (en) |
-
2022
- 2022-06-23 CN CN202210715597.2A patent/CN115268960A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2990181B1 (en) | Flash memory, microcomputer having flash memory, and method of storing program in flash memory | |
CN109358887B (en) | On-line upgrading method, device and system for single chip microcomputer program | |
JP2002278783A (en) | System for rewriting firmware | |
CN112000358B (en) | Upgrading method of charging pile and intelligent charging pile | |
US20100049961A1 (en) | Update method for basic input/output system and update system thereof | |
CN112732310A (en) | Firmware upgrading method, system, equipment and medium based on embedded boot partition | |
CN115756984A (en) | Memory test method, device, equipment and storage medium | |
CN115268960A (en) | Safe upgrading method and system for automobile instrument software | |
CN113094107B (en) | Data protection method, device, equipment and computer storage medium | |
CN106444730B (en) | Diagnosis method of electronic control unit for preventing software from being dead | |
CN115993985A (en) | Bootloader updating method, bootloader updating device, bootloader updating equipment and Bootloader updating medium | |
CN112908390B (en) | Data storage method, device, electronic equipment and storage medium | |
CN104615387A (en) | Vehicle-mounted equipment based on XPE system and design method of vehicle-mounted equipment | |
CN100543676C (en) | The method of firmware update | |
CN108241578B (en) | Method and device for checking software compatibility of automobile electric control unit | |
CN110888689A (en) | Loading method of touch screen drive, storage medium and terminal equipment | |
CN113377421B (en) | Method, device, equipment and medium for detecting software and hardware version information | |
CN114637626B (en) | Method, device and equipment for reducing read-write errors of EEPROM (electrically erasable programmable read-only memory) data and readable storage medium | |
JP3314719B2 (en) | Flash EEPROM and its test method | |
CN106970809A (en) | A kind of method and apparatus of safety upgrade file system | |
CN112379909A (en) | Method, device and equipment for refreshing combination instrument program and storage medium | |
CN117742763A (en) | ECU firmware upgrading method, device, system, automobile and storage medium | |
CN115794179A (en) | Program upgrading method and device, electronic equipment and storage medium | |
CN116932018A (en) | Bootloader upgrading method, bootloader upgrading device, bootloader upgrading equipment and medium | |
CN115132262A (en) | Rapid RAM detection method, system, detection device and storage medium |
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 |