An automobile embedded software upgrading method, device and storage medium

By setting up a backup area and consistency verification in the storage device, errors in the automotive embedded software upgrade process are resolved, ensuring the stability and recoverability of the upgrade process and preventing system failure.

CN112486549BActive Publication Date: 2025-11-25GAC COMPONENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011197393.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-30
Publication Date
2025-11-25
Estimated Expiration
2040-10-30

AI Technical Summary

Technical Problem

Errors can easily occur during automotive embedded software upgrades, leading to upgrade failures and system paralysis.

Method used

By setting up a backup area in the storage device to store both new and old application code, and performing consistency checks and counter management during the upgrade process, the stability and recoverability of the upgrade process are ensured.

Benefits of technology

It achieves stability in automotive embedded software upgrades, enabling timely recovery to the pre-upgrade state in case of upgrade failure, thus preventing system paralysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112486549B_ABST
    Figure CN112486549B_ABST
Patent Text Reader

Abstract

The application discloses a kind of car embedded software upgrade method, comprising: when system detects reprogramming request, new application code is downloaded to storage device and new application code is backed up to storage device backup area;Receive erase service request and erase the application code backup area of system and the old application code of the application code area of system is backed up to application code backup area;Erase application code area and copy new application code to application code area;Erase the related information of storage device and the error count of system after restart, realize the upgrade of car embedded software.The upgrade method provided by the application is more stable, safe.The application also provides a kind of car embedded software upgrade device and storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to embedded software upgrade, in particular to a car embedded software upgrade method, device and storage medium. BACKGROUND

[0002] At present, the embedded software is installed in the embedded device of the car, and the car upgrade corresponds to the embedded software upgrade, but in the upgrade process, the original application program is covered, which is easy to cause errors and lead to upgrade failure, and the system is paralyzed due to upgrade failure in the upgrade process. SUMMARY

[0003] In order to overcome the defects of the prior art, one of the purposes of the present application is to provide a car embedded software upgrade method, which can solve the problems that the car embedded software upgrade process is prone to errors, leading to upgrade failure and system paralysis.

[0004] The second purpose of the present application is to provide a car embedded software upgrade device, which can solve the problems that the car embedded software upgrade process is prone to errors, leading to upgrade failure and system paralysis.

[0005] The third purpose of the present application is to provide a storage medium, which can solve the problems that the car embedded software upgrade process is prone to errors, leading to upgrade failure and system paralysis.

[0006] One of the purposes of the present application is achieved by the following technical solutions:

[0007] A car embedded software upgrade method, comprising:

[0008] Request detection step: when the system detects a reprogramming request, download a new application code to a storage device and backup the new application code to a storage device backup area;

[0009] Backup step: receiving an erase service request and erasing the application code backup area of the system and backing up the old application code of the application code area of the system to the application code backup area;

[0010] Update step: erasing the application code area and copying the new application code to the application code area;

[0011] Clearing step: erasing the related information of the storage device and the error count of the system and restarting.

[0012] Further, when the system does not detect a reprogramming request and the system is available: detecting whether the storage device is available, if yes, erasing the related information of the storage device, and then jumping to the system software interface; if not, directly jumping to the system software interface.

[0013] Further, when the system does not detect the reprogramming request and the system is not available:

[0014] The detection step: detecting whether the application code backup area and the storage device backup area are both available, if yes, executing the backup recovery step; if no, the system stays in the Boot area to execute the BootLoader program;

[0015] The backup recovery step: copying the new application code of the storage device backup area to the system memory and copying the old application code of the application code backup area to the application code area, and then executing the erasing of the related information of the storage device and the clearing of the system error count before restarting.

[0016] Further, the backup recovery step comprises:

[0017] The first recovery step: copying the new application code of the storage device backup area to the system memory;

[0018] The first judgment step: judging whether the new application code in the system memory is consistent with the new application code of the storage device backup area, if yes, executing the second recovery step; if no, the counter +1;

[0019] The second recovery step: copying the old application code of the application code backup area to the application code area, and then executing the second judgment step;

[0020] The second judgment step: judging whether the old application code of the application code area is consistent with the old application code of the application code backup area, if yes, setting the available state of the application code area as available; if no, the counter +1.

[0021] Further, in the first judgment step and the second judgment step: when the counter is greater than a preset value, restarting the system; when the counter is greater than the preset value, the system stays in the Boot area to execute the BootLoader program.

[0022] Further, the preset value is 5.

[0023] Further, the request detection step further comprises:

[0024] The downloading step: downloading the new application code in the storage device to the system memory;

[0025] The first judgment step: when the storage device backup area is available and the new application code in the system memory is consistent with the new application code of the storage device backup area, executing the backup step; when the storage device backup area is not available or the new application code in the system memory is not consistent with the new application code of the storage device backup area, executing the first backup erasing step;

[0026] The first backup erasing step: erasing the backup area of the storage device and re-backing up the new application code in the system memory to the backup area of the storage device;

[0027] The first checking step: checking whether the new application code in the backup area of the storage device is consistent with the new application code in the system memory, if yes, the flag setting step; if no, restarting;

[0028] The flag setting step: setting the available state of the Flash Driver backup area as available; and then executing the backup step.

[0029] Further, the backup step further comprises:

[0030] The second checking step: when the old application code in the application code backup area is consistent with the old application code in the application code area and the application code backup area is available, executing the erasing step; when the old application code in the application code backup area is inconsistent with the old application code in the application code area or the application code backup area is unavailable, executing the second backup erasing step;

[0031] The second backup erasing step: erasing the application code backup area and copying the old application code to the application code backup area;

[0032] The second checking step: checking whether the old application code in the application code backup area is consistent with the old application code in the application code area, if yes, setting the available state of the application code backup area as available, and then executing the erasing step; if no, restarting the system.

[0033] The second purpose of the present application is achieved by using the following technical solution:

[0034] An automobile embedded software upgrading device comprises a memory and a processor, the memory stores an automobile embedded software upgrading program which can run on the processor, the automobile embedded software upgrading program is a computer program, and the processor implements the steps of an automobile embedded software upgrading method according to one of the purposes of the present application when executing the automobile embedded software upgrading program.

[0035] The third purpose of the present application is achieved by using the following technical solution:

[0036] A storage medium is a computer readable storage medium, which stores an automobile embedded software upgrading program, the automobile embedded software upgrading program is a computer program, and the automobile embedded software upgrading program implements the steps of an automobile embedded software upgrading method according to one of the purposes of the present application when being executed by a processor.

[0037] Compared with the prior art, the present application has the following beneficial effects:

[0038] The application stores new application code in the storage device backup area and stores old application code in the application code backup area of the system, so that the upgrading of the automobile embedded software is realized, and the upgrading method provided by the application has stability, and when the upgrading fails, the system can be restored to the state before the upgrading or the basic running function of the system is reserved, so that the system is prevented from being paralyzed due to the upgrading failure in the prior art. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 A main flowchart of the automobile embedded software upgrading method provided by the application is shown in the figure.

[0040] Figure 2 A flowchart of step S12 in the method provided by the application is shown in the figure. Figure 1

[0041] A flowchart of step S11 in the method provided by the application is shown in the figure. Figure 3 Figure 1 A flowchart of step S31 provided by the application is shown in the figure.

[0042] Figure 4 A module diagram of the automobile embedded software upgrading device provided by the application is shown in the figure.

[0043] Figure 5 In the figure: 11, memory; 12, processor; 13, communication bus; 14, network interface. DETAILED DESCRIPTION

[0044] Hereinafter, the application is further described in combination with the accompanying drawings and specific embodiments, and it should be noted that the embodiments described below or the technical features thereof can be combined with each other to form new embodiments without conflict.

[0045] Embodiment one

[0046] The application provides an automobile embedded software upgrading method, which can quickly realize upgrading, reduce the upgrading error rate and greatly improve the upgrading stability, as shown in the figure.

[0047] The main flow of the method specifically includes the following steps: Figure 1

[0048] Step S10, the system detects whether there is a reprogramming request, if yes, step S11 is executed, and if no, step S20 is executed. Wherein, the reprogramming request refers to the request of whether the automobile embedded software needs to be updated.

[0049] For example, when the automobile embedded software needs to be upgraded, a reprogramming request is generally sent to the system by a host computer or other equipment, so that whether the software upgrading is performed is determined by detecting whether the reprogramming request exists.​​

[0050] Step S11, download new application code to the storage device and backup the new application code to the storage device backup area.

[0051] The new application code refers to the new program code data after software upgrade.

[0052] Preferably, the storage device in the embodiment is a Flash Driver. Therefore, after detecting the reprogramming request, the new application code is downloaded to the Flash Driver and is backed up to the Flash Drive backup area. By setting the Flash Drive backup area, when the new application code is damaged in the Flash Driver due to other factors during the upgrade process, the new application code can be quickly recovered from the Flash Driver backup area.

[0053] Preferably, the storage device in the embodiment can be various external storage devices such as a commonly used U disk, a mobile hard disk, etc. in addition to the Flash Driver. Preferably, the embodiment is described by taking the Flash Driver as an example.

[0054] Step S12, the system receives the erase service request and erases the application code backup area and backs up the old application code in the application code area to the application code backup area.

[0055] The application code area is used to store the application code of the system. The old application code is the application code before upgrade. During the upgrade process, the old application code is overwritten by copying the new application code to the application code area to realize software upgrade.

[0056] At the same time, the old application code is backed up by setting the application code backup area, so that after the upgrade fails, the state before the upgrade can be restored according to the application code backup area.

[0057] Step S13, copy the new application code of the Flash Driver to the system memory, and erase the application code area to copy the new application code in the system memory to the application code area.

[0058] Step S14, after erasing the related information of the Flash Driver and the error count of the system, restart to realize the upgrade of the embedded software of the automobile.

[0059] The related information of the Flash Driver refers to various flag bits set by the system during the upgrade process, which are used to mark the rollback position when the upgrade fails during the upgrade process. The error count refers to various data specified in the system, such as the number of times of judgment and the number of times of calculation, etc.

[0060] Further, as shown in FIG. 2, the system further comprises a storage device backup area.Figure 1 As shown, when no programming request is detected in the system:

[0061] Step S20, detect whether the system is available, if yes, execute step S21; if no, execute step S30.

[0062] Preferably, the embodiment indicates the availability of the device, program or system by setting an effective flag. That is, when the effective flag in the system is valid, the system is considered available, and the APP of the embedded software of the car is available.

[0063] Step S21, detect whether the Flash Drive is available, if yes, execute step S22; if no, jump to other interface of the application or perform other operations.

[0064] Step S22, erase the relevant information of the Flash Drive and jump to other interface of the application or perform other operations. By erasing the relevant information of the Flash Drive, the data of the False Driver in the system is restored, ensuring the security of the upgrade data.

[0065] Since the current embedded software does not need to be upgraded, and the system is available, if the current Flash Drive is available, it means that the Flash Drive stores the upgraded application code. Therefore, in order to ensure the security of the software, the relevant information of the Flash Drive and the error count in the system are erased.

[0066] When the system is not available, that is, the embedded software APP cannot be normally used, the system needs to be restored, specifically:

[0067] Step S30, detect whether the application code backup area and the Flash Drive backup area are both available, if yes, execute step S31; if no, the system stays in the Boot area to execute the BootLoader program.

[0068] Staying in the Boot area to execute the BootLoader program means keeping the most basic running program of the system, ensuring the basic running of the system.

[0069] Step S31, copy the new application code of the Flash Drive backup area to the system memory and copy the old application code of the application code backup area to the application code area, and then execute step S32.

[0070] Step S32, after erasing the related information of the Flash Driver and clearing the system error count, restart. At this time, the old application code in the application code backup area is copied to the application code area, so after the system restarts, the system enters the state before the upgrade.

[0071] Preferably, in order to ensure the correctness of the upgrade, the correctness of the new application code also needs to be ensured when downloading the new application code. Further, as shown in Figure 3 Step S11 further includes:

[0072] Step S110, download the new application code in the Flash Driver to the system memory.

[0073] Step S111, check whether the Flash Driver backup area is available and whether the new application code in the system memory is consistent with the application code in the Flash Driver backup area. If the Flash Driver backup area is available and the new application code in the system memory is consistent with the application code in the Flash Driver backup area, execute step S12; otherwise, execute step S112.

[0074] Preferably, in the embodiment, when judging whether the application code is consistent, the CRC (Cyclical Redundancy Check) is calculated to judge. The CRC is a cyclic redundancy check code, and by calculating and checking the CRC, whether the data is correct can be checked.

[0075] That is, in step S110, the CRC value of the new application code in the system memory is also calculated.

[0076] In step S111, when the CRC value of the new application code in the system memory is the same as the CRC value of the new application code in the Flash Driver backup area, and the Flash Driver backup area is available, step S12 can be executed to perform the next data backup; otherwise, it means that the new application code in the Flash Driver backup area is incorrect, and the new application code in the Flash Driver backup area is re-backed up.

[0077] Step S112, erase the Flash Driver backup area and backup the new application code in the Flash Driver to the Flash Driver backup area.

[0078] Step S113, judge whether the new application code in the Flash Driver backup area is consistent with the new application code in the system memory. If yes, execute step S114; if no, restart.

[0079] Step S114, setting the available state of the Flash Driver backup area as available, and then executing step S12.

[0080] Step S114 specifically includes setting the valid flag of the Flash Driver backup area as valid and the CRC value of the new application code.

[0081] Preferably, when the old application code of the application code area is backed up to the application code backup area, in order to ensure the correctness of subsequent rollback, further, as shown in Figure 2 Step S12 specifically includes:

[0082] Step S120, checking whether the application code backup area is available and whether the old application code of the application code backup area is consistent with the old application code of the application code area; when the application code backup area is available and the old application code of the application code backup area is consistent with the old application code of the application code area, executing step S13; otherwise, executing step S121.

[0083] Step S121, erasing the application code backup area and copying the old application code to the application code backup area.

[0084] Step S122, checking whether the old application code of the application code area is consistent with the old application code of the application code backup area, if not, restarting; if yes, executing step S123.

[0085] Preferably, when checking whether the old application code of the application code area is consistent with the old application code of the application code backup area, the CRC value of the old application code of the application code area and the CRC value of the old application code of the application code backup area are calculated respectively, and then the CRC values are compared to determine whether they are consistent, if yes, it is considered that the old application codes are consistent.

[0086] Step S123, setting the available state of the application code backup area as available, and then executing step S13. Preferably, step S123 further includes setting the valid flag of the application code backup area as valid and setting the CRC value of the old application code of the application code backup area as the CRC value of the old application code of the application code area.

[0087] Further, as shown in Figure 4 when an upgrade error occurs and it is necessary to roll back to the state before the upgrade, that is, in step S31, after the new application code of the Flash Driver backup area is downloaded to the system memory, the CRC value of the new application code in the system memory is calculated, and then step S310 is executed.

[0088] Step S310, checking whether the new application code of the Flash Driver backup area is consistent with the new application code in the system memory, if yes, executing step S311, if not, the counter +1.

[0089] Step S311, copying the old application code of the application code backup area to the application code area.

[0090] Step S312, judging whether the old application code of the application code area is consistent with the old application code of the application code backup area, if yes, executing step S313, if not, the counter +1.

[0091] Step S313, setting the available state of the application code area as available. Preferably, setting the valid flag of the application code area as valid and setting the old application code of the application code area as the CRC value of the old application code of the application code backup area.

[0092] Preferably, in step S310 and step S312, when the counter is greater than a preset value, the system stays in the Boot area to execute the BootLoader program; when the counter is less than the preset value, the system is restarted.

[0093] Preferably, the preset value is 5.

[0094] The application sets the valid flag to judge whether the application program, the Flash Driver and the Flash Driver backup area, the application code area, the application code backup area and the like are available, to ensure the upgrade stability, and combines the CRC to judge whether the backup of the new and old application code in the upgrade process is correct, to ensure the accuracy of the upgrade and to ensure that the system can be rolled back to the state before the upgrade when the upgrade fails.

[0095] Embodiment two

[0096] The application provides an automobile embedded software upgrade device. Figure 5 As shown in the figure, an internal structure schematic diagram of the automobile embedded software upgrade device provided by an embodiment of the application.

[0097] In the embodiment, the automobile embedded software upgrade device can be a PC (Personal Computer, personal computer), and can also be a terminal device such as a smart phone, a tablet computer, a portable computer and the like. The automobile embedded software upgrade device at least includes a processor 12, a communication bus 13, a network interface 14 and a memory 11.

[0098] The memory 11 includes at least one type of readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The memory 11 can be an internal storage unit of the automotive embedded software upgrading device in some embodiments, such as a hard disk of the automotive embedded software upgrading device. The memory 11 can also be an external storage device of the automotive embedded software upgrading device in other embodiments, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 11 can include both an internal storage unit and an external storage device of the automotive embedded software upgrading device. The memory 11 can be used to store application software installed in the automotive embedded software upgrading device and various data, such as code of the automotive embedded software upgrading program, etc., and to temporarily store data that has been output or will be output.

[0099] The processor 12 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments, and is used to run program code or process data stored in the memory 11, such as to execute the automotive embedded software upgrading program, etc.

[0100] The communication bus 13 is used to realize connection and communication between the components.

[0101] The network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the automotive embedded software upgrading device and other electronic devices.

[0102] Optionally, the automotive embedded software upgrading device can also include a user interface, which can include a display, an input unit such as a keyboard, and can optionally include a standard wired interface, a wireless interface. Optionally, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, etc. in some embodiments. The display can also be appropriately referred to as a display screen or a display unit, and is used to display information processed in the automotive embedded software upgrading device and to display a visual user interface.

[0103] Figure 5Only the automobile embedded software upgrading device with components 11-14 and the automobile embedded software upgrading program are shown, and those skilled in the art can understand that, Figure 5 The shown structure does not constitute a limitation on the automobile embedded software upgrading device, and can include less or more components than shown, or combine certain components, or different component arrangement.

[0104] In Figure 5 In the shown embodiment of the automobile embedded software upgrading device, the automobile embedded software upgrading program is stored in the memory 11; and the processor 12 implements the following steps when executing the automobile embedded software upgrading program stored in the memory 11:

[0105] Request detection step: when the system detects a reprogramming request, download new application code to the storage device and backup the new application code to the storage device backup area;

[0106] Backup step: receive an erase service request and erase the application code backup area of the system and backup the old application code of the application code area of the system to the application code backup area;

[0107] Update step: erase the application code area and copy the new application code to the application code area;

[0108] Clearing step: erase the related information of the storage device and the error count of the system and then restart.

[0109] Further, when the system does not detect a reprogramming request and the system is available: detect whether the storage device is available, if yes, erase the related information of the storage device, and then jump to the system software interface; if not, directly jump to the system software interface.

[0110] Further, when the system does not detect a reprogramming request and the system is not available:

[0111] Detection step: detect whether the application code backup area and the storage device backup area are both available, if yes, execute the backup recovery step; if not, keep the system in the Boot area to execute the BootLoader program;

[0112] Backup recovery step: copy the new application code of the storage device backup area to the system memory and copy the old application code of the application code backup area to the application code area, and then execute the step of erasing the related information of the storage device and clearing the error count of the system and then restarting.

[0113] Further, the backup recovery step includes:

[0114] First recovery step: copy the new application code of the storage device backup area to the system memory;

[0115] The first judging step: judging whether the new application code in the system memory is consistent with the new application code in the storage device backup area, if yes, executing the second recovery step; if no, the counter +1;

[0116] The second recovery step: copying the old application code in the application code backup area to the application code area, and then executing the second judging step;

[0117] The second judging step: judging whether the old application code in the application code area is consistent with the old application code in the application code backup area, if yes, setting the available state of the application code area as available; if no, the counter +1.

[0118] Further, in the first judging step and the second judging step: when the counter is greater than a preset value, restarting the system; when the counter is greater than the preset value, the system stays in the Boot area to execute the BootLoader program.

[0119] Further, the preset value is 5.

[0120] Further, the request detecting step further comprises:

[0121] The downloading step: downloading the new application code in the storage device to the system memory;

[0122] The first judging step: when the storage device backup area is available and the new application code in the system memory is consistent with the new application code in the storage device backup area, executing the backup step; when the storage device backup area is not available or the new application code in the system memory is not consistent with the new application code in the storage device backup area, executing the first backup erasing step;

[0123] The first backup erasing step: erasing the storage device backup area and re-backing up the new application code in the system memory to the storage device backup area;

[0124] The first verifying step: verifying whether the new application code in the storage device backup area is consistent with the new application code in the system memory, if yes, executing the flag setting step; if no, restarting;

[0125] The flag setting step: setting the available state of the Flash Driver backup area as available; and then executing the backup step.

[0126] Further, the backup step further comprises:

[0127] The second detecting step: when the old application code in the application code backup area is consistent with the old application code in the application code area and the application code backup area is available, executing the erasing step; when the old application code in the application code backup area is not consistent with the old application code in the application code area or the application code backup area is not available, executing the second backup erasing step;

[0128] Second backup erasing step: erasing the application code backup area and copying the old application code to the application code backup area;

[0129] Second checking step: checking whether the old application code in the application code backup area is consistent with the old application code in the application code area, if yes, setting the available state of the application code backup area as available, and then executing the erasing step; if not, restarting the system.

[0130] Embodiment three

[0131] A storage medium, which is a computer readable storage medium, has stored thereon an automobile embedded software upgrading program, the automobile embedded software upgrading program being a computer program, the automobile embedded software upgrading program, when executed by a processor, implementing the steps of the automobile embedded software upgrading method provided in Embodiment One.

[0132] The above embodiments are only preferred embodiments of the present application, and cannot be used to limit the scope of protection of the present application, and any non-essential changes and replacements made by those skilled in the art on the basis of the present application shall fall within the scope of protection of the present application.

Claims

1. A method for upgrading automotive embedded software, characterized in that, include: Request detection steps: When the system detects a reprogramming request, it downloads the new application code to the storage device and backs up the new application code to the storage device's backup area; Backup steps: Upon receiving the erase service request, erase the system's application code backup area and back up the old application code from the system's application code area to the application code backup area; Update steps: Erase the application code area and copy the new application code to the application code area; Clearing steps: Erase storage device information and system error count, then restart; When the system does not detect a reprogramming request and the system is available: check if the storage device is available. If it is, erase the relevant information of the storage device and then jump to the system software interface; otherwise, jump directly to the system software interface. When the system does not detect a reprogramming request and the system is unavailable: Detection steps: Check whether the application code backup area and the storage device backup area are both available. If so, perform the backup and restore steps; if not, keep the system in the Boot area and execute the BootLoader program. Backup and recovery steps: Copy the new application code from the storage device backup area to the system memory and copy the old application code from the application code backup area to the application code area. Then, erase the relevant information of the storage device and clear the system error count before restarting. The backup and recovery steps include: First recovery step: Copy the new application code from the storage device backup area to system memory; First judgment step: Determine whether the new application code in the system memory is consistent with the new application code in the storage device backup area. If yes, proceed to the second recovery step; otherwise, increment the counter by 1. The second recovery step: Copy the old application code from the application code backup area to the application code area, and then perform the second judgment step; The second judgment step is to determine whether the old application code in the application code area is consistent with the old application code in the application code backup area. If they are consistent, the availability status of the application code area is set to available; otherwise, the counter is incremented by 1. In the first and second judgment steps: when the counter is greater than the preset value, the system is restarted; when the counter is greater than the preset value, the system stays in the Boot area and executes the BootLoader program. The preset value is 5; The automotive embedded software upgrade method includes the following steps: Step S10: The system checks if there is a reprogramming request. If there is, proceed to step S11; otherwise, proceed to step S20. Step S11: Download the new application code to the storage device and back up the new application code to the backup area of ​​the storage device; Step S12: The system receives the erase service request and erases the application code backup area and backs up the old application code in the application code area to the application code backup area; Step S13: Copy the new application code from the Flash Driver to the system memory, and erase the application code area by copying the new application code from the system memory to the application code area; Step S14: After erasing the Flash Driver information and the system error count, and restarting, the automotive embedded software upgrade is achieved. Step S20: Check if the system is available. If yes, proceed to step S21; otherwise, proceed to step S30. Step S21: Check if the Flash Drive is available. If yes, proceed to step S22; otherwise, jump to another interface of the application or perform other operations. Step S22: After erasing the relevant information of the Flash Driver, the user will be redirected to another interface of the application or perform other operations. Step S30: Check whether the application code backup area and the Flash Driver backup area are both available. If yes, proceed to step S31; otherwise, the system stays in the Boot area and executes the BootLoader program. Step S31: Copy the new application code from the Flash Driver backup area to the system memory and copy the old application code from the application code backup area to the application code area, and then execute step S32; Step S32: Erase the Flash Driver information and clear the system error count, then restart; Step S11 further includes: Step S110: Download the new application code from the Flash Driver to the system memory; Step S111: Verify whether the Flash Driver backup area is available and whether the new application code in the system memory is consistent with the application code in the Flash Driver backup area. If the Flash Driver backup area is available and the new application code in the system memory is consistent with the application code in the Flash Driver backup area, proceed to step S12; otherwise, proceed to step S112. In step S111, if the CRC value of the new application code in the system memory is the same as the CRC value of the new application code in the Flash Driver backup area, and the Flash Driver backup area is available, then step S12 can be executed to perform the next data backup; otherwise, it indicates that the new application code in the Flash Driver backup area is incorrect, and the new application code in the Flash Driver backup area should be backed up again. Step S112: Erase the Flash Driver backup area and back up the new application code in the Flash Driver to the Flash Driver backup area; Step S113: Determine whether the new application code in the Flash Driver backup area is consistent with the new application code in the system memory. If yes, proceed to step S114; otherwise, restart. Step S114: Set the availability status of the Flash Driver backup area to available, and then execute step S12; Step S120: Verify whether the application code backup area is available and whether the old application code in the application code backup area is consistent with the old application code in the application code area; if the application code backup area is available and the old application code in the application code backup area is consistent with the old application code in the application code area, proceed to step S13; otherwise, proceed to step S121. Step S121: Erase the application code backup area and copy the old application code to the application code backup area; Step S122: Verify whether the old application code in the application code area is consistent with the old application code in the application code backup area. If not, restart; if yes, proceed to step S123. Step S123: Set the availability status of the application code backup area to available, and then execute step S13.

2. The automotive embedded software upgrade method according to claim 1, characterized in that, The request detection step is followed by: Download steps: Download the new application code from the storage device to the system memory; First determination step: When the storage device backup area is available and the new application code in the system memory is consistent with the new application code in the storage device backup area, execute the backup step; when the storage device backup area is unavailable or the new application code in the system memory is inconsistent with the new application code in the storage device backup area, execute the first backup erase step. First backup and erase step: Erase the storage device backup area and back up the new application code in the system memory to the storage device backup area; First verification step: Verify whether the new application code in the storage device backup area is consistent with the new application code in the system memory. If yes, proceed with the setup step; otherwise, restart. Flag setting steps: Set the availability status of the Flash Driver backup area to available; then perform the backup steps.

3. The automotive embedded software upgrade method according to claim 1, characterized in that, The backup step is followed by: Second detection step: When the old application code in the application code backup area is consistent with the old application code in the application code backup area and the application code backup area is available, the erasure step is executed; when the old application code in the application code backup area is inconsistent with the old application code in the application code backup area or the application code backup area is unavailable, the second backup erasure step is executed. The second backup and erase step: erase the application code backup area and copy the old application code to the application code backup area; The second verification step is to verify whether the old application code in the application code backup area is consistent with the old application code in the application code area. If they are consistent, the availability status of the application code backup area is set to available, and then the erasure step is performed. If not, the system is restarted.

4. An automotive embedded software upgrade device, comprising a memory and a processor, wherein the memory stores an automotive embedded software upgrade program executable on the processor, the automotive embedded software upgrade program being a computer program, characterized in that: When the processor executes the automotive embedded software upgrade program, it implements the steps of an automotive embedded software upgrade method as described in any one of claims 1-3.

5. A storage medium, said storage medium being a computer-readable storage medium, storing thereon an automotive embedded software upgrade program, said automotive embedded software upgrade program being a computer program, characterized in that: When the automotive embedded software upgrade program is executed by the processor, it implements the steps of an automotive embedded software upgrade method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Software upgrading method and device, terminal and readable storage medium

    CN110874237A