Program upgrading method, device and equipment of electronic control unit, medium and vehicle
Through the differential comparison upgrade method, the problem of too long ECU upgrade time in the existing technology is solved, faster program upgrade is achieved, the processing burden of the ECU is reduced, and the efficiency of the vehicle OTA upgrade is improved.
Patent Information
- Application Number
- CN202310201488.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-01
- Publication Date
- 2024-09-03
AI Technical Summary
In existing program upgrade solutions for electronic control units, limited by ECU processing capabilities and FLASH resources, the full upgrade method is often used, which results in a long vehicle OTA upgrade time and increases the ECU processing burden.
Use the differential comparison upgrade method to obtain the file fragments of the original and target version files and their corresponding upgrade operation types, generate an operation table, and perform differential upgrades based on the operation types to avoid overall erasure and rewriting, and only upgrade different parts .
It reduces the program processing time of the electronic control unit, shortens the vehicle OTA upgrade time, reduces the processing burden of the ECU, and improves the user experience.
Smart Images

Figure CN118585231A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a program upgrade method, device, equipment, medium and vehicle for an electronic control unit. Background Art
[0002] Over the Air Technology (OTA) is a technology that upgrades smart cars through wireless connections. For example, it can make changes to the vehicle's central control screen interface, icon style, etc. OTA upgrades to the entire vehicle can also make the vehicle more functional, thereby enhancing the user's perceived experience.
[0003] The whole vehicle OTA upgrade includes the upgrade of a large number of electronic control units (ECUs). Due to the limitations of ECU processing capabilities and ECU FLASH resources, existing ECU upgrade solutions mostly use full upgrades. In the process of upgrading the ECU program using the full upgrade method, the original application needs to be erased as a whole and then the target application is rewritten. It also depends on the hardware conditions of the ECU, thereby increasing the ECU processing burden and program processing time, resulting in a long OTA upgrade time for the whole vehicle. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment, medium and vehicle for program upgrading of an electronic control unit. Based on the differential comparison upgrade, the program upgrade no longer adopts the method of overall erasing and rewriting. Instead, no operation is performed on the parts with the same content of corresponding file fragments in the two version files. Only different parts need to be upgraded according to the corresponding upgrade operation types. This can reduce the program upgrade processing time of the electronic control unit and reduce the processing burden of the electronic control unit, thereby shortening the upgrade time of the whole vehicle OTA.
[0005] In a first aspect, an embodiment of the present application provides a method for upgrading a program of an electronic control unit, the method comprising:
[0006] Obtaining an original version file and a target version file of a first program, the first program being loaded into an electronic control unit;
[0007] Performing a differential comparison between the original version file and the target version file to obtain at least one file segment of the original version file and its corresponding upgrade operation type;
[0008] The first program is differentially upgraded according to at least one file segment of the original version file and its corresponding upgrade operation type.
[0009] In some implementations of the first aspect, before performing a differential upgrade on the first program according to at least one file segment of the original version file and its corresponding upgrade operation type, the method further includes:
[0010] Generate a first operation table according to at least one file segment of the original version file and its corresponding upgrade operation type;
[0011] Performing a differential upgrade on the first program according to at least one file segment of the original version file and its corresponding upgrade operation type includes:
[0012] Verifying whether the first operation table is an operation table corresponding to the original version file and the target version file;
[0013] When the verification is passed, the first program is differentially upgraded based on the first operation table.
[0014] In some implementations of the first aspect, the original version file and the target version file are stored in different storage areas of a non-volatile memory, and a differential comparison is performed on the original version file and the target version file to obtain at least one file segment of the original version file and its corresponding upgrade operation type, including:
[0015] The file information of the original version file and the target version file stored in the corresponding storage locations in the storage area are compared to obtain at least one file segment of the original version file and its corresponding upgrade operation type.
[0016] In some implementations of the first aspect, the storage location is a location corresponding to a minimum storage unit of the non-volatile memory.
[0017] In some implementations of the first aspect, generating a first operation table according to at least one file segment of the original version file and its corresponding upgrade operation type includes:
[0018] Aggregate the file information with the same upgrade operation type and continuous storage location to generate multiple file fragments and their corresponding upgrade operation types;
[0019] The plurality of file fragments and their corresponding upgrade operation types are aggregated in the order of storage locations to obtain a first operation table, wherein a header of the first operation table includes program version information applicable to the first operation table.
[0020] In some implementations of the first aspect, the upgrade operation type includes any one of the following: keep, migrate, erase, write, and update.
[0021] In some implementations of the first aspect, the same file segment is stored in consecutive storage pages in the non-volatile memory, and when the upgrade operation type is migration, performing a differential upgrade on the first program according to at least one file segment of the original version file and its corresponding upgrade operation type includes:
[0022] Acquire a first storage page of a file segment corresponding to a migration operation in the original version file and an unused second storage page in the original version file;
[0023] The file information of the first storage page is migrated to the second storage page.
[0024] In some implementations of the first aspect, the same file segment is stored in consecutive storage pages in the non-volatile memory, and when the upgrade operation type is update, differentially upgrading the first program according to at least one file segment of the original version file and its corresponding upgrade operation type includes:
[0025] Obtain the third storage page of the file fragment corresponding to the update operation in the original version file and the fourth storage page of the file fragment corresponding to the write operation in the target version file; erase the file information of the third storage page, and write the file information of the fourth storage page into the third storage page.
[0026] In a second aspect, an embodiment of the present application provides a program upgrade device for an electronic control unit, the device comprising:
[0027] An acquisition module, used to acquire an original version file and a target version file of a first program, the first program being loaded in an electronic control unit;
[0028] A comparison module, used to perform a differential comparison between the original version file and the target version file to obtain at least one file segment of the original version file and its corresponding upgrade operation type;
[0029] The upgrade module is used to perform a differential upgrade on the first program according to at least one file segment of the original version file and its corresponding upgrade operation type.
[0030] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;
[0031] When the processor executes the computer program instructions, the program upgrade method of the electronic control unit as described in any one of the first aspects is implemented.
[0032] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer readable storage medium is stored computer program instructions, and when the computer program instructions are executed by a processor, a program upgrade method for an electronic control unit as described in any one of the first aspects is implemented.
[0033] In a fifth aspect, an embodiment of the present application provides a vehicle, the vehicle comprising at least one of the following:
[0034] A program upgrade device for an electronic control unit as described in any one of the second aspects;
[0035] The electronic device according to the third aspect;
[0036] A computer-readable storage medium as described in the fourth aspect.
[0037] The program upgrade method, device, equipment, medium and vehicle of the electronic control unit provided in the present application obtain the original version file and the target version file of the first program loaded in the electronic control unit, and perform differential comparison on the two version files to obtain at least one file fragment of the original version file and its corresponding upgrade operation type, and then perform differential upgrade on the first program according to at least one file fragment of the original version file and its corresponding upgrade operation type. On the basis of differential comparison upgrade, the program upgrade no longer adopts the method of overall erasing and rewriting, but does not perform operations on the parts with the same content of the corresponding file fragments in the two version files, and only needs to upgrade the different parts according to the corresponding upgrade operation type, thereby reducing the program processing time and reducing the processing burden of the electronic control unit. Since the whole vehicle OTA upgrade includes a large number of ECU program upgrades, while shortening the ECU program upgrade time, it also shortens the whole vehicle OTA upgrade time. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0039] Figure 1 It is a flowchart of a program upgrade method of an electronic control unit provided in an embodiment of the present application;
[0040] Figure 2 is a schematic diagram of a first operation table provided in an embodiment of the present application;
[0041] Figure 3 It is a structural schematic diagram of a program upgrading device of an electronic control unit provided in an embodiment of the present application;
[0042] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0044] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present application 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 application, rather than all of the embodiments.
[0045] 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.
[0046] With the continuous development of automation in the automotive industry, the number of electronic control units (ECUs) in vehicle control systems is increasing. When there are new functions, software optimization, repairs, and other situations to achieve OTA upgrades for the entire vehicle, it is inevitable to upgrade the ECU. For some simple ECUs, the processing power and resources are not enough to support the differential upgrade algorithm. Therefore, due to the limitations of ECU processing power and ECU FLASH resources, most of the existing ECU upgrade solutions do not use differential upgrade algorithms, and most use full upgrades. The full upgrade method requires the original application to be erased as a whole and then the target application is rewritten, which increases the ECU processing burden and the ECU upgrade time, resulting in a long OTA upgrade time for the entire vehicle.
[0047] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, medium and vehicle for program upgrading of an electronic control unit. The following first introduces the method for program upgrading of an electronic control unit provided by the embodiments of the present application.
[0048] Figure 1 FIG. 1 is a flow chart showing a method for program upgrading of an electronic control unit provided in an embodiment of the present application. Figure 1 As shown, the program upgrade method of the electronic control unit may specifically include the following steps S101 to S103.
[0049] S101, obtaining an original version file and a target version file of a first program, wherein the first program is loaded into an electronic control unit.
[0050] The first program is loaded in the electronic control unit ECU and can characterize the operating status of the ECU. Since there are many ECUs on the vehicle, different ECUs have different versions of software. The original version file of the first program refers to the software version file of the ECU before the upgrade, which can be obtained by reading the ECU by the main controller. The target version file of the first program is the new software version file required for the upgrade, which can be downloaded locally by the main controller.
[0051] S102: Perform a differential comparison between the original version file and the target version file to obtain at least one file segment of the original version file and its corresponding upgrade operation type.
[0052] After obtaining the original version file and the target version file, the original version file and the target version file are compared using a differential algorithm to determine the difference between the two version files and the file fragment where the difference is located, and the upgrade operation type corresponding to the file fragment is determined based on the difference content. The upgrade operation type includes any of the following: keep, migrate, erase, write, and update.
[0053] S103: Perform a differential upgrade on the first program according to at least one file segment of the original version file and its corresponding upgrade operation type.
[0054] After obtaining at least one file fragment of the original version file and the upgrade operation type corresponding to each file fragment, the main controller completes the program upgrade operation of the ECU according to at least one file fragment of the original version file and the upgrade operation type corresponding to each file fragment. Since the main controller has strong processing power and sufficient resources, the main controller is selected as the main control end of the upgrade operation, and the resource-consuming operations such as program storage, parsing and execution are transferred to the main controller with more powerful processing power, so that the differential upgrade of the first program can be completed in a shorter time. Among them, the main controller can be a central domain controller.
[0055] Therefore, according to the program upgrade method of the electronic control unit provided in the embodiment of the present application, the original version file and the target version file of the first program loaded in the electronic control unit are obtained, and the two version files are differentially compared to obtain at least one file fragment of the original version file and its corresponding upgrade operation type, and then the first program is differentially upgraded according to at least one file fragment of the original version file and its corresponding upgrade operation type. On the basis of differential comparison upgrade, the program upgrade no longer adopts the overall erasing and rewriting method, but does not perform operations on the parts with the same content of the corresponding text fragments in the two version files, and only needs to upgrade the different parts according to the corresponding upgrade operation type, thereby reducing the program processing time and reducing the processing burden of the electronic control unit. Since the whole vehicle OTA upgrade includes a large number of ECU program upgrades, while shortening the ECU program upgrade time, it also shortens the whole vehicle OTA upgrade time.
[0056] In some embodiments, before performing a differential upgrade on the first program based on at least one file fragment of the original version file and its corresponding upgrade operation type, the method also includes: generating a first operation table based on at least one file fragment of the original version file and its corresponding upgrade operation type, thereby implementing a program upgrade of the electronic control unit according to the first operation table.
[0057] As an example, according to at least one file fragment of the original version file and its corresponding upgrade operation type, a first operation table is generated, specifically including: aggregating file information with the same upgrade operation type and continuous storage locations to generate multiple file fragments and their corresponding upgrade operation types; aggregating multiple file fragments and their corresponding upgrade operation types in the order of storage locations to obtain a first operation table, wherein the header of the first operation table includes program version information applicable to the first operation table. Among them, the storage location is the location corresponding to the smallest storage unit of the non-volatile memory, the non-volatile memory refers to the FLASH memory, and the upgrade operation type includes any of the following: keep, migrate, erase, write, update.
[0058] For example, Figure 2As shown, bootloader means boot loader, page means "page", which refers to the page of FLASH memory, that is, the minimum erase unit of FLASH memory, and also corresponds to a storage location. The division of page depends on the size of FLASH memory, that is, it can be divided according to the minimum erase unit of FLASH memory. For example, after comparing the original version file and the target version file, it is determined that the text information of page0-page9 in the original version file is the same as the text information of new page0-new page9 in the target version file, indicating that page0-page9 does not need to be upgraded, and is mostly information record, which will not produce actual operation actions and effects, and the storage location of page0-page9 is continuous, so page0-page9 can be summarized to obtain a file segment, and the upgrade operation type corresponding to the file segment is maintenance.
[0059] It should be noted that, for example, it is determined that the upgrade operation types of page10-page15 and page20-page25 are both erase, but since the storage locations of page10-page15 and page20-page25 are not continuous, page10-page15 and page20-page25 cannot be aggregated into one file fragment, but two file fragments with the same upgrade operation type.
[0060] Therefore, according to whether the upgrade operation types are the same and whether the storage locations are continuous, the text information in the first program is summarized, and multiple file fragments are generated accordingly and the upgrade operation types of the file fragments are determined. Then, the multiple file fragments and their corresponding upgrade operation types are summarized in the order of the storage locations to obtain a first operation table, so as to implement the upgrade of the ECU program based on the first operation table.
[0061] In some embodiments, a differential upgrade is performed on the first program based on at least one file fragment of the original version file and its corresponding upgrade operation type, specifically including: verifying whether the first operation table is an operation table corresponding to the original version file and the target version file; if the verification passes, differentially upgrading the first program based on the first operation table.
[0062] As an example, the header of the first operation table includes program version information applicable to the first operation table, that is, the basic version information before the upgrade and the target version information for the upgrade. After the first operation table is generated, it is verified whether the original version file and the target version file of the first program correspond to the program version information applicable to the first operation table contained in the header of the first operation table, that is, it is verified whether the first operation table is an operation table corresponding to the original version file and the target version file, and if the verification is passed, the first program is differentially upgraded based on the first operation table. If the first operation table is not an operation table corresponding to the original version file and the target version file, it indicates that the first operation table is not suitable for differential upgrade of the first program. At this time, the first program is fully upgraded by a full upgrade method.
[0063] Since the communication between the main controller and the electronic control unit is usually a low-speed automotive bus such as the Controller Area Network (CAN) or the Local Interconnect Network (LIN), this is also an important factor that makes the full upgrade more time-consuming. Therefore, by differentially upgrading the first program based on the first operation table, the program upgrade of the electronic control unit can be completed with little or no modification under the condition of establishing less communication, and no longer depends on the hardware update of the electronic control unit.
[0064] In some embodiments, the original version file and the target version file are stored in different storage areas of the FLASH memory, and a differential comparison is performed on the original version file and the target version file to obtain at least one file fragment of the original version file and its corresponding upgrade operation type, specifically including: comparing the file information of the original version file and the target version file stored in corresponding storage locations in the storage area to obtain at least one file fragment of the original version file and its corresponding upgrade operation type.
[0065] As an example, the original version file and the target version file can be Hex files and stored in different storage areas of the FLASH memory. When the original version file and the target version file are differentially compared using a differential algorithm, the comparison is based on the file information in the storage location corresponding to the storage area where the version file is located, wherein the differential algorithm can be a bsdiff algorithm. Figure 2 As shown, page0 in the original version file is compared with new page0 in the target version file. If the text information of the corresponding storage locations is the same, no processing is performed. If they are different, the text information of subsequent storage locations, that is, subsequent pages, can be further compared to determine which upgrade operation to perform.
[0066] As an example, the same file fragment is stored in consecutive storage pages in a non-volatile memory. When the upgrade operation type is migration, the first program is differentially upgraded according to at least one file fragment of the original version file and its corresponding upgrade operation type, specifically including: obtaining the first storage page of the file fragment corresponding to the migration operation in the original version file and the unused second storage page in the original version file; migrating the file information of the first storage page to the second storage page.
[0067] The migration operation may be to migrate the file information of the file segment corresponding to the migration operation in the original version file to the unused second storage page in the original version file, or to migrate the file information of the file segment corresponding to the migration operation in the target version file to the unused second storage page in the original version file. Figure 2 As shown, if it is a migration between original version files, it is necessary to migrate the first storage page of the file fragment corresponding to the migration operation, such as page15-page20, to the unused second storage page in the original version file, such as page30-page35, and erase the text information corresponding to page15-page20. If it is a migration between the original version file and the target version file, it is necessary to erase the first storage page of the file fragment corresponding to the migration operation in the original version file, such as page10-page15, and then migrate the text information corresponding to the target version file, such as new page10-new page15, to page10-page15 of the original version file.
[0068] As an example, when the upgrade operation type is update, the first program is differentially upgraded according to at least one file fragment of the original version file and its corresponding upgrade operation type, including: obtaining the third storage page of the file fragment corresponding to the update operation in the original version file and the fourth storage page of the file fragment corresponding to the write operation in the target version file; erasing the file information of the third storage page, and writing the file information of the fourth storage page to the third storage page.
[0069] For example, if it is necessary to update the text information corresponding to the file fragment page10-page15 in the original version file to the text information corresponding to the file fragment new page10-new page15 in the target version file, it is necessary to first erase the text information of the third storage page where the file fragment page10-page15 is located, and then transfer and write the text information of the fourth storage page where the file fragment new page10-newpage15 is located to the third storage page where the file fragment page10-page15 is located.
[0070] Therefore, according to the program upgrade method of the electronic control unit of the embodiment of the present application, the first operation table is generated by page comparison, and during the program upgrade process of the electronic control unit, the main control end is responsible for parsing the first operation table, and the program upgrade operation of the electronic control unit is performed according to the content of the first operation table. Based on this, the differential upgrade capability of the electronic control unit can be provided without increasing the ECU processing responsibility and resource occupation, which can greatly reduce the program upgrade time of the electronic control unit. Since the OTA upgrade of the whole vehicle involves the upgrade of a large number of electronic control units, the program upgrade time of the electronic control unit is reduced, thereby reducing the upgrade time of the OTA of the whole vehicle and improving the user's perceived experience.
[0071] It should be noted that the application scenarios described in the above embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0072] Based on the same inventive concept, the embodiment of the present application provides a program upgrade device for an electronic control unit, specifically in combination with Figure 3 Provide detailed explanation.
[0073] Figure 3 FIG. 1 is a schematic diagram showing the structure of a program upgrade device for an electronic control unit provided in an embodiment of the present application. Figure 3 As shown, the program upgrade device 300 of the electronic control unit may include:
[0074] An acquisition module 301 is used to acquire an original version file and a target version file of a first program, the first program being loaded in an electronic control unit;
[0075] A comparison module 302 is used to perform a differential comparison between the original version file and the target version file to obtain at least one file segment of the original version file and its corresponding upgrade operation type;
[0076] The upgrade module 303 is used to perform a differential upgrade on the first program according to at least one file segment of the original version file and its corresponding upgrade operation type.
[0077] Therefore, according to the program upgrade device of the electronic control unit of the embodiment of the present application, the original version file and the target version file of the first program loaded in the electronic control unit are obtained, and the two version files are differentially compared to obtain at least one file fragment of the original version file and its corresponding upgrade operation type, and then the first program is differentially upgraded according to at least one file fragment of the original version file and its corresponding upgrade operation type. On the basis of differential comparison upgrade, the program upgrade no longer adopts the overall erasing and rewriting method, but does not perform operations on the parts with the same content of the corresponding file fragments in the two version files, and only needs to upgrade the different parts according to the corresponding upgrade operation type, thereby reducing the program processing time and reducing the processing burden of the electronic control unit. Since the whole vehicle OTA upgrade includes a large number of ECU program upgrades, while shortening the ECU program upgrade time, it also shortens the whole vehicle OTA upgrade time.
[0078] The program upgrade device 300 of the electronic control unit is described in detail below, as shown below:
[0079] In some embodiments, the program upgrade device 300 of the electronic control unit may include the following submodules:
[0080] The generating submodule is used to generate a first operation table according to at least one file segment of the original version file and its corresponding upgrade operation type.
[0081] In some embodiments, the upgrade module 303 may include the following units:
[0082] A verification unit, used to verify whether the first operation table is an operation table corresponding to the original version file and the target version file;
[0083] The differential upgrade unit is used to perform a differential upgrade on the first program based on the first operation table when the verification is passed.
[0084] In some embodiments, the original version file and the target version file are stored in different storage areas of the non-volatile memory, and the comparison module 302 may include the following units:
[0085] A comparison unit, used to compare the file information of the original version file and the target version file stored in the corresponding storage location of the storage area to obtain at least one file segment of the original version file and its corresponding upgrade operation type;
[0086] The storage location is a location corresponding to a minimum storage unit of the non-volatile memory.
[0087] In some embodiments, the generation submodule may include the following units:
[0088] A first aggregation unit, configured to aggregate file information having the same upgrade operation type and continuous storage locations, to generate a plurality of file segments and their corresponding upgrade operation types;
[0089] A second aggregation unit is used to aggregate the multiple file fragments and their corresponding upgrade operation types according to the order of storage locations to obtain a first operation table, wherein the table header of the first operation table includes program version information applicable to the first operation table;
[0090] The upgrade operation type includes any of the following: keep, migrate, erase, write, and update.
[0091] In some embodiments, the same file segment is stored in consecutive storage pages in the non-volatile memory. When the upgrade operation type is migration, the upgrade module 303 may include the following units:
[0092] A first acquisition unit is used to acquire a first storage page of a file segment corresponding to a migration operation in an original version file and an unused second storage page in the original version file;
[0093] The migration unit is used to migrate the file information of the first storage page to the second storage page.
[0094] In some embodiments, the same file segment is stored in consecutive storage pages in the non-volatile memory. When the upgrade operation type is update, the upgrade module 303 may include the following units:
[0095] A second acquisition unit is used to acquire a third storage page of the file segment corresponding to the update operation in the original version file and a fourth storage page of the file segment corresponding to the write operation in the target version file;
[0096] The updating unit is used to erase the file information of the third storage page and write the file information of the fourth storage page into the third storage page.
[0097] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0098] The electronic device 400 may include a processor 401 and a memory 402 storing computer program instructions.
[0099] Specifically, the processor 401 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.
[0100] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0101] In certain embodiments, the memory 402 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory 402 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 first aspect of the present application.
[0102] The processor 401 implements the program upgrade method of the electronic control unit in the above embodiment by reading and executing the computer program instructions stored in the memory 402 .
[0103] In some examples, the electronic device 400 may further include a communication interface 403 and a bus 404. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 404 and communicate with each other.
[0104] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0105] Bus 404 includes hardware, software or both, and the components of electronic device 400 are coupled to each other. For example, but not limitation, bus 404 may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 404 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0106] Exemplarily, the electronic device 400 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).
[0107] The electronic device 400 can be combined with Figure 1 and Figure 3 A method and device for upgrading a program of an electronic control unit are described.
[0108] In addition, in combination with the program upgrade method of the electronic control unit in the above embodiment, the embodiment of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the program upgrade method of the electronic control unit in the above embodiment is implemented. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as portable disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, etc.
[0109] In addition, the embodiment of the present application further provides a vehicle, which may include at least one of the following:
[0110] A program upgrade device for an electronic control unit as described in any one of the second aspects;
[0111] The electronic device according to the third aspect;
[0112] A computer-readable storage medium as described in the fourth aspect.
[0113] It should be understood that the above specific embodiments of the present application are only used to illustrate or explain the principles of the present application, and do not constitute a limitation to the present application. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present application should be included in the protection scope of the present application. In addition, the claims attached to the present application are intended to cover all changes and modifications that fall within the scope and boundaries of the attached claims, or the equivalent forms of such scope and boundaries.
[0114] The functional blocks shown in the above-described 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.
[0115] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0116] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the 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 realization of the function / action specified in one or more square boxes of the flow chart and / or the 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 square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0117] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention 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 by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A method for upgrading a program of an electronic control unit, characterized in that: include: Obtaining an original version file and a target version file of a first program, wherein the first program is loaded in the electronic control unit; Performing a differential comparison between the original version file and the target version file to obtain at least one file segment of the original version file and its corresponding upgrade operation type; The first program is differentially upgraded according to at least one file segment of the original version file and its corresponding upgrade operation type.
2. The method according to claim 1, characterized in that Before performing differential upgrade on the first program according to at least one file segment of the original version file and its corresponding upgrade operation type, the method further includes: Generate a first operation table according to at least one file segment of the original version file and its corresponding upgrade operation type; The step of performing differential upgrading on the first program according to at least one file segment of the original version file and its corresponding upgrade operation type includes: Verifying whether the first operation table is an operation table corresponding to the original version file and the target version file; If the verification is passed, the first program is differentially upgraded based on the first operation table.
3. The method according to claim 1, characterized in that The original version file and the target version file are stored in different storage areas of a non-volatile memory, and the differential comparison between the original version file and the target version file is performed to obtain at least one file segment of the original version file and its corresponding upgrade operation type, including: The file information of the original version file and the target version file stored in the corresponding storage location of the storage area are compared to obtain at least one file segment of the original version file and its corresponding upgrade operation type.
4. The method according to claim 3, characterized in that The storage location is a location corresponding to a minimum storage unit of the non-volatile memory.
5. The method according to claim 2, characterized in that: The step of generating a first operation table according to at least one file segment of the original version file and its corresponding upgrade operation type comprises: Aggregating the file information having the same upgrade operation type and continuous storage locations to generate multiple file fragments and their corresponding upgrade operation types; The plurality of file fragments and their corresponding upgrade operation types are aggregated in the order of the storage locations to obtain the first operation table, wherein a header of the first operation table includes program version information applicable to the first operation table.
6. The method according to claim 5, characterized in that The upgrade operation type includes any one of the following: keep, migrate, erase, write, and update.
7. The method according to claim 6, characterized in that The same file fragment is stored in consecutive storage pages in the non-volatile memory. When the upgrade operation type is migration, performing differential upgrade on the first program according to at least one file fragment of the original version file and its corresponding upgrade operation type includes: Acquire a first storage page of a file segment corresponding to a migration operation in the original version file and an unused second storage page in the original version file; The file information of the first storage page is migrated to the second storage page.
8. The method according to claim 6, characterized in that The same file fragment is stored in consecutive storage pages in the non-volatile memory. When the upgrade operation type is update, performing differential upgrade on the first program according to at least one file fragment of the original version file and its corresponding upgrade operation type includes: Acquire the third storage page of the file fragment corresponding to the update operation in the original version file and the fourth storage page of the file fragment corresponding to the write operation in the target version file; The file information of the third storage page is erased, and the file information of the fourth storage page is written into the third storage page.
9. A program upgrade device for an electronic control unit, characterized in that: include: an acquisition module, configured to acquire an original version file and a target version file of a first program, wherein the first program is loaded in the electronic control unit; A comparison module, used to perform a differential comparison between the original version file and the target version file to obtain at least one file segment of the original version file and its corresponding upgrade operation type; An upgrade module is used to perform a differential upgrade on the first program according to at least one file fragment of the original version file and its corresponding upgrade operation type.
10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the program upgrade method of the electronic control unit as described in any one of claims 1-8 is implemented.
11. 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 the processor, the program upgrade method of the electronic control unit according to any one of claims 1 to 8 is implemented.
12. A vehicle, characterized in that: The vehicle includes at least one of the following: The program upgrading device of the electronic control unit as claimed in claim 9; The electronic device as claimed in claim 10; The computer readable storage medium of claim 11.
