Method and device for managing OTA (over-the-air) upgrading space

By dynamically managing the upgrade partition, the problem of insufficient OTA upgrade space for the main control TBOX was solved, improving the success rate of OTA upgrades and the space utilization rate.

CN121967536APending Publication Date: 2026-05-01SAIC GM WULING AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SAIC GM WULING AUTOMOBILE CO LTD
Filing Date
2025-12-22
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, the OTA upgrade space management method of the main control TBOX suffers from insufficient storage space leading to download failures, and the fixed partition lacks an expansion mechanism, resulting in an unreliable OTA success rate.

Method used

By obtaining the required space size and remaining space size for the upgrade, the upgrade partition is dynamically managed, the target files are identified, and space is released or expanded. A dynamic monitoring and expansion mechanism is adopted to ensure sufficient upgrade space.

Benefits of technology

It enables dynamic management of the upgrade partition, avoiding download failures due to insufficient storage space, and improving the success rate of OTA upgrades and space utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967536A_ABST
    Figure CN121967536A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for managing an OTA (Over the Air) upgrading space. The method comprises the following steps: acquiring the size of a space required for upgrading and the size of a residual space in an upgrading partition; when the size of the residual space is smaller than the size of the space required for upgrading, determining at least one target file which can be cleared in the upgrading partition; and determining a management strategy of the upgrading space based on the at least one target file, the size of the residual space and the size of the space required for upgrading, thereby realizing dynamic management of the upgrading partition.
Need to check novelty before this filing date? Find Prior Art

Description

A method and device for managing OTA upgrade space Technical Field

[0001] This application relates to the field of intelligent vehicle upgrade technology, and more specifically, to a method, apparatus, medium, and electronic device for managing OTA upgrade space. Background Technology

[0002] Currently, the main control TBOX (which is responsible for 5G internet access and provides Ethernet functionality) stores over-the-air (OTA) upgrade packages by statically reserving fixed partitions for upgrades.

[0003] However, this method requires creating the download filename in a fixed partition before downloading the upgrade package and then checking if there is sufficient space. If insufficient storage space is found, the cleanup mechanism is not triggered to release outdated space; instead, the download is declared a failure, requiring offline cleanup of the TBOX device to free up storage space. Even after a successful upgrade, the upgrade package is not immediately cleaned up; instead, it is replaced with a new upgrade package for the next upgrade, resulting in ineffective storage space occupation. Furthermore, the fixed partition lacks an expansion mechanism, has weak scalability, and the success rate of OTA updates cannot be guaranteed.

[0004] Therefore, this application provides a method for managing OTA upgrade space to solve the above-mentioned technical problems. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, medium, and electronic device for managing OTA upgrade space, which can solve at least one of the aforementioned technical problems. The specific solution is as follows: According to a specific embodiment of this application, in a first aspect, this application provides a method for managing OTA upgrade space, comprising: obtaining the space required for upgrade and the remaining space within the upgrade partition; when the remaining space is less than the space required for upgrade, determining at least one target file within the upgrade partition that can be deleted; and determining a management strategy for the upgrade space based on the at least one target file, the remaining space, and the space required for upgrade.

[0006] Optionally, the step of determining the upgrade space management strategy based on the at least one target file, the remaining space size, and the upgrade required space size includes: calculating the sum of the total storage space size of the at least one target file and the remaining space size to obtain the available space size; when the available space size is greater than or equal to the upgrade required space size, calculating the difference between the upgrade required space size and the remaining space size to obtain the space to be cleared; determining at least one file to be cleared among the at least one target file based on the space to be cleared; and releasing the space occupied by each of the at least one file to be cleared.

[0007] Optionally, determining at least one file to be cleared among the at least one target file based on the size of the space to be cleared includes: determining the clearing priority of each of the at least one target file; determining the files to be cleared in descending order of the clearing priority among the at least one target file; and stopping the determination of the files to be cleared when the storage space size of all the determined files to be cleared is greater than or equal to the size of the space to be cleared.

[0008] Optionally, determining the files to be cleared in descending order of the clearing priority in the at least one target file includes: when multiple files with the same clearing priority are obtained in descending order of the clearing priority in the at least one target file, determining the files to be cleared in descending order of storage space size.

[0009] Optionally, after calculating the sum of the storage space sizes of all the at least one target file and the remaining space size to obtain the available space size, the method further includes: when the available space size is less than the space size required for the upgrade, calculating the difference between the space size required for the upgrade and the available space size to obtain the size of the partition to be expanded; releasing the space occupied by each of the target files, and expanding the space of the upgrade partition based on the size of the partition to be expanded.

[0010] Optionally, obtaining the space required for the upgrade includes: during the upgrade preparation process, in response to receiving an upgrade command, obtaining the space required for the upgrade based on the upgrade package size and the partition space size of the upgrade partition in the upgrade command.

[0011] Optionally, obtaining the required space size for the upgrade based on the upgrade package size and the partition space size of the upgrade partition in the upgrade instruction includes: calculating the product of the partition space size and a preset safe space ratio value to obtain the safe space size; calculating the product of the upgrade package size in the upgrade instruction and a preset decompression multiple value, and adding the safe space size to obtain the required space size for the upgrade.

[0012] Optionally, obtaining the space required for the upgrade includes: during the upgrade process, detecting the size of the downloaded package and the remaining space in the upgrade partition in real time; calculating the difference between the size of the upgrade package and the size of the downloaded package to obtain the remaining package size; when the remaining package size is greater than the remaining space size, calculating the difference between the remaining package size and the remaining space size to obtain the space required for the upgrade.

[0013] Optionally, the method further includes: during the upgrade process, deleting the upgrade package when the upgrade package has been decompressed.

[0014] Optionally, the method further includes: when the upgrade is complete, releasing the space occupied by files other than at least one system file supporting the upgrade within the upgrade partition; determining the additional space required by the at least one system file to run; calculating the difference between the partition size of the upgrade partition and the total file size of the at least one system file, and then subtracting the additional space size to obtain the size of the released partition; and releasing the space of the upgrade partition based on the size of the released partition.

[0015] According to a specific embodiment of this application, in a second aspect, this application provides an OTA upgrade space management device, comprising: an information acquisition unit, configured to acquire the space required for upgrade and the remaining space within the upgrade partition; a file determination unit, configured to determine at least one target file that can be deleted within the upgrade partition when the remaining space is less than the space required for upgrade; and a strategy determination unit, configured to determine a management strategy for the upgrade space based on the at least one target file, the remaining space, and the space required for upgrade.

[0016] According to a specific embodiment of this application, in a third aspect, this application provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the OTA upgrade space management method as described in any of the preceding claims.

[0017] According to a specific embodiment of this application, in a fourth aspect, this application provides an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the OTA upgrade space management method as described in any of the preceding claims.

[0018] Compared with the prior art, the above-described solutions of this application have at least the following beneficial effects: This application provides a method, apparatus, medium, and electronic device for managing OTA upgrade space. The method includes: obtaining the space required for the upgrade and the remaining space in the upgrade partition; when the remaining space is less than the space required for the upgrade, determining at least one target file that can be deleted in the upgrade partition; and determining a management strategy for the upgrade space based on the at least one target file, the remaining space, and the space required for the upgrade, thereby realizing dynamic management of the upgrade partition. Attached Figure Description

[0019] Figure 1 shows a flowchart of an OTA upgrade space management method according to an embodiment of the present application; Figure 2 shows a unit block diagram of an OTA upgrade space management device according to an embodiment of the present application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.

[0022] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0023] It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, first may also be referred to as second without departing from the scope of the embodiments of this application, and similarly, second may also be referred to as first.

[0024] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”

[0025] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.

[0026] It should be noted that any symbols and / or numbers present in the specification that are not marked in the accompanying drawings are not reference numerals.

[0027] The optional embodiments of this application are described in detail below with reference to the accompanying drawings.

[0028] Example 1 is an example of an embodiment provided in this application, namely, an embodiment of a method for managing OTA upgrade space.

[0029] The embodiments of this application will be described in detail below with reference to Figure 1.

[0030] Step S101: Obtain the space required for the upgrade and the remaining space in the upgrade partition.

[0031] This application is applicable to automotive upgrade scenarios where TBOX serves as the master control node, particularly in vehicles equipped with TBOX devices that have limited storage space. It is also applicable to other industrial equipment capable of OTA upgrades, efficiently utilizing fixed-partition storage space and avoiding OTA failures due to insufficient storage.

[0032] An upgrade partition refers to a storage area on the vehicle's system used to store upgrade packages and provide upgrade resources for them. For example, when the cloud sends an upgrade command to the vehicle, the vehicle's OTA program triggers a download, downloads the upgrade package from the cloud, saves it in the upgrade partition, and then decompresses the upgrade package in the upgrade partition to upgrade the vehicle.

[0033] In this application embodiment, the space required for the upgrade has two cases: one refers to the space required during the upgrade preparation process, and the other refers to the space required during the upgrade process.

[0034] In some specific embodiments, obtaining the space required for the upgrade includes: step S101a, in the upgrade preparation process, in response to receiving an upgrade instruction, obtaining the space required for the upgrade based on the upgrade package size and the partition space size of the upgrade partition in the upgrade instruction.

[0035] In this specific embodiment, before the vehicle-side device officially downloads the upgrade package, the cloud needs to transmit an upgrade command to the vehicle-side device, notifying the vehicle-side device that an upgrade is required. The upgrade command includes the size of the upgrade package.

[0036] In actual upgrade processes, simply downloading the upgrade package to the upgrade partition is not necessarily sufficient to complete the upgrade. The upgrade package also needs to be decompressed and saved to the upgrade partition, and necessary operating space needs to be provided for the upgrade software to run normally. Therefore, in some specific embodiments, obtaining the required upgrade space based on the upgrade package size in the upgrade instruction and the partition space size of the upgrade partition includes: step S101a-1, calculating the product of the partition space size and a preset safe space ratio value to obtain the safe space size.

[0037] The preset safe space ratio is an empirical value determined through numerous experiments.

[0038] The size of the safe space refers to the safe space reserved after decompression, so that the upgrade software can use the safe space in the upgrade partition to complete the upgrade normally.

[0039] Step S101a-2: Calculate the product of the upgrade package size in the upgrade instruction and the preset decompression multiplier, and add the size of the security space to obtain the space required for the upgrade.

[0040] The preset decompression ratio is determined based on the compression ratio of the upgrade package. For example, if the upgrade software size is 3076M and the compressed upgrade package size is 1024M, the compression ratio = 1024 / 3076 = 1 / 3, then the preset decompression ratio is 3, meaning the size of the upgraded software after decompression = 1024 × 3 = 3076M.

[0041] In this specific embodiment, the formula for calculating the space required for the upgrade includes: M1 = z × P + Q × b; where M1 represents the space required for the upgrade during the upgrade preparation process, z represents the preset decompression multiplier, P represents the size of the upgrade package, Q represents the size of the partition space, and b represents the preset security space ratio. For example, if z = 3, P = 32M, Q = 512M, and b = 3%, then M1 = 3 × 32 + 512 × 3% = 111.36M.

[0042] This specific embodiment employs a dynamic monitoring mechanism during the upgrade preparation process, enabling full-process monitoring and processing. It dynamically assesses storage requirements and determines the space needed for the upgrade, reserving not only the space required to decompress the upgrade package but also the space needed for the upgrade software to run normally. By accurately calculating the required upgrade space, it ensures the upgrade software can perform the upgrade within sufficient and effective space, avoiding download failures due to insufficient storage.

[0043] To avoid discrepancies between theoretical and actual values, the upgrade process requires real-time monitoring of the difference between the actual remaining space size and the theoretically undownloaded remaining package size. In some specific embodiments, obtaining the space size required for the upgrade includes: step S101b-1, during the upgrade process, real-time monitoring of the downloaded package size and the remaining space size within the upgrade partition.

[0044] Step S101b-2: Calculate the difference between the size of the upgrade package and the size of the downloaded package to obtain the remaining package size.

[0045] Step S101b-3: When the remaining package size is greater than the remaining space size, calculate the difference between the remaining package size and the remaining space size to obtain the space size required for the upgrade.

[0046] In this specific embodiment, the formula for calculating the space required for the upgrade includes: M2 = (P - P') - Y; where M2 represents the space required for the upgrade process, P represents the size of the upgrade package, P' represents the size of the downloaded package, and Y represents the remaining space. For example, if P = 32M, P' = 10M, and Y = 20M, then M2 = (32 - 10) - 20 = 2M.

[0047] This specific embodiment employs a dynamic monitoring and expansion mechanism throughout the upgrade process, enabling full-process monitoring and dynamic assessment of storage requirements. During download and upgrade, the storage partition's space size is monitored in real time. If the remaining package size exceeds the remaining space, it indicates insufficient space to complete the upgrade. Therefore, by accurately calculating the required upgrade space, the system ensures the upgrade software can operate within a sufficient and effective storage space, preventing download failures due to insufficient storage.

[0048] Step S102: When the remaining space size is less than the space required for the upgrade, determine at least one target file that can be deleted within the upgrade partition.

[0049] In this embodiment, if the remaining space is less than the space required for the upgrade, it indicates that the remaining space is insufficient to complete the upgrade, and some space needs to be freed up or expanded for the upgrade. If the remaining space is greater than or equal to the space required for the upgrade, it indicates that the remaining space is sufficient to complete the upgrade, and the upgrade package can be downloaded directly to complete the upgrade. Since this is a routine operation, it will not be described in detail here.

[0050] Step S103: Determine the management strategy for the upgrade space based on the at least one target file, the remaining space size, and the space size required for the upgrade.

[0051] In some specific embodiments, the step of determining the management strategy of the upgrade space based on the at least one target file, the remaining space size, and the space size required for the upgrade includes: step S103-1, calculating the sum of the total storage space size of the at least one target file and the remaining space size to obtain the available space size.

[0052] In this specific embodiment, the upgrade partition contains multiple files. Some files (i.e., target files) can be deleted, while others (such as system files that support the upgrade) cannot be deleted to prevent excessive deletion from causing system crashes. For example, target files include: temporary log files, temporary cache data files, files left over from historical upgrades, and temporarily compressed files.

[0053] Step S103-2a: When the available space size is greater than or equal to the space size required for the upgrade, calculate the difference between the space size required for the upgrade and the remaining space size to obtain the space size to be cleared.

[0054] Step S103-3: Determine at least one file to be cleared from the at least one target file based on the size of the space to be cleared.

[0055] There are many methods for determining at least one file to be cleared among the at least one target file. For example, multiple file combinations can be determined based on the at least one target file, and each target file in any file combination is determined to be a file to be cleared when the total size of all files in any file combination is greater than or equal to the size of the space to be cleared. However, in some specific embodiments, preferably, the method includes: step S103-31, determining the clearing priority of each of the at least one target file.

[0056] For example, continuing the example above, files left over from historical upgrades are determined to be the first priority to be cleared (i.e., the highest priority), temporarily compressed files are determined to be the second priority to be cleared, temporary cache data files are determined to be the third priority to be cleared, and temporary log files are determined to be the fourth priority to be cleared (i.e., the low priority).

[0057] Step S103-32: In the at least one target file, the files to be cleared are determined sequentially based on the descending order of the clearing priority.

[0058] In this specific embodiment, the files to be cleared are determined step by step by ranking the target files according to their clearing priority. This tiered confirmation mechanism reduces the number of files to be cleared, protects low-priority target files from being identified as pending clearing, and safeguards more upgrade information.

[0059] In some other specific embodiments, preferably, the step of determining the files to be cleared in the at least one target file in descending order of the clearing priority includes: step S103-32a, in the at least one target file, when multiple files to be cleared with the same clearing priority are obtained in descending order of the clearing priority, the files to be cleared are determined in descending order of the storage space size.

[0060] In this specific embodiment, if multiple pending files exist with the same deletion priority, the pending files are determined in descending order of their storage space size. For example, continuing the above example, there are three temporarily compressed and stored files: a first file, a second file, and a third file. All three files have the second deletion priority. If the storage space size of the first file is 10MB, the storage space size of the second file is 20MB, and the storage space size of the third file is 15MB, then the descending order is: the storage space size of the second file, the storage space size of the third file, and the storage space size of the first file.

[0061] In this specific embodiment, target files with high deletion priority are first identified as files to be deleted, and then target files with lower deletion priority are successively identified as files to be deleted. For the same deletion priority, target files with large storage space are first identified as files to be deleted, and then target files with small storage space are successively identified as files to be deleted. By using a hierarchical mechanism to identify files to be deleted and a large file priority principle, the number of files to be deleted can be reduced, protecting low-priority target files from being identified as files to be deleted, and preserving more upgrade information.

[0062] Step S103-33: When the storage space size of all the files to be cleared is greater than or equal to the size of the space to be cleared, stop determining the files to be cleared.

[0063] For example, continuing the above example, the storage space is ordered in descending order as follows: storage space of the second file, storage space of the third file, and storage space of the first file. If the space to be cleared is 500M, the total storage space of all files to be cleared before the second file is confirmed is 470M. When the second file is confirmed as a file to be cleared, the total storage space of all files to be cleared is 470 + 20 = 490M, which is less than 500M. When the third file is confirmed as a file to be cleared, the total storage space of all files to be cleared is 490 + 15 = 505M, which is greater than 500M. The required storage space is already met, therefore, the determination of the files to be cleared is stopped, and the first file is no longer considered a file to be cleared.

[0064] In this specific embodiment, a mechanism for hierarchically confirming files to be cleared is used to prioritize the confirmation of high-priority target files. Once the required space for clearing is met, the confirmation of files to be cleared stops. This reduces the number of target files to be confirmed, thereby protecting more upgrade information.

[0065] Step S103-4: Release the space occupied by each of the at least one file to be cleared.

[0066] In this specific embodiment, a tiered cleanup mechanism is used to preemptively clean up residual data and clean up cached data during the process in real time. By dynamically managing the space of the upgrade partition, the space required for the upgrade is allocated on demand. By prioritizing the removal of high-priority target files, the number of target files to be removed is reduced, and low-priority target files are protected from being identified as files to be removed. This preserves more upgrade information, improves the space judgment and cleanup process, enhances space utilization and space allocation flexibility, avoids upgrade failures, and thus increases the speed of cleaning up files to be removed, thereby improving upgrade efficiency.

[0067] In some other specific embodiments, after calculating the sum of the total storage space size of the at least one target file and the remaining space size to obtain the available space size, the method further includes: step S103-2b-1, when the available space size is less than the space size required for the upgrade, calculating the difference between the space size required for the upgrade and the available space size to obtain the size of the partition to be expanded.

[0068] If the available space is less than the space required for the upgrade, it indicates that the upgrade partition can no longer provide the space required for a secure upgrade and external expansion is needed.

[0069] Step S103-2b-2: Release the space occupied by each of the target files, and expand the space of the upgrade partition based on the size of the partition to be expanded.

[0070] In this specific embodiment, all target files in the upgrade partition are deleted, and the space of the upgrade partition is expanded according to the size of the partition to be expanded to meet the space requirements of the upgrade.

[0071] This specific embodiment achieves full-process monitoring and processing of the upgrade preparation and upgrade process by setting up a classification and cleanup mechanism, a dynamic monitoring mechanism, and a dynamic release and expansion mechanism. It dynamically assesses storage needs, cleans up residual data in advance, cleans up cached data in real time, and dynamically manages the upgrade partition's space, enabling on-demand allocation of upgrade space. This improves space judgment and cleanup processes, enhances space utilization and allocation flexibility, avoids upgrade failures, and increases the upgrade success rate. Furthermore, it increases the speed of cleaning up pending files and improves upgrade efficiency.

[0072] In some specific embodiments, the method further includes: step S111, during the upgrade process, when the upgrade package is decompressed, the upgrade package is deleted.

[0073] In this specific embodiment, the upgrade package is no longer needed once the upgrade is complete. During the period when the vehicle's normal operation is not affected, the upgrade package is deleted to make room for the upgrade, reduce the upgrade time, and improve the efficiency of demagnetization and upgrade.

[0074] In some specific embodiments, the method further includes: step S121, when the upgrade is completed, releasing the space occupied by other files in the upgrade partition except for at least one system file that supports the upgrade.

[0075] Step S122: Determine the additional space required for the at least one system file to run.

[0076] The extra space ensures that system files can start and run normally during upgrades.

[0077] The additional space required for the operation of the at least one system file is an empirical value determined based on the size of the system file and the space occupied by starting and running the system file.

[0078] Step S123: Calculate the difference between the size of the upgrade partition and the total file size of the at least one system file, and then subtract the extra space size to obtain the size of the freed partition.

[0079] Step S124: Release the space of the upgrade partition based on the size of the release partition.

[0080] This specific embodiment employs a deep slimming mechanism and a dynamic release mechanism. Within the upgrade partition, besides retaining the system files supporting the upgrade, the process log is packaged and uploaded to cloud storage, and all other files are deleted. Then, sufficient space is reserved within the upgrade partition for the normal startup of system files, while unused space within the upgrade partition is released, allowing other systems to utilize the released unused space, improving space utilization efficiency and reducing storage costs.

[0081] This application embodiment obtains the space required for the upgrade and the remaining space in the upgrade partition; when the remaining space is less than the space required for the upgrade, it determines at least one target file in the upgrade partition that can be deleted; based on the at least one target file, the remaining space, and the space required for the upgrade, it determines the management strategy for the upgrade space, thereby realizing dynamic management of the upgrade partition.

[0082] Example 2 This application also provides an apparatus embodiment that follows the above embodiments, used to implement the method steps described in the above embodiments. The interpretation of the same names is the same as that in the above embodiments, and it has the same technical effects as the above embodiments, so it will not be repeated here.

[0083] As shown in Figure 2, this application provides an OTA upgrade space management device 200, including: an information acquisition unit 201, used to acquire the space required for upgrade and the remaining space in the upgrade partition; a file determination unit 202, used to determine at least one target file that can be deleted in the upgrade partition when the remaining space is less than the space required for upgrade; and a strategy determination unit 203, used to determine the management strategy of the upgrade space based on the at least one target file, the remaining space, and the space required for upgrade.

[0084] This application embodiment obtains the space required for the upgrade and the remaining space in the upgrade partition; when the remaining space is less than the space required for the upgrade, it determines at least one target file in the upgrade partition that can be deleted; based on the at least one target file, the remaining space, and the space required for the upgrade, it determines the management strategy for the upgrade space, thereby realizing dynamic management of the upgrade partition.

[0085] Example 3 This example provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the method steps described in the above example.

[0086] Example 4 This application provides a non-volatile computer storage medium storing computer-executable instructions that can perform the steps described in the above examples.

[0087] Finally, it should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.

[0088] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for managing OTA upgrade space, characterized in that, include: Obtain the space required for the upgrade and the remaining space in the upgrade partition; when the remaining space is less than the space required for the upgrade, identify at least one target file in the upgrade partition that can be deleted; determine the management strategy for the upgrade space based on the at least one target file, the remaining space, and the space required for the upgrade.

2. The method according to claim 1, characterized in that, The management strategy for determining the upgrade space based on the at least one target file, the remaining space size, and the space required for the upgrade includes: calculating the sum of the total storage space size of the at least one target file and the remaining space size to obtain the available space size; when the available space size is greater than or equal to the space required for the upgrade size, calculating the difference between the space required for the upgrade size and the remaining space size to obtain the space to be cleared; determining at least one file to be cleared among the at least one target file based on the space to be cleared size; and releasing the space occupied by each of the at least one file to be cleared.

3. The method according to claim 2, characterized in that, The step of determining at least one file to be cleared from the at least one target file based on the size of the space to be cleared includes: determining the clearing priority of each of the at least one target file; determining the files to be cleared in descending order of the clearing priority among the at least one target file; and stopping the determination of the files to be cleared when the storage space size of all the determined files to be cleared is greater than or equal to the size of the space to be cleared.

4. The method according to claim 3, characterized in that, The step of determining the files to be cleared in descending order of the clearing priority in the at least one target file includes: when multiple files to be cleared with the same clearing priority are obtained in descending order of the clearing priority in the at least one target file, the files to be cleared are determined in descending order of storage space size.

5. The method according to claim 2, characterized in that, After calculating the sum of the storage space size of all the at least one target file and the remaining space size to obtain the available space size, the method further includes: when the available space size is less than the space size required for the upgrade, calculating the difference between the space size required for the upgrade and the available space size to obtain the size of the partition to be expanded; releasing the space occupied by each of the target files, and expanding the space of the upgrade partition based on the size of the partition to be expanded.

6. The method according to claim 1, characterized in that, The step of obtaining the space required for the upgrade includes: during the upgrade preparation process, in response to receiving an upgrade command, obtaining the space required for the upgrade based on the upgrade package size and the partition space size of the upgrade partition in the upgrade command.

7. The method according to claim 6, characterized in that, The step of obtaining the required space size for the upgrade based on the upgrade package size and the partition space size of the upgrade partition in the upgrade instruction includes: calculating the product of the partition space size and a preset safe space ratio value to obtain the safe space size; calculating the product of the upgrade package size in the upgrade instruction and a preset decompression multiple value, and adding the safe space size to obtain the required space size for the upgrade.

8. The method according to claim 1, characterized in that, The process of obtaining the space required for the upgrade includes: during the upgrade process, detecting the size of the downloaded package and the remaining space in the upgrade partition in real time; calculating the difference between the size of the upgrade package and the size of the downloaded package to obtain the remaining package size; and when the remaining package size is greater than the remaining space size, calculating the difference between the remaining package size and the remaining space size to obtain the space required for the upgrade.

9. The method according to claim 1, characterized in that, The method further includes: during the upgrade process, deleting the upgrade package when the upgrade package has been decompressed.

10. The method according to claim 1, characterized in that, The method further includes: when the upgrade is completed, releasing the space occupied by other files in the upgrade partition except for at least one system file that supports the upgrade; determining the additional space required by the at least one system file to run; calculating the difference between the partition size of the upgrade partition and the total file size of the at least one system file, and then subtracting the additional space size to obtain the size of the released partition; and releasing the space of the upgrade partition based on the size of the released partition.

11. A management device for OTA upgrade space, characterized in that, include: The information acquisition unit is used to obtain the amount of space required for the upgrade and the amount of remaining space in the upgrade partition. The file determination unit is used to determine at least one target file that can be deleted within the upgrade partition when the remaining space size is less than the space size required for the upgrade. The strategy determination unit is used to determine the management strategy of the upgrade space based on the at least one target file, the remaining space size, and the space size required for the upgrade.