Software upgrading method, device, equipment, vehicle, medium and product

By obtaining upgrade data to create software images, the problem of backup data occupies storage resources in differential upgrades is solved, and a robust software upgrade process is achieved.

CN120508309APending Publication Date: 2025-08-19BYD CO LTD
0 Cites 0 Cited by

Patent Information

Application Number
CN202411719499.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-08-19

Smart Images

  • Figure CN120508309A_ABST
    Figure CN120508309A_ABST
Patent Text Reader

Abstract

The invention discloses a software upgrading method, a control device, electronic equipment, a vehicle, a computer readable storage medium and a computer program product. The method comprises the steps of obtaining upgrading data of to-be-upgraded software, creating a software mirror image of the to-be-upgraded software, and upgrading the to-be-upgraded software according to the upgrading data and the software mirror image. Thus, the software mirror image of the to-be-upgraded software can be created under the condition that the upgrading data is received, and version upgrading of the to-be-upgraded software is completed through the upgrading data and the software mirror image, so that the situation that backup data of the to-be-upgraded software needs to be stored in a vehicle before software upgrading can be avoided; according to the technical scheme, excessive occupation of vehicle storage resources by software upgrading operation is avoided, the situation that the to-be-upgraded software fails to be upgraded due to backup data storage failure or storage data loss can also be avoided, software upgrading is stably operated, differential upgrading is supported, and dependence of differential upgrading on software backup data is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of software upgrades, and in particular to a software upgrade method, a control device, an electronic device, a vehicle, a computer-readable storage medium, and a computer program product. Background Art

[0002] In related technologies, differential upgrade is an implementation of Over The Air (OTA) technology, which refers to an upgrade process in which only part of the software is updated to achieve a version upgrade without completely replacing the device software.

[0003] To support differential upgrades, vehicles in related art typically need to store backup data of the software to be upgraded. Upon receiving a differential upgrade package, a new version of the software to be upgraded is created based on the backup data and the differential upgrade package. However, because backup data typically takes up a large amount of storage space, and vehicle storage resources are relatively limited, the differential upgrade of the vehicle software may fail due to backup file corruption or failure to write the backup file to disk. Summary of the Invention

[0004] The present application provides a software upgrade method, a control device, an electronic device, a vehicle, a computer-readable storage medium, and a computer program product.

[0005] The present application provides a software upgrade method, including:

[0006] Obtain upgrade data for the software to be upgraded;

[0007] Creating a software image of the software to be upgraded;

[0008] The software to be upgraded is upgraded according to the upgrade data and the software image.

[0009] In this way, in the embodiment of the present application, a software image of the software to be upgraded can be created when the upgrade data is received, so as to complete the version upgrade of the software to be upgraded through the upgrade data and the software image, thereby avoiding the need to store backup data of the software to be upgraded in the vehicle before the software upgrade, and avoiding excessive occupation of vehicle storage resources by the software upgrade operation. It can also avoid the failure of the software to be upgraded due to failure in storage of backup data or loss of storage data, thereby avoiding the failure of the software to be upgraded to be upgraded, so that the upgrade of the software to be upgraded can run stably, differential upgrade can be supported, and the dependence of differential upgrade on software backup data can be reduced to a certain extent.

[0010] In certain embodiments of the present application, upgrading the software to be upgraded based on the upgrade data and the software image includes:

[0011] Performing a first preprocessing on the upgrade data to determine the upgraded data after processing, wherein the first preprocessing includes a decryption process and / or a signature verification process;

[0012] The software to be upgraded is upgraded according to the processed upgrade data and the software image.

[0013] Thus, in the embodiment of the present application, the upgrade data can be pre-processed to determine the processed upgrade data, and the software to be upgraded can be upgraded based on the processed upgrade data and the software image, which ensures the stable progress of the software to be upgraded to a certain extent.

[0014] In certain embodiments of the present application, upgrading the software to be upgraded based on the processed upgrade data and the software image includes:

[0015] determining an upgraded software image according to the processed upgrade data and the software image;

[0016] The software to be upgraded is upgraded according to the upgraded software image.

[0017] Thus, in the embodiment of the present application, the upgraded software image can be determined based on the processed upgrade data and the software image, and the software to be upgraded is upgraded based on the upgraded software image, which ensures the stable upgrade of the software to be upgraded to a certain extent.

[0018] In certain embodiments of the present application, determining an upgraded software image based on the processed upgrade data and the software image includes:

[0019] Create target file;

[0020] Mount the target file to a preset file path;

[0021] performing differential restoration processing on the processed upgrade data and the software image;

[0022] Writing the result of the differential restoration processing into the target file according to the preset file path;

[0023] Uninstalling the preset file path;

[0024] The upgraded software image is determined according to the target file.

[0025] In this way, in the implementation mode of the present application, a target file can be created, and the target file can be mounted to the preset file path, and differential restoration processing can be performed on the processed upgrade data and the software image, and the result of the differential restoration processing can be written to the target file according to the preset file path, and the preset file path can be uninstalled, and the upgraded software image can be determined according to the target file, which to a certain extent ensures the robust acquisition of the upgraded software image.

[0026] In certain embodiments of the present application, obtaining upgrade data of the software to be upgraded includes:

[0027] Obtaining first version software data and second version software data of the software to be upgraded;

[0028] The upgrade data is generated according to the data difference between the first version software data and the second version software data.

[0029] In this way, in the embodiment of the present application, the first version software data and the second version software data of the software to be upgraded can be obtained, and the upgrade data can be generated according to the data difference between the first version software data and the second version software data, thereby enabling the upgrade process of the software to be upgraded to be carried out based on a differential upgrade method.

[0030] In certain embodiments of the present application, generating the upgrade data based on the data difference between the first version software data and the second version software data includes:

[0031] In a case where there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, the upgrade data is generated according to the data difference.

[0032] Thus, in the embodiment of the present application, when there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, upgrade data can be generated according to the data difference between the first version software data and the second version software.

[0033] In certain embodiments of the present application, when there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, generating the upgrade data according to the data difference includes:

[0034] If there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, performing second preprocessing on the first version software data and the second version software data to determine processed first version software data and processed second version software data, wherein the second preprocessing includes decryption processing and / or signature verification processing;

[0035] The upgrade data is generated according to the data difference between the processed first version software data and the processed second version software data.

[0036] Thus, in an embodiment of the present application, when there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, the first version software data and the second version software data can be subjected to a second pre-processing to determine the processed first version software data and the processed second version software data, and upgrade data can be generated based on the data difference between the processed first version software data and the processed second version software data.

[0037] In certain embodiments of the present application, generating the upgrade data according to the data difference between the processed first version software data and the processed second version software data includes:

[0038] Generate upgrade data to be verified based on the data differences;

[0039] Performing differential restoration on the upgrade data to be verified and the processed first version software data to determine the third version software data;

[0040] Verifying the upgrade data to be verified based on the third version software data;

[0041] In a case where the verification is passed, the upgrade data to be verified is determined as the upgrade data.

[0042] Thus, in the embodiment of the present application, the upgrade data to be verified can be generated based on the data difference between the processed first version software data and the processed second version software data, and the upgrade data to be verified and the processed first version software data can be differentially restored to determine the third version software data, and the upgrade data to be verified can be verified based on the third version software data, and if the verification passes, the upgrade data to be verified can be determined as the upgrade data, thereby ensuring the validity and reliability of the upgrade data.

[0043] In certain embodiments of the present application, verifying the upgrade data to be verified based on the third version software data includes:

[0044] In a case where the compression mapping parameters of the third version software data match the compression mapping parameters of the second version software data, the verification of the upgrade data to be verified is passed.

[0045] Thus, in the embodiment of the present application, it can be determined that the verification of the upgrade data to be verified has passed when the compression mapping parameters of the third version software data match the compression mapping parameters of the second version software data, thereby efficiently completing the verification of the upgrade data to be verified.

[0046] The present application provides a control device, comprising:

[0047] a transceiver unit configured to obtain upgrade data of the software to be upgraded;

[0048] The processing unit is configured to create a software image of the software to be upgraded, and upgrade the software to be upgraded according to the upgrade data and the software image.

[0049] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the above-mentioned software upgrade method is implemented.

[0050] An embodiment of the present application provides a vehicle, comprising the above-mentioned control device or the above-mentioned electronic device.

[0051] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by one or more processors, the above-mentioned software upgrade method is implemented.

[0052] An embodiment of the present application provides a computer program product, including a computer program / instruction, which implements the above-mentioned software upgrade method when executed by a processor.

[0053] The control device, electronic device, vehicle and computer-readable storage medium provided in the embodiments of the present application can create a software image of the software to be upgraded when the upgrade data is received, so as to complete the version upgrade of the software to be upgraded through the upgrade data and the software image, thereby avoiding the need to store backup data of the software to be upgraded in the vehicle before the software upgrade, and avoiding excessive occupation of vehicle storage resources by the software upgrade operation. It can also avoid the failure of the software to be upgraded due to failure in storage of backup data or loss of storage data, thereby ensuring that the upgrade of the software to be upgraded can run stably, supporting differential upgrades, and reducing the dependence of differential upgrades on software backup data to a certain extent.

[0054] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0056] Figure 1This is a flowchart of a software upgrade method in certain embodiments of the present application;

[0057] Figure 2 This is a schematic diagram of an application scenario in some embodiments of the present application;

[0058] Figure 3 This is a flowchart of a software upgrade method in certain embodiments of the present application;

[0059] Figure 4 This is a schematic diagram of an application scenario in some embodiments of the present application;

[0060] Figure 5 This is a flowchart of a software upgrade method in certain embodiments of the present application;

[0061] Figure 6 This is a flowchart of a software upgrade method in certain embodiments of the present application;

[0062] Figure 7 This is a flowchart of a software upgrade method in certain embodiments of the present application;

[0063] Figure 8 This is a flowchart of a software upgrade method in certain embodiments of the present application;

[0064] Figure 9 This is a flowchart of a software upgrade method in certain embodiments of the present application;

[0065] Figure 10 This is a flowchart of a software upgrade method in certain embodiments of the present application;

[0066] Figure 11 This is a schematic diagram of an application scenario in some embodiments of the present application;

[0067] Figure 12 This is a schematic diagram of an application scenario in certain embodiments of the present application. DETAILED DESCRIPTION

[0068] The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and should not be understood as limiting the embodiments of the present application.

[0069] Due to the rapid popularization of network technology, current network performance is relatively high, with characteristics such as high bandwidth and low latency. With the development of network technology, the vehicle development process and upgrade process have been optimized to a certain extent. For example, when the software in the user's vehicle needs to be updated, the user does not need to use a traditional diagnostic instrument to update the software at a 4S store or vehicle repair station. Instead, it can be directly upgraded remotely through Over The Air (OTA) technology, thus ensuring a good user experience.

[0070] Among them, Over The Air (OTA) technology refers to the process of upgrading the software system of a device (such as a vehicle) from one version to another via a wireless network. Differential upgrade is an implementation method of OTA upgrade, which refers to the process of updating only part of the software to complete the software without completely replacing the software in the device. It can be understood that differential upgrade can save network bandwidth and device storage space during the upgrade, while reducing upgrade time and cost.

[0071] In related technologies, the complete process of a differential upgrade package usually includes: first, comparing the new version of the software with the old version of the software to find the difference data between the new and old versions of the software; then, packaging these difference data into a differential upgrade package, and transmitting the differential upgrade package to a device (such as a vehicle) via a wireless network. After receiving the differential upgrade package, the device can perform a differential restoration on the differential upgrade package and the pre-stored backup data of the old version of the software to generate a new version of the software.

[0072] During a differential upgrade, the differential upgrade package is typically read in binary format. Furthermore, during a differential restore, three parts are typically involved: old data, new data, and differential data. Old data can be understood as existing data on the device, new data as newly added to the upgrade package, and differential data as the difference between the update package and the old data package. In related technologies, the device requires all old data packages, resulting in excessive memory space occupied by old data packages and over-reliance on backups from the previous upgrade.

[0073] Based on the above problems you may encounter, please refer to Figure 1 , the embodiment of the present application provides a software upgrade method, comprising:

[0074] 01: Get the upgrade data of the software to be upgraded;

[0075] 02: Create a software image for the software to be upgraded;

[0076] 03: Upgrade the software to be upgraded based on the upgrade data and software image.

[0077] The embodiments of the present application provide a control device. The software upgrade method of the embodiments of the present application can be implemented by the control device of the embodiments of the present application. Specifically, the control device includes a transceiver unit and a processing unit. The transceiver unit is configured to obtain upgrade data of the software to be upgraded. The processing unit is configured to create a software image of the software to be upgraded and upgrade the software to be upgraded based on the upgrade data and the software image.

[0078] The embodiments of the present application also provide an electronic device, comprising a memory and a processor. The software upgrade method of the embodiments of the present application can be implemented by the electronic device of the embodiments of the present application. Specifically, the memory stores a computer program, and the processor is configured to obtain upgrade data for software to be upgraded, create a software image of the software to be upgraded, and upgrade the software to be upgraded based on the upgrade data and the software image.

[0079] Specifically, in an embodiment of the present application, the vehicle can receive upgrade data for the software to be upgraded sent by an electronic device such as a remote server. The upgrade data generally includes text, images, audio, video and other data information for the software to be upgraded. Then, the vehicle can create a software image of the software to be upgraded, and complete the upgrade of the software based on the software image and upgrade data of the software to be upgraded.

[0080] In this way, in the embodiment of the present application, a software image of the software to be upgraded can be created when the upgrade data is received, so as to complete the version upgrade of the software to be upgraded through the upgrade data and the software image, thereby avoiding the need to store backup data of the software to be upgraded in the vehicle before the software upgrade, and avoiding excessive occupation of vehicle storage resources by the software upgrade operation. It can also avoid the failure of the software to be upgraded due to failure in storage of backup data or loss of storage data, thereby avoiding the failure of the software to be upgraded to be upgraded, so that the upgrade of the software to be upgraded can run stably, differential upgrade can be supported, and the dependence of differential upgrade on software backup data can be reduced to a certain extent.

[0081] In one example, the software to be upgraded refers to upgradeable firmware.

[0082] Furthermore, in an example where the software to be upgraded refers to upgradeable firmware, the firmware is the firmware carried by a chip in a vehicle domain controller, such as a file system carried by a system on chip (SOC) chip of an intelligent driving domain controller.

[0083] In an example, see Figure 2 , Figure 2 This is a schematic diagram of an application scenario in some embodiments of the present application, that is, Figure 2As shown, in the example where the software (including the software to be upgraded before the upgrade and the software to be upgraded after the upgrade) is the firmware carried by the intelligent driving domain controller SOC chip, the software may include four parts, namely application (Application, APP), userdata, other disk and algdata.

[0084] Furthermore, APP includes programs for implementing intelligent driving algorithms, vehicle applications, and third-party applications. Userdata refers to the OTA data storage path, including the storage of upgrade packages sent by DiLink and intermediate files and backup files during the upgrade process. Other disk includes user data such as autonomous driving data closed loop, autonomous driving data recording system (Data storage system for automated driving, DSSAD), vehicle dynamic monitoring system (Dynamic Electronic Testing, DET) and other data, as well as log data, and may also include certain calibration parameters, configuration files, preference settings and other config parameters configured by the user, as well as product testing programs, etc. Algdata refers to map data.

[0085] In one example, the upgrade data refers to differential upgrade data.

[0086] In an example where the upgrade data refers to differential upgrade data, the vehicle may perform differential restoration on both the upgrade data and the software image, thereby obtaining a new version of the software to be upgraded to implement the upgrade.

[0087] See also Figure 3 In certain embodiments of the present application, step 03 includes:

[0088] 030: performing a first pre-processing on the upgrade data to determine the upgraded data after the processing, wherein the first pre-processing includes a decryption process and / or a signature verification process;

[0089] 031: Upgrade the software to be upgraded based on the processed upgrade data and software image.

[0090] The processing unit of the embodiment of the present application is configured to perform a first preprocessing on the upgrade data, determine the processed upgrade data, and upgrade the software to be upgraded based on the processed upgrade data and the software image, wherein the first preprocessing includes decryption processing and / or signature verification processing.

[0091] The processor of the embodiment of the present application is also used to perform a first preprocessing on the upgrade data, determine the processed upgrade data, and upgrade the software to be upgraded based on the processed upgrade data and the software image, wherein the first preprocessing includes decryption processing and / or signature verification processing.

[0092] Specifically, in order to ensure the safe upgrade of the vehicle-mounted software, in the embodiment of the present application, the vehicle can perform security verification on the upgrade data before the software upgrade, and then perform the software upgrade using the upgrade data when the security verification of the upgrade data passes.

[0093] In an example, see Figure 4 , Figure 4 This is a schematic diagram of an application scenario in some embodiments of the present application, that is, Figure 4 As shown, in the embodiment of the present application, the vehicle is equipped with a differential restoration function component for realizing the differential restoration function. Moreover, the differential restoration function component also includes a pre-processing module for realizing pre-processing. And, the pre-processing module includes an encryption and decryption function (i.e. Figure 4 The submodule of "encryption / decryption" in Figure 6 The "Signature Addition / Verification" submodule in the .

[0094] Furthermore, in the embodiments of the present application, the electronic device may encrypt the upgrade data before transmitting it to ensure secure transmission and storage of the upgrade data. Therefore, upon receiving the upgrade data from the electronic device, the vehicle may decrypt the received upgrade data using the pre-processing module, and use the decrypted upgrade data to upgrade the software to be upgraded.

[0095] Furthermore, in the embodiments of the present application, the electronic device may digitally sign (i.e., "sign") the upgrade data before sending it. Therefore, when the vehicle receives the upgrade data sent by the electronic device, it can perform digital signature verification (i.e., "signature verification") on the received upgrade data based on the pre-processing module to verify the reliability of the upgrade data. It is understood that if the electronic signature verification passes, it indicates that the source of the upgrade data is reliable, and therefore the upgrade data can be used to upgrade the software to be upgraded.

[0096] It is understood that in the embodiment of the present application, the vehicle can perform decryption processing and signature verification processing on the received upgrade data synchronously or asynchronously. It is also understood that the execution order of the decryption processing and signature verification processing can be set according to actual needs.

[0097] Furthermore, when the vehicle can synchronously or asynchronously perform decryption processing and signature verification processing on the received upgrade data, the vehicle can use the upgrade data to perform subsequent upgrade steps if the decryption operation of the upgrade data is successfully performed and the electronic signature verification of the upgrade data is passed.

[0098] Thus, in the embodiment of the present application, the upgrade data can be pre-processed to determine the processed upgrade data, and the software to be upgraded can be upgraded based on the processed upgrade data and the software image, which ensures the stable progress of the software to be upgraded to a certain extent.

[0099] See also Figure 5 In certain embodiments of the present application, step 031 includes:

[0100] 0310: Determine the upgraded software image based on the processed upgrade data and the software image;

[0101] 0311: Upgrade the software to be upgraded based on the upgraded software image.

[0102] The processing unit of the embodiment of the present application is configured to determine an upgraded software image according to the processed upgrade data and the software image, and to upgrade the software to be upgraded according to the upgraded software image.

[0103] The processor of the embodiment of the present application is further configured to determine an upgraded software image based on the processed upgrade data and the software image, and to upgrade the software to be upgraded based on the upgraded software image.

[0104] Specifically, in the embodiments of the present application, after receiving the upgrade data and completing pre-processing of the upgrade data to obtain the processed upgrade data, the vehicle can perform differential restoration on both the upgraded data and the software image of the software to be upgraded, thereby obtaining an upgraded software image. The vehicle can then use the upgraded software image to update the software to be upgraded.

[0105] In one example, the vehicle can perform differential restoration on the processed upgrade data and the software image to generate new software, and package the software into an image so that the flashing process can use the image during the subsequent upgrade process of the software to be upgraded, thereby completing the upgrade of the software to be upgraded.

[0106] In an example where the software to be upgraded is a file system carried by an intelligent driving domain controller SOC chip, the storage size occupied by the image file of the file system is 6GB.

[0107] Furthermore, in one example, the image file of the SOC file system can be visually mounted on the root directory of the SOC. Therefore, the vehicle of the embodiment of the present application can directly restore the new file system image based on the existing file system image on the SOC in combination with the processed upgrade data, and obtain the directory contained in the file system for restoration through a pre-set Python script and a predetermined Linux command, and finally update the relevant directory of the SOC file system to complete the upgrade of the SOC file system.

[0108] Thus, in the embodiment of the present application, the upgraded software image can be determined based on the processed upgrade data and the software image, and the software to be upgraded is upgraded based on the upgraded software image, which ensures the stable upgrade of the software to be upgraded to a certain extent.

[0109] See also Figure 6 In some embodiments of the present application, step 0310 includes:

[0110] 03100: Create target file;

[0111] 03101: Mount the target file to the preset file path;

[0112] 03102: Perform differential restoration on the processed upgrade data and software image;

[0113] 03103: Write the differential restoration result to the target file according to the preset file path;

[0114] 03104: Uninstall preset file path;

[0115] 03105: Determine the upgraded software image based on the target file.

[0116] The processing unit of the embodiment of the present application is configured to create a target file, mount the target file to a preset file path, perform differential restoration on the processed upgrade data and the software image, write the result of the differential restoration processing to the target file according to the preset file path, uninstall the preset file path, and determine the upgraded software image according to the target file.

[0117] The processor of the embodiment of the present application is also used to create a target file, mount the target file to a preset file path, perform differential restoration on the processed upgrade data and software image, write the result of the differential restoration processing to the target file according to the preset file path, uninstall the preset file path, and determine the upgraded software image according to the target file.

[0118] Specifically, in the embodiment of the present application, the software image of the software to be upgraded can be mounted to a preset path, so that differential restoration processing of the software image and the upgrade package can be performed under the path.

[0119] For example, in one example, for the SOC file system, the vehicle may first call the dd command under the Linux system to create a file files of a specified size.

[0120] Then, the vehicle can call the Linux system mkfs.ext4 command to format the files created in the previous step.

[0121] Then, the vehicle can mount the formatted files to the tmp path.

[0122] Next, the file system content and the processed upgrade data in the root directory of the SOC are restored and restored to the tmp path.

[0123] Finally, call the umount command to unmount the tmp path and obtain the new file system image through the files file.

[0124] In this way, in the implementation mode of the present application, a target file can be created, and the target file can be mounted to the preset file path, and differential restoration processing can be performed on the processed upgrade data and the software image, and the result of the differential restoration processing can be written to the target file according to the preset file path, and the preset file path can be uninstalled, and the upgraded software image can be determined according to the target file, which to a certain extent ensures the robust acquisition of the upgraded software image.

[0125] In certain embodiments of this application, please refer to Figure 4 The differential restoration functional components carried by the vehicle include a preprocessing module, a data analysis module and an algorithm module. The vehicle's preprocessing module includes an encryption / decryption submodule and a signing / verification submodule. The vehicle's data analysis module includes a data assembly submodule. The vehicle's algorithm module includes a restoration submodule.

[0126] Furthermore, the vehicle can perform pre-processing such as decryption and signature verification on the received upgrade data based on the encryption / decryption submodule and the signing / verification submodule.

[0127] In addition, after the preprocessing is completed, the vehicle can use the data assembly submodule to call the Linux dd command to create a file of a specified size, and then call the Linux mkfs.ext4 command to format the file created by the dd command into an ext4 format file image. The created image is then mounted to the tmp path, and the system image of the SOC file system under the tmp path is restored through the restore submodule, so that the restored file of the SOC file system image can be restored to the tmp path. After that, the SOC file Linux umount command is called to unmount the tmp path to the file system image, thereby obtaining a new version of the SOC file system image (i.e., the upgraded software image).

[0128] It is understood that once a new version of the SOC file system image is obtained, the vehicle can complete subsequent upgrade steps using the new version of the SOC file system image. For example, the vehicle can use Python scripts and Linux commands to obtain the directories contained in the SOC file system, restore them with pre-processed upgrade data, and ultimately update the relevant directories of the SOC file system, thereby completing the SOC file system update.

[0129] See also Figure 7 In certain embodiments of the present application, step 01 includes:

[0130] 010: Obtain the first version software data and the second version software data of the software to be upgraded;

[0131] 011: Generate upgrade data based on the data difference between the first version software data and the second version software data.

[0132] The transceiver unit of the embodiment of the present application is configured to obtain the first version software data and the second version software data of the software to be upgraded. The processing unit of the embodiment of the present application is configured to generate upgrade data according to the data difference between the first version software data and the second version software data.

[0133] The processor of the embodiment of the present application is further configured to obtain first version software data and second version software data of the software to be upgraded, and to generate upgrade data according to the data difference between the first version software data and the second version software data.

[0134] Specifically, in an embodiment of the present application, the electronic device may, when obtaining the old version software data and the new version software data of the software to be upgraded, or in other words, when obtaining the first version software data and the second version software data of the software to be upgraded, compare the first version software data and the second version software data to determine the data difference between the first version software data and the second version software data, and generate a differential upgrade package for the software to be upgraded based on the data difference, that is, the above-mentioned upgrade data.

[0135] In one example, the electronic device is a device such as a server that can communicate with the vehicle. In other words, the vehicle in the embodiment of the present application can receive upgrade data sent by the server to upgrade the local software.

[0136] In one example, the electronic device is a vehicle. For example, after receiving first and second version software data of software to be upgraded and completing the upgrade of the software to be upgraded using the first and second version software data, a vehicle may generate upgrade data for the software to be upgraded based on the first and second version software data. The vehicle may then provide the upgrade data to at least one other vehicle, allowing the vehicle that received the upgrade data to upgrade its local software based on the upgrade data without having to receive new version software data of the local software to upgrade the local software, thereby reducing bandwidth requirements, storage space requirements, etc. during the upgrade process.

[0137] In one example, the version software data (including the first version software data and the second version software data) can be understood as an installation package of the software to be upgraded, or in other words, as a compressed package of the software to be upgraded.

[0138] In this way, in the embodiment of the present application, the first version software data and the second version software data of the software to be upgraded can be obtained, and the upgrade data can be generated according to the data difference between the first version software data and the second version software data, thereby enabling the upgrade process of the software to be upgraded to be carried out based on a differential upgrade method.

[0139] See also Figure 8 In certain embodiments of the present application, step 011 includes:

[0140] 0110: When there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, generate upgrade data according to the data difference.

[0141] The processing unit of the embodiment of the present application is configured to generate upgrade data according to the data difference when there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data.

[0142] The processor of the embodiment of the present application is further configured to generate upgrade data according to the data difference when there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data.

[0143] Specifically, in order to ensure the reliable implementation of the upgrade data generation process, in an embodiment of the present application, the electronic device can determine whether there is a difference between the first version software data and the second version software data based on the compression mapping parameters of the two versions of the software data when obtaining the first version software data and the second version software data.

[0144] It is understood that if the compression mapping parameters of the two versions of the software data are the same, then the two versions of the software data are likely the same, and the upgrade data generation process can be stopped. Conversely, if the compression mapping parameters of the two versions of the software data are different, then the two versions of the software data are different, and the subsequent upgrade data generation process can be continued.

[0145] In one example, the compression mapping parameter includes a Message-Digest Algorithm (MD) 5 value.

[0146] In one example, the electronic device may calculate the MD5 value of the first version software data and the MD5 value of the second version software data using a pre-set program code for implementing the MD5 information digest algorithm, and then compare whether there is a difference between the MD5 value of the first version software data and the MD5 value of the second version software data, thereby determining whether there is a data difference between the first version software data and the second version software data.

[0147] It can be understood that compared to the method of directly comparing whether there are differences between the first version software data ontology and the second version software data ontology, based on the MD5 value of the first version software data and the MD5 value of the second version software data, it is possible to relatively quickly and efficiently determine whether there are data differences between the first version software data ontology and the second version software data ontology.

[0148] Thus, in the embodiment of the present application, when there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, upgrade data can be generated according to the data difference between the first version software data and the second version software.

[0149] See also Figure 9 In certain embodiments of the present application, step 0110 includes:

[0150] 01100: If there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, perform second pre-processing on the first version software data and the second version software data to determine processed first version software data and processed second version software data, wherein the second pre-processing includes decryption processing and / or signature verification processing;

[0151] 01101: Generate upgrade data according to the data difference between the processed first version software data and the processed second version software data.

[0152] The processing unit of the embodiment of the present application is configured to perform a second preprocessing on the first version software data and the second version software data, determine the processed first version software data and the processed second version software data, and generate upgrade data based on the data difference between the processed first version software data and the processed second version software data, wherein the second preprocessing includes decryption processing and / or signature verification processing.

[0153] The processor of the embodiment of the present application is further used to perform a second preprocessing on the first version software data and the second version software data, determine the processed first version software data and the processed second version software data, and generate upgrade data based on the data difference between the processed first version software data and the processed second version software data, wherein the second preprocessing includes decryption processing and / or signature verification processing.

[0154] Specifically, in order to ensure the reliable generation of upgrade data, in an embodiment of the present application, the electronic device may, after obtaining the first version software data and the second version software data and determining that there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, pre-process the first version software data and the second version software data respectively, thereby obtaining the processed first version software data and the processed second version software data.

[0155] It is understood that to ensure the security of the version software data (including the first version software data and the second version software data), the version software data is usually encrypted after it is generated. It is also understood that after the version software data is encrypted, it is usually necessary to decrypt the version software data before the version software data itself can be viewed and processed.

[0156] It is also understood that to ensure the credibility of the version software data (including the first version software data and the second version software data), the version software data is usually digitally signed after it is generated. It is also understood that if the version software data can be successfully decrypted, it indicates that the source of the version software data is credible.

[0157] Therefore, in the embodiment of the present application, the electronic device can perform decryption processing and / or signature verification processing on the acquired first version software data and second version software data respectively, so that when the decryption and / or signature verification are successful, thereby obtaining the processed first version software data and the processed second version software data, the upgrade data can be generated by the data difference between the processed first version software data and the processed second version software data, thereby ensuring the reliability and security of the upgrade data.

[0158] Thus, in an embodiment of the present application, when there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, the first version software data and the second version software data can be subjected to a second pre-processing to determine the processed first version software data and the processed second version software data, and upgrade data can be generated based on the data difference between the processed first version software data and the processed second version software data.

[0159] See also Figure 10 In certain embodiments of the present application, step 01101 includes:

[0160] 011010: Generate upgrade data to be verified based on data differences;

[0161] 011011: Perform differential restoration on the upgraded data to be verified and the processed first version software data to determine the third version software data;

[0162] 011012: Verify the upgrade data to be verified based on the third version software data;

[0163] 011013: If the verification is successful, the upgrade data to be verified is determined as the upgrade data.

[0164] The processing unit of the embodiment of the present application is configured to generate upgrade data to be verified based on data differences, and to perform differential restoration processing on the upgrade data to be verified and the processed first version software data to determine the third version software data, and to verify the upgrade data to be verified based on the third version software data, and if the verification passes, determine the upgrade data to be verified as upgrade data.

[0165] The processor of the embodiment of the present application is further used to generate upgrade data to be verified based on the data difference between the first version software data and the second version software data, and to perform differential restoration on the upgrade data to be verified and the processed first version software data to determine the third version software data, and to verify the upgrade data to be verified based on the third version software data when the third version software data and the second version software data are present, and to determine the upgrade data to be verified as the upgrade data if the verification passes.

[0166] Specifically, in order to ensure the validity of the upgrade data finally generated, in an embodiment of the present application, after the upgrade data is generated by using the data difference between the preprocessed first version software data and the preprocessed second version software data, the upgrade data and the preprocessed first version software data are differentially restored together to obtain a new version software data, namely, the third version software data. Then, based on the third version software data, the previously generated upgrade data is verified, and if the verification passes, it is determined that the upgrade data is valid.

[0167] In one example, when there is no data difference between the third version software data and the second version software data, the verification of the upgrade data to be verified passes.

[0168] Thus, in the embodiment of the present application, the upgrade data to be verified can be generated based on the data difference between the processed first version software data and the processed second version software data, and the upgrade data to be verified and the processed first version software data can be differentially restored to determine the third version software data, and the upgrade data to be verified can be verified based on the third version software data, and if the verification passes, the upgrade data to be verified can be determined as the upgrade data, thereby ensuring the validity and reliability of the upgrade data.

[0169] In certain embodiments of the present application, step 011012 includes:

[0170] In a case where the compression mapping parameters of the third version software data match the compression mapping parameters of the second version software data, the verification of the upgrade data to be verified is passed.

[0171] It can be understood that, compared with directly comparing the third version software data ontology with the second version software data ontology, the execution speed of comparing the "compression mapping parameters of the third version software data" with the "compression mapping parameters of the second version software data" is faster.

[0172] In one example, the compression mapping parameter includes a Message-Digest Algorithm (MD) 5 value.

[0173] In one example, the electronic device may calculate the MD5 value of the second version software data and the MD5 value of the third version software data using a preset program code for implementing the MD5 information digest algorithm, and then compare whether there is a difference between the MD5 value of the second version software data and the MD5 value of the third version software data, thereby determining whether there is a data difference between the second version software data and the third version software data.

[0174] Thus, in the embodiment of the present application, it can be determined that the verification of the upgrade data to be verified has passed when the compression mapping parameters of the third version software data match the compression mapping parameters of the second version software data, thereby efficiently completing the verification of the upgrade data to be verified.

[0175] In certain embodiments of this application, please refer to Figure 4 、 Figure 11 as well as Figure 12 , Figure 11 and Figure 12 These are schematic diagrams of application scenarios in certain embodiments of the present application. Figure 4 As shown, in certain embodiments of the present application, the electronic device includes a differential restoration functional component for implementing the differential restoration function, and the differential restoration functional component includes a preprocessing module, a data parsing module and an algorithm module.

[0176] The pre-processing module in the electronic device includes an MD5 check submodule, an encryption / decryption submodule, a signature / verification submodule, and a compression / decompression submodule.

[0177] Furthermore, the MD5 check submodule is responsible for calculating the MD5 values for the new and old versions of software data (i.e., the first version of software data and the second version of software data) input from the outside world, and comparing the MD5 values of the new and old versions of software data to see if they are the same. It is understandable that if the MD5 values of the two versions of software data are the same, there is no need to perform differential operations on the new and old versions of software data. If the MD5 values of the two versions of software data are different, subsequent decryption, signature verification, and other processing can be performed. It is also understandable that after completing the differential processing of the new and old versions of software data, the differential file can be restored for verification by the MD5 check submodule, i.e., calculating whether the MD5 value of the restored result (i.e., the third version of software data) is the same as the MD5 value of the new version of software data (i.e., the second version of software data). If they are the same, it is determined that the differential is successful and the differential file (i.e., the upgrade data) is valid.

[0178] The encryption / decryption submodule in the electronic device can be used to decrypt received data, such as old and new versions of software data, and encrypt and output differential files (i.e., upgrade data). In one example, the encryption / decryption submodule in the electronic device performs encryption and decryption based on the AES128 encryption algorithm and operates in Electronic Code Book (ECB) mode.

[0179] The signature adding / verification submodule in the electronic device can be used to perform digital signature verification on the decrypted new and old versions of software data respectively, and to sign the differential file.

[0180] The compression / decompression submodule in the electronic device can be used to decompress the version software data according to the format required by the data parsing layer during the difference process, and compress the difference file according to the format of the OTA version software data.

[0181] It should also be noted that the data parsing module in the electronic device includes a data splitting submodule, a differential verification submodule and an OTA package production submodule.

[0182] Among them, the data splitting submodule is used to classify the files passed in by the decompression module according to the firmware type during the difference process, and pass them into different firmware difference interfaces of the algorithm module.

[0183] The differential verification submodule is primarily used to verify the differenced files. This module applies a restoration algorithm to the differenced package and the old package to restore the version software data. The restored version software data can be verified with the MD5 value of all files in the new version software data.

[0184] The OTA package production submodule is mainly used to compress, sign, encrypt and name the differential results according to the format of OTA version software data during the restoration process.

[0185] And, it can also be understood that the algorithm module in the electronic device mainly includes a differential submodule, which can be used for file differentiation, that is, determining the data difference between the new and old versions of software data and outputting the differential version software data (that is, upgrade data) based on the data difference.

[0186] Further, if Figure 11 and Figure 12 As shown, in the embodiment of the present application, the electronic device first transmits the received first version software data 201 and second version software data 202 to the data receiving module provided by the application layer. The data receiving module transmits the old and new upgrade package addresses as parameters to the MD5 check submodule (or integrity verification module) to calculate the MD5 values of the first version software data 201 and the second version software data 202 respectively, and verifies whether the MD5 value of the first version software data 201 and the MD5 value of the second version software data 202 are the same, so as to determine whether there is a difference between the first version software data 201 and the second version software data 202. If there is no difference, the differential operation is terminated. If there is a difference, the address of the first version software data 201 and the address of the second version software data 202 are transmitted to the data parsing module of the data parsing layer (i.e. Figure 4 Compression / decompression modules in .

[0187] The unpacking module can decrypt the first version software data 201 and the second version software data 202 respectively, and perform digital signature verification based on the decrypted first version software data 201 and the second version software data 202 respectively. When the decryption and verification are both passed, the first version software data 201 and the second version software data 202 are decompressed respectively. After the decompression is completed, the decompressed path is passed to the data parsing module of the data parsing layer.

[0188] The data parsing module can parse the first version software data 201 and the second version software data 202 passed into the application layer into multiple firmware files, and pass each firmware file path to the algorithm layer for differential operation. Specifically, the SOC file system images in the first version software data 201 and the second version software data 202 can be mounted to the tmp path respectively, and then the paths of the SOC file system images mounted from the first version software data 201 and the second version software data 202 are passed as parameters to the algorithm layer. The differential algorithm is used to perform differential operation on the two mounted SOC file system images, and finally the upgrade data (or differential upgrade package) is obtained.

[0189] It is understandable that during the restoration process, the data parsing module needs to combine the firmware in the first version software data 201, the firmware in the second version software data 202, and the differential result to perform a restoration together to obtain the third version software data 203. It is worth noting that when restoring the SOC file system, it is necessary to use the Linux system dd command to create a file of a specified size, use the Linux system mkfs.ext4 command to format the file created in the previous step, and then mount the formatted file to the tmp path. The existing file system content and upgrade data (differential package) in the root directory of the SOC are restored and restored to the tmp path. At this time, the tmp path is unmounted through umount to finally obtain a new file system image.

[0190] After obtaining the third-version software data 203, the upgrade data is verified to be valid using the MD5 value of the third-version software data 203 and the MD5 value of the second-version software data 202. It is understood that if the MD5 value of the third-version software data 203 matches the MD5 value of the second-version software data 202, the upgrade data is valid; otherwise, the upgrade data is invalid. If the upgrade data is invalid, the electronic device can generate new upgrade data based on the first-version software data 201 and the second-version software data 202.

[0191] Corresponding to the above-mentioned software upgrade method, control device and electronic device, an embodiment of the present application provides a vehicle, which includes the above-mentioned control device or the above-mentioned electronic device.

[0192] Corresponding to the above-mentioned software upgrade method, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the above-mentioned software upgrade method is implemented.

[0193] Corresponding to the above-mentioned software upgrade method, an embodiment of the present application provides a computer program product, which includes a computer program / instructions, and the computer program / instructions implement the above-mentioned software upgrade method when executed by a processor.

[0194] In the description of this specification, the descriptions with reference to the terms "particularly", "further", "particularly", "understandably", etc. are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms are not intended to refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0195] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0196] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A software upgrade method, characterized in that: include: Obtain upgrade data for the software to be upgraded; Creating a software image of the software to be upgraded; The software to be upgraded is upgraded according to the upgrade data and the software image.

2. The method according to claim 1, characterized in that The step of upgrading the software to be upgraded according to the upgrade data and the software image includes: Performing a first preprocessing on the upgrade data to determine the upgraded data after processing, wherein the first preprocessing includes a decryption process and / or a signature verification process; The software to be upgraded is upgraded according to the processed upgrade data and the software image.

3. The method according to claim 2, characterized in that The step of upgrading the software to be upgraded according to the processed upgrade data and the software image includes: determining an upgraded software image according to the processed upgrade data and the software image; The software to be upgraded is upgraded according to the upgraded software image.

4. The method according to claim 3, characterized in that The step of determining an upgraded software image according to the processed upgrade data and the software image includes: Create target file; Mount the target file to a preset file path; performing differential restoration processing on the processed upgrade data and the software image; Writing the result of the differential restoration processing into the target file according to the preset file path; Uninstalling the preset file path; The upgraded software image is determined according to the target file.

5. The method according to claim 1, wherein The step of obtaining the upgrade data of the software to be upgraded includes: Obtaining first version software data and second version software data of the software to be upgraded; The upgrade data is generated according to the data difference between the first version software data and the second version software data.

6. The method according to claim 5, characterized in that Generating the upgrade data according to the data difference between the first version software data and the second version software data includes: In a case where there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, the upgrade data is generated according to the data difference.

7. The method according to claim 6, characterized in that When there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, generating the upgrade data according to the data difference includes: If there is a difference between the compression mapping parameters of the first version software data and the compression mapping parameters of the second version software data, performing second preprocessing on the first version software data and the second version software data to determine processed first version software data and processed second version software data, wherein the second preprocessing includes decryption processing and / or signature verification processing; The upgrade data is generated according to the data difference between the processed first version software data and the processed second version software data.

8. The method according to claim 7, characterized in that Generating the upgrade data according to the data difference between the processed first version software data and the processed second version software data includes: Generate upgrade data to be verified based on the data differences; Performing differential restoration on the upgrade data to be verified and the processed first version software data to determine the third version software data; Verifying the upgrade data to be verified based on the third version software data; In a case where the verification is passed, the upgrade data to be verified is determined as the upgrade data.

9. The method according to claim 8, characterized in that The verifying the upgrade data to be verified based on the third version software data includes: In a case where the compression mapping parameters of the third version software data match the compression mapping parameters of the second version software data, the verification of the upgrade data to be verified is passed.

10. A control device, characterized in that: include: a transceiver unit configured to obtain upgrade data of the software to be upgraded; The processing unit is configured to create a software image of the software to be upgraded, and upgrade the software to be upgraded according to the upgrade data and the software image.

11. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 9 is implemented.

12. A vehicle, characterized in that: Includes the control device according to claim 10, or the electronic device according to claim 11.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the method according to any one of claims 1 to 9 is implemented.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.