Incremental upgrading method, incremental upgrading file generation method, incremental upgrading system, first electronic equipment, second electronic equipment and storage medium
By receiving and parsing the incremental upgrade file, generating an upgrade information table, and determining the address interval type based on the physical address information of the vehicle controller firmware, it solves the problems in the existing technology that the partition cannot be erased and the flash writing efficiency is low, and realizes vehicle control Efficient upgrade of server firmware.
Patent Information
- Application Number
- CN202410648898.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-09-17
AI Technical Summary
The existing incremental upgrade method based on the feature value lookup table method has the problem that the partition spans different physical address blocks or sectors, resulting in the partition being unable to be erased, and the efficiency of repeated flashing is low, and it cannot effectively improve the upgrade efficiency of the vehicle controller firmware.
By receiving and parsing the incremental upgrade file, an upgrade information table is generated, and the address interval type is determined based on the physical address information of the vehicle controller firmware. Different incremental upgrade processing methods are used to prevent the partition from being erased, and the flashing process is optimized to improve efficiency.
It ensures the feasibility and efficiency of vehicle controller firmware upgrade, avoids the situation where the partition cannot be erased, and improves the stability and efficiency of the upgrade process.
Smart Images

Figure CN118656104A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of firmware upgrade, and in particular to an incremental upgrade method, a method for generating an incremental upgrade file, an incremental upgrade system, a first electronic device, a second electronic device, and a storage medium. Background Art
[0002] Usually, the vehicle controller firmware is updated using a full upgrade package, but this method takes a lot of time to perform firmware upgrades, especially for controller firmware with only a small part of the program content modified. The upgrade efficiency is very low. Therefore, an incremental upgrade method for firmware has gradually developed. The incremental upgrade method is that the cloud or the flashing host computer generates an incremental upgrade package based on the comparison between the new version of the software and the local version of the controller. The flashing host computer uses the incremental upgrade package to update the changed content in the local version of the controller, reducing the upgrade time and improving the upgrade efficiency.
[0003] In the related art, an incremental upgrade method based on a characteristic value lookup table method calculates the partition characteristic value corresponding to the firmware data segment, compares the partition characteristic value corresponding to the new version of the firmware with the partition characteristic value corresponding to the old version of the firmware, and flashes the partitions with different partition characteristic values to achieve incremental upgrade of the firmware. This method partitions the firmware data segment, and the partitions may span different physical address blocks or sectors, resulting in the problem that the partitions cannot be erased, and incremental upgrade cannot be achieved. In addition, this method only flashes based on the difference in partition characteristic values, which may result in repeated flashing, resulting in low firmware upgrade efficiency. Summary of the invention
[0004] The present application provides an incremental upgrade method, which can ensure the feasibility of upgrading the vehicle controller firmware and improve the upgrade efficiency of the vehicle controller firmware.
[0005] The technical solution of this application is implemented as follows:
[0006] An embodiment of the present application provides an incremental upgrade method, which is applied to a first electronic device, including: receiving an incremental upgrade file of a vehicle controller firmware sent by a second electronic device; parsing the incremental upgrade file to obtain at least one upgrade information table; each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type; the address information is determined based on the physical address information stored in the vehicle controller firmware; based on the address information, performing incremental upgrade processing on the vehicle controller firmware to obtain upgraded vehicle controller firmware; the incremental upgrade processing methods corresponding to address information of different address interval types are different.
[0007] It is understandable that in the incremental upgrade method provided in the embodiment of the present application, since the address information is determined based on the physical address information stored in the vehicle controller firmware, the partition will not be unable to be erased during the process of upgrading the vehicle controller firmware based on the address information, thereby ensuring the feasibility of upgrading the vehicle controller firmware. In addition, since the incremental upgrade processing methods corresponding to the address information of the address interval type are different, upgrading the vehicle controller firmware based on the address information of different address interval types can improve the upgrade efficiency of the vehicle controller firmware.
[0008] In some embodiments, the address interval type includes a first type, the first upgrade data corresponding to the first address information of the first type is the same as the first original data, the address intervals corresponding to the first address information and the first original data are different, and the first original data is the old version data of the vehicle controller firmware.
[0009] It can be understood that by obtaining the upgrade information table corresponding to the first type of address interval, when the firmware is subsequently upgraded based on the address information in the upgrade information table, it can be directly copied from the old version data without erasing the old version data and re-writing it, thereby improving the firmware upgrade efficiency.
[0010] In some embodiments, the vehicle controller firmware is incrementally upgraded based on the address information, including: if the address interval type corresponding to the first address information is the first type, determining the first original data corresponding to the first address information; in the address interval where the old version data of the vehicle controller firmware is stored, copying the first original data to the first address interval; the first address interval is determined based on the first address information.
[0011] It can be understood that when the address interval corresponding to the first address information is of the first type, the first original data corresponding to the first address information is copied to the first address interval instead of rewriting the old version data, thereby improving the upgrade efficiency of the vehicle controller firmware.
[0012] In some embodiments, the incremental upgrade method further includes: after copying the first original data to the first address interval, updating the verification information corresponding to the first address interval according to the first original data.
[0013] It can be understood that by updating the verification information in the first address interval, power outages or abnormal resets can be avoided in the subsequent upgrade process. After the flashing of the first electronic device is interrupted, it can be continued from the last interrupted position according to the retained verification information during the next re-upgrade, thereby improving the stability of the vehicle firmware upgrade.
[0014] In some embodiments, the incremental upgrade method also includes: in the address interval of the old version data of the vehicle controller firmware, storing the original data stored in the first address interval in a backup address interval, and storing the first address information corresponding to the first address interval and the address information corresponding to the backup address interval as an entry in a preset mapping relationship table.
[0015] It can be understood that by storing the original data in the first address interval in the backup interval, and storing the first address information and the address information of the backup address interval as an entry (corresponding storage) in the preset mapping relationship table, the content in the backup address interval can be immediately accessed through the first partition address information during subsequent upgrades, thereby improving the efficiency of firmware upgrades.
[0016] In some embodiments, the vehicle controller firmware is incrementally upgraded based on the address information, including: if the address interval type corresponding to the second address information is the second type, obtaining second upgrade data corresponding to the second address information; in the address interval where the old version data of the vehicle controller firmware is stored, deleting the original data stored in the second address interval, and flashing the second upgrade data to the second address interval; the second address interval is determined based on the second address interval information.
[0017] It can be understood that by deleting the original data stored in the second address interval and then flashing the second upgrade data to the second address interval, an incremental upgrade of the vehicle controller firmware can be achieved.
[0018] In some embodiments, the incremental upgrade method further includes: after writing the second upgrade data to the second address interval, updating the verification information of the second address interval based on the second upgrade data.
[0019] It can be understood that by updating the verification information in the second address interval, power outages or abnormal resets can be avoided in the subsequent upgrade process. After the flashing of the first electronic device is interrupted, it can be continued from the last interruption position according to the retained verification information during the next re-upgrade, thereby improving the stability of the vehicle firmware upgrade.
[0020] In some embodiments, the address interval type further includes a second type, and the second upgrade data corresponding to the second address information of the second type is different from the old version data of the vehicle controller firmware.
[0021] It can be understood that by obtaining the upgrade information table corresponding to the second type of address interval, when the firmware is subsequently upgraded based on the address information in the upgrade information table, data can be directly flashed to achieve incremental upgrade of the vehicle controller firmware.
[0022] In some embodiments, the incremental upgrade processing of the first upgrade data takes precedence over the incremental upgrade processing of the second upgrade data.
[0023] It can be understood that the incremental upgrade processing method for the first upgrade data is copying, and the incremental upgrade processing method for the second upgrade data is flashing. Therefore, the original data that already exists in the address interval and is the same as the first upgrade data is flashed by copying, and then the second upgrade data that does not exist in the address interval is flashed, instead of upgrading both by flashing. This can relatively reduce the data flashing process and improve the efficiency of firmware upgrades.
[0024] In some embodiments, the incremental upgrade method further includes: after the vehicle controller firmware is incrementally upgraded, performing a validity check on the vehicle controller firmware; if it is determined that the validity check passes, updating the verification information of the vehicle controller firmware.
[0025] It is understandable that after the vehicle controller firmware is incrementally upgraded, the vehicle controller firmware is verified for validity, and when it is determined that the validity verification has passed, the verification information of the vehicle controller firmware is updated, so that the corresponding firmware version can be determined according to the updated verification information when the controller firmware is upgraded next time.
[0026] In some embodiments, the upgrade information table includes verification information of each address interval of the corresponding address interval type, and the incremental upgrade method also includes: obtaining verification information of the address interval corresponding to the vehicle controller firmware; if the verification information of the address interval exists in the upgrade information table, deleting the address information corresponding to the address interval from the upgrade information table.
[0027] It can be understood that when the verification information of the address interval exists in the upgrade information table, by deleting the address information corresponding to the first interval from the upgrade information table, it is convenient to quickly locate other non-upgraded address information in the upgrade information table, thereby improving the firmware upgrade rate.
[0028] In some embodiments, the incremental upgrade file carries verification information of the upgrade data of the vehicle controller firmware; the incremental upgrade processing of the vehicle controller firmware based on the address information includes: obtaining verification information of the old version data of the vehicle controller firmware; if the verification information corresponding to the old version data is the same as the verification information of the upgrade data of the vehicle controller firmware, the vehicle controller firmware is incrementally upgraded based on the upgrade information table.
[0029] It is understandable that by comparing the verification information corresponding to the old version data with the verification information of the upgrade data of the vehicle controller firmware, it can be confirmed whether the current controller firmware matches the incremental upgrade file to ensure the effective upgrade of the vehicle controller firmware.
[0030] An embodiment of the present application provides a method for generating an incremental upgrade file, which is applied to a second electronic device, including: obtaining old version data, upgrade data, address information corresponding to the old version data, and address information corresponding to the upgrade data of a vehicle controller firmware; determining multiple address interval types based on the similarity between the old version data and the upgrade data; creating at least one upgrade information table based on the address interval type; each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type, and the address information is determined based on the physical address information stored in the vehicle controller firmware; based on the upgrade information table, generating an incremental upgrade file for the vehicle controller firmware.
[0031] It is understandable that by creating at least one upgrade information table based on the address interval type, it is convenient to perform different upgrade methods according to different upgrade information tables in the future, thereby improving the upgrade efficiency. In addition, since the address information is determined according to the physical address information stored in the vehicle controller firmware, the partition will not be unable to be erased in the process of upgrading the vehicle controller firmware in the subsequent incremental upgrade file constructed based on the upgrade information table corresponding to the address information, thereby ensuring the feasibility of upgrading the vehicle controller firmware.
[0032] In some embodiments, based on the similarity between the old version data and the upgraded data, multiple address interval types are determined, including: if the first upgraded data in the upgraded data is the same as the first original data in the old version data, and the first address information corresponding to the first upgraded data is different from the address information corresponding to the first original data, the first address information is determined as the first type.
[0033] It can be understood that by determining address information with the same data but different address information as the first type, it is convenient to perform a copy operation according to the first type of address information during the subsequent vehicle controller firmware upgrade process, thereby improving the upgrade efficiency.
[0034] In some embodiments, the upgrade information table includes a first upgrade information table; creating at least one upgrade information table based on the address interval type includes: obtaining at least one first address information whose address interval type is the first type; generating a first upgrade information table based on each first address information and the address information of the first original data corresponding to each first address information.
[0035] It can be understood that establishing a first upgrade information table based on first address information of the first type of address interval type and address information of the first original data corresponding to the first address information can enable subsequent copying operations based on the first address information in the first upgrade information table and the corresponding address information of the first original data, thereby speeding up the upgrade.
[0036] In some embodiments, the method for generating the incremental upgrade file further includes: if the first address information in the first upgrade information table includes address information of a plurality of corresponding first original data, deduplicating the first address information to obtain an updated first upgrade information table.
[0037] It can be understood that, in a case where the first address information in the first upgrade information table includes address information of multiple corresponding first original data, by deduplicating the first address information in the first upgrade information table, it is possible to avoid multiple copies of the first original data corresponding to the same first upgrade data during the upgrade process based on the first upgrade information table, thereby improving the upgrade efficiency.
[0038] In some embodiments, generating an incremental upgrade file for the vehicle controller firmware based on the upgrade information table includes: obtaining the total number of first address information in the first upgrade information table and the total number of address intervals stored in the vehicle controller firmware; determining the percentage of the total number of first address information to the total number of address intervals stored in the vehicle controller firmware; if the percentage meets a preset threshold condition, generating an incremental upgrade file for the vehicle controller firmware based on the updated first upgrade information table.
[0039] It can be understood that by determining the percentage of the total amount of updated first address information to the total amount of address intervals stored in the vehicle controller firmware, and when the percentage meets the preset threshold condition, an incremental upgrade file for the vehicle controller firmware is generated based on the updated first upgrade information table, which can ensure the proportion of subsequent copying operations in the upgrade process, thereby ensuring the upgrade efficiency of the firmware.
[0040] In some embodiments, determining multiple address interval types based on the similarity between the old version data and the upgraded data includes: if second upgraded data in the upgraded data and the old version data are different, determining second address information corresponding to the second upgraded data as a second type.
[0041] It can be understood that by determining the second address information corresponding to the second upgrade data different from the old version data as the second type, it is convenient to subsequently generate a corresponding upgrade information table according to the second type of address information and perform a corresponding upgrade operation based on the upgrade information table.
[0042] In some embodiments, the upgrade information table includes a second upgrade information table; creating at least one upgrade information table based on the address interval type includes: obtaining at least one second address information whose address interval type is the second type; generating a second upgrade information table based on each second address information.
[0043] It can be understood that by generating the second upgrade information table based on the second address information whose address interval type is the second type, it is convenient to perform incremental upgrade of the firmware based on the second upgrade information table later.
[0044] In some embodiments, the incremental upgrade file generation method further includes: if there are multiple consecutive second address information in the second upgrade information table, merging the multiple consecutive second address information to obtain an updated second upgrade information table.
[0045] It can be understood that by merging a plurality of continuous second address information, the content stored in the second upgrade information table can be reduced, and the transmission amount of the incremental upgrade file can be reduced.
[0046] In some embodiments, based on the upgrade information table, an incremental upgrade file of the vehicle controller firmware is generated, including: obtaining second upgrade data corresponding to the second address information; generating an incremental upgrade package of the vehicle controller firmware based on the second address information and the corresponding second upgrade data; generating an incremental upgrade file of the vehicle controller firmware based on the incremental upgrade package and the upgrade information table.
[0047] It can be understood that by generating an incremental upgrade package for the vehicle controller firmware based on the second address information and the corresponding second upgrade data, and constructing an incremental upgrade file based on the upgrade information table and the incremental upgrade package, it can be convenient for the subsequent first electronic device to obtain the upgrade information table and upgrade data based on the incremental upgrade file, and complete the firmware upgrade based on the upgrade information table and the upgrade data.
[0048] In some embodiments, the method for generating the incremental upgrade file further includes: sending the incremental upgrade file to a first electronic device, so that the first electronic device performs incremental upgrade processing on the vehicle controller firmware based on the incremental upgrade file.
[0049] It is understandable that sending the incremental upgrade file to the first electronic device facilitates the second electronic device to perform incremental upgrade processing on the vehicle controller firmware based on the incremental upgrade file.
[0050] An embodiment of the present application provides a first electronic device, including:
[0051] A first receiving module, used for receiving an incremental upgrade file of the vehicle controller firmware sent by the second electronic device;
[0052] A first parsing module is used to parse the incremental upgrade file to obtain at least one upgrade information table; each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type; the address information is determined according to the physical address information stored in the vehicle controller firmware;
[0053] The first incremental upgrade processing module is used to perform incremental upgrade processing on the vehicle controller firmware based on the address information to obtain upgraded vehicle controller firmware; the incremental upgrade processing methods corresponding to address information of different address interval types are different.
[0054] An embodiment of the present application provides a second electronic device, including:
[0055] A first acquisition module, used to acquire old version data, upgraded data, address information corresponding to the old version data, and address information corresponding to the upgraded data of the vehicle controller firmware;
[0056] A first determination module, configured to determine a plurality of address interval types based on similarity between the old version data and the upgraded data, and similarity between address information corresponding to the old version data and address intervals corresponding to the upgraded data;
[0057] A first creation module, configured to create at least one upgrade information table based on the address interval type; each upgrade information table corresponds to an address interval type, the upgrade information table includes address information of the corresponding address interval type, and the address information is determined according to the physical address information stored in the vehicle controller firmware;
[0058] The first generating module is used to generate an incremental upgrade file of the vehicle controller firmware based on the upgrade information table.
[0059] The embodiment of the present application provides an incremental upgrade system, including a first electronic device and a second electronic device; wherein:
[0060] The first electronic device is used to execute the incremental upgrade method provided in the embodiment of the present application;
[0061] The second electronic device is used to execute the method for generating an incremental upgrade file provided in an embodiment of the present application.
[0062] An embodiment of the present application provides another first electronic device, including:
[0063] A first memory, used to store a computer program that can be run on the first processor;
[0064] The first processor is used to execute the incremental upgrade method provided in the embodiment of the present application when running the computer program.
[0065] An embodiment of the present application provides another second electronic device, including:
[0066] A second memory, used for storing a computer program that can be run on the second processor;
[0067] The second processor is used to execute the method for generating an incremental upgrade file provided in an embodiment of the present application when running the computer program.
[0068] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are configured to execute the above-mentioned incremental upgrade method or incremental upgrade file generation method.
[0069] In the incremental upgrade method provided in the embodiment of the present application, on the one hand, the address information is determined based on the physical address information stored in the vehicle controller firmware. Therefore, in the process of upgrading the vehicle controller firmware based on the address information, the situation where the partition cannot be erased will not occur, thereby ensuring the feasibility of upgrading the vehicle controller firmware; on the other hand, since the incremental upgrade processing methods corresponding to the address information of the address interval type are different, upgrading the vehicle controller firmware based on the address information of different address interval types can improve the upgrade efficiency of the vehicle controller firmware. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 A flowchart of an incremental upgrade method provided in an embodiment of the present application;
[0071] Figure 2 A flowchart of a method for generating an incremental upgrade file provided in an embodiment of the present application;
[0072] Figure 3A flowchart of a method for producing an incremental upgrade file provided in an embodiment of the present application;
[0073] Figure 4 A flowchart of a method for fully comparing the content of a new version of firmware with the content of an old version of firmware provided in an embodiment of the present application;
[0074] Figure 5 A schematic diagram of comparing the contents of new and old versions of controller firmware provided in an embodiment of the present application;
[0075] Figure 6 A schematic diagram of an upgrade method for each partition in a new version of firmware provided in an embodiment of the present application;
[0076] Figure 7 A flowchart of a method for rapid incremental upgrade of firmware provided in an embodiment of the present application;
[0077] Figure 8 A schematic diagram of a replication process in a controller fast incremental upgrade provided by an embodiment of the present application;
[0078] Fig. 9 A schematic diagram of a flash writing process in a controller fast incremental upgrade provided by an embodiment of the present application;
[0079] Fig.10 A flowchart of a method for fast incremental upgrade of firmware breakpoint resume provided in an embodiment of the present application;
[0080] Fig.11 A schematic diagram of the composition structure of a device for fast incremental firmware upgrade provided in an embodiment of the present application;
[0081] Fig.12 A schematic diagram of the structure of a first electronic device provided in an embodiment of the present application;
[0082] Fig.13 A schematic diagram of the structure of a second electronic device provided in an embodiment of the present application;
[0083] Fig.14 A schematic diagram of the structure of an incremental upgrade system provided in an embodiment of the present application;
[0084] Fig.15 A schematic diagram of the structure of another first electronic device provided in an embodiment of the present application;
[0085] Fig.16 A schematic diagram of the composition structure of another second electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0086] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0087] In the following description, reference is made to “some embodiments\other embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments\other embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0088] In the following description, the terms "first\second" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0089] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0090] In the related art, patent document CN107783778B discloses an incremental upgrade method based on a characteristic value lookup table method, which mainly divides a reserved space in the firmware, partitions the area of the non-reserved space and calculates the characteristic values respectively, stores them in the reserved space, and calculates the 32-bit cyclic redundancy check code (Cyclic Redundancy Check, CRC) value of the reserved space and the area outside the reserved space for data verification, and stores them in the reserved space. Before the host computer performs an upgrade on the firmware, it reads the partition characteristic value saved in the reserved space and compares it with the corresponding partition characteristic value in the new version of the software. Through comparison, only the partitions with different characteristic values are flashed to achieve incremental upgrades to the firmware.
[0091] The above incremental upgrade method based on the feature vector table lookup method has the following problems:
[0092] First, the partitioning method of the above patent partitions the firmware data segment instead of the hardware physical address block or sector, and the partitions may span different blocks or sectors. Since the memory can only be erased according to the integer multiple of the sector or block, if the above method is used to perform partitioning, the partition may not be erased, and incremental upgrades cannot be achieved.
[0093] Second, the above method cannot identify the data segments where the content in the firmware has not changed, but only the flash address has changed, so the above content still needs to be erased, retransmitted and flashed. In different versions of the controller firmware, there will be many cases where only the storage address range has changed, but the data content has not changed. If the firmware upgrade is still performed by re-flashing, the upgrade efficiency is not high.
[0094] Third, the above method does not save the checksum of the updated partition during the upgrade process. When repeatedly flashing, the updated partition still needs to be re-flashed, which is inefficient. When performing an incremental firmware upgrade, the checksum of the partition data is not updated synchronously after the partition is erased and re-flashed. If the erasing process is interrupted or reset abnormally, the partition content will not match the checksum of the corresponding partition saved. When the upgrade is re-executed, it will be recognized that the firmware partition content does not match the checksum of the corresponding partition, and the controller cannot continue to perform incremental upgrades.
[0095] Based on the problems existing in the related art, this application proposes an incremental upgrade method, which can ensure the feasibility of vehicle controller firmware upgrade and improve the upgrade efficiency of vehicle controller firmware. The method is applied to a first electronic device, which can be a flashing device such as a flashing host computer or an upgrade device. Figure 1 FIG. 1 is a flow chart of an incremental upgrade method provided in an embodiment of the present application, the method comprising the following steps S101 to S103:
[0096] S101. Receive an incremental upgrade file of a vehicle controller firmware sent by a second electronic device.
[0097] It should be noted that the second electronic device can be a cloud device, a vehicle-side device or other packaging device, and the second electronic device can generate an incremental upgrade file for the vehicle controller firmware. A communication connection is established between the second electronic device and the first electronic device, and after the second electronic device generates the incremental upgrade file for the vehicle controller firmware, the upgrade firmware can be sent to the second electronic device.
[0098] In some embodiments, the first electronic device can actively send an incremental upgrade file acquisition request to the second electronic device, and the request carries the identification information of the vehicle controller firmware. After receiving the request, the second electronic device can send the incremental upgrade file it has produced to the first electronic device based on the identification information; after the second electronic device completes the production, it can actively push the incremental upgrade file to the first electronic device, thereby obtaining the incremental upgrade file corresponding to the vehicle controller firmware.
[0099] S102: Parse the incremental upgrade file to obtain at least one upgrade information table.
[0100] It should be noted that each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type, and the address information is determined according to the physical address information stored in the vehicle controller firmware. The address information may include a start address identifier, address length, address number, etc.
[0101] In some embodiments, parsing the incremental upgrade file may be to decrypt, read and process the incremental upgrade file to obtain a variety of data. The incremental upgrade file may be encrypted by the second electronic device and sent to the first electronic device. Therefore, after receiving the incremental upgrade file, the first electronic device can decrypt the incremental upgrade file and read and process the data in the decrypted incremental upgrade file to obtain one or more upgrade information tables.
[0102] In some embodiments, the address interval type includes a first type, the first upgrade data corresponding to the first address information of the first type is the same as the first original data, the first address information and the address information corresponding to the first original data are different, and the first original data is the old version data of the vehicle controller firmware. The difference in address information between the first address information and the first original data may be that the corresponding starting addresses are different, or the address lengths are different, or the address numbers are different. By obtaining the upgrade information table corresponding to the first type of address interval, when the firmware is subsequently upgraded based on the address information in the upgrade information table, it is possible to directly copy from the old version data without erasing the old version data and re-writing it, thereby improving the upgrade efficiency of the firmware.
[0103] In some embodiments, the address interval type includes a second type, and the second upgrade data corresponding to the second address information of the second type is different from the old version data of the vehicle controller firmware. The second upgrade data and the first upgrade data are both upgrade data of the vehicle controller firmware, but the first upgrade data and the second upgrade data are different. The first upgrade data can be found in the old version data of the vehicle controller firmware, and the second upgrade data and the old version data are different. Therefore, by obtaining the upgrade information table corresponding to the second type of address interval, when the firmware is upgraded based on the address information in the upgrade information table later, the data can be directly flashed to achieve an incremental upgrade of the vehicle controller firmware.
[0104] In some embodiments, the address interval type corresponding to the upgrade information table may include a third type in addition to the first type and the second type. The address information of the third type is the same as the address information in the old version data, and the upgraded data and the old version data corresponding to the address information of the third type are also the same.
[0105] In some embodiments, the upgrade information table corresponding to the first type of address interval may include address information of the upgraded data and address information of the corresponding old version data, as well as address interval verification information of the upgraded data and address interval verification information of the old version data. The verification information may be a verification value of the corresponding address interval. The address interval verification value of the upgraded data can be calculated through the corresponding upgraded data, and the address interval verification value of the old version data can be calculated through the corresponding old version data.
[0106] In some implementations, the incremental upgrade file also includes an information table of all address information corresponding to the upgrade data of the vehicle controller firmware, and verification information of the address interval corresponding to each address information. The incremental upgrade file may also include an incremental upgrade file, which includes upgrade data corresponding to the second type of address interval type, and the upgrade data is the firmware content that the old version data and the new version data are different.
[0107] S103: Based on the address information, incrementally upgrade the vehicle controller firmware to obtain upgraded vehicle controller firmware.
[0108] It should be noted that different address interval types of address information correspond to different incremental upgrade processing methods, including copying, erasing, flashing, etc. The address information may be address information of old version data and / or address information of new version data.
[0109] In some embodiments, since the incremental upgrade processing methods corresponding to address information of different address interval types are different, the address interval type corresponding to the address can be determined based on the address information, and then the corresponding upgrade method can be determined.
[0110] In some embodiments, for address information whose address interval type is the first type, the data of the address information corresponding to the old version data can be copied to the address interval determined by the address information corresponding to the upgraded data; for address information whose address interval type is the second type, the content in the address interval determined by the address information corresponding to the old version data can be erased, and then the upgraded data corresponding to the second type of address information can be flushed to the corresponding address interval.
[0111] In an embodiment of the present application, an incremental upgrade file of the vehicle controller firmware sent by the second electronic device is received; the incremental upgrade file is parsed to obtain at least one upgrade information table; each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type; the address information is determined according to the physical address information stored in the vehicle controller firmware; based on the address information, the vehicle controller firmware is incrementally upgraded to obtain the upgraded vehicle controller firmware; the incremental upgrade processing methods corresponding to the address information of different address interval types are different. In this way, since the address information is determined according to the physical address information stored in the vehicle controller firmware, in the process of upgrading the vehicle controller firmware based on the address information, there will be no situation where the partition cannot be erased, thereby ensuring the feasibility of upgrading the vehicle controller firmware. In addition, since the incremental upgrade processing methods corresponding to the address information of the address interval type are different, upgrading the vehicle controller firmware based on the address information of different address interval types can improve the upgrade efficiency of the vehicle controller firmware.
[0112] In some embodiments of the present application, the vehicle controller firmware is incrementally upgraded based on the address information, that is, the above-mentioned step S103 can be implemented by the following steps S1031A to S1032A, and each step is described separately below.
[0113] S1031A: If the address interval type corresponding to the first address information is the first type, determine the first original data corresponding to the first address information.
[0114] It should be noted that the first upgrade data and the first original data corresponding to the first address information of the first type are the same, the first address information and the first original data correspond to different address information, and the first original data is the old version data of the vehicle controller firmware. The first upgrade data may be part of the upgrade data, and the first original data may be part of the old version data.
[0115] In some embodiments, the address information of the first original data in the old version data that is the same as the first upgraded data can be determined according to the first address information in the upgraded information table, so that the first original data can be determined according to the address information.
[0116] S1032A: In the address interval where the old version data of the vehicle controller firmware is stored, copy the first original data to the first address interval.
[0117] It should be noted that the first address interval is determined according to the first address information. If the first address information includes the partition number, the start address identifier and the address length corresponding to the first address interval, the first address interval can be uniquely determined according to the partition number, or according to the start address identifier and the address length.
[0118] In some embodiments, after the first original data is determined, the first original data may be copied from the address interval corresponding to the first original data, and the copied first original data may be stored in the first address interval.
[0119] It can be understood that when the address interval corresponding to the first address information is of the first type, the first original data corresponding to the first address information is copied to the first address interval instead of rewriting the old version data, thereby improving the upgrade efficiency of the vehicle controller firmware.
[0120] In some embodiments of the present application, after the first original data is copied to the first address interval, the verification information corresponding to the first address interval can be updated according to the first original data. The verification information corresponding to the first address interval can be a verification value of the first address interval, which can be determined according to the content stored in the first address interval, for example, the verification value corresponding to the first address interval can be calculated according to the Secure Hash Algorithm (SHA) encryption algorithm, the Cyclic Redundancy Check (CRC) cyclic redundancy check algorithm, and the Message-Digest Algorithm 5 (MD5) and other algorithms.
[0121] In some embodiments, before the copy operation is performed, the verification information corresponding to the first address interval is calculated based on the original data in the first address interval, and after the copy operation is performed, the data stored in the first address interval is changed (updated from other original data to the first original data). Therefore, by updating the verification information of the first address interval, it is possible to avoid power outages or abnormal resets during the subsequent upgrade process, and it is possible for the first electronic device to continue from the last interrupted position when the flashing is interrupted the next time it is re-upgraded based on the maintained verification information, thereby improving the stability of the vehicle firmware upgrade.
[0122] In some embodiments of the present application, before copying the first original data to the first address interval, the original data stored in the first address interval can be stored in the backup address interval in the address interval of the old version data of the vehicle controller firmware, and the first address information corresponding to the first address interval and the address information corresponding to the backup address interval are stored as an entry in the preset mapping relationship table. The backup address interval can be a pre-established address interval, and the backup address interval can include multiple ones.
[0123] In some embodiments, the original data stored in the first address interval may be the source data of other subsequent copy processing partitions. Therefore, by storing the original data in the first address interval in the backup interval, and storing the first address information and the address information of the backup address interval as an entry (corresponding storage) in a preset mapping relationship table, the content in the backup address interval can be immediately accessed through the first partition address information during the subsequent upgrade process, thereby improving the efficiency of firmware upgrade.
[0124] In some embodiments of the application, the vehicle controller firmware is incrementally upgraded based on the address information, that is, the above-mentioned step S103 can be implemented by the following steps S1031B to S1032B, and each step is described below.
[0125] S1031B: If the address interval type corresponding to the second address information is the second type, obtain second upgrade data corresponding to the second address information.
[0126] In some embodiments, the second upgrade data corresponding to the second address information of the second type is different from the old version data of the vehicle controller firmware. The second upgrade data may be part of the upgrade data of the vehicle controller firmware. Since the incremental upgrade file carries the upgrade data, the second upgrade data may be obtained from the upgrade data according to the second address information.
[0127] S1032B. In the address interval where the old version data of the vehicle controller firmware is stored, delete the original data stored in the second address interval, and write the second upgrade data to the second address interval.
[0128] It should be noted that the second address interval is determined based on the second address interval information. For example, if the second address interval information includes start and end address information, address length and partition number, the second address interval can be determined based on the partition number, or the start address and address length.
[0129] In some embodiments, since the upgrade data and old version data corresponding to the second address interval information are different, the upgrade data corresponding to the second address interval information needs to be flashed to the second address interval of the vehicle controller. By deleting the original data stored in the second address interval and then flashing the second upgrade data to the second address interval, an incremental upgrade of the vehicle controller firmware can be achieved.
[0130] In some embodiments of the present application, after the second upgrade data is flushed to the second address interval, the verification information of the second address interval may be updated based on the second upgrade data.
[0131] In some embodiments, the verification information of the second address interval may be a verification value of the second address interval, which is related to the content stored in the second address interval and can be calculated based on the second upgrade data stored in the second address interval, for example, it may be a hash value calculated based on the second upgrade data. Before the second address interval is flashed, the verification information of the second address interval is based on the data stored in the second address interval principle. After the data in the second address interval is flashed, the data stored in the second address interval has changed. Therefore, by updating the verification information in the second address interval, it is possible to avoid power outages or abnormal resets during the subsequent upgrade process, so that after the flashing of the first electronic device is interrupted, it can be continued from the last interrupted position according to the maintained verification information at the next re-upgrade, thereby improving the stability of the vehicle firmware upgrade.
[0132] In some embodiments of the present application, the incremental upgrade processing of the first upgrade data takes precedence over the incremental upgrade processing of the second upgrade data. The address space type corresponding to the first upgrade data is the first type, and the address space type corresponding to the second upgrade data is the second type. In the actual processing process, the incremental upgrade processing of the upgrade data corresponding to all first-type address information takes precedence over the incremental upgrade processing of the upgrade data corresponding to the second-type address information. The incremental upgrade processing method for the upgrade data corresponding to the first-type address information is copying, and the incremental upgrade processing method for the upgrade data corresponding to the second-type address information is flashing, that is, the existing data (the same as the first upgrade data) in the address space is first copied, and then the second upgrade data that does not exist in the address space is flashed.
[0133] It can be understood that since the incremental upgrade processing method for the first upgrade data is copying, and the incremental upgrade processing method for the second upgrade data is flashing, the original data that already exists in the address interval and is the same as the first upgrade data is first flashed by copying, and then the second upgrade data that does not exist in the address interval is flashed, instead of upgrading both by flashing. This can relatively reduce the data flashing process and improve the efficiency of firmware upgrades.
[0134] In some embodiments of the present application, after the vehicle controller firmware is incrementally upgraded, the vehicle controller firmware may be verified for validity; if it is determined that the validity verification passes, the verification information of the vehicle controller firmware is updated.
[0135] In some embodiments, after the vehicle controller firmware upgrade is completed, the validity of the vehicle controller firmware can be verified by determining whether the controller functions normally or achieves the expected functions based on the operating status of the controller. Accordingly, passing the validity verification can mean that the controller functions normally or achieves the expected functions. When it is determined that the vehicle controller firmware has passed the validity verification, it means that the vehicle controller firmware upgrade is successful and the verification information of the vehicle controller firmware can be updated.
[0136] It can be understood that after the vehicle controller firmware is incrementally upgraded, the vehicle controller firmware is verified for validity, and when it is determined that the validity verification passes, the verification information of the vehicle controller firmware is updated. This makes it easier to determine the corresponding firmware version based on the updated verification information when the controller firmware is upgraded next time.
[0137] In some embodiments of the present application, the upgrade information table includes verification information of each address interval of the corresponding address interval type, and the incremental upgrade file is parsed to obtain at least one upgrade information table, that is, after step S102, the following steps S201 to S202 can also be executed, and each step is described below.
[0138] S201. Obtain verification information of each address interval corresponding to the vehicle controller firmware.
[0139] In some embodiments, during the process of performing an upgrade operation on the vehicle controller firmware, verification information of the address interval corresponding to the vehicle controller firmware may be obtained, and the verification information may be obtained by the first electronic device actively requesting the controller, or may be actively sent by the controller to the first electronic device. The verification information may identify the data stored in the address interval of the vehicle controller firmware.
[0140] S202: If the verification information of the address interval exists in the upgrade information table, the address information corresponding to the address interval is deleted from the upgrade information table.
[0141] In some embodiments, if it is determined that the verification information of the address interval exists in the upgrade information table, it means that the address interval has been upgraded. Therefore, the address information corresponding to the address interval can be deleted from the upgrade information table, indicating that the data in the address interval has been upgraded.
[0142] It can be understood that when the verification information of the address interval exists in the upgrade information table, by deleting the address information corresponding to the first interval from the upgrade information table, it is convenient to quickly locate other non-upgraded address information in the upgrade information table, thereby improving the firmware upgrade rate.
[0143] In some embodiments of the present application, the incremental upgrade file carries the verification information of the upgrade data of the vehicle controller firmware, and the verification information of the upgrade data can be the verification information of the software package of the vehicle controller firmware, which belongs to the verification information corresponding to the entire firmware content. Based on this, based on the address information, the vehicle controller firmware is incrementally upgraded, that is, the above step S103 can also be implemented by the following steps S1031C to S1032C, and each step is described below.
[0144] S1031C. Obtain verification information of old version data of the vehicle controller firmware.
[0145] In some embodiments, the verification information of the old version data of the vehicle controller firmware can be determined based on the old version data, and the first electronic device can actively request the verification information from the controller after receiving the incremental upgrade file, or actively request the verification information from the controller before receiving the incremental upgrade file.
[0146] S1032C: If the verification information corresponding to the old version data is the same as the verification information of the upgrade data of the vehicle controller firmware, perform incremental upgrade processing on the vehicle controller firmware based on the upgrade information table.
[0147] In some embodiments, if the verification information obtained from the incremental upgrade file is consistent with the verification information requested from the controller, it means that the incremental upgrade file and the vehicle controller firmware match, and the vehicle controller firmware can be upgraded based on the upgrade information table; if the verification information obtained from the incremental upgrade file is different from the verification information requested from the controller, it means that the incremental upgrade file and the vehicle controller firmware do not match, and it is necessary to re-obtain the incremental upgrade file from the second electronic device.
[0148] It is understandable that by comparing the verification information corresponding to the old version data with the verification information of the upgrade data of the vehicle controller firmware, it can be confirmed whether the current controller firmware matches the incremental upgrade file to ensure the effective upgrade of the vehicle controller firmware.
[0149] In the implementation of this application, an incremental upgrade file of the vehicle controller firmware sent by the second electronic device is received; the incremental upgrade file is parsed to obtain at least one upgrade information table; each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type; the address information is determined according to the physical address information stored in the vehicle controller firmware; based on the address information, the vehicle controller firmware is incrementally upgraded to obtain the upgraded vehicle controller firmware; the incremental upgrade processing method corresponding to the address information of different address interval types is different. In this way, since the address information is determined according to the physical address information stored in the vehicle controller firmware, in the process of upgrading the vehicle controller firmware based on the address information, there will be no situation where the partition cannot be erased, thereby ensuring the feasibility of upgrading the vehicle controller firmware. In addition, since the incremental upgrade processing methods corresponding to the address information of different address interval types are different, upgrading the vehicle controller firmware based on the address information of different address interval types can improve the upgrade efficiency of the vehicle controller firmware.
[0150] The present application also provides a method for generating an incremental upgrade file, which can be performed before the incremental upgrade method provided in the present application. The method for generating an incremental upgrade file can be applied to a second electronic device, which can be a cloud device, a vehicle-mounted device, etc. Figure 2 As shown, the method for generating an incremental upgrade file provided in the present application can be implemented through the following steps S301 to S304, and each step is described separately below.
[0151] S301, obtaining old version data, upgraded data, address information corresponding to the old version data, and address information corresponding to the upgraded data of a vehicle controller firmware.
[0152] In some embodiments, the old version data of the vehicle controller firmware and the address information corresponding to the old version data may be pre-stored in the second electronic device, or the second electronic device may actively request the vehicle controller to obtain the old version data. The upgrade data of the vehicle controller firmware and the upgrade data may be pre-stored in the second electronic device, or the second electronic device may actively request other electronic devices that store the upgrade data and the address information corresponding to the upgrade data. The address information corresponding to the upgrade data may be the address information of multiple address spaces divided by the electronic device for the upgrade data according to the physical address information corresponding to the vehicle controller firmware, and the address information corresponding to the upgrade data may be stored in the second electronic device.
[0153] In some embodiments, the address information corresponding to the old version data can be the starting address identifier, address length and partition number of each address interval corresponding to the old version data, and the address information corresponding to the upgraded data can be the starting address identifier, address length and partition number of each address interval corresponding to the upgraded data.
[0154] S302: Determine multiple address interval types based on similarities between old version data and upgraded data.
[0155] In some embodiments, the address information corresponding to the vehicle controller firmware can be divided into multiple address interval types based on whether the old version data and the upgraded data of the vehicle controller firmware are the same. During implementation, multiple address interval types can also be determined based on whether the address information corresponding to the old version data and the address information corresponding to the upgraded data are the same.
[0156] In some embodiments, the address interval type includes a first type and a second type. The first upgraded data and the first original data corresponding to the first address information of the first type are the same, and the first original data is data in the old version data, but the address information corresponding to the first address information and the first original data are different; the second upgraded data and the old version data corresponding to the second address information of the second type are different.
[0157] S303: Create at least one upgrade information table based on the address range type.
[0158] It should be noted that each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type, and the address information is determined according to the physical address information stored in the vehicle controller firmware. The address information may include a start address identifier, address length, address number, etc.
[0159] In some embodiments, since one address interval type corresponds to one upgrade information table, and there may be multiple address interval types, the number of upgrade information tables may include multiple. The corresponding address information can be determined according to the address interval type, and then the corresponding upgrade information table can be constructed according to the address information.
[0160] S304: Generate an incremental upgrade file for the vehicle controller firmware based on the upgrade information table.
[0161] In some embodiments, after the upgrade information table is obtained, an incremental upgrade file of the vehicle controller firmware can be generated according to the upgrade information table and the incremental upgrade package determined according to the old version data and the upgrade data.
[0162] In the embodiment of the present application, multiple address interval types are determined based on the similarity between the old version data and the upgraded data, and the similarity between the address information corresponding to the old version data and the address information corresponding to the upgraded data, and at least one upgrade information table is created based on the address interval type, so as to facilitate the subsequent execution of different upgrade methods according to different upgrade information tables, thereby improving the upgrade efficiency. In addition, since the address information is determined based on the physical address information stored in the vehicle controller firmware, the partition will not be unable to be erased in the subsequent process of upgrading the vehicle controller firmware based on the incremental upgrade file constructed based on the upgrade information table corresponding to the address information, thereby ensuring the feasibility of upgrading the vehicle controller firmware.
[0163] In some embodiments of the present application, multiple address interval types are determined based on the similarity between the old version data and the upgraded data, that is, the above step S302 can be implemented by the following step S3021A, which is described below.
[0164] S3021A: If the first upgraded data in the upgraded data is the same as the first original data in the old version data, and the first address information corresponding to the first upgraded data is different from the address information corresponding to the first original data, the first address information is determined to be of the first type.
[0165] In some embodiments, the first upgrade data is partial upgrade data in the upgrade data, and the first original data is partial data in the old version data. In practice, the original data stored in each address interval corresponding to the first upgrade data and the old version data can be compared in turn, and the first original data that is the same as the first upgrade data can be found in the old version data, but the address information of the first original data is different from the first address information corresponding to the first upgrade data, then the first address information can be determined as the first type.
[0166] It can be understood that by determining address information with the same data but different address information as the first type, it is convenient to perform a copy operation according to the first type of address information during the subsequent vehicle controller firmware upgrade process, thereby improving the upgrade efficiency.
[0167] In some embodiments of the present application, the upgrade information table includes a first upgrade information table; based on the address interval type, at least one upgrade information table is created, that is, the above step S303 can be implemented by the following steps S3031A to S3032A, and each step is described below.
[0168] S3031A. Obtain at least one first address information whose address interval type is a first type.
[0169] It should be noted that the physical address corresponding to the storage of the vehicle controller firmware is predetermined, and the first address information may be determined based on the physical address information. The first address information may include an address start identifier, an address length, a partition number, etc. For example, if the physical address interval corresponding to the storage of the vehicle controller firmware is 0x8000 0000 to 0x8000D000, and the length of each partition is 0x1000, then the address length corresponding to the first address information is 0x1000, and the start address may be any one or more of the address interval 0x8000 0000 to 0x8000 D000, for example, it may be 0x80001000, 0x8000 2000, etc. Here, the first address information, and the start address and partition length corresponding to the first address information are merely exemplary, and this application does not limit this.
[0170] In some embodiments, the upgrade data and the old version data of the vehicle controller firmware can be fully compared, and the address information corresponding to the upgrade data and the address information corresponding to the old version data can be fully compared. If it is determined that there is first upgrade data (partial data in the upgrade data) that is the same as the first original data (partial data in the old version data) in the upgrade data, and the first address information of the first upgrade data is different from the address information corresponding to the first original data, then the address interval type of the first address information is determined to be the first type.
[0171] In some embodiments, the first address type may include one or more, and each first upgraded data in the upgraded data may be compared with each first original data in the old version data in turn, so as to determine the first address value information whose address interval type is the first type.
[0172] S3032A: Generate a first upgrade information table based on each piece of first address information and address information of first original data corresponding to each piece of first address information.
[0173] In some embodiments, after determining the first address information and the address information of the first original data corresponding to the first address information, a first upgrade information table can be generated based on the first address information and the address information of the first original data corresponding to the first address information, as well as the verification information corresponding to the first address information and the verification information corresponding to the address information of the first original data.
[0174] Exemplarily, the content stored in the first upgrade information table is as shown in Table 1, wherein the upgrade data starting address is the starting address of the address corresponding to each first upgrade data in the upgrade data, the address check value is the check value determined according to the first upgrade data, the old version data starting address is the starting address of the address corresponding to each first original data, the data length is the data length of each first original data, and the check value is the check value determined according to the first original data. Among them, the starting address of the upgrade data storage address interval with partition number 6 is 0x8000 6000, and the corresponding old version data address starting address is 0x8000 2600, that is, the old version data stored in the address interval with the starting address of 0x8000 2600 is the same as the upgrade data stored in the address interval with the starting address of 0x8000 6000.
[0175] Table 1 First upgrade information table
[0176] Partition number Upgrade data starting address Partition length Address check value Old version data starting address Data length Checksum 6 0x8000 6000 0x1000 xxx 0x8000 2600 0x1000 xxx 7 0x8000 7000 0x1000 xxx 0x8000 3600 0x1000 xxx 8 0x8000 8000 0x1000 xxx 0x8000 4600 0x1000 xxx 9 0x8000 9000 0x1000 xxx 0x8000 5600 0x1000 xxx 11 0x8000B000 0x1000 xxx 0x8000 8000 0x1000 xxx 12 0x8000C000 0x1000 xxx 0x8000 9000 0x1000 xxx
[0177] It can be understood that establishing a first upgrade information table based on first address information of the first type of address interval type and address information of the first original data corresponding to the first address information can enable subsequent copying operations based on the first address information in the first upgrade information table and the corresponding address information of the first original data, thereby speeding up the upgrade.
[0178] In some embodiments of the present application, after the first upgrade information table is generated, if the first address information in an upgrade information table includes address information of multiple corresponding first original data, the first address information is deduplicated to obtain an updated first upgrade information table.
[0179] In some embodiments, the same first upgrade data may include multiple first original data with different address information in the old version data, and each first original data is the same as the first upgrade data, but the address information and the first address information corresponding to the first upgrade data are different. Therefore, in the generated first upgrade information table, the first address information may correspond to the address information of multiple first original data. In this case, the starting addresses of the address information of each first original data can be arranged in ascending or descending order, and then the first address information and the address information of the corresponding first original data can be deduplicated. The other address information and the first address information of the address information of the first first original data (the first one in the address sequence obtained after the starting address is arranged in ascending or descending order) can be deleted accordingly, leaving only the first address information and the corresponding first first original data and the corresponding address information, thereby obtaining an updated first upgrade information table.
[0180] Exemplarily, the starting address corresponding to the first information is 0x8000 6000, and the starting address of the corresponding first original data may include 0x8000 5600 and 0x8000 8000. The address information with the starting address of 0x8000 8000 and the first address information with the starting address of 0x80006000 can be deleted accordingly, and only the address information with the starting address of 0x8000 5600 and the first address information with the starting address of 0x80006000 are retained.
[0181] It can be understood that, in a case where the first address information in the first upgrade information table includes address information of multiple corresponding first original data, by deduplicating the first address information in the first upgrade information table, it is possible to avoid multiple copies of the first original data corresponding to the same first upgrade data during the upgrade process based on the first upgrade information table, thereby improving the upgrade efficiency.
[0182] In some embodiments of the present application, an incremental upgrade file of the vehicle controller firmware is generated based on the upgrade information table, that is, the above step S304 can be implemented by the following steps S3041A to S3043A, and each step is described below.
[0183] S3041A. Obtain the total number of first address information in the first upgrade information table and the total number of address intervals stored in the vehicle controller firmware.
[0184] In some embodiments, the first address information in the first upgrade information table may include multiple first address information. After the first upgrade information table is generated, the total number of first address information can be determined. The total number of address intervals stored in the vehicle controller firmware can be obtained in advance or in real time from the vehicle controller or other vehicle equipment.
[0185] S3042A. Determine the percentage of the total number of first address information to the total number of address intervals stored in the vehicle controller firmware.
[0186] In some embodiments, the corresponding percentage can be obtained by comparing the total number of first address information with the total number of address intervals stored in the vehicle controller firmware. For example, if the total number of first address information is 10 and the total number of address intervals stored in the vehicle controller firmware is 30, the comparison percentage is 33.3%.
[0187] S3043A: If the percentage meets the preset threshold condition, generate an incremental upgrade file for the vehicle controller firmware based on the updated first upgrade information table.
[0188] In some embodiments, satisfying the preset condition may be that the percentage is greater than or equal to a preset threshold, and the preset threshold may be 30%, 45%, 60%, etc. If the total number of first address information accounts for a percentage of the total number of address intervals stored in the vehicle controller firmware, it means that the number of first address information is large, and subsequent upgrades based on the updated first upgrade information table can increase the upgrade speed. In this case, an incremental upgrade file for the vehicle controller firmware can be generated based on the updated first upgrade information table.
[0189] In some embodiments, if it is determined that the percentage does not meet the preset threshold condition, that is, the number of first address types belonging to the first type is small, in this case, the data in the updated first upgrade information table can be stored in the (updated) second upgrade information table. During the vehicle controller firmware upgrade process, the flash operation is performed directly based on the (updated) second upgrade information table, and the copy operation is no longer performed.
[0190] It can be understood that by determining the percentage of the total number of updated first address information to the total number of address intervals stored in the vehicle controller firmware, and when the percentage meets the preset threshold condition, an incremental upgrade file for the vehicle controller firmware is generated based on the updated first upgrade information table, which can ensure the proportion of subsequent copying operations in the upgrade process, thereby ensuring the upgrade efficiency of the firmware.
[0191] In some embodiments of the present application, multiple address interval types are determined based on the similarity between the old version data and the upgraded data, that is, the above step S302 can be implemented by the following step S3021B, which is described below.
[0192] S3021B: If the second upgrade data and the old version data in the upgrade data are different, the second address information corresponding to the second upgrade data is determined to be of the second type.
[0193] In some embodiments, the second upgrade data and the first upgrade data are both data segments in the upgrade data, but the first upgrade data and the second upgrade data are different. If the second upgrade data and the old version data in the upgrade data are different, it means that the second upgrade data is incremental upgrade data, and the second address information corresponding to the second upgrade data can be determined as the second type.
[0194] In some embodiments, each data segment in the upgrade data can be compared with each data segment in the old version data in turn. If the data segment identical to the second upgrade data is not found in the old version data, it can be determined that the address interval type of the second upgrade information corresponding to the second upgrade data is the second type.
[0195] It can be understood that by determining the second address information corresponding to the second upgrade data different from the old version data as the second type, it is convenient to subsequently generate a corresponding upgrade information table according to the second type of address information and perform a corresponding upgrade operation based on the upgrade information table.
[0196] In some embodiments of the present application, the upgrade information table includes a second upgrade information table, based on which, based on the address interval type, at least one upgrade information table is created, that is, the above step S303 can be implemented by the following steps S3031B to S3032B, and each step is described below.
[0197] S3031B, obtain at least one second address information whose address interval type is the second type.
[0198] In some implementations, after dividing the address interval type of the address information corresponding to the upgrade data, one or more second address information can be obtained. The second address information may include the starting address identifier, interval length and partition number of the corresponding address interval. The address interval corresponding to the second address information is used to store the second upgrade data.
[0199] S3032B. Generate a second upgrade information table based on each piece of second address information.
[0200] In some embodiments, a second information table can be generated based on the second address information and the verification information corresponding to the second address information. The verification information corresponding to the second address information can be determined based on the second upgrade data. Different second address information and corresponding verification information can be stored in the second information table as different entries.
[0201] It can be understood that by generating the second upgrade information table based on the second address information whose address interval type is the second type, it is convenient to perform incremental upgrade of the firmware based on the second upgrade information table later.
[0202] In some embodiments of the present application, after the second upgrade information table is generated, if there are multiple consecutive second address information in the second upgrade information table, the multiple consecutive second address information are merged to obtain an updated second upgrade information table.
[0203] In some embodiments, the second address information may be continuous, and the starting addresses corresponding to the second address information may be continuous. The merging of multiple continuous second address information may be arranging the second address information in ascending order, and determining the starting address corresponding to the first second address information and the starting address corresponding to the last second address information as the starting addresses of the merged multiple address information. By merging multiple continuous second address information, the content stored in the second upgrade information table can be reduced, and the amount of transmission of the incremental upgrade file can be reduced.
[0204] Exemplarily, if the second upgrade information table is as shown in Table 2, after merging multiple consecutive second address information (starting addresses 0x80002000 to 0x80005000) in Table 2, an updated second upgrade information table as shown in Table 3 below can be obtained.
[0205] Table 2 Second upgrade information table
[0206] Partition number The starting address corresponding to the second address information Partition length Partition checksum 2 0x8000 2000 0x1000 xxx 3 0x8000 3000 0x1000 xxx 4 0x8000 4000 0x1000 xxx 5 0x8000 5000 0x1000 xxx 10 0x8000A000 0x8000 xxx
[0207] Table 3 Updated second upgrade information table
[0208] Partition number The starting address corresponding to the second address information Partition length Partition checksum 2-5 0x8000 2000 0x4000 xxx 10 0x8000A000 0x1000 xxx
[0209] In some embodiments of the present application, the upgrade information table generates an incremental upgrade file for the vehicle controller firmware, that is, the above-mentioned step S304 can be implemented by the following steps S3041B to S3043B, and each step is described below.
[0210] S3041B. Obtain second upgrade data corresponding to the second address information.
[0211] In some embodiments, the second upgrade data corresponding to the second address information is incremental upgrade data, that is, data that does not exist in the old version of the data. Each second address information corresponds to a data segment, different second upgrade data are stored in different data segments, and all the second upgrade data constitute the entire upgrade data.
[0212] S3042B. Generate an incremental upgrade package for the vehicle controller firmware based on the second address information and the corresponding second upgrade data.
[0213] In some embodiments, a corresponding incremental upgrade package can be generated based on the second upgrade data and the corresponding address information. The geothermal address information corresponding to each second upgrade data can be used as its identification information, and the corresponding second upgrade data can be determined through the identification information.
[0214] S3043B. Generate an incremental upgrade file for the vehicle controller firmware based on the incremental upgrade package and the upgrade information table.
[0215] In some embodiments, after obtaining the incremental upgrade package and the upgrade information table, an incremental upgrade file of the vehicle controller firmware can be generated, and the upgrade information table can include a first upgrade information table and / or a second upgrade information table. The first upgrade information table can be the first upgrade information table obtained after deduplication processing (updated), and the second upgrade information table can be the second upgrade information table (updated) after address merging.
[0216] In some embodiments, in addition to the incremental upgrade package and the upgrade information table, the incremental upgrade file may also include verification information of the vehicle controller firmware, and the verification information may be a verification value determined based on the current firmware of the vehicle controller.
[0217] In some embodiments, the incremental upgrade file may also include a third upgrade information table, the address interval type corresponding to the third upgrade information table is a third type, the third upgrade data corresponding to the third address information of the third type is the same as the third original data in the old version data, and the third address information is the same as the address information corresponding to the third original data.
[0218] In some embodiments, the incremental upgrade file may also include a fourth upgrade information table, which includes address information and verification information corresponding to all upgrade data. Each upgrade data (first upgrade data, second upgrade data or third upgrade data) corresponds to an address information and a verification information. The address information may be a starting address, and the verification information may be a verification value determined based on the upgrade data.
[0219] It can be understood that by generating an incremental upgrade package for the vehicle controller firmware based on the second address information and the corresponding second upgrade data, and constructing an incremental upgrade file based on the upgrade information table and the incremental upgrade package, it can be convenient for the subsequent first electronic device to obtain the upgrade information table and upgrade data based on the incremental upgrade file, and complete the firmware upgrade based on the upgrade information table and the upgrade data.
[0220] In some embodiments of the present application, after generating the incremental upgrade file, the second electronic device can send the incremental upgrade file to the first electronic device, so that after receiving the incremental upgrade file, the first electronic device can perform incremental upgrade processing on the vehicle controller firmware based on the incremental upgrade file.
[0221] In the embodiment of the present application, multiple address interval types are determined based on the similarity between the old version data and the upgraded data, and the similarity between the address information corresponding to the old version data and the address information corresponding to the upgraded data, and at least one upgrade information table is created based on the address interval type, so as to facilitate the subsequent execution of different upgrade operations according to different upgrade information tables, thereby improving the upgrade efficiency. In addition, since the address information is determined based on the physical address information stored in the vehicle controller firmware, the partition will not be unable to be erased in the subsequent process of upgrading the vehicle controller firmware based on the incremental upgrade file constructed based on the upgrade information table corresponding to the address information, thereby ensuring the feasibility of upgrading the vehicle controller firmware.
[0222] Next, the implementation process of the application embodiment in the actual application scenario is introduced.
[0223] The present application embodiment provides a method for producing an incremental upgrade file, such as Figure 3 As shown, the method comprises the following steps:
[0224] S401, taking the controller memory physical address as the object, partitioning and numbering the application program address interval.
[0225] The application (firmware) address range is divided, provided that the controller application address range remains unchanged.
[0226] S402. Compare the contents of each partition of the new version firmware (equivalent to the "audit data" in other embodiments) with the contents of the old version firmware (equivalent to the "old version data" in other embodiments) according to the incremental upgrade package file comparison method to determine the partitions that do not need to be processed, the partitions that need to copy local data, and the partitions that need to rewrite data.
[0227] The content of the new version of the firmware is divided into the above-mentioned partitions, and the content of each partition is classified into the following categories: the first category, the partition content has consistent content in the corresponding address interval of the local old version of the controller firmware, and such partitions do not need to be processed; the second category (equivalent to the "first type" in other embodiments), the partition content has consistent content in the local old version of the controller firmware, but its address interval is inconsistent with the partition address interval, and such partitions can be copied inside the controller for upgrading; the third category (equivalent to the "second type" in other embodiments), the partition content does not have consistent content in the local old version of the controller firmware, and such partitions need to be rewritten for upgrading.
[0228] S403. Based on the data comparison results, generate a first data table corresponding to the partition that does not need to be processed, a second data table corresponding to the partition that needs to copy local data (equivalent to the "first upgrade information table" in other embodiments), a third data table corresponding to the partition that needs to rewrite data (equivalent to the "second upgrade information table" in other embodiments), and a fourth information table of all partition address information.
[0229] Calculate the checksum of each partition of the new version, and save the number, starting address, length and checksum of each partition in the corresponding data table. Obtain the content of each partition in turn and compare it with the local old version firmware in full, and match whether there is a data block with the same content in the local old version firmware. If it exists and the storage address is the same, the partition is recorded in the first data table, including the partition number, starting address, length and checksum of the partition. At the same time, the starting address, data length and checksum of the corresponding data block in the local old version firmware are recorded. If it exists, but the storage address is different, the partition is recorded in the second data table, and the starting address, data length and checksum of the data block with the same data in the local old version firmware are recorded. If there is no data block with the same content, the partition is recorded in the third data table, and the classification of all partitions in the fourth data table is completed according to this method.
[0230] Save the above four tables. The first data table records the partitions that do not need to be processed. The content of the corresponding partition in the table is the same as the content of the corresponding address range of the local old version firmware; the second data table records the partitions that need to be copied. The content of the corresponding partition in the table has the same data block in the local old version firmware, but the storage address range is different. The controller needs to copy the content of the storage address range of the local old version firmware to the address range corresponding to the partition of the new version firmware; the third data table records the partitions that need to be rewritten. The content of the corresponding partition in the table does not have the same data block in the local old version firmware; the fourth data table records the address range and partition check value of all partitions of the new version firmware. The algorithms that can be used to calculate the check value include SHA encryption algorithm, CRC cyclic redundancy check algorithm, and MD5 digest algorithm, etc.
[0231] The above method of comparing the contents of each partition of the new version firmware with the contents of the local old version firmware in full to determine whether there are data blocks in the local old version firmware that are identical to the contents of each partition, the process is as follows Figure 4 As shown, the method comprises the following steps:
[0232] S501, obtain the first x bytes of data of the new version firmware partition and compare them with the local old version firmware content.
[0233] S502: Determine whether there is corresponding data matching with the old version firmware.
[0234] If yes, execute the following step S503; otherwise, execute the following step S509.
[0235] If there is no corresponding data match in the old version of the firmware, this partition is recorded in the third data table, and the process returns to step S501 to continue to perform the next partition data match; if there is a matching data block in the local old version of the firmware, the next group of x consecutive bytes of data of the new version of the firmware partition is taken and compared with the next group of x consecutive bytes of data of the matching data block in the local old version of the firmware, where x can be any pre-set positive integer, such as 1, 2, 6, etc.
[0236] Determine whether the old version firmware has corresponding data matching. If not, record the partition to the third data table and return to step S501 to continue to compare the next partition data; if yes, continue to compare the next set of continuous x bytes of data.
[0237] S503, repeat the execution to see if the data reaches y groups.
[0238] If yes, then the following step S504 is executed; otherwise, the process returns to step S501 and continues to execute, wherein y represents the total number of new version data of the data length x.
[0239] S504: Calculate the check value of the data from the start address to the partition length address of the matching data in the local old version firmware, and compare it with the check value of the partition data of the new version firmware.
[0240] If there is matching data in the local old version firmware after repeatedly performing the comparison of y groups of data, the check value of the data from the starting address to the partition length address of the matching data in the local old version firmware is continued to be calculated and compared with the check value of the partition data of the new version firmware.
[0241] S505: Determine whether the check value calculated by the matching data block of the old version firmware does not match the check value of the partition data of the new version firmware.
[0242] If yes, execute the following step S506; otherwise, execute the following step S509.
[0243] It is determined whether the check value calculated by the old version firmware matching data block is consistent with the check value of the new version firmware partition data. If neither matches, the partition is recorded in the third data table, and the process returns to step S501 to continue to perform the next partition data matching.
[0244] S506: Determine whether the start address and data length in the matched data block correspond to and are consistent with the partition start address and partition length respectively.
[0245] If yes, execute the following step S507; otherwise, execute step S508.
[0246] If the old version of the firmware matches the data block with the same check value, continue to determine whether the starting address and data length of the matching data block in the old version of the firmware are consistent with the starting address and length of the partition. If so, record the partition into the first data table, save the partition starting address, partition length, partition check value, the starting address, data length, and check value of the data block corresponding to the old version of the firmware, and return to step 1 to continue to compare the next partition data; if not, record the partition into data 2, save the partition starting address, partition length, partition check value, the starting address, data length, and check value of all data blocks of the old version of the firmware, and return to step S501 to continue to compare the next partition data.
[0247] S507. The partitions are recorded in the first data table.
[0248] S508. Record the partitions into the second data table.
[0249] S509: partition and record to the third data table.
[0250] S510: Determine whether all partitions have completed grouping.
[0251] If yes, the process ends; otherwise, the process returns to step S501 and continues to execute.
[0252] After all partition data matching of all new versions of firmware is completed, the first data table, the second data table, and the third data table are saved, and the process is exited.
[0253] S404: De-duplicate data in the data table (second data table) corresponding to the partition where local data needs to be copied, and obtain an updated second data table (equivalent to the “updated first upgrade information table” in other embodiments).
[0254] For the second data table, there are cases where the new version partition content matches multiple data segments in the local old version firmware. Arrange the partition numbers in ascending / descending order, deduplicate the partitions, retain only one row of data, delete the duplicate data of the partitions, and sort out a more detailed second data table.
[0255] S405. Set a partition ratio threshold a. When the partition ratio of the updated second data table (equivalent to "the percentage of the total number of first address information to the total number of address intervals stored in the vehicle controller firmware" in other embodiments) is greater than or equal to a (equivalent to "the percentage meets the preset threshold condition" in other embodiments), the controller needs to perform a copy operation before incremental upgrade.
[0256] If the refined second data table contains few partitions, the efficiency of the controller performing the copy operation before the incremental upgrade is not significantly improved. The percentage of the number of partitions in the refined second data table to all partitions can be further counted, and a partition ratio threshold a is set. When the partition ratio of the refined second data table is greater than or equal to a, the controller needs to perform the copy operation before the incremental upgrade. Among them, the partition ratio of the updated second data table = the number of partitions in the updated second data table / the number of partitions in Table 4, and a is a rational number greater than 0 and less than 1.
[0257] S406: Merge the continuous partitions of the third data table to obtain an updated third data table (equivalent to the “new second upgrade information table” in other embodiments).
[0258] The continuous partitions of Table 3 are merged, the starting address of the first partition of the continuous partitions is used as the starting address of the merged partition, the length of a single partition multiplied by the number of continuous partitions is used as the length of the merged partition, and the updated third data table is obtained.
[0259] S407 , using the updated content of the third data table, and packaging and generating an incremental upgrade package according to the Flash Bootloader flashing process.
[0260] The incremental upgrade package is generated by packaging according to the Flash Bootloader flashing process using the updated content of the third data table. The incremental upgrade package generation process includes: obtaining the starting address and data length of each data segment in the incremental upgrade package according to the updated third data table; configuring the XML file of the incremental upgrade package according to the Flash Bootloader flashing process and the data segment address information; parsing the software package data according to the XML file, filling the upgrade data into the data transmission process, and packaging to generate the incremental upgrade package.
[0261] S408: Calculate the checksum of the old version software package used by the package making system to generate the incremental upgrade package.
[0262] The incremental upgrade process is to first obtain the version number of the controller's local old version firmware. The package making system generates an incremental upgrade package based on the version number by comparing the saved same version software package with the new version software package. It cannot be determined that the content of the controller's local old version firmware is consistent with the content of the same version software package saved by the package making system. Therefore, the verification value of the old version software package used by the package making system to generate the incremental upgrade package is calculated. The purpose of saving this verification value is to ensure that the content of the controller's local old version firmware is consistent with the content of the same version software package saved by the package making system. Because the controller has the problem of irregular version management, the same firmware version number may correspond to multiple firmwares with different contents. This process needs to be judged before the incremental upgrade to avoid the situation where the incremental upgrade package does not match the local old version firmware, resulting in abnormal controller function.
[0263] S409. Generate an incremental upgrade file based on the updated second data table, the updated third data table, the incremental upgrade package, and the old version software package checksum calculated above (equivalent to "generating an incremental upgrade file of the vehicle controller firmware based on the incremental upgrade package and the upgrade information table" in other embodiments), and provide it to the flashing host computer to execute a rapid incremental upgrade of the controller firmware.
[0264] Through the above process, the generation of incremental upgrade files is completed. All the above steps are completed during the package making process and do not affect the user's upgrade time.
[0265] like Figure 5 The figure shows the comparison of the old and new versions of the controller firmware. In the example, the controller application address range is 0x8000 0000 to 0x8000 D000, and the address range is divided into partition 0 to partition 12 according to the partition length 0x1000, with a total of 12 partitions. Comparing the contents of the new and old versions of the firmware, if the incremental upgrade method described in the literature is followed, only partition 0 and partition 1 do not need to be processed, and the remaining partitions need to be re-written.
[0266] according to Figure 4The incremental upgrade package file comparison method shown in the figure compares the contents of each partition of the new version of the firmware with the contents of the old version of the firmware in full to determine which upgrade method should be used for the contents of each partition. By comparison, the contents of Table 1 (second data table), Table 2 (third data table), Table 4 (first data table) and Table 5 (fourth data table) are obtained. Among them, partition 0 and partition 1 are recorded as partitions that do not need to be processed; partitions 6 to 9, partitions 11 and partition 12 are recorded as partitions that need to be copied; partitions 3 to 5, partition 10 are recorded as partitions that need to be re-written.
[0267] Table 4: Table of separation that does not require processing
[0268] Partition number New version partition starting address Partition length Partition checksum Old version start address Data length Checksum 0 0x8000 0000 0x1000 xxx 0x8000 0000 0x1000 xxx 1 0x8000 1000 0x1000 xxx 0x8000 1000 0x1000 xxx
[0269] Table 5 New version firmware data sheet
[0270] Partition number New version partition starting address Partition length Partition checksum 0 0x8000 0000 0x1000 xxx 1 0x8000 1000 0x1000 xxx 2 0x8000 2000 0x1000 xxx 3 0x8000 3000 0x1000 xxx 4 0x8000 4000 0x1000 xxx 5 0x8000 5000 0x1000 xxx 6 0x8000 6000 0x1000 xxx 7 0x8000 7000 0x1000 xxx 8 0x8000 8000 0x1000 xxx 9 0x8000 9000 0x1000 xxx A 0x8000A000 0x1000 xxx B 0x8000B000 0x1000 xxx C 0x8000C000 0x1000 xxx D 0x8000D000 0x1000 xxx
[0271] It can be seen from the contents of Table 1 that, on the one hand, new program segments are added to the firmware content, such as partitions 6 to 9, resulting in no change in the subsequent program content. However, in the case of storage address offset, the flashing efficiency can be improved by local copying of the controller; on the other hand, the overall storage address offset of the firmware program segment, such as partitions 11 and 12, can also be improved by local copying of the controller.
[0272] Furthermore, if the content of the new version partition matches multiple data segments of the local old version firmware, the partitions in Table 1 need to be deduplicated, and only one corresponding matching data segment is retained for one partition, and Table 1* (updated second data table) is obtained. Since there is no situation in Table 1 where the content of the new version partition matches multiple data segments of the local old version firmware, the contents of Table 1 and Table 1* are the same, and Table 1* is no longer displayed here. Further, according to the set partition ratio threshold a, it is determined whether the new version firmware meets the conditions for performing the copy operation; at the same time, in order to improve the data transmission efficiency during incremental upgrades, it is necessary to merge the continuous partitions in Table 2, and obtain Table 3 (updated third data table).
[0273] According to the updated data in Table 1 and Table 3, we can get Figure 6 The upgrade method of each partition in the new version of the firmware is shown. Generate an incremental upgrade package according to the incremental upgrade package preparation process described above using Table 3.
[0274] Table 1*, Table 3, the incremental upgrade package, and the calculated checksum value of the old version software package are used together to generate an incremental upgrade file, which is provided to the flashing host computer to perform a fast incremental upgrade of the controller firmware.
[0275] The present application provides a method for fast incremental firmware upgrade, which mainly includes: flashing the incremental upgrade file of the controller new version firmware received by the host computer (equivalent to the "first electronic device" in other embodiments), including the content of the updated second data table, the content of the updated second data table, the incremental upgrade package, and the calculated checksum value of the old version software package. Figure 7 As shown, the method for fast incremental firmware upgrade provided by this application can be implemented by the following steps:
[0276] S601. The flashing host computer receives an incremental upgrade file (equivalent to the "incremental upgrade file" in other embodiments) and obtains the file content.
[0277] S602, flashing the check value stored in the controller requested by the host computer (equivalent to "obtaining the check information of the old version data of the vehicle controller firmware" in other embodiments).
[0278] The controller allocates an area in the memory to store the checksum of the local old version of the firmware content. Before executing the upgrade process, the flash host computer first requests the checksum stored in the controller.
[0279] S603: Determine whether the verification value obtained in the incremental upgrade file (equivalent to the "verification information of the upgrade data of the vehicle controller firmware" in other embodiments) is consistent with the verification value returned by the controller.
[0280] If not, execute the following step S604; otherwise, execute step S605.
[0281] The flash host compares the obtained check value with the check value read from the incremental upgrade file. If the two check values are the same, the incremental upgrade file matches the old version of the controller's local firmware, and the incremental upgrade can be performed; if the two check values are different, the incremental upgrade file does not match the old version of the controller's local firmware, exit the incremental upgrade process, re-obtain the upgrade package, and perform a full upgrade. The check value stored in the controller requested by the flash host can be transmitted through a custom routine control service.
[0282] S604: Exit the incremental upgrade process, re-obtain the upgrade package, and perform a full upgrade.
[0283] After step S604, the following step S610 may be performed to update the saved check value of the local firmware version.
[0284] S605, the upper computer obtains the updated content of the second data table and transmits it to the controller to execute the copying of the corresponding content in the table.
[0285] When the verification is passed, the flashing host computer obtains the updated content of the second data table and transmits it to the controller to execute the copy of the corresponding partition content in the table. The flashing host computer transmits the updated content of the second data table to the controller, which can be implemented through a custom routine controller service or a 2E service.
[0286] S606. After receiving the request, the controller parses the message content and replies 0x78 to the bus to let the host computer wait for the controller to execute the copy process.
[0287] After receiving the data transmission request sent by the host computer, the controller parses the content of the updated second data table in the message and replies 0x78 to the bus, asking the host computer to wait for the controller to execute the copy process.
[0288] The controller needs to allocate an area in the memory to back up the contents that need to be erased in the address interval of the partition to be processed. Because in the copy process, the contents of the corresponding address interval of the local partition of the controller need to be erased first, and then the contents of the local matching data block address interval need to be copied to the corresponding address interval of the partition. If the data erased from the partition contains the source data of the subsequent copy processing partition, failure to back up the erased data will cause abnormalities in the subsequent upgrade process.
[0289] Furthermore, the controller needs to maintain an address mapping table between the erased partition address interval and the backup space address interval, that is, the correspondence between the data content in the erased partition address interval and the data content in the backup space address interval, and needs to implement instant access to the corresponding address content of the backup space through the original partition address.
[0290] S607, the controller executes the copy process, and after the execution is completed, it replies with an affirmative response to the flashing host computer.
[0291] The controller performs the replication process including the following steps:
[0292] (1) The controller parses the replication information transmitted by the flash host computer, obtains a set of data to be replicated, and reads the starting address and length of the new version partition in the list data;
[0293] (2) The controller performs a backup space erase;
[0294] (3) The controller obtains the corresponding partition content and saves it to the backup space;
[0295] (4) Obtaining the corresponding partition address information and backup space address information, and updating the address mapping table;
[0296] (5) The controller executes erasure of the corresponding partition content;
[0297] (6) The controller reads the starting address and data length of the old version in the list data to obtain the corresponding data;
[0298] (7) Copy data to the target partition;
[0299] (8) Determine whether there is other data in the list that needs to be copied. If so, jump to (1) to continue execution; if not, end the copy process and reply to the host computer to complete the execution.
[0300] The controller completes the copy process and sends a positive response to the flashing host computer.
[0301] S608, flashing the upper computer to perform incremental upgrade package parsing, and performing data transmission according to the Flash Bootloader flashing process in the upgrade package.
[0302] S609, flashing the host computer to request the controller to perform application validity verification to complete the rapid incremental upgrade of the firmware.
[0303] S610: Update the saved verification value of the local firmware version.
[0304] like Figure 8 FIG. 1 is a schematic diagram of the replication process in the controller fast incremental upgrade, wherein the partitions to be replicated include partitions 6 to 9, partition 11 and partition 12 shown in Table 1. Figure 8 The copy process of partition 6 is shown. First, the data in the controller address range 0x8000 6000 to 0x8000 7000 is backed up to the backup space, and the address mapping table is updated. Continue to copy the content of the partition matching data range to the partition address, and the copy process of one partition is completed. Follow this process to complete the copy of the remaining partitions.
[0305] like Fig. 9 The figure shows a schematic diagram of the flashing process in the controller fast incremental upgrade. In Table 3, the partitions that need to be re-written are partitions 2-5 and partition 10, with a total of two sections of data. Fig. 9 The host computer transmits the data at both ends to the controller through the diagnostic service to complete the flashing of the incremental upgrade package.
[0306] After completing the above copying and flashing process, the flashing host computer verifies the validity of the controller firmware, and the controller updates the verification value of the local version of the firmware, the fast incremental upgrade is completed.
[0307] This application provides a method for fast incremental upgrade of firmware with breakpoint resumption. Fig.10 As shown, the method comprises the following steps:
[0308] 701. The flashing host computer receives the incremental upgrade file and obtains the file content.
[0309] 702. Flash the check value stored in the controller requested by the host computer.
[0310] In the fast incremental upgrade process, after the flashing host computer completes the local version verification of the controller, it requests the verification values of each partition of its local old version stored in the controller. The verification values stored in the controller requested by the flashing host computer can be transmitted through a custom routine control service.
[0311] 703. Whether the check value obtained in the incremental upgrade file is consistent with the check value returned by the controller.
[0312] The flashing host receives the returned check value and compares the new version partition check value of each partition in the updated second data table with the check value of the corresponding partition returned by the controller. If the new version partition check value of each partition in the updated second data table is inconsistent with the check value of the corresponding partition returned by the controller, the following step S704 is executed; otherwise, the following step S705 is executed.
[0313] S704: Exit the incremental upgrade process, re-obtain the upgrade package, and perform a full upgrade.
[0314] After step S704, the following step S715 may be performed.
[0315] S705, flashing the upper computer to obtain the verification values of each partition of the local old version stored in the controller.
[0316] S706, the flashing host computer compares the updated partition check value of each partition in the second data table with the local corresponding partition check value of the controller in turn, and removes the partitions with the same check value.
[0317] If the check value of each partition in the updated second data table is the same as the check value of the corresponding partition in the controller, the partition is removed from the updated second data table until all partitions in the updated second data table are compared.
[0318] S707, the flashing host computer compares the updated partition check value in the third data table with the corresponding partition check value of the controller in turn, and removes the partitions with the same check value.
[0319] The flashing host computer compares the new version partition verification value of each partition in the updated third data table with the verification value of the corresponding partition returned by the controller in turn. If the verification values are the same, the partition is removed from the updated third data table until all partitions in the updated third data table are compared.
[0320] S708: Determine whether the updated second data table is empty.
[0321] If yes, then execute the following steps S709 to S710; otherwise, execute the following step S711. The flashing host computer determines whether the updated second data table is empty. If not, continue to execute according to the fast incremental upgrade method flow; if yes, skip the copy process, regenerate the xml file according to the updated third data table, regenerate the incremental upgrade package according to the xml file, and continue to execute according to the fast incremental upgrade method flow.
[0322] S709, flashing the upper computer to regenerate the XML file according to the updated third data table.
[0323] S710, flashing the upper computer to regenerate an incremental upgrade package according to the XML file.
[0324] After step S710, the following step S714 may be performed.
[0325] S711, flash the upper computer to obtain the updated second data table content and transmit it to the controller to execute the copying of the corresponding content in the table.
[0326] S712, after receiving the request, the controller parses the message content and replies 0x78 to the bus to let the host computer wait for the controller to execute the copy process.
[0327] S713, the controller executes the copy process, and after the execution is completed, it replies with an affirmative response to the flashing host computer.
[0328] S714, flashing the upper computer to perform incremental upgrade package parsing, and performing data transmission according to the Flash Bootloader flashing process in the upgrade package.
[0329] When the controller completes copying a partition during the copying process, the controller updates the check value of the partition stored locally in the controller; when the controller completes flashing a partition during the flashing process, the controller updates the check value of the partition stored locally in the controller.
[0330] When the flash host computer is performing a fast incremental upgrade on the controller, the vehicle often loses power or the upgrade terminal is terminated due to system malfunction. At this time, the controller may be in the process of copying or transmitting the incremental upgrade package.
[0331] When waiting for the next upgrade retry, the flashing host computer still needs to retransmit the updated content of the second data table to the controller, and the controller repeats the copy process, or the flashing host computer still needs to transmit the content of the incremental upgrade package to the controller, and repeat the flashing of the already flashed content.
[0332] S715, flashing the host computer to request the controller to perform application validity verification to complete the rapid incremental upgrade of the firmware.
[0333] S716. Update the verification value of the saved local firmware version (equivalent to "if it is determined that the validity verification passes, update the verification information of the vehicle controller firmware" in other embodiments).
[0334] Through the incremental upgrade method with breakpoint resume capability, the next re-upgrade after the controller flash interruption can be continued from the last interruption position. Through the above process, the controller can realize the fast incremental upgrade method with breakpoint resume.
[0335] The fast incremental firmware upgrade method proposed in this application uses a copy-copy method to implement the rewriting of reused content in the incremental upgrade file, avoiding re-transmission of bus data and improving the efficiency of firmware upgrade. The fast incremental firmware upgrade method with breakpoint resume proposed in this invention implements the process of transmitting data and saving progress during the firmware upgrade process, ensuring that even if the controller is interrupted during the upgrade, it can restart the transmission from the previous interruption point during the subsequent retry, further improving the efficiency of firmware upgrade.
[0336] This application provides a device for fast incremental firmware upgrade, such as Fig.11 As shown, the device 800 for fast incremental firmware upgrade includes a version collection module 801, an update detection and package making module 802, a flashing host computer 803, and a controller 804. The controller 804 includes a copy module 8041 and a flashing module 8042.
[0337] Version collection module 801: collects the local firmware version information of the controller 804 and uploads it to the update detection and packaging module 802.
[0338] Update detection and package making module 802: Receive the local firmware version information of the controller 804 from the version collection module 801, perform version update detection with the server, and determine whether there is a new version. If there is, perform the incremental upgrade file production process to obtain the updated second data table, the updated third data table, the incremental upgrade package, and the check value of the old version software package used by the update detection and package making module 802, package the above content to generate an incremental upgrade file, and provide it to the flashing host computer 803 for performing fast incremental upgrade.
[0339] Flashing the host computer 803: receiving the incremental upgrade file, verifying the local firmware version of the controller 804, and executing a fast incremental upgrade of the controller firmware after the verification passes.
[0340] Controller 804: Controller 804 needs to respond to version collection requests, firmware version content verification requests, and partition verification value upload requests from flashing host computer 803. When controller 804 receives a copy request from flashing host computer 803, it sends the command to copy module 8041 for execution; when controller 804 receives a data flash request from flashing host computer 803, it sends the command to flashing module 8042 for execution.
[0341] The incremental upgrade method provided in the present application uses a replication method to flash the new version content for data blocks with only address changes and unchanged content, which can improve the efficiency of firmware upgrades; the fast incremental upgrade method does not need to partition the local version of the controller firmware, but only needs to reserve backup space and save the check value of the local version of the firmware, integrates a replication module, and has low requirements for the controller; the physical address range of the controller memory is partitioned instead of the firmware content, which improves the feasibility of incremental upgrades; the firmware fast incremental upgrade method with breakpoint resumption ensures that even if the upgrade is interrupted, the next upgrade can start again from the interruption point, thereby improving the efficiency of firmware upgrades.
[0342] The present application provides a first electronic device, Fig.12 A schematic diagram of the structure of a first electronic device provided in an embodiment of the present application is shown in FIG. Fig.12 As shown, the first electronic device 900 includes:
[0343] The first receiving module 901 is used to receive an incremental upgrade file of the vehicle controller firmware sent by the second electronic device;
[0344] A first parsing module 902 is used to parse the incremental upgrade file to obtain at least one upgrade information table; each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type; the address information is determined according to the physical address information stored in the vehicle controller firmware;
[0345] The first incremental upgrade processing module 903 is used to perform incremental upgrade processing on the vehicle controller firmware based on the address information to obtain upgraded vehicle controller firmware; different incremental upgrade processing methods correspond to address information of different address interval types.
[0346] In some embodiments, the address interval type includes a first type, the first upgrade data corresponding to the first address information of the first type is the same as the first original data, the address information corresponding to the first address information and the first original data is different, and the first original data is the old version data of the vehicle controller firmware.
[0347] In some embodiments, the first incremental upgrade processing module 903 includes:
[0348] A first determination submodule, configured to determine first original data corresponding to the first address information if the address interval type corresponding to the first address information is of the first type;
[0349] The first copy submodule is used to copy the first original data to a first address interval in the address interval where the old version data of the vehicle controller firmware is stored; the first address interval is determined according to the first address information.
[0350] In some embodiments, the first incremental upgrade processing module 903 further includes:
[0351] The first updating submodule is configured to update the verification information corresponding to the first address interval according to the first original data after copying the first original data to the first address interval.
[0352] In some embodiments, the first incremental upgrade processing module 903 further includes:
[0353] The first storage submodule is used to store the original data stored in the first address interval in the backup address interval in the address interval of the old version data of the vehicle controller firmware, and store the first address information corresponding to the first address interval and the address information corresponding to the backup address interval as an entry in a preset mapping relationship table.
[0354] In some embodiments, the first incremental upgrade processing module 903 includes:
[0355] A first acquisition submodule, configured to acquire second upgrade data corresponding to the second address information if the address interval type corresponding to the second address information is of the second type;
[0356] The first deletion submodule is used to delete the original data stored in the second address interval in the address interval where the old version data of the vehicle controller firmware is stored, and to flash the second upgrade data to the second address interval; the second address interval is determined based on the second address interval information.
[0357] In some embodiments, the first incremental upgrade processing module 903 further includes:
[0358] The second updating submodule is configured to update the verification information of the second address interval based on the second upgrading data after the second upgrading data is flushed to the second address interval.
[0359] In some embodiments, the address interval type further includes a second type, and the second upgrade data corresponding to the second address information of the second type is different from the old version data of the vehicle controller firmware.
[0360] In some embodiments, the incremental upgrade processing of the first upgrade data takes precedence over the incremental upgrade processing of the second upgrade data.
[0361] In some embodiments, the first electronic device 900 further includes:
[0362] A first verification module, used for verifying the validity of the vehicle controller firmware after performing an incremental upgrade process on the vehicle controller firmware;
[0363] The first update module is used to update the verification information of the vehicle controller firmware if it is determined that the validity verification passes.
[0364] In some embodiments, the upgrade information table includes verification information of each address interval of a corresponding address interval type, and the first electronic device 900 further includes:
[0365] A second acquisition module, used to acquire verification information of an address interval corresponding to the vehicle controller firmware;
[0366] The first deleting module is used to delete the address information corresponding to the address interval from the upgrade information table if the verification information of the address interval exists in the upgrade information table.
[0367] In some embodiments, the incremental upgrade file carries verification information of the upgrade data of the vehicle controller firmware, and the first incremental upgrade processing module 903 includes:
[0368] A second acquisition submodule is used to obtain verification information of old version data of the vehicle controller firmware;
[0369] The first upgrade submodule is used to perform incremental upgrade processing on the vehicle controller firmware based on the upgrade information table if the verification information corresponding to the old version data is the same as the verification information of the upgrade data of the vehicle controller firmware.
[0370] The present application provides a second electronic device, Fig.13 A schematic diagram of the structure of a second electronic device provided in an embodiment of the present application is shown in FIG. Fig.13 As shown, the second electronic device 10 includes:
[0371] A first acquisition module 11 is used to acquire old version data, upgraded data, address information corresponding to the old version data, and address information corresponding to the upgraded data of the vehicle controller firmware;
[0372] A first determination module 12, configured to determine a plurality of address interval types based on similarities between the old version data and the upgraded data;
[0373] A first creation module 13, configured to create at least one upgrade information table based on the address interval type; each upgrade information table corresponds to an address interval type, the upgrade information table includes address information of the corresponding address interval type, and the address information is determined according to the physical address information stored in the vehicle controller firmware;
[0374] The first generating module 14 is used to generate an incremental upgrade file of the vehicle controller firmware based on the upgrade information table.
[0375] In some embodiments, the first determining module 12 includes:
[0376] The second determination submodule is used to determine the first address information as a first type if the first upgrade data in the upgrade data is the same as the first original data in the old version data, and the first address information corresponding to the first upgrade data is different from the address information corresponding to the first original data.
[0377] In some embodiments, the upgrade information table includes a first upgrade information table, and the first creation module 13 includes:
[0378] A third acquisition submodule, used to acquire at least one first address information whose address interval type is the first type;
[0379] The first generating submodule is used to generate a first upgrade information table based on each piece of first address information and address information of first original data corresponding to each piece of first address information.
[0380] In some embodiments, the first creation module 13 further includes:
[0381] The deduplication processing submodule is used to, if the first address information in the first upgrade information table includes address information of a plurality of corresponding first original data, perform deduplication processing on the first address information to obtain an updated first upgrade information table.
[0382] In some embodiments, the first generating module 14 includes:
[0383] A fourth acquisition submodule, used to acquire the total number of first address information in the first upgrade information table and the total number of address intervals stored in the vehicle controller firmware;
[0384] A third determination submodule, used to determine the percentage of the total number of the first address information to the total number of address intervals stored in the vehicle controller firmware;
[0385] The second generation submodule is used to generate an incremental upgrade file of the vehicle controller firmware based on the updated first upgrade information table if the percentage meets a preset threshold condition.
[0386] In some embodiments, the first determining module 12 further includes:
[0387] The fourth determining submodule is configured to determine, if the second upgrade data in the upgrade data is different from the old version data, that the second address information corresponding to the second upgrade data is of the second type.
[0388] In some embodiments, the upgrade information table includes a second upgrade information table; the first creation module 13 includes:
[0389] A fifth acquisition submodule, used to acquire at least one second address information whose address interval type is the second type;
[0390] The third generating submodule is used to generate a second upgrade information table based on each second address information.
[0391] In some embodiments, the first creation module 13 further includes:
[0392] The merging submodule is used to merge the multiple consecutive second address information if there are multiple consecutive second address information in the second upgrade information table, so as to obtain an updated second upgrade information table.
[0393] In some embodiments, the first generating module 14 includes:
[0394] A sixth acquisition submodule, used to acquire second upgrade data corresponding to the second address information;
[0395] a fourth generating submodule, configured to generate an incremental upgrade package of the vehicle controller firmware based on the second address information and corresponding second upgrade data;
[0396] The fifth generation submodule is used to generate an incremental upgrade file of the vehicle controller firmware based on the incremental upgrade package and the upgrade information table.
[0397] In some embodiments, the second electronic device further includes:
[0398] The sending module is used to send the incremental upgrade file to the first electronic device, so that the first electronic device performs incremental upgrade processing on the vehicle controller firmware based on the incremental upgrade file.
[0399] This application provides an incremental upgrade system. Fig.14 A schematic diagram of the structure of an incremental upgrade system provided in an embodiment of the present application is shown in FIG. Fig.14As shown, the incremental upgrade system 20 includes: a first electronic device 21 and a second electronic device 22. The first electronic device 21 and the second electronic device 22 establish a communication connection, and the second electronic device 22 is used to execute the incremental upgrade file generation method provided in this application. The second electronic device 22 sends the generated incremental upgrade file to the first electronic device 21. After receiving the incremental upgrade file sent by the second electronic device 22, the first electronic device 21 is used to execute the incremental upgrade method provided in this application.
[0400] It should be noted that the description of the first electronic device 21 and the second electronic device 22 in the embodiment of the present application is similar to the description of the corresponding method embodiment above, and has similar beneficial effects as the method embodiment, so it is not repeated. For technical details not disclosed in the embodiment of the present device, please refer to the description of the method embodiment of the present application for understanding.
[0401] It should be noted that in the embodiment of the present application, if the above-mentioned method for determining the video route information is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or the part that contributes to the relevant solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0402] Accordingly, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the incremental upgrade method applied to the first electronic device provided in the above embodiment is implemented, or the method for generating an incremental upgrade file applied to the second electronic device provided in the above embodiment is implemented.
[0403] An embodiment of the present application provides an information processing device. Fig.15 Another schematic diagram of the composition structure of the first electron provided in the embodiment of the present application is as follows: Fig.15As shown, the first electronic device 30 includes: a first memory 31, a first processor 32, a first communication interface 33 and a first communication bus 34. The first memory 31 is used to store executable upgrade instructions; the first processor 32 is used to execute the executable upgrade instructions stored in the first memory 31 to implement the incremental upgrade method applied to the first electronic device provided in the above embodiment.
[0404] The description of the first electronic device and storage medium embodiment above is similar to the description of the corresponding method embodiment above, and has similar beneficial effects as the corresponding method embodiment. For technical details not disclosed in the first electronic device and storage medium embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0405] The embodiment of the present application also provides a second electronic device. Fig.16 A schematic diagram of the structure of another second electronic device provided in an embodiment of the present application is shown in FIG. Fig.16 As shown, the second electronic device 40 includes: a second memory 41, a second processor 42, a second communication interface 43 and a second communication bus 44. The second memory 41 is used to store instructions for generating executable incremental upgrade files; the second processor 42 is used to execute the instructions for generating executable incremental upgrade files stored in the second memory 41 to implement the method for generating incremental upgrade files applied to the second electronic device provided in the above embodiment.
[0406] The description of the second electronic device and storage medium embodiment above is similar to the description of the corresponding method embodiment above, and has similar beneficial effects as the corresponding method embodiment. For technical details not disclosed in the vehicle-mounted terminal and storage medium embodiments of this application, please refer to the description of the method embodiment of this application for understanding.
[0407] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are 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 includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes at least one ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0408] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0409] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0410] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0411] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, disks or optical disks.
[0412] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a product to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.
[0413] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technical object familiar with the technical field can be easily conceived of within the technical scope disclosed in the present application. Changes or substitutions should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An incremental upgrade method, applied to a first electronic device, characterized in that: include: Receiving an incremental upgrade file of the vehicle controller firmware sent by the second electronic device; Parsing the incremental upgrade file to obtain at least one upgrade information table; Each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type; The address information is determined based on physical address information stored in the vehicle controller firmware; Based on the address information, incrementally upgrade the vehicle controller firmware to obtain upgraded vehicle controller firmware; The incremental upgrade processing methods corresponding to address information of different address range types are different.
2. The method according to claim 1, characterized in that The address interval type includes a first type, wherein the first upgrade data corresponding to the first address information of the first type is the same as the first original data, the address information corresponding to the first address information and the first original data is different, and the first original data is the old version data of the vehicle controller firmware.
3. The method according to claim 1, characterized in that The incremental upgrade process of the vehicle controller firmware based on the address information includes: If the address interval type corresponding to the first address information is the first type, determining first original data corresponding to the first address information; In the address interval where the old version data of the vehicle controller firmware is stored, the first original data is copied to a first address interval; the first address interval is determined according to the first address information.
4. The method according to claim 3, characterized in that Also includes: After the first original data is copied to the first address interval, the verification information corresponding to the first address interval is updated according to the first original data.
5. The method according to claim 3, characterized in that: Also includes: In the address interval of the old version data of the vehicle controller firmware, the original data stored in the first address interval is stored in the backup address interval, and the first address information corresponding to the first address interval and the address information corresponding to the backup address interval are stored as an entry in the preset mapping relationship table.
6. The method according to claim 1, characterized in that The incremental upgrade process of the vehicle controller firmware based on the address information includes: If the address interval type corresponding to the second address information is the second type, obtaining second upgrade data corresponding to the second address information; In the address interval where the old version data of the vehicle controller firmware is stored, the original data stored in the second address interval is deleted, and the second upgrade data is flashed to the second address interval; the second address interval is determined according to the second address interval information.
7. The method according to claim 6, characterized in that Also includes: After the second upgrade data is written to the second address interval, the verification information of the second address interval is updated based on the second upgrade data.
8. The method according to claim 2, characterized in that: The address interval type also includes a second type, and the second upgrade data corresponding to the second address information of the second type is different from the old version data of the vehicle controller firmware.
9. The method according to claim 8, characterized in that The incremental upgrade processing of the first upgrade data takes precedence over the incremental upgrade processing of the second upgrade data.
10. The method according to claim 1, characterized in that Also includes: After performing incremental upgrade processing on the vehicle controller firmware, performing validity verification on the vehicle controller firmware; If it is determined that the validity check passes, the verification information of the vehicle controller firmware is updated.
11. The method according to claim 1, characterized in that: The upgrade information table includes verification information of each address interval of the corresponding address interval type, and the method further includes: Obtaining verification information of an address interval corresponding to the vehicle controller firmware; If the verification information of the address interval exists in the upgrade information table, the address information corresponding to the address interval is deleted from the upgrade information table.
12. The method according to claim 1, characterized in that The incremental upgrade file carries verification information of the upgrade data of the vehicle controller firmware; The incremental upgrade process of the vehicle controller firmware based on the address information includes: Obtaining verification information of old version data of the vehicle controller firmware; If the verification information corresponding to the old version data is the same as the verification information of the upgrade data of the vehicle controller firmware, the vehicle controller firmware is incrementally upgraded based on the upgrade information table.
13. A method for generating an incremental upgrade file, applied to a second electronic device, characterized in that: include: Obtaining old version data, upgraded data, address information corresponding to the old version data, and address information corresponding to the upgraded data of the vehicle controller firmware; Determining a plurality of address interval types based on similarities between the old version data and the upgraded data; Based on the address interval type, at least one upgrade information table is created; each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type, and the address information is determined according to the physical address information stored in the vehicle controller firmware; Based on the upgrade information table, an incremental upgrade file of the vehicle controller firmware is generated.
14. The method according to claim 13, characterized in that The determining of multiple address interval types based on the similarity between the old version data and the upgraded data includes: If the first upgraded data in the upgraded data is the same as the first original data in the old version data, and the first address information corresponding to the first upgraded data is different from the address information corresponding to the first original data, the first address information is determined to be of the first type.
15. The method according to claim 14, characterized in that The upgrade information table includes a first upgrade information table; the creating at least one upgrade information table based on the address interval type includes: Acquire at least one first address information whose address interval type is the first type; A first upgrade information table is generated based on each piece of first address information and address information of the first original data corresponding to the each piece of first address information.
16. The method according to claim 15, characterized in that Also includes: If the first address information in the first upgrade information table includes address information of a plurality of corresponding first original data, the first address information is deduplicated to obtain an updated first upgrade information table.
17. The method according to claim 16, characterized in that The step of generating an incremental upgrade file of the vehicle controller firmware based on the upgrade information table includes: Acquire the total number of first address information in the first upgrade information table and the total number of address intervals stored in the vehicle controller firmware; determining a percentage of the total number of the first address information to the total number of address intervals stored in the vehicle controller firmware; If the percentage meets a preset threshold condition, an incremental upgrade file of the vehicle controller firmware is generated based on the updated first upgrade information table.
18. The method according to claim 13, characterized in that The determining of multiple address interval types based on the similarity between the old version data and the upgraded data includes: If the second upgrade data in the upgrade data is different from the old version data, the second address information corresponding to the second upgrade data is determined as a second type.
19. The method according to claim 18, characterized in that The upgrade information table includes a second upgrade information table; the creating at least one upgrade information table based on the address interval type includes: Acquire at least one second address information whose address interval type is the second type; Based on each piece of second address information, a second upgrade information table is generated.
20. The method according to claim 19, characterized in that The method further comprises: If there are multiple continuous second address information in the second upgrade information table, the multiple continuous second address information are merged to obtain an updated second upgrade information table.
21. The method according to claim 18, characterized in that Based on the upgrade information table, an incremental upgrade file of the vehicle controller firmware is generated, including: Acquire second upgrade data corresponding to the second address information; generating an incremental upgrade package of the vehicle controller firmware based on the second address information and the corresponding second upgrade data; An incremental upgrade file of the vehicle controller firmware is generated based on the incremental upgrade package and the upgrade information table.
22. The method according to claim 13, characterized in that The method further comprises: The incremental upgrade file is sent to a first electronic device, so that the first electronic device performs incremental upgrade processing on the vehicle controller firmware based on the incremental upgrade file.
23. A first electronic device, characterized in that: include: A first receiving module, used for receiving an incremental upgrade file of the vehicle controller firmware sent by the second electronic device; A first parsing module, configured to parse the incremental upgrade file to obtain at least one upgrade information table; each upgrade information table corresponds to an address interval type, and the upgrade information table includes address information of the corresponding address interval type; The address information is determined based on physical address information stored in the vehicle controller firmware; A first incremental upgrade processing module, configured to perform incremental upgrade processing on the vehicle controller firmware based on the address information to obtain upgraded vehicle controller firmware; The incremental upgrade processing methods corresponding to address information of different address range types are different.
24. A second electronic device, characterized in that: include: A first acquisition module, used to acquire old version data, upgraded data, address information corresponding to the old version data, and address information corresponding to the upgraded data of the vehicle controller firmware; A first determination module, configured to determine a plurality of address interval types based on similarity between the old version data and the upgraded data, and similarity between address information corresponding to the old version data and address intervals corresponding to the upgraded data; A first creation module, configured to create at least one upgrade information table based on the address interval type; each upgrade information table corresponds to an address interval type, the upgrade information table includes address information of the corresponding address interval type, and the address information is determined according to the physical address information stored in the vehicle controller firmware; The first generating module is used to generate an incremental upgrade file of the vehicle controller firmware based on the upgrade information table.
25. An incremental upgrade system, characterized in that: It includes a first electronic device and a second electronic device; wherein, The first electronic device is used to perform the incremental upgrade method according to any one of claims 1 to 12; The second electronic device is used to execute the method for generating an incremental upgrade file according to any one of claims 13 to 22.
26. A first electronic device, characterized in that: It includes a first processor and a first memory; wherein, The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the incremental upgrade method according to any one of claims 1 to 12 when running the computer program.
27. A second electronic device, characterized in that: comprising a second processor and a second memory; wherein, The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method for generating an incremental upgrade file according to any one of claims 13 to 22 when running the computer program.
28. A computer-readable storage medium, characterized in that: The storage medium stores computer program code, and when the computer program code is executed by a computer, the incremental upgrade method described in any one of claims 1 to 12, or the method for generating an incremental upgrade file described in any one of claims 13 to 22 is executed.
