System upgrading method and device, computer equipment and computer readable storage medium

By dynamically selecting static or dynamic partition upgrade modes based on the device's storage and network conditions, the problem of low upgrade success rate in existing technologies is solved, enabling efficient system upgrades in complex environments.

CN122044632APending Publication Date: 2026-05-15TCL COMM TECH (CHENGDU) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, operating system upgrade methods for mobile and embedded devices suffer from insufficient storage space or high network dependence, resulting in low upgrade success rates and an inability to flexibly adapt to complex device environments.

Method used

A system upgrade method is provided, which determines the minimum installation space and available storage space by obtaining upgrade configuration information, dynamically selects static or dynamic partition upgrade mode, integrates the two upgrade methods, and dynamically selects the best upgrade strategy based on the device's storage and network conditions.

Benefits of technology

It improves the success rate of upgrades in various complex device environments, avoids the shortcomings of a single mode, reduces the risk of upgrade failure, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122044632A_ABST
    Figure CN122044632A_ABST
Patent Text Reader

Abstract

The invention discloses a system upgrading method and device, computer equipment and a computer readable storage medium. The system upgrading method and device are used for improving the system upgrading success rate in various complex equipment environments. Comprising the steps that upgrading configuration information is obtained, the upgrading configuration information comprises upgrading file information of system upgrading of terminal equipment, and the upgrading file information is used for describing upgrading files in an upgrading package of system upgrading; when determining that the upgrading configuration information carries a configuration parameter of a dynamic partition upgrading mode based on the upgrading file information, obtaining a minimum installation space corresponding to the system upgrading and an available storage space of the terminal equipment; determining a target upgrading mode based on the minimum installation space and the available storage space; and performing system upgrading on the terminal equipment based on the target upgrading mode and the upgrading file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and specifically to a system upgrade method, apparatus, computer equipment, and computer-readable storage medium. Background Technology

[0002] In the process of upgrading the operating system of mobile and embedded devices, the two main upgrade methods are the traditional static partition upgrade method (AB) and the dynamic partition upgrade method (Streaming AB). Although both AB partition and Streaming AB partition can complete the operating system upgrade, they both have certain limitations in specific scenarios.

[0003] For example, AB partitioning heavily relies on the remaining user space on user devices as a temporary storage area. On low-storage devices, upgrades may be completely impossible. Streaming AB partitioning requires devices to be constantly connected to the network and places high demands on network stability. Furthermore, most current data devices only support a single technology and cannot dynamically adapt to varying storage loads or network conditions.

[0004] Therefore, there is an urgent need to provide a device upgrade method that can dynamically switch between static partition upgrade and dynamic partition upgrade methods. Summary of the Invention

[0005] This application provides a system upgrade method, apparatus, computer device, and computer-readable storage medium to improve the success rate of system upgrades in various complex equipment environments.

[0006] Firstly, this application provides a system upgrade method, including: The system acquires upgrade configuration information, including upgrade file information for system upgrades on the terminal device. This upgrade file information describes the upgrade files in the upgrade package for the system upgrade. When determining the configuration parameters for the dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information, the system acquires the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device. The system determines the target upgrade mode based on the minimum installation space and the available storage space. The system upgrade is then performed on the terminal device based on the target upgrade mode and the upgrade file.

[0007] In some embodiments of this application, the upgrade configuration information is encapsulated based on the data offset and data size of the upgrade file in the upgrade package. The data offset and data size are obtained by parsing the upgrade package, which is stored on the system upgrade server of the terminal device.

[0008] In some embodiments of this application, the upgrade document includes a first document, a second document, and a third document; The first file is used for data mirroring and differential upgrade content of the storage device system partition; The second file is used to record the attribute information of the upgrade package corresponding to the first file; This third file is used to record the target information and attribute information of the upgrade package.

[0009] In some embodiments of this application, obtaining the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device includes: The upgrade configuration information is parsed to obtain the first data offset and first data size of the second file, and the second data offset and second data size of the third file; Download the second file based on the first data offset and the first data size; Download the third file based on the second data offset and the second data size; The third file is parsed to obtain the fourth file, as well as the third data offset and the third data size of the fourth file. The fourth file includes metadata for the system upgrade. Download the fourth file based on the third data offset and the size of the third data; The fourth file is parsed to obtain the minimum installation space required for the system upgrade; The storage space of the terminal device is calculated to obtain the available storage space of the terminal device.

[0010] In some embodiments of this application, determining the target upgrade mode based on the minimum installation space and the available storage space includes: When the minimum installation space is less than the available storage space, the download space is determined based on the minimum installation space and the available storage space. If the download space is greater than the storage space of the upgrade package, then the static partition upgrade mode is determined as the target upgrade mode; If the download space is less than or equal to the storage space of the upgrade package, the dynamic partition upgrade mode is determined as the target upgrade mode.

[0011] In some embodiments of this application, the method further includes: When the minimum installation space is greater than or equal to the available storage space, a prompt message is displayed to inform the user of the amount of space to be cleared.

[0012] In some embodiments of this application, after obtaining the upgrade configuration information, the method further includes: If, based on the upgrade file information, it is determined that the upgrade configuration information does not carry the configuration parameters for dynamic partition upgrade mode, then static partition upgrade mode is determined as the target upgrade mode. or; When determining the specified upgrade mode in the upgrade configuration information based on the upgrade file information, the specified upgrade mode is determined to be the target upgrade mode.

[0013] Secondly, this application provides a system upgrade apparatus, including: a transceiver module, used to acquire upgrade configuration information, the upgrade configuration information including upgrade file information for a terminal device to perform a system upgrade, the upgrade file information being used to describe the upgrade file in the upgrade package of the system upgrade; The processing module is used to obtain the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device when determining the configuration parameters of the dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information; and to determine the target upgrade mode based on the minimum installation space and the available storage space. The upgrade module is used to perform system upgrades on the terminal device based on the target upgrade mode and the upgrade file.

[0014] Thirdly, this application also provides a computer device, which includes: One or more processors; Memory; and One or more applications, wherein the applications are stored in memory and configured to be executed by a processor to implement the system upgrade method of any of the first aspects.

[0015] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in the system upgrade method of any of the first aspects.

[0016] The beneficial effects of this invention are: integrating static partition upgrade mode and dynamic partition upgrade mode, establishing a dynamic selection mechanism based on the available storage space of the terminal device, and selecting the upgrade mode according to the minimum installation space and the available storage space of the terminal device, which can effectively avoid the shortcomings of a single mode and avoid upgrade failure, thereby significantly improving the upgrade success rate in various complex device environments. Attached Figure Description

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

[0018] Figure 1 This is a schematic diagram of the system architecture provided in an embodiment of the present invention; Figure 2 This is a schematic flowchart of an embodiment of the system upgrade method provided by the present invention; Figure 3 This is a schematic diagram of an application process of the system upgrade method provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of a specific embodiment of the system upgrade device provided in this invention. Figure 5 This is a schematic diagram of an embodiment of the computer device provided in this invention. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described 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 of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] In the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more features.

[0021] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0022] It should be noted that since the method in this application embodiment is executed in a computer device, the processing objects of each computer device exist in the form of data or information, such as time, which is essentially time information. It is understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data that exist so that the computer device can process them. Specific details will not be elaborated here.

[0023] With the increasing prevalence of smart devices, operating system (OS) updates are becoming more frequent. Firmware over-the-air (FOTA) upgrades are a crucial way to ensure device security, acquire new features, and fix defects. Currently, the two main FOTA upgrade methods in the industry are static partition upgrades (also known as A / B partition upgrades, or AB upgrades for short) and dynamic partition upgrades (also known as streaming A / B partition upgrades, or Streaming AB upgrades for short).

[0024] The AB upgrade method pre-defines two identical system partitions (Partition A and Partition B) on the device. During the upgrade, if the device is currently running on Partition A, the system downloads the complete upgrade package to the device's user data area and then writes the upgrade image to the unused Partition B. After the upgrade is complete, the device restarts and boots from Partition B. The advantage of this method is that if the upgrade fails or the new system is unstable, the device can easily roll back to the pre-upgrade Partition A, resulting in high reliability. However, its disadvantage is also significant: it requires the device to have a sufficiently large amount of free user space to store the entire upgrade package, which often becomes an obstacle for devices with limited storage capacity.

[0025] The Streaming AB upgrade method does not require pre-downloading the complete upgrade package. It uses streaming media technology to download upgrade data blocks directly and sequentially from the server and write them to the target partition. The advantage of this method is that it does not require additional user storage space to cache the upgrade package, making it very friendly to devices with low storage capacity. However, its disadvantage is that it heavily relies on a stable and high-speed network connection. In poor network conditions, the upgrade process may take a long time or even fail due to network interruption.

[0026] In existing technologies, devices typically only support one of the two methods mentioned above, employing a fixed upgrade strategy. This rigid approach cannot flexibly adjust based on the device's real-time status (such as remaining storage space) and external environment (such as network conditions), resulting in low upgrade success rates and poor user experience in certain scenarios. For example, a device that supports AB upgrades but has insufficient storage space will be unable to upgrade; a device that supports Streaming AB upgrades will face a long wait in a weak network environment.

[0027] Therefore, how to overcome the limitations of existing upgrade methods and provide a more flexible, reliable, and user-friendly system upgrade solution is a technical problem that urgently needs to be solved in this field.

[0028] To address this technical problem, this application provides the following technical solution: Obtaining upgrade configuration information, including upgrade file information for system upgrades on terminal devices, which describes the upgrade files in the upgrade package; when determining the configuration parameters for a dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information, obtaining the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device; determining the target upgrade mode based on the minimum installation space and the available storage space; and performing a system upgrade on the terminal device based on the target upgrade mode and the upgrade file. This integration of static and dynamic partition upgrade modes, establishing a dynamic selection mechanism based on the available storage space of the terminal device, and selecting the upgrade mode according to the minimum installation space and the available storage space of the terminal device, effectively avoids the shortcomings of a single mode, prevents upgrade failures, and significantly improves the upgrade success rate in various complex device environments.

[0029] This application provides a system upgrade method, apparatus, computer device, and computer-readable storage medium to improve the success rate of system upgrades in various complex device environments. The electronic device provided in this application can be implemented as various types of user terminals or as a server.

[0030] Electronic devices can improve the success rate of system upgrades in various complex device environments by running the system upgrade method provided in the embodiments of this application.

[0031] The above method can be applied to firmware (OTA) upgrades for many smart TVs, in-vehicle systems, smartphones, or IoT devices. The core of this method is to intelligently select the optimal installation strategy based on the real-time storage status of the terminal device.

[0032] In one exemplary scenario, this system upgrade method can be applied to the system upgrade of smart TVs. For instance, in a smart TV system upgrade scenario, brand operations or R&D personnel plan to push out a major system update. This update package is large and introduces a new file system, requiring specific partitioning operations during the installation process. To ensure a smooth upgrade for TVs with different storage conditions, the server-side upgrade strategy includes configuration parameters for a dynamic partition upgrade mode. The upgrade process for this smart TV can then proceed as follows: Operations or R&D personnel deploy the upgrade package in the background system and initiate its push to all eligible online TV terminals. At this point, the server's core task is to distribute the upgrade configuration information. After receiving the upgrade configuration information in the background, the user's smart TV activates the system upgrade service. The smart TV begins pre-parseing (or directly reading from the configuration information) the metadata of the upgrade package to determine the minimum installation space required to complete the system upgrade. Simultaneously, the smart TV calls the system's underlying application programming interface to query the available storage space for the user's data partition. At this point, the smart TV's internal decision engine determines the upgrade mode based on the minimum installation space and the available storage space, and performs the system upgrade based on this upgrade mode and the upgrade package. For example, system analysis shows that even with the most space-saving installation method, at least 3GB of temporary decompression and write space is required. Meanwhile, the query results show that the user's smart TV currently only has 2.5GB of available storage space remaining. In this situation, the smart TV can prompt the user to clear the data stored on the smart TV to expand the available storage space for system upgrades. Assuming that after the user clears the data, the smart TV has 4GB of available storage space, it can further determine whether the download space after subtracting the installation space is sufficient to store the upgrade package. If not, it can directly select the dynamic partition upgrade mode for system upgrade; if it is sufficient, it can select the static partition upgrade model for system upgrade.

[0033] It should be understood that the above is only an example of a system upgrade application scenario. There are many other possible application scenarios, which are not limited here.

[0034] The system upgrade method provided in this application embodiment is applied to, for example, Figure 1 The system architecture diagram shown is for your reference. Figure 1 To support a system upgrade method, the terminal device 100 connects to the server 300 via network 200, and the server 300 connects to the database 400. Network 200 can be a wide area network (WAN), a local area network (LAN), or a combination of both. The client used to implement the system upgrade scheme is deployed on the terminal device 100, or it can run on the terminal device 100 as a standalone application. The specific form of the client is not limited here.

[0035] The server 300 involved in this application can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data and artificial intelligence platforms.

[0036] Terminal equipment 100, also known as user equipment (UE), mobile station (MS), mobile terminal (MT), customer premise equipment (CPE), etc., can be a device that includes both receiving and transmitting hardware, i.e., a device with receiving and transmitting hardware capable of performing bidirectional communication on a bidirectional communication link. Such equipment can include cellular or other communication devices with single-line displays, multi-line displays, or no multi-line displays. Examples include handheld devices with wireless connectivity, vehicle-mounted devices, and machine-type communication (MTC) terminals. Currently, terminal devices can include: mobile phones, tablets, laptops, PDAs, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, self-driving, remote medical surgery, smart grids, transportation safety, smart cities, and smart homes. For example, wireless terminals in self-driving can be drones, helicopters, or airplanes. For example, wireless terminals in vehicle-to-everything (V2X) can be in-vehicle equipment, vehicle components, in-vehicle modules, vehicles, or ships. Wireless terminals in industrial control can be cameras, robots, or robotic arms. Wireless terminals in smart homes can be televisions, air conditioners, robot vacuums, speakers, or set-top boxes.

[0037] It should be noted that the terminal device can be a device or apparatus with a chip, or a device or apparatus with integrated circuitry, or a chip, module, or control unit in the device or apparatus shown above; this application does not limit the specific device. The solution provided in this application can be implemented by the terminal device 100 and the server 300 working together.

[0038] In short, the database 400 in this application can be viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, shared by multiple users, with minimal redundancy, and independent of application programs. A Database Management System (DBMS) is a computer software system designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. DBMSs can be classified according to the database model they support, such as relational or Extensible Markup Language (XML); or according to the type of computer they support, such as server clusters or mobile phones; or according to the query language used, such as Structured Query Language (SQL) or XQuery; or according to performance priorities, such as maximum scale or maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, simultaneously supporting multiple query languages. In this application, database 400 can be used to store data such as upgrade packages.

[0039] Those skilled in the art will understand that Figure 1 The system architecture diagram shown is one possible system architecture for this application and does not constitute a limitation on the system architecture of this application. Other system architectures may include more advanced architectures. Figure 1 The number of more or fewer terminal devices or servers shown, for example Figure 1 The diagram shows one server. It is understood that the system architecture may also include one or more other terminal devices or servers, which are not limited here.

[0040] It should be noted that, Figure 1 The system architecture shown is an example. The servers and scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of servers and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0041] like Figure 2 The diagram shown is a flowchart of an embodiment of the system upgrade method in this application. The following description uses a terminal device as the execution subject to illustrate the system upgrade method, which may include the following steps 201-204, as detailed below: 201. Obtain upgrade configuration information, which includes upgrade file information for system upgrades on terminal devices. This upgrade file information describes the upgrade files in the upgrade package for the system upgrade.

[0042] In this embodiment, the terminal device receives upgrade configuration information sent by the server. The upgrade configuration information includes upgrade file information for the terminal device to perform a system upgrade. The upgrade file information describes the upgrade files in the upgrade package of the current system upgrade.

[0043] The upgrade configuration information can be generated by the server based on the upgrade package when the terminal device detects a new system upgrade package on the server or when the server is preparing to push a new system upgrade package to the terminal device.

[0044] Optionally, the server may perform the following process when generating the upgrade configuration information: The server preprocesses the upgrade package, parsing out the upgrade file information (such as data offset and data size) of the core files within the entire upgrade package. This information, along with the upgrade version and change log, is used as configuration parameters to support the Streaming AB upgrade mode and is then encapsulated to generate the upgrade configuration information. The server then sends this upgrade configuration information to the terminal device.

[0045] Optionally, when generating the upgrade package, the server can scan its internal structure, like building a file index, to accurately record the starting position (data offset) and length (data size) of the core file in the entire upgrade package data stream.

[0046] Therefore, when a terminal device requests an upgrade based on this upgrade configuration information, it can use a protocol that supports range requests to accurately download a small portion of the data currently needed from the large upgrade package, without having to download the entire package, thereby reducing the network resources used.

[0047] It should be understood that the core file may include a first file (such as payload.bin), a second file (such as payload_properties.txt), and a third file (such as metadata). The first file is used to store the data image of the device system partition and the differential upgrade content; the second file is used to record the attribute information of the upgrade package corresponding to the first file; and the third file is used to record the target information and attribute information of the upgrade package.

[0048] The payload.bin file is the core data carrier in the system update mechanism. It's a binary file that encapsulates all the data and operational instructions needed to update one or more system partitions (such as system, vendor, boot, etc.). Its main function is to store the actual content that constitutes the new system version. Unlike traditional methods that directly provide partition image files (such as system.img), payload.bin uses a more efficient format. It can contain complete system partition data (full package) or only the difference data between the old and new versions (incremental package). During the upgrade process, the device's update engine parses payload.bin and performs a series of operations based on the instructions within, such as reading data blocks, applying differential patches, or directly writing data streams to inactive system partitions (inactive slots), thereby completing the system update.

[0049] payload_properties.txt is a plain text file that records core attributes and metadata related to the payload.bin main upgrade package in key-value pairs. Its primary function is to provide the system with verification instructions for payload.bin. It is used by the system for verification and parameter configuration before the upgrade begins. Its contents typically include payload.bin's header information, SHA256 hash value, file size, etc. By reading this file, the terminal device can quickly verify its integrity and authenticity, and obtain the initial parameters necessary to perform the upgrade operation, without accessing the large payload.bin file itself.

[0050] The metadata file is the highest-level manifest and configuration file for the entire upgrade package. It records various key information, attributes, and rules regarding the upgrade. Its purpose is to comprehensively guide and constrain the entire upgrade process. Its content covers several aspects: Verification: Contains public key information used to verify the digital signature of the entire upgrade package, ensuring that the upgrade package comes from a trusted source and has not been tampered with.

[0051] Compatibility assessment: Defines pre-conditions for upgrades, such as device model and current system version number range, to prevent incorrect firmware from being flashed onto incompatible devices.

[0052] Upgrade Steps: This includes a detailed sequence of instructions for the upgrade operation. For example, in the scenario of this invention, it records the data offset and data size of other important files such as payload_metadata.bin stored on the server, providing navigation for the device to perform segmented downloads.

[0053] In this embodiment, "system" typically refers to the operating system (OS) and its accompanying applications and user interface. It is a large and complex software suite running on top of firmware, responsible for managing the hardware and software resources of the entire device and providing an interactive interface for the user.

[0054] A system upgrade is an update to the operating system and its related components. The purposes are typically: to bring new features and user interface designs (e.g., upgrading from Android 12 to Android 13); to improve system performance and smoothness; to fix software bugs; to update security patches; and to update pre-installed applications.

[0055] Firmware is short for software embedded in hardware. It is a very low-level piece of code programmed into the hardware device. Its main responsibility is to directly control and initialize the hardware, providing a usable hardware platform for the higher-level operating system. For example, the first program that runs when a computer boots up (BIOS / UEFI) is responsible for detecting hardware (memory, hard drive), initializing devices, and booting the operating system.

[0056] Firmware upgrades involve updating these low-level control codes. The purposes are typically: fixing hardware-related bugs (e.g., fixing a Wi-Fi chip's disconnection issue); improving hardware performance (e.g., optimizing baseband algorithms to improve signal reception); supporting new hardware features (e.g., enabling a camera to support a new shooting mode); and patching security vulnerabilities.

[0057] In summary, the system upgrade in this embodiment can be understood as including firmware upgrade.

[0058] 202. When determining the configuration parameters of the dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information, obtain the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device.

[0059] After receiving the upgrade configuration information, the terminal device can parse it to obtain the upgrade file information and determine whether it includes the configuration parameters for the dynamic partition upgrade mode. If the configuration parameters for the dynamic partition upgrade mode are present, it means the server supports the dynamic partition upgrade mode. In this case, the terminal device can calculate the minimum installation space required for the current system upgrade and determine its current available storage space to prepare for the subsequent upgrade process. If the configuration parameters for the dynamic partition upgrade mode are not present, it means the server does not support the dynamic partition upgrade mode. In this case, the terminal device can determine that the static partition upgrade mode is the target upgrade mode for this system upgrade.

[0060] Optionally, to provide more upgrade mode selection mechanisms, the upgrade configuration information can also be configured to specify an upgrade mode. After the terminal device identifies the specified upgrade mode, it performs a system upgrade based on that mode. This allows for more refined upgrade operations.

[0061] In this embodiment, the minimum installation space can be understood as a security threshold for system upgrades. It represents the minimum available space that the system reserves throughout the entire upgrade process to ensure the normal operation of basic system functions (such as receiving messages and writing application data) and to provide the necessary space for operations such as upgrade decompression, application processing, and log recording.

[0062] This available storage space can be understood as the total remaining space in the user data partition ( / data) that is available for use by the system and users.

[0063] The storage space of the upgrade package can be understood as the size of the upgrade package (e.g., update.zip) downloaded from the server.

[0064] The download space is dynamically calculated based on the current situation and is the space available to store the upgrade package files. Optionally, the download space can be equal to the difference between the available storage space and the minimum installation space.

[0065] In one exemplary scheme, the process by which the terminal device calculates the minimum installation space can be as follows: Parsing the upgrade configuration information to obtain the first data offset and first data size of the second file, and the second data offset and second data size of the third file; downloading the second file based on the first data offset and first data size; downloading the third file based on the second data offset and second data size; parsing the third file to obtain a fourth file and the third data offset and third data size of the fourth file, the fourth file including metadata for the system upgrade; downloading the fourth file based on the third data offset and third data size; and parsing the fourth file to obtain the minimum installation space corresponding to the system upgrade.

[0066] The following explanation uses the second file, payload_properties.txt, and the third file, metadata, to illustrate the above process: The terminal device downloads these two small files from the server in segments via network requests (such as HTTP Range Requests), based on the data offsets and file sizes of payload_properties.txt and metadata in the upgrade configuration information. The terminal device parses the metadata file to further obtain the data offsets and file sizes of payload_metadata.bin. This file contains detailed metadata about the upgrade operation. The terminal device again obtains the payload_metadata.bin file through segmented downloads. The terminal device calls the system's update engine tool (such as updateEngine in Android) to analyze the payload_metadata.bin file downloaded to the terminal device's local machine, thereby accurately calculating the minimum installation space required to perform this upgrade operation.

[0067] In this embodiment, the payload_metadata.bin file is a structured metadata file, which is essentially a Protobuf (Protocol Buffers) message. It describes which partitions will be operated on during this upgrade, as well as the specific operation steps. Therefore, the update engine tool may calculate the minimum installation space based on the payload_metadata.bin file.

[0068] At the same time, the terminal device can call the system's internal application programming interface to query the current available storage space of the terminal device.

[0069] 203. Determine the target upgrade mode based on the minimum installation space and the available storage space.

[0070] In this embodiment, after obtaining the minimum installation space and the available storage space, the terminal device can make a decision according to preset rules.

[0071] In one exemplary scheme, the preset rule can be set as follows: when the minimum installation space is less than the available storage space, the download space is determined based on the minimum installation space and the available storage space; when the download space is greater than the storage space of the upgrade package, the static partition upgrade mode is determined as the target upgrade mode; when the download space is less than or equal to the storage space of the upgrade package, the dynamic partition upgrade mode is determined as the target upgrade mode.

[0072] In another exemplary solution, the preset rule, based on the aforementioned judgment of available space, can also determine the target upgrade mode by considering the network environment. For example, when the minimum installation space is less than the available storage space and the download space is greater than the storage space of the upgrade package, the terminal device can also obtain the current network environment and select the upgrade mode according to the network environment. For example, if the current location is a wireless LAN and the network quality is good, the terminal device can also select the dynamic partition upgrade mode to perform a system upgrade. Optionally, when the minimum installation space is greater than or equal to the available storage space, the terminal device may display a prompt message, which may include one or more of the following: The system will prompt the user that the current system upgrade has failed; it will also prompt the user to indicate the amount of space that needs to be freed up for the current system upgrade; and it will prompt the user to delete data on the terminal device to increase the available storage space.

[0073] In this way, when space is insufficient, the terminal device no longer simply prompts a failure, but accurately informs the user how much space needs to be cleaned up. Moreover, this space requirement is calculated based on the more space-saving Streaming AB mode, which greatly reduces the burden on users to clean up space.

[0074] It should be understood that after the terminal device performs data deletion or triggers an upgrade operation again, the terminal device can query the available storage space again and compare it with the minimum installation space.

[0075] In this embodiment, the process of confirming the target upgrade mode is automatically completed by the terminal device. Users do not need to understand complex technical concepts or make manual selections, achieving seamless upgrade of the optimal path and a smoother process.

[0076] 204. Based on the target upgrade mode and the upgrade document, perform a system upgrade on the terminal device.

[0077] After determining the upgrade mode, the terminal device can select the download time, download method, and system upgrade time of the upgrade file according to the actual situation.

[0078] In one exemplary scenario, when the download space is significantly larger than the upgrade package's storage space (e.g., twice the download space), the terminal device can choose a static partition upgrade mode and immediately begin downloading the upgrade package in the background. For A / B partition devices, after the download is complete, the upgrade package is immediately installed to the inactive partition in the background when the terminal device is idle. The entire process is seamless for the user. After installation, the system automatically switches to the new system the next time the user restarts the device, or a simple notification pops up: "System updated, effective after restart."

[0079] In another exemplary scheme, the difference between the download space and the upgrade package's storage space meets a critical threshold (e.g., the download space is 1.5 times the upgrade package's storage space). In this case, the terminal device can choose a static partition upgrade mode, but considering that the user may download large files or install applications at any time, the terminal device can download the upgrade package first but not start the installation. The terminal device will continuously monitor the available storage space, and only start background installation when the terminal device has been idle for a long time and the available storage space is stable. If the available storage space drops to a dangerous threshold during this period (e.g., the download space becomes 1.1 times the upgrade package's storage space), the installation process will be paused, waiting for space to be released.

[0080] In another exemplary solution, if the download space is less than or equal to the storage space of the upgrade package, the terminal device can select a dynamic partition upgrade mode; then, the network environment can be considered before deciding on the upgrade timing. For example, if currently in Wi-Fi mode, the terminal device can immediately perform a system upgrade based on the dynamic partition upgrade mode. If currently in a mobile data network environment, the terminal device can prompt the user to postpone the upgrade and perform the system upgrade when connected to a wireless LAN.

[0081] The following is based on Figure 3 The flowchart shown illustrates the system upgrade method of this application: 1. Initiate the FOTA (Firmware Over-The-Air) system update process. During this process, when the terminal device and / or server detects a new upgrade package, the terminal device and / or the server trigger the FOTA startup process.

[0082] 2. Download the upgrade configuration information.

[0083] 3. Confirm whether the Streaming AB configuration parameters exist in the upgrade configuration information. If they exist, proceed to step 4; otherwise, perform the AB upgrade.

[0084] 4. Confirm whether the specified upgrade mode exists in the upgrade configuration information. If not, proceed to step 5; if it exists, execute the specified upgrade mode.

[0085] 5. Download the payload_properties.txt and metadata files.

[0086] 6. Determine if there is sufficient installation space. If not, prompt the user that there is insufficient space and provide the minimum space requirement to be released; if yes, proceed to step 7.

[0087] 7. Determine if there is sufficient download space. If not, perform AB upgrade; if so, perform Streaming AB upgrade.

[0088] This integration of static and dynamic partition upgrade modes, based on a dynamic selection mechanism built upon the available storage space of the terminal device, effectively avoids the shortcomings of single modes and prevents upgrade failures. This significantly improves the upgrade success rate in various complex device environments. Specifically, when terminal device storage space is insufficient, the Streaming AB mode can be automatically adopted, eliminating the need to download the complete firmware package and greatly relieving storage pressure, enabling even low-storage devices to upgrade smoothly. Furthermore, terminal device manufacturers no longer need to develop and maintain multiple independent upgrade solutions for devices with different storage specifications. This unified framework simplifies the development process, reduces R&D investment, and minimizes after-sales technical support costs due to upgrade failures.

[0089] To better implement the system upgrade method in the embodiments of this application, based on the system upgrade method, the embodiments of this application also provide a system upgrade device, such as... Figure 4 As shown, the system upgrade device 400 includes: The transceiver module 401 is used to obtain upgrade configuration information, which includes upgrade file information for system upgrade of the terminal device. The upgrade file information is used to describe the upgrade files in the upgrade package of the system upgrade. Processing module 402 is used to obtain the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device when determining the configuration parameters of the dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information; and to determine the target upgrade mode based on the minimum installation space and the available storage space. Upgrade module 403 is used to perform a system upgrade on the terminal device based on the target upgrade mode and the upgrade file.

[0090] In this embodiment, the static partition upgrade mode and the dynamic partition upgrade mode are integrated. A dynamic selection mechanism is established based on the available storage space of the terminal device. The upgrade mode is selected according to the minimum installation space and the available storage space of the terminal device. This can effectively avoid the shortcomings of a single mode and avoid upgrade failure, thereby significantly improving the upgrade success rate in various complex device environments.

[0091] In some embodiments of this application, the upgrade configuration information is encapsulated based on the data offset and data size of the upgrade file in the upgrade package. The data offset and data size are obtained by parsing the upgrade package, which is stored on the server for the current system upgrade of the terminal device.

[0092] In this embodiment of the application, the upgrade configuration information is obtained by encapsulating only the data offset and data size of each file in the upgrade package. This reduces the amount of data transmitted between the server and the terminal device while ensuring the integrity of the configuration information.

[0093] In some embodiments of this application, the upgrade file includes a first file, a second file, and a third file; The first file is used for data mirroring and differential upgrade content of the storage device system partition; The second file is used to record the attribute information of the upgrade package corresponding to the first file; This third file is used to record the target information and attribute information of the upgrade package.

[0094] In this application embodiment, core files for system upgrades are provided to ensure the correctness and stability of system upgrades.

[0095] In some embodiments of this application, the processing module 402 is specifically used to parse the upgrade configuration information to obtain the first data offset and the first data size of the second file, and the second data offset and the second data size of the third file; Download the second file based on the first data offset and the first data size; Download the third file based on the second data offset and the second data size; The third file is parsed to obtain the fourth file, as well as the third data offset and the third data size of the fourth file. The fourth file includes metadata for the system upgrade. Download the fourth file based on the third data offset and the size of the third data; The fourth file is parsed to obtain the minimum installation space required for the system upgrade; The storage space of the terminal device is calculated to obtain the available storage space of the terminal device.

[0096] In this embodiment, the minimum installation space for system upgrade is calculated based on the core files in the upgrade package. This allows for the effective establishment of a dynamic selection mechanism based on available space, thereby effectively avoiding the shortcomings of a single mode, preventing upgrade failure, and significantly improving the upgrade success rate in various complex device environments.

[0097] In some embodiments of this application, the processing module 402 is specifically used to determine the download space based on the minimum installation space and the available storage space when the minimum installation space is less than the available storage space; If the download space is greater than the storage space of the upgrade package, then the static partition upgrade mode is determined as the target upgrade mode; If the download space is less than or equal to the storage space of the upgrade package, the dynamic partition upgrade mode is determined as the target upgrade mode.

[0098] In this embodiment, a dynamic selection mechanism is established based on the available storage space of the terminal device and the minimum installation space required for system upgrade. The upgrade mode is selected according to the minimum installation space and the available storage space of the terminal device, which can effectively avoid the shortcomings of a single mode and avoid upgrade failure, thereby significantly improving the upgrade success rate in various complex device environments.

[0099] In some embodiments of this application, the processing module 402 is further configured to display a prompt message when the minimum installation space is greater than or equal to the available storage space, the prompt message being used to inform the user of the amount of space to be cleaned.

[0100] In this embodiment, when space is insufficient, the terminal device no longer simply prompts a failure, but precisely informs the user how much space needs to be cleared. Moreover, this space requirement is calculated based on the more space-saving Streaming AB mode, which greatly reduces the burden on the user to clear space.

[0101] In some embodiments of this application, the processing module 402 is further configured to determine the static partition upgrade mode as the target upgrade mode when it is determined from the upgrade file information that the upgrade configuration information does not carry the configuration parameters of the dynamic partition upgrade mode; or; When determining the specified upgrade mode in the upgrade configuration information based on the upgrade file information, the specified upgrade mode is determined to be the target upgrade mode.

[0102] In this embodiment, when the server does not support dynamic partition upgrade mode, the original static partition upgrade mode is used for system upgrade, which ensures the normal progress of system upgrade. Alternatively, if a specified upgrade mode exists, the specified upgrade mode is selected for system upgrade, enabling fine-grained management.

[0103] This application also provides a computer device that integrates any of the system upgrade devices provided in this application. The computer device includes: One or more processors; Memory; and One or more applications, wherein the applications are stored in memory and configured to be executed by a processor from the steps of the system upgrade method in any of the embodiments described above.

[0104] This application also provides a computer device that integrates any of the system upgrade devices provided in this application. For example... Figure 5 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically: The computer device may include components such as a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a power supply 503, and an input unit 504. Those skilled in the art will understand that... Figure 5 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 501 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 502, and by calling data stored in the memory 502, it performs various functions of the computer device and processes data, thereby providing overall monitoring of the computer device. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 501.

[0105] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.

[0106] The computer equipment also includes a power supply 503 that supplies power to the various components. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 503 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0107] The computer device may also include an input unit 504, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0108] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 501 in the computer device loads the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 runs the application programs stored in the memory 502 to realize various functions, as follows: The system acquires upgrade configuration information, including upgrade file information for system upgrades on the terminal device. This upgrade file information describes the upgrade files in the upgrade package for the system upgrade. When determining the configuration parameters for the dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information, the system acquires the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device. The system determines the target upgrade mode based on the minimum installation space and the available storage space. The system upgrade is then performed on the terminal device based on the target upgrade mode and the upgrade file.

[0109] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0110] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the system upgrade methods provided in embodiments of this application. For example, the computer program loaded by the processor can execute the following steps: The system acquires upgrade configuration information, including upgrade file information for system upgrades on the terminal device. This upgrade file information describes the upgrade files in the upgrade package for the system upgrade. When determining the configuration parameters for the dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information, the system acquires the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device. The system determines the target upgrade mode based on the minimum installation space and the available storage space. The system upgrade is then performed on the terminal device based on the target upgrade mode and the upgrade file.

[0111] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.

[0112] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.

[0113] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0114] The above provides a detailed description of a system upgrade method, apparatus, computer device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A system upgrade method, characterized in that, include: Obtain upgrade configuration information, which includes upgrade file information for system upgrade of terminal devices, and the upgrade file information is used to describe the upgrade files in the upgrade package of the system upgrade; When determining the configuration parameters of the dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information, the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device are obtained; The target upgrade mode is determined based on the minimum installation space and the available storage space. The terminal device is upgraded based on the target upgrade mode and the upgrade file.

2. The method according to claim 1, characterized in that, The upgrade configuration information is encapsulated based on the data offset and data size of the upgrade file in the upgrade package. The data offset and data size are obtained by parsing the upgrade package, which is stored on the server for the current system upgrade of the terminal device.

3. The method according to claim 1, characterized in that, The upgrade files include a first file, a second file, and a third file; The first file is used to store the data image and differential upgrade content of the storage device system partition; The second file is used to record the attribute information of the upgrade package corresponding to the first file; The third file is used to record the target information and attribute information of the upgrade package.

4. The method according to claim 3, characterized in that, Obtaining the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device includes: The upgrade configuration information is parsed to obtain the first data offset and the first data size of the second file, and the second data offset and the second data size of the third file; Download the second file based on the first data offset and the first data size; Download the third file based on the second data offset and the second data size; The third file is parsed to obtain a fourth file, as well as the third data offset and the third data size of the fourth file. The fourth file includes the metadata of the system upgrade. Download the fourth file based on the third data offset and the third data size; The fourth file is parsed to obtain the minimum installation space corresponding to the system upgrade; The storage space of the terminal device is calculated to obtain the available storage space of the terminal device.

5. The method according to any one of claims 1 to 4, characterized in that, The determination of the target upgrade mode based on the minimum installation space and the available storage space includes: When the minimum installation space is less than the available storage space, the download space is determined based on the minimum installation space and the available storage space. When the download space is greater than the storage space of the upgrade package, the static partition upgrade mode is determined as the target upgrade mode; When the download space is less than or equal to the storage space of the upgrade package, the dynamic partition upgrade mode is determined as the target upgrade mode.

6. The method according to claim 5, characterized in that, The method further includes: When the minimum installation space is greater than or equal to the available storage space, a prompt message is displayed to inform the user of the amount of space to be cleared.

7. The method according to any one of claims 1 to 4, characterized in that, After obtaining the upgrade configuration information, the method further includes: When it is determined from the upgrade file information that the upgrade configuration information does not carry the configuration parameters for dynamic partition upgrade mode, the static partition upgrade mode is determined as the target upgrade mode; or; When determining the specified upgrade mode in the upgrade configuration information based on the upgrade file information, the specified upgrade mode is determined to be the target upgrade mode.

8. A system upgrade device, characterized in that, include: The transceiver module is used to acquire upgrade configuration information, which includes upgrade file information for system upgrades of terminal devices. The upgrade file information describes the upgrade files in the upgrade package of the system upgrade. The processing module is used to obtain the minimum installation space corresponding to the system upgrade and the available storage space of the terminal device when determining the configuration parameters of the dynamic partition upgrade mode carried in the upgrade configuration information based on the upgrade file information. The target upgrade mode is determined based on the minimum installation space and the available storage space. The upgrade module is used to perform a system upgrade on the terminal device based on the target upgrade mode and the upgrade file.

9. A computer device, characterized in that, The computer device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to perform the steps of the method according to any one of claims 1 to 7.