A firmware upgrade system and method
By using encryption algorithms and preset verification processes in the firmware upgrade system of vehicle-mounted equipment, the problem of legality verification in the firmware upgrade process in the prior art is solved, and a secure, modular and compatible firmware update is achieved.
Patent Information
- Application Number
- CN202111086128.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-09-16
AI Technical Summary
The legality verification of the firmware upgrade process of existing vehicle-mounted devices is not carried out, which makes it impossible to guarantee the legality of the upgraded firmware, and cannot achieve modular updates and firmware updates that are compatible with multi-core heterogeneous processor platforms.
By establishing a firmware upgrade system between the cloud server and the vehicle terminal to be upgraded, multiple encryption of the firmware is used to use encryption algorithms, and a preset verification process is carried out on the terminal to ensure the legality and accuracy of the upgrade data.
It improves the security of firmware upgrades, ensures safe start after the equipment is upgraded, realizes modular upgrades to the on-board terminal firmware, and is compatible with the multi-core heterogeneous processor platform.
Smart Images

Figure CN113885907B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data upgrade, and in particular to a firmware upgrade system and method. Background Art
[0002] With the rapid development of the Internet and vehicle communication technology, the demand for the Internet of Things is also growing. Among them, the Internet of Vehicles is an important part of the Internet of Things.
[0003] In order to ensure the driving safety of the vehicle, it is necessary to upgrade the vehicle's on-board equipment. The current on-board equipment upgrade solution generally has the following process: the cloud sends a vehicle status query and firmware upgrade verification to the vehicle ECU terminal, and after verifying that the vehicle ECU terminal meets the upgrade requirements, sends the upgrade firmware package to the vehicle ECU terminal; after the vehicle ECU terminal receives the upgrade firmware package, the vehicle ECU terminal performs an integrity check on the upgrade firmware package, and after determining that the integrity check of the upgrade firmware package passes, the vehicle ECU terminal directly writes the contents of the upgrade firmware package into its firmware area; subsequently, the vehicle ECU terminal completes the upgrade after restarting.
[0004] During the above upgrade process, since the legitimacy of the upgrade firmware package is not verified, its legitimacy cannot be guaranteed, and modular updates and updates compatible with multi-core heterogeneous processor platform firmware cannot be achieved. Summary of the invention
[0005] The present invention provides a firmware upgrade system and method to improve the security of firmware upgrade and ensure the safe startup of the device after the upgrade. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a firmware upgrade system, the system comprising: a vehicle terminal to be upgraded and a cloud server;
[0007] The cloud server is configured to encrypt each first firmware required for upgrading the vehicle-mounted terminal to be upgraded using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware; generate a target fingerprint corresponding to the target encrypted firmware using a second encryption algorithm; encrypt the target fingerprint using a specified private key to obtain an encrypted fingerprint; determine an upgrade package based on the target encrypted firmware, the target fingerprint, the encrypted fingerprint, and the public key corresponding to the specified private key corresponding to each first firmware, and send the upgrade package to the vehicle-mounted terminal to be upgraded;
[0008] The vehicle terminal to be upgraded is configured to obtain the upgrade package, and if the first firmware does not include the specified boot firmware, determine the firmware to be upgraded of the vehicle terminal to be upgraded by using the running current boot firmware, the upgrade package and the partition activation status table; verify the upgrade data corresponding to the firmware to be upgraded in the upgrade package by using a preset verification process; and after each upgrade data is verified, decrypt the target encrypted firmware in each upgrade data by using the locally stored specified encrypted text, obtain the first firmware corresponding to each firmware to be upgraded, and upgrade it;
[0009] The preset verification process includes:
[0010] Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate a current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate a current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
[0011] Optionally, the vehicle terminal to be upgraded is further configured to, if the first firmware includes the designated boot firmware, verify the upgrade data corresponding to the designated boot firmware in the upgrade package by using the running current boot firmware and the preset verification process; after the upgrade data corresponding to the designated boot firmware is verified, decrypt the target encrypted firmware of the designated boot firmware in the upgrade data corresponding to the designated boot firmware by using the locally stored designated encrypted text to obtain the designated boot firmware, wherein the target firmware includes the designated boot firmware;
[0012] The firmware to be upgraded of the vehicle terminal to be upgraded is determined by using the running specified boot firmware, the upgrade package and the partition activation status table; the upgrade data corresponding to the firmware to be upgraded in the upgrade package is verified by using a preset verification process; and after each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted by using the locally stored specified encrypted text to obtain the first firmware corresponding to each firmware to be upgraded, and then upgrade it.
[0013] Optionally, the storage unit of the vehicle terminal to be upgraded includes: a factory partition and at least two storage partitions; wherein the factory partition includes: a read-only area and a readable and writable area, the read-only area is used to store the boot firmware and its backup and application firmware at the factory; the readable and writable area is used to store the partition activation status table, the partition activation status table contains information specifying the current partition to be upgraded and the firmware to be upgraded; the at least two storage partitions are used to store firmware.
[0014] Optionally, the vehicle terminal to be upgraded includes a one-time programmable memory for storing designated encrypted texts corresponding to each firmware to be upgraded and information corresponding to a public key corresponding to a designated private key.
[0015] Optionally, the cloud server is specifically configured to:
[0016] For each first firmware, the target fingerprint corresponding to the first firmware is added to the tail of the target encrypted firmware corresponding to the first firmware; the encrypted fingerprint corresponding to the first firmware is added to the tail of the target fingerprint corresponding to the first firmware; the public key corresponding to the designated private key corresponding to the first firmware is added to the tail of the encrypted fingerprint corresponding to the first firmware; and the corresponding address information is generated to obtain the upgrade package.
[0017] Optionally, the vehicle-mounted terminal to be upgraded, in the process of determining the firmware to be upgraded of the vehicle-mounted terminal to be upgraded by using the currently running boot firmware, the upgrade package and the partition activation status table, is specifically configured as follows:
[0018] The current partition to be upgraded of the vehicle terminal to be upgraded is determined by using the currently running boot firmware, the upgrade package and the partition activation status table, and the firmware to be upgraded in the current partition to be upgraded is determined.
[0019] Optionally, during the upgrade process, the vehicle-mounted terminal to be upgraded is specifically configured as follows:
[0020] The first firmware corresponding to the firmware to be upgraded is loaded to the startup position corresponding to each firmware to be upgraded; the remaining startup count corresponding to the current partition to be upgraded is reduced by one; the first firmware loaded to the startup position corresponding to each firmware to be upgraded is started in sequence according to the upgrade startup order; if each first firmware loaded to the startup position corresponding to each firmware to be upgraded is successfully started, it is determined that the current partition to be upgraded is successfully upgraded, and the remaining startup count corresponding to the current partition to be upgraded is reset; if any first firmware loaded to the startup position corresponding to each firmware to be upgraded fails to start, it is determined whether the remaining startup count corresponding to the current partition to be upgraded is zero; if it is not zero, return to the step of reducing the remaining startup count corresponding to the current partition to be upgraded by one.
[0021] Optionally, the vehicle terminal to be upgraded includes at least two storage partitions and a factory partition;
[0022] The vehicle terminal to be upgraded is also configured as
[0023] If it is determined that the remaining number of startup times corresponding to the current partition to be upgraded is zero, determine whether the vehicle-mounted terminal to be upgraded has other storage partitions whose corresponding remaining number of startup times is not zero; if so, start the firmware in the other storage partitions whose corresponding remaining number of startup times is not zero in turn; if not, start the firmware in the factory partition.
[0024] Optionally, the firmware required for upgrading the vehicle-mounted terminal to be upgraded also includes a second firmware;
[0025] The cloud server, in the process of determining the upgrade package based on the target encrypted firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key corresponding to each first firmware in the target firmware, is specifically configured to: encrypt the second firmware using a third encryption algorithm, and determine the upgrade package based on the target encrypted firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key corresponding to each first firmware in the target firmware, and the encrypted second firmware;
[0026] Correspondingly, after the upgrade, the vehicle terminal to be upgraded is further configured to: decrypt and verify the encrypted second firmware using a decryption algorithm corresponding to the third encryption algorithm to obtain the second firmware, and upgrade using the second firmware.
[0027] In a second aspect, an embodiment of the present invention provides a firmware upgrade method, which is applied to a cloud server of a firmware upgrade system, wherein the firmware upgrade system also includes a vehicle terminal to be upgraded, and the method includes:
[0028] For each first firmware required for upgrading the vehicle-mounted terminal to be upgraded, encrypt the first firmware using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware, where the target encrypted firmware is the firmware required for upgrading the vehicle-mounted terminal to be upgraded;
[0029] Using a second encryption algorithm, generating a target fingerprint corresponding to the target encrypted firmware;
[0030] Encrypting the target fingerprint using a specified private key to obtain an encrypted fingerprint;
[0031] Based on the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the designated private key corresponding to each first firmware, an upgrade package is determined and sent to the vehicle terminal to be upgraded, so that the vehicle terminal to be upgraded obtains the upgrade package, if the first firmware does not contain the designated boot firmware; the firmware to be upgraded of the vehicle terminal to be upgraded is determined by using the running current boot firmware, the upgrade package and the partition activation status table; the upgrade data corresponding to the firmware to be upgraded in the upgrade package is verified by using a preset verification process; and after each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted by using the designated encrypted text stored locally, and the first firmware corresponding to each firmware to be upgraded is obtained, and the upgrade is performed;
[0032] The preset verification process includes:
[0033] Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate a current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate a current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
[0034] In a third aspect, an embodiment of the present invention provides a firmware upgrade method, which is applied to a vehicle terminal to be upgraded in a firmware upgrade system, wherein the firmware upgrade system also includes a cloud server, and the cloud server is used to encrypt each first firmware required for upgrading the vehicle terminal to be upgraded using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware; generate a target fingerprint corresponding to the target encrypted firmware using a second encryption algorithm; encrypt the target fingerprint using a specified private key to obtain an encrypted fingerprint; determine an upgrade package based on the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the specified private key corresponding to each first firmware, and send it to the vehicle terminal to be upgraded, wherein the method includes:
[0035] Obtaining the upgrade package sent by the cloud server;
[0036] If the first firmware does not include the specified boot firmware; using the running current boot firmware, the upgrade package and the partition activation status table, determining the firmware to be upgraded of the vehicle terminal to be upgraded;
[0037] Using a preset verification process, verifying the upgrade data corresponding to the firmware to be upgraded in the upgrade package;
[0038] After each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted using the designated encrypted text stored locally, the first firmware corresponding to each firmware to be upgraded is obtained, and the upgrade is performed;
[0039] The preset verification process includes:
[0040] Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate a current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate a current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
[0041] From the above content, it can be seen that an embodiment of the present invention provides a firmware upgrade system and method, the system includes: a vehicle terminal to be upgraded and a cloud server; the cloud server is configured to encrypt each first firmware required for the upgrade of the vehicle terminal to be upgraded using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware; use a second encryption algorithm to generate a target fingerprint corresponding to the target encrypted firmware; use a specified private key to encrypt the target fingerprint to obtain an encrypted fingerprint; based on the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the specified private key corresponding to each first firmware, determine an upgrade package and send it to the vehicle terminal to be upgraded, the target encrypted firmware is the firmware required for the upgrade of the vehicle terminal to be upgraded; the vehicle terminal to be upgraded is configured to obtain the upgrade package, if the first firmware does not contain the specified boot firmware; use the running current boot firmware, upgrade package and partition activation status Table, determine the firmware to be upgraded of the vehicle-mounted terminal to be upgraded; use the preset verification process to verify the upgrade data corresponding to the firmware to be upgraded in the upgrade package; and after each upgrade data is verified, use the locally stored specified encrypted text to decrypt the target encrypted firmware in each upgrade data, obtain the first firmware corresponding to each firmware to be upgraded, and upgrade it; wherein the preset verification process includes: using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware to generate the current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; use the second encryption algorithm to generate the current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed.
[0042] By applying the embodiment of the present invention, before sending the firmware required for the upgrade to the vehicle terminal to be upgraded, the cloud server performs multiple encryption on the firmware and its corresponding key, and encrypts different firmware separately to obtain an upgrade package, and sends it to the vehicle terminal to be upgraded. The vehicle terminal to be upgraded obtains the upgrade package, and determines the firmware to be upgraded based on the partition activation status table, and verifies the upgrade data corresponding to each firmware to be upgraded in the upgrade package based on a preset verification process. After the verification is passed, the firmware to be upgraded is upgraded to realize a modular upgrade of the firmware of the vehicle terminal to be upgraded. Moreover, before the upgrade, the upgrade data corresponding to each firmware to be upgraded in the upgrade package is verified to ensure the legitimacy and accuracy of the obtained upgrade data and the safety of the upgrade process. Of course, implementing any product or method of the present invention does not necessarily require all of the advantages described above to be achieved at the same time.
[0043] The innovative features of the embodiments of the present invention include:
[0044] 1. The cloud server performs multiple encryption on each firmware and its key to be sent, generates an upgrade package, and sends it to the vehicle terminal to be upgraded. The vehicle terminal to be upgraded determines the firmware to be upgraded of the vehicle terminal based on the partition activation status table, verifies the upgrade data corresponding to the firmware to be upgraded in the upgrade package, and upgrades after the verification is passed, thereby realizing modular upgrade of the firmware of the vehicle terminal to be upgraded, ensuring the legitimacy and accuracy of the obtained upgrade data, and ensuring the security of the upgrade process.
[0045] 2. Set up multiple storage partitions and factory partitions, so that to a certain extent, when the firmware of one or some storage partitions cannot be started normally after upgrading, the firmware of other storage partitions or factory partitions can be started to ensure the normal use of the vehicle terminal to be upgraded.
[0046] 3. Set the remaining number of boot times for the partition to ensure that the partition to be upgraded can be upgraded multiple times, so as to ensure that the firmware to be upgraded in the partition to be upgraded can be upgraded and used normally to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative work.
[0048] Figure 1 A schematic diagram of the structure of a firmware upgrade system provided by an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of a structure of a vehicle terminal to be upgraded provided by an embodiment of the present invention;
[0050] Figure 3 A schematic diagram of partitioning of a storage unit of a vehicle-mounted terminal to be upgraded provided in an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of a structure of a partition activation status table provided in an embodiment of the present invention;
[0052] Figure 5 A schematic diagram of the encryption process of the cloud server and the decryption process of the vehicle terminal to be upgraded provided by an embodiment of the present invention;
[0053] Figure 6 A schematic diagram of a flow chart of a firmware upgrade method provided by an embodiment of the present invention;
[0054] Figure 7 A schematic diagram of a flow chart of a firmware upgrade method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present invention and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0057] The present invention provides a firmware upgrade system and method to improve the security of firmware upgrade and ensure the safe startup of the device after the upgrade. The embodiments of the present invention are described in detail below.
[0058] Figure 1 A schematic diagram of a firmware upgrade system provided in an embodiment of the present invention. The firmware upgrade system may include: a vehicle terminal 110 to be upgraded and a cloud server 120;
[0059] The cloud server 120 is configured to encrypt each first firmware required for upgrading the vehicle terminal to be upgraded using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware; generate a target fingerprint corresponding to the target encrypted firmware using a second encryption algorithm; encrypt the target fingerprint using a specified private key to obtain an encrypted fingerprint; determine an upgrade package based on the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the specified private key corresponding to each first firmware, and send it to the vehicle terminal 110 to be upgraded, where the target encrypted firmware is the firmware required for upgrading the vehicle terminal to be upgraded.
[0060] The vehicle terminal 110 to be upgraded is configured to obtain an upgrade package. If the first firmware does not contain the specified boot firmware, the firmware to be upgraded of the vehicle terminal to be upgraded is determined by using the running current boot firmware, the upgrade package and the partition activation status table; the upgrade data corresponding to the firmware to be upgraded in the upgrade package is verified by using a preset verification process; and after each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted by using the locally stored specified encrypted text, so as to obtain the first firmware corresponding to each firmware to be upgraded, and then upgrade it.
[0061] The preset verification process includes:
[0062] Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate the current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate the current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
[0063] Among them, the vehicle terminal 110 to be upgraded in the firmware upgrade system may be one or more. When there are multiple vehicle terminals 110 to be upgraded, after obtaining the upgrade request sent by any vehicle terminal 110 to be upgraded, the cloud server 120 may execute the subsequent firmware upgrade process for the vehicle terminal 110 to be upgraded. Alternatively, the cloud server 120 may, when verifying that the vehicle terminal meets the upgrade requirements, use the vehicle terminal that meets the upgrade requirements as the vehicle terminal to be upgraded, and execute the subsequent firmware upgrade process for the vehicle terminal 110 to be upgraded.
[0064] The cloud server 120 can support full upgrade, differential upgrade and single-core upgrade functions. Among them, full upgrade refers to refreshing and upgrading all the firmware of the vehicle terminal 110 to be upgraded, that is, the vehicle controller. The cloud server 120 needs to send the entire upgrade package required for the vehicle terminal to be upgraded, that is, the upgrade package containing all the firmware of the vehicle terminal 110 to be upgraded. Differential upgrade means that on the basis of the existing firmware of the vehicle terminal 110 to be upgraded, the cloud server 120 only sends the difference between the old and new firmware to achieve the purpose of firmware upgrade. The difference between it and the full upgrade is that the size of the upgrade package sent is different, and the upgrade package of the differential upgrade is smaller. Single-core upgrade means that when the vehicle terminal 110 to be upgraded contains multiple cores and each core runs independent software, only one core of the vehicle terminal 110 to be upgraded is upgraded.
[0065] In one implementation, the vehicle terminal 110 to be upgraded can be any vehicle terminal that needs to upgrade its installed firmware. When there is a need for firmware upgrade, the vehicle terminal 110 to be upgraded can send a firmware upgrade request to the cloud server 120. The cloud server 120 determines the firmware required for the upgrade of the vehicle terminal 110 to be upgraded based on the obtained firmware upgrade request. The firmware required for the upgrade of the vehicle terminal 110 to be upgraded can include at least one first firmware. The first firmware can be: a firmware with an updated version relative to the firmware installed on the vehicle terminal to be upgraded, or it can be: a newly added firmware required for the vehicle terminal to be upgraded. Both are possible.
[0066] Among them, Figure 2 As shown, the vehicle terminal 110 to be upgraded may include an information processing unit, a storage unit, and a network receiving unit, wherein the vehicle terminal 110 to be upgraded executes the firmware upgrade process provided by the embodiment of the present invention through its information processing unit, and the vehicle terminal 110 to be upgraded stores the firmware required for the upgrade through its storage unit. The network receiving unit receives the firmware sent by the cloud processor 120 and sends a firmware upgrade request to communicate with the cloud processor 120.
[0067] After determining the firmware required for the vehicle terminal to be upgraded, the cloud server 120 encrypts each first firmware using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware. The first encryption algorithm may be an AES (Advanced Encryption Standard) encryption algorithm. The specified encrypted text is the vi value of the AES encryption algorithm.
[0068] The target encrypted firmware is encoded using a second encryption algorithm to obtain a target fingerprint corresponding to the target encrypted firmware, wherein the second encryption algorithm may be a sha384 encryption algorithm.
[0069] The target fingerprint is encrypted using a specified private key to obtain an encrypted fingerprint. The specified private key is a private key generated based on the RSA public key encryption algorithm. The specified private key corresponds to a public key and is used to decrypt the object encrypted using the specified private key.
[0070] It is understandable that different first firmwares may correspond to different designated encrypted texts or the same designated encrypted texts, which is possible. Similarly, different first firmwares may correspond to different designated private keys or the same designated private key.
[0071] The designated encrypted text, designated private key and the corresponding public key corresponding to the first firmware are pre-agreed between the cloud server 120 and the vehicle terminal 110 to be upgraded. The cloud server 120 stores the designated encrypted text and designated private key corresponding to the first firmware agreed upon by the vehicle terminal 110 to be upgraded. The vehicle terminal 110 to be upgraded stores the designated encrypted text corresponding to the first firmware agreed upon by the cloud server 120 and the information corresponding to the public key corresponding to the designated private key. In one case, the information corresponding to the public key corresponding to the designated private key may be: the public key fingerprint of the public key corresponding to the designated private key.
[0072] In one implementation of the present invention, the vehicle terminal 110 to be upgraded includes a one-time programmable memory for storing the specified encrypted text corresponding to each firmware to be upgraded and the information corresponding to the public key corresponding to the specified private key. In one case, the information processing unit of the vehicle terminal 110 to be upgraded can be implemented by any processor that can safely select to start three partitions or more, for example, it can be implemented by a zu11 multi-core heterogeneous processor. The vehicle terminal 110 to be upgraded implements the verification of each upgrade data in the obtained upgrade package and the upgrade process through the information processing unit. In one case, when the information processing unit of the vehicle terminal 110 to be upgraded is implemented by a zu11 multi-core heterogeneous processor, the one-time programmable memory of the vehicle terminal 110 to be upgraded can be an efuse memory.
[0073] Subsequently, after the cloud server 120 obtains the target encrypted firmware, target fingerprint and encrypted fingerprint corresponding to each first firmware, it determines the upgrade package based on the target encrypted firmware, target fingerprint, encrypted fingerprint and the public key corresponding to the designated private key corresponding to each first firmware, that is, packages the target encrypted firmware, target fingerprint, encrypted fingerprint and the public key corresponding to the designated private key corresponding to each first firmware, and sends it to the vehicle terminal 110 to be upgraded. In one case, the cloud server can send the upgrade package to the vehicle terminal to be upgraded via a mobile communication network or a wireless communication network. The mobile communication network includes but is not limited to a 4G network and a 5G network.
[0074] The vehicle terminal 110 to be upgraded can obtain the upgrade package through the network receiving unit and send it to its information processing unit; through its information processing unit, it is determined whether the first firmware of the target firmware contains the specified boot firmware. If it does not contain the specified boot firmware, the vehicle terminal 110 to be upgraded runs the current boot firmware installed locally on the vehicle terminal 110 to be upgraded, and uses the running current boot firmware, the upgrade package and the partition activation status table to determine the firmware to be upgraded of the vehicle terminal to be upgraded. The upgrade package contains the upgrade data corresponding to the firmware to be upgraded. In theory, the upgrade data corresponding to the firmware to be upgraded includes: the target encrypted firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key corresponding to the first firmware required for the firmware to be upgraded. For example, the upgrade data corresponding to the first firmware A in the upgrade package is version 2.1, and the first firmware A installed on the vehicle terminal to be upgraded is version 2.0, then the first firmware A of the vehicle terminal is the firmware to be upgraded of the vehicle terminal to be upgraded.
[0075] When the firmware to be upgraded is the firmware to be upgraded for the existing version of the vehicle terminal to be upgraded, the corresponding first firmware is: the higher version of the firmware to be upgraded. When the firmware to be upgraded is the newly added firmware of the vehicle terminal to be upgraded, the corresponding first firmware is: the newly added firmware required by the vehicle terminal to be upgraded.
[0076] The network receiving unit receives the upgrade package via a mobile communication network or a wireless communication network.
[0077] The vehicle terminal 110 to be upgraded may include multiple storage partitions and factory partitions, each of which stores the firmware required for the vehicle terminal 110 to be upgraded to run, and the versions of the firmware stored in different storage partitions may be different. The factory partition stores the version of the firmware at the time of leaving the factory. The partition activation status table contains information specifying the current partition to be upgraded and the firmware to be upgraded; at least two storage partitions are used to store firmware.
[0078] After the vehicle terminal 110 to be upgraded determines the firmware to be upgraded through its information processing unit, it uses a preset verification process to verify the upgrade data corresponding to the firmware to be upgraded in the upgrade package through its information processing unit. After the verification is passed, the target encrypted firmware in each upgrade data is decrypted using the designated encrypted text stored locally to obtain the first firmware corresponding to each firmware to be upgraded, and then the upgrade is performed.
[0079] Among them, the preset verification process is the image decryption process of encrypting each first firmware with the cloud server 120. Specifically, it can be: for each firmware to be upgraded, the firmware to be upgraded is used as the target firmware, and the upgrade data corresponding to the firmware to be upgraded is used as the target upgrade data; using the second encryption algorithm, the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware is encoded to obtain the current public key fingerprint corresponding to the target upgrade data; the public key fingerprint corresponding to the target firmware to be upgraded is obtained. If the current public key fingerprint corresponding to the target upgrade data is the same as the public key fingerprint corresponding to the locally stored target firmware, it is determined that the public key corresponding to the specified private key in the upgrade data corresponding to the target firmware has not been tampered with, and the encrypted fingerprint in the target upgrade data is decrypted using the public key corresponding to the specified private key in the target upgrade data to obtain the target fingerprint.
[0080] The target encrypted firmware in the target upgrade data is encoded using a second encryption algorithm to generate a current fingerprint of the target encrypted firmware in the target upgrade data; the target fingerprint and the current fingerprint are compared to determine whether the two are the same. If they are the same, it is determined that the target encrypted firmware in the target upgrade data has not been tampered with, and it is further determined that the target upgrade data corresponding to the target firmware is complete and has not been tampered with. Accordingly, it is determined that the target upgrade data corresponding to the target firmware has passed the verification.
[0081] On the contrary, if the current public key fingerprint corresponding to the target upgrade data is different from the public key fingerprint corresponding to the locally stored target firmware, it is determined that the target upgrade data corresponding to the target firmware has been tampered with, and it can be considered that there is a problem with the upgrade package, and the subsequent process will not be executed. In one case, the vehicle terminal 110 to be upgraded can continue to send a firmware upgrade request to the cloud server 120 to obtain a new firmware upgrade package.
[0082] Similarly, if it is determined that the target fingerprint corresponding to the target upgrade data is different from the current fingerprint, it is determined that the target upgrade data corresponding to the target firmware has been tampered with, and it can be considered that there is a problem with the upgrade package.
[0083] In one case, the vehicle terminal 110 to be upgraded can use each firmware to be upgraded as the target firmware in parallel or serially, and verify it based on a preset verification process. In one implementation, when the vehicle terminal 110 to be upgraded uses each firmware to be upgraded as the target firmware in serial, and verifies it based on a preset verification process, after the first firmware currently used as the target firmware passes the verification, the first firmware next used as the target firmware is verified. If the first firmware currently used as the target firmware fails the verification, the first firmware next used as the target firmware is no longer verified, that is, the verification process ends, and it is determined that the upgrade package has been tampered with.
[0084] Among them, the specified boot firmware can refer to the new version of the boot firmware, and the first firmware can include but is not limited to: the new version of R5 required for the upgrade of the vehicle terminal to be upgraded, PMU (Power Management Unit, power management unit), Uboot, Kernel Images, and FPGA (Field-Programmable Gate Array) and other vehicle terminal firmware.
[0085] In the application of the embodiment of the present invention, before sending the firmware required for the upgrade to the vehicle terminal to be upgraded, the cloud server performs multiple encryption on the firmware and its corresponding key, and encrypts different firmware separately to obtain an upgrade package, and sends it to the vehicle terminal to be upgraded. The vehicle terminal to be upgraded obtains the upgrade package, and determines the firmware to be upgraded based on the partition activation status table, and verifies the upgrade data corresponding to each firmware to be upgraded in the upgrade package based on a preset verification process. After the verification is passed, the firmware to be upgraded is upgraded to realize the modular upgrade of the application firmware of the vehicle terminal to be upgraded. In addition, before the upgrade, the upgrade data corresponding to each firmware to be upgraded in the upgrade package is verified to ensure the legitimacy and accuracy of the obtained upgrade data and the safety of the upgrade process.
[0086] Furthermore, the vehicle-mounted terminal to be upgraded may be a multi-core homogeneous terminal or a multi-core heterogeneous terminal, and the firmware upgrade process provided by the embodiment of the present invention is compatible with both multi-core homogeneous terminals and multi-core heterogeneous terminals.
[0087] In another embodiment of the present invention, the vehicle terminal 110 to be upgraded is further configured to, if the first firmware includes the designated boot firmware, verify the upgrade data corresponding to the designated boot firmware in the upgrade package by using the running current boot firmware and the preset verification process; after the upgrade data corresponding to the designated boot firmware is verified, decrypt the target encrypted firmware of the designated boot firmware in the upgrade data corresponding to the designated boot firmware by using the designated encrypted text stored locally, to obtain the designated boot firmware, wherein the target firmware includes the designated boot firmware;
[0088] Determine the firmware to be upgraded of the vehicle terminal by using the running specified boot firmware, upgrade package and partition activation status table; verify the upgrade data corresponding to the firmware to be upgraded in the upgrade package by using the preset verification process; and after each upgrade data is verified, use the locally stored specified encrypted text to decrypt the target encrypted firmware in each upgrade data, obtain the first firmware corresponding to each firmware to be upgraded, and upgrade it.
[0089] In this implementation, taking into account that some vehicle terminals to be upgraded support the upgrade of boot firmware, and that the vehicle terminals to be upgraded inevitably have the need to upgrade their boot firmware, when the vehicle terminal to be upgraded determines that the first firmware includes the specified boot firmware, it is necessary to first use a preset verification process to verify the upgrade data corresponding to the specified boot firmware in the upgrade package, and after the verification is passed, use the locally stored specified encrypted text to decrypt the target encrypted firmware of the specified boot firmware in the upgrade data corresponding to the specified boot firmware to obtain the specified boot firmware; and start running the specified boot firmware, use the running specified boot firmware to verify the upgrade data corresponding to other firmware to be upgraded in the upgrade package, and after the verification is passed, decrypt the first firmware corresponding to the firmware to be upgraded and upgrade it.
[0090] When verifying the designated boot firmware, the vehicle terminal 110 to be upgraded runs the current boot firmware installed locally, and uses the running current boot firmware and a preset verification process to verify the upgrade data corresponding to the designated boot firmware in the upgrade package.
[0091] In one case, when the vehicle terminal to be upgraded supports the upgrade of the boot firmware, the storage partition can store boot firmware in addition to application firmware such as R5, PMU (Power Management Unit), Uboot, Kernel Images, rootfs (Root Filesystem) and FPGA (Field-Programmable Gate Array), so as to upgrade the boot firmware.
[0092] Accordingly, after upgrading the boot firmware stored in the storage partition, in the subsequent firmware upgrade process and firmware running process, the vehicle terminal to be upgraded may preferentially choose to run the boot firmware with the highest version stored locally to perform the firmware upgrade process and firmware running process; or it may be possible to run the boot firmware stored in each storage partition and the factory partition in a rotating manner. Among them, in the case that the boot firmware stored in all storage partitions fails and cannot be run, the boot firmware stored in the factory partition can be directly run.
[0093] In another embodiment of the present invention, the storage unit of the vehicle terminal 110 to be upgraded may include: a factory partition and at least two storage partitions; wherein the factory partition includes: a read-only area and a readable and writable area, the read-only area is used to store the boot firmware and its backup and application firmware at the factory; the readable and writable area is used to store the partition activation status table, the partition activation status table contains information specifying the current partition to be upgraded and the firmware to be upgraded; at least two storage partitions are used to store firmware.
[0094] In order to avoid the situation that the firmware of the vehicle terminal to be upgraded has problems during the upgrade process, resulting in upgrade failure and inability to return to the version before the upgrade, resulting in the vehicle terminal to be upgraded being unable to start, the storage unit of the vehicle terminal to be upgraded 110 may include: a factory partition and at least two storage partitions, such as Figure 2 The factory partition includes: a read-only area and a readable and writable area. The read-only area is used to store the boot firmware and its backup and application firmware at the factory, that is, the firmware required for the terminal to be upgraded to run, so as to ensure that when the firmware in other storage partitions fails to start due to problems, the firmware in the factory partition can be started to ensure the basic functions of the vehicle terminal to be upgraded. Figure 2 The storage unit of the vehicle terminal 110 to be upgraded shown in FIG. 1 includes two storage partitions, namely partition A and partition B.
[0095] The readable and writable area of the factory partition is used to store the partition activation status table, which contains information specifying the current partition to be upgraded and the firmware to be upgraded. The vehicle terminal to be upgraded can determine the current storage partition to be upgraded and the firmware to be upgraded therein based on the partition activation status table. Figure 3 As shown, it is a partition diagram of the storage unit of the vehicle terminal 110 to be upgraded, which includes a factory partition and two storage partitions, namely partition A and partition B. The read-only area of the factory partition stores the boot firmware of the factory version, namely the "Boot firmware" and its backup "Boot backup firmware" shown in the figure, and the application firmware "R5 core firmware, PMU firmware, Uboot firmware, Kernel firmware, Rootfs firmware and Fpga firmware". The readable and writable area of the factory partition includes a partition activation status table. Partition A stores the application firmware "R5 core firmware, PMU firmware, Uboot firmware, Kernel firmware, Rootfs firmware and Fpga firmware" required by each vehicle terminal to be upgraded, and partition B stores the application firmware "R5 core firmware, PMU firmware, Uboot firmware, Kernel firmware, Rootfs firmware and Fpga firmware" required by each vehicle terminal to be upgraded, wherein the versions of each application firmware in partition A and partition B may be different. In one case, when the vehicle terminal to be upgraded supports the upgrade of the boot firmware, partition A and partition B may also store the Boot firmware.
[0096] The storage unit of the vehicle terminal 110 to be upgraded can be implemented by an EMMC non-volatile memory, which includes a factory partition and at least two storage partitions, and can also be used to store other data that need to be saved after power off. The memory where the factory partition is located and the memory where the at least two storage partitions are located can be the same memory or different memories.
[0097] In another embodiment of the present invention, the cloud server 120 is specifically configured to determine the upgrade package based on the target encrypted firmware corresponding to each first firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key.
[0098] For each first firmware, the target fingerprint corresponding to the first firmware is added to the tail of the target encrypted firmware corresponding to the first firmware; the encrypted fingerprint corresponding to the first firmware is added to the tail of the target fingerprint corresponding to the first firmware; the public key corresponding to the designated private key corresponding to the first firmware is added to the tail of the encrypted fingerprint corresponding to the first firmware; and the corresponding address information is generated to obtain the upgrade package.
[0099] In order to ensure the orderliness of the relevant encrypted information corresponding to each first firmware, i.e., the upgrade data, and to facilitate the subsequent decryption of the upgrade data corresponding to each first firmware, in this implementation, the cloud server 120, in the process of encrypting the target firmware, for each first firmware, after obtaining the target fingerprint of the target encrypted firmware corresponding to the first firmware, adds the target fingerprint corresponding to the first firmware to the tail of the target encrypted firmware corresponding to the first firmware, and after obtaining the encrypted fingerprint corresponding to the first firmware, adds the encrypted fingerprint corresponding to the first firmware to the tail of the target fingerprint corresponding to the first firmware, and adds the public key corresponding to the designated private key corresponding to the first firmware to the tail of the encrypted fingerprint corresponding to the first firmware, and generates the address information of each upgrade data corresponding to each first firmware. The upgrade data corresponding to each first firmware are connected together in a preset sorting order or in a random sorting manner, and the address information of each upgrade data corresponding to each first firmware is obtained to obtain an upgrade package.
[0100] In another embodiment of the present invention, the vehicle terminal to be upgraded 110 is specifically configured as follows in the process of determining the firmware to be upgraded of the vehicle terminal to be upgraded by using the currently running boot firmware, upgrade package and partition activation status table:
[0101] By using the currently running boot firmware, upgrade package and partition activation status table, the current partition to be upgraded of the vehicle terminal to be upgraded is determined, and the firmware to be upgraded in the current partition to be upgraded is determined. In one case, the structural diagram of the partition activation status table is as follows Figure 4 As shown, the storage unit of the vehicle terminal to be upgraded includes two storage partitions, partition A and partition B, and the partition activation status table includes an area for special bytes, an area for storing the partition table length of the partition activation status table, an area for indicating the identifier of the current partition to be upgraded, namely, the "currently activated partition", an area for storing the identifier of the firmware contained in partition A, namely, the "partition A-containing firmware", an area for storing the remaining number of startups of partition A, and the version number of each firmware of partition A, namely, the "partition A firmware version number" area; an area for storing the identifier of the firmware contained in partition B, namely, the "partition B-containing firmware", an area for storing the remaining number of startups of partition B, and the version number of each firmware of partition B, namely, the "partition B firmware version number" area. In one case, the partition activation status table may also include an area for storing MD5 checksums to support the verification function of the vehicle terminal to be upgraded on corresponding data during other operations.
[0102] The storage unit of the vehicle terminal 110 to be upgraded includes a factory partition and at least two storage partitions. The partition activation status table specifies the information of the current partition to be upgraded and the firmware to be upgraded. In this implementation, the vehicle terminal 110 to be upgraded runs the current boot firmware through its information processing unit, and uses the running current boot firmware, upgrade package and partition activation status table to determine the current partition to be upgraded from at least two storage partitions, and determines the firmware to be upgraded from the determined current partition to be upgraded.
[0103] The method of determining the current storage partition to be upgraded of the vehicle-mounted terminal to be upgraded may be: determining one of at least two storage partitions as the storage partition to be upgraded in a rotating manner, or determining one of at least two storage partitions as the current storage partition to be upgraded in a random manner.
[0104] In another embodiment of the present invention, during the upgrade process, the vehicle-mounted terminal to be upgraded is specifically configured as follows:
[0105] The first firmware corresponding to the firmware to be upgraded is loaded to the startup position corresponding to each firmware to be upgraded; the remaining startup count corresponding to the current partition to be upgraded is reduced by one; the first firmware loaded to the startup position corresponding to each firmware to be upgraded is started in sequence according to the upgrade startup order; if each first firmware loaded to the startup position corresponding to each firmware to be upgraded is successfully started, it is determined that the partition to be upgraded is successfully upgraded, and the remaining startup count corresponding to the partition to be upgraded is reset; if any first firmware loaded to the startup position corresponding to each firmware to be upgraded fails to start, it is determined whether the remaining startup count corresponding to the current partition to be upgraded is zero; if it is not zero, return to the step of reducing the remaining startup count corresponding to the current partition to be upgraded by one.
[0106] In order to improve the probability of normal startup of the partition to be upgraded of the vehicle terminal 110 to be upgraded after the upgrade, and reduce the probability of failure to start after the upgrade, in this implementation, the remaining startup times are set for each storage partition, so as to limit the startup times of the storage partition as the first firmware of the current partition to be upgraded after the startup upgrade by setting the remaining startup times for each storage partition. The upgrade process may be: the vehicle terminal 110 to be upgraded loads the first firmware corresponding to the firmware to be upgraded to the startup position corresponding to each firmware to be upgraded through its information processing unit, for example, the first firmware corresponding to each firmware to be upgraded may be loaded into DDR (Double Data Rate) memory.
[0107] And using the running boot firmware boot firmware, according to the upgrade startup order, the first firmware loaded to the startup position corresponding to each firmware to be upgraded is started in sequence, and the remaining startup number corresponding to the current partition to be upgraded is reduced by one; if the first firmware loaded to the startup position corresponding to each firmware to be upgraded is successfully started, it is determined that the current partition to be upgraded is successfully upgraded, and the remaining startup number corresponding to the current partition to be upgraded is reset, that is, the remaining startup number corresponding to the current partition to be upgraded is set to a preset value.
[0108] If any first firmware loaded into the startup position corresponding to each firmware to be upgraded fails to start, it is determined whether the remaining startup times corresponding to the partition to be upgraded is zero; if not zero, the process returns to the step of reducing the remaining startup times corresponding to the current partition to be upgraded by one.
[0109] Among them, in the process of starting the first firmware loaded into the startup position corresponding to each firmware to be upgraded in sequence according to the upgrade startup order, if the currently started first firmware fails to start, it is considered that the startup has failed, and the first firmware after the currently started first firmware will not be started.
[0110] In another embodiment of the present invention, the storage unit of the vehicle terminal 110 to be upgraded includes at least two storage partitions and a factory partition; considering that the current partition to be upgraded fails to start after the upgrade, in order to ensure the use of the vehicle terminal 110 to be upgraded, the vehicle terminal 110 to be upgraded is also configured as
[0111] If it is determined that the remaining number of startup times corresponding to the current partition to be upgraded is zero, then determine whether there are other storage partitions in the vehicle terminal to be upgraded whose corresponding remaining number of startup times is not zero; if so, start the firmware in the other storage partitions whose corresponding remaining number of startup times is not zero in turn; if not, start the firmware in the factory partition.
[0112] In another embodiment of the present invention, the firmware required for upgrading the vehicle-mounted terminal to be upgraded further includes a second firmware;
[0113] The cloud server 120, in the process of determining the upgrade package based on the target encrypted firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key corresponding to each first firmware, is specifically configured to: encrypt the second firmware using the third encryption algorithm, and determine the upgrade package based on the target encrypted firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key corresponding to each first firmware in the target firmware, and the encrypted second firmware;
[0114] Correspondingly, the vehicle terminal 110 to be upgraded is further configured to decrypt the encrypted second firmware using a decryption algorithm corresponding to the third encryption algorithm before the upgrade to obtain the second firmware.
[0115] It is inevitable that some firmware is not suitable for verification by the preset verification process, such as rootfs (Root Filesystem) firmware. In this implementation, when the cloud server 120 determines that the firmware required for the upgrade of the vehicle-mounted terminal to be upgraded also includes a second firmware, the second firmware is a firmware that is not suitable for verification by the preset verification process. After determining the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the specified private key corresponding to each first firmware, the cloud server 120 encrypts the second firmware using a third encryption algorithm, and determines the upgrade package based on the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the specified private key corresponding to each first firmware in the target firmware, as well as the encrypted second firmware.
[0116] In one case, the third encryption algorithm may be a dm-verity encryption algorithm.
[0117] In the process of determining the upgrade package, the cloud server 120 can add the encrypted second firmware to the end of the target encrypted firmware corresponding to the first firmware, the target fingerprint, the encrypted fingerprint, and the public key corresponding to the designated private key.
[0118] Correspondingly, after obtaining the first firmware corresponding to each firmware to be upgraded and upgrading, the vehicle terminal 110 to be upgraded uses the decryption algorithm corresponding to the third encryption algorithm to decrypt and verify the encrypted second firmware, and obtains the second firmware after the verification passes. Then, the vehicle terminal 110 to be upgraded uses the second firmware for upgrading.
[0119] The following is a specific example of an encryption process of the cloud server 120 and a decryption process of the vehicle terminal 110 to be upgraded in the firmware upgrade system provided by the embodiment of the present invention, wherein the encryption and decryption process of a first firmware is described.
[0120] like Figure 5 As shown, the cloud server encrypts each first firmware required for upgrading the vehicle terminal to be upgraded using a specified encrypted text vi value corresponding to the first encryption algorithm, such as Figure 5 The target encrypted firmware is encrypted by AES as shown in the figure. The encrypted file is encoded by the second encryption algorithm sha384 encryption algorithm to obtain the target fingerprint corresponding to the target encrypted firmware, that is, Figure 5 The file signature shown in . Use the specified private key, i.e., the RSA private key, to perform RSA encryption on the target fingerprint to obtain the encrypted fingerprint, i.e. Figure 5 The encrypted file signature shown in the figure. Figure 5 The encrypted file shown in the target fingerprint corresponding to the target encrypted firmware is Figure 5 The file signature shown in the encrypted fingerprint is Figure 5 The encrypted file signature shown in the figure, and the public key corresponding to the specified private key is Figure 5 The RSA public keys shown in are arranged in sequence and the corresponding address information is generated. Figure 5 The map shown in , where the map is located in front of the encrypted file signature to obtain the upgrade package.
[0121] Correspondingly, the vehicle terminal to be upgraded uses a preset verification process to decrypt the upgrade data corresponding to the firmware to be upgraded in the upgrade package, that is, the upgrade data corresponding to the first firmware. The decryption process includes: using the sha384 encryption algorithm to decrypt the public key corresponding to the specified private key in the target upgrade data corresponding to the firmware to be upgraded, that is, Figure 5 The RSA public key shown in is encoded to generate the current public key fingerprint corresponding to the target upgrade data. If the current public key fingerprint is the same as the public key fingerprint corresponding to the target firmware stored locally in the vehicle terminal to be upgraded, such as Figure 5 As shown, the RSA public key is used to encrypt the fingerprint in the target upgrade data. Figure 5 The encrypted file signature shown in is decrypted by RSA to obtain the target fingerprint, that is, Figure 5 The decrypted file fingerprint is shown in . The target encrypted firmware in the target upgrade data is encoded using the sha384 encryption algorithm to obtain the current fingerprint of the target encrypted firmware in the target upgrade data. The target fingerprint is compared with the current fingerprint to determine whether the target fingerprint is consistent with the current fingerprint, such as Figure 5 If the fingerprints are consistent, the target encrypted firmware in the upgrade data corresponding to the firmware to be upgraded is the encrypted firmware in the upgrade data corresponding to the firmware to be upgraded. Figure 5 The encrypted file shown in is decrypted and restored by AES to obtain the first firmware.
[0122] Corresponding to the above system embodiment, the embodiment of the present invention provides a firmware upgrade method, such as Figure 6 As shown, the method is applied to a cloud server of a firmware upgrade system, the firmware upgrade system also includes a vehicle terminal to be upgraded, and the method includes:
[0123] S601: For each first firmware required for upgrading the vehicle-mounted terminal to be upgraded, encrypt the first firmware using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware;
[0124] S602: Generate a target fingerprint corresponding to the target encrypted firmware using a second encryption algorithm;
[0125] S603: Encrypt the target fingerprint using a specified private key to obtain an encrypted fingerprint;
[0126] S604: Based on the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the designated private key corresponding to each first firmware, determine the upgrade package and send it to the vehicle terminal to be upgraded. So that the vehicle terminal to be upgraded can obtain the upgrade package. If the first firmware does not contain the designated boot firmware; use the running current boot firmware, the upgrade package and the partition activation status table to determine the firmware to be upgraded of the vehicle terminal to be upgraded; use the preset verification process to verify the upgrade data corresponding to the firmware to be upgraded in the upgrade package; and after each upgrade data is verified, use the designated encrypted text stored locally to decrypt the target encrypted firmware in each upgrade data, obtain the first firmware corresponding to each firmware to be upgraded, and upgrade;
[0127] The preset verification process includes:
[0128] Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate a current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate a current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
[0129] By applying the embodiment of the present invention, before sending the firmware required for the upgrade to the vehicle terminal to be upgraded, the cloud server performs multiple encryption on the firmware and its corresponding key, and encrypts different firmware separately to obtain an upgrade package, and sends it to the vehicle terminal to be upgraded. The vehicle terminal to be upgraded obtains the upgrade package, and determines the firmware to be upgraded based on the partition activation status table, and verifies the upgrade data corresponding to each firmware to be upgraded in the upgrade package based on a preset verification process. After the verification is passed, the firmware to be upgraded is upgraded to realize the modular upgrade of the firmware of the vehicle terminal to be upgraded. In addition, before the upgrade, the upgrade data corresponding to each firmware to be upgraded in the upgrade package is verified to ensure the legitimacy and accuracy of the obtained upgrade data and the safety of the upgrade process.
[0130] In another embodiment of the present invention, the vehicle terminal to be upgraded is further used to verify the upgrade data corresponding to the specified boot firmware in the upgrade package by using the running current boot firmware and the preset verification process if the first firmware includes the specified boot firmware; after the upgrade data corresponding to the specified boot firmware is verified, decrypt the target encrypted firmware of the specified boot firmware in the upgrade data corresponding to the specified boot firmware by using the locally stored specified encrypted text to obtain the specified boot firmware, wherein the target firmware includes the specified boot firmware;
[0131] The firmware to be upgraded of the vehicle terminal to be upgraded is determined by using the running specified boot firmware, the upgrade package and the partition activation status table; the upgrade data corresponding to the firmware to be upgraded in the upgrade package is verified by using a preset verification process; and after each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted by using the locally stored specified encrypted text to obtain the first firmware corresponding to each firmware to be upgraded, and then upgrade it.
[0132] In another embodiment of the present invention, the storage unit of the vehicle terminal to be upgraded includes: a factory partition and at least two storage partitions; wherein the factory partition includes: a read-only area and a readable and writable area, the read-only area is used to store the boot firmware and its backup and application firmware at the time of leaving the factory; the readable and writable area is used to store the partition activation status table, the partition activation status table contains information specifying the current partition to be upgraded and the firmware to be upgraded; the at least two storage partitions are used to store firmware.
[0133] In another embodiment of the present invention, the vehicle terminal to be upgraded includes a one-time programmable memory for storing the designated encrypted text corresponding to each firmware to be upgraded and the information corresponding to the public key corresponding to the designated private key.
[0134] In another embodiment of the present invention, the step of determining the upgrade package based on the target encrypted firmware corresponding to each first firmware, the target fingerprint, the encrypted fingerprint, and the public key corresponding to the designated private key includes:
[0135] For each first firmware, the target fingerprint corresponding to the first firmware is added to the tail of the target encrypted firmware corresponding to the first firmware; the encrypted fingerprint corresponding to the first firmware is added to the tail of the target fingerprint corresponding to the first firmware; the public key corresponding to the designated private key corresponding to the first firmware is added to the tail of the encrypted fingerprint corresponding to the first firmware; and the corresponding address information is generated to obtain the upgrade package.
[0136] In another embodiment of the present invention, the vehicle terminal to be upgraded, in the step of determining the firmware to be upgraded of the vehicle terminal to be upgraded by using the currently running boot firmware, the upgrade package and the partition activation status table, includes:
[0137] The current partition to be upgraded of the vehicle terminal to be upgraded is determined by using the currently running boot firmware, the upgrade package and the partition activation status table, and the firmware to be upgraded in the current partition to be upgraded is determined.
[0138] In another embodiment of the present invention, the process of upgrading the vehicle-mounted terminal to be upgraded includes:
[0139] The first firmware corresponding to the firmware to be upgraded is loaded to the startup position corresponding to each firmware to be upgraded; the remaining startup count corresponding to the current partition to be upgraded is reduced by one; the first firmware loaded to the startup position corresponding to each firmware to be upgraded is started in sequence according to the upgrade startup order; if each first firmware loaded to the startup position corresponding to each firmware to be upgraded is successfully started, it is determined that the current partition to be upgraded is successfully upgraded, and the remaining startup count corresponding to the current partition to be upgraded is reset; if any first firmware loaded to the startup position corresponding to each firmware to be upgraded fails to start, it is determined whether the remaining startup count corresponding to the current partition to be upgraded is zero; if it is not zero, return to the step of reducing the remaining startup count corresponding to the current partition to be upgraded by one.
[0140] In another embodiment of the present invention, the vehicle terminal to be upgraded includes at least two storage partitions and a factory partition;
[0141] The vehicle terminal to be upgraded is also used
[0142] If it is determined that the remaining number of startup times corresponding to the current partition to be upgraded is zero, determine whether the vehicle-mounted terminal to be upgraded has other storage partitions whose corresponding remaining number of startup times is not zero; if so, start the firmware in the other storage partitions whose corresponding remaining number of startup times is not zero in turn; if not, start the firmware in the factory partition.
[0143] In another embodiment of the present invention, the vehicle-mounted terminal to be upgraded also requires a second firmware;
[0144] The step of determining the upgrade package based on the target encrypted firmware corresponding to each first firmware, the target fingerprint, the encrypted fingerprint, and the public key corresponding to the designated private key includes:
[0145] Encrypt the second firmware using a third encryption algorithm, and determine an upgrade package based on the target encrypted firmware corresponding to each first firmware in the target firmware, the target fingerprint, the encrypted fingerprint, the public key corresponding to the specified private key, and the encrypted second firmware;
[0146] Correspondingly, after the upgrade, the vehicle terminal to be upgraded is also used to decrypt and verify the encrypted second firmware using a decryption algorithm corresponding to the third encryption algorithm to obtain the second firmware, and upgrade using the second firmware.
[0147] Corresponding to the above system embodiment, the embodiment of the present invention provides a firmware upgrade method, such as Figure 7 As shown, the method is applied to a vehicle terminal to be upgraded in a firmware upgrade system, and the firmware upgrade system also includes a cloud server, and the cloud server is used to encrypt each first firmware required for the upgrade of the vehicle terminal to be upgraded using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware; using a second encryption algorithm to generate a target fingerprint corresponding to the target encrypted firmware; using a specified private key to encrypt the target fingerprint to obtain an encrypted fingerprint; based on the target encrypted firmware corresponding to each first firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key, determine the upgrade package, and send it to the vehicle terminal to be upgraded, the method includes:
[0148] S701: Obtain the upgrade package sent by the cloud server;
[0149] S702: If the first firmware does not include the specified boot firmware, determine the firmware to be upgraded of the vehicle terminal to be upgraded by using the currently running boot firmware, the upgrade package and the partition activation status table;
[0150] S703: Verify the upgrade data corresponding to the firmware to be upgraded in the upgrade package by using a preset verification process;
[0151] S704: After each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted using the designated encrypted text stored locally, to obtain the first firmware corresponding to each firmware to be upgraded, and then upgrade.
[0152] The preset verification process includes:
[0153] Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate a current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate a current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
[0154] In the application of the embodiment of the present invention, before sending the firmware required for the upgrade to the vehicle terminal to be upgraded, the cloud server performs multiple encryption on the firmware and its corresponding key, and encrypts different firmware separately to obtain an upgrade package, and sends it to the vehicle terminal to be upgraded. The vehicle terminal to be upgraded obtains the upgrade package, and determines the firmware to be upgraded based on the partition activation status table, and verifies the upgrade data corresponding to each firmware to be upgraded in the upgrade package based on a preset verification process. After the verification is passed, the firmware to be upgraded is upgraded to realize the modular upgrade of the application firmware of the vehicle terminal to be upgraded. In addition, before the upgrade, the upgrade data corresponding to each firmware to be upgraded in the upgrade package is verified to ensure the legitimacy and accuracy of the obtained upgrade data and the safety of the upgrade process.
[0155] In another embodiment of the present invention, in another embodiment of the present invention, the method further comprises:
[0156] If the first firmware of the target firmware includes the designated boot firmware, verify the upgrade data corresponding to the designated boot firmware in the upgrade package by using the running current boot firmware and the preset verification process; after the upgrade data corresponding to the designated boot firmware is verified, decrypt the target encrypted firmware of the designated boot firmware in the upgrade data corresponding to the designated boot firmware by using the designated encrypted text stored locally to obtain the designated boot firmware, wherein the target firmware includes the designated boot firmware;
[0157] The firmware to be upgraded of the vehicle terminal to be upgraded is determined by using the running specified boot firmware, the upgrade package and the partition activation status table; the upgrade data corresponding to the firmware to be upgraded in the upgrade package is verified by using a preset verification process; and after each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted by using the locally stored specified encrypted text to obtain the first firmware corresponding to each firmware to be upgraded, and then upgrade it.
[0158] In another embodiment of the present invention, the storage unit of the vehicle terminal to be upgraded includes: a factory partition and at least two storage partitions; wherein the factory partition includes: a read-only area and a readable and writable area, the read-only area is used to store the boot firmware and its backup and application firmware at the time of leaving the factory; the readable and writable area is used to store the partition activation status table, the partition activation status table contains information specifying the current partition to be upgraded and the firmware to be upgraded; the at least two storage partitions are used to store firmware.
[0159] In another embodiment of the present invention, the vehicle terminal to be upgraded includes a one-time programmable memory for storing the designated encrypted text corresponding to each firmware to be upgraded and the information corresponding to the public key corresponding to the designated private key.
[0160] In another embodiment of the present invention, the cloud server is specifically used to determine the upgrade package based on the target encrypted firmware corresponding to each first firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key.
[0161] For each first firmware, the target fingerprint corresponding to the first firmware is added to the tail of the target encrypted firmware corresponding to the first firmware; the encrypted fingerprint corresponding to the first firmware is added to the tail of the target fingerprint corresponding to the first firmware; the public key corresponding to the designated private key corresponding to the first firmware is added to the tail of the encrypted fingerprint corresponding to the first firmware; and the corresponding address information is generated to obtain the upgrade package.
[0162] In another embodiment of the present invention, the step of determining the firmware to be upgraded of the vehicle terminal to be upgraded by using the currently running boot firmware, the upgrade package and the partition activation status table includes:
[0163] The current partition to be upgraded of the vehicle terminal to be upgraded is determined by using the currently running boot firmware, the upgrade package and the partition activation status table, and the firmware to be upgraded in the current partition to be upgraded is determined.
[0164] In another embodiment of the present invention, the process of performing the upgrade includes:
[0165] The first firmware corresponding to the firmware to be upgraded is loaded to the startup position corresponding to each firmware to be upgraded; the remaining startup count corresponding to the current partition to be upgraded is reduced by one; the first firmware loaded to the startup position corresponding to each firmware to be upgraded is started in sequence according to the upgrade startup order; if each first firmware loaded to the startup position corresponding to each firmware to be upgraded is successfully started, it is determined that the current partition to be upgraded is successfully upgraded, and the remaining startup count corresponding to the current partition to be upgraded is reset; if any first firmware loaded to the startup position corresponding to each firmware to be upgraded fails to start, it is determined whether the remaining startup count corresponding to the current partition to be upgraded is zero; if it is not zero, return to the step of reducing the remaining startup count corresponding to the current partition to be upgraded by one.
[0166] In another embodiment of the present invention, the vehicle terminal to be upgraded includes at least two storage partitions and a factory partition;
[0167] The method further comprises:
[0168] If it is determined that the remaining number of startup times corresponding to the current partition to be upgraded is zero, determine whether the vehicle-mounted terminal to be upgraded has other storage partitions whose corresponding remaining number of startup times is not zero; if so, start the firmware in the other storage partitions whose corresponding remaining number of startup times is not zero in turn; if not, start the firmware in the factory partition.
[0169] In another embodiment of the present invention, the vehicle-mounted terminal to be upgraded also requires a second firmware;
[0170] The cloud server is specifically used to determine the upgrade package based on the target encrypted firmware corresponding to each first firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the designated private key:
[0171] Encrypt the second firmware using a third encryption algorithm, and determine an upgrade package based on the target encrypted firmware corresponding to each first firmware in the target firmware, the target fingerprint, the encrypted fingerprint, the public key corresponding to the specified private key, and the encrypted second firmware;
[0172] Correspondingly, the method further includes, after the upgrading, decrypting and verifying the encrypted second firmware using a decryption algorithm corresponding to the third encryption algorithm to obtain the second firmware, and upgrading using the second firmware.
[0173] The above method embodiment corresponds to the system embodiment and has the same technical effect as the system embodiment. For specific description, please refer to the system embodiment. The method embodiment is obtained based on the system embodiment. For specific description, please refer to the system embodiment part, which will not be repeated here. A person of ordinary skill in the art can understand that the accompanying drawings are only schematic diagrams of one embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0174] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed accordingly and located in one or more devices different from the embodiment. The modules in the above embodiment can be combined into one module, or can be further divided into multiple sub-modules.
[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A firmware upgrade system, characterized in that: The system includes: a vehicle terminal to be upgraded and a cloud server; The cloud server is configured to encrypt each first firmware required for upgrading the vehicle-mounted terminal to be upgraded using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware; generate a target fingerprint corresponding to the target encrypted firmware using a second encryption algorithm; encrypt the target fingerprint using a specified private key to obtain an encrypted fingerprint; determine an upgrade package based on the target encrypted firmware, the target fingerprint, the encrypted fingerprint, and the public key corresponding to the specified private key corresponding to each first firmware, and send the upgrade package to the vehicle-mounted terminal to be upgraded; The vehicle terminal to be upgraded is configured to obtain the upgrade package, and if the first firmware does not include the specified boot firmware, determine the firmware to be upgraded of the vehicle terminal to be upgraded by using the running current boot firmware, the upgrade package and the partition activation status table; verify the upgrade data corresponding to the firmware to be upgraded in the upgrade package by using a preset verification process; and after each upgrade data is verified, decrypt the target encrypted firmware in each upgrade data by using the locally stored specified encrypted text, obtain the first firmware corresponding to each firmware to be upgraded, and upgrade it; The preset verification process includes: Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate a current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate a current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
2. The system according to claim 1, characterized in that The vehicle terminal to be upgraded is further configured to verify the upgrade data corresponding to the specified boot firmware in the upgrade package by using the running current boot firmware and the preset verification process if the first firmware includes the specified boot firmware; After the upgrade data corresponding to the designated boot firmware is verified, the target encrypted firmware of the designated boot firmware in the upgrade data corresponding to the designated boot firmware is decrypted using the designated encrypted text stored locally to obtain the designated boot firmware, wherein the target firmware includes the designated boot firmware; The firmware to be upgraded of the vehicle terminal to be upgraded is determined by using the running specified boot firmware, the upgrade package and the partition activation status table; the upgrade data corresponding to the firmware to be upgraded in the upgrade package is verified by using a preset verification process; and after each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted by using the locally stored specified encrypted text to obtain the first firmware corresponding to each firmware to be upgraded, and then upgrade it.
3. The system according to claim 1, characterized in that The storage unit of the vehicle terminal to be upgraded includes: a factory partition and at least two storage partitions; wherein the factory partition includes: a read-only area and a readable and writable area, the read-only area is used to store the boot firmware and its backup and application firmware at the time of leaving the factory; the readable and writable area is used to store a partition activation status table, the partition activation status table contains information specifying the current partition to be upgraded and the firmware to be upgraded; the at least two storage partitions are used to store firmware; The vehicle terminal to be upgraded includes a one-time programmable memory for storing the designated encrypted text corresponding to each firmware to be upgraded and the information corresponding to the public key corresponding to the designated private key.
4. The system according to claim 1, characterized in that In the process of determining the upgrade package based on the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the designated private key corresponding to each first firmware, the cloud server is specifically configured to, for each first firmware, add the target fingerprint corresponding to the first firmware to the tail of the target encrypted firmware corresponding to the first firmware; add the encrypted fingerprint corresponding to the first firmware to the tail of the target fingerprint corresponding to the first firmware; add the public key corresponding to the designated private key corresponding to the first firmware to the tail of the encrypted fingerprint corresponding to the first firmware; and generate corresponding address information to obtain the upgrade package.
5. The system according to any one of claims 1 to 4, characterized in that: The vehicle terminal to be upgraded, in the process of determining the firmware to be upgraded of the vehicle terminal to be upgraded by using the currently running boot firmware, the upgrade package and the partition activation status table, is specifically configured as follows: The current partition to be upgraded of the vehicle terminal to be upgraded is determined by using the currently running boot firmware, the upgrade package and the partition activation status table, and the firmware to be upgraded in the current partition to be upgraded is determined.
6. The system according to claim 5, characterized in that During the upgrade process, the vehicle-mounted terminal to be upgraded is specifically configured as follows: Loading the first firmware corresponding to the firmware to be upgraded to the startup position corresponding to each firmware to be upgraded; reducing the remaining startup count corresponding to the current partition to be upgraded by one; According to the upgrade startup sequence, the first firmware loaded into the startup position corresponding to each firmware to be upgraded is started in sequence; If each first firmware loaded into the startup position corresponding to each firmware to be upgraded is successfully started, it is determined that the current partition to be upgraded is successfully upgraded, and the remaining startup times corresponding to the current partition to be upgraded are reset; If any first firmware loaded into the startup position corresponding to each firmware to be upgraded fails to start, it is determined whether the remaining startup times corresponding to the current partition to be upgraded is zero; if not zero, the process returns to the step of reducing the remaining startup times corresponding to the current partition to be upgraded by one.
7. The system according to claim 6, characterized in that The vehicle terminal to be upgraded includes at least two storage partitions and a factory partition; The vehicle terminal to be upgraded is also configured as If it is determined that the remaining number of startup times corresponding to the current partition to be upgraded is zero, determine whether the vehicle-mounted terminal to be upgraded has other storage partitions whose corresponding remaining number of startup times is not zero; if so, start the firmware in the other storage partitions whose corresponding remaining number of startup times is not zero in turn; if not, start the firmware in the factory partition.
8. The system of claim 1, wherein: The firmware required for upgrading the vehicle-mounted terminal to be upgraded also includes a second firmware; The cloud server, in the process of determining the upgrade package based on the target encrypted firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key corresponding to each first firmware in the target firmware, is specifically configured to: encrypt the second firmware using a third encryption algorithm, and determine the upgrade package based on the target encrypted firmware, the target fingerprint, the encrypted fingerprint and the public key corresponding to the specified private key corresponding to each first firmware in the target firmware, and the encrypted second firmware; Correspondingly, after the upgrade, the vehicle terminal to be upgraded is further configured to: decrypt and verify the encrypted second firmware using a decryption algorithm corresponding to the third encryption algorithm to obtain the second firmware, and upgrade using the second firmware.
9. A firmware upgrade method, characterized in that: A cloud server applied to a firmware upgrade system, wherein the firmware upgrade system also includes a vehicle terminal to be upgraded, and the method includes: For each first firmware required for upgrading the vehicle-mounted terminal to be upgraded, encrypt the first firmware using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware, where the target encrypted firmware is the firmware required for upgrading the vehicle-mounted terminal to be upgraded; Using a second encryption algorithm, generating a target fingerprint corresponding to the target encrypted firmware; Encrypting the target fingerprint using a specified private key to obtain an encrypted fingerprint; Based on the target encrypted firmware, target fingerprint, encrypted fingerprint and public key corresponding to the designated private key corresponding to each first firmware, an upgrade package is determined and sent to the vehicle terminal to be upgraded, so that the vehicle terminal to be upgraded obtains the upgrade package, if the first firmware does not contain the designated boot firmware; the firmware to be upgraded of the vehicle terminal to be upgraded is determined by using the running current boot firmware, the upgrade package and the partition activation status table; the upgrade data corresponding to the firmware to be upgraded in the upgrade package is verified by using a preset verification process; and after each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted by using the designated encrypted text stored locally, and the first firmware corresponding to each firmware to be upgraded is obtained, and the upgrade is performed; The preset verification process includes: Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate a current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate a current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
10. A firmware upgrade method, characterized in that: A vehicle terminal to be upgraded applied to a firmware upgrade system, the firmware upgrade system further comprising a cloud server, the cloud server being used for encrypting each first firmware required for upgrading the vehicle terminal to be upgraded using a specified encrypted text corresponding to a first encryption algorithm to obtain a target encrypted firmware; generating a target fingerprint corresponding to the target encrypted firmware using a second encryption algorithm; and encrypting the target fingerprint using a specified private key to obtain an encrypted fingerprint; Based on the target encrypted firmware corresponding to each first firmware, the target fingerprint, the encrypted fingerprint, and the public key corresponding to the designated private key, an upgrade package is determined and sent to the vehicle terminal to be upgraded, the method comprising: Obtaining the upgrade package sent by the cloud server; If the first firmware does not include the specified boot firmware; using the running current boot firmware, the upgrade package and the partition activation status table, determining the firmware to be upgraded of the vehicle terminal to be upgraded; Using a preset verification process, verifying the upgrade data corresponding to the firmware to be upgraded in the upgrade package; After each upgrade data is verified, the target encrypted firmware in each upgrade data is decrypted using the designated encrypted text stored locally, the first firmware corresponding to each firmware to be upgraded is obtained, and the upgrade is performed; The preset verification process includes: Using the public key corresponding to the specified private key in the target upgrade data corresponding to the target firmware, generate a current public key fingerprint corresponding to the target upgrade data; if the current public key fingerprint is the same as the public key fingerprint corresponding to the locally stored target firmware, use the public key corresponding to the specified private key in the target upgrade data to decrypt the encrypted fingerprint in the target upgrade data to obtain the target fingerprint; using the second encryption algorithm, generate a current fingerprint of the target encrypted firmware in the target upgrade data; if the current fingerprint is the same as the target fingerprint, it indicates that the target upgrade data verification has passed, wherein the target firmware includes the firmware to be upgraded.
Citation Information
Patent Citations
Firmware upgrade method and device
CN109214168A
Firmware verification method and system, server and electronic device
CN109829294A