An operating system (OS) over-the-air (OTA) upgrade method, system, device, and medium for a terminal

CN123011352APending Publication Date: 2026-10-30CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611198447.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

若升级过程中未能对相关数据进行准确识别、备份、恢复和校验,可能导致用户配置丢失、应用初始化异常、授权状态失效、业务功能不可用等问题,甚至需要用户重新构建关键业务数据

Benefits of technology

本申请提供了一种终端的操作系统OTA升级方法,所述方法包括:在对终端的操作系统执行OTA升级之前,获取终端的应用在源操作系统下的自声明继承信息,所述自声明继承信息为:应用对自身的待继承数据资产做出的声明;根据自声明继承信息,获取应用的待继承数据资产,并对待继承数据资产进行备份;在待继承数据资产备份成功的情况下,对终端的操作系统执行OTA升级;在终端的操作系统由源操作系统成功升级至目标操作系统的情况下,在目标操作系统下执行对待继承数据资产的恢复;在恢复出的数据资产校验通过的情况下,输出针对终端的操作系统升级成功的提示信息,和/或,响应于针对应用的启动请求,在目标操作系统下启动所述应用。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011352A_ABST
    Figure CN123011352A_ABST
Patent Text Reader

Abstract

The application provides an operating system OTA upgrading method and system of a terminal, a device and a medium, relates to the technical field of OTA upgrading, and the method comprises the following steps: acquiring self-declared inheritance information of an application of the terminal under a source operating system before performing OTA upgrading on the operating system of the terminal; acquiring to-be-inherited data assets of the application according to the self-declared inheritance information, and backing up the to-be-inherited data assets; performing OTA upgrading on the operating system of the terminal in the case that the backup of the to-be-inherited data assets is successful; performing recovery on the to-be-inherited data assets under a target operating system in the case that the operating system of the terminal is successfully upgraded from the source operating system to the target operating system; outputting prompt information that the operating system upgrading of the terminal is successful in the case that the recovered data assets pass the verification, and / or starting the application under the target operating system in response to a starting request of the application. The application can reduce the risk of application initialization exception and function unavailability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of OTA upgrade technology, and in particular to an OTA upgrade method, system, device and medium for a terminal operating system. Background Technology

[0002] With the rapid development of smart cockpits, in-vehicle terminals, and customized Android systems, OTA upgrades have become an important way to iterate vehicle system functions and maintain software. In actual upgrade processes, situations may occur such as changes in operating system versions, adjustments to application permission models, changes in application package names, reconstruction of directory structures, and application integration. For example, an application may be changed from a system-level application to a regular pre-installed application, or the storage path and access permissions of application private data may change.

[0003] During daily vehicle use, in-vehicle applications may generate critical business data such as configuration files, shared preferences, database files, authorization status, system settings, vehicle personalization parameters, navigation authorization files, user reading status, and driver memory data. This data is typically stored in scattered locations within application private directories, system directories, or restricted public directories, and remains needed after OTA upgrades. Failure to accurately identify, back up, restore, and verify this data during the upgrade process can lead to issues such as lost user configurations, abnormal application initialization, invalid authorization status, and unavailability of business functions, potentially requiring users to rebuild critical business data.

[0004] Therefore, this application proposes a new method for OTA (Over-The-Air) upgrade of the terminal operating system. Summary of the Invention

[0005] In view of the above problems, embodiments of this application provide a method, system, device and medium for OTA upgrade of the operating system of a terminal, so as to overcome the above problems or at least partially solve the above problems.

[0006] In a first aspect, this application provides a method for OTA (Over-The-Air) upgrade of a terminal's operating system, the method comprising: Before performing an OTA upgrade on the terminal's operating system, obtain the self-declared inheritance information of the terminal's application under the source operating system. The self-declared inheritance information is: the application's declaration of its own data assets to be inherited. Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the data assets to be inherited; If the backup of the data assets to be inherited is successful, perform an OTA upgrade on the terminal's operating system; If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the data assets to be inherited are restored under the target operating system. If the recovered data assets pass verification, output a message indicating that the operating system upgrade for the terminal has been successful, and / or, in response to a startup request for the application, launch the application under the target operating system.

[0007] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and backups of these data assets are performed, including: Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the application's data assets to be inherited to the terminal's storage space; If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the recovery of the data assets to be inherited is performed under the target operating system, including: If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the application's data assets to be inherited are read from the terminal's storage space. Using the data assets to be inherited read from the terminal's storage space, the system performs the restoration of the data assets to be inherited under the target operating system based on the self-declared inheritance information.

[0008] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and the application's data assets to be inherited are backed up to the terminal's storage space, including: Based on the self-declared inheritance information, determine the source path of the data assets to be inherited in the source operating system of the application; Read the application's data assets to be inherited based on the source path, and back up the data assets to be inherited based on the source path to the terminal's storage space; Using the data assets to be inherited read from the terminal's storage space, and based on the self-declared inheritance information, the data assets to be inherited are restored under the target operating system, including: Perform path relocation on the source path to determine the target path under the target operating system; The inherited data assets will be restored from the terminal's storage space to the target path.

[0009] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and backups of these data assets are performed, including: Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and determine the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the application's data assets to be inherited. Backup data assets that must be inherited locally; If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the method further includes: Retrieve data assets that are recoverable in the cloud from cloud servers; Output user reconstruction prompts for data assets of the user-reconstructable type.

[0010] Optionally, after backing up the data assets to be inherited, the method further includes: Based on the self-declared inheritance information, identify the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the data assets to be inherited by the application. In the event of a failure to back up data assets of a type that must be inherited locally, OTA upgrades for the terminal's operating system will be blocked. In the event of a backup failure for data assets that can be recovered in the cloud or rebuilt by the user, the backup anomaly status is recorded, and an OTA upgrade is performed on the terminal's operating system.

[0011] Optionally, after restoring the data assets to be inherited under the target operating system, the method further includes: Set the application's owner, permissions, and security context to match the target operating system; For the recovered data assets, perform at least one of the following verifications: Permission verification; Security context verification; Owner verification; Verify whether the file parameter values ​​of the recovered data assets are consistent with the file parameter values ​​of the successfully backed-up data assets to be inherited. The file parameter values ​​include at least one of the following: file size, number of files, and file hash value.

[0012] Optionally, after performing the restoration of the data assets to be inherited under the target operating system, the method further includes: If the data asset verification fails after recovery, at least one of the following actions shall be performed according to the exception handling strategy in the self-declared inheritance information: Re-restore data assets based on self-declared inheritance information; Back up the recovered data assets according to the backup path; Retain the data assets to be inherited in the storage space backed up to the terminal; Block the output of the message indicating a successful operating system upgrade for the terminal; Prevent the application from launching under the target operating system; Perform a system-level rollback to roll back the terminal's operating system to the source operating system; Output exception logs or report exception status.

[0013] A second aspect of this application provides an OTA (Over-The-Air) upgrade system for a terminal operating system, the system comprising: The first acquisition module is used to acquire the self-declared inheritance information of the terminal's application under the source operating system before performing an OTA upgrade on the terminal's operating system. The self-declared inheritance information is: the application's declaration of its own data assets to be inherited. The second acquisition module is used to acquire the application's data assets to be inherited based on the self-declared inheritance information, and to back up the data assets to be inherited. The upgrade module is used to perform OTA upgrades on the terminal's operating system after the backup of the data assets to be inherited is successful. The recovery module is used to perform the recovery of the data assets to be inherited under the target operating system when the terminal's operating system is successfully upgraded from the source operating system to the target operating system; The output module is used to output a prompt message indicating that the operating system upgrade for the terminal has been successful when the recovered data assets have been verified, and / or to launch the application under the target operating system in response to a startup request for the application.

[0014] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and the data assets to be inherited are backed up. The second acquisition module includes: The first acquisition submodule is used to acquire the application's data assets to be inherited based on the self-declared inheritance information, and back up the application's data assets to be inherited to the terminal's storage space. If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the recovery of the data assets to be inherited is performed under the target operating system. The recovery module includes: The read submodule is used to read the application's data assets to be inherited from the terminal's storage space when the terminal's operating system is successfully upgraded from the source operating system to the target operating system. The recovery submodule is used to recover the data assets to be inherited under the target operating system by using the data assets to be inherited read from the terminal's storage space and based on the self-declared inheritance information.

[0015] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and the application's data assets to be inherited are backed up to the terminal's storage space. The first obtaining module includes: The first determining submodule is used to determine the source path of the application's data assets to be inherited under the source operating system based on the self-declared inheritance information; The first backup submodule is used to read the application's data assets to be inherited based on the source path and back up the data assets to be inherited read based on the source path to the terminal's storage space. Using the data assets to be inherited read from the terminal's storage space, and based on the self-declared inheritance information, the data assets to be inherited are restored under the target operating system. The restoration submodule includes: The determination subunit is used to relocate the source path and determine the target path under the target operating system; The recovery subunit is used to restore the data assets to be inherited, which will be read from the terminal's storage space, to the target path.

[0016] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and the data assets to be inherited are backed up. The second acquisition module includes: The second acquisition submodule is used to acquire the application's data assets to be inherited based on the self-declared inheritance information, and to determine the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the application's data assets to be inherited. The second backup submodule is used to back up data assets that must be inherited locally; The system also includes: The third acquisition submodule is used to acquire data assets that can be recovered in the cloud from the cloud server; The output submodule is used to output user reconstruction prompts for data assets of the user-reconstructable type.

[0017] Optionally, the system further includes: The second determination submodule is used to determine, based on the self-declared inheritance information, the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the data assets to be inherited by the application. The blocking submodule is used to block OTA upgrades to the terminal's operating system in the event of a failure to back up data assets of a type that must be inherited locally. The logging submodule is used to record the backup failure status and perform OTA upgrades on the terminal's operating system in the event of a backup failure for data assets that can be recovered in the cloud or reconstructed by the user.

[0018] Optionally, the system further includes: The settings submodule is used to set the owner, permissions, and security context for the application that match the target operating system; The first execution submodule is used to perform at least one of the following verifications on the recovered data assets: Permission verification; Security context verification; Owner verification; Verify whether the file parameter values ​​of the recovered data assets are consistent with the file parameter values ​​of the successfully backed-up data assets to be inherited. The file parameter values ​​include at least one of the following: file size, number of files, and file hash value.

[0019] Optionally, the system further includes: The second execution submodule is used to perform at least one of the following processes in the event that the data asset verification fails after recovery, based on the exception handling strategy in the self-declared inheritance information: Re-restore data assets based on self-declared inheritance information; Back up the recovered data assets according to the backup path; Retain the data assets to be inherited in the storage space backed up to the terminal; Block the output of the message indicating a successful operating system upgrade for the terminal; Prevent the application from launching under the target operating system; Perform a system-level rollback to roll back the terminal's operating system to the source operating system; Output exception logs or report exception status.

[0020] A third aspect of this application provides an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of the OTA upgrade method for the terminal's operating system as described in the first aspect of this application.

[0021] A fourth aspect of this application provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the OTA upgrade method for the operating system of a terminal as described in the first aspect of this application.

[0022] The beneficial effects of this application are: This application provides an OTA upgrade method for a terminal's operating system. The method includes: before performing an OTA upgrade on the terminal's operating system, obtaining self-declared inheritance information of the terminal's application under the source operating system, wherein the self-declared inheritance information is a declaration made by the application regarding its data assets to be inherited; obtaining the application's data assets to be inherited based on the self-declared inheritance information, and backing up the data assets to be inherited; if the backup of the data assets to be inherited is successful, performing an OTA upgrade on the terminal's operating system; if the terminal's operating system is successfully upgraded from the source operating system to the target operating system, restoring the data assets to be inherited under the target operating system; if the restored data assets pass verification, outputting a prompt message indicating successful upgrade of the terminal's operating system; and / or, in response to a startup request for the application, starting the application under the target operating system.

[0023] This application identifies and backs up the data assets to be inherited based on the application's self-declared inheritance information before OTA upgrades. After successful backup, it performs an operating system upgrade, restores and verifies the relevant data under the target operating system, and confirms the upgrade success or allows the application to start only after the verification is successful. This avoids the loss of application configuration, authorization status, and business data, reduces the risk of application initialization anomalies and functional unavailability, and ensures the continuity of application data and business status before and after operating system upgrades. Attached Figure Description

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

[0025] Figure 1 This is a flowchart illustrating the steps of an OTA (Over-The-Air) upgrade method for a terminal's operating system provided in an embodiment of this application. Figure 2 This is a timing diagram of the backup and recovery of the data assets to be inherited before and after the OTA upgrade, provided in the embodiments of this application; Figure 3 This is a schematic diagram illustrating a cross-version path relocation process for a target path provided in an embodiment of this application: Figure 4 This is a schematic diagram illustrating the parsing of a self-declaration inheritance protocol and the generation of data inheritance description information, provided in an embodiment of this application. Figure 5 This is a flowchart of an OTA (Over-The-Air) upgrade method for a terminal's operating system provided in an embodiment of this application; Figure 6This is a schematic diagram of an OTA (Over-The-Air) upgrade system for a terminal provided in an embodiment of this application; Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0027] In a first aspect, this application provides a method for OTA (Over-The-Air) upgrade of a terminal's operating system, such as... Figure 1 As shown, the method includes: S101, Before performing an OTA upgrade on the terminal's operating system, obtain the self-declared inheritance information of the terminal's application under the source operating system. The self-declared inheritance information is: the application's declaration of its own data assets to be inherited.

[0028] In this step, before the terminal's operating system performs an OTA upgrade, the self-declared inheritance information generated by the application under the source operating system is obtained. The source operating system refers to the operating system running on the terminal before the OTA upgrade. The self-declared inheritance information is created by the application for its own data assets and is used to indicate the data assets to be inherited that the application still needs to use after the operating system upgrade.

[0029] For example, an application can configure a data asset inheritance entry point in the application manifest, and declare the data assets to be inherited and the corresponding inheritance strategy in a structured manner in the resource file corresponding to that entry point, for example: <meta-data Android: name="OTA_DATA_INHERITANCE" Android: resource="@xml / ota_data_inheritance" / > The resource file corresponding to the data asset inheritance entry point configures the data assets to be inherited. For example: <?xml version="1.0" encoding="utf-8"?> <inheritance version="1"> <asset id="diagnose_config" sourcePath=" / data / vendor / diagnose / config / " type="directory" sourceVersion="V1" targetVersion="V2" relocateRule="DIAGNOSE_CONFIG_V1_TO_V2" verify="hash,count,permission" rollback="retain_backup" blockOnFailure="true" / > <asset id="auth_state" sourcePath=" / data / vendor / diagnose / auth / state.db" type="file" verify="hash,readable" rollback="restore_to_backup_path" blockOnFailure="true" / > < / inheritance> It should be noted that the above configuration is merely an example. This application does not limit specific field names, resource names, or file formats. As long as the application can express the data assets to be inherited and the inheritance strategy through a structured declaration, it falls within the scope of protection of this application.

[0030] S102, based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the data assets to be inherited.

[0031] Based on the self-declared inheritance information, the data assets to be inherited for the application are identified, and these assets are backed up under the source operating system. Data assets to be inherited refer to data generated during the application's operation on the source operating system and which needs to be used under the target operating system. The backup process is used to save the data assets to be inherited before performing an OTA upgrade, preventing the loss of related data due to operating system upgrades.

[0032] S103 performs an OTA upgrade on the terminal's operating system after the backup of the data assets to be inherited is successful.

[0033] In this step, assuming the data assets to be inherited are successfully backed up, an OTA upgrade is performed on the terminal's operating system, upgrading it from the source operating system to the target operating system. By making a successful backup a prerequisite for performing an OTA upgrade, the possibility of directly upgrading the operating system before the data assets to be inherited have been effectively preserved can be avoided.

[0034] S104, if the terminal's operating system is successfully upgraded from the source operating system to the target operating system, perform the restoration of the data assets to be inherited under the target operating system.

[0035] If the source operating system is successfully upgraded to the target operating system, the data assets to be inherited are restored under the target operating system, that is, the data backed up before the upgrade is restored to the target operating system, so that the application can continue to use the relevant data under the target operating system.

[0036] S105, if the recovered data assets pass the verification, output a prompt message indicating that the operating system upgrade for the terminal is successful, and / or, in response to the application's startup request, start the application under the target operating system.

[0037] In this step, the recovered data assets need to be verified to determine if they meet the usage requirements. If the verification passes, a message indicating a successful operating system upgrade can be output; alternatively, when a launch request for the application is received, the application can be launched under the target operating system; or a message indicating a successful upgrade can be output simultaneously, and the application can be allowed to launch. Therefore, only after the inherited data assets have been fully restored and verified can the operating system upgrade be confirmed as successful or the application be allowed to run under the target operating system.

[0038] This application identifies and backs up the data assets to be inherited based on the application's self-declared inheritance information before OTA upgrades. After successful backup, it performs an operating system upgrade, restores and verifies the relevant data under the target operating system, and confirms the upgrade success or allows the application to start only after the verification is successful. This avoids the loss of application configuration, authorization status, and business data, reduces the risk of application initialization anomalies and functional unavailability, and ensures the continuity of application data and business status before and after operating system upgrades.

[0039] In one embodiment, the application's data assets to be inherited are obtained based on self-declared inheritance information, and the data assets to be inherited are backed up, including: Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the application's data assets to be inherited to the terminal's storage space; If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the recovery of the data assets to be inherited is performed under the target operating system, including: If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the application's data assets to be inherited are read from the terminal's storage space. Using the data assets to be inherited read from the terminal's storage space, the system performs the restoration of the data assets to be inherited under the target operating system based on the self-declared inheritance information.

[0040] In this embodiment, the self-declared inheritance information is generated by the application for data assets it needs to continue using after an OTA upgrade, indicating the data assets to be inherited and the corresponding data inheritance method. In practical applications, the data assets to be inherited may include configuration files, shared preferences, database files, authorization status files, user settings, vehicle personalization configurations, or critical business caches formed during the application's operation in the source operating system. The terminal determines the corresponding data assets based on the self-declared inheritance information and retrieves this data from the data storage location under the source operating system.

[0041] Before performing an OTA (Over-The-Air) upgrade of the operating system, the terminal backs up the data assets to be inherited to its storage space. This storage space is a region capable of preserving data across the OTA upgrade process; after the backup data is written to the source operating system, it can still be read under the target operating system. For example, this storage space can be a preset reserved partition, a temporary partition, or a system-reserved data area. By saving the data assets to be inherited to this storage space, the inability to retrieve relevant data from the original storage location can be avoided after the source operating system is replaced.

[0042] Specifically, during the backup process, the data assets to be inherited can be determined based on self-declared inheritance information. For example, the source path and data object type of the data assets to be inherited can be determined based on the self-declared inheritance information. Files, directories, databases, or other data objects are read from the corresponding source path, and the read data is written to the terminal's storage space. The terminal can save backup data corresponding to different applications or different data assets separately, so that after the operating system upgrade is completed, the application and data asset corresponding to each backup data can be determined.

[0043] For example, if application data in the source operating system is stored at ` / data / vendor / diagnose / config / `, and the corresponding data storage location in the target operating system is adjusted to ` / data / misc / diagnose / profile / `, then the data recovery location in the target operating system can be determined based on the self-declared inheritance information, and the backup data in the terminal storage space can be restored to that location. During recovery, corresponding directories can also be created according to the target operating system's directory structure, and files, directories, databases, or system settings can be written to them so that the recovered data can continue to be used in the target operating system.

[0044] This embodiment allows the use of the terminal's storage space to save data assets to be inherited across the OTA upgrade process, and to complete data recovery under the target operating system based on the application's self-declared inheritance information. This reduces the risk of application data loss or unusability caused by operating system upgrades, and ensures the continuity of application data before and after the upgrade.

[0045] In one embodiment, the backup and recovery sequence of the data assets to be inherited before and after the OTA upgrade can be found in [reference needed]. Figure 2 As shown: Before an OTA upgrade, the application / self-declared information item provides self-declared inheritance information to the OTA control item. Based on this information, the OTA control item sends an inheritance task to the data inheritance service item. The data inheritance service item then calls the data backup and recovery item to perform a backup operation. The data backup and recovery item writes the data assets to be inherited to the persistent storage item and sequentially reports the backup results and status. After the OTA upgrade is complete, the OTA control item notifies the data backup and recovery item to perform data recovery. The data backup and recovery item reads the data assets to be inherited from the persistent storage item and completes the recovery, then sequentially reports the recovery results to both the data inheritance service item and the OTA control item.

[0046] In one embodiment, obtaining the application's data assets to be inherited based on self-declared inheritance information and backing up the application's data assets to the terminal's storage space includes: Based on the self-declared inheritance information, determine the source path of the data assets to be inherited in the source operating system of the application; Read the application's data assets to be inherited based on the source path, and back up the data assets to be inherited based on the source path to the terminal's storage space; Using the data assets to be inherited read from the terminal's storage space, and based on the self-declared inheritance information, the data assets to be inherited are restored under the target operating system, including: Perform path relocation on the source path to determine the target path under the target operating system; The inherited data assets will be restored from the terminal's storage space to the target path.

[0047] In this embodiment, the self-declared inheritance information records the source path of the data asset to be inherited under the source operating system. After parsing the self-declared inheritance information, the terminal can locate the corresponding data asset based on the source path. The source path indicates the actual storage location of the data asset in the source operating system, and the corresponding data asset can be a file, directory, database file, configuration data, or system settings item, etc.

[0048] Furthermore, after determining the source path, the terminal accesses and reads the data assets to be inherited based on the source path, and backs up the read data to the terminal's storage space. By transferring the data from the source path to a storage space that can preserve data across the OTA upgrade process, it is possible to avoid the data in the original path becoming unreadable after the source operating system is replaced.

[0049] Once the terminal's operating system is successfully upgraded to the target operating system, the backed-up data assets to be inherited are read from the terminal's storage space. Because there may be changes in directory structure, application package names, user identifiers, partition mounting methods, or permission models between the source and target operating systems, the source path is relocated during data recovery by combining the self-declared inheritance information and the target operating system's runtime environment to determine the corresponding target path for the data assets under the target operating system.

[0050] For example, the source path of the data asset to be inherited in the source operating system is / data / vendor / diagnose / config / . Due to changes in the directory structure and permission model of the target operating system, the data needs to be stored in / data / misc / diagnose / profile / . In this case, the source path can be mapped to the target path according to the path relocation rules in the self-declared inheritance information, and the data read from the terminal storage space can be restored to the target path, enabling the application to continue to access and use the relevant data under the target operating system.

[0051] This embodiment allows for the accurate reading and backup of data assets to be inherited based on the source path declared by the application. After an OTA upgrade, the data can be restored to the applicable path under the target operating system through path relocation, thereby adapting to changes in directory structure or data storage location caused by operating system upgrades and reducing the risk of data being restored to the wrong path or the application being unable to access the restored data.

[0052] In this embodiment, the process of relocating the source path and determining the cross-version path relocation of the target path under the target operating system is as follows: Figure 3 As shown: Based on the self-declared inheritance information, determine the source path of the data asset to be inherited under the source operating system: / data / vendor / diagnose / config / / data / vendor / diagnose / auth / state.db / data / vendor / diagnose / calibration / The data assets to be inherited are read based on the source path, and the read data is backed up to the terminal's storage space. After the operating system upgrade is completed, the source path is relocated to determine the target path of the data assets to be inherited under the target operating system.

[0053] Finally, the backed-up data assets to be inherited are read from the terminal's storage space and restored to the target path: / data / misc / diagnose / profile / / data / misc / diagnose / auth / state.db / data / misc / diagnose / calibration / .

[0054] For example, after determining the target path of the data asset to be inherited under the target operating system, data inheritance description information can be generated for use in the data backup and recovery process based on the parsing results of the self-declared inheritance information, the runtime environment of the source operating system, and the runtime environment of the target operating system. The data inheritance description information may include application identifier, data asset identifier, source path, target path, data object type, version information, path relocation rules, permission settings, verification rules, rollback policies, and failure blocking identifiers, etc.

[0055] {"packageName": "com.test.diagnose", "assetId": "diagnose_config", "sourcePath": " / data / vendor / diagnose / config / ", "targetPath": " / data / misc / diagnose / profile / ", "assetType": "directory", "sourceVersion": "V1", "targetVersion": "V2", "relocateRule": "DIAGNOSE_CONFIG_V1_TO_V2", "permission": { "owner": "system", "group": "diagnose", "mode": "0750" }, "verifyRules": ["hash", "count", "permission"], "rollbackPolicy": "retain_backup", "blockOnFailure": true} In this application, after determining the source path of the data asset to be inherited under the source operating system and the target path under the target operating system, data inheritance description information can be generated based on the parsing results of the self-declared inheritance information, the source operating system environment, and the target operating system environment. This information is then used for subsequent data backup, recovery, permission settings, verification, and exception handling. The process of parsing the self-declared inheritance protocol and generating the data inheritance description information can be found in [reference needed]. Figure 4 As shown: The system retrieves the self-declared inheritance entry point from the application manifest and reads the self-declared inheritance information from this entry point, such as self-declared inheritance information in XML, JSON, or resource file format. Then, it parses the self-declared inheritance information to obtain the source path, data type, version information, path relocation rules, permission requirements, validation rules, and exception handling strategies. Simultaneously, it obtains the target operating system's environment information, such as directory structure, permission model, application package name, and path mapping rules, and generates the target path based on the path relocation rules. Finally, combining the parsing results and the target system environment, it generates and outputs data inheritance description information, such as the source path, target path, data type, version information, permission settings, validation rules, and exception handling strategies.

[0056] In one embodiment, the application's data assets to be inherited are obtained based on self-declared inheritance information, and the data assets to be inherited are backed up, including: Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and determine the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the application's data assets to be inherited. Backup data assets that must be inherited locally; If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the method further includes: Retrieve data assets that are recoverable in the cloud from cloud servers; Output user reconstruction prompts for data assets of the user-reconstructable type.

[0057] In this embodiment, based on the self-declared inheritance information provided by the application, the data assets to be inherited that the application still needs to use after OTA upgrades are determined. These data assets are then categorized according to their recovery methods into three types: locally mandatory inheritance, cloud-recoverable, and user-reconstructable. Different processing methods are used for different types of data assets to avoid indiscriminate backup of all data.

[0058] Data assets that must be inherited locally refer to data that cannot be retrieved from the cloud and is not suitable for users to rebuild; they need to be directly carried over between the source and target operating systems. For such data assets, a local backup should be performed before performing an OTA upgrade, and the backup should be used for data recovery after the operating system upgrade is successful, ensuring that applications can continue to use the original data.

[0059] Cloud-recoverable data assets refer to data that is already stored on a cloud server or can be retrieved from the cloud based on application accounts, user identities, or other information. For these types of data assets, local backups are not required before OTA upgrades. Once the terminal's operating system is successfully upgraded to the target operating system, the corresponding data assets are retrieved from the cloud server and provided to applications running the target operating system.

[0060] User-reconstructable data assets refer to data that can be recreated by users through settings, selections, or operations. These data assets do not require local backups or retrieval from cloud servers. After a successful operating system upgrade, a corresponding user reconstruction prompt message is output to guide the user in rebuilding the relevant data.

[0061] This embodiment allows for categorized processing based on the recovery methods of different data assets. Only data of the types that must be inherited locally is backed up, while other data is processed through cloud recovery or user reconstruction. This reduces unnecessary data copying and storage space occupation, and improves the targeting and efficiency of data processing during OTA upgrades.

[0062] In one embodiment, after backing up the data assets to be inherited, the method further includes: Based on the self-declared inheritance information, identify the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the data assets to be inherited by the application. In the event of a failure to back up data assets of a type that must be inherited locally, OTA upgrades for the terminal's operating system will be blocked. In the event of a backup failure for data assets that can be recovered in the cloud or rebuilt by the user, the backup anomaly status is recorded, and an OTA upgrade is performed on the terminal's operating system.

[0063] In this embodiment, after the backup process of the data assets to be inherited is completed, the data assets are classified according to the self-declared inheritance information provided by the application, and it is determined that the data assets belong to the types that must be inherited locally, types that can be recovered in the cloud, and types that can be rebuilt by the user. In practical applications, different types of data assets correspond to different levels of importance and subsequent recovery methods.

[0064] After determining the type of each data asset to be inherited, the decision on whether to allow OTA upgrades to continue is made based on the backup results of the corresponding data assets. For data assets that must be inherited locally, since such data usually cannot be recovered through the cloud or reconstructed by the user, OTA upgrades to the terminal operating system are blocked when the backup fails. This prevents the source operating system from being replaced without effectively preserving critical data, which could lead to unrecoverable data.

[0065] For data assets that can be recovered from the cloud or rebuilt by the user, even if local backup fails, OTA upgrades will not be blocked. Instead, the corresponding backup failure status will be recorded, and OTA upgrades will continue to be performed on the terminal's operating system. Data assets that can be recovered from the cloud can be retrieved again after the upgrade is complete, while data assets that can be rebuilt by the user can be restored by prompting the user to reset or repeat the process. Therefore, backup failures for this type of data typically do not directly lead to the permanent loss of critical application business status.

[0066] This embodiment enables differentiated OTA upgrade control based on the importance of different types of data assets. It can promptly block upgrades when local data backup fails to be inherited, and allow upgrades to continue when recoverable or rebuildable data backups fail, thus balancing critical data security and OTA upgrade execution efficiency.

[0067] In one embodiment, after performing the restoration of the data assets to be inherited under the target operating system, the method further includes: Set the application's owner, permissions, and security context to match the target operating system; For the recovered data assets, perform at least one of the following verifications: Permission verification; Security context verification; Owner verification; Verify whether the file parameter values ​​of the recovered data assets are consistent with the file parameter values ​​of the successfully backed-up data assets to be inherited. The file parameter values ​​include at least one of the following: file size, number of files, and file hash value.

[0068] In this embodiment, after restoring the data assets to be inherited under the target operating system, matching owners, access permissions, and security contexts are set for the application and the restored data assets based on the target operating system's permission model and runtime environment. The owner is used to determine the identity of the owner corresponding to the data asset; the access permissions limit the application or system process's ability to read, write, and execute data assets; and the security context ensures that the restored data assets meet the security access control requirements of the target operating system. By resetting these attributes, it is possible to avoid situations where changes in application identity, permission model, or security policies between the source and target operating systems prevent the application from accessing the restored data assets normally.

[0069] Furthermore, after completing the relevant attribute settings, the recovered data assets are verified. Verification may include at least one of permission verification, security context verification, and owner verification to determine whether the recovered data assets have permissions, owner, and security context matching the target operating system, thereby determining whether the application can normally read or use the relevant data under the target operating system.

[0070] Additionally, the file parameter values ​​of the recovered data assets can be compared with the file parameter values ​​of the data assets to be inherited recorded when the backup was successful. The file parameter values ​​can include at least one of the following: file size, number of files, and file hash value. File size verification determines whether the amount of data before and after recovery is consistent; file number verification determines whether any files to be inherited are missing; and file hash value verification determines whether the content of the recovered files is consistent with the content of the files at the time of backup.

[0071] This embodiment allows for further verification of the integrity of data assets and the correctness of permission attributes after data recovery. It avoids situations where applications cannot access the recovered data due to missing files, content changes, incorrect ownership, abnormal permissions, or mismatched security contexts, thereby improving the reliability of data recovery after OTA upgrades.

[0072] In one embodiment, after performing the restoration of the data assets to be inherited under the target operating system, the method further includes: If the data asset verification fails after recovery, at least one of the following actions shall be performed according to the exception handling strategy in the self-declared inheritance information: Re-restore data assets based on self-declared inheritance information; Back up the recovered data assets according to the backup path; Retain the data assets to be inherited in the storage space backed up to the terminal; Block the output of the message indicating a successful operating system upgrade for the terminal; Prevent the application from launching under the target operating system; Perform a system-level rollback to roll back the terminal's operating system to the source operating system; Output exception logs or report exception status.

[0073] In this embodiment, after the data asset to be inherited is restored under the target operating system, the restored data asset is verified to determine whether the restored data content, file attributes, or access status meet preset requirements. If the verification fails, it indicates that the restored data asset may have missing files, inconsistent content, abnormal permissions, or be unusable. In this case, the corresponding exception handling operation is executed according to the exception handling strategy configured for the corresponding data asset in the self-declared inheritance information.

[0074] Specifically, data asset recovery can be performed again based on the self-declared inheritance information, that is, the successfully backed-up data assets to be inherited can be read again from the terminal's storage space and restored again according to the recovery method determined by the self-declared inheritance information.

[0075] You can also back up the recovered data assets using a backup path, saving them to a pre-determined backup path to prevent further modification or loss. Simultaneously, you can retain the data assets to be inherited that were backed up to the terminal storage space before the upgrade, without immediately deleting them, so that they can be reused for subsequent recovery, fault analysis, or data processing by maintenance personnel.

[0076] For data assets that fail verification, the system can also block the output of successful operating system upgrade notifications, preventing the terminal from externally confirming that the OTA upgrade has been completely successful. It can also prevent applications from starting on the target operating system, avoiding initialization errors or business function anomalies caused by applications reading incomplete, erroneous, or unusable data assets. For cases with a high degree of verification failure that cannot be handled through recovery methods, a system-level rollback can be performed, rolling the terminal's operating system back from the target operating system to the source operating system to restore the system's operating environment before the upgrade.

[0077] In addition, exception logs can be output or exception statuses can be reported to the management platform, cloud server, or relevant control modules. In this embodiment, exception logs or exception statuses can be used to record data assets that failed verification, the reasons for the failure, the recovery status, and the exception handling operations that have been performed, providing a basis for subsequent fault location and maintenance. In this embodiment, the above-mentioned processing methods can be executed individually or in combination according to the importance of the data assets and the verification failure situation.

[0078] In one embodiment, this application provides a flowchart of an OTA (Over-The-Air) upgrade method for a terminal's operating system, such as... Figure 5 As shown: The terminal detection enters the OTA preparation stage, reads the inheritance entry from the application list, and obtains the application's self-declared inheritance information. Subsequently, based on the self-declared inheritance information, it obtains the application's data assets to be inherited and backs them up. According to the self-declared inheritance information, the data assets to be inherited are divided into three types: locally mandatory inheritance, cloud-recoverable, and user-reconstructable. Local backups are performed on locally mandatory inheritance data assets; corresponding identifiers are recorded for cloud-recoverable data assets to facilitate recovery from the cloud after the upgrade; and user reconstruction prompts are output for user-reconstructable data assets.

[0079] After the data assets to be inherited are successfully backed up, an OTA upgrade of the terminal operating system is performed. After the upgrade, the data assets to be inherited are restored under the target operating system, and the application is configured with an owner, permissions, and security context matching the target operating system. Then, the restored data assets are verified. If the verification passes, a message indicating a successful operating system upgrade is output, and / or an application startup request is responded to, launching the application under the target operating system. If the verification fails, corresponding processing is performed according to the exception handling strategy in the self-declared inheritance information. The exception handling includes at least one of the following: re-restoring the data assets according to the self-declared inheritance information; backing up the restored data assets using a backup path; retaining the data assets to be inherited in the terminal's storage space; blocking the output of the operating system upgrade success message for the terminal; blocking the launch of the application under the target operating system; performing a system-level rollback to roll back the terminal's operating system to the source operating system; and outputting an exception log or reporting an exception status.

[0080] Based on the same inventive concept, a second aspect of the embodiments of this application provides an OTA (Over-The-Air) upgrade system for a terminal operating system, such as... Figure 6 As shown, the system includes: The first acquisition module 201 is used to acquire the self-declared inheritance information of the terminal's application under the source operating system before performing an OTA upgrade on the terminal's operating system. The self-declared inheritance information is: the application's declaration of its own data assets to be inherited. The second acquisition module 202 is used to acquire the application's data assets to be inherited based on the self-declared inheritance information, and to back up the data assets to be inherited. Upgrade module 203 is used to perform OTA upgrades on the terminal's operating system after the backup of the data assets to be inherited is successful. Recovery module 204 is used to perform the recovery of the data assets to be inherited under the target operating system when the terminal's operating system is successfully upgraded from the source operating system to the target operating system; The output module 205 is used to output a prompt message indicating that the operating system upgrade for the terminal has been successful when the recovered data assets have been verified, and / or to launch the application under the target operating system in response to a startup request for the application.

[0081] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and the data assets to be inherited are backed up. The second acquisition module 202 includes: The first acquisition submodule is used to acquire the application's data assets to be inherited based on the self-declared inheritance information, and back up the application's data assets to be inherited to the terminal's storage space. If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the recovery of the data assets to be inherited is performed under the target operating system. The recovery module 204 includes: The read submodule is used to read the application's data assets to be inherited from the terminal's storage space when the terminal's operating system is successfully upgraded from the source operating system to the target operating system. The recovery submodule is used to recover the data assets to be inherited under the target operating system by using the data assets to be inherited read from the terminal's storage space and based on the self-declared inheritance information.

[0082] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and the application's data assets to be inherited are backed up to the terminal's storage space. The first acquisition module 201 includes: The first determining submodule is used to determine the source path of the application's data assets to be inherited under the source operating system based on the self-declared inheritance information; The first backup submodule is used to read the application's data assets to be inherited based on the source path and back up the data assets to be inherited read based on the source path to the terminal's storage space. Using the data assets to be inherited read from the terminal's storage space, and based on the self-declared inheritance information, the data assets to be inherited are restored under the target operating system. The restoration submodule includes: The determination subunit is used to relocate the source path and determine the target path under the target operating system; The recovery subunit is used to restore the data assets to be inherited, which will be read from the terminal's storage space, to the target path.

[0083] Optionally, based on the self-declared inheritance information, the application's data assets to be inherited are obtained, and the data assets to be inherited are backed up. The second acquisition module 202 includes: The second acquisition submodule is used to acquire the application's data assets to be inherited based on the self-declared inheritance information, and to determine the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the application's data assets to be inherited. The second backup submodule is used to back up data assets that must be inherited locally; The system also includes: The third acquisition submodule is used to acquire data assets that can be recovered in the cloud from the cloud server; The output submodule is used to output user reconstruction prompts for data assets of the user-reconstructable type.

[0084] Optionally, the system further includes: The second determination submodule is used to determine, based on the self-declared inheritance information, the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the data assets to be inherited by the application. The blocking submodule is used to block OTA upgrades to the terminal's operating system in the event of a failure to back up data assets of a type that must be inherited locally. The logging submodule is used to record the backup failure status and perform OTA upgrades on the terminal's operating system in the event of a backup failure for data assets that can be recovered in the cloud or reconstructed by the user.

[0085] Optionally, the system further includes: The settings submodule is used to set the owner, permissions, and security context for the application that match the target operating system; The first execution submodule is used to perform at least one of the following verifications on the recovered data assets: Permission verification; Security context verification; Owner verification; Verify whether the file parameter values ​​of the recovered data assets are consistent with the file parameter values ​​of the successfully backed-up data assets to be inherited. The file parameter values ​​include at least one of the following: file size, number of files, and file hash value.

[0086] Optionally, the system further includes: The second execution submodule is used to perform at least one of the following processes in the event that the data asset verification fails after recovery, based on the exception handling strategy in the self-declared inheritance information: Re-restore data assets based on self-declared inheritance information; Back up the recovered data assets according to the backup path; Retain the data assets to be inherited in the storage space backed up to the terminal; Block the output of the message indicating a successful operating system upgrade for the terminal; Prevent the application from launching under the target operating system; Perform a system-level rollback to roll back the terminal's operating system to the source operating system; Output exception logs or report exception status.

[0087] Based on the same inventive concept, a third aspect of the embodiments of this application provides a method as follows: Figure 7 The electronic device 100 shown includes a processor 120, a memory 110, and a program or instructions stored in the memory 110 and executable on the processor 120. When the program or instructions are executed by the processor 120, they implement the steps of the OTA upgrade method for the operating system of the terminal as described in the first aspect of this application.

[0088] Based on the same inventive concept, in a fourth aspect of this application, a readable storage medium is provided, on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the OTA upgrade method for the operating system of a terminal as described in the first aspect of this application are implemented.

[0089] Each embodiment in this specification focuses on the differences from other embodiments. For the same or similar parts between the embodiments, please refer to each other.

[0090] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0091] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0092] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0094] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0095] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0096] The above provides a detailed description of the OTA upgrade method, system, device, and medium for a terminal operating system. 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 method for OTA (Over-The-Air) upgrade of a terminal's operating system, characterized in that, The method includes: Before performing an OTA upgrade on the terminal's operating system, obtain the self-declared inheritance information of the terminal's application under the source operating system. The self-declared inheritance information is: the application's declaration of its own data assets to be inherited. Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the data assets to be inherited; If the backup of the data assets to be inherited is successful, perform an OTA upgrade on the terminal's operating system; If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the data assets to be inherited are restored under the target operating system. If the recovered data assets pass verification, output a message indicating that the operating system upgrade for the terminal has been successful, and / or, in response to a startup request for the application, launch the application under the target operating system.

2. The OTA upgrade method for the terminal operating system according to claim 1, characterized in that, Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the data assets to be inherited, including: Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the application's data assets to be inherited to the terminal's storage space; If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the recovery of the data assets to be inherited is performed under the target operating system, including: If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the application's data assets to be inherited are read from the terminal's storage space. Using the data assets to be inherited read from the terminal's storage space, the system performs the restoration of the data assets to be inherited under the target operating system based on the self-declared inheritance information.

3. The OTA upgrade method for the terminal's operating system according to claim 1, characterized in that, Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the application's data assets to the terminal's storage space, including: Based on the self-declared inheritance information, determine the source path of the data assets to be inherited in the source operating system of the application; Read the application's data assets to be inherited based on the source path, and back up the data assets to be inherited based on the source path to the terminal's storage space; Using the data assets to be inherited read from the terminal's storage space, and based on the self-declared inheritance information, the data assets to be inherited are restored under the target operating system, including: Perform path relocation on the source path to determine the target path under the target operating system; The inherited data assets will be restored from the terminal's storage space to the target path.

4. The OTA upgrade method for the terminal's operating system according to claim 1, characterized in that, Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and back up the data assets to be inherited, including: Based on the self-declared inheritance information, obtain the application's data assets to be inherited, and determine the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the application's data assets to be inherited. Backup data assets that must be inherited locally; If the terminal's operating system is successfully upgraded from the source operating system to the target operating system, the method further includes: Retrieve data assets that are recoverable in the cloud from cloud servers; Output user reconstruction prompts for data assets of the user-reconstructable type.

5. The OTA upgrade method for the terminal's operating system according to claim 1, characterized in that, After backing up the inherited data assets, the method further includes: Based on the self-declared inheritance information, identify the data assets that must be inherited locally, the data assets that can be recovered in the cloud, and the data assets that can be rebuilt by the user from the data assets to be inherited by the application. In the event of a failure to back up data assets of a type that must be inherited locally, OTA upgrades for the terminal's operating system will be blocked. In the event of a backup failure for data assets that can be recovered in the cloud or rebuilt by the user, the backup anomaly status is recorded, and an OTA upgrade is performed on the terminal's operating system.

6. The OTA upgrade method for the terminal operating system according to claim 1, characterized in that, After restoring the data assets to be inherited under the target operating system, the method further includes: Set the application's owner, permissions, and security context to match the target operating system; For the recovered data assets, perform at least one of the following verifications: Permission verification; Security context verification; Owner verification; Verify whether the file parameter values ​​of the recovered data assets are consistent with the file parameter values ​​of the successfully backed-up data assets to be inherited. The file parameter values ​​include at least one of the following: file size, number of files, and file hash value.

7. The OTA upgrade method for the operating system of a terminal according to any one of claims 1-6, characterized in that, After restoring the data assets to be inherited under the target operating system, the method further includes: If the data asset verification fails after recovery, at least one of the following actions shall be performed according to the exception handling strategy in the self-declared inheritance information: Re-restore data assets based on self-declared inheritance information; Back up the recovered data assets according to the backup path; Retain the data assets to be inherited in the storage space backed up to the terminal; Block the output of the message indicating a successful operating system upgrade for the terminal; Prevent the application from launching under the target operating system; Perform a system-level rollback to roll back the terminal's operating system to the source operating system; Output exception logs or report exception status.

8. An OTA (Over-The-Air) upgrade system for a terminal operating system, characterized in that, The system includes: The first acquisition module is used to acquire the self-declared inheritance information of the terminal's application under the source operating system before performing an OTA upgrade on the terminal's operating system. The self-declared inheritance information is: the application's declaration of its own data assets to be inherited. The second acquisition module is used to acquire the application's data assets to be inherited based on the self-declared inheritance information, and to back up the data assets to be inherited. The upgrade module is used to perform OTA upgrades on the terminal's operating system after the backup of the data assets to be inherited is successful. The recovery module is used to perform the recovery of the data assets to be inherited under the target operating system when the terminal's operating system is successfully upgraded from the source operating system to the target operating system; The output module is used to output a prompt message indicating that the operating system upgrade for the terminal has been successful when the recovered data assets have been verified, and / or to launch the application under the target operating system in response to a startup request for the application.

9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein when the program or instructions are executed by the processor, they implement the steps of the OTA upgrade method for the operating system of the terminal as described in any one of claims 1-7.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the OTA upgrade method for the terminal's operating system as described in any one of claims 1-7.