ECU (Electronic Control Unit) upgrading method, device, equipment, medium and vehicle
By responding to the upgrade instructions in the ECU, the boot upgrade data is copied from the application partition to the boot load partition, which solves the problem of not supporting BOOT upgrades or large storage space in the existing technology, and realizes efficient ECU upgrades, reduces costs and provides power-down protection.
Patent Information
- Application Number
- CN202311531743.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-16
- Publication Date
- 2025-05-16
AI Technical Summary
The existing ECU upgrade method does not support BOOT upgrades, or it needs to occupy a lot of storage space, resulting in an increase in the overall cost of ECU.
By responding to the upgrade instruction, the boot upgrade data is obtained and written to the application partition. When the ECU restarts and runs the pre-boot program, the boot upgrade data is copied from the application partition to the boot loading partition, and the boot loader is booted from the boot loading partition to realize the upgrade of the boot loader.
It realizes the successive upgrade of boot loaders and applications, reduces the storage space usage, reduces the storage cost of ECU upgrade solutions, and provides power outage protection during the upgrade process, improving the convenience of ECU upgrade.
Smart Images

Figure CN120010877A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of vehicle upgrade, and in particular, relates to an ECU upgrade method, device, equipment, medium and vehicle. Background Art
[0002] With the continuous development of the new energy vehicle field, the number of ECUs (Electronic Control Units) in cars is increasing, and the demand for OTA (Over-the-Air Technology) functions is also increasing. Therefore, the BOOT (Bootloader) function of ECU to achieve self-upgrade of software has become an essential function for vehicles.
[0003] Usually, the storage area in a single ECU is divided into a boot loader partition and an application partition. The boot loader partition stores the boot loader BOOT, and the application partition stores the application APP. As a boot loader, BOOT can implement OTA of APP.
[0004] However, there are certain defects in the ECU upgrade method in the related technology. Some ECU upgrade methods do not support BOOT upgrades, while other ECU upgrade methods support BOOT upgrades but require more storage space, resulting in an increase in the overall cost of the ECU. Summary of the invention
[0005] The embodiments of the present application provide an ECU upgrade method, device, equipment, medium and vehicle, which can improve the problem that the existing ECU upgrade method has certain defects.
[0006] In a first aspect, an embodiment of the present application provides an ECU upgrade method, the ECU upgrade method comprising:
[0007] In response to the upgrade instruction, obtaining boot upgrade data and writing it into the application partition; wherein the boot upgrade data is update data of the boot loader;
[0008] When the ECU is restarted and the pre-boot program is running, the boot upgrade data is copied from the application partition to the boot loading partition, and the boot loading program is boot loaded from the boot loading partition; wherein the pre-boot program is stored in the pre-boot partition;
[0009] Obtain application upgrade data and write it to the application partition; wherein the application upgrade data is update data of the application program;
[0010] When the ECU restarts and runs the upgraded bootloader, the application is bootloaded from the application partition.
[0011] In some embodiments, in response to the upgrade instruction, obtaining the boot upgrade data and writing it to the application partition includes:
[0012] In response to the upgrade instruction, the boot loader is run, and boot upgrade data is acquired through the boot loader;
[0013] Erase the original program data in the application partition;
[0014] Write the boot upgrade data to the application partition.
[0015] In some embodiments, after obtaining the boot upgrade data and writing it to the application partition, the method further includes:
[0016] Verify the written boot upgrade data to obtain the verification result;
[0017] When the verification result is successful, a first startup parameter is set; wherein the first startup parameter is used to indicate an application partition storing boot upgrade data.
[0018] In some embodiments, when the ECU is restarted and the pre-boot program is run, the boot upgrade data is copied from the application partition to the boot loader partition, and the boot loader is boot loaded from the boot loader partition, including:
[0019] Use the pre-boot program to erase the original program data of the boot loading partition;
[0020] Based on the first startup parameter, copying the boot upgrade data from the application partition to the boot loading partition;
[0021] Boot the boot loader from the boot partition.
[0022] In some embodiments, before erasing the original program data of the boot loading partition using the pre-boot program, the process further includes:
[0023] When the ECU is restarted, the abnormal monitoring program is turned on;
[0024] When the abnormality monitoring program detects that the boot loading is abnormal, the copying of the boot upgrade data is stopped;
[0025] The pre-boot program is used to boot load the original program data of the boot load partition.
[0026] In some embodiments, obtaining application upgrade data and writing it to the application partition includes:
[0027] In response to the application program flashing instruction, obtaining application upgrade data using the upgraded boot loader;
[0028] Erase the boot upgrade data in the application partition;
[0029] Write application upgrade data to the application partition.
[0030] In a second aspect, an embodiment of the present application further provides an ECU upgrade device, the ECU upgrade device comprising:
[0031] A first writing module is used to obtain boot upgrade data and write it into the application partition in response to the upgrade instruction; wherein the boot upgrade data is update data of the boot loader;
[0032] A first boot module is used for copying boot upgrade data from the application partition to the boot loading partition and boot loading the boot loading program from the boot loading partition when the ECU is restarted and the pre-boot program is running; wherein the pre-boot program is stored in the pre-boot partition;
[0033] The second writing module is used to obtain application upgrade data and write it into the application partition; wherein the application upgrade data is update data of the application program;
[0034] The second boot module is used for boot-loading the application program from the application partition when the ECU is restarted and runs the upgraded boot loader.
[0035] In a third aspect, an embodiment of the present application further provides an ECU upgrade device, the ECU upgrade device comprising: a processor and a memory storing computer program instructions;
[0036] When the processor executes the computer program instructions, the ECU upgrade method of the first aspect is implemented.
[0037] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the ECU upgrade method of the first aspect is implemented.
[0038] In a fifth aspect, an embodiment of the present application further provides a vehicle, the vehicle comprising at least one of the ECU upgrade device of the second aspect, the ECU upgrade equipment of the third aspect, or the computer-readable storage medium of the fourth aspect.
[0039] The ECU upgrade method, device, equipment, medium and vehicle provided in the embodiment of the present application can write the boot upgrade data to the application partition by responding to the upgrade instruction, and copy the boot upgrade data from the application partition to the boot loading partition through the pre-boot program, so as to boot load the boot loader from the boot loading partition to realize the upgrade of the boot loader. When the upgraded boot loader is running, the application upgrade data can be written to the application partition, and the application program can be boot loaded from the partition to realize the upgrade of the application. By adopting a single boot loading partition and a single application partition, the boot loader and the application program can be upgraded successively. Compared with the method of using multiple data partitions to realize the upgrade in the related art, the storage space occupied can be reduced, thereby reducing the storage cost of the ECU upgrade solution. Moreover, after the boot upgrade data is written to the application partition and before it is copied to the boot loading partition, if the ECU loses power, it will not affect the original boot loader in the boot loading partition. When power is lost during the upgrade process, power-off protection can be realized, which improves the convenience of ECU upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 It is a flowchart of an ECU upgrade method provided by an embodiment of the present application;
[0042] Figure 2 is a flowchart of an ECU upgrade method provided by another embodiment of the present application;
[0043] Figure 3 It is a flowchart of an ECU upgrade method provided by another embodiment of the present application;
[0044] Figure 4 is a flowchart of an ECU upgrade method provided in yet another embodiment of the present application;
[0045] Figure 5 is a flowchart of an ECU upgrade method provided in yet another embodiment of the present application;
[0046] Figure 6 A schematic diagram of the structure of an ECU upgrade device provided in one embodiment of the present application;
[0047] Figure 7 A schematic diagram of the structure of an ECU upgrade device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0050] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0051] With the continuous development of the new energy vehicle field, the number of ECUs (Electronic Control Units) in cars is increasing, and the demand for OTA (Over-the-Air Technology) functions is also increasing. Therefore, the BOOT (Bootloader) function of ECU to achieve self-upgrade of software has become an essential function for vehicles.
[0052] Usually, the storage area in a single ECU is divided into a boot loader partition and an application partition. The boot loader partition stores the boot loader BOOT, and the application partition stores the application APP. As a boot loader, BOOT can implement OTA of APP.
[0053] However, there are certain defects in the ECU upgrade method in the related technology. Some ECU upgrade methods do not support BOOT upgrades, while other ECU upgrade methods support BOOT upgrades but require more storage space, resulting in an increase in the overall cost of the ECU.
[0054] In order to solve the above technical problems, the embodiments of the present application provide an ECU upgrade method, device, equipment, medium and vehicle. The ECU upgrade method provided by the embodiments of the present application is described in detail below through some embodiments and their application scenarios in conjunction with the accompanying drawings.
[0055] Figure 1 The following is a flow chart of an ECU upgrade method provided by an embodiment of the present application. The ECU upgrade method includes:
[0056] S110, in response to the upgrade instruction, obtaining boot upgrade data and writing it into the application partition; wherein the boot upgrade data is update data of the boot loader;
[0057] S120, when the ECU is restarted and the pre-boot program is running, the boot upgrade data is copied from the application partition to the boot loading partition, and the boot loading program is boot loaded from the boot loading partition; wherein the pre-boot program is stored in the pre-boot partition;
[0058] S130, obtaining application upgrade data and writing it to the application partition; wherein the application upgrade data is update data of the application program;
[0059] S140: When the ECU is restarted and the upgraded boot loader is running, the application is boot-loaded from the application partition.
[0060] The ECU upgrade method provided in the embodiment of the present application is applied to an ECU upgrade device. The ECU upgrade device can realize the upgrade of the boot loader BOOT and the application APP in the ECU, thereby ensuring the user experience. The following is an example of an ECU in a car.
[0061] In this embodiment, the device can write the boot upgrade data to the application partition by responding to the upgrade instruction, and copy the boot upgrade data from the application partition to the boot loading partition through the pre-boot program, so as to boot load the boot loader from the boot loading partition to achieve the upgrade of the boot loader. When the upgraded boot loader is running, the application upgrade data can be written to the application partition, and the application program can be boot loaded from the partition to achieve the upgrade of the application. By adopting a single boot loading partition and a single application partition, the boot loader and the application program can be upgraded successively. Compared with the method of using multiple data partitions to achieve the upgrade in the related art, the storage space occupied can be reduced, thereby reducing the storage cost of the ECU upgrade solution. Moreover, after the boot upgrade data is written to the application partition and before it is copied to the boot loading partition, if the ECU loses power, it will not affect the original boot loader in the boot loading partition. When power is lost during the upgrade process, power-off protection can be achieved, which improves the convenience of ECU upgrade.
[0062] In S110, the device may respond to the upgrade instruction to upgrade the boot loader and the application respectively. The upgrade instruction may be triggered by a user, for example, by a user inside the vehicle, or by a user through a mobile device or other smart device that has a communication function with the vehicle, or by a car manufacturer through communication with the vehicle for directional triggering or range triggering. The user inside the vehicle may trigger the upgrade instruction by pressing an upgrade button inside the vehicle, by clicking on a related control on the display screen inside the vehicle, or by using voice inside the vehicle, and there is no limitation here.
[0063] After receiving the upgrade instruction, the device can communicate with the server and obtain the boot upgrade data. The boot upgrade data is the update data of the boot loader. After obtaining the boot upgrade data, the device can write the boot upgrade data into the application partition.
[0064] The application partition may be an independent storage partition in the storage module of the ECU, and the application partition may be independent of the pre-boot partition and the boot-loading partition. When the ECU is started, the application stored in the application partition may be run to implement the corresponding function of the ECU.
[0065] It is understandable that in order for the ECU to implement the corresponding functions, it is necessary to boot and load the program data stored in the application partition at startup. After the boot upgrade data is written to the application partition, the original program data in the application partition will be overwritten by the boot upgrade data. Therefore, before the application is upgraded, the application partition no longer stores the program data of the application, and therefore the ECU cannot implement the corresponding application functions before the upgrade process is completed.
[0066] Please refer to Figure 2 As an optional embodiment, the above S110 may include:
[0067] S210, in response to the upgrade instruction, running a boot loader program, and obtaining boot upgrade data through the boot loader program;
[0068] S220, erasing the original program data in the application partition;
[0069] S230, writing the boot upgrade data into the application partition.
[0070] In this embodiment, the device may run a boot loader based on the upgrade instruction to obtain the boot upgrade data. The boot loader may erase the original program data in the application partition and then write the boot upgrade data into the application partition.
[0071] In S210, the device may select a boot loading partition from the two boot loading partitions in response to the upgrade instruction and run the boot loading program stored in the boot loading partition. The boot loading program can communicate with a server or other device storing boot upgrade data to obtain the boot upgrade data.
[0072] In S220, the device can erase the original program data in the application partition based on the running boot loader. The application partition after data erasure can be used to store boot upgrade data.
[0073] In S230, after erasing the original program data in the application partition, the device may write the boot upgrade data into the application partition.
[0074] Please refer to Figure 3 As an optional embodiment, after the above S110, the following may also be included:
[0075] S310, verifying the written boot upgrade data to obtain a verification result;
[0076] S320: If the verification result is successful, set a first startup parameter; wherein the first startup parameter is used to indicate an application partition storing boot upgrade data.
[0077] In this embodiment, after writing the boot upgrade data, the device may verify it, and after the verification is successful, a first startup parameter may be set so that the pre-boot program can identify the application partition storing the boot upgrade data according to the first startup parameter.
[0078] In S310, after writing the boot upgrade data into the application partition, the device may verify the boot upgrade data written into the application partition and obtain a verification result.
[0079] As an optional implementation, the device can obtain verification and comparison data of the boot upgrade data when obtaining the boot upgrade data. Of course, the device can also obtain the verification and comparison data before obtaining the boot upgrade data, or obtain the verification and comparison data after obtaining the boot upgrade data.
[0080] After the device writes the boot upgrade data to the application partition, it can process the boot upgrade data using a pre-set verification algorithm to obtain the data to be verified, and match the data to be verified with the verification comparison data. If the data to be verified matches the verification comparison data successfully, it means that the verification is successful; if the data to be verified fails to match the verification comparison data, it means that the verification result is a verification failure. For example, the device can pre-store the MD5 digest algorithm or other related algorithms that can realize program data verification, and when the device obtains the boot upgrade data, it can also obtain the verification code provided by the server. After the device writes the boot upgrade data to the application partition, it can calculate the boot upgrade data through a pre-stored algorithm to obtain the corresponding calculation result, and match the calculation result with the verification code provided by the server. If the calculation result is consistent with the verification code, it means that the verification is successful, otherwise it means that the verification failed. The verification algorithm of the device for the boot upgrade data can also be a hash algorithm such as SHA-1 and SHA-256 or other verification algorithms that can realize program data, which are not limited here.
[0081] When the verification fails, it means that the boot upgrade data obtained by the device is abnormal, and the ECU upgrade process can be stopped at this time. When the verification fails, the boot upgrade data has not been copied from the application partition to the boot load partition. At this time, stopping the ECU upgrade process will not affect the original boot loader stored in the boot load partition. This allows the original boot loader to continue to run after the ECU upgrade fails.
[0082] In S320, when the verification result is successful, the device may set the first startup parameter.
[0083] After determining the boot load upgrade mode, the device can set a first startup parameter. The first startup parameter can indicate the application partition storing the boot upgrade data. That is, when the ECU is restarted, the device can determine that the application partition stores the boot upgrade data according to the first startup parameter, and continue to execute the boot upgrade data copy process in the following steps.
[0084] In S120, after the device writes the boot upgrade data into the application partition, the ECU can be restarted. The restarted ECU can run a pre-boot program, which can be stored in a pre-boot partition in the storage module of the ECU. The pre-boot partition is also independent of the above-mentioned boot loading partition and application partition.
[0085] When the boot loader needs to be upgraded, the ECU will not directly run the boot loader after restarting, but will run the pre-boot program. The pre-boot program can determine the application partition that stores the boot upgrade data, and copy the boot upgrade data from the application partition to the boot load partition, and then boot load the boot loader from the boot load partition. For example, before the ECU is restarted, the ECU runs the original boot loader, and the original boot loader can obtain the boot upgrade data, which is the upgraded boot loader. After the ECU is restarted, the ECU can copy the boot upgrade data from the application partition that stores the boot upgrade data to the boot load partition through the pre-boot program, and then boot load the boot loader from the boot load partition, thereby running the upgraded boot loader.
[0086] After the boot upgrade data is written to the application partition, since the memory to which the application partition belongs is a non-volatile memory, even if power is lost at this time, the boot upgrade data stored in the application partition will not be lost. When the ECU is powered on again, the boot upgrade data in the application partition can be read and copied through the pre-boot program to achieve power-off protection during the boot loader upgrade process.
[0087] Before the boot upgrade data is copied to the boot loader partition, the original boot loader program in the boot loader partition will not be overwritten. Therefore, after the boot upgrade data is written to the application partition and before the boot upgrade data is copied to the boot loader partition, if the ECU has an abnormal power failure, it will not affect the original boot loader program in the boot loader partition. After an abnormal power failure, the ECU can still run the original boot loader program in the boot loader partition, thereby realizing power failure protection during the upgrade process and improving the convenience of ECU upgrades.
[0088] Please refer to Figure 4 As an optional embodiment, the above S120 may include:
[0089] S410, using the pre-boot program to erase the original program data of the boot loading partition;
[0090] S420, based on the first startup parameter, copy the boot upgrade data from the application partition to the boot loading partition;
[0091] S430, boot-load the boot loader program from the boot loader partition.
[0092] In this embodiment, after the pre-boot program determines that the boot upgrade data is stored in the application partition, it can erase the original program data of the boot loading partition and copy the boot upgrade data stored in the application partition to the boot loading partition. After completing the data copy, the pre-boot program can boot load the boot loader from the boot loading partition to realize the operation of the upgraded boot loader.
[0093] In S410, the device may run the pre-boot program after the ECU is restarted, and erase the original program data in the boot loading partition through the pre-boot program.
[0094] It is understandable that the original program data in the boot loader partition is the original boot loader. After erasing the original program data, the ECU will not be able to run the boot loader before rewriting the upgraded boot upgrade data.
[0095] In S420, after the ECU is restarted, the device can determine based on the first startup parameter that the boot upgrade data is stored in the application partition. In order to write the boot upgrade data to the boot load partition, the boot upgrade data in the application partition can be copied to the boot load partition through the pre-boot program.
[0096] After the boot upgrade data in the application partition is copied to the boot loading partition, both the boot loading partition and the application partition store the boot upgrade data.
[0097] In S430, after the boot loader partition stores the boot upgrade data, the device may use the pre-boot program to boot load the boot loader program from the boot loader partition to implement the upgrade of the boot loader program.
[0098] Please refer to Figure 5 As an optional embodiment, before S410, the following steps may also be included:
[0099] S510, when the ECU is restarted, the abnormality monitoring program is started;
[0100] S520, when the abnormality monitoring program detects that the boot loading is abnormal, stop copying the boot upgrade data;
[0101] S530: Use the pre-boot program to boot-load the original program data of the boot-load partition.
[0102] In this embodiment, during the process of ECU restarting and copying boot upgrade data, an abnormality monitoring program can be started. If the abnormality monitoring program detects that there is an abnormality in the upgrade process of the boot loader before the original program data of the boot loading partition is erased, the device can stop copying the boot upgrade data so that the boot loading partition can retain the original program data. When the boot loading partition retains the original program data, the original boot loader can continue to run to realize the boot loading and upgrade of the application program, which will not affect the function realization of the ECU.
[0103] In S510, when the ECU is restarted, the device may start an abnormal monitoring program before copying data of the application partition storing the boot upgrade data by running the pre-boot program. The abnormal monitoring program may be a watchdog or other monitoring controls.
[0104] In S520, during the upgrade process of the boot loader, if the abnormality monitoring program detects that an abnormality occurs in the boot loading process before the pre-boot program copies data, the copying of the boot upgrade data may be stopped.
[0105] It is understandable that, before data copying is performed, the original program data stored in the boot loading partition is the boot loading program that can run normally. Stopping the copying in time when an abnormality occurs can prevent the original program data stored in the boot loading partition from being overwritten.
[0106] In S530, after the pre-boot program stops copying the boot upgrade data, the pre-boot program can boot load the original program data of the boot load partition, so that after the upgrade of the boot loader fails, the original boot loader can continue to run. The original boot loader can normally implement the boot loading and upgrade of the application program, so as not to affect the function of the ECU.
[0107] As an optional embodiment, the above S130 may include:
[0108] S610, in response to the application program flashing instruction, obtaining application upgrade data using the upgraded boot loader;
[0109] S620, erasing the boot upgrade data in the application partition;
[0110] S630, writing the application upgrade data into the application partition.
[0111] In this embodiment, after the boot loader is upgraded, the ECU normally runs the upgraded boot loader, which can obtain the application upgrade data and write the application upgrade data into the application partition from which the boot upgrade data has been erased.
[0112] In S610, the device may respond to the application program flashing instruction and run the upgraded boot loader. The upgraded boot loader can communicate with the server or other devices storing boot upgrade data to obtain application upgrade data. The application upgrade data is the update data of the application program.
[0113] In S620, since the boot upgrade data previously written into the boot loading partition is copied from the application partition, the program data stored in the application partition at this time is not the program data of the application program, but the boot upgrade data. Therefore, before writing the application upgrade data into the application partition, the boot upgrade data in the application partition needs to be erased.
[0114] In S630, after erasing the original boot upgrade data in the application partition, the device may write the application upgrade data into the application partition.
[0115] In S140, after the device writes the application upgrade data into the application partition, the ECU may be restarted. The restarted ECU may run the upgraded boot loader.
[0116] When the application needs to be upgraded, the ECU will not directly run the application after restarting, but will run the upgraded boot loader. The upgraded boot loader can boot load the application from the application partition. For example, before the ECU is restarted, the ECU runs the original application. After the ECU is restarted, the upgraded boot loader can boot load the application from the application partition, thereby running the upgraded application.
[0117] It is understandable that in the related art, even after the boot loader is updated, before the ECU is restarted, the original boot loader is still used to upgrade the application. In the embodiment of the present application, after the boot loader is upgraded and updated, the upgraded boot loader can be immediately run to upgrade the application, thereby timely avoiding the problems caused by the original boot loader upgrading the application. In addition, in order to achieve the upgrade of the boot loader and the application in the related art, it is usually necessary to set up multiple storage partitions. In this embodiment, a single boot loader partition and a single application partition can be used to achieve the upgrade of the boot loader and the application in sequence, which can save the storage space required in the ECU and reduce the cost of the ECU upgrade solution.
[0118] It should be noted that, in the above embodiment, the storage module of the ECU can be divided into three independent storage partitions, namely a pre-boot partition, a boot loading partition and an application partition.
[0119] The present application also provides an ECU upgrade device, such as Figure 6 As shown, the ECU upgrade device includes:
[0120] The first writing module 601 is used to obtain the boot upgrade data and write it into the application partition in response to the upgrade instruction; wherein the boot upgrade data is the update data of the boot loader;
[0121] The first boot module 602 is used to copy the boot upgrade data from the application partition to the boot loading partition and boot load the boot loading program from the boot loading partition when the ECU is restarted and the pre-boot program is running; wherein the pre-boot program is stored in the pre-boot partition;
[0122] The second writing module 603 is used to obtain application upgrade data and write it into the application partition; wherein the application upgrade data is the update data of the application program;
[0123] The second boot module 604 is used to boot load the application program from the application partition when the ECU is restarted and runs the upgraded boot loader.
[0124] It should be noted that the ECU upgrade device is a device corresponding to the above-mentioned ECU upgrade method. All implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device and can achieve the same technical effect.
[0125] Figure 7 A schematic diagram of the hardware structure of the ECU upgrade device provided in an embodiment of the present application is shown.
[0126] The ECU upgrade device may include a processor 701 and a memory 702 storing computer program instructions.
[0127] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0128] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 702 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 702 may be inside or outside the ECU upgrade device. In a particular embodiment, the memory 702 is a non-volatile solid-state memory.
[0129] In certain embodiments, the memory 702 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0130] The processor 701 implements any one of the ECU upgrading methods in the above embodiments by reading and executing the computer program instructions stored in the memory 702 .
[0131] In one example, the ECU upgrade device may further include a communication interface 703 and a bus 710. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via a bus 710 and communicate with each other.
[0132] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0133] Bus 710 includes hardware, software or both, and couples the components of the ECU upgrade device to each other. For example, but not limitation, the bus may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-end bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, bus 710 may include one or more buses. Although the present application embodiment describes and illustrates a specific bus, the present application considers any suitable bus or interconnect.
[0134] In addition, in combination with the ECU upgrade method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the ECU upgrade methods in the above embodiment is implemented.
[0135] An embodiment of the present application also provides a vehicle, which may include at least one of the above-mentioned ECU upgrade device, ECU upgrade equipment or computer-readable storage medium.
[0136] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0137] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0138] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0139] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0140] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. An ECU upgrade method, characterized in that: The ECU upgrade method comprises: In response to the upgrade instruction, obtaining boot upgrade data and writing it into the application partition; wherein the boot upgrade data is update data of the boot loader; When the ECU is restarted and the pre-boot program is running, the boot upgrade data is copied from the application partition to the boot loading partition, and the boot loading program is boot-loaded from the boot loading partition; wherein the pre-boot program is stored in the pre-boot partition; Acquire application upgrade data and write it into the application partition; wherein the application upgrade data is update data of the application program; When the ECU is restarted and runs the upgraded boot loader, the application is boot loaded from the application partition.
2. The ECU upgrade method according to claim 1, characterized in that: The step of obtaining the boot upgrade data and writing the boot upgrade data to the application partition in response to the upgrade instruction includes: In response to the upgrade instruction, running a boot loader program, and acquiring the boot upgrade data through the boot loader program; Erasing original program data in the application partition; The boot upgrade data is written into the application partition.
3. The ECU upgrade method according to claim 1, characterized in that: After obtaining the boot upgrade data and writing it into the application partition, the method further includes: Verifying the written boot upgrade data to obtain a verification result; If the verification result is successful, a first startup parameter is set; wherein the first startup parameter is used to indicate the application partition storing the boot upgrade data.
4. The ECU upgrade method according to claim 3, characterized in that: The method of copying the boot upgrade data from the application partition to the boot loading partition and boot loading the boot loading program from the boot loading partition when the ECU is restarted and the pre-boot program is run includes: Erasing original program data of the boot-loading partition using a pre-boot program; Based on the first startup parameter, copying the boot upgrade data from the application partition to the boot loading partition; The boot loader is boot loaded from the boot loading partition.
5. The ECU upgrade method according to claim 4, characterized in that: Before erasing the original program data of the boot-loading partition by using the pre-boot program, the method further includes: When the ECU is restarted, the abnormal monitoring program is turned on; When the abnormality monitoring program detects that the boot loading is abnormal, the copying of the boot upgrade data is stopped; The pre-boot program is used to boot-load the original program data of the boot-load partition.
6. The ECU upgrade method according to claim 3, characterized in that: The obtaining application upgrade data and writing it into the application partition includes: In response to the application program flashing instruction, obtaining the application upgrade data using the upgraded boot loader; Erasing the boot upgrade data in the application partition; The application upgrade data is written into the application partition.
7. An ECU upgrade device, characterized in that: The ECU upgrading device comprises: A first writing module, used for obtaining boot upgrade data in response to an upgrade instruction and writing the boot upgrade data into the application partition; wherein the boot upgrade data is update data of the boot loader; A first boot module, configured to copy the boot upgrade data from the application partition to the boot loading partition and boot load the boot loading program from the boot loading partition when the ECU is restarted and the pre-boot program is run; wherein the pre-boot program is stored in the pre-boot partition; A second writing module, used to obtain application upgrade data and write it into the application partition; wherein the application upgrade data is update data of the application program; The second boot module is used to boot load the application program from the application partition when the ECU is restarted and runs the upgraded boot loader.
8. An ECU upgrade device, characterized in that: The ECU upgrade device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the ECU upgrading method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the ECU upgrading method according to any one of claims 1 to 6 is implemented.
10. A vehicle, characterized in that: The vehicle comprises at least one of the following: The ECU upgrading device as claimed in claim 7; The ECU upgrade device as claimed in claim 8; The computer readable storage medium of claim 9.