Vehicle controller flashing method and device

By using external FLASH in the controller of new energy vehicles for A/B partition upgrade and backup, the problem of unsafe and unreliability of OTA upgrades caused by insufficient built-in storage capacity is solved, and the stability and reliability of OTA upgrades are achieved, and the user experience is improved.

CN119597324APending Publication Date: 2025-03-11SUNGIANT AUTOMOTIVE ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411563355.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When new energy vehicles are upgrading their entire vehicle OTA, due to the functional integration characteristics of the controller, the OTA upgrade package is getting larger and larger, and the MCU's built-in FLASH storage is insufficient, so it is impossible to upgrade and backup A/B partitions, resulting in unsafe and unreliable upgrades and unreliable upgrades, and the upgrade time becomes longer, affecting the user experience.

Method used

A/B partition is performed through external FLASH, and it is used as a download area and a backup area in turn. The OTA upgrade package is downloaded and backed up using external FLASH to ensure the stability and reliability of the upgrade process.

Benefits of technology

It solves the problem of unsafe and unreliability of upgrades caused by insufficient built-in storage capacity, saves time to backup the current version, improves the stability and reliability of OTA upgrades, shortens the upgrade time, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597324A_ABST
    Figure CN119597324A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle control, and discloses a vehicle controller flashing method and device. The method is realized based on an external FLASH electrically connected with a vehicle controller. The external FLASH comprises a first partition and a second partition; when an OTA upgrading instruction is received, identifying partition flag bits of the first partition and the second partition to determine a current downloading partition; analyzing the OTA upgrading instruction to obtain a first upgrading package required by OTA upgrading, and downloading the first upgrading package to the current downloading partition; and when OTA upgrading is triggered, upgrading and flashing the vehicle controller based on the first upgrading package of the currently downloaded partition, and interchanging the partition flag bits of the first partition and the second partition. According to the invention, the external FLASH is subjected to A / B partitioning, so that the stability and reliability of OTA upgrading are improved; the two partitions in the external FLASH are used as the downloading area and the backup area in turn, so that the time for backing up the currently used version is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle control technology, and in particular to a vehicle controller flashing method and device. Background Art

[0002] As the EE architecture develops from distributed to cross-domain integration, there is a trend of moving strategies to the central controller and driving them to regional controllers, making the functions of new energy vehicles more and more complex, diverse and integrated.

[0003] When performing whole-vehicle OTA for new energy vehicles, the upgrade packages for OTA upgrades are getting larger and larger due to the complexity and diversity of their functions and the integrated characteristics of their controllers. At the same time, due to the functional integration characteristics of their controllers, the safety and reliability of OTA upgrades need to be further guaranteed, and the backup of A / B partition upgrade packages is essential. However, the built-in FLASH of the general controller MCU cannot perform A / B partition upgrade backup due to insufficient storage capacity. During the upgrade process, it is easy to fail to automatically end the upgrade or perform version rollback due to problems with the upgrade package, resulting in vehicle failures. At the same time, due to the large size of the upgrade package, it will take longer to download the upgrade package online, resulting in a poor user experience. Summary of the invention

[0004] The present invention provides a vehicle controller flashing method and device, which divides an external FLASH into A / B partitions, and uses the A / B partitions in the external FLASH as a download area and a backup area in turn, saving time for backing up the currently used version and improving the stability and reliability of OTA upgrades.

[0005] In order to solve the above technical problems, the present invention provides a vehicle controller flashing method, which is implemented based on an external FLASH electrically connected to the vehicle controller; the external FLASH includes a first partition and a second partition; the vehicle controller flashing method includes:

[0006] Upon receiving the OTA upgrade instruction, identifying the partition flags of the first partition and the second partition to determine the current download partition; wherein the partition flags include download and backup;

[0007] Obtain a first upgrade package required for OTA upgrade by parsing the OTA upgrade instruction, and download the first upgrade package to the current download partition;

[0008] When the OTA upgrade is triggered, the vehicle controller is upgraded and flashed based on the first upgrade package of the currently downloaded partition, and the partition flags of the first partition and the second partition are swapped.

[0009] When receiving an OTA upgrade instruction, the present invention directly identifies and judges the partition flags of the first partition and the second partition of the external FLASH, obtains the current download area of ​​the external FLASH, uses the external FLASH to complete the download of the first upgrade package, and stores the downloaded firmware in the current download area of ​​the external FLASH, thereby solving the problem of unsafe and unreliable upgrade caused by the inability to perform A / B partitioning due to insufficient built-in storage FLASH capacity of the vehicle controller itself; the present invention uses the A / B partitions in the external FLASH as the download area and the backup area in turn by exchanging the partition flags, thereby saving the time for backing up the currently used version and ensuring the stability and reliability of the OTA upgrade.

[0010] Furthermore, after the vehicle controller is upgraded and flashed by the first upgrade package based on the currently downloaded partition, and the partition flag bits of the first partition and the second partition are swapped, the method further includes:

[0011] When the OTA upgrade fails, the vehicle controller is upgraded and flashed based on the backup upgrade package of the currently downloaded partition, and the partition flags of the first partition and the second partition are swapped.

[0012] The present invention performs A / B partition upgrade backup in an external FLASH. When an OTA upgrade fails, the backup upgrade package in the external FLASH is flashed to avoid the vehicle from becoming bricked.

[0013] Furthermore, the vehicle controller flashing method further includes:

[0014] When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed.

[0015] The present invention uses an upgrade time threshold to determine whether an OTA upgrade is successful. If the OTA upgrade time is greater than the upgrade time threshold, the OTA upgrade is judged to have failed, and a subsequent version rollback operation is performed to avoid the situation where the upgrade cannot be automatically terminated during the upgrade flashing process, resulting in the user being unable to use the vehicle.

[0016] Furthermore, when the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed, specifically:

[0017] Determine an upgrade time threshold according to the size of the first upgrade package;

[0018] When performing OTA upgrades, monitor the OTA upgrade time in real time;

[0019] When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed.

[0020] The present invention sets an upgrade time threshold according to the size of the first upgrade package downloaded, and monitors the OTA upgrade time in real time during OTA upgrade. The upgrade time threshold can be compared with the OTA upgrade time in time. Once the OTA upgrade time is greater than the upgrade time threshold, a version rollback operation is triggered to maintain the normal operation of the vehicle and improve user experience.

[0021] Further, the first upgrade package based on the currently downloaded partition is used to upgrade the vehicle controller, specifically:

[0022] The first upgrade package of the current download partition is copied to the internal application area.

[0023] Further, downloading the first upgrade package to the current download partition is specifically:

[0024] The first upgrade package is downloaded in background mode, and the first upgrade package is stored in the current download partition.

[0025] The present invention utilizes an external FLASH to perform background downloading of the first upgrade package, and can also realize the downloading of the upgrade package during the driving process of the vehicle, thus saving the user's waiting time and improving the user experience.

[0026] Further, downloading the first upgrade package to the current download partition further includes:

[0027] If there is a historical upgrade package in the current download partition, the first upgrade package is downloaded to the current download partition and overwrites the historical upgrade package.

[0028] When the first upgrade package is downloaded to the current download area, the present invention directly overwrites the upgrade package of the historical version with the first upgrade package, thereby saving the memory space of the external FLASH.

[0029] Furthermore, the triggering of OTA upgrade is specifically:

[0030] When the vehicle OTA upgrade conditions are met, the OTA upgrade is triggered.

[0031] After downloading the upgrade package, the present invention monitors data related to the vehicle OTA upgrade conditions in real time, and triggers the OTA upgrade only when the vehicle OTA upgrade conditions are met, so as to improve the system stability during the upgrade.

[0032] Further, after the vehicle controller is upgraded and flashed by the first upgrade package based on the currently downloaded partition, the method further includes:

[0033] When the OTA upgrade is successful, a success signal will be fed back;

[0034] When the OTA upgrade fails, an upgrade failure signal is fed back.

[0035] When the OTA upgrade is completed, the present invention feeds back a corresponding signal according to the upgrade result to improve the communication efficiency between devices.

[0036] Accordingly, the present invention provides a vehicle controller flashing device, which is applied to an external FLASH electrically connected to the vehicle controller; the external FLASH includes a first partition and a second partition; the vehicle controller flashing device includes: a partition identification module, a download module and a flashing module;

[0037] The partition identification module is used to identify the partition flags of the first partition and the second partition to determine the current download partition when receiving the OTA upgrade instruction; wherein the partition flags include download and backup;

[0038] The download module is used to obtain a first upgrade package required for OTA upgrade by parsing the OTA upgrade instruction, and download the first upgrade package to the current download partition;

[0039] The flashing module is used to upgrade and flash the vehicle controller based on the first upgrade package of the currently downloaded partition when an OTA upgrade is triggered, and to swap the partition flags of the first partition and the second partition. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A schematic flow chart of an embodiment of a vehicle controller flashing method provided by the present invention;

[0041] Figure 2 A schematic structural diagram of an embodiment of a vehicle controller flashing system provided by the present invention;

[0042] Figure 3 A schematic diagram of a flow chart of an embodiment of the upgrade package downloading method provided by the present invention;

[0043] Figure 4 A schematic diagram of a flow chart of another embodiment of the upgrade package downloading method provided by the present invention;

[0044] Figure 5 A schematic structural diagram of an embodiment of a vehicle controller flashing device provided by the present invention. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0047] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0048] Example 1

[0049] See also Figure 1 , is a flow chart of an embodiment of a vehicle controller flashing method provided by the present invention, the vehicle controller flashing method is implemented based on an external FLASH electrically connected to the vehicle controller; the external FLASH includes a first partition and a second partition; the vehicle controller flashing method includes steps 101 to 103, each step is as follows:

[0050] Step 101: upon receiving an OTA upgrade instruction, identifying the partition flags of the first partition and the second partition to determine the current download partition; wherein the partition flags include download and backup.

[0051] Optional, see Figure 2 , a schematic diagram of the structure of an embodiment of the vehicle controller flashing system provided by the present invention, the system is used to implement the vehicle controller flashing method, the system includes a cloud server and a vehicle end. Among them, a secure connection is established between the vehicle end and the cloud server through T-BOX, the latest or updateable firmware upgrade package in the cloud server can be transmitted to the vehicle end central controller VDC through T-BOX, and then the OTA upgrade management module performs OTA upgrade on the vehicle controller to complete the upgrade flashing of the vehicle controller.

[0052] Optionally, the built-in storage of the vehicle controller includes a boot area, an application area, and a download area. The download area is placed in an external FLASH electrically connected to the vehicle controller, and the upgrade backup can be completed in the external FLASH. The external FLASH includes two partitions with partition flags of download and backup.

[0053] Optionally, when the vehicle controller receives an OTA upgrade request sent by the cloud server, the OTA upgrade management module first reads the flag information of the two partitions in the external FLASH, determines the current download partition and the current backup partition of the external FLASH according to the flag information, and uses the current download partition as the available partition when downloading the firmware upgrade package.

[0054] The present invention electrically connects an external FLASH to the vehicle controller and uses the partitions in the external FLASH to download the firmware upgrade package, thereby solving the problem that the vehicle central controller cannot perform A / B partitioning due to insufficient built-in storage FLASH capacity, and improving the security and reliability of firmware upgrades.

[0055] Step 102: Obtain a first upgrade package required for OTA upgrade by parsing the OTA upgrade instruction, and download the first upgrade package to the current download partition.

[0056] Further, in the first embodiment of the present invention, downloading the first upgrade package to the current download partition is specifically:

[0057] The first upgrade package is downloaded in background mode, and the first upgrade package is stored in the current download partition.

[0058] Optionally, when an OTA upgrade instruction is received from the cloud server, the first upgrade package required for the OTA upgrade can be obtained by parsing the OTA upgrade instruction. The OTA upgrade management module sends a request to download the first upgrade package to the cloud server through T-BOX, and performs background download of the first upgrade package in the cloud through T-BOX, thereby downloading the first upgrade package required for the OTA upgrade to the current download partition of the external FLASH.

[0059] Optionally, after the first upgrade package required for OTA upgrade is downloaded, the OTA upgrade management module feeds back an upgrade package download completion signal, at which time the flag bit information of the two partitions of the external FLASH does not change.

[0060] The present invention utilizes an external FLASH to download the first upgrade package in the background, and can also download the upgrade package during vehicle driving, greatly shortening the OTA upgrade time, thereby saving the user's waiting time and improving the user experience.

[0061] Furthermore, in the first embodiment of the present invention, downloading the first upgrade package to the current download partition further includes:

[0062] If there is a historical upgrade package in the current download partition, the first upgrade package is downloaded to the current download partition and overwrites the historical upgrade package.

[0063] Optionally, when downloading the first upgrade package required for OTA upgrade to the current download partition of the external FLASH, if there is a historical upgrade package in the current download partition, the newly downloaded first upgrade package will overwrite the historical upgrade package, thereby saving memory space of the external FLASH.

[0064] Step 103: When the OTA upgrade is triggered, the vehicle controller is upgraded and flashed based on the first upgrade package of the currently downloaded partition, and the partition flags of the first partition and the second partition are swapped.

[0065] Further, in the first embodiment of the present invention, triggering the OTA upgrade is specifically as follows:

[0066] When the vehicle OTA upgrade conditions are met, the OTA upgrade is triggered.

[0067] Optionally, after the first upgrade package required for OTA upgrade is downloaded, the OTA upgrade management module determines whether the vehicle meets the OTA upgrade conditions, and triggers the OTA upgrade only when the vehicle OTA upgrade conditions are met, so as to improve the system stability during the upgrade. Among them, the OTA upgrade conditions may include that the vehicle gear is in P gear, the vehicle power state is ON, the battery power is greater than 90%, the battery voltage is greater than 11.5V, the communication state is not lost, and the vehicle speed is 0.

[0068] Further, in the first embodiment of the present invention, the vehicle controller is upgraded and flashed based on the first upgrade package of the currently downloaded partition, specifically:

[0069] The first upgrade package of the current download partition is copied to the internal application area.

[0070] Optionally, when it is determined that the vehicle meets the OTA upgrade conditions, the OTA upgrade is triggered, and the OTA upgrade management module copies the first upgrade package of the current download partition of the external FLASH to the internal application area in the vehicle. When the copy action is performed, the flag information of the two partitions in the external FLASH is exchanged, that is, the current download area is converted into the backup area, and the current backup area is converted into the download area, so as to perform the OTA upgrade.

[0071] Furthermore, in the first embodiment of the present invention, after the vehicle controller is upgraded and flashed based on the first upgrade package of the currently downloaded partition, the method further includes:

[0072] When the OTA upgrade is successful, a success signal will be fed back;

[0073] When the OTA upgrade fails, an upgrade failure signal is fed back.

[0074] Optionally, when the vehicle controller completes the upgrade flash, it will judge the current OTA upgrade status, feedback an upgrade success signal when the OTA upgrade is successful, feedback an upgrade failure signal when the OTA upgrade fails, and use the OTA upgrade management module to report the upgrade result to the cloud server.

[0075] When the OTA upgrade is completed, the present invention feeds back a corresponding signal according to the upgrade result to improve the communication efficiency between devices.

[0076] Furthermore, in the first embodiment of the present invention, after the vehicle controller is upgraded and flashed based on the first upgrade package of the currently downloaded partition, and the partition flag bits of the first partition and the second partition are swapped, the method further includes:

[0077] When the OTA upgrade fails, the vehicle controller is upgraded and flashed based on the backup upgrade package of the currently downloaded partition, and the partition flags of the first partition and the second partition are swapped.

[0078] Optionally, the feedback signal can be used to determine whether the current OTA upgrade is successful. If it fails, the OTA upgrade management module upgrades the vehicle controller based on the upgrade package in the current download area of ​​the external FLASH, and during the flashing process, controls the partition flags of the two partitions of the external FLASH to be swapped.

[0079] When the OTA upgrade fails, the present invention flashes the upgrade package in the current download area of ​​the external FLASH. At this time, the backup upgrade package is stored in the current download area of ​​the external FLASH, so the version rollback of the upgrade package can be achieved to avoid the bricking of the vehicle.

[0080] Furthermore, in the first embodiment of the present invention, it also includes:

[0081] When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed.

[0082] The present invention uses an upgrade time threshold to determine whether the OTA upgrade is successful. If the OTA upgrade time is greater than the upgrade time threshold, the OTA upgrade is judged to have failed, and a subsequent version rollback operation is performed to prevent unexpected situations from occurring during the upgrade flashing process, causing the controller to be in a flashing upgrade state all the time, making it impossible for the user to use the vehicle.

[0083] Further, in the first embodiment of the present invention, when the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade fails, specifically:

[0084] Determine an upgrade time threshold according to the size of the first upgrade package;

[0085] When performing OTA upgrades, monitor the OTA upgrade time in real time;

[0086] When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed.

[0087] Optionally, when downloading the first upgrade package required for OTA upgrade, the OTA upgrade management module can set an upgrade time threshold according to the size of the first upgrade package to determine whether the OTA upgrade is successful. When performing OTA upgrade, the OTA upgrade time is monitored in real time. If the upgrade process has not ended when the OTA upgrade time reaches the threshold, the OTA upgrade is judged to have failed, and the OTA upgrade management module automatically ends the OTA upgrade to avoid being unable to automatically end the upgrade during the upgrade flashing process, thereby maintaining the normal operation of the vehicle and improving the user experience.

[0088] As an example of the first embodiment of the present invention, see Figure 3 , is a flow chart of an embodiment of the upgrade package download method provided by the present invention. When the vehicle receives the first upgrade package, by reading the flag information of the two partitions of the external FLASH, it is determined that the V0 area is the backup area and the blank area is the download area, that is, Figure 3 At this time, download the V1 version of the firmware upgrade package to the blank area, that is, Figure 3 II state; when the vehicle meets the OTA upgrade conditions to trigger the OTA upgrade, the OTA upgrade management module copies the V1 firmware package in the download area of ​​the external FLASH to the APP area of ​​the on-chip Boot loader for upgrading, that is, Figure 3 At the same time, the flag information of the two partitions of the external FLASH is changed, that is, V0 becomes the download area and V1 becomes the backup area. Figure 3 After the upgrade is completed, the OTA upgrade management module reports the upgrade result. When the second upgrade is performed, T-BOX directly downloads the V2 version firmware upgrade package to the V0 area of ​​the external FLASH download area, overwriting the V0 version firmware package, that is, Figure 3 When the upgrade is triggered, the V2 version firmware is copied to the APP area on the chip, and the flag information of the two partitions of the external FLASH is changed, then V1 becomes the download area and V2 becomes the backup area, that is, Figure 3 VI status.

[0089] As an example of the first embodiment of the present invention, see Figure 4, is a flow chart of another embodiment of the upgrade package download method provided by the present invention. Assuming that the second upgrade fails, that is, the copying of the V2 version firmware to the on-chip APP area fails to be written, at this time, V1 in the external FLASH is the download area, and V2 is the backup area. The OTA upgrade management module then executes the operation of writing the firmware package in the external FLASH download area to the on-chip APP area again, that is, the available partition in the off-chip FLASH, that is, the download area, the V1 version firmware is copied to the on-chip APP area, completes the rollback writing, and changes the flag information of the two partitions of the external FLASH. At this time, V1 becomes the backup area, and V2 becomes the download area. In addition, when the second upgrade fails, it will not try to copy the V2 upgrade package to the on-chip APP area again. When the cloud server issues the next upgrade instruction, the V3 version firmware upgrade package is directly downloaded to the download area, that is, the V2 area, overwriting the V2 version firmware package, and performing the V3 version upgrade.

[0090] In summary, the first embodiment of the present invention provides a vehicle controller flashing method. When receiving an OTA upgrade instruction, the current download area of ​​the external FLASH is determined by identifying the partition flags of the first partition and the second partition in the external FLASH, and the first upgrade package is downloaded using the external FLASH. The downloaded firmware is stored in the current download area of ​​the external FLASH, which solves the problem that the vehicle central controller cannot perform A / B partitioning due to insufficient built-in storage FLASH capacity. When the upgrade flashing fails, the present invention uses the historical version in the external FLASH for rollback flashing to avoid the situation where the vehicle controller freezes due to the upgrade failure, thereby ensuring the stability and reliability of the vehicle upgrade. The present invention also interchanges the partition flags to use the A / B partitions in the external FLASH as the download area and the backup area in turn, saving the time for backing up the currently used version and ensuring the stability and reliability of the OTA upgrade.

[0091] Example 2

[0092] See also Figure 5 , is a schematic diagram of the structure of an embodiment of a vehicle controller flashing device provided by the present invention, the vehicle controller flashing device is applied to an external FLASH electrically connected to a vehicle controller; the external FLASH includes a first partition and a second partition; the vehicle controller flashing device includes: a partition identification module 201, a download module 202 and a flashing module 203;

[0093] The partition identification module 201 is used to identify the partition flags of the first partition and the second partition to determine the current download partition when receiving the OTA upgrade instruction; wherein the partition flags include download and backup;

[0094] The download module 202 is used to obtain a first upgrade package required for OTA upgrade by parsing the OTA upgrade instruction, and download the first upgrade package to the current download partition;

[0095] The flashing module 203 is used to upgrade and flash the vehicle controller based on the first upgrade package of the currently downloaded partition when the OTA upgrade is triggered, and to swap the partition flags of the first partition and the second partition.

[0096] Furthermore, in the second embodiment of the present invention, after upgrading and flashing the vehicle controller based on the first upgrade package of the currently downloaded partition and swapping the partition flags of the first partition and the second partition, it also includes:

[0097] When the OTA upgrade fails, the vehicle controller is upgraded and flashed based on the backup upgrade package of the currently downloaded partition, and the partition flags of the first partition and the second partition are swapped.

[0098] Furthermore, in the second embodiment of the present invention, it also includes:

[0099] When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed.

[0100] Further, in the second embodiment of the present invention, when the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade fails, specifically:

[0101] Determine an upgrade time threshold according to the size of the first upgrade package;

[0102] When performing OTA upgrades, monitor the OTA upgrade time in real time;

[0103] When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed.

[0104] Further, in the second embodiment of the present invention, the vehicle controller is upgraded and flashed based on the first upgrade package of the currently downloaded partition, specifically:

[0105] The first upgrade package of the current download partition is copied to the internal application area.

[0106] Further, in the second embodiment of the present invention, downloading the first upgrade package to the current download partition is specifically:

[0107] The first upgrade package is downloaded in background mode, and the first upgrade package is stored in the current download partition.

[0108] Furthermore, in the second embodiment of the present invention, downloading the first upgrade package to the current download partition further includes:

[0109] If there is a historical upgrade package in the current download partition, the first upgrade package is downloaded to the current download partition and overwrites the historical upgrade package.

[0110] Further, in the second embodiment of the present invention, triggering the OTA upgrade is specifically as follows:

[0111] When the vehicle OTA upgrade conditions are met, the OTA upgrade is triggered.

[0112] Furthermore, in the second embodiment of the present invention, after the vehicle controller is upgraded and flashed based on the first upgrade package of the currently downloaded partition, the method further includes:

[0113] When the OTA upgrade is successful, a success signal will be fed back;

[0114] When the OTA upgrade fails, an upgrade failure signal is fed back.

[0115] In summary, the second embodiment of the present invention provides a vehicle controller flashing device, which is based on the organic combination of modules. When receiving an OTA upgrade instruction, by identifying the partition flags of the first partition and the second partition in the external FLASH, the current download area of ​​the external FLASH is determined, the first upgrade package is downloaded using the external FLASH, and the downloaded firmware is stored in the current download area of ​​the external FLASH, which solves the problem that the vehicle central controller cannot perform A / B partitioning due to insufficient built-in storage FLASH capacity. When the upgrade flashing fails, the present invention uses the historical version in the external FLASH for rollback flashing to avoid the situation where the vehicle controller crashes due to the upgrade failure, thereby ensuring the stability and reliability of the vehicle upgrade. The present invention also interchanges the partition flags to use the A / B partitions in the external FLASH as the download area and the backup area in turn, saving the time for backing up the currently used version and ensuring the stability and reliability of the OTA upgrade.

[0116] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A vehicle controller flashing method, characterized in that: Based on external FLASH electrically connected to the vehicle controller; The external FLASH includes a first partition and a second partition; the vehicle controller flash writing method includes: Upon receiving the OTA upgrade instruction, identifying the partition flags of the first partition and the second partition to determine the current download partition; wherein the partition flags include download and backup; Obtain a first upgrade package required for OTA upgrade by parsing the OTA upgrade instruction, and download the first upgrade package to the current download partition; When the OTA upgrade is triggered, the vehicle controller is upgraded and flashed based on the first upgrade package of the currently downloaded partition, and the partition flags of the first partition and the second partition are swapped.

2. The vehicle controller flashing method according to claim 1, characterized in that: After the vehicle controller is upgraded and flashed by the first upgrade package based on the currently downloaded partition, and the partition flag bits of the first partition and the second partition are swapped, the method further includes: When the OTA upgrade fails, the vehicle controller is upgraded and flashed based on the backup upgrade package of the currently downloaded partition, and the partition flags of the first partition and the second partition are swapped.

3. The vehicle controller flashing method according to claim 2, characterized in that: Also includes: When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed.

4. The vehicle controller flashing method according to claim 3, characterized in that: When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed, specifically: Determine an upgrade time threshold according to the size of the first upgrade package; When performing OTA upgrades, monitor the OTA upgrade time in real time; When the OTA upgrade time is greater than the upgrade time threshold, it is determined that the OTA upgrade has failed.

5. The vehicle controller flashing method according to claim 1, characterized in that: The upgrading and flashing of the vehicle controller based on the first upgrade package of the currently downloaded partition is specifically: The first upgrade package of the current download partition is copied to the internal application area.

6. The vehicle controller flashing method according to claim 1, characterized in that: The downloading of the first upgrade package to the current download partition is specifically: The first upgrade package is downloaded in background mode, and the first upgrade package is stored in the current download partition.

7. The vehicle controller flashing method according to claim 6, characterized in that: The step of downloading the first upgrade package to the current download partition further includes: If there is a historical upgrade package in the current download partition, the first upgrade package is downloaded to the current download partition and overwrites the historical upgrade package.

8. The vehicle controller flashing method according to claim 1, characterized in that: The triggering of OTA upgrade is specifically: When the vehicle OTA upgrade conditions are met, the OTA upgrade is triggered.

9. The vehicle controller flashing method according to claim 1, characterized in that: After the vehicle controller is upgraded and flashed by the first upgrade package based on the currently downloaded partition, the method further includes: When the OTA upgrade is successful, a success signal will be fed back; When the OTA upgrade fails, an upgrade failure signal is fed back.

10. A vehicle controller flashing device, characterized in that: An external FLASH electrically connected to a vehicle controller; the external FLASH includes a first partition and a second partition; the vehicle controller flashing device includes: a partition identification module, a download module and a flashing module; The partition identification module is used to identify the partition flags of the first partition and the second partition to determine the current download partition when receiving the OTA upgrade instruction; wherein the partition flags include download and backup; The download module is used to obtain a first upgrade package required for OTA upgrade by parsing the OTA upgrade instruction, and download the first upgrade package to the current download partition; The flashing module is used to upgrade and flash the vehicle controller based on the first upgrade package of the currently downloaded partition when an OTA upgrade is triggered, and to swap the partition flags of the first partition and the second partition.