Vehicle system upgrading method, device and apparatus

After successfully detecting the insertion and mounting of the USB flash drive, the system upgrade package on the USB flash drive is used to upgrade the vehicle system firmware, which solves the problem of vehicle system upgrades relying on the network and realizes flexible and convenient upgrades under network conditions.

CN114625398BActive Publication Date: 2025-11-11SHANGHAI PATEO ELECTRONIC EQUIPMENT MANUFACTURING CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202011467598.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-14
Publication Date
2025-11-11
Estimated Expiration
2040-12-14

AI Technical Summary

Technical Problem

In existing technologies, firmware upgrades for vehicle systems rely on mobile wireless networks or wired networks, making upgrades inconvenient and impossible to perform without a network.

Method used

After successfully detecting that the USB drive has been inserted and mounted, the system upgrade package on the USB drive is used to upgrade the vehicle system firmware, and the system firmware is upgraded directly through the USB drive.

Benefits of technology

It improves the flexibility and convenience of vehicle system firmware upgrades, overcomes the shortcomings of conventional upgrade methods, and enables system upgrades under network-free conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114625398B_ABST
    Figure CN114625398B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, and apparatus for upgrading an in-vehicle system. The method includes: upon detecting the insertion of a USB flash drive, determining the mounting result of the USB flash drive; and if the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB flash drive, performing a system firmware upgrade based on the system upgrade package in the target directory. Using the embodiments of this application can improve the flexibility of in-vehicle system firmware upgrades.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive system upgrade technology, and in particular to a method, device and apparatus for upgrading an in-vehicle system. Background Technology

[0002] With the improvement of people's living standards and the development of science and technology, more and more users are choosing cars as their means of transportation, and the car ownership rate is rapidly increasing. To ensure that the vehicle's onboard terminal system firmware is compatible with the vehicle's functions, it is necessary to regularly upgrade the firmware of the vehicle's onboard terminal system. However, the mainstream system firmware upgrade technology in China currently relies on OTA technology for mobile phones to improve functionality. This upgrade method does not adequately consider the application scenarios of the onboard system and requires reliance on mobile wireless or wired networks for upgrades, making the process extremely inconvenient. Therefore, how to upgrade the onboard system firmware without relying on a network is a critical problem that urgently needs to be solved. Summary of the Invention

[0003] This application provides a method, device, and apparatus for upgrading an in-vehicle system, which helps to improve the convenience of firmware upgrades for in-vehicle systems.

[0004] In a first aspect, embodiments of this application provide a method for upgrading an in-vehicle system, the method comprising:

[0005] If a USB flash drive is detected to be inserted, determine the mounting result of the USB flash drive;

[0006] If the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB drive, the system firmware is upgraded based on the system upgrade package in the target directory.

[0007] Secondly, embodiments of this application provide an in-vehicle system upgrade device, the device comprising:

[0008] A determining unit is used to determine the mounting result of the USB flash drive when it is detected that the USB flash drive is inserted.

[0009] The upgrade unit is used to perform a system firmware upgrade based on the system upgrade package in the target directory when the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB flash drive.

[0010] Thirdly, embodiments of this application provide a device including a processor, a memory, a communication interface, and one or more programs, wherein the communication interface is connected to the processor, the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps of the method described in the first aspect of this application.

[0011] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the method described in the first aspect of embodiments of this application.

[0012] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to perform some or all of the steps described in the method described in the first aspect of embodiments of this application. The computer program product may be a software installation package.

[0013] As can be seen from this embodiment, the device first determines the mounting result of the USB flash drive upon detecting its insertion. Then, if the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB flash drive, the device performs a system firmware upgrade based on the system upgrade package in the target directory. Since the device directly upgrades the system firmware via the USB flash drive, it overcomes the inconvenience of conventional vehicle system firmware upgrades and improves the flexibility of vehicle system firmware upgrades. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a schematic diagram of the structure of a device provided in an embodiment of this application;

[0016] Figure 2 This is a flowchart illustrating a vehicle system upgrade method provided in an embodiment of this application;

[0017] Figure 3 This is a schematic diagram of a device system partition provided in an embodiment of this application;

[0018] Figure 4 This is a schematic diagram of the structure of another device provided in an embodiment of this application;

[0019] Figure 5 This is a schematic diagram of the structure of an in-vehicle system upgrade device provided in an embodiment of this application. Detailed Implementation

[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0021] The following sections will provide detailed explanations.

[0022] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes 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 apparatuses.

[0023] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0024] The following explanations of some terms used in this application are provided to facilitate understanding by those skilled in the art.

[0025] The equipment may include a variety of handheld devices, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile station (MS), terminal device, etc.

[0026] With the widespread adoption of Android systems in in-vehicle infotainment systems, a large number of R&D personnel have devoted themselves to developing these systems, leading to the emergence of USB flash drive upgrade methods. To ensure the integrity of the burned data, the existing solution involves verifying the integrity of the upgrade package before the upgrade, but this cannot guarantee that the burned data will be consistent with the original data. Once the data is lost, it can cause abnormalities after system startup or when starting certain services.

[0027] like Figure 1 As shown, Figure 1 This is a schematic diagram of the structure of a device provided in an embodiment of this application. The device includes a processor, a memory, a signal processor, a transceiver, random access memory (RAM), a communication interface, a display, sensors, etc. The memory, signal processor, RAM, communication interface, display, and sensors are connected to the processor, and the transceiver is connected to the signal processor.

[0028] The sensor includes at least one of the following: a light sensor, a gyroscope, an infrared proximity sensor, a fingerprint sensor, a pressure sensor, etc. The light sensor, also known as an ambient light sensor, is used to detect ambient light intensity. The light sensor may include a photosensitive element and an analog-to-digital converter (ADC). The photosensitive element converts the collected light signal into an electrical signal, and the ADC converts the electrical signal into a digital signal. Optionally, the light sensor may also include a signal amplifier, which amplifies the electrical signal converted by the photosensitive element and outputs it to the ADC. The photosensitive element may include at least one of a photodiode, a phototransistor, a photoresistor, and a silicon photovoltaic cell.

[0029] The processor is the control center of the vehicle terminal. It connects various parts of the electronic device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory, and calling data stored in the memory, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole.

[0030] The processor can integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may also be omitted from the processor.

[0031] The memory stores software programs and / or modules. The processor executes various functional applications and data processing of the electronic device by running the software programs and / or modules stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, software programs required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0032] The embodiments of this application will be described in detail below.

[0033] like Figure 2The diagram shown is a flowchart of an in-vehicle system upgrade method provided in an embodiment of this application, applied to the aforementioned device, and specifically includes the following steps:

[0034] Step 201: If the insertion of the USB flash drive is detected, determine the mounting result of the USB flash drive.

[0035] The USB flash drive should be inserted when the device is powered on normally.

[0036] Step 202: If the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB flash drive, perform a system firmware upgrade based on the system upgrade package in the target directory.

[0037] The system upgrade package can be Update.zip, which is the upgrade package used for upgrading via USB flash drive.

[0038] The target directory is mounted under the root directory of the device, and the device upgrades its system firmware by reading the system upgrade package in the target directory under the root directory.

[0039] As can be seen from this embodiment, the device first determines the mounting result of the USB flash drive upon detecting its insertion. Then, if the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB flash drive, the device performs a system firmware upgrade based on the system upgrade package in the target directory. Since the device directly upgrades the system firmware via the USB flash drive, it overcomes the inconvenience of conventional vehicle system firmware upgrades and improves the flexibility of vehicle system firmware upgrades.

[0040] In one implementation of this application, determining the mounting result of the USB flash drive includes the following steps:

[0041] If a system upgrade is determined, the system enters recovery mode and displays the first information, which indicates whether a system firmware upgrade is to be performed.

[0042] Upon receiving a first operation instruction for the first information, the first directory is detected, and the first operation instruction is used to instruct a system firmware upgrade.

[0043] If it is determined that the first directory includes the target directory, it is determined that the USB flash drive is successfully mounted, and the target directory is the directory where the USB flash drive is mounted;

[0044] If it is determined that the first directory does not include the target directory, then the USB drive mounting is deemed to have failed.

[0045] The first operation instruction can be a click instruction, a voice instruction, or other instructions used to instruct the system firmware to be upgraded.

[0046] The first directory is the root directory of the device. The target directory is mounted under the first directory. The name of the root directory can be preset, / proc / mount, or a root directory with other names.

[0047] If mounting the USB drive fails, you can reset it to try mounting it again. If mounting fails again, you will be prompted to either perform a system upgrade or return to recovery mode.

[0048] After the USB drive is successfully mounted, the system checks if the system installation package exists in the target directory. If the system installation package does not exist, it returns to recovery mode or performs a system upgrade again.

[0049] In one possible implementation, determining to perform a system upgrade includes:

[0050] Determine the first version number of the system upgrade package in the USB drive, and obtain the second version number of the current system;

[0051] If the first version number is higher than the second version number, second information is displayed. The second information is used to indicate whether to perform a system upgrade. The second information includes the first version number.

[0052] Upon receiving a second operation instruction for the second information, it is determined that a system upgrade should be performed, wherein the second operation is used to instruct the system upgrade to be performed.

[0053] The device uses an upgrade detection service to detect the version number of the system upgrade package in the USB flash drive. The version number of the system upgrade package in the USB flash drive can be stored in a preset file of the system upgrade package. The preset file can be a Manifest.xml file or other files used to store the version number.

[0054] The second operation command can be a click command, a voice command, or other command to confirm the system upgrade.

[0055] As can be seen, in this embodiment, the version number of the system installation package in the USB flash drive is first detected. The system upgrade is only performed when the version number of the system installation package is higher than the version number of the system currently used by the vehicle terminal, so as to upgrade the system firmware, which helps to avoid installing a low version system.

[0056] In one implementation of this application, the system firmware upgrade based on the system upgrade package under the target directory includes the following steps:

[0057] The system firmware is upgraded to the upgrade partition based on the system upgrade package in the target directory.

[0058] When the system firmware upgrade is completed in the upgrade partition, a flag is written to a preset partition. The flag is used to indicate that if a preset situation occurs during the system firmware upgrade of the current partition of the running system, the system will run in the backup partition after restarting the system to re-upgrade the system firmware. The backup partition is the upgrade partition.

[0059] Upgrade the system firmware on the first partition, which is the partition currently running on the system.

[0060] The preset partition can be a misc partition or other partitions used to store flag bits.

[0061] The preset conditions could be a power outage, or an incomplete image file detected during the system firmware upgrade process on the first partition via the system upgrade package in the target directory.

[0062] When the system is running in the backup partition, the backup partition becomes the currently running partition, i.e., the first partition, while the first partition previously used by the system becomes the upgrade partition. In other words, if the device encounters a problem during the system firmware upgrade process using the system upgrade package in the target directory to directly upgrade the first partition, such as an incomplete image file or a power outage, the system will restart and run in the backup partition. The first partition will then be used as the upgrade partition, and the system firmware will be upgraded again using the system upgrade package in the target directory.

[0063] It can be seen that writing a flag to the preset partition helps to avoid the system failing to run properly after an abnormal situation occurs during the system firmware upgrade process.

[0064] In one implementation of this application, upgrading the upgrade partition based on the system upgrade package under the target directory includes:

[0065] Extract at least one first image file to be extracted from the system upgrade package in the target directory to obtain at least one first image file, wherein the at least one first image file to be extracted and the at least one first image file correspond one-to-one;

[0066] Integrity checks are performed on the at least one first image file to obtain a first check result;

[0067] If the first detection result indicates that the image file is complete, the at least one first image file is burned into the upgrade partition to obtain at least one first burning image file, and the at least one first image file corresponds one-to-one with the at least one first burning image file;

[0068] Perform an integrity check on the at least one first burning image file to obtain a second check result;

[0069] If the second detection result indicates that the image file is complete, extract at least one first image file to be extracted from the system upgrade package in the target directory, excluding the at least one first image file to be extracted. Repeat the above steps until all the first image files to be extracted in the system upgrade package in the target directory have been extracted. Then, extract at least one second image file to be extracted from the system upgrade package in the target directory to obtain at least one second image file. The at least one second image file to be extracted and the at least one second image file correspond one-to-one.

[0070] An integrity check is performed on the at least one second image file to obtain a third check result;

[0071] If the third detection result indicates that the image file is complete, the at least one second image file is burned into the upgrade partition to obtain at least one second burned image file, and the at least one second image file corresponds one-to-one with the at least one second burned image file;

[0072] The integrity of the at least one second burning image file is checked to obtain a fourth detection result;

[0073] If the fourth detection result indicates that the image file is complete, extract at least one second image file other than the at least one second image file to be extracted from the system upgrade package in the target directory; repeat the above until all the second image files to be extracted in the system upgrade package in the target directory have been extracted, then determine that the upgrade partition has completed the system firmware upgrade.

[0074] The first image file to be extracted may include the image file system, the image file vendor, and the image file vbmeta, and may also include other image files used for system firmware upgrades.

[0075] The second image file to be extracted may include image file dtbo and image file boot, and may also include other image files used for system firmware upgrades.

[0076] The first image file may include the image file system, the image file vendor, and the image file vbmeta, and may also include other image files used for system firmware upgrades.

[0077] The second image file may include image file dtbo and image file boot, and may also include other image files used for system firmware upgrades.

[0078] The first burning image file may include image file system, image file vendor, and image file vbmeta, and may also include other image files used for system firmware upgrades.

[0079] The second burning image file may include image file dtbo and image file boot, and may also include other image files used for system firmware upgrades.

[0080] The command for burning image files is dd.

[0081] Optionally, one first image file to be extracted can be extracted at a time, or two first image files can be extracted at a time, or five first image files can be extracted at a time, and so on, from the system upgrade package in the target directory.

[0082] For example, if there are three first image files to be extracted (#1, #2, and #3) and two second image files to be extracted (#4 and #5), firstly, extract one of the first image files, #1, to obtain the first image file #11. Then, perform an integrity check on the first image file #11. If the first image file #11 is confirmed to be intact, burn the first image file #11 to the upgrade partition to obtain the first burning image file #111. Then, burn the first burning image file #111... If the original image file is intact, extract another first image file #2 and #3 to be extracted, resulting in first image file #22 and first image file #33. Perform integrity checks on both first image file #22 and #33. If both first image file #22 and #33 are confirmed to be intact, burn them to the upgrade partition, resulting in burning image file #222 and burning image file #333. Integrity checks are performed on both image files #222 and #333. If both image files #222 and #333 are confirmed to be complete, the second image file #4 is extracted, resulting in second image file #44. Integrity checks are then performed on second image file #44. If second image file #44 is confirmed to be complete, it is burned to the upgrade partition, resulting in second image file #444. Integrity checks are then performed on second image file #444. If second image file #444 is confirmed to be complete, the second image file #5 is extracted, resulting in second image file #55. Integrity checks are then performed on second image file #55. If second image file #55 is confirmed to be complete, it is burned to the upgrade partition, resulting in second image file #555. Integrity checks are then performed on second image file #555. If second image file #555 is confirmed to be complete, the system firmware upgrade is complete.

[0083] Optionally, the first image file to be extracted includes image file system, image file vendor, image file vbmeta, image file dtbo, image file boot, and other image files used for system firmware upgrades. The system firmware can be upgraded based on the first image file to be extracted using the above system firmware upgrade method.

[0084] As can be seen, in this embodiment of the application, the image file to be extracted is obtained, and the integrity of the image file is checked. If the image file is intact, the image file is burned to the upgrade partition to obtain the burned image file. The integrity of the burned image file is then checked to avoid data loss during the extraction or burning process, which helps to ensure the integrity of the data.

[0085] In one implementation of this application, the system firmware upgrade of the first partition includes the following steps:

[0086] The first burning image file and the second burning image file in the upgrade partition are burned to the first partition to obtain a third burning image file. Each first burning image file corresponds to one third burning image file, and each second burning image file corresponds to one third burning image file.

[0087] The integrity of the third burned image file is checked to obtain the fifth check result;

[0088] If the fifth detection result indicates that the image file is complete, clear the flag bit and restart the system to enter the normal boot process. Clearing the flag bit indicates that the system firmware upgrade of the first partition is complete.

[0089] The third burning image file includes image file system, image file vendor, image file vbmeta, image file dtbo, image file boot, and other image files used for system firmware upgrades.

[0090] Among them, such as Figure 3 The diagram shows the device system partitioning, where partition 1 is the first partition and partition 2 is the upgrade partition.

[0091] The first burning image file is located in the same position in the upgrade partition as the third burning image file is located in the first partition, and the first burning image file corresponds to the third burning image file.

[0092] As can be seen, in this embodiment of the application, clearing the flag bit after the system firmware upgrade of the first partition is completed helps to avoid the system restarting and re-entering recovery mode to perform system firmware upgrade.

[0093] In one implementation of this application, the system firmware upgrade of the first partition includes the following steps:

[0094] The first partition is identified as the upgrade partition, and the system firmware is upgraded on the upgrade partition;

[0095] Once the system firmware upgrade of the upgrade partition is complete, clear the flag bit and restart the system to enter the normal boot process. Clearing the flag bit indicates that the system firmware upgrade of the upgrade partition is complete.

[0096] The first partition is designated as the upgrade partition, which is used to upgrade the system firmware of the first partition using the system upgrade package in the target directory.

[0097] During the upgrade process, if the image file is found to be incomplete, the system will be restarted and run on the backup partition (the backup partition becomes the currently running partition) to re-upgrade the system firmware on the upgrade partition.

[0098] As can be seen from the embodiments of this application, clearing the flag bit after the system firmware upgrade of the first partition is completed helps to avoid the system restarting and re-entering recovery mode to make the backup partition the currently running partition for system firmware upgrade.

[0099] In one implementation of this application, the detection result is determined by performing a first process on S target image files and the system upgrade package in the target directory, where S is a positive integer;

[0100] The first process includes the following steps:

[0101] Determine the sub-target image file from the S target image files;

[0102] Determine the first MD5 value of the sub-target image file;

[0103] Based on the sub-target image file, obtain the preset MD5 value from the first file of the system upgrade package in the target directory;

[0104] If the first MD5 value is the same as the preset MD5 value, a sub-target image file is determined from the target image files other than the sub-target image file in the S target image files; the above steps are repeated until each of the target image files in the S target image files is determined to be the sub-target image file, and the detection result is determined to be that the image file is complete;

[0105] If the first MD5 value is different from the preset MD5 value, the detection result is determined to be that the image file is incomplete.

[0106] The target image file can be a first image file, a second image file, a first burning image file, or a second burning image file.

[0107] The sub-target image file can be determined based on the position of the S target image files in the upgrade partition and / or the first partition, or it can be determined based on a preset order among the S target image files, or it can be determined randomly among the S target image files.

[0108] For example, if there are three target image files (A, B, and C), and target image file A is located before target image file B, and target image file B is located before target image file C, then the sub-target image files can be determined according to the principle of position from front to back. That is, first determine target image file A as a sub-target image file, then determine target image file B as a sub-target image file, and finally determine target image file C as a sub-target image file.

[0109] For example, if there are three target image files (A, B, and C), firstly, target image file A is identified as a sub-target image file. If the MD5 value of target image file A is different from the MD5 value of target image file A stored in the first file, the detection result is determined to be an incomplete image file. If the MD5 value of target image file A is the same as the MD5 value of target image file A stored in the first file, then target image file B is identified as a sub-target image file. If the MD5 value of target image file B is different from the MD5 value of target image file B stored in the first file, the detection result is determined to be an incomplete image file. If the MD5 value of target image file B is the same as the MD5 value of target image file B stored in the first file, then target image file C is identified as a sub-target image file. If the MD5 value of target image file C is different from the MD5 value of target image file C stored in the first file, the detection result is determined to be an incomplete image file. If the MD5 value of target image file C is the same as the MD5 value of target image file C stored in the first file, the detection result is determined to be a complete image file.

[0110] Optionally, the first file is obtained by the first electronic device performing a second processing on the second system upgrade package;

[0111] The second process includes the following steps: compiling the second system upgrade package, and during the compilation of the second system upgrade package, creating a third directory under the second directory, and copying the first image file to be copied and the second image file to be copied generated in the fifth directory under the fourth directory to the third directory, so as to obtain the first image file to be extracted and the second image file to be extracted. The second directory includes the third directory and the fourth directory.

[0112] Convert the data type of the third image file to be extracted to the target data type, wherein the first image file to be extracted includes the third image file to be extracted;

[0113] Determine the preset MD5 value of the first image file to be extracted, and determine the preset MD5 value of the second image file to be extracted;

[0114] The preset MD5 value of the first image file to be extracted and the preset MD5 value of the second image file to be extracted are stored in a storage file to obtain the first file.

[0115] The first electronic device can be a server, a cloud platform, or other computer equipment capable of generating system installation packages.

[0116] The second system upgrade package can be an OTA upgrade package.

[0117] The second directory is the root directory of the first electronic device. The name of the root directory can be "out" or any other name.

[0118] The name of the third directory can be preset or IMAGES; the name of the fourth directory can be preset or target_files_intermediates; and the name of the fifth directory can be preset or IMAGES.

[0119] The first image file to be copied may include the image file system, the image file vendor, and the image file vbmeta, and may also include other image files used for system firmware upgrades; the second image file to be copied may include the image file dtbo and the image file boot, and may also include other image files used for system firmware upgrades.

[0120] The third image file to be copied may include the image file system and the image file vendor, and may include other image files used for system firmware upgrades.

[0121] The image file is an img file.

[0122] The data type of the third image file to be extracted is Android sparse image, and the target data type is Linux rev 1.0ext2 filesystem data.

[0123] Specifically, the simg2img command is used to change the data type of the third image file to be extracted to the target data type, that is, to convert the vendor.img file to the vendor_raw.img file and the system.img file to the system_raw.img file.

[0124] As can be seen, in this embodiment of the application, pre-determining the MD5 values ​​of the first and second image files to be extracted is beneficial for performing integrity checks on the image files after reading and burning, thus ensuring the integrity of the data.

[0125] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the first image file, or the target image file is the first burning image file, and the detection result indicates that the image file is incomplete, the method further includes the following steps:

[0126] Displaying third information, the third information including at least one of the following: re-upgrading the system firmware; returning to recovery mode; burning the first image file in the first partition to the backup partition;

[0127] Upon receiving a third operation instruction for the third information, wherein the third operation instruction is used to instruct re-enter the system upgrade process, a system upgrade is determined to be performed.

[0128] Upon receiving a fourth operation instruction for the third information, wherein the fourth operation instruction indicates a return to recovery mode, the system returns to recovery mode.

[0129] Upon receiving a fifth operation instruction for the third information, wherein the fifth operation instruction is used to instruct the first image file in the first partition to be burned to the backup partition, the system is restarted after the first image file in the first partition is burned to the backup partition and the first image file in the first partition is burned to the backup partition, so as to enter the normal boot process and suspend the system firmware upgrade.

[0130] The first partition is the currently running partition of the system, and the backup partition is the upgrade partition where the system firmware upgrade is currently underway.

[0131] The third, fourth, and fifth operation instructions can be the same or different. The third, fourth, and fifth operation instructions can all be click instructions, or they can be partly click instructions, partly voice instructions, and partly other selection instructions.

[0132] Specifically, the first image files system, vendor, and bmeta in the first partition are burned to the backup partition.

[0133] As can be seen, when the detection result indicates that the image file is incomplete, not only can the vehicle terminal be operated according to user needs to improve user satisfaction, but the data in the backup partition can also be repaired to improve data integrity.

[0134] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the second image file, or the target image file is the second burning image file, and the detection result indicates that the image file is incomplete, the method further includes the following steps:

[0135] Display a fourth message, which indicates a system upgrade error and includes re-upgrading the system and / or returning to recovery mode;

[0136] Upon receiving a sixth operation instruction for the fourth information, wherein the sixth operation instruction is used to instruct a system upgrade to be performed again, it is determined to perform a system upgrade.

[0137] Upon receiving a seventh operation instruction for the fourth information, which indicates a return to recovery mode, the system returns to recovery mode.

[0138] The sixth and seventh operation instructions can be the same or different. The sixth and seventh operation instructions can both be click instructions, or the sixth operation instruction can be a click instruction and the seventh operation instruction can be a voice instruction, and so on.

[0139] The first partition is the currently running partition, and the backup partition is the upgrade partition that is currently undergoing system firmware upgrade.

[0140] It can be seen that when the detection result shows that the image file is incomplete, the vehicle terminal can be operated according to user needs, thereby improving user satisfaction.

[0141] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the third burning image file, and the fifth detection result indicates that the image file is incomplete, the method further includes the following steps:

[0142] The fifth message includes at least one of the following: perform a system upgrade again; return to recovery mode; burn the first burning image file and the second burning image file in the backup partition to the first partition;

[0143] Upon receiving an eighth operation instruction for the fifth information, wherein the eighth operation instruction is used to instruct re-enter the system upgrade process, a system upgrade is determined to be performed.

[0144] Upon receiving a ninth operation instruction for the fifth information, wherein the ninth operation instruction indicates a return to recovery mode, the system returns to recovery mode.

[0145] Upon receiving a tenth operation instruction for the fifth information, wherein the tenth operation instruction instructs the first burning image file and the second burning image file in the backup partition to be burned to the first partition, the first burning image file and the second burning image file in the backup partition are burned to the first partition to obtain a fourth burning image file, and the fourth burning image file is determined to be the third burning image file.

[0146] The eighth, ninth, and tenth operation instructions may be the same or different. The eighth, ninth, and tenth operation instructions may all be click instructions, or some may be click instructions, some may be voice instructions, and some may be other selection instructions.

[0147] After determining that the fourth burning image file is the third burning image file, the integrity of the third burning image file is checked again.

[0148] As can be seen, when the detection result indicates that the image file is incomplete, not only can the vehicle terminal be operated according to user needs to improve user satisfaction, but the system firmware of the current partition can also be upgraded to improve data integrity.

[0149] With the above Figure 2 The embodiments shown are consistent; please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic diagram of another device provided in an embodiment of this application. As shown in the figure, the device includes a processor, a memory, a communication interface, and one or more programs. The communication interface is connected to the processor, and the one or more programs are stored in the memory and configured to be executed by the processor. The programs include instructions for performing the following steps:

[0150] If a USB flash drive is detected to be inserted, determine the mounting result of the USB flash drive;

[0151] If the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB drive, the system firmware is upgraded based on the system upgrade package in the target directory.

[0152] In one implementation of this application, the above program is specifically used to execute the following instructions in determining the mounting result of the USB flash drive:

[0153] If a system upgrade is determined, the system enters recovery mode and displays the first information, which indicates whether a system firmware upgrade is to be performed.

[0154] Upon receiving a first operation instruction for the first information, the first directory is detected, and the first operation instruction is used to instruct a system firmware upgrade.

[0155] If it is determined that the first directory includes the target directory, it is determined that the USB flash drive is successfully mounted, and the target directory is the directory where the USB flash drive is mounted;

[0156] If it is determined that the first directory does not include the target directory, then the USB drive mounting is deemed to have failed.

[0157] In one implementation of this application, the above procedure is specifically used to execute instructions for the following steps in determining whether to perform a system upgrade:

[0158] Determine the first version number of the system upgrade package in the USB drive, and obtain the second version number of the current system;

[0159] If the first version number is higher than the second version number, second information is displayed. The second information is used to indicate whether to perform a system upgrade. The second information includes the first version number.

[0160] Upon receiving a second operation instruction for the second information, it is determined that a system upgrade should be performed, wherein the second operation is used to instruct the system upgrade to be performed.

[0161] In one implementation of this application, regarding system firmware upgrades based on system upgrade packages under the target directory, the above program is specifically used to execute instructions for the following steps:

[0162] The system firmware is upgraded to the upgrade partition based on the system upgrade package in the target directory.

[0163] When the system firmware upgrade is completed in the upgrade partition, a flag is written to a preset partition. The flag is used to indicate that if a preset situation occurs during the system firmware upgrade of the current partition of the running system, the system will run in the backup partition after restarting the system to re-upgrade the system firmware. The backup partition is the upgrade partition.

[0164] Upgrade the system firmware on the first partition, which is the partition currently running on the system.

[0165] In one implementation of this application, regarding upgrading the upgrade partition based on the system upgrade package under the target directory, the above program is specifically used to execute the following instructions:

[0166] Extract at least one first image file to be extracted from the system upgrade package in the target directory to obtain at least one first image file, wherein the at least one first image file to be extracted and the at least one first image file correspond one-to-one;

[0167] Integrity checks are performed on the at least one first image file to obtain a first check result;

[0168] If the first detection result indicates that the image file is complete, the at least one first image file is burned into the upgrade partition to obtain at least one first burning image file, and the at least one first image file corresponds one-to-one with the at least one first burning image file;

[0169] Perform an integrity check on the at least one first burning image file to obtain a second check result;

[0170] If the second detection result indicates that the image file is complete, extract at least one first image file to be extracted from the system upgrade package in the target directory, excluding the at least one first image file to be extracted. Repeat the above steps until all the first image files to be extracted in the system upgrade package in the target directory have been extracted. Then, extract at least one second image file to be extracted from the system upgrade package in the target directory to obtain at least one second image file. The at least one second image file to be extracted and the at least one second image file correspond one-to-one.

[0171] An integrity check is performed on the at least one second image file to obtain a third check result;

[0172] If the third detection result indicates that the image file is complete, the at least one second image file is burned into the upgrade partition to obtain at least one second burned image file, and the at least one second image file corresponds one-to-one with the at least one second burned image file;

[0173] The integrity of the at least one second burning image file is checked to obtain a fourth detection result;

[0174] If the fourth detection result indicates that the image file is complete, extract at least one second image file other than the at least one second image file to be extracted from the system upgrade package in the target directory; repeat the above until all the second image files to be extracted in the system upgrade package in the target directory have been extracted, then determine that the upgrade partition has completed the system firmware upgrade.

[0175] In one implementation of this application, regarding the system firmware upgrade of the first partition, the above-mentioned program is specifically used to execute instructions for the following steps:

[0176] The first burning image file and the second burning image file in the upgrade partition are burned to the first partition to obtain a third burning image file. Each first burning image file corresponds to one third burning image file, and each second burning image file corresponds to one third burning image file.

[0177] The integrity of the third burned image file is checked to obtain the fifth check result;

[0178] If the fifth detection result indicates that the image file is complete, clear the flag bit and restart the system to enter the normal boot process. Clearing the flag bit indicates that the system firmware upgrade of the first partition is complete.

[0179] In one implementation of this application, regarding the system firmware upgrade of the first partition, the above-mentioned program is specifically used to execute instructions for the following steps:

[0180] The first partition is identified as the upgrade partition, and the system firmware is upgraded on the upgrade partition;

[0181] Once the system firmware upgrade of the upgrade partition is complete, clear the flag bit and restart the system to enter the normal boot process. Clearing the flag bit indicates that the system firmware upgrade of the upgrade partition is complete.

[0182] In one implementation of this application, the detection result is determined by performing a first process on S target image files and the system upgrade package in the target directory, where S is a positive integer;

[0183] The first process includes the following steps:

[0184] Determine the sub-target image file from the S target image files;

[0185] Determine the first MD5 value of the sub-target image file;

[0186] Based on the sub-target image file, obtain the preset MD5 value from the first file of the system upgrade package in the target directory;

[0187] If the first MD5 value is the same as the preset MD5 value, a sub-target image file is determined from the target image files other than the sub-target image file in the S target image files; the above steps are repeated until each of the target image files in the S target image files is determined to be the sub-target image file, and the detection result is determined to be that the image file is complete;

[0188] If the first MD5 value is different from the preset MD5 value, the detection result is determined to be that the image file is incomplete.

[0189] In one implementation of this application, when the target image file is the first image file, S is equal to the number of first image files in the at least one first image file, and the detection result is the first detection result;

[0190] When the target image file is the first burning image file, S is equal to the number of first burning image files in the at least one first burning image file, and the detection result is the second detection result;

[0191] When the target image file is the second image file, S is equal to the number of second image files in the at least one second image file, and the detection result is the third detection result;

[0192] When the target image file is the second burning image file, S is equal to the number of second burning image files in the at least one second burning image file, and the detection result is the fourth detection result;

[0193] When the target image file is a third burning image file, S is equal to the number of the third burning image files, and the detection result is the fifth detection result.

[0194] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the first image file, or the target image file is the first burning image file, and the detection result indicates that the image file is incomplete, the above program is specifically used to execute the following instructions:

[0195] Displaying third information, the third information including at least one of the following: re-upgrading the system firmware; returning to recovery mode; burning the first image file in the first partition to the backup partition;

[0196] Upon receiving a third operation instruction for the third information, wherein the third operation instruction is used to instruct re-enter the system upgrade process, a system upgrade is determined to be performed.

[0197] Upon receiving a fourth operation instruction for the third information, wherein the fourth operation instruction indicates a return to recovery mode, the system returns to recovery mode.

[0198] Upon receiving a fifth operation instruction for the third information, wherein the fifth operation instruction is used to instruct the first image file in the first partition to be burned to the backup partition, the system is restarted after the first image file in the first partition is burned to the backup partition and the first image file in the first partition is burned to the backup partition, so as to enter the normal boot process and suspend the system firmware upgrade.

[0199] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the second image file, or the target image file is the second burning image file, and the detection result indicates that the image file is incomplete, the above program is specifically used to execute the following instructions:

[0200] Display a fourth message, which indicates a system upgrade error and includes re-upgrading the system and / or returning to recovery mode;

[0201] Upon receiving a sixth operation instruction for the fourth information, wherein the sixth operation instruction is used to instruct a system upgrade to be performed again, it is determined to perform a system upgrade.

[0202] Upon receiving a seventh operation instruction for the fourth information, which indicates a return to recovery mode, the system returns to recovery mode.

[0203] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the third burning image file, and the fifth detection result indicates that the image file is incomplete, the above program is specifically used to execute the following instructions:

[0204] The fifth message includes at least one of the following: perform a system upgrade again; return to recovery mode; burn the first burning image file and the second burning image file in the backup partition to the first partition;

[0205] Upon receiving an eighth operation instruction for the fifth information, wherein the eighth operation instruction is used to instruct re-enter the system upgrade process, a system upgrade is determined to be performed.

[0206] Upon receiving a ninth operation instruction for the fifth information, wherein the ninth operation instruction indicates a return to recovery mode, the system returns to recovery mode.

[0207] Upon receiving a tenth operation instruction for the fifth information, wherein the tenth operation instruction instructs the first burning image file and the second burning image file in the backup partition to be burned to the first partition, the first burning image file and the second burning image file in the backup partition are burned to the first partition to obtain a fourth burning image file, and the fourth burning image file is determined to be the third burning image file.

[0208] It should be noted that the specific implementation process of this embodiment can be found in the specific implementation process described in the above method embodiments, and will not be described again here.

[0209] Please see Figure 5 , Figure 5 This is a schematic diagram of a vehicle system upgrade device provided in an embodiment of this application, applied to the aforementioned equipment. The device includes:

[0210] The determining unit 501 is used to determine the mounting result of the USB flash drive when the insertion of the USB flash drive is detected;

[0211] Upgrade unit 502 is used to perform system firmware upgrade based on the system upgrade package in the target directory when the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB flash drive.

[0212] In one possible implementation, the vehicle system upgrade device further includes a display unit 503.

[0213] In one implementation of this application, the determining unit 501 is used to execute the following instructions in determining the mounting result of the USB flash drive:

[0214] If a system upgrade is required, enter recovery mode;

[0215] The above-mentioned display unit 503 is used to execute the instructions for the following steps:

[0216] Display the first information, which indicates whether to perform a system firmware upgrade;

[0217] The aforementioned determining unit 501 is used to execute the instructions for the following steps:

[0218] Upon receiving a first operation instruction for the first information, the first directory is detected, and the first operation instruction is used to instruct a system firmware upgrade.

[0219] If it is determined that the first directory includes the target directory, it is determined that the USB flash drive is successfully mounted, and the target directory is the directory where the USB flash drive is mounted;

[0220] If it is determined that the first directory does not include the target directory, then the USB drive mounting is deemed to have failed.

[0221] In one implementation of this application, the determining unit 501 is used to execute instructions for the following steps in determining whether to perform a system upgrade:

[0222] Determine the first version number of the system upgrade package in the USB drive, and obtain the second version number of the current system;

[0223] The above-mentioned display unit 503 is used to execute the instructions for the following steps:

[0224] If the first version number is higher than the second version number, second information is displayed. The second information is used to indicate whether to perform a system upgrade. The second information includes the first version number.

[0225] The aforementioned determining unit 501 is used to execute the instructions for the following steps:

[0226] Upon receiving a second operation instruction for the second information, it is determined that a system upgrade should be performed, wherein the second operation is used to instruct the system upgrade to be performed.

[0227] In one implementation of this application, regarding system firmware upgrades based on system upgrade packages under the target directory, the upgrade unit 502 is configured to execute the following instructions:

[0228] The system firmware is upgraded to the upgrade partition based on the system upgrade package in the target directory.

[0229] When the system firmware upgrade is completed in the upgrade partition, a flag is written to a preset partition. The flag is used to indicate that if a preset situation occurs during the system firmware upgrade of the current partition of the running system, the system will run in the backup partition after restarting the system to re-upgrade the system firmware. The backup partition is the upgrade partition.

[0230] Upgrade the system firmware on the first partition, which is the partition currently running on the system.

[0231] In one implementation of this application, regarding upgrading the upgrade partition based on the system upgrade package under the target directory, the upgrade unit 502 is configured to execute the following instructions:

[0232] Extract at least one first image file to be extracted from the system upgrade package in the target directory to obtain at least one first image file, wherein the at least one first image file to be extracted and the at least one first image file correspond one-to-one;

[0233] Integrity checks are performed on the at least one first image file to obtain a first check result;

[0234] If the first detection result indicates that the image file is complete, the at least one first image file is burned into the upgrade partition to obtain at least one first burning image file, and the at least one first image file corresponds one-to-one with the at least one first burning image file;

[0235] Perform an integrity check on the at least one first burning image file to obtain a second check result;

[0236] If the second detection result indicates that the image file is complete, extract at least one first image file to be extracted from the system upgrade package in the target directory, excluding the at least one first image file to be extracted. Repeat the above steps until all the first image files to be extracted in the system upgrade package in the target directory have been extracted. Then, extract at least one second image file to be extracted from the system upgrade package in the target directory to obtain at least one second image file. The at least one second image file to be extracted and the at least one second image file correspond one-to-one.

[0237] An integrity check is performed on the at least one second image file to obtain a third check result;

[0238] If the third detection result indicates that the image file is complete, the at least one second image file is burned into the upgrade partition to obtain at least one second burned image file, and the at least one second image file corresponds one-to-one with the at least one second burned image file;

[0239] The integrity of the at least one second burning image file is checked to obtain a fourth detection result;

[0240] If the fourth detection result indicates that the image file is complete, extract at least one second image file other than the at least one second image file to be extracted from the system upgrade package in the target directory; repeat the above until all the second image files to be extracted in the system upgrade package in the target directory have been extracted, then determine that the upgrade partition has completed the system firmware upgrade.

[0241] In one implementation of this application, in upgrading the system firmware of the first partition, the upgrade unit 502 is configured to execute the following instructions:

[0242] The first burning image file and the second burning image file in the upgrade partition are burned to the first partition to obtain a third burning image file. Each first burning image file corresponds to one third burning image file, and each second burning image file corresponds to one third burning image file.

[0243] The integrity of the third burned image file is checked to obtain the fifth check result;

[0244] If the fifth detection result indicates that the image file is complete, clear the flag bit and restart the system to enter the normal boot process. Clearing the flag bit indicates that the system firmware upgrade of the first partition is complete.

[0245] In one implementation of this application, in upgrading the system firmware of the first partition, the upgrade unit 502 is configured to execute the following instructions:

[0246] The first partition is identified as the upgrade partition, and the system firmware is upgraded on the upgrade partition;

[0247] Once the system firmware upgrade of the upgrade partition is complete, clear the flag bit and restart the system to enter the normal boot process. Clearing the flag bit indicates that the system firmware upgrade of the upgrade partition is complete.

[0248] In one implementation of this application, the detection result is determined by performing a first process on S target image files and the system upgrade package in the target directory, where S is a positive integer;

[0249] The first process includes the following steps:

[0250] Determine the sub-target image file from the S target image files;

[0251] Determine the first MD5 value of the sub-target image file;

[0252] Based on the sub-target image file, obtain the preset MD5 value from the first file of the system upgrade package in the target directory;

[0253] If the first MD5 value is the same as the preset MD5 value, a sub-target image file is determined from the target image files other than the sub-target image file in the S target image files; the above steps are repeated until each of the target image files in the S target image files is determined to be the sub-target image file, and the detection result is determined to be that the image file is complete;

[0254] If the first MD5 value is different from the preset MD5 value, the detection result is determined to be that the image file is incomplete.

[0255] In one implementation of this application, when the target image file is the first image file, S is equal to the number of first image files in the at least one first image file, and the detection result is the first detection result;

[0256] When the target image file is the first burning image file, S is equal to the number of first burning image files in the at least one first burning image file, and the detection result is the second detection result;

[0257] When the target image file is the second image file, S is equal to the number of second image files in the at least one second image file, and the detection result is the third detection result;

[0258] When the target image file is the second burning image file, S is equal to the number of second burning image files in the at least one second burning image file, and the detection result is the fourth detection result;

[0259] When the target image file is a third burning image file, S is equal to the number of the third burning image files, and the detection result is the fifth detection result.

[0260] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the first image file, or the target image file is the first burning image file, and the detection result indicates that the image file is incomplete, the display unit 503 is further configured to execute the following instructions:

[0261] Displaying third information, the third information including at least one of the following: re-upgrading the system firmware; returning to recovery mode; burning the first image file in the first partition to the backup partition;

[0262] Upon receiving a third operation instruction for the third information, wherein the third operation instruction is used to instruct re-enter the system upgrade process, a system upgrade is determined to be performed.

[0263] Upon receiving a fourth operation instruction for the third information, wherein the fourth operation instruction indicates a return to recovery mode, the system returns to recovery mode.

[0264] Upon receiving a fifth operation instruction for the third information, wherein the fifth operation instruction is used to instruct the first image file in the first partition to be burned to the backup partition, the system is restarted after the first image file in the first partition is burned to the backup partition and the first image file in the first partition is burned to the backup partition, so as to enter the normal boot process and suspend the system firmware upgrade.

[0265] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the second image file, or the target image file is the second burning image file, and the detection result indicates that the image file is incomplete, the display unit 503 is further configured to execute the following instructions:

[0266] Display a fourth message, which indicates a system upgrade error and includes re-upgrading the system and / or returning to recovery mode;

[0267] Upon receiving a sixth operation instruction for the fourth information, wherein the sixth operation instruction is used to instruct a system upgrade to be performed again, it is determined to perform a system upgrade.

[0268] Upon receiving a seventh operation instruction for the fourth information, which indicates a return to recovery mode, the system returns to recovery mode.

[0269] In one implementation of this application, when the upgrade partition is a backup partition, the target image file is the third burning image file, and the fifth detection result indicates that the image file is incomplete, the display unit 503 is further configured to execute the following instructions:

[0270] The fifth message includes at least one of the following: perform a system upgrade again; return to recovery mode; burn the first burning image file and the second burning image file in the backup partition to the first partition;

[0271] Upon receiving an eighth operation instruction for the fifth information, wherein the eighth operation instruction is used to instruct re-enter the system upgrade process, a system upgrade is determined to be performed.

[0272] Upon receiving a ninth operation instruction for the fifth information, wherein the ninth operation instruction indicates a return to recovery mode, the system returns to recovery mode.

[0273] Upon receiving a tenth operation instruction for the fifth information, wherein the tenth operation instruction instructs the first burning image file and the second burning image file in the backup partition to be burned to the first partition, the first burning image file and the second burning image file in the backup partition are burned to the first partition to obtain a fourth burning image file, and the fourth burning image file is determined to be the third burning image file.

[0274] It should be noted that the determining unit 501 and the upgrading unit 502 can be implemented by a processor, and the display unit 503 can be implemented by a display.

[0275] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the electronic device of the above method embodiments.

[0276] This application also provides a computer program product, comprising a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the electronic device section of the above-described method. This computer program product may be a software installation package.

[0277] The steps of the methods or algorithms described in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Furthermore, the ASIC can reside in an access network device, a target network device, or a core network device. Alternatively, the processor and storage medium can exist as discrete components in the access network device, the target network device, or the core network device.

[0278] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in the embodiments of this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).

[0279] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above descriptions are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A method for upgrading an in-vehicle system, characterized in that, The method includes the following steps: If a USB flash drive is detected to be inserted, determine the mounting result of the USB flash drive; If the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB drive, a system firmware upgrade is performed based on the system upgrade package in the target directory. Specifically, at least one first image file to be extracted is extracted from the system upgrade package in the target directory, resulting in at least one first image file. The at least one first image file to be extracted and the at least one first image file correspond one-to-one. An integrity check is performed on the at least one first image file to obtain a first check result. If the first check result indicates that the image file is complete, the at least one first image file is burned to the upgrade partition, resulting in at least one first burned image file. The at least one first image file corresponds one-to-one with the at least one first burned image file. An integrity check is performed on the at least one first burned image file to obtain a second check result. If the second check result indicates that the image file is complete, at least one first image file other than the at least one first image file to be extracted is extracted from the system upgrade package in the target directory. The above steps are repeated until the system firmware upgrade package in the target directory is complete. If all the first image files to be extracted in the system upgrade package have been extracted, at least one second image file to be extracted is extracted from the system upgrade package in the target directory, resulting in at least one second image file. The at least one second image file to be extracted and the at least one second image file correspond one-to-one. An integrity check is performed on the at least one second image file to obtain a third check result. If the third check result indicates that the image file is complete, the at least one second image file is burned into the upgrade partition to obtain at least one second burned image file. The at least one second image file corresponds one-to-one with the at least one second burned image file. An integrity check is performed on the at least one second burned image file to obtain a fourth check result. If the fourth check result indicates that the image file is complete, at least one second image file to be extracted (excluding the at least one second image file to be extracted) is extracted from the system upgrade package in the target directory. This process is repeated until all the second image files to be extracted in the system upgrade package in the target directory have been extracted, at which point the upgrade partition is confirmed to have completed the system firmware upgrade. The first file of the system upgrade package in the target directory includes a preset MD5 value. The first file is obtained by the first electronic device performing a second processing on the second system upgrade package. The preset MD5 value is used for integrity detection. The second process includes the following steps: compiling the second system upgrade package, and during the compilation of the second system upgrade package, creating a third directory under the second directory, and copying the first image file to be copied and the second image file to be copied generated in the fifth directory under the fourth directory to the third directory, so as to obtain the first image file to be extracted and the second image file to be extracted. The second directory includes the third directory and the fourth directory. Convert the data type of the third image file to be extracted to the target data type, wherein the first image file to be extracted includes the third image file to be extracted; Determine the preset MD5 value of the first image file to be extracted, and determine the preset MD5 value of the second image file to be extracted; The preset MD5 value of the first image file to be extracted and the preset MD5 value of the second image file to be extracted are stored in a storage file to obtain the first file.

2. The method according to claim 1, wherein, Determining the mounting result of the USB flash drive includes the following steps: If a system upgrade is determined, the system enters recovery mode and displays the first information, which indicates whether a system firmware upgrade is to be performed. Upon receiving a first operation instruction for the first information, the first directory is detected, and the first operation instruction is used to instruct a system firmware upgrade. If it is determined that the first directory includes the target directory, then the USB drive is successfully mounted, and the target directory is the directory where the USB drive is mounted. If it is determined that the first directory does not include the target directory, then the USB drive mounting is deemed to have failed.

3. The method according to claim 2, wherein, The determination to perform a system upgrade includes: Determine the first version number of the system upgrade package in the USB drive, and obtain the second version number of the current system; If the first version number is higher than the second version number, second information is displayed. The second information is used to indicate whether to perform a system upgrade. The second information includes the first version number. Upon receiving a second operation instruction for the second information, it is determined that a system upgrade should be performed, wherein the second operation is used to instruct the system upgrade to be performed.

4. The method according to claim 1, characterized in that, The upgrade partition is upgraded based on the system upgrade package under the target directory, including: The system firmware is upgraded to the upgrade partition based on the system upgrade package in the target directory. When the system firmware upgrade is completed in the upgrade partition, a flag is written to a preset partition. The flag is used to indicate that if a preset situation occurs during the system firmware upgrade of the current partition of the running system, the system will run in the backup partition after restarting the system to re-upgrade the system firmware. The backup partition is the upgrade partition. Upgrade the system firmware on the first partition, which is the partition currently running on the system.

5. The method according to claim 4, wherein, The system firmware upgrade of the first partition includes the following steps: The first burning image file and the second burning image file in the upgrade partition are burned to the first partition to obtain a third burning image file. Each first burning image file corresponds to one third burning image file, and each second burning image file corresponds to one third burning image file. The integrity of the third burned image file is checked to obtain the fifth check result; If the fifth detection result indicates that the image file is complete, clear the flag bit and restart the system to enter the normal boot process. Clearing the flag bit indicates that the system firmware upgrade of the first partition is complete.

6. The method according to claim 4, wherein, The system firmware upgrade of the first partition includes the following steps: The first partition is identified as the upgrade partition, and the system firmware is upgraded on the upgrade partition; Once the system firmware upgrade of the upgrade partition is complete, clear the flag bit and restart the system to enter the normal boot process. Clearing the flag bit indicates that the system firmware upgrade of the upgrade partition is complete.

7. The method according to claim 5 or 6, wherein, The detection result is determined by performing a first process on S target image files and the system upgrade package in the target directory, where S is a positive integer; The first process includes the following steps: Determine the sub-target image file from the S target image files; Determine the first MD5 value of the sub-target image file; Based on the sub-target image file, obtain the preset MD5 value from the first file of the system upgrade package in the target directory; If the first MD5 value is the same as the preset MD5 value, a sub-target image file is determined from the target image files other than the sub-target image file in the S target image files; the above steps are repeated until each of the target image files in the S target image files is determined to be the sub-target image file, and the detection result is determined to be that the image file is complete; If the first MD5 value is different from the preset MD5 value, the detection result is determined to be that the image file is incomplete.

8. The method according to claim 7, wherein, When the target image file is the first image file, S is equal to the number of first image files in the at least one first image file, and the detection result is the first detection result; When the target image file is the first burning image file, S is equal to the number of first burning image files in the at least one first burning image file, and the detection result is the second detection result; When the target image file is the second image file, S is equal to the number of second image files in the at least one second image file, and the detection result is the third detection result; When the target image file is the second burning image file, S is equal to the number of second burning image files in the at least one second burning image file, and the detection result is the fourth detection result; When the target image file is a third burning image file, S is equal to the number of the third burning image files, and the detection result is the fifth detection result.

9. The method according to claim 8, wherein, If the upgrade partition is a backup partition, the target image file is the first image file, or the target image file is the first burning image file, and the detection result indicates that the image file is incomplete, the method further includes the following steps: Displaying third information, the third information including at least one of the following: re-upgrading the system firmware; returning to recovery mode; burning the first image file in the first partition to the backup partition; Upon receiving a third operation instruction for the third information, wherein the third operation instruction is used to instruct re-enter the system upgrade process, a system upgrade is determined to be performed. Upon receiving a fourth operation instruction for the third information, wherein the fourth operation instruction indicates a return to recovery mode, the system returns to recovery mode. Upon receiving a fifth operation instruction for the third information, wherein the fifth operation instruction is used to instruct the first image file in the first partition to be burned to the backup partition, the system is restarted after the first image file in the first partition is burned to the backup partition and the first image file in the first partition is burned to the backup partition, so as to enter the normal boot process and suspend the system firmware upgrade.

10. The method according to claim 8, wherein, If the upgrade partition is a backup partition, the target image file is the second image file, or the target image file is the second burning image file, and the detection result indicates that the image file is incomplete, the method further includes the following steps: Display a fourth message, which indicates a system upgrade error and includes re-upgrading the system and / or returning to recovery mode; Upon receiving a sixth operation instruction for the fourth information, wherein the sixth operation instruction is used to instruct a system upgrade to be performed again, it is determined to perform a system upgrade. Upon receiving a seventh operation instruction for the fourth information, which indicates a return to recovery mode, the system returns to recovery mode.

11. The method according to claim 8, wherein, If the upgrade partition is a backup partition, the target image file is the third burning image file, and the fifth detection result indicates that the image file is incomplete, the method further includes the following steps: The fifth message includes at least one of the following: perform a system upgrade again; return to recovery mode; burn the first burning image file and the second burning image file in the backup partition to the first partition; Upon receiving an eighth operation instruction for the fifth information, wherein the eighth operation instruction is used to instruct re-enter the system upgrade process, a system upgrade is determined to be performed. Upon receiving a ninth operation instruction for the fifth information, wherein the ninth operation instruction indicates a return to recovery mode, the system returns to recovery mode. Upon receiving a tenth operation instruction for the fifth information, wherein the tenth operation instruction instructs the first burning image file and the second burning image file in the backup partition to be burned to the first partition, the first burning image file and the second burning image file in the backup partition are burned to the first partition to obtain a fourth burning image file, and the fourth burning image file is determined to be the third burning image file.

12. A vehicle-mounted system upgrade device, characterized in that, The device includes: A determining unit is used to determine the mounting result of the USB flash drive when it is detected that the USB flash drive is inserted. The upgrade unit is used to perform a system firmware upgrade based on the system upgrade package in the target directory when the mounting result is successful and a system upgrade package exists in the target directory of the mounted USB flash drive. Specifically, Extract at least one first image file to be extracted from the system upgrade package in the target directory, obtaining at least one first image file, with each of the at least one first image file to be extracted corresponding to the first image file; perform an integrity check on the at least one first image file to obtain a first check result; if the first check result indicates that the image file is complete, burn the at least one first image file to the upgrade partition to obtain at least one first burning image file, with each of the at least one first image file corresponding to the first image file to be burned; perform an integrity check on the at least one first burning image file to obtain a second check result; if the second check result indicates that the image file is complete, extract at least one first image file to be extracted from the system upgrade package in the target directory, excluding the at least one first image file to be extracted; repeat the above steps until all the first image files to be extracted from the system upgrade package in the target directory have been extracted, then extract from the target directory... Extract at least one second image file to be extracted from the system upgrade package to obtain at least one second image file, and the at least one second image file to be extracted and the at least one second image file correspond one-to-one; perform an integrity check on the at least one second image file to obtain a third check result; if the third check result indicates that the image file is complete, burn the at least one second image file to the upgrade partition to obtain at least one second burning image file, and the at least one second image file corresponds one-to-one with the at least one second burning image file; perform an integrity check on the at least one second burning image file to obtain a fourth check result; if the fourth check result indicates that the image file is complete, extract at least one second image file to be extracted from the system upgrade package in the target directory, excluding the at least one second image file to be extracted; repeat the above until all the second image files to be extracted in the system upgrade package in the target directory have been extracted, and then determine that the upgrade partition has completed the system firmware upgrade; The first file of the system upgrade package in the target directory includes a preset MD5 value. The first file is obtained by the first electronic device performing a second processing on the second system upgrade package. The preset MD5 value is used for integrity detection. The second process includes the following steps: compiling the second system upgrade package, and during the compilation of the second system upgrade package, creating a third directory under the second directory, and copying the first image file to be copied and the second image file to be copied generated in the fifth directory under the fourth directory to the third directory, so as to obtain the first image file to be extracted and the second image file to be extracted. The second directory includes the third directory and the fourth directory. Convert the data type of the third image file to be extracted to the target data type, wherein the first image file to be extracted includes the third image file to be extracted; Determine the preset MD5 value of the first image file to be extracted, and determine the preset MD5 value of the second image file to be extracted; The preset MD5 value of the first image file to be extracted and the preset MD5 value of the second image file to be extracted are stored in a storage file to obtain the first file.

13. A device, characterized in that, The device includes a processor, a memory, a communication interface, and one or more programs, the communication interface being connected to the processor, the one or more programs being stored in the memory and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is processed to execute instructions for the steps of the method as described in any one of claims 1-11.

Citation Information

Patent Citations

  • Generating method for integration mirror image document, testing method and device

    CN104516759A

  • Upgrading method based on mirror image of U flash disk interface and application in Delta system

    CN106293806A

  • A method for on-line upgrade firmware of vehicle-mounted system

    CN109375939A

  • Vehicle and vehicle electronic control system program updating method and device

    CN111324362A