OTA differential upgrading method and device, medium and computer program product
Through differential restoration and inter-core communication technology, partition images are read and written one by one, solving the problem of slow OTA upgrade speed and achieving a faster upgrade process and higher security.
Patent Information
- Application Number
- CN202510758669.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-09
AI Technical Summary
In the prior art, during the OTA differential upgrade process of a vehicle electronic system, the large size of the target version firmware causes the upgrade time to be too long, affecting the upgrade speed.
By reading the partition images in the differential upgrade package one by one, performing differential restoration processing, generating the target partition image, and writing it to the memory in real time, deleting the basic version firmware, using inter-core communication to accelerate the upgrade process, and combining hash value proofreading to ensure the correctness and integrity of the upgrade package.
It reduces the flashing time of the target version firmware, improves the speed and efficiency of OTA differential upgrades, ensures the security and reliability of the upgrade process, and avoids vehicle electronic system failures caused by upgrade failures.
Smart Images

Figure CN120610731A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of automotive OTA technology, and in particular to an OTA differential upgrade method, device, medium, and computer program product. Background Art
[0002] In vehicle electronic systems, OTA (Over-The-Air) differential upgrade technology has gradually been widely used.
[0003] In the related art, during the OTA differential upgrade of the vehicle electronic system, it is necessary to first restore the differential upgrade package and the basic version firmware in the memory to obtain the complete target version firmware, and then write the target version firmware into the memory to complete the upgrade process.
[0004] However, the size of the complete target version firmware is large, which will cause the absorption time of the target version firmware to be too long, resulting in a slower OTA upgrade process. Summary of the Invention
[0005] The embodiments of the present disclosure provide an OTA differential upgrade method, device, medium, and computer program product that can solve the above-mentioned technical problems existing in the related art. The technical solution is as follows:
[0006] In a first aspect, an OTA differential upgrade method is provided. The method is applied to an electronic system of a vehicle, wherein a memory of the electronic system stores a base version of firmware, the base version of firmware including multiple base partition images, and the method includes:
[0007] Obtaining a differential upgrade package, wherein the differential upgrade package is used to upgrade the base version firmware in the memory to a target version firmware, and the differential upgrade package includes multiple partition images;
[0008] Reading partition images one by one in the differential upgrade package, obtaining a base partition image corresponding to the read partition image each time a partition image is read, performing differential restoration processing on the read partition image and the obtained base partition image to obtain a target partition image of the target version firmware, and writing the obtained target partition image into the memory each time a target partition image is obtained;
[0009] The basic version firmware in the memory is deleted.
[0010] In some possible implementations, the electronic system includes a processor, the processor includes an R core and an A core, the memory includes a first space and a second space, the first space corresponds to the R core, the second space corresponds to the A core, the multiple base partition images include m first base partition images and n second base partition images, the m first base partition images are stored in the first space, the n second base partition images are stored in the second space, the multiple partition images include m first partition images and n second partition images, the m first partition images correspond one-to-one to the m first base partition images, and the n second partition images correspond one-to-one to the n second base partition images;
[0011] The step of reading partition images one by one in the differential upgrade package includes:
[0012] In the differential upgrade package, the m first partition images are first read one by one, and then the n second partition images are read one by one.
[0013] In some possible implementations, the method further includes:
[0014] After obtaining the differential upgrade package, the differential upgrade package is moved to a designated space, where the designated space corresponds to the A core and is used to store the target partition image obtained by differential restoration;
[0015] After obtaining the target partition image corresponding to the first partition image, the obtained target partition image is written into the first space through inter-core communication.
[0016] In some possible implementations, before reading partition images one by one in the differential upgrade package, the method further includes:
[0017] Obtain a first proofreading file, wherein the first proofreading file stores a first hash value;
[0018] Obtain a second hash value of the differential upgrade package, and compare the first hash value with the second hash value.
[0019] In some possible implementations, the differential upgrade package includes a second proofreading file, wherein the second proofreading file stores a plurality of third hash values. After comparing the first hash value with the second hash value, the method further includes:
[0020] Obtain fourth hash values of the multiple partition images, and compare the multiple third hash values with the fourth hash values of the multiple partition images.
[0021] In some possible implementations, after obtaining the differential upgrade package, the method further includes:
[0022] It is detected whether the electronic system meets a specified upgrade condition, and if the electronic system meets the upgrade condition, the partition images are read one by one in the differential upgrade package.
[0023] In some possible implementations, the method further includes:
[0024] In the case that the electronic system does not meet the upgrade condition, a prompt message for adjusting the status of the electronic system is issued.
[0025] In a second aspect, an OTA differential upgrade device is provided, the device being used to upgrade an electronic system of a vehicle, wherein a memory of the electronic system stores a base version of firmware, the base version of firmware including multiple base partition images, the device comprising an acquisition module, a calculation module, a writing module, and a deletion module;
[0026] The acquisition module is used to acquire a differential upgrade package, wherein the differential upgrade package is used to replace the base version firmware in the memory with the target version firmware, and the differential upgrade package includes multiple partition images;
[0027] The acquisition module is further configured to read partition images one by one in the differential upgrade package, and acquire a base partition image corresponding to the read partition image each time a partition image is read;
[0028] The calculation module is used to perform differential restoration on the read partition image and the obtained basic partition image to obtain a target partition image of the target version firmware;
[0029] The writing module is used for writing the obtained target partition image into the memory after obtaining each target partition image;
[0030] The deletion module is used to delete the basic version firmware in the memory.
[0031] In a third aspect, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the OTA differential upgrade method as described in the first aspect and its possible implementation method.
[0032] In a fourth aspect, a computer program product is provided, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement the OTA differential upgrade method as described in the first aspect and its possible implementation method.
[0033] The beneficial effects of the technical solution provided by the present disclosure include at least:
[0034] When performing an OTA upgrade on the vehicle's electronic system, each time a target partition image of the target version firmware is obtained, the target partition image will be written to the memory, thereby reducing the flashing time of the target version firmware and speeding up the OTA differential upgrade process.
[0035] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0037] Figure 1 This is a flow chart of an OTA differential upgrade method provided by an embodiment of the present disclosure;
[0038] Figure 2 This is a heterogeneous SOC differential upgrade flow chart provided by an embodiment of the present disclosure;
[0039] Figure 3 This is a diagram of a heterogeneous SOC differential upgrade architecture provided by an embodiment of the present disclosure;
[0040] Figure 4 This is a schematic diagram of OTA differential packet flow provided by an embodiment of the present disclosure;
[0041] Figure 5 This is a design diagram of an OTA dual encryption and decryption system provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0043] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0044] An embodiment of the present disclosure provides an OTA differential upgrade method, which is applied to an electronic system of a vehicle. A memory of the electronic system stores a base version of firmware, which includes multiple base partition images. The method includes:
[0045] 101. Obtain a differential upgrade package, wherein the differential upgrade package is used to upgrade the base version firmware in the memory to the target version firmware, and the differential upgrade package includes multiple partition images;
[0046] 106. Read the partition images one by one in the differential upgrade package, obtain a base partition image corresponding to the read partition image each time a partition image is read, perform differential restoration on the read partition image and the obtained base partition image, and obtain a target partition image of the target version firmware;
[0047] 107. Each time a target partition image is obtained, the obtained target partition image is written into the memory;
[0048] 108. Delete the basic version firmware in the memory.
[0049] By adopting the OTA differential upgrade method provided in the embodiment of the present disclosure, when performing OTA upgrade on the electronic system of a vehicle, each time a target partition image of the target version firmware is obtained, the obtained target partition image will be written to the memory, thereby reducing the flashing time of the target version firmware and speeding up the OTA differential upgrade process.
[0050] Here, steps 106 and 107 may mean that while step 107 is being executed, step 106 is still being executed. This allows for further improvement in the efficiency of the firmware upgrade by performing steps 106 and 107 in parallel. Of course, steps 106 and 107 may also mean that each step 106 and 107 is completed, and the cycle continues. This is not a limitation of the present embodiment.
[0051] In some possible implementations, the memory includes partition A and partition B, the basic version firmware is stored in partition A, and the target partition image is written to partition B. Before deleting the basic version firmware in the memory, the key data in partition A (such as user configuration, logs, and runtime status) is copied to partition B.
[0052] In this way, during the OTA differential upgrade process, partition A and partition B are independent of each other, which can prevent the OTA differential upgrade from interfering with the normal use of the electronic system, allowing users to use the vehicle normally when the electronic system is undergoing OTA.
[0053] In some possible implementations, an electronic system includes a processor, the processor includes an R core and an A core, a memory includes a first space and a second space, the first space corresponds to the R core, the second space corresponds to the A core, the multiple base partition images include m first base partition images and n second base partition images, the m first base partition images are stored in the first space, the n second base partition images are stored in the second space, the multiple partition images include m first partition images and n second partition images, the m first partition images correspond one-to-one to the m first base partition images, and the n second partition images correspond one-to-one to the n second base partition images;
[0054] Reading partition images one by one in a differential upgrade package includes:
[0055] In the differential upgrade package, firstly read the m first partition images one by one, and then read the n second partition images one by one.
[0056] Among them, in this processor, the R core is a real-time core, which is mainly used to process real-time tasks of the vehicle electronic system, including but not limited to braking, steering or power management; the A core is a used core, which is mainly used to process application tasks of the vehicle electronic system, including but not limited to infotainment systems or navigation, etc., and the A core application is highly dependent on the real-time data provided by the R core. If the R core is not upgraded, it may cause data format mismatch or protocol conflict, thereby causing functional abnormalities.
[0057] Therefore, the first partition image is read first and the part corresponding to the R core in the electronic system is upgraded, which can avoid resource contention with the A core and the complexity of concurrent control, thereby reducing the risk of system crash.
[0058] In some possible implementations, the first space includes an A1 partition and a B1 partition, the first basic partition image is stored in the A1 partition, and the target partition image corresponding to the first basic partition image is written to the B1 partition. Before deleting the basic partition image in the A1 partition, the key data (such as user configuration, logs, and runtime status) in the A1 partition is copied to the B1 partition.
[0059] In this way, during the OTA differential upgrade process, the A1 partition and the B1 partition are independent of each other, thereby avoiding the OTA differential upgrade from interfering with the normal use of the R core functions of the electronic system, so that users can use the R core functions of the vehicle normally when the electronic system is undergoing OTA.
[0060] In some possible implementations, the second space includes an A2 partition and a B2 partition, the second base partition image is stored in the A2 partition, and the target partition image corresponding to the second base partition image is written to the B2 partition. Before deleting the base partition image in the A2 partition, the key data in the A2 partition (such as user configuration, logs, and runtime status) is copied to the B2 partition.
[0061] In this way, during the OTA differential upgrade process, the A2 partition and the B2 partition are independent of each other, thereby preventing the OTA differential upgrade from interfering with the normal use of the A core functions of the electronic system, so that users can use the A core functions of the vehicle normally when the electronic system is undergoing OTA.
[0062] In some possible implementations, the method further includes:
[0063] 105. After obtaining the differential upgrade package, move the differential upgrade package to a designated space. The designated space corresponds to core A and is used to store the target partition image obtained by differential restoration.
[0064] After obtaining the target partition image corresponding to the first partition image, the obtained target partition image is written into the first space through inter-core communication.
[0065] In related technologies, if the processor has an R core and an A core, after obtaining the target version of the firmware, the target version of the firmware is often written into the first space through the DoIP (Diagnostic communication over Internet Protocol, diagnostic communication based on IP network) protocol or the DoCAN (Diagnostic communication over Controller Area Network, diagnostic communication based on controller local area network) protocol. The transmission rate of the DoIP protocol or the DoCAN protocol is often low, which will also affect the speed of OTA upgrades.
[0066] In comparison, after obtaining the target partition image corresponding to the first partition image, the embodiment of the present disclosure writes the obtained target partition image into the first space through inter-core communication, which can greatly improve the speed of writing the target version firmware into the first space, thereby further improving the speed of OTA upgrades and reducing the time required for OTA upgrades.
[0067] In some possible implementations, before reading the partition images one by one in the differential upgrade package, the method further includes:
[0068] 102. Obtain a first proofreading file, in which a first hash value is stored; obtain a second hash value of the differential upgrade package, and compare the first hash value with the second hash value.
[0069] Among them, in cases such as but not limited to differential upgrade package download errors, if the partition images are directly read one by one in the differential upgrade package and upgraded, it may cause the upgrade to fail, thereby wasting the user's time, or even if the target version firmware is obtained, the target version firmware may contain errors and be unusable, which may cause the vehicle's electronic system to malfunction, thereby affecting the normal use of the vehicle.
[0070] In this way, by comparing the first hash value with the second hash value, it is possible to determine whether the differential upgrade package is obtained correctly, thereby reducing the possibility of OTA upgrade failure due to differential upgrade package file errors.
[0071] In some possible implementations, the differential upgrade package includes a second proofreading file, wherein the second proofreading file stores a plurality of third hash values. After comparing the first hash value with the second hash value, the method further includes:
[0072] 103. Obtain fourth hash values of the multiple partition images, and compare the multiple third hash values with the fourth hash values of the multiple partition images.
[0073] Among them, in cases such as but not limited to partition image packaging errors in the differential upgrade package, if the partition images are directly read one by one in the differential upgrade package and upgraded, it may cause the partition image restoration to fail, thereby wasting the user's time, or even if the target partition image is obtained, the obtained target partition image may contain errors and be unusable, which may cause the vehicle's electronic system to malfunction, thereby affecting the normal use of the vehicle.
[0074] In this way, by comparing the third hash value with the fourth hash value, it is possible to determine whether the partition image is packaged correctly, thereby reducing the possibility of OTA upgrade failure due to partition image errors.
[0075] In addition, after obtaining the differential upgrade package, the first hash value will be compared with the second hash value. After each partition image is read, the third hash value will be compared with the fourth hash value. This can further reduce the possibility of errors in the differential upgrade package through double hash value verification, and further reduce the possibility of OTA differential upgrade failure.
[0076] In some possible implementations, after obtaining the differential upgrade package, the method further includes:
[0077] 104. Check whether the electronic system meets the specified upgrade conditions. If the electronic system meets the upgrade conditions, read the partition images one by one in the differential upgrade package.
[0078] Among them, if the electronic system does not meet the specified upgrade conditions, it means that the electronic system may be in a state that cannot be upgraded. At this time, if the electronic system is upgraded directly, it is difficult to ensure the safety of the user's use of the car. Therefore, before upgrading the electronic system, the embodiment of the present disclosure will detect whether the electronic system meets the specified upgrade conditions, and only perform subsequent upgrades if the electronic system meets the upgrade conditions, thereby ensuring the safety of the user's use of the car.
[0079] Optionally, the upgrade condition may be, for example, but not limited to, the battery level exceeding a specified value (such as 30%), the free storage space being greater than a specified capacity (such as 15 GB), and the like.
[0080] In some possible implementations, the method further includes:
[0081] When the electronic system does not meet the upgrade conditions, a prompt message is issued to adjust the status of the electronic system.
[0082] In this way, the user can be reminded to adjust the status of the electronic system in time so that the electronic system meets the upgrade conditions, thereby ensuring the normal progress of the OTA differential upgrade.
[0083] Optionally, the prompt information for adjusting the status of the electronic system may be, for example but not limited to, charging the vehicle, clearing storage space, etc.
[0084] The following will be combined Figures 2 to 5 , taking a heterogeneous SOC (System on Chip) differential upgrade process as an example, this method is explained.
[0085] Figure 2 A heterogeneous SO upgrade flow chart is given, which will be combined with Figure 2 The OTA differential upgrade method based on the above heterogeneous multi-core processor is further explained:
[0086] a. The vehicle is powered on, and the OTA cloud starts the HMI (Human Machine Interface), UCMMASTER (Update and Configuration Management MASTER), and diagnostic host computer services. After checking preconditions, it triggers the ADCC (Autonomous Driving Control Center) to enter OTA mode.
[0087] a. ADCC enters OTA mode and starts diagnostic flash service and upgrade management service;
[0088] b. The diagnostic flash service downloads the differential upgrade package to the ADCC dedicated storage area;
[0089] c. The upgrade management service decrypts the differential upgrade package and performs level 1 RSA signature verification.
[0090] d. The upgrade management service decompresses the differential upgrade package, starts the master control upgrade program, and performs secondary RSA signature verification on the internal zip package;
[0091] f. If the above process fails to verify the signature or start, the upgrade will be terminated by entering the exception handling process;
[0092] g. If the above processes are normal, enter the image flashing A core to directly flash the EMMC (Embedded Multi Media Card) partition and perform differential restoration and upgrade by calling the differential tool;
[0093] The hA core notifies the R core to start the OTA upgrade program through inter-core communication and sends the differentially restored image to the R core;
[0094] The iR core performs HSM (Hardware Security Module) decryption verification and upgrades NorFlash via XSPI;
[0095] The jA core master upgrade program queries the differential upgrade progress and results and feeds back to the upgrade management service;
[0096] k. If the upgrade is successful, perform A / B partition synchronization and BAK partition synchronization to complete the upgrade. If the upgrade fails, roll back.
[0097] Optionally, in step a, the preconditions may include: heterogeneous SOC supports inter-core communication, and the electronic system can obtain the following information: vehicle mode, vehicle OBD port status, vehicle VIN code acquisition, vehicle charging status, domain control software and hardware version number, part number, supplier code, product serial number, Bootloader version number, DID of the calibration version number, vehicle's external 4G / 5G network, ADCC dedicated OTA storage space, ADCC domain control OTA status, vehicle speed, gear, handbrake, power gear, vehicle mode, etc.
[0098] Optionally, in the above upgrade process, the JSON file used may contain the following code:
[0099]
[0100]
[0101] Figure 3 A heterogeneous SOC differential upgrade architecture diagram is given, which will be combined with Figure 3The following explains the logical nodes in the OTA differential upgrade method based on the above heterogeneous multi-core processor:
[0102] (1) ICC (Intelligent Chassis Controller) domain control module:
[0103] HMI: The human-machine interaction module is deployed in the ICC and communicates with the UCM Master program through the in-vehicle device management protocol. It is responsible for functions such as upgrade prompts, guiding user operations, and displaying upgrade progress and results.
[0104] UCM Master: The main program for upgrading and configuring management, mainly responsible for vehicle-cloud interaction: by collecting the software and hardware version information of each ECU (Electronic Control Unit) in the vehicle and reporting it to the OTA Server (OTA server) cloud, the cloud issues OTA upgrade tasks, and UCM Master is responsible for upgrading task strategy analysis, execution, and downloading, verifying, storing, and distributing upgrade packages. It also collects the download and upgrade results of each ECU and feeds them back to the cloud. In addition, UCM Master also supports advanced functions such as remote diagnosis, breakpoint resumption, power-off resumption, and OTA upgrade exception handling.
[0105] Diagnostic Engine: Diagnostic host computer service, diagnostic control node, responsible for sending and receiving instructions related to vehicle diagnosis, such as reading ECU information, controlling ECU upgrades and flashing, and obtaining status related to vehicle upgrades.
[0106] (2) ADCC domain control module:
[0107] DoIP-UDS Service: A standard UDS (Unified Diagnostic Services) flashing service program implemented based on the DoIP protocol. By interacting with the Diagnostic Engine program, it is responsible for the self-upgrade of the ADCC domain controller, downloading the OTA software package to a dedicated storage space through the DoIP transmission protocol, and guiding the OTA upgrade through the HTTP (Hypertext Transfer Protocol) interaction protocol interface defined by ADCC_ota_manager and obtaining the OTA upgrade status feedback to the diagnostic engine.
[0108] ADCC_ota_manager: ADCC upgrade management service, responsible for the OTA self-upgrade function within the ADCC domain controller. It is mainly responsible for implementing the HTTP protocol interface, obtaining and reporting the device's software and hardware version information, system status check, first-level RSA digital signature verification, triggering the OTA self-upgrade process, and obtaining and reporting the progress and results of the OTA self-upgrade to the UDSService.
[0109] A_ota_process: The A core OTA upgrade master program mainly performs a series of verification checks based on the partition upgrade configuration file guidance information: secondary RSA digital signature verification, configuration file check, GPT partition verification, and partition integrity check. If the verification is successful, the OTA is switched to the pre-upgrade state first, and the partition upgrade image is traversed and written. When the partition image upgrade method is differential upgrade, the differential tool is called for differential upgrade. After the partition traversal and writing are completed, the OTA is switched to the post-upgrade state. The differential restoration of all base partition images and target partition images is in the A core, and the partition is image-written and integrity-checked.
[0110] R_ota_service: R core ota upgrade slave control program, mainly transmits upgrade instructions and upgrade image packages through inter-core communication with A_ota_process, and performs software flashing.
[0111] Differential Engine: Differential restoration algorithm, cross-compilation provides a cross-platform differential restoration tool, mainly providing support for platform OTA differential upgrade capabilities, responsible for controlling the organization and management of ADCC domain control upgrades, divided into two parts: the cloud-side differential packet generation tool and the vehicle-side differential packet restoration engine.
[0112] Figure 4 Shows a schematic diagram of OTA differential packet flow, which will be combined with Figure 4 Explain the production and restoration process of the above differential upgrade package:
[0113] (1) Cloud differential packaging process:
[0114] a. Parse the partition configuration file during packaging to determine whether the partition supports A / B partitions;
[0115] b. Obtain the base upgrade package and target upgrade package for the current partition;
[0116] c. Perform differential calculations using a differential tool to generate a differential upgrade package for the partition;
[0117] d. Package the upgrade packages of each partition together to generate an OTA upgrade package.
[0118] (2) Vehicle-side differential upgrade process:
[0119] a. Download the OTA upgrade package on the vehicle and decompress it to obtain the upgrade package for each partition;
[0120] b. Parse the partition configuration file and traverse and flash it to upgrade the partition image;
[0121] c. Determine whether the partition is to be differentially upgraded;
[0122] d. Get the A / B partition location of the current partition and confirm the partition upgrade;
[0123] e. Perform a restore operation using a differential tool. The restore operation is performed on the upgraded partition.
[0124] f. The completion of differential restoration means the completion of differential upgrade of the current partition;
[0125] g. When all partitions are flashed, update the status and restart the system to switch to the upgraded partition.
[0126] The double encryption process is explained below:
[0127] The platform OTA supports integrity verification of the upgrade package, and securely encrypts the upgrade package through a dual RSA public and private key mechanism to prevent the upgrade package from being tampered with during transmission and introducing security risks. To generate these signature values, the message is first generated using the HASH algorithm, and then the message digest is encrypted to generate the signature value. The main algorithms used in this invention are as follows:
[0128] Optionally, the HASH algorithm includes the SHA256 algorithm and the SHA512 algorithm, and the signature algorithm includes the RSA3072+RSASSA-PSS algorithm and the RSA4096+RSASSA-PSS algorithm.
[0129] Furthermore, Figure 5 A design diagram of an OTA dual encryption and decryption system is shown, as Figure 5 As shown in the figure, the platform's OTA dual encryption and decryption system is mainly divided into two processes: cloud-side encryption and vehicle-side decryption:
[0130] (1) Cloud encryption process:
[0131] a. Perform HASH calculation on the OTA upgrade image file to obtain the Hash Value;
[0132] b. Sign the Hash Value using the internally generated secondary RSA private key to generate a signature file TXT;
[0133] c. Package the Image file and signature file together into an OTA upgrade package in the specified format;
[0134] d. Then perform HASH calculation on the OTA upgrade package file to obtain Hash Data;
[0135] e. Sign the HASH Data using an externally generated primary RSA private key to generate an RSA signature file.
[0136] Vehicle-side decryption process:
[0137] a. Download the OTA upgrade package and the first-level RSA signature file in the specified format from the vehicle side;
[0138] b. Perform HASH calculation on the OTA upgrade package to obtain Hash Data;
[0139] c. Use the externally disclosed first-level RSA public key to verify the RSA signature file and obtain the hash data;
[0140] d. If the two Hash Data values are the same, the first-level RSA digital signature verification is successful, and the next step is performed; otherwise, the signature verification fails.
[0141] e. Parse the OTA upgrade package, further unpack it, and obtain the internal Image file and signature file TXT;
[0142] f. Perform HASH calculation on the Image file to obtain the Hash Value;
[0143] g. Use the internally disclosed secondary RSA public key to verify the signature file and obtain the hash value;
[0144] h. If the two hash values are identical, the secondary RSA digital signature verification is successful. Finally, the OTA upgrade package RSA signature verification is successful.
[0145] The above-mentioned OTA upgrade package encryption and decryption system does not describe the PKI encryption and decryption system. Since the PKI decryption is mainly handled by the vehicle-side ICC master control node and the decompression process is performed, only the ADCC decryption method and process are described here.
[0146] Based on the same concept, an embodiment of the present disclosure further provides an OTA differential upgrade device, which is used to upgrade the electronic system of a vehicle. The memory of the electronic system stores a base version firmware, and the base version firmware includes multiple base partition images. The device includes an acquisition module, a calculation module, a writing module, and a deletion module.
[0147] The acquisition module is used to acquire a differential upgrade package, wherein the differential upgrade package is used to replace the base version firmware in the memory with the target version firmware, and the differential upgrade package includes multiple partition images;
[0148] The acquisition module is further configured to read partition images one by one in the differential upgrade package, and acquire a base partition image corresponding to the read partition image each time a partition image is read;
[0149] The calculation module is used to perform differential restoration on the read partition image and the obtained basic partition image to obtain a target partition image of the target version firmware;
[0150] The writing module is used for writing the obtained target partition image into the memory after obtaining each target partition image;
[0151] The deletion module is used to delete the basic version firmware in the memory.
[0152] Based on the same concept, an embodiment of the present disclosure also provides a computer-readable storage medium, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the above-mentioned OTA differential upgrade method.
[0153] Based on the same concept, an embodiment of the present disclosure also provides a computer program product, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the above-mentioned OTA differential upgrade method.
[0154] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present disclosure. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0155] Unless otherwise specifically stated, the relative arrangement of the parts and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the drawings are not drawn according to actual proportional relationships. The technology, methods and equipment known to those of ordinary skill in the relevant art may not be discussed in detail, but in appropriate cases, the technology, methods and equipment should be considered as part of the specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of the exemplary embodiments may have different values. It should be noted that similar numbers and letters represent similar items in the following figures, and therefore, once an item is defined in one figure, it does not need to be further discussed in subsequent figures.
[0156] In the description of the present disclosure, it should be understood that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "horizontal, vertical, perpendicular, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present disclosure and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the device or element referred to must have a specific direction or be constructed and operated in a specific direction. Therefore, they cannot be understood as limiting the scope of protection of the present disclosure; the directional words "inside and outside" refer to the inside and outside relative to the outline of each component itself.
[0157] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used herein to describe the spatial positional relationship of a device or feature to other devices or features as shown in the figures. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figures. For example, if the device in the drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.
[0158] In addition, it should be noted that the use of words such as "first" and "second" to limit components is only for the convenience of distinguishing the corresponding components. Unless otherwise stated, the above words have no special meaning and therefore cannot be understood as limiting the scope of protection of this disclosure.
[0159] The foregoing description is merely a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Those skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present disclosure shall be included within the scope of protection of the present disclosure.
Claims
1. An OTA differential upgrade method, characterized in that: The method is applied to an electronic system of a vehicle, wherein a memory of the electronic system stores a basic version of firmware, the basic version of firmware including a plurality of basic partition images, and the method comprises: Obtaining a differential upgrade package, wherein the differential upgrade package is used to upgrade the base version firmware in the memory to a target version firmware, and the differential upgrade package includes multiple partition images; Reading partition images one by one in the differential upgrade package, obtaining a base partition image corresponding to the read partition image each time a partition image is read, performing differential restoration processing on the read partition image and the obtained base partition image to obtain a target partition image of the target version firmware, and writing the obtained target partition image into the memory each time a target partition image is obtained; The basic version firmware in the memory is deleted.
2. The method according to claim 1, characterized in that The electronic system includes a processor, the processor includes an R core and an A core, the memory includes a first space and a second space, the first space corresponds to the R core, the second space corresponds to the A core, the multiple base partition images include m first base partition images and n second base partition images, the m first base partition images are stored in the first space, the n second base partition images are stored in the second space, the multiple partition images include m first partition images and n second partition images, the m first partition images correspond one-to-one to the m first base partition images, and the n second partition images correspond one-to-one to the n second base partition images; The step of reading partition images one by one in the differential upgrade package includes: In the differential upgrade package, the m first partition images are first read one by one, and then the n second partition images are read one by one.
3. The method according to claim 2, characterized in that The method further comprises: After obtaining the differential upgrade package, the differential upgrade package is moved to a designated space, where the designated space corresponds to the A core and is used to store the target partition image obtained by differential restoration; After obtaining the target partition image corresponding to the first partition image, the obtained target partition image is written into the first space through inter-core communication.
4. The method according to claim 1, wherein Before reading the partition images one by one in the differential upgrade package, the method further includes: Obtain a first proofreading file, wherein the first proofreading file stores a first hash value; Obtain a second hash value of the differential upgrade package, and compare the first hash value with the second hash value.
5. The method according to claim 4, characterized in that The differential upgrade package includes a second proofreading file, wherein the second proofreading file stores a plurality of third hash values. After comparing the first hash value with the second hash value, the method further includes: Obtain fourth hash values of the multiple partition images, and compare the multiple third hash values with the fourth hash values of the multiple partition images.
6. The method according to claim 1, characterized in that After obtaining the differential upgrade package, the method further includes: It is detected whether the electronic system meets a specified upgrade condition, and if the electronic system meets the upgrade condition, the partition images are read one by one in the differential upgrade package.
7. The method according to claim 6, characterized in that The method further comprises: In the case that the electronic system does not meet the upgrade condition, a prompt message for adjusting the status of the electronic system is issued.
8. An OTA differential upgrade device, characterized in that: The device is used to upgrade the electronic system of a vehicle, wherein a basic version of firmware is stored in a memory of the electronic system, and the basic version of firmware includes multiple basic partition images. The device includes an acquisition module, a calculation module, a writing module, and a deletion module; The acquisition module is used to acquire a differential upgrade package, wherein the differential upgrade package is used to replace the base version firmware in the memory with the target version firmware, and the differential upgrade package includes multiple partition images; The acquisition module is further configured to read partition images one by one in the differential upgrade package, and acquire a base partition image corresponding to the read partition image each time a partition image is read; The calculation module is used to perform differential restoration on the read partition image and the obtained basic partition image to obtain a target partition image of the target version firmware; The writing module is used for writing the obtained target partition image into the memory after obtaining each target partition image; The deletion module is used to delete the basic version firmware in the memory.
9. A computer-readable storage medium, characterized in that At least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by the processor to implement the OTA differential upgrade method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the OTA differential upgrade method according to any one of claims 1 to 7.