Method for updating upgrade software, and related apparatus

By compressing the upgrade software and combining it with offline decompression parameters and verification information, the problem of unstable bootloader design in embedded devices was solved, achieving efficient and reliable self-upgrade under limited storage resources, reducing maintenance costs and improving user experience.

WO2026102577A1PCT designated stage Publication Date: 2026-05-21YINWANG INTELLIGENT TECHNOLOGIES CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
YINWANG INTELLIGENT TECHNOLOGIES CO LTD
Filing Date
2024-11-12
Publication Date
2026-05-21

AI Technical Summary

Technical Problem

In embedded devices, the design of the bootloader is difficult to guarantee stability and vulnerability-free, resulting in high software update and maintenance costs, low efficiency and poor user experience. Especially when storage resources are limited, existing technologies are unable to achieve efficient and reliable self-upgrades.

Method used

By compressing the upgraded version of the software into a compressed package, and utilizing the limited storage resources of computing devices for decompression and writing, combined with offline decompression parameters and verification information, the software can be self-upgraded, simplifying the operation process and reducing the demand for storage space.

Benefits of technology

It enables simple, fast, and reliable software upgrades with limited storage resources, reducing maintenance costs, improving user experience, and increasing upgrade success rate and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024131600_21052026_PF_FP_ABST
    Figure CN2024131600_21052026_PF_FP_ABST
Patent Text Reader

Abstract

A method for updating upgrade software, and a related apparatus, which are applied in the field of device upgrading. In the present application, a first storage unit in a computing device comprises a basic function area and a first storage area, wherein a basic software area is used for storing software related to basic functions, and the first storage area is a storage space outside the basic function area, and is commonly used for storing application software. The computing device acquires a compressed upgraded version of upgrade software, i.e., a first compressed package, and stores same in the first storage area. During upgrading, the first compressed package is decompressed and restored to the upgraded version of the upgrade software, and is written into an upgrade software area, so as to realize the self-upgrading of the upgrade software. Since the first compressed package has been compressed, the data size is greatly reduced, and when the first compressed package is temporarily stored in the first storage area, it is unnecessary to occupy an excessive storage space. By means of the present application, in the cases of limited storage resources, the self-upgrading of upgrade software can be realized simply, conveniently and reliably, thereby reducing the maintenance cost of the computing device.
Need to check novelty before this filing date? Find Prior Art

Description

A method and related apparatus for updating and upgrading software. Technical Field

[0001] This application relates to the field of equipment upgrades, and more particularly to a method and related apparatus for updating and upgrading software. Background Technology

[0002] With the development of computer technology, people's demand for intelligent devices is increasing, and embedded devices are being used more and more widely in fields such as vehicles, intelligent manufacturing, and smart cities. Embedded devices consist of hardware and software. The software, once executed, works in conjunction with the hardware to achieve the corresponding functions. The software of an embedded device mainly includes the application program and the bootloader. The application program implements the main functions of the embedded device, while the bootloader is an upgrade program primarily responsible for upgrading the application program within the embedded device.

[0003] In the era of intelligent connected vehicles, user needs change rapidly, and users have increasingly higher requirements for device functionality, leading to a faster pace of software updates. Timely, efficient, and reliable application updates can fill software gaps and enrich the software functionality of embedded devices. In this scenario of rapid product updates, the stability of the bootloader determines the success rate of embedded device software upgrades and directly affects the user's upgrade experience. When designing a bootloader, manufacturers should strive to ensure its functionality is complete and bug-free to guarantee the stability of embedded device services. However, due to the wide variety of embedded devices and short product development cycles, it is difficult to ensure that the bootloader design is stable, reliable, and bug-free in practice.

[0004] When the bootloader malfunctions or needs an update, the common industry practice is to remove or replace the embedded device. However, for the replaced embedded device, repair personnel need to manually update the bootloader using a programming tool, which is costly, inefficient, and results in a poor user experience.

[0005] Summary of the Invention

[0006] This application provides a method and related apparatus for updating and upgrading software, which can achieve self-upgrading of software simply, quickly, and reliably, greatly reducing the maintenance cost of computing devices and improving the user experience. Especially when the storage resources of computing devices are limited, the solution provided in this application can solve the problem of self-upgrading of software without additional resource support.

[0007] Firstly, this application provides a method for updating and upgrading software. This method is applied to a computing device and can be executed by the computing device or a component (such as a chip or module) of a device with computing capabilities within the computing device. The following description uses a computing device as the executing entity of this method as an example; however, in actual implementation, the executing entity of this method can be other devices or other equipment. In some cases, the computing device is located in a vehicle. Exemplarily, the computing device is one or more of the following: electronic control unit (ECU), controller, domain controller (DC), telematics control unit (TCU), etc. In this application, the computing device includes a first storage unit, which includes a basic functional area and a first storage area. The basic functional area includes an upgrade software area, which includes storage space for storing the upgrade software. The upgrade software is used to update application software. The first storage area includes available storage space outside the basic functional area, and the application software is stored in the first storage area.

[0008] The method for updating and upgrading software includes: obtaining first upgrade information and writing the first upgrade information into a first storage area, wherein the first upgrade information includes a first compressed package, which is a compressed file obtained by compressing the upgraded version of the upgrade software. The method further includes: decompressing the first compressed package to obtain the upgraded version of the upgrade software, erasing data in the upgrade software area, and writing the upgraded version of the upgrade software into the upgrade software area.

[0009] In this application, the upgrade software area within the basic software area is used to store upgrade software. When the upgrade software needs to be updated, the upgrade information obtained by the computing device includes a compressed upgrade version of the upgrade software, i.e., a first compressed package. Compared to the original data before compression, the first compressed package requires significantly less storage space and can be temporarily stored in the first storage area. During the upgrade, the first compressed package is decompressed to restore the upgrade version of the upgrade software and written to the upgrade software area, thereby updating the upgrade software to the upgrade version.

[0010] Since the storage resources of the first storage unit are limited, the basic functional area is essentially a fixed storage space used to store some basic function-related programs. The first storage area is a flexibly usable storage area, but its storage space is also quite limited. In this application, the upgraded version of the upgrade software is transmitted and stored in the form of a compressed package, and then decompressed and written during the upgrade, significantly reducing the space occupied by the upgraded version of the upgrade software.

[0011] The software update and upgrade method provided in this application involves only basic operations such as storage, decompression, writing, and erasing. The steps are simple, have low requirements for the computing power of the computing device, and have good compatibility. The execution of each step of this method is highly smooth, and the software update and upgrade operation does not involve complex processes such as multiple upgrade package pushes and switching to backup upgrade software. The upgrade process is fast, less prone to maintenance problems, and has high stability and reliability.

[0012] In summary, this application enables simple, quick, and reliable self-upgrades of software, significantly reducing the maintenance costs of computing devices and improving the user experience. Especially when computing devices have limited storage resources, the solution provided in this application can solve the self-upgrade problem of software without additional resource support.

[0013] In some schemes, the storage space size of the first storage unit is in the kilobyte (KB) range. Alternatively, the storage space size of the first storage unit is less than 1 MB. For example, the storage space size of the first storage unit is 256 KB, or 512 KB.

[0014] In one possible implementation of the first aspect, the storage space of the first storage unit is 256KB, of which the basic functional area typically occupies about 50KB, while the application requires about 180KB of space in the first storage area. This leaves only about 20KB of space remaining in the first storage area. However, the storage space occupied by upgrade software is often greater than 20KB, making it impossible to store directly in the remaining space of the first storage area. But with the solution of this application, the compressed upgrade version of the upgrade software can be less than 20KB, typically around 10KB, and can thus be stored in the remaining space of the first storage area for upgrading the software. Therefore, under the condition of limited computing device resources, this solution can greatly improve the utilization rate of storage resources and solve the self-upgrade problem of upgrade software under conditions of limited resources and no additional resource support. Furthermore, based on the application of this solution, the computing device can be configured with storage units with small storage space, which helps to reduce device costs.

[0015] In another possible implementation of the first aspect, the difference between the size of the first storage area and the size of the application software is less than the size of the upgraded version of the upgrade software. That is, after storing the application software, the first storage area does not support the direct storage of the upgraded version of the upgrade software.

[0016] In the above implementation, the remaining space in the first storage area is already very limited. However, by compressing the upgraded version of the upgrade software, the computing device can obtain the compressed package and then store it, which can greatly reduce the storage space occupied by the upgraded version of the upgrade software, thereby greatly improving the utilization rate of the first storage unit and solving the self-upgrade problem of the upgrade software without additional resource support.

[0017] In another possible implementation of the first aspect, the upgrade software is a bootloader. Bootloaders are commonly used to upgrade application software in computing devices, and this application is applicable to scenarios involving bootloader updates. Of course, in some similar scenarios, the program used to update application software may not be called a bootloader, but upgrade software often suffers from difficulties in self-updating, and this application is also applicable to similar scenarios involving upgrade software updates.

[0018] In yet another possible implementation of the first aspect, the computing device is an embedded device.

[0019] In another possible implementation of the first aspect, the computing device is located in the vehicle. With the development of intelligent vehicle technology, the number of electronic devices in vehicles is increasing. While the storage resources of the computing devices in vehicles are limited, security requirements are high, functional updates are rapid, and maintenance costs are high. The solution of this application allows for simple, convenient, and efficient updates to the upgrade programs of vehicle components, adapting to the characteristics of rapid vehicle updates, reducing maintenance costs, and improving user experience.

[0020] In another possible implementation of the first aspect, the first upgrade information further includes decompression parameters for the first compressed file. Decompressing the first compressed file to obtain an upgraded version of the upgrade software includes: decompressing the first compressed file based on the decompression parameters to obtain an upgraded version of the upgrade software.

[0021] Since the first compressed file is compressed, decompression-related configuration parameters are required during decompression. Based on the above solution, the decompression parameters of the first compressed file are transmitted and stored along with the first compressed file, enabling offline decompression and improving the stability of the upgrade.

[0022] In some solutions, the decompression of compressed data by the embedded device requires the assistance of a host computer, which provides decompression parameters and performs online decompression in conjunction with the local compressed data. However, the upgrade process may encounter various situations, such as power failure of the host computer or the host computer being in an update state and unable to function properly, which will affect the decompression success rate and efficiency of the embedded device. In the above implementation, the decompression parameters of the first compressed package are transmitted and stored along with the first compressed package. The computing device can read the decompression parameters and the first compressed package at any time for offline decompression, resulting in high decompression efficiency and high success rate, which helps to improve the stability and reliability of the upgrade.

[0023] In another possible implementation of the first aspect, decompressing the first compressed package to obtain an upgraded version of the upgrade software includes: receiving decompression parameters for the first compressed package provided by a control device, and decompressing the first compressed package based on the decompression parameters to obtain an upgraded version of the upgrade software, wherein the control device is connected to a computing device. The control device may be a host computer of the computing device or a device that controls the upgrade process.

[0024] Based on the above scheme, the decompression parameters of the first compressed file are not stored in the first storage area, but are provided by the host computer. This allows for control over the upgrade process of the computing device, improving security. Furthermore, by not storing the decompression parameters of the first compressed file in the first storage area, the storage resource consumption of the first storage unit can be further reduced.

[0025] Optionally, the first upgrade information may not include the decompression parameters of the first compressed package. Alternatively, the upgrade package provided to the terminal device (such as a vehicle) may include the decompression parameters of the first compressed package, but the decompression parameters of the first compressed package are not stored in the first storage area.

[0026] In another possible implementation of the first aspect, the first upgrade information further includes verification information of the first compressed package. The method further includes: verifying the upgrade version of the upgrade software based on the verification information of the first compressed package. Optionally, this step can be performed after decompressing the first compressed package to obtain the upgrade version of the upgrade software, but before writing the upgrade version of the upgrade software into the upgrade software area.

[0027] Based on the above scheme, the first upgrade information also carries verification information for the first compressed package, which can verify the upgrade version of the decompressed upgrade software. In some schemes, since the first compressed package is compressed, if it is damaged by an attacker during the compression process, it may be replaced, posing a security threat to the computing device. By using the verification information of the compressed package transmitted along with it, the original data can be verified after decompression and restoration, preventing data tampering and improving the security performance of the computing device.

[0028] In another possible implementation of the first aspect, the computing device further includes random access memory (RAM). After decompressing the first compressed package to obtain the upgraded version of the upgrade software, and before erasing the data in the upgrade software, the method further includes: storing the upgraded version of the upgrade software in RAM. Writing the upgraded version of the upgrade software to the upgrade software area includes: if the verification of the upgraded version of the upgrade software is successful, writing the upgraded version of the upgrade software stored in RAM into the upgrade software area.

[0029] In some solutions, since the upgraded software version needs to undergo verification processes, it is only written to the upgrade software area after being confirmed to be safe, complete, and legitimate. Before that, the upgraded software version can be temporarily stored in RAM. The above implementation utilizes the computing device's RAM for temporary storage, eliminating the need for additional space in the first storage unit. This allows for verification of the upgraded software version even with limited storage space, solving the problem of insufficient storage space in the first storage unit preventing the implementation of additional verification processes, and thus improving the stability of the upgrade process.

[0030] In another possible implementation of the first aspect, the first storage unit stores update software used to update the upgrade software. After writing the first upgrade information to the first storage area, the method further includes: running the update software. After the update software is run, the following operations are performed: decompressing the first compressed package to obtain the upgraded version of the upgrade software, erasing the data in the upgrade software area, and writing the upgraded version of the upgrade software to the upgrade software area.

[0031] Based on the above scheme, some or all of the operations performed by the computing device are implemented by executing the software in the first storage unit. The specific operation of updating this upgrade software is implemented by the update software stored in the first storage unit. Updating the upgrade software through software calls stored in the first storage unit makes the upgrade operation controllable and improves the upgrade success rate.

[0032] In another possible implementation of the first aspect, the updated software may be stored in the basic function area, or the updated software may be stored in the first storage area.

[0033] In another possible implementation of the first aspect, the updated software is stored in a first storage area, and the first upgrade information also includes the updated software.

[0034] Based on the above scheme, the updated software can be transmitted along with the first upgrade package and other information. After the subsequent update is completed, the first upgrade information can be erased along with it. At this point, the function of the updated software has been fulfilled, and it does not occupy any additional space in the first storage unit.

[0035] In another possible implementation of the first aspect, after writing the upgraded version of the upgrade software to the upgrade software area, the method further includes erasing the data of the first upgrade information in the first storage area.

[0036] Based on the above solution, after the software upgrade is completed, the data of the first upgrade information can be erased, without occupying the space of the first storage unit, thereby improving the space utilization of the first storage unit.

[0037] In another possible implementation of the first aspect, the method further includes erasing data in the first storage area before writing the first upgrade information to the first storage area.

[0038] Based on the above scheme, some data may already be stored in the first storage area before the first upgrade information is written. In order to store the data of the first upgrade information, the data in the first storage area can be erased in advance to ensure that the data of the first upgrade information is stored completely, so that the update process of the upgrade software can be executed smoothly and the upgrade success rate can be improved.

[0039] In another possible implementation of the first aspect, before writing the first upgrade information into the first storage area, the method further includes erasing the data in the first storage area if the data size of the first upgrade information is greater than the remaining space size of the first storage area.

[0040] Based on the above scheme, if the remaining space in the first storage area is sufficient to store the data of the first upgrade information, the data of the first upgrade information may not need to be erased, thereby further reducing the impact of the upgrade software update on the computing device and improving the efficiency of the upgrade process.

[0041] In another possible implementation of the first aspect, the method further includes: if the data size of the first upgrade information is less than or equal to the remaining space size of the first storage area, providing the control device with the first data currently stored in the first storage area, and receiving a third compressed package provided by the control device, the third compressed package being a compressed package formed by compressing the first data. The third compressed package is stored in the first storage area. The remaining space size of the first storage area after storing the first compressed package is greater than the data size of the first upgrade information. The control device is connected to a computing device.

[0042] Based on the above scheme, if the remaining space in the first storage area is insufficient to store the data of the first upgrade information, the computing device can compress the data in the first storage area through the control device. After storing the compressed third upgrade package, the remaining space in the first storage unit can store the data of the first upgrade information, thereby enabling the upgrade software to be upgraded under limited conditions.

[0043] In another possible implementation of the first aspect, the method further includes: obtaining second upgrade information, the second upgrade information including a second compressed package, writing the second upgrade information into a first storage area, wherein the second upgrade information and the first upgrade information are stored in different locations within the first storage area. After writing the upgraded version of the upgrade software into the upgrade software area, the method further includes: decompressing the second compressed package to obtain an upgraded version of the first application software, and writing the upgraded version of the first application software into the first storage area.

[0044] The second compressed package is a compressed file obtained by compressing an upgraded version of the first application software, which is an application software.

[0045] Based on the above scheme, the application software can be updated synchronously during an update process along with the upgrade software. The updated version of the application software can be compressed into a second compressed package and stored in the first storage area, thereby maximizing the utilization of the storage resources in the first storage area and avoiding the problem that the upgraded version of the application software and / or the upgraded version of the upgrade software cannot be completely stored due to limited storage space, thus improving the upgrade success rate.

[0046] Optionally, the application software of the computing device includes only the first application software. When the computing device is operating normally, the data stored in the first storage area is the first application software (including related data), and the first compressed package is an upgraded version of all application software that should originally be stored in the first storage area. Alternatively, when the computing device is operating normally, the data stored in the first storage area may include other files or application software in addition to the first application software.

[0047] Optionally, the second upgrade information and the first upgrade information belong to the same upgrade package. The actions of obtaining the first upgrade information and obtaining the second upgrade information can be completed in one operation, for example, they can be replaced by obtaining the upgrade package of the computing device.

[0048] In another possible implementation of the first aspect, the second upgrade information further includes decompression parameters for the second compressed package. Decompressing the second compressed package to obtain an upgraded version of the first application software includes: decompressing the second compressed package based on the decompression parameters to obtain the upgraded version of the first application software. Based on the above scheme, offline decompression of the first application software can be achieved.

[0049] In another possible implementation of the first aspect, the second upgrade information includes verification information of the second compressed package. After decompressing the second compressed package to obtain the upgraded version of the first application software, and before writing the upgraded version of the first application software into the first storage area, the method further includes: verifying the upgraded version of the first application software based on the verification information of the second compressed package. Based on the above scheme, the data after decompressing the second compressed package can be verified, which can improve the security performance of the computing device.

[0050] In another possible implementation of the first aspect, when decompressing the second compressed package, it is necessary to obtain the available storage space in the current first storage area and decompress the second compressed package by a size smaller than the available storage space in the current application partition, ensuring that the decompressed data can be written normally to the first storage area. For example, the computing device can decompress the second compressed package multiple times and erase the decompressed portion of the second compressed package after decompression, thereby ensuring that the decompressed data can be written normally to the first storage area.

[0051] In another possible implementation of the first aspect, before decompressing the second compressed package to obtain the upgraded version of the first application software, the method includes: obtaining the available storage space in the first storage area, and determining that the available storage space in the first storage area is greater than the size of the decompressed file of the second compressed package. Based on the above scheme, it can be ensured that the decompressed data is stored completely, and the success rate of upgrading computing devices and the stability of the upgrading process can be improved.

[0052] Optionally, the second upgrade information may also include the size of the uncompressed file of the second compressed package.

[0053] In another possible implementation of the first aspect, the basic functional area further includes a jump area, the software in the jump area being used to jump to the corresponding storage location of the first storage unit based on the fulfillment of certain conditions, so as to run the software at the corresponding storage location.

[0054] The jump area enables conditional execution of multiple software programs stored in the first storage unit, controlling the operation of the computing device to conform to the current conditions and improving the success rate of upgrades.

[0055] In another possible implementation of the first aspect, the first storage unit further includes a boot area, the software of which is used to execute an initialization process and jump to a jump area to execute the software in the jump area when the computing device starts up. Booting here includes various boot scenarios such as restart, booting after a reset, and booting under normal conditions.

[0056] In another possible implementation of the first aspect, the first storage unit stores update software. After writing the first upgrade information to the first storage area and before decompressing the first compressed package to obtain the upgraded version of the upgrade software, the method further includes: setting the parameter value of the first parameter so that the conditions for updating the upgrade software are met. The software in the jump area is run to perform the following operations: if the conditions for updating the upgrade software are met, jump to the storage location of the update software to run the update software.

[0057] Based on the above scheme, by setting the parameter values, the jump area can be triggered to jump to different storage locations for execution, which can design the operation process of the computing device and improve the success rate of upgrades.

[0058] In some possible implementations, after setting the value of the first parameter, a reset can be triggered, causing the program in the first storage unit to start execution from the startup area and reach the jump area, thus achieving conditional jump. After setting the value of the first parameter, the method further includes enabling the computing device to restart. That is, enabling the computing device to reset.

[0059] It should be noted that the first parameter can be one parameter or multiple parameters. For example, setting the first parameter includes setting a first flag (e.g., called the reprogramming flag) to a first value and setting a second flag (e.g., called the software update flag) to a second value. When the first flag is at its first value and the second flag is at its second value, the jump area jumps to the storage location of the update software to run the update software.

[0060] In another possible implementation of the first aspect, after writing the upgraded version of the upgrade software to the upgrade software area, the method further includes: setting the parameter value of the second parameter so that the conditions for updating the upgrade software are not met while the conditions for decompressing the application software are met. Running the software in the jump area to perform the following operations: if the conditions for decompressing the application software are met, jumping to the upgrade software area. Running the upgraded version of the upgrade software to perform the following operations: decompressing the second compressed package to obtain the upgraded version of the first application software, and writing the upgraded version of the first application software to the first storage area.

[0061] Optionally, the first parameter and the second parameter may be the same or different. Alternatively, if at least one of the first and second parameters includes multiple parameters, the first and second parameters may be partially the same. For example, the second parameter may include multiple parameters, and setting the second parameter includes: setting a second flag (e.g., referred to as an upgrade software update flag) to a third value, and setting a third flag (e.g., referred to as an unzip application software flag) to a fourth value. When the second flag is at the third value and the third flag is at the fourth value, the jump area jumps to the storage location of the upgrade software to run the upgrade software.

[0062] In another possible implementation of the first aspect, the method further includes: setting the parameter value of the third parameter so that the conditions for running the application software are met. The software in the jump area is then run to perform the following operations: if the conditions for running the application software are met, jump to the first storage area to run the application software in the first storage area.

[0063] Similarly, the third parameter may be the same as, different from, or partially the same as the aforementioned first and third parameters. For example, the third parameter may include multiple parameters, and setting the third parameter includes setting a third flag (e.g., referred to as the decompression application software flag) to a fifth value and setting a first flag (e.g., referred to as the reprogramming flag) to a sixth value. When the third flag is at its fifth value and the first flag is at its sixth value, the jump area jumps to the application software's storage location to run the application software.

[0064] In another possible implementation of the first aspect, the computing device is included in the terminal device, and the terminal device is communicatively connected to the upgrade device. Obtaining the first upgrade information includes: obtaining first upgrade information from the upgrade device. Exemplarily, the upgrade device is an over-the-air (OTA) upgrade server or a diagnostic device, etc.

[0065] Secondly, this application provides a method for updating and upgrading software, applied to an upgrade device, for example, implemented by the upgrade device or a module within the upgrade device. The upgrade device has a communication connection with a terminal device.

[0066] The method includes: compressing an upgraded version of the upgrade software to obtain a first compressed package, and sending first upgrade information to a terminal device, the first upgrade information including the first compressed package. The terminal device includes a computing device, which includes a first storage unit. The first storage unit includes a basic functional area and a first storage area. The basic functional area includes an upgrade software area, which includes storage space for storing the upgrade software, which is used to update application software. The first storage area includes available storage space outside the basic functional area, and the application software is stored in the first storage area.

[0067] In the above scheme, the upgrade device can compress the upgrade version of the upgrade software and send it to the terminal device, so that the terminal device can complete the upgrade software in the computing device even when the storage space in the first storage area is limited, thereby improving the upgrade efficiency of the computing device and reducing maintenance costs.

[0068] In one possible implementation of the second aspect, the first upgrade information further includes compression parameters of the first compressed package, and / or, the first upgrade information further includes verification information of the first compressed package.

[0069] In another possible implementation of the second aspect, the first upgrade information further includes update software, which is used to update the upgrade software.

[0070] In another possible implementation of the second aspect, the method further includes: compressing an upgraded version of the first application software to obtain a second compressed package, and sending second upgrade information to a terminal device, wherein the first application software is application software and the second upgrade information includes the second compressed package.

[0071] In another possible implementation of the second aspect, the second upgrade information further includes compression parameters of the second compressed package, and / or, the second upgrade information further includes verification information of the second compressed package.

[0072] Thirdly, this application provides a computing device including an acquisition unit and a processing unit. The acquisition unit is used to acquire data, for example, to perform the aforementioned acquisition and receiving operations. The processing unit is used to process data and perform operations, for example, to implement one or more of the aforementioned data processing, program execution, storage, verification, decompression, compression, and decision-making (such as judgment). This computing device is used to implement the method described in the first aspect or any possible embodiment of the first aspect.

[0073] Fourthly, this application provides an upgrade device comprising a communication unit and a compression unit. The communication unit performs communication-related operations, such as sending or receiving data. The compression unit compresses data and can also perform other processing operations. This upgrade device is used to implement the method described in the second aspect or any possible embodiment of the second aspect.

[0074] Fifthly, this application provides a computing device, including a memory and a processor. The memory provides storage space, and the processor implements the methods described in the first aspect or any possible embodiment of the first aspect.

[0075] Sixthly, this application provides a computing device including a memory and a processor. The memory stores computer instructions, and the processor invokes the computer instructions to implement the methods described in the second aspect or any possible implementation thereof.

[0076] In a seventh aspect, this application provides an upgrade system, including a computing device and an upgrade device, wherein the computing device is used to implement the method described in the first aspect or any possible implementation of the first aspect, and the computing device is used to implement the method described in the second aspect or any possible implementation of the second aspect.

[0077] Eighthly, this application provides a vehicle that includes the computing device described in the fourth aspect, or the computing equipment described in the fifth aspect.

[0078] Ninthly, this application provides a computer-readable storage medium storing program instructions that, when executed by a processor, implement the method described in the first aspect or any possible implementation of the first aspect, or implement the method described in the second aspect or any possible implementation of the second aspect.

[0079] In a tenth aspect, this application provides a computer program product, including program instructions or executable computer program code, which, when executed by at least one processor, implements the method described in the first aspect or any possible implementation of the first aspect, or implements the method described in the second aspect or any possible implementation of the second aspect.

[0080] The beneficial effects of the solutions in aspects two through ten of this application can be found in the beneficial effects described in aspect one. Attached Figure Description

[0081] The accompanying drawings used in the description of the embodiments will be briefly introduced below.

[0082] Figure 1 is a schematic diagram of the structure of a computing device provided in this application;

[0083] Figure 2 is a schematic diagram of the spatial distribution of a first storage cell provided in this application;

[0084] Figure 3 is a schematic diagram of the architecture of an upgrade system provided in this application;

[0085] Figure 4 is a flowchart illustrating a method for updating and upgrading software according to an embodiment of this application;

[0086] Figure 5 is a schematic diagram of the spatial distribution of three more first storage units provided in this application;

[0087] Figure 6 is a schematic diagram of the spatial distribution of two more first storage units provided in this application;

[0088] Figure 7 is a flowchart illustrating another method for updating and upgrading software provided in an embodiment of this application;

[0089] Figure 8 is a flowchart illustrating another method for updating and upgrading software provided in an embodiment of this application;

[0090] Figure 9 is a schematic diagram of the spatial distribution of another first storage unit provided in this application;

[0091] Figure 10 is a schematic diagram of the structure of a computing device provided in an embodiment of this application;

[0092] Figure 11 is a schematic diagram of an upgrade device provided in an embodiment of this application;

[0093] Figure 12 is a schematic diagram of the structure of a computing device provided in an embodiment of this application;

[0094] Figure 13 is a structural schematic diagram of an upgrade device 130 provided in an embodiment of this application. Detailed Implementation

[0095] The following is a brief introduction to the terminology that may be used in this application:

[0096] In the computer field, an image typically refers to a complete copy of a system, software, or data. This copy contains all the necessary files and settings, enabling the creation of an environment identical to the original. Images play a crucial role in a variety of application scenarios. For example, a software image contains the executable files (or instructions) required to run an application, essentially packaging all the application's components together, allowing it to run easily on any system that supports the corresponding technology.

[0097] The following section introduces the equipment, system architecture, and other aspects of the application in this paper.

[0098] Please refer to Figure 1, which is a schematic diagram of the structure of a computing device provided in this application. The computing device 11 includes a processor 111 and a first storage unit 112.

[0099] The processor 111 is a module with processing capabilities, capable of performing one or more operations such as calculation, processing, and control. In one implementation, the processor can be a circuit with instruction read and execute capabilities, such as an arithmetic logic unit (ALU), processor core, CPU, microprocessor, microcontroller unit (MCU), graphics processing unit (GPU), or digital signal processor (DSP). In another implementation, the processor can implement certain functions through the logical relationships of hardware circuits. These logical relationships can be fixed or reconfigurable. For example, the processor can be a hardware circuit implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), such as a field-programmable gate array (FPGA). In reconfigurable hardware circuits, the process of the processor loading a configuration document and configuring the hardware circuit can be understood as the process of the processor loading instructions to implement the corresponding functions. Furthermore, the processor can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as a neural network processing unit (NPU), tensor processing unit (TPU), deep learning processing unit (DPU), etc. In some implementations, the computing device 11 includes at least one processor integrated as a system-on-chip (SOC), which is commonly referred to as a SOC by those skilled in the art. The SOC may include at least one processor, and when the SOC includes multiple processors, the types of processors can be different, such as including a CPU and an NPU.

[0100] The first storage unit 112 provides storage space to store software (program instructions, program executable files, or executable code, etc.), including software-related data, files, parameters, etc. Exemplarily, the software stored in the first storage unit 112 can be executed by the processor 111 to perform corresponding operations. Exemplarily, the first storage unit 112 can be a memory, and more specifically, a non-volatile memory, such as flash memory, disk storage, phase-change memory, and resistive random access memory. In some solutions, the first storage unit 112 can be an internal storage resource of the processor 111; that is, the first storage unit 112 is not an external storage unit of the processor 111.

[0101] The processor 111 and the first storage unit 112 are connected, for example, via a bus or circuit. Alternatively, the processor 111 and the first storage unit 112 shown in Figure 1 are represented as two modules for ease of describing the functions of different modules. In a specific implementation, the processor 111 and the first storage unit 112 can be integrated into the same module. As one possible implementation, the processor 111 and the first storage unit 112 can be integrated into the main control chip. In this case, the processor 111 can be an arithmetic logic unit (ALU) core or a core, and the first storage unit 112 can be a storage resource within the main control chip (e.g., flash memory within the main control chip).

[0102] As one possible implementation, referring to Figure 2, the first storage unit 112 includes a basic functional area and a first storage area. The basic functional area is used to store software for implementing basic functions and can be considered as a fixed storage space. For example, the basic functional area includes an upgrade software area, which includes storage space for storing upgrade software used to update application (APP) software (hereinafter referred to as APP). Further, the basic functional area also includes a startup area and / or a jump area, wherein the software stored in the startup area is the software executed when the computing device is initialized during startup (or reset), and after the software in the startup area has finished executing, the software in other areas will be executed. The software in the jump area is used to jump to the corresponding storage location of the first storage unit based on the fulfillment of certain conditions, so as to run the software at the corresponding storage location.

[0103] The first storage area includes available storage space outside the basic functional area, and the application software of the computing device is stored in the first storage area. The application software of the computing device is used to implement the specific functions of the computing device 11. Under normal operation of the computing device 11, the jump area usually jumps to the storage location of the application software to run the application software. Since the application software may require upgrades, when the application software needs to be upgraded, the computing device 11 jumps through the jump area to the storage location of the upgrade software to run the upgrade software and upgrade the application software.

[0104] In some schemes, the division of storage areas such as the first storage area and the basic functional area is logical, and the first storage unit 112 may not actually have two physically separated parts. Moreover, in some virtualized storage spaces, one or more different memories can be virtualized to form the first storage unit, and a memory may also be virtually divided into multiple storage units.

[0105] Optionally, the computing device 11 may also include storage units other than the first storage unit 112. For example, the computing device 11 may also include volatile memory, such as random access memory (RAM). Taking RAM as an example, RAM is usually used as a temporary storage medium for the operating system or other running programs (which may be called system memory).

[0106] In some possible implementations, the computing device 11 also includes a communication interface (or communication unit) for communicating with devices outside the computing device, such as receiving or sending information. For example, referring to FIG1, the computing device can receive upgrade information provided to it by other devices, such as first upgrade information, second upgrade information, etc. hereinafter referred to as such.

[0107] In some possible implementations, the upgrade software is a bootloader. Bootloaders are commonly used to upgrade application software in computing devices, and this application is applicable to scenarios involving bootloader updates. Of course, in some similar scenarios, the program used to update application software may not be called a bootloader, but upgrade software often suffers from difficulties in self-updating, and this application is also applicable to similar scenarios involving upgrade software updates.

[0108] In some possible implementations, the computing device is an embedded device.

[0109] In some possible implementations, the computing device is located in the vehicle. With the development of intelligent vehicle technology, the number of electronic devices in vehicles is increasing. While the storage resources of the computing devices in vehicles are limited, security requirements are high, functional updates are rapid, and maintenance costs are high. The solution proposed in this application allows for simple, convenient, and efficient updates to the upgrade programs of vehicle components, adapting to the characteristics of rapid vehicle updates, reducing maintenance costs, and improving user experience.

[0110] In some solutions, the computing device 11 can be connected to other devices via wired and / or wireless means to transmit information. For example, the computing device can be directly or indirectly connected to diagnostic devices, control devices, or servers (cloud).

[0111] This application can be applied to equipment upgrade scenarios, such as equipment upgrades in smart vehicles, smart homes, smart showrooms, and smart security systems. For example, this application can be applied to the upgrade of vehicles, televisions, and home appliances.

[0112] In some solutions, the computing device is considered a terminal device. Taking a vehicle as an example, the aforementioned computing device 11 includes, but is not limited to, electronic control units (ECUs), domain controllers (DCs), mobile data centers (MDCs), and vehicle integrated / integration units (VIUs) used in vehicles. The following section, using a computing device installed in a vehicle as an example, and referring to Figure 3, illustrates the architecture of the upgrade system of this application.

[0113] As shown in Figure 3, the upgrade system includes a vehicle 100 and a server 200. The vehicle 100 and the server 200 can establish a connection via wired and / or wireless communication links. Wherein:

[0114] Vehicle 100 includes multiple components with architectures similar to computing device 11. Specifically, the vehicle may include one or more subsystems or components such as a driving system, a control system, a sensing system, peripheral devices, and a power supply. Each subsystem may include one or more components, and the subsystems or components may be interconnected via wired or wireless means. Taking the sensing system as an example, the sensing system includes several sensing devices, or sensors, that provide information about the environment around or inside the vehicle, such as cameras, microphones, radar, lidar, temperature sensors, humidity sensors, light sensors, positioning systems, inertial measurement units, pressure sensors, etc., one or more of these sensing devices can serve as the aforementioned computing device 11.

[0115] Server 200, also known as server-side, cloud, or cloud platform, is a device with computing and communication capabilities. Server 200 typically concentrates a significant amount of computing resources, which can include physical devices or virtual units or software modules. For example, server 200 may include one or more physical servers, such as blade servers or rack servers. Alternatively, server 200 may contain one or more computing instances, which are virtualizations of computing resources, such as virtual machines or containers. In some solutions, server 200 can be a cloud service, providing corresponding interfaces. Other devices (such as vehicle 100) can interact with the cloud service by calling its interfaces, and the cloud service can also transmit information to other devices through these interfaces.

[0116] In this embodiment, server 200 can generate upgrade information required for upgrading the computing device and send the upgrade information to vehicle 100. Accordingly, vehicle 100 can receive the upgrade information from server 200 and distribute the upgrade information required for upgrading the computing device to computing device 11.

[0117] Furthermore, the vehicle 100 may also include an upgrade control device that can obtain upgrade information from the server 200 and distribute the upgrade information required by the corresponding computing device to the computing device inside the vehicle.

[0118] The upgrade method described above, which involves sending upgrade information via a server, is merely an example. In some solutions, when the computing device in a terminal device (e.g., vehicle 100) is upgraded, it can also be upgraded via a diagnostic device. In this case, the diagnostic device can communicate with the terminal device and provide upgrade information to it. Accordingly, the terminal device obtains the upgrade information provided by the diagnostic device and transmits it to the computing device.

[0119] As mentioned above, the first storage unit of a computing device stores application software and upgrade software, which is used to upgrade the application software. However, application software often lacks self-updating capabilities. When the upgrade software itself needs updating or repair, the computing device often has to be removed, and new upgrade software burned into the first storage unit, resulting in high maintenance costs and low efficiency.

[0120] In some solutions, the first storage unit can store two upgrade software programs. When an upgrade is needed, one upgrade software erases and writes to the other, completing the update. This solution is difficult to implement. First, storing two copies of the two upgrade software programs, and requiring them to be executed alternately, relies on the processor supporting dual-upgrade software. Second, backing up one copy of the upgrade software, with both copies only used when an update is needed, is costly and yields low returns for current computing devices with limited storage space.

[0121] For example, the storage space size of the first storage unit in the computing device is in the kilobyte (KB) range. In most computing devices, the storage space size of the first storage unit is designed to be 256KB, of which the basic functional area typically occupies about 50KB of space, while the application requires about 180KB of space in the first storage area. At this point, only about 20KB of space remains in the first storage area, while the storage space occupied by upgrade software is often greater than 20KB. Therefore, the first storage unit can no longer support storing two upgrade software programs.

[0122] In some solutions, the storage unit in the computing device is divided into an upgrade software area and an application area, used to store the upgrade software and the application respectively. Updating the upgrade software in the storage unit involves two stages. In the first stage, the computing device obtains the upgrade version of the upgrade software from an external source, erases the application software in the application area, stores the upgrade version of the upgrade software in the application area, and updates the upgrade software based on the upgrade version in the upgrade software. In the second stage, the computing device obtains the new application software upgrade package from an external source, erases the upgrade software in the application area, and then writes the application software into the application area. This solution requires erasing the original application and requires the upgrade device to push upgrade information twice in two separate stages to complete the upgrade, resulting in relatively low upgrade efficiency. Especially during OTA upgrades, each upgrade push requires a filing and approval process, which is subject to many limitations in actual implementation and leads to high operation and maintenance costs.

[0123] In view of this, this application provides a method and related apparatus for updating and upgrading software to update the upgrade software in a computing device. The first storage unit in the computing device includes a basic function area and a first storage area, where the upgrade software area within the basic software area is used to store the upgrade software. In this embodiment, the upgrade information acquired by the computing device includes a compressed upgrade version of the upgrade software, i.e., a first compressed package. Compared to the original data before compression, the first compressed package requires significantly less storage space and can be temporarily stored in the first storage area. During the upgrade, the first compressed package is decompressed to restore the upgraded version of the upgrade software and written to the upgrade software area, thereby updating the upgrade software to the upgraded version. Since the storage resources of the first storage unit are limited, the basic function area is essentially a fixed storage space used to store some basic function-related programs, while the first storage area is a flexibly usable storage area, but its storage space is also quite limited. In this application, the upgrade version of the upgrade software is transmitted and stored in the form of a compressed package, and then decompressed and written during the upgrade, significantly reducing the space occupied by the upgrade version of the upgrade software.

[0124] In summary, the solution provided in this application enables simple, fast, and reliable self-upgrades of software, significantly reducing the maintenance costs of computing devices and improving user experience. Especially when computing devices have limited storage resources, the solution provided in this application can solve the self-upgrade problem of software without additional resource support.

[0125] The method of this application embodiment is described below. It should be noted that the method is illustrated here using a vehicle scenario as an example. When this method is applied to other devices or systems, it can have similar effects. In this case, the method need not be called a vehicle control method; it can be called a control method or other methods. It should be understood that the names of the methods, devices, information, etc., can be designed according to the implementation situation, and this application does not strictly limit the names of things.

[0126] Please refer to Figure 4, which is a flowchart illustrating a method for updating and upgrading software according to an embodiment of this application. Optionally, this method is applied to a computing device, such as the computing device 11 shown in Figure 1. For ease of description, the following description uses a computing device as the executing entity.

[0127] The software update and upgrade method shown in Figure 4 may include one or more steps from S401 to S405. It should be understood that, for ease of description, the steps are described in the order of S401 to S405, but this embodiment does not limit the order of execution, the execution time, or the number of executions of the above one or more steps. S401 to S405 are as follows:

[0128] S401: The computing device obtains the first upgrade information.

[0129] The computing device includes a first storage unit. Referring to Figure 2, the first storage unit includes a basic functional area and a first storage area. The basic functional area includes an upgrade software area, which includes storage space for storing upgrade software used to update application software. The first storage area includes available storage space outside the basic functional area, and the application software is stored in the first storage area. In some solutions, the basic functional area can be considered a fixed storage space used to store some basic function-related programs, while the first storage area is a flexible storage area. In some solutions, storage space outside the basic functional area can be included in the scope of the first storage area. For example, the computing device is an embedded device, the first storage unit is a non-volatile memory, and the upgrade software is a bootloader.

[0130] The first upgrade information includes a first compressed file, which is a compressed file obtained by compressing the upgraded version of the upgrade software. It can also be called an image compressed file of the upgraded version of the upgrade software, or simply an upgrade software image compressed file. Here, "image" refers to a complete copy of the upgraded version of the upgrade software, equivalent to the executable upgraded version of the upgrade software itself. For example, in the case of the upgrade software being a bootloader, the first compressed file can be called a bootloader compressed image. Compared to the original data before compression, the first compressed file requires significantly less storage space. Furthermore, the operation of compressing the upgraded version of the upgrade software can be performed by the device that packages the first upgrade information, such as the server shown in Figure 3, or by a diagnostic device. Alternatively, the operation of compressing the upgraded version of the upgrade software can be performed by a control device connected to the computing device. The aforementioned control device can distribute the upgrade information to the computing device.

[0131] In some possible implementations, the first upgrade information also includes supplementary information of the first compressed package. In some schemes, the supplementary information of the first compressed package is placed at the beginning of the first compressed package during transmission and storage, and can therefore also be called the header of the first compressed package, for example, the upgrade software image header. As another example, when the upgrade software is a bootloader, the supplementary information of the first compressed package can be called the bootloader image header. As one possible design, the supplementary information of the first compressed package includes one or more of the following: decompression parameters of the first compressed package, verification information of the first compressed package, and attribute data of the first compressed package. Some of this information is described below as examples:

[0132] The decompression parameters for the first compressed file include parameters used to decompress the first compressed file. For example, the decompression parameters for the first compressed file may include configuration parameters of the compression algorithm used when upgrading the compression software, or key information used when upgrading the compression software.

[0133] The verification information for the first compressed package includes information that verifies the security, legitimacy, or integrity of the first compressed package (or the upgraded version of the upgrade software), such as one or more of the following: signature, message digest, account, password, etc.

[0134] The attributes of the first compressed file include one or more of the following: the size of the first compressed file, the size of the upgraded version of the upgrade software, and the version number of the upgraded version of the upgrade software.

[0135] As a possible example, the supplementary information of the first compressed package includes compression parameters and integrity and validity signature information. The compression parameters describe the configuration of the compression algorithm; for example, they may include one or more parameters such as the size of the probability array used for compression, the size of the sliding window used for compression, and the size of the data before compression. Optionally, the integrity and validity signature information of the first compressed package is a signature generated by signing the complete image before decompression using a signature algorithm and a signature key.

[0136] In some possible implementations, the computing device may obtain the first upgrade information in the following three ways:

[0137] Method 1: The computing device connects with the upgrade device, the upgrade device provides the first upgrade information to the computing device, and the computing device obtains the first upgrade information accordingly.

[0138] Method 2: The computing device is a terminal device, and it connects to the upgrade device, thereby connecting the computing device and the upgrade device. The upgrade device provides first upgrade information to the computing device, and the computing device accordingly obtains the first upgrade information. For example, the upgrade device can be a diagnostic device, which can connect to the computing device's bus system via a wired connection, thereby connecting to the computing device through the bus system and providing the first upgrade information to the computing device.

[0139] Method 3 involves connecting the upgrade device to the control device, and then connecting the control device to the computing device. The upgrade device provides first upgrade information to the control device, which in turn provides the first upgrade information to the computing device. For example, the upgrade device can be a server (such as an OTA server). The server sends an OTA upgrade package to the control device in OTA format. The OTA upgrade package includes the first upgrade information. During the process of distributing the upgrade information in the OTA upgrade package, the control device also distributes the first upgrade information to the computing device. Accordingly, the computing device receives the first upgrade information.

[0140] Furthermore, the control device can be part of the same device as the computing device. For example, the computing device could be the ECU in a vehicle, while the control device could be an OTA control node in the vehicle, such as a T-box.

[0141] Of course, the methods for obtaining first upgrade information described above are merely examples. Some solutions may employ other methods, such as obtaining the first upgrade information through copying from storage media.

[0142] In some possible implementations, the computing device may also obtain second upgrade information, which includes a second compressed package. The second compressed package is a compressed file obtained by compressing an upgraded version of the first APP, where the first APP is an APP. Optionally, the application software of the computing device only includes the first APP; that is, when the computing device is operating normally, the data stored in the first storage area is the first APP (including related data of the first application software), and the first compressed package is an upgraded version of all APPs that should originally be stored in the first storage area. Alternatively, when the computing device is operating normally, the data stored in the first storage area may include other files or APPs besides the first application software. In some solutions, the second compressed package may also be called an APP compressed image.

[0143] Optionally, the second upgrade information and the first upgrade information belong to the same upgrade package. The actions of obtaining the first upgrade information and obtaining the second upgrade information can be completed in one operation, for example, they can be replaced by obtaining the upgrade package of the computing device.

[0144] Furthermore, the second upgrade information also includes supplementary information of the second compressed package, or APP image header, which may optionally include one or more of the following: decompression parameters of the second compressed package, verification information of the second compressed package, and attribute data of the second compressed package. A related description can be found in the description of the supplementary information of the first compressed package. For example, the supplementary information of the second compressed package includes compression parameters and integrity and legality signature information. For instance, compression parameters include one or more of the following: the size of the probability array used for compression, the size of the sliding window used for compression, and the size of the data before compression.

[0145] In some possible implementations, the first storage unit also stores update software, which is used to perform one or more operations such as decompressing, verifying, and writing the first compressed package. Optionally, the update software may be carried along with the first upgrade information and stored in the first storage unit when storing the upgrade information. Alternatively, the update software may be permanently stored in the first storage unit, for example, stored in the basic function area.

[0146] S402: The computing device writes the first upgrade information to the first storage area.

[0147] For example, a computing device can invoke a flashing program to store first information upgrade information in a certain storage location in the first storage area.

[0148] For example, please refer to part (a) of Figure 5. Before the computing device stores the first upgrade information, the data stored in the first storage area includes the APP. Please refer to part (b) of Figure 5. The computing device can store the first upgrade information in the first storage area. At this time, the first storage area includes the first upgrade information. Figure 5 (b) illustrates this by taking the example that the first upgrade information includes a first compressed package and its ancillary information.

[0149] In some possible implementations, the difference between the size of the first storage area and the size of the app is less than the size of the upgraded version of the software. For example, in Figure 5(a), the size of the first storage area is 205KB, while the app's data size is 180KB, and the upgraded version of the software is 30KB. Therefore, after storing the app, the remaining storage space (26KB) in the first storage area is insufficient to directly store the upgraded version of the software. Compressing the upgraded version of the software will significantly reduce the space occupied by it.

[0150] In some possible implementations, the computing device erases the data in the first storage area before writing the first upgrade information to the first storage area. Referring to Figure 5(a), the computing device erases the APP in the first storage area.

[0151] In one possible design, if the size of the first upgrade information is greater than the remaining space in the first storage area, the computing device erases the data in the first storage area. That is, if the remaining space in the first storage area is sufficient to store the data of the first upgrade information, the data of the first upgrade information may not need to be erased.

[0152] In another possible design, if the size of the first upgrade information is less than or equal to the remaining space in the first storage area, the computing device provides the control device with the first data currently stored in the first storage area, such as the APP shown in part (a) of Figure 5. The control device compresses the data currently stored in the first storage area to form a third compressed package and provides the third compressed package to the computing device. Accordingly, the third compressed package provided by the control device is received and stored in the first storage area. The remaining space in the first storage area after storing the first compressed package is greater than the size of the first upgrade information. The control device and the computing device are connected.

[0153] In one possible implementation, if the computing device acquires the second upgrade information, it may also store the second upgrade information in the first storage area. It should be understood that the second upgrade information and the first upgrade information are stored in different locations within the first storage area.

[0154] S403: The computing device decompresses the first compressed package to obtain the upgraded version of the upgrade software.

[0155] For example, the computing device reads the first compressed package from the first storage area of ​​the first storage unit and decompresses it to obtain an upgraded version of the upgrade software.

[0156] In some possible implementations, the computing device needs to decompress the archive using decompression parameters. Two methods for decompressing the first compressed file are described below:

[0157] In decompression method 1, the decompression parameters of the first compressed package are carried within the first upgrade information. The computing device decompresses the first compressed package based on the decompression parameters in the first upgrade information to obtain the upgraded version of the upgrade software. That is, the decompression parameters of the first compressed package are acquired and stored along with the first compressed package. During decompression, the computing device can read the first compressed package and its decompression parameters from the first storage area of ​​the first storage unit, achieving offline decompression without relying on a connection or cooperation with a host computer.

[0158] In decompression method 2, the first decompression parameters are provided by the control device. The computing device receives the decompression parameters of the first compressed package provided by the control device, and decompresses the first compressed package based on the decompression parameters to obtain the upgraded version of the upgrade software. The control device is connected to the computing device. This control device can be a host computer of the computing device or a device that controls the upgrade process.

[0159] The decompression parameters for the first compressed file are not stored in the first storage area, but are provided by the host computer. This allows for better control over the upgrade process of the computing device, improving security. Furthermore, by not storing the decompression parameters in the first storage area, the storage resource consumption of the first storage unit can be further reduced.

[0160] Optionally, the first upgrade information may not include the decompression parameters of the first compressed package. Alternatively, the upgrade package provided to the terminal device may include the decompression parameters of the first compressed package, but the decompression parameters of the first compressed package are not stored in the first storage area, for example, they may be stored in the control device.

[0161] In some possible implementations, after decompressing the upgraded version of the upgrade software, the computing device can verify the upgraded version to improve the security performance of the computing device. This verification may include integrity verification and / or legality verification. As one possible implementation, the first upgrade information also includes verification information of the first compressed package, and the computing device verifies the upgraded version of the upgrade software based on the verification information of the first compressed package.

[0162] For example, the verification information of the first compressed package includes a signature of the upgraded version of the upgrade software. The computing device also obtains the certificate or verified public key of the device providing the first upgrade information, and can verify the signature of the upgraded version of the upgrade software through the public key, thereby verifying the legality and integrity of the upgraded version of the upgrade software.

[0163] As another example, the verification information in the first compressed package includes a message authentication code (MAC), which can be used in conjunction with a key to verify the integrity of the upgrade version of the upgrade software. The key can be pre-obtained by the computing device.

[0164] In some possible implementations, the computing device also includes RAM. After decompressing the first compressed package to obtain the upgraded version of the upgrade software, and before erasing the data in the upgrade software, the method further includes storing the upgraded version of the upgrade software in RAM. Since the upgraded version of the upgrade software needs to undergo verification processes, it is only written to the upgrade software area after it has been confirmed to be safe, complete, and legitimate. Before that, the upgraded version of the upgrade software can be temporarily stored in RAM. Utilizing the computing device's RAM for temporary storage eliminates the need to occupy additional space in the first storage unit, enabling verification of the upgraded version of the upgrade software even with limited storage space. This solves the problem of insufficient storage space in the first storage unit preventing the implementation of additional processes such as verification, and helps improve the stability of the upgrade process.

[0165] S404: The computing device erases the data in the upgrade software area.

[0166] Optionally, step S404 is an optional step and can be implemented according to the specific implementation of the storage control. For example, some storage technologies support directly writing data to the storage space. If data already exists in the storage space, the existing data will be overwritten. In this case, step S404 may not be executed. Alternatively, the execution of this step may be implemented internally by the controller, where data is erased before being written, and the data erasure process is invisible to the outside of the storage control.

[0167] S405: The computing device writes the upgraded version of the upgrade software to the upgrade software area.

[0168] As shown in part (c) of Figure 5, after the upgrade software is written, the upgrade software in the upgrade software area is updated to the upgrade version.

[0169] In some possible implementations, the first storage unit stores update software used to update and upgrade the software. When the update software is invoked, the operation of updating and upgrading the software is performed, namely, S403, S404 (optional) and S405 mentioned above.

[0170] In some cases, the upgrade software can be transmitted and stored as part of the first upgrade information. As shown in part (a) of Figure 5, the upgrade software is included in the first upgrade information, and after the computing device stores the first upgrade information, the update software is also stored in the first storage area.

[0171] In some cases, the upgrade software can be permanently stored in the first storage unit, such as in the basic function area.

[0172] In some possible implementations, the computing device also obtains second upgrade information. After the upgraded version of the upgrade software is written to the upgrade software area, the computing device can decompress the second compressed package to obtain the upgraded version of the first application software, and write the upgraded version of the first application software to the first storage area. Please refer to parts (a) and (b) of Figure 6, where the computing device decompresses the second compressed package and writes the decompressed APP to the first storage area.

[0173] In some possible implementations, the second upgrade information also includes decompression parameters for the second compressed package, for example, carried in the supplementary information of the second compressed package. The computing device decompresses the second compressed package based on the decompression parameters to obtain an upgraded version of the first application software. Based on the above scheme, offline decompression of the first application software can be achieved.

[0174] In some possible implementations, the second upgrade information also includes verification information for the second compressed package, for example, carried in the supplementary information of the second compressed package. Before the upgraded version of the first application software is written to the first storage area, the computing device verifies the upgraded version of the first application software based on the verification information of the second compressed package. This verification may include validity verification, integrity verification, security verification, etc. For example, the verification information may be signature information, and the verification process may be a signature verification process. Based on the above scheme, the data after the second compressed package is decompressed can be verified, which can improve the security performance of the computing device. Furthermore, if the verification is successful, the computing device writes the upgraded version of the first application software to the first storage area.

[0175] In some possible implementations, when decompressing the second compressed package, the computing device obtains the available storage space in the first storage area and decompresses the second compressed package by a size smaller than the available storage space in the current application partition, ensuring that the decompressed data can be written normally to the first storage area. For example, the computing device can decompress the second compressed package multiple times and erase the decompressed portion of the second compressed package after decompression, thereby ensuring that the decompressed data can be written normally to the first storage area. For example, the computing device can obtain the available storage space in the first storage area and determine that the available storage space in the first storage area is larger than the size of the currently decompressed file of the second compressed package. Based on the above scheme, it can be ensured that the decompressed data is stored completely, which can improve the upgrade success rate and the stability of the upgrade process of the computing device. Optionally, the second upgrade information also includes the size of the decompressed file of the second compressed package. For example, the size of the decompressed file of the second compressed package (or the original data size of the first upgrade software) can be carried in the auxiliary information of the second compressed package.

[0176] In some possible implementations, the operation of decompressing the second compressed package and writing the upgraded version of the first upgrade software is achieved by running the upgraded version of the upgrade software. Specifically, the computing device can call the upgraded version of the upgrade software in the upgrade software area, and after the upgraded version of the upgrade software runs, perform the following operations: decompress the second compressed package to obtain the upgraded version of the first application software, and write the upgraded version of the first application software to the first storage area. Further, after the upgraded version of the upgrade software runs, the following operations are also performed: verify the upgraded version of the first application software.

[0177] In some possible implementations, the basic functional area also includes a jump area. The software in the jump area is used to jump to the corresponding storage location in the first storage unit based on whether certain conditions are met, in order to run the software at that storage location. The jump area enables conditional execution of multiple software programs stored in the first storage unit, ensuring that the operation of the computing device conforms to the current conditions and improving the success rate of upgrades.

[0178] In some possible implementations, the first storage unit further includes a boot area, the software of which is used to execute an initialization process and jump to a jump area to execute the software in the jump area when the computing device starts up. Booting here includes various boot scenarios such as restart, booting after a reset, and booting under normal conditions.

[0179] In some possible implementations, the first storage unit stores the update software. After writing the first upgrade information to the first storage area, the computing device can set the parameter value of the first parameter to ensure that the conditions for updating the software are met. Further, the computing device runs the software in the jump area to perform the following operations: if the conditions for updating the software are met, jump to the storage location of the update software to run it. Based on the above scheme, by setting the parameter value to trigger the jump area to jump to different storage locations for execution, the operation process of the computing device can be designed, improving the upgrade success rate.

[0180] Optionally, the first parameter can be one parameter or multiple parameters. For example, setting the first parameter includes setting a first flag (e.g., called a reprogramming flag) to a first value and setting a second flag (e.g., called an upgrade software update flag) to a second value. When the first flag is at its first value and the second flag is at its second value, the jump area jumps to the storage location of the update software to run the update software.

[0181] In some possible implementations, after setting the value of the first parameter, a reset can be triggered, causing the program in the first storage unit to start execution from the startup area and reach the jump area, thus achieving conditional jump. After setting the value of the first parameter, the method further includes enabling the computing device to restart. That is, enabling the computing device to reset.

[0182] In some possible implementations, after writing the upgraded version of the upgrade software to the upgrade software area, the computing device sets the parameter value of the second parameter so that the conditions for updating the upgrade software are not met while the conditions for decompressing the application software are met. Further, the computing device runs the software in the jump area to perform the following operations: if the conditions for decompressing the application software are met, jump to the upgrade software area. Run the upgraded version of the upgrade software to perform the following operations: decompress the second compressed package to obtain the upgraded version of the first application software, and write the upgraded version of the first application software to the first storage area. Optionally, the following operation may also be performed: verify the upgraded version of the first application software. For details of the specific execution, please refer to the foregoing steps.

[0183] Optionally, the first parameter and the second parameter may be the same or different. Alternatively, if at least one of the first and second parameters includes multiple parameters, the first and second parameters may be partially the same. For example, the second parameter may include multiple parameters, and setting the second parameter includes: setting a second flag (e.g., referred to as an upgrade software update flag) to a third value, and setting a third flag (e.g., referred to as an unzip application software flag) to a fourth value. When the second flag is at the third value and the third flag is at the fourth value, the jump area jumps to the storage location of the upgrade software to run the upgrade software.

[0184] In some possible implementations, the computing device sets the value of the third parameter to ensure that the conditions for running the application software are met. Further, the computing device runs the software in the jump area to perform the following operations: if the conditions for running the application software are met, it jumps to the first storage area to run the application software in the first storage area. For example, referring to part (b) of Figure 6, after the APP is written to the first storage area, the computing device sets the value of the third parameter to ensure that the conditions for running the APP are met. When the software in the jump area is run, it jumps to the storage address of the APP to run the APP.

[0185] Similarly, the third parameter may be the same as, different from, or partially the same as the aforementioned first and third parameters. For example, the third parameter may include multiple parameters, and setting the third parameter includes setting a third flag (e.g., referred to as the decompression application software flag) to a fifth value and setting a first flag (e.g., referred to as the reprogramming flag) to a sixth value. When the third flag is at its fifth value and the first flag is at its sixth value, the jump area jumps to the application software's storage location to run the application software.

[0186] In the embodiment shown in Figure 4, the upgraded version of the software is transmitted and stored in the form of a compressed package, and then decompressed and written during the upgrade, significantly reducing the space occupied by the upgraded software. Moreover, the above embodiment has simple steps, low requirements for computing power, and good compatibility. The execution of each step of this method is highly smooth, and the operation of updating the software does not involve complex processes such as multiple upgrade package pushes and switching to backup upgrade software. The upgrade process is fast, less prone to maintenance problems, and has high stability and reliability.

[0187] In summary, the embodiment shown in Figure 4 enables simple, quick, and reliable self-upgrading of software, significantly reducing the maintenance costs of computing devices and improving the user experience. Especially when computing devices have limited storage resources, the solution provided in this application can solve the self-upgrading problem of software without additional resource support.

[0188] The embodiments shown in Figure 4 above illustrate various possible implementations. Further descriptions of some possible implementations of this application follow. The execution logic, terminology, etc., mentioned below can be found in the descriptions of the embodiments shown in Figure 4.

[0189] Please refer to Figure 7, which is a flowchart illustrating a method for updating and upgrading software according to an embodiment of this application. Optionally, this method is applied to an upgrade system, such as the upgrade system shown in Figure 3. The method for updating and upgrading software as shown in Figure 7 may include one or more steps from S701 to S706. It should be understood that, for ease of description, the steps are described in the order of S701 to S706, but this embodiment of the application does not limit the order of execution, the execution time, or the number of executions of the above one or more steps. S701 to S706 are as follows:

[0190] S701: Upgrade the device's compression software to an upgraded version, resulting in the first compressed package.

[0191] Upgrade equipment is a device with processing and communication capabilities that can compress data and transmit upgrade information to vehicles.

[0192] Optionally, the upgrade device also compresses the upgraded version of the first application software to obtain a second compressed package. It should be noted that the upgraded version of the first application software here may be the same as the version of the first application software currently stored in the computing device (for example, it has not been upgraded, but has only been compressed to save storage space), although the versions may be different.

[0193] S702: The upgrade device sends the first upgrade information to the terminal device.

[0194] Accordingly, the terminal device receives the first upgrade information. The terminal device includes a computing device, or the terminal device is connected to a computing device, and the terminal device can provide the first upgrade information to the computing device.

[0195] Taking a vehicle as an example, the upgrade master node in the vehicle receives an upgrade package provided by the upgrade device, which includes first upgrade information. The upgrade master node then distributes the first upgrade information to the computing device, which receives the upgrade information.

[0196] The first upgrade information includes a first compressed package. Optionally, the first upgrade information also includes an image of the updated software. Optionally, the first upgrade information also includes supplementary information of the first compressed package, or referred to as the header of the first compressed package. For example, the upgrade device loads one or more of the following as headers before the first compressed package: the write address of the original data, the parameters of the compression algorithm, the length of the original data blocks, and the signature information of the data.

[0197] Optionally, the upgrade device also sends second upgrade information to the terminal device. Correspondingly, the terminal device receives the second upgrade information and provides it to the computing device. Optionally, the second information also includes supplementary information of the second compressed package. For example, the upgrade device may load one or more of the following as a header at the beginning of the first compressed package: the write address of the upgraded version of the first application software, the parameters of the compression algorithm, the length of the original data block, and the signature information of the data.

[0198] Optionally, the first upgrade information and the second upgrade information can be sent in the same upgrade package. For example, the aforementioned upgrade package may also include the second upgrade information.

[0199] In some schemes, the write address of the upgraded version of the upgrade software is lower than the write address of the first application software.

[0200] In some other solutions, when the first upgrade information includes the image of the updated software, the starting address of the updated software needs to be consistent with the starting address of the application. That is, when jumping in the jump area, it can jump to the starting address of the application.

[0201] S703: The computing device writes the first upgrade information to the first storage area.

[0202] S704: The computing device decompresses the first compressed package to obtain the upgraded version of the upgrade software.

[0203] S705: Wipe data in the upgrade software area of ​​the computing device.

[0204] S706: The computing device writes the upgraded version of the upgrade software to the upgrade software area.

[0205] For a detailed description of steps S703-S706 above and possible implementation methods, please refer to the embodiment shown in Figure 4.

[0206] Please refer to Figure 8. The embodiment shown in Figure 8 uses BootLoader as an example for illustration. Of course, in some cases, the upgrade software may have other names. This method can be applied to computing devices, such as the computing devices mentioned in the foregoing embodiments.

[0207] The specific details of the first storage unit in the embodiment shown in Figure 8 will be described below. As shown in Figure 9, the first storage unit includes a BootLoader startup area (which can be considered as a startup area), a BootLoader jump area (which can be considered as a jump area), a BootLoader running area, and an application running area (or application area). These will be described in detail below:

[0208] The BootLoader's startup area starts at address 0x0000 0000. After the software in the BootLoader runs, it initializes the boot sector and loads and initializes basic peripherals. After initialization, the computing device's BootLoader jump area begins execution.

[0209] During bootloader execution, the jump area encompasses two scenarios. In the first scenario, when the reprogramming flag is valid, it's assumed there's an external programming request, and the program jumps to the BootLoader runtime area (which can be considered the upgrade software area) to run. In the second scenario, when the reprogramming flag is invalid, it's assumed there's no external programming request. For this solution, the computing device further determines whether the BootLoader upgrade flag is valid, resulting in two branches. Branch 1: If valid, it jumps to the storage location (e.g., the starting address of the update software) of the update software in the application runtime area (which can be considered the first storage area) to begin updating the BootLoader. Branch 2: For the scenario where the BootLoader upgrade flag is invalid, it further determines whether the APP flag is valid. If valid, the program jumps to the APP's starting address in the application area to run. Otherwise, the program jumps back to the BootLoader runtime area.

[0210] During runtime, the BootLoader first checks if the app decompression flag is valid. If valid, it erases the first upgrade information from the application partition, decompresses the second compressed package, and writes it to the application partition.

[0211] The application runtime area is where the ECU runs during normal operation. When running the application (APP) in the application runtime area, the computing device has complete communication and application functions.

[0212] The specific process shown in Figure 8 is described below. The method illustrated in Figure 8 may include the following steps: storing upgrade information, updating the upgrade software, updating the app, and ensuring the app runs normally. These will be described in detail below:

[0213] During the storage upgrade information process, after the computing device starts up, it jumps to the BootLoader runtime area via a jump zone. At this time, the BootLoader runtime area still runs the old version of the BootLoader. The specific steps are as follows:

[0214] S81 runs the software in the BootLoader startup area.

[0215] S82 is the software that runs the BootLoader jump area.

[0216] Optionally, before the process starts, when the computing device receives the first upgrade information and the second upgrade information, the computing device sets the reprogramming flag to valid and the decompressing APP flag to invalid, so that the execution conditions of the storage upgrade information process are met.

[0217] S812, jump to the BootLoader runtime area.

[0218] After jumping to the BootLoader runtime area, the BootLoader in the BootLoader runtime area is run to perform the following steps S83-S86.

[0219] S83 stores the first upgrade information and the second upgrade information in the first storage area.

[0220] S84, set the reprogramming flag to invalid.

[0221] S85, set the BootLoader upgrade flag to enabled.

[0222] S86, Reset.

[0223] The storage upgrade information process ends. After a reset, the computing device either restarts the software in the Bootloader startup area, or it starts executing the software in the Bootloader jump area. This example illustrates the former, where the computing device executes the software in the Bootloader startup area after a reset.

[0224] During the software update / upgrade process, after startup, the computing device jumps to the starting address of the software update via a jump area to update the software. The specific steps are as follows:

[0225] S81 runs the software in the BootLoader startup area.

[0226] S82 is the software that runs the BootLoader jump area.

[0227] In summary, once the storage upgrade information process is complete, the reprogramming flag is invalidated, the BootLoader upgrade flag is set to valid, and the conditions for updating and upgrading the software are met. The BootLoader jump area then jumps to the storage location of the updated software.

[0228] S87 redirects to the update software's storage location and runs the update software.

[0229] S88 decompresses the first compressed file into the BootLoader runtime area.

[0230] Specifically, the computing device decompresses the first compressed package to obtain an upgraded version of the BootLoader and writes it into the BootLoader runtime area.

[0231] Optionally, the computing device verifies the upgraded version of the BootLoader before writing it to the BootLoader runtime area.

[0232] Optionally, after the BootLoader runtime area starts running, the computing device verifies whether the compressed image of the BootLoader is complete. If it is complete, the image is decompressed.

[0233] S89, set the reprogramming flag to active.

[0234] S810, set the BootLoader upgrade flag to invalid.

[0235] S811, set the decompression APP flag to active.

[0236] S86, Reset.

[0237] The software update / upgrade process is now complete.

[0238] During the app update process, after the computing device starts up, it jumps to the BootLoader runtime area via a redirection area to update the app. The specific steps are as follows:

[0239] S81 runs the software in the BootLoader startup area.

[0240] S82 is the software that runs the BootLoader jump area.

[0241] S812, jump to the BootLoader runtime area.

[0242] S813 decompresses the second compressed package and writes it to the first storage area.

[0243] Optionally, the computing device copies the driver of the first storage unit to the RAM partition, calls the driver of the first storage unit, and erases the BootLoader Updater image and the BootLoader compressed image in the application runtime area.

[0244] Optionally, after decompressing and writing all the data in the compressed APP image, it is necessary to read the signature in the header of the compressed APP image to complete the integrity and legality verification of the APP image.

[0245] S814, set the decompression APP flag to invalid.

[0246] S815, set the reprogramming flag to invalid.

[0247] S816, set the APP flag to active.

[0248] S86, Reset.

[0249] The software update / upgrade process is now complete.

[0250] In a normally running app, after startup, the computing device jumps to the app's starting address in the application runtime area via a jump area to run the app. The specific steps are as follows:

[0251] S81 runs the software in the BootLoader startup area.

[0252] S82 is the software that runs the BootLoader jump area.

[0253] S817, jump to the application runtime area to run.

[0254] In the embodiment shown in Figure 8, the computing device reduces the data size of the upgraded BootLoader version and the APP through data compression, thereby reducing the upgrade transmission time. Furthermore, when storing upgrade information, the compressed files of the BootLoader and the APP are stored together, reducing the number of times the storage unit needs to be written and improving upgrade efficiency. The embodiment shown in Figure 8 maximizes the use of the storage space of the first storage unit, enabling simple, fast, and reliable self-upgrades of the upgrade software, significantly reducing the maintenance cost of the computing device and improving the user experience.

[0255] The foregoing has described the application scenarios and methods provided by the embodiments of this application. The apparatus of the embodiments of this application is provided below. It is understood that the various apparatuses provided in the embodiments of this application, such as interactive devices, computing devices, chips, etc., include hardware structures, software units, or combinations of hardware and software structures to perform the functions described in the above method embodiments. Those skilled in the art should readily recognize that the apparatus and modules within it can be implemented in hardware or a combination of hardware and computer software in conjunction with the various functions described in the embodiments disclosed herein. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different apparatus implementations in different application scenarios to implement the aforementioned method embodiments, and different implementations of the apparatus should not be considered beyond the scope of the embodiments of this application.

[0256] Several possible devices are listed below.

[0257] Please refer to Figure 10, which is a schematic diagram of the structure of a computing device provided in an embodiment of this application. The computing device 100 includes an acquisition unit 1002 and a processing unit 1001. The computing device 100 can be a standalone device, such as the computing device 11 shown in Figure 1, or an in-vehicle device in the vehicle 100 shown in Figure 3. Alternatively, the computing device 100 can also be a software module and / or hardware module in a standalone device, such as a chip in the in-vehicle device of the vehicle 100 shown in Figure 3.

[0258] The computing device 100 is used to implement the aforementioned method for updating and upgrading software, such as the method executed by the computing device in the embodiments shown in FIG4, FIG7, or FIG8. The processing unit 1001 is used to process data and perform operations, such as implementing one or more of the aforementioned operations including data processing, program execution, storage, verification, decompression, compression, and decision-making (e.g., judgment). The acquisition unit 1002 is used to acquire data, such as performing the aforementioned acquisition and reception operations.

[0259] In one possible implementation, the acquisition unit 1002 is used to acquire first upgrade information, and the processing unit 1001 is used to write the first upgrade information into a first storage area, decompress the first compressed package to obtain the upgrade version of the upgrade software, erase the data in the upgrade software area, and write the upgrade version of the upgrade software into the upgrade software area.

[0260] In another possible implementation, the first upgrade information also includes decompression parameters for the first compressed package. The processing unit 1001 is used to decompress the first compressed package based on the decompression parameters to obtain an upgraded version of the upgrade software.

[0261] In another possible implementation, the first compressed package is decompressed to obtain an upgraded version of the upgrade software. The acquisition unit 1002 receives decompression parameters for the first compressed package provided by the control device, and the processing unit 1001 decompresses the first compressed package based on the decompression parameters to obtain the upgraded version of the upgrade software. The control device is connected to the computing device. The control device can be a host computer of the computing device or a device that controls the upgrade process.

[0262] In another possible implementation, the first upgrade information also includes verification information of the first compressed package. The processing unit 1001 is further configured to verify the upgrade version of the upgrade software based on the verification information of the first compressed package.

[0263] In another possible implementation, the first storage unit stores update software used to update and upgrade the software. The processing unit 1001 is also used to run the update software. Optionally, the update software may be stored in the basic function area, or the update software may be stored in the first storage area.

[0264] In another possible implementation, the processing unit 1001 is further configured to erase the data of the first upgrade information in the first storage area.

[0265] In another possible implementation, the processing unit 1001 is also used to erase data in the first storage area.

[0266] In another possible implementation, the processing unit 1001 is further configured to erase the data in the first storage area if the data size of the first upgrade information is greater than the remaining space size of the first storage area.

[0267] In another possible implementation, the computing device 100 further includes a sending unit, configured to provide the control device with the first data currently stored in the first storage area when the data size of the first upgrade information is less than or equal to the remaining space size of the first storage area. The acquisition unit 1002 is further configured to receive a third compressed package provided by the control device, the third compressed package being a compressed package formed by compressing the first data. The processing unit 1001 is further configured to store the third compressed package in the first storage area.

[0268] In another possible implementation, the acquisition unit 1002 is further configured to acquire second upgrade information, which includes a second compressed package. The processing unit 1001 is further configured to write the second upgrade information into a first storage area, wherein the second upgrade information and the first upgrade information are stored in different locations within the first storage area. The processing unit 1001 is further configured to decompress the second compressed package to obtain an upgraded version of the first application software, and write the upgraded version of the first application software into the first storage area. Here, the second compressed package is a compressed file obtained by compressing the upgraded version of the first application software, and the first application software is application software.

[0269] In another possible implementation, the second upgrade information also includes decompression parameters for the second compressed package. The processing unit 1001 is further configured to decompress the second compressed package based on the decompression parameters to obtain an upgraded version of the first application software.

[0270] In another possible implementation, the second upgrade information includes verification information of the second compressed package. The processing unit 1001 is further configured to verify the upgrade version of the first application software based on the verification information of the second compressed package.

[0271] In another possible implementation, when decompressing the second compressed package, the processing unit 1001 needs to obtain the available storage space in the current first storage area and decompress the second compressed package by a size smaller than the available storage space in the current application partition, ensuring that the decompressed data can be written normally to the first storage area. For example, the processing unit 1001 can decompress the second compressed package multiple times and erase the decompressed portion of the second compressed package after decompression, thereby ensuring that the decompressed data can be written normally to the first storage area.

[0272] In another possible implementation, the acquisition unit 1002 is further configured to acquire the available storage space of the first storage area, and the processing unit 1001 is further configured to determine that the available storage space of the first storage area is greater than the size of the decompressed file of the second compressed package. Optionally, the second upgrade information may also include the size of the decompressed file of the second compressed package.

[0273] In another possible implementation, the first storage unit stores the update software. The processing unit 1001 is further configured to set the parameter value of the first parameter so that the conditions for updating the software are met. The processing unit 1001 is also configured to run the software in the jump area to perform the following operation: if the conditions for updating the software are met, jump to the storage location of the update software to run the update software.

[0274] In another possible implementation, the processing unit 1001 is further configured to set the parameter value of the second parameter so that the conditions for updating and upgrading the software are not met, while the conditions for decompressing the application software are met. The processing unit 1001 is further configured to run the software in the jump area to perform the following operations: if the conditions for decompressing the application software are met, jump to the upgrade software area. The processing unit 1001 is further configured to run an upgraded version of the upgrade software to perform the following operations: decompress the second compressed package to obtain an upgraded version of the first application software, and write the upgraded version of the first application software to the first storage area.

[0275] In another possible implementation, the processing unit 1001 is further configured to set the parameter value of the third parameter so that the conditions for running the application software are met. The processing unit 1001 is also configured to run the software in the jump area to perform the following operations: if the conditions for running the application software are met, jump to the first storage area to run the application software in the first storage area.

[0276] The specific operations performed by the computing device 100 can also be found in the embodiments shown in Figures 4, 7 or 8.

[0277] Please refer to Figure 11, which is a schematic diagram of an upgrade device provided in an embodiment of this application. The upgrade device 110 includes a compression unit 1101 and a communication unit 1102. The upgrade device 110 can be a standalone device, such as the server shown in Figure 2, or a diagnostic device. Alternatively, the computing device 100 can also be a software module and / or hardware module in a standalone device, such as a chip in a server.

[0278] The upgrade device 110 is used to implement the aforementioned method for updating and upgrading software, for example, to implement the method performed by the upgrade device in the embodiment shown in FIG7. The communication unit 1102 is used to implement communication-related operations, such as sending or receiving, and the compression unit is used to compress data. In addition, it can also perform other processing operations.

[0279] In one possible implementation, compression unit 1101 is used to compress the upgraded version of the upgrade software to obtain a first compressed package, and communication unit 1102 is used to send first upgrade information to the terminal device, the first upgrade information including the first compressed package.

[0280] In one possible implementation, compression unit 1101 is used to compress an upgraded version of the first application software to obtain a second compressed package, and communication unit 1102 is used to send second upgrade information to the terminal device.

[0281] Figure 12 shows a schematic diagram of a computing device provided in an embodiment of this application. The computing device 11 is a device with computing capabilities, and the device here can be a physical device, such as an embedded device. Optionally, the computing device 11 can be included in a vehicle, for example, as an on-board component in the vehicle 100 shown in Figure 2.

[0282] As shown in Figure 12, the computing device 11 includes a processor 111 and a memory 113. Optionally, the computing device 11 may also include one or more of a connection line 115, a communication interface 114, etc. For example, the processor 111 and the memory 113 communicate with each other via the connection line 115. It should be understood that this application does not limit the number of processors and memories in the computing device 11.

[0283] The memory 113 provides storage space for computer programs or data. For example, the memory 113 includes a first storage unit 112 for storing the aforementioned boot area software, jump area software, upgrade software, APP, update software, etc. The memory 113 may include volatile memory, such as random access memory (RAM). The memory 113 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD).

[0284] Processor 111 is a module that performs computations and may include any one or more of the following: controller, central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), digital signal processor (DSP), coprocessor (to assist the central processing unit in completing corresponding processing and applications), application-specific integrated circuit (ASIC), microcontroller unit (MCU), virtual machine, container, etc.

[0285] The communication interface 114 is used to provide information input or output to at least one processor, such as an in-line interface, an out-of-line interface, etc. And / or, the communication interface 114 can be used to receive externally transmitted data and / or transmit data externally. The communication interface 114 can be a wired link interface including an Ethernet cable, or a wireless link interface (Wi-Fi, Bluetooth, general wireless transmission, and other wireless communication technologies, etc.). Optionally, the communication interface 114 may also include a transmitter (such as a radio frequency transmitter, antenna, etc.) or a receiver coupled to the interface.

[0286] Connection line 115 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one line is used in Figure 12, but this does not imply that there is only one bus or one type of bus. Connection line 115 can include pathways for transmitting information between various components of computing device 11 (e.g., memory 113, processor 111, communication interface 114).

[0287] In one possible implementation, memory 113 stores executable instructions, which processor 111 executes to implement the aforementioned method for updating and upgrading software, such as the method executed by the computing device in the embodiments shown in FIG4, FIG7 or FIG8.

[0288] Figure 13 shows a schematic diagram of an upgrade device provided in an embodiment of this application. The upgrade device 130 is a device with computing and communication capabilities. The device can be a physical device, such as a server or diagnostic device, or a virtual device, such as a cloud service or virtual machine.

[0289] As shown in Figure 13, the upgrade device 130 includes a processor 1301 and a memory 1302. Optionally, the upgrade device 130 may also include one or more of a connection line 1303, a communication interface 1304, etc. For example, the processor 1301 and the memory 1302 communicate with each other via the connection line 1303. A description of the relevant components can be found in the description of the components shown in Figure 12 above. It should be understood that this application does not limit the number of processors and memories in the upgrade device 130.

[0290] In one possible implementation, the memory 1302 of the upgrade device 130 stores executable instructions, and the processor 1301 executes the executable instructions to implement the aforementioned method for updating and upgrading software, such as the method executed by the upgrade device in the embodiment shown in FIG7.

[0291] This application also provides a chip including a processor and a communication interface. The communication interface is used for outputting and / or outputting data (including instructions), and / or for receiving and / or sending data. When the processor executes program instructions in memory, it performs the aforementioned method for updating and upgrading software, for example, implementing the method executed by the computing device in the embodiments shown in FIG4, FIG7, or FIG8.

[0292] This application provides a computer-readable storage medium storing instructions that, when executed by at least one processor, implement the aforementioned method for updating and upgrading software, such as the method shown in the embodiments of FIG4, FIG7, or FIG8. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. The computer-readable storage medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).

[0293] This application provides a computer program product including computer instructions that, when executed on at least one processor, implement the aforementioned method for updating and upgrading software, such as the method in the embodiments shown in FIG4, FIG7, or FIG8. Optionally, the computer program product may be a software installation package or image package. When the aforementioned method is required, the computer program product can be downloaded and executed on a computing device.

[0294] This application provides a vehicle that includes the aforementioned computing device 100, or the aforementioned computing equipment 11, or the aforementioned chip, or the aforementioned computer storage medium, or the aforementioned computer program product deployed on the vehicle.

[0295] In addition, a few additional points need to be made regarding this application:

[0296] 1. Unless otherwise stated, “multiple” means two or more.

[0297] 2. Unless otherwise specified or in case of logical conflict, the terms and / or descriptions in different embodiments of this application are consistent and can be referenced in each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.

[0298] III. The various numerical designations used in this application are merely for descriptive convenience and are not intended to limit the scope of protection of this application. The magnitude of the serial numbers used in this application does not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic. For example, the terms "first," "second," "third," "fourth," and other various terminology (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein.

[0299] Furthermore, any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner for ease of understanding.

[0300] IV. The terms “comprising” and “having” and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are expressly listed, but may include other steps or units that are not expressly listed or that are inherent to such process, method, product or device.

[0301] V. In this application, "for indicating" can be understood as "enabling". "Enabling" can include direct enabling and indirect enabling. When describing information for enabling A, it can include whether the information directly enables A or indirectly enables A, but it does not mean that the information necessarily carries A.

[0302] The information that enables the information is called the information to be enabled. In the specific implementation process, there are many ways to enable the information to be enabled, such as, but not limited to, directly enabling the information to be enabled, such as the information to be enabled itself or its index. It can also be indirectly enabled by enabling other information, where there is a relationship between the other information and the information to be enabled. It can also enable only a part of the information to be enabled, while the other parts are known or pre-agreed upon. For example, enabling specific information can be achieved by using a pre-agreed (e.g., protocol-defined) arrangement of various pieces of information, thereby reducing enabling overhead to some extent. Simultaneously, common parts of various pieces of information can be identified and enabled uniformly to reduce the enabling overhead caused by individually enabling the same information.

[0303] VI. In this application, "predefined" may include preconfiguration. For example, predefining certain information means that the information is calculated or received in advance before performing an action that uses the information. The "predefined" can be implemented by pre-storing corresponding codes, tables, or other means that can be used to indicate relevant information in the device (e.g., in a controller or vehicle). This application does not limit the specific implementation method.

[0304] VII. The term "storage" or "preservation" in this application can refer to storage in one or more memory devices. These memory devices can be separately configured or integrated into an encoder, decoder, processor, or communication device. Alternatively, some memory devices can be separately configured, while others can be integrated into a decoder, processor, or communication device. The type of memory can be any form of storage medium, and this is not limited.

[0305] 8. In the schematic diagrams in the accompanying drawings of this application, the dashed arrows or boxes indicate optional steps or optional modules.

[0306] 9. Unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can mean A or B. In this application, "and / or" is merely a description of the relationship between the related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. A and B can be singular or plural.

Claims

1. A method of updating software upgrades, characterized by, The invention is applied to a computing device, the computing device including a first storage unit, the first storage unit including a basic functional area and a first storage area, the basic functional area including an upgrade software area, the upgrade software area including storage space for storing upgrade software, the upgrade software being used to update application software, the first storage area including available storage space outside the basic functional area, and the application software being stored in the first storage area; The method includes: Obtain first upgrade information, the first upgrade information including a first compressed package, the first compressed package being a compressed file obtained by compressing the upgrade version of the upgrade software; Write the first upgrade information into the first storage area; Decompress the first compressed package to obtain the upgraded version of the upgrade software; Erase the data in the upgraded software area; Write the upgraded version of the upgrade software into the upgrade software area.

2. The method of claim 1, wherein, The difference between the size of the first storage area and the size of the application software is less than the size of the upgraded version of the upgrade software.

3. The method according to claim 1 or 2, characterized in that, The upgrade software is a bootloader, the computing device is an embedded device, and the computing device is located in the vehicle.

4. The method according to any one of claims 1 to 3, characterized in that, The first upgrade information also includes the decompression parameters of the first compressed package; The process of decompressing the first compressed package to obtain an upgraded version of the upgrade software includes: The first compressed package is decompressed based on the decompression parameters of the first compressed package to obtain the upgraded version of the upgrade software.

5. The method according to any one of claims 1 to 4, characterized in that, The first upgrade information also includes verification information for the first compressed package; After decompressing the first compressed package to obtain the upgraded version of the upgrade software, and before writing the upgraded version of the upgrade software into the upgrade software area, the method further includes: The upgrade version of the upgrade software is verified based on the verification information of the first compressed package.

6. The method of claim 5, wherein, The computing device further includes random access memory (RAM). After decompressing the first compressed package to obtain the upgraded version of the upgrade software, and before erasing the data in the upgrade software, the method further includes: The upgraded version of the upgraded software is stored in the RAM; The step of writing the upgraded version of the upgrade software into the upgrade software area includes: If the upgrade version of the upgrade software is successfully verified, the upgrade version of the upgrade software stored in the RAM is written into the upgrade software area.

7. The method according to any one of claims 1 to 6, characterized in that, The first storage unit stores update software, which is used to update the upgrade software; After writing the first upgrade information to the first storage area, the method further includes: Running the update software causes the following operation in claim 1 to be performed: Decompress the first compressed package to obtain the upgraded version of the upgrade software; Erase the data in the upgraded software area; Write the upgraded version of the upgrade software into the upgrade software area.

8. The method of claim 7, wherein, The updated software is stored in the first storage area, and the first upgrade information also includes the updated software.

9. The method according to any one of claims 1 to 8, characterized in that, After writing the upgraded version of the upgrade software into the upgrade software area, the method further includes: Erase the data of the first upgrade information in the first storage area.

10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: Obtain second upgrade information, the second upgrade information includes a second compressed package, the second compressed package is a compressed file obtained by compressing the upgrade version of the first application software, the first application software belongs to the application software; The second upgrade information is written into the first storage area, and the second upgrade information and the first upgrade information are stored in different locations in the first storage area; After writing the upgraded version of the upgrade software into the upgrade software area, the method further includes: Decompress the second compressed package to obtain an upgraded version of the first application software; Write the upgraded version of the first application software into the first storage area.

11. The method of claim 10, wherein, The second upgrade information also includes the decompression parameters of the second compressed package. The process of decompressing the second compressed package to obtain an upgraded version of the first application software includes: Based on the decompression parameters of the second compressed package, the upgraded version of the first application software is obtained by decompressing the second compressed package.

12. The method according to claim 10 or 11, characterized in that, The second upgrade information includes the verification information of the second compressed package; After decompressing the second compressed package to obtain the upgraded version of the first application software, and before writing the upgraded version of the first application software into the first storage area, the method further includes: The upgrade version of the first application software is verified based on the verification information in the second compressed package.

13. The method according to any one of claims 10-12, characterized in that, The second upgrade information also includes the size of the extracted file of the second compressed package; Before decompressing the second compressed package to obtain the upgraded version of the first application software, the method includes: Obtain the available storage space in the first storage area; It is determined that the available storage space in the first storage area is greater than the size of the decompressed file of the second compressed package.

14. The method as claimed in any one of claims 1 to 13, characterized in that The basic functional area also includes a jump area, where the software in the jump area is used to jump to the corresponding storage location of the first storage unit based on the condition that is met, so as to run the software at the corresponding storage location.

15. The method of claim 14, wherein, The first storage unit stores updated software. After writing the first upgrade information to the first storage area and before decompressing the first compressed package to obtain the upgraded version of the upgrade software, the method further includes: Set the value of the first parameter so that the conditions for updating the upgraded software are met; Run the software in the jump area to perform the following operations: If the conditions for updating the software are met, the system will jump to the storage location of the updated software to run the updated software.

16. The method of claim 15, wherein, After writing the upgraded version of the upgrade software into the upgrade software area, the method further includes: Set the value of the second parameter so that the conditions for updating the upgraded software are not met and the conditions for decompressing the application software are met. Run the software in the jump area to perform the following operations: If the decompression application software is satisfied, then proceed to the upgrade software area; Run an upgraded version of the upgrade software to perform the following operations as described in claim 8: Decompress the second compressed package to obtain an upgraded version of the first application software; Write the upgraded version of the first application software into the first storage area.

17. The method according to any one of claims 14-16, characterized by, The method further includes: Set the value of the third parameter so that the conditions for running the application software are met; Run the software in the jump area to perform the following operations: If the conditions for running the application software are met, the system jumps to the first storage area to run the application software in the first storage area.

18. The method according to any one of claims 1 to 17, characterized in that, The computing device is included in the terminal device, which is communicatively connected to the upgrade device, which is an over-the-air (OTA) upgrade server or a diagnostic device. The acquisition of the first upgrade information includes: Obtain first upgrade information from the upgrade device.

19. A method for updating and upgrading software, applied to upgrading equipment, the method comprising: The upgraded version of the compression software produces the first compressed file. Send first upgrade information to a terminal device. The first upgrade information includes the first compressed package. The terminal device includes a computing device, which includes a first storage unit. The first storage unit includes a basic function area and a first storage area. The basic function area includes an upgrade software area. The upgrade software area includes storage space for storing the upgrade software, which is used to update application software. The first storage area includes available storage space outside the basic function area. The application software is stored in the first storage area.

20. The method of claim 19, wherein, The first upgrade information also includes the compression parameters of the first compressed package, and / or the first upgrade information also includes the verification information of the first compressed package.

21. The method of claim 19 or 20, wherein, The first upgrade information also includes updated software, which is used to update the upgrade software.

22. The method according to any one of claims 19-21, characterized in that, The method further includes: An upgraded version of the first application software is compressed to obtain a second compressed package, wherein the first application software is a subset of the application software. Send a second upgrade message to the terminal device, the second upgrade message including the second compressed package.

23. The method of claim 22, wherein, The second upgrade information also includes the compression parameters of the second compressed package, and / or, the second upgrade information also includes the verification information of the second compressed package.

24. A computing device comprising: The computing device includes an acquisition unit and a processing unit, the storage unit is used to provide storage space, and the computing device is used to execute the method according to any one of claims 1-18.

25. An upgrading device, characterized by The computing device includes a communication unit and a compression unit, and is used to perform the method according to any one of claims 19-23.

26. A computing device, comprising: The computing device includes a memory and a processor, wherein the memory is used to provide storage space, and the processor is used to execute the method according to any one of claims 1-18.

27. An upgrade device, characterized by The upgrade device includes a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to invoke the computer instructions to implement the method according to any one of claims 19-23.

28. An upgrade system, comprising: It includes a computing device and an upgrade device, the computing device being used to perform the method according to any one of claims 1-18, and the computing device being used to perform the method according to any one of claims 19-23.

29. A vehicle characterized by The vehicle includes the computing device of claim 24, or the computing equipment of claim 26.

30. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores program instructions that, when executed by a processor, implement the method described in any one of claims 1-23.