System upgrade method and related apparatus
By completely removing the applications indicated by the OTA upgrade package from the pre-installed partitions and data partitions of the electronic device, the problem of some applications not being deleted after OTA upgrades is solved, improving the user experience and reducing memory usage.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2023-12-22
- Publication Date
- 2026-06-02
AI Technical Summary
After electronic devices remove applications from the system software via OTA upgrade packages, some applications are not completely removed, resulting in a poor user experience.
The application package is deleted from the pre-installed partition by the first OTA upgrade package, and the application package is deleted from the data partition by the second OTA upgrade package, ensuring that the application package is not present in either the pre-installed partition or the data partition of the electronic device, so that the application is not displayed on the desktop.
It enables the complete removal of applications, improves the user experience, reduces the possibility of accidental deletion when restarting the system after subsequent installations, and reduces memory usage.
Smart Images

Figure CN120234020B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to system upgrade methods and related devices. Background Technology
[0002] Electronic devices can update their system software through over-the-air (OTA) technology.
[0003] Electronic devices can download OTA (Over-The-Air) update packages via wireless communication methods such as Wireless Fidelity (Wi-Fi) or Bluetooth. These OTA update packages are then used to update or remove applications from the system software.
[0004] However, after electronic devices remove applications from their system software via OTA updates, some applications are not removed. Summary of the Invention
[0005] This application provides a system upgrade method and related apparatus, applicable to the field of terminal technology. When an electronic device deletes an application based on an OTA upgrade, the application package of the application can be deleted from both the pre-installed partition and the data partition. Thus, after the OTA upgrade, neither the pre-installed partition nor the data partition of the electronic device contains the application package, and the electronic device will not display the application.
[0006] In a first aspect, embodiments of this application propose a system upgrade method. The method includes: installing a first application based on a first OTA upgrade; displaying a desktop, the desktop including an icon of the first application; upgrading the first application in response to an operation to upgrade the first application; and, based on a second OTA upgrade following the upgrade of the first application, not displaying the first application on the desktop.
[0007] In this embodiment, the first OTA upgrade is used to instruct the installation of a first application. For example, the first OTA upgrade package may include the application package of the first application. After the electronic device replaces the content in the pre-installed partition with the first OTA upgrade package, the pre-installed partition includes the application package of the first application. The process of the electronic device replacing the content in the pre-installed partition with the first OTA upgrade package can be referred to the corresponding description below, and will not be repeated here.
[0008] The first application is the application in the first OTA upgrade package. The first application can be any type of application, such as a camera application, a video application, etc., without specific limitations.
[0009] The icon for the first application can be any form of icon. Upgrading the first application can be understood as updating the first application, or changing the version of the first application, etc. The operation of upgrading the first application can be the user downloading and installing the first application from the "App Store", the user downloading and installing the first application from a browser, webpage, etc., or the user clicking the "Update" control in the first application. There are no specific limitations here.
[0010] In some embodiments, upgrading the first application refers to storing the application package of the first application in the data partition. The application package of the first application in the data partition may be the same as or different from the application package of the first application stored in the prefab partition; no specific limitation is made here. The prefab partition and the data partition can be referred to the corresponding descriptions above, and will not be repeated here.
[0011] In this embodiment, the second OTA upgrade is used to instruct the deletion of the first application. For example, the second OTA upgrade package may include a configuration file that instructs the deletion of the first application. After the electronic device replaces the content in the pre-installed partition with the second OTA upgrade package, the pre-installed partition no longer includes the application package of the first application. The electronic device also deletes the application package of the first application from the data partition.
[0012] In this way, after the second OTA upgrade, the electronic device will not display the application package of the first application because neither the device's pre-installed partition nor its data partition contains the application package.
[0013] In one possible implementation, the upgrade package of the second OTA upgrade includes: a configuration file, which includes: an application identifier to be deleted, which includes: a first application identifier of the first application; based on the second OTA upgrade after upgrading the first application, the first application is not displayed on the desktop, which includes: deleting the first application package of the application to be deleted based on the upgrade package of the second OTA upgrade, the first application package being located in a first partition, which is not readable or writable; deleting the second application package of the application to be deleted based on the first application identifier, the second application package being located in a second partition, which is readable or writable; and the first application is not displayed on the desktop.
[0014] The application identifier to be deleted can be the package name, the application name, or any application identifier; there are no specific restrictions here. The first partition can correspond to the pre-built partition mentioned above, and the second partition can correspond to the data partition mentioned above. The application package can be an APK file. The first application can be any application; there are no specific restrictions here.
[0015] In this way, the electronic device can delete the application package in the second partition, so that the electronic device does not include the application package of the first application, and does not include the first application.
[0016] In one possible implementation, the second partition further includes a database, which stores path information of applications in the first partition; the second application package of the application to be deleted is deleted based on the first application identifier, including: after the second OTA upgrade, the device is powered on, the configuration file is parsed to obtain the application identifier to be deleted; the first path information in the database is deleted, and the first identifier corresponding to the first path information is recorded; the first path information is path information in the database that does not correspond to an application package; if the first identifier includes the first application identifier, the second application package is deleted.
[0017] The first identifier can be any identifier such as the application package name or the name of the application corresponding to the first path information, without any specific limitation here.
[0018] Electronic devices can identify the applications to be deleted during OTA upgrades (applications to be deleted) based on path information in the database and remove the first path information. This reduces the likelihood of the first application being deleted upon restarting after a second OTA upgrade, thus improving user experience and reducing the chance of accidental deletion during subsequent OTA upgrades.
[0019] In some embodiments, the first identifier can be the application package name of the application corresponding to the first path information. This facilitates subsequent retrieval of the application package.
[0020] It is understandable that the application packages stored in the first and second partitions typically carry the application package name. For example, the application package name can consist of: application package name, update count, and version. Alternatively, the application package name can consist of: a random value, application package name, update count, and version; no specific limitations are imposed here.
[0021] In one possible implementation, if the first identifier includes a first application identifier, deleting the second application package includes: if the first identifier includes a first application identifier, querying whether the path of the application package corresponding to the first application is in the second partition; if the application package corresponding to the first application is in the second partition, deleting the second application package.
[0022] In this embodiment, the existence of the application package corresponding to the first application in the second partition can be queried by application package name; alternatively, the path corresponding to the application package of the first application can be queried to see if it is within the second partition. For example, taking the second partition as a data partition, the query can be made to see if the path corresponding to the application package of the first application is data / app.
[0023] This allows for a reconfirmation of the application's package location, reducing the risk of accidental deletion due to incorrect package name matching or customized configurations.
[0024] In one possible implementation, deleting the second application package when the first identifier includes the first application identifier includes: querying the first partition to see if the application package of the first application exists; and deleting the second application package when the first partition does not include the application package of the first application.
[0025] In this embodiment, the application package name can be used to query whether the application package corresponding to the first application exists in the first partition; alternatively, the path corresponding to the application package of the first application can be queried to see if it is within the first partition.
[0026] This further verifies that the application package of the first application in the first partition has been deleted, reducing the possibility of accidental deletion due to the application package of the first application in the first partition not being scanned during boot.
[0027] In one possible implementation, the method further includes: deleting the data information of the first application when the second application package is deleted, the data information including one or more of the following: installation package information, permission information, or component information.
[0028] This removes all information from the first application, reducing the amount of memory used by the electronic device.
[0029] In one possible implementation, the first partition includes one or more of the following: system partition, vendor partition, odm partition, cust partition, preavs partition, preload partition, version partition, and product partition; the second partition includes: a data partition.
[0030] Secondly, embodiments of this application provide a system upgrade apparatus, which can be an electronic device, or a chip or chip system within an electronic device. The system upgrade apparatus may include a display unit and a processing unit. When the system upgrade apparatus is an electronic device, the display unit may be a display screen. The display unit is used to perform display steps to enable the electronic device to implement a system upgrade method described in the first aspect or any possible implementation of the first aspect. When the system upgrade apparatus is an electronic device, the processing unit may be a processor. The system upgrade apparatus may further include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit to enable the electronic device to implement a system upgrade method described in the first aspect or any possible implementation of the first aspect. When the system upgrade apparatus is a chip or chip system within an electronic device, the processing unit may be a processor. The processing unit executes the instructions stored in the storage unit to enable the electronic device to implement a system upgrade method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (e.g., a register, cache, etc.), or a storage unit located outside the chip within the electronic device (e.g., read-only memory, random access memory, etc.).
[0031] For example, the processing unit is configured to install a first application based on a first OTA upgrade; the display unit is configured to display a desktop, the desktop including an icon of the first application; the processing unit is further configured to upgrade the first application in response to an operation to upgrade the first application; the display unit is further configured to not display the first application on the desktop during a second OTA upgrade by the system upgrade device based on the upgraded first application.
[0032] In one possible implementation, the processing unit is specifically used to delete the first application package of the application to be deleted from the upgrade package of the second OTA upgrade, the first application package being located in a first partition that is not readable or writable; the processing unit is specifically used to delete the second application package of the application to be deleted based on the first application identifier, the second application package being located in a second partition that is readable or writable.
[0033] In one possible implementation, the second partition further includes a database for storing path information of applications in the first partition; a processing unit, specifically used to parse the configuration file to obtain the application identifier to be deleted after booting up following the second OTA upgrade; a processing unit, specifically used to delete the first path information in the database and record the first identifier corresponding to the first path information; the first path information is path information for which there is no corresponding application package in the database; if the first identifier includes the first application identifier, the second application package is deleted.
[0034] In one possible implementation, the processing unit is specifically configured to query whether the path of the application package corresponding to the first application is in the second partition when the first identifier includes the first application identifier; and to delete the second application package when the application package corresponding to the first application is in the second partition.
[0035] In one possible implementation, the processing unit is specifically configured to query whether the application package of the first application exists in the first partition if the first identifier includes the first application identifier; and to delete the second application package if the first partition does not include the application package of the first application.
[0036] In one possible implementation, the processing unit is further configured to delete the data information of the first application in the event that the second application package is deleted, the data information including one or more of the following: installation package information, permission information, or component information.
[0037] In one possible implementation, the first partition includes one or more of the following: system partition, vendor partition, odm partition, cust partition, preavs partition, preload partition, version partition, and product partition; the second partition includes: a data partition.
[0038] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory for storing code instructions, and the processor for running the code instructions to perform the methods described in the first aspect or any possible implementation of the first aspect.
[0039] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0040] Fifthly, embodiments of this application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect or any possible implementation thereof.
[0041] Sixthly, this application provides a chip or chip system including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected via a circuit. The at least one processor is used to run computer programs or instructions to perform the methods described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.
[0042] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).
[0043] It should be understood that the second to sixth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0045] Figure 2 This is a schematic diagram of storage for an application before and after an OTA upgrade in a possible design.
[0046] Figure 3 This application provides a schematic diagram of application storage before and after an application upgrade.
[0047] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0048] Figure 5 A software structure block diagram of an electronic device provided in an embodiment of this application;
[0049] Figure 6 A flowchart illustrating a system upgrade method provided in an embodiment of this application;
[0050] Figure 7 A flowchart illustrating the process of deleting an application package from a data partition, as provided in an embodiment of this application;
[0051] Figure 8 This application provides a schematic diagram of application storage before and after an OTA upgrade.
[0052] Figure 9 A flowchart illustrating a system upgrade method provided in an embodiment of this application;
[0053] Figure 10 A storage diagram of the application before and after a first OTA upgrade is provided as an embodiment of this application;
[0054] Figure 11 This is a schematic diagram illustrating the storage used during the execution of a system upgrade method provided in this application embodiment. Detailed Implementation
[0055] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:
[0056] 1. Over-the-air (OTA) upgrade: This involves downloading and installing firmware upgrades via a wireless network. OTA upgrades can be applied to various electronic devices such as smartphones, smart TVs, and IoT devices. Electronic devices can use OTA upgrades to improve functionality, fix bugs, and upgrade software versions, thereby enhancing device performance and user experience.
[0057] 2. Read-only memory (ROM) upgrade: refers to the iterative update of the operating system version of an electronic device, commonly known as a major version upgrade.
[0058] ROM refers to the firmware of the internal system of electronic devices such as mobile phones and computers. It serves as the bridge connecting the hardware and software of electronic devices. ROM stores the firmware code of electronic devices, including the operating system, device drivers, and applications.
[0059] 3. Maintenance Release (MR) Upgrade: This is an update released outside of the ROM upgrade phase, commonly known as a minor version upgrade. Compared to ROM upgrades, MR upgrades involve smaller system changes and are optimization updates of the same operating system.
[0060] 4. Other terms
[0061] In the embodiments of this application, terms such as "first" and "second" are used to distinguish identical or similar items with substantially the same function and purpose. For example, "first chip" and "second chip" are used only to distinguish different chips and do not limit their order of execution. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that "first" and "second" do not necessarily imply that they are different.
[0062] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0063] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0064] 5. Electronic equipment
[0065] The electronic devices in this application embodiment may include handheld devices, vehicle-mounted devices, etc., with OTA upgrade capabilities. For example, some electronic devices include: mobile phones, tablets, PDAs, laptops, mobile internet devices (MIDs), wearable devices (e.g., smartwatches, smart glasses, smart bracelets, or smart jewelry), virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, and personal digital assistants (PDAs). The embodiments of this application do not limit this to personal assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to a wireless modem, vehicle-mounted devices, terminal devices in 5G networks or terminal devices in future evolved public land mobile networks (PLMNs).
[0066] Furthermore, in this embodiment of the application, the electronic device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-to-object interconnection.
[0067] The electronic devices in the embodiments of this application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent, or user device, etc.
[0068] In this embodiment, the electronic device or various network devices include a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on top of the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0069] For example, Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1 As shown, the application scenario includes: server 101 and electronic device 102. Server 101 can establish a communication connection with electronic device 102.
[0070] Server 101 can be a single server or a server cluster consisting of multiple servers. Specifically, server 101 can be a server containing several storage upgrade packages, or a distributed server cluster containing distributed storage upgrade packages, group configuration information, or upgrade policy information. For example, a distributed server can be a server cluster consisting of multiple servers, which may include cloud computing servers, Content Delivery Network (CDN) servers, Network Time Protocol (NTP) servers, Domain Name System (DNS) servers, etc.; wherein, the servers in the server cluster coordinate with each other to jointly complete functions such as computing, data storage, and communication.
[0071] For ease of description, in this application embodiment, a single server, a distributed server, and a server cluster are collectively referred to as a server. In some application scenarios, server 101 may also be called an OTA server, OTA cloud, etc.
[0072] Electronic device 102 can be a device capable of providing users with various services such as voice, video, photography, and data connectivity by installing application software. Specific forms of electronic devices can be found in the descriptions above and will not be repeated here.
[0073] In this embodiment, server 101 provides over-the-air (OTA) service. Specifically, server 101 can provide OTA upgrade packages to electronic device 102. Adaptively, electronic device 102 can download the OTA upgrade package via a wireless network and update its system software using the OTA upgrade package. The wireless network can be Bluetooth, Wi-Fi, mobile communication network, etc.
[0074] In a possible design, the electronic device can receive OTA (Over-The-Air) upgrade packages from a server and use these packages to iteratively update the system software. These updates may include applications being installed or removed.
[0075] However, when OTA update packages are used to instruct the removal of applications, some applications are not removed after the electronic device undergoes an OTA update.
[0076] For example, consider an OTA update package used to instruct the removal of applications A and B. Before the OTA update, the electronic device could display icons for both application A and application B on the desktop. After the OTA update, the electronic device would display the icon for application A on the desktop, but not the icon for application B.
[0077] Storage analysis of the application revealed that after an OTA upgrade, the electronic device's data partition contained the application package for application A, and the device displayed an icon for application A. However, when the electronic device was upgraded via OTA, the pre-built partition's contents were replaced using an image, without modifying the contents of the data partition.
[0078] It is understood that electronic devices include pre-installed partitions and data partitions. Pre-installed partitions cannot be read or written; they can only be updated (upgraded) via OTA (Over-The-Air) updates. Pre-installed partitions can also be called read-only partitions, system read-only partitions, etc. For example, pre-installed partitions can include: system partitions, product partitions, vendor partitions, etc. Data partitions can be read and written. Data partitions can also be called application partitions, data application partitions, etc. No specific limitations are made here. Applications in the data partition can be updated through methods such as downloading from app stores or web browsers.
[0079] For example, taking system partitions and data partitions as examples, Figure 2 This is a schematic diagram illustrating the storage configuration before and after an OTA upgrade in a possible design. For example... Figure 2 As shown in Figure 'a', before the OTA upgrade, the system partition 1a of the electronic device includes: application package of application A and application package of application B; the data partition 2a includes: application package of application A.
[0080] After an electronic device deletes applications A and B via OTA upgrade, the device's storage partitions can be configured as follows: Figure 2 As shown in b. System partition 1b of the electronic device does not include: application package of application A and application package of application B; data partition 2b includes: application package of application A.
[0081] It is understandable that in some scenarios, when electronic devices perform OTA upgrades and delete applications in the pre-installed partition, the electronic devices may upgrade the applications in the pre-installed partition through methods such as downloading from "app stores" or web pages. Therefore, the data partition of the electronic device stores the application packages of the corresponding applications.
[0082] For example, taking system partitions and data partitions as examples, Figure 3 This is a schematic diagram illustrating the storage of an application before and after an application upgrade, provided as an embodiment of this application. For example... Figure 3 As shown in Figure 'a', the system partition 1a of the electronic device includes: application packages for application 1, application packages for application 2, application packages for application 3, and application packages for application 4; the data partition 2a includes: application packages for application 5 and application packages for application 6.
[0083] After the electronic device updates Application 1 and Application 2 through methods such as downloading from the "App Store" or downloading from a webpage, the electronic device's storage partition can be updated as follows: Figure 3 As shown in b. System partition 1b of the electronic device includes: application packages for application 1, application packages for application 2, application packages for application 3, and application packages for application 4; data partition 2b includes: application packages for application 1, application packages for application 2, application packages for application 5, and application packages for application 6.
[0084] In a possible design, if the electronic device deletes Application 1 and Application 2 via OTA after both applications are updated, the storage partitions of the electronic device can be configured as follows: Figure 3 As shown in 'c', the system partition 1c of the electronic device includes application packages for application 3 and application 4; the data partition 2c includes application packages for application 1, application 2, application 5, and application 6. After this OTA upgrade, the electronic device can display the icons for application 1 and application 2.
[0085] In view of this, embodiments of this application provide a software upgrade method. When an electronic device deletes an application based on an OTA upgrade, the application package of the application can be deleted from both the pre-installed partition and the data partition. Thus, after the OTA upgrade, neither the pre-installed partition nor the data partition of the electronic device contains the application package of the application, and the electronic device will not display the application.
[0086] To better understand the embodiments of this application, the structure of the electronic device of the embodiments of this application is described below.
[0087] For example, Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, an indicator 192, a camera 193, and a display screen 194, etc.
[0088] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc. This embodiment does not specifically limit the specific components.
[0089] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0090] The processor 110 may include one or more processing units. These processing units may be independent devices or integrated within one or more processors. The processor 110 may also include a memory for storing instructions and data. For example, the processor 110 may be used to implement the steps performed in the system upgrade method provided in the embodiments of this application, and to store instructions and data related to the system upgrade method.
[0091] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The internal memory 121 can be used to store executable program code, including instructions. The internal memory 121 may include a program storage area and a data storage area. For example, the internal memory 121 can be used to store executable program code in a system upgrade method.
[0092] In some embodiments, the internal memory 121 may include read-only memory (ROM) and random access memory (RAM). In practical applications, RAM, also known as "main memory," can be read and written at any time at high speed. It is typically used as a temporary data storage medium for the operating system or other running programs. RAM cannot retain data when the power is off. That is, RAM typically stores temporary data during the operation of the electronic device. ROM, also known as "non-volatile memory," generally stores data pre-written before being installed in the device, as well as user data generated when the user uses the electronic device. During the operation of the device, it can only be read and cannot be quickly and easily rewritten like RAM. Therefore, the data stored in ROM is stable and will not change after power is off. Based on these characteristics, the operating system's system data is usually stored in ROM to ensure the stability of the system data.
[0093] The software systems of electronic devices can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture, etc., which will not be elaborated here.
[0094] The following is combined with Figure 5 The software architecture of the electronic device is described. For example, Figure 5 This is a software structure block diagram of an electronic device provided in an embodiment of this application.
[0095] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0096] The application layer can include a series of application packages.
[0097] like Figure 5 As shown, the application package can include applications such as camera, calendar, phone, map, music, settings, email, video, and social media.
[0098] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0099] like Figure 5 As shown, the application framework layer may include a window manager, content provider, resource manager, view system, notification manager, etc.
[0100] The window manager is used to manage windowed applications. It can obtain the screen size, determine if a status bar is present, lock the screen, allow screen touch, drag the screen, and capture the screen, among other things.
[0101] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.
[0102] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0103] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0104] The package manager service (PMS) is used to manage all package information, such as managing application installation, uninstallation, and updates, as well as parsing the configuration file (e.g., android manifest.xml) for each application to obtain the corresponding data information.
[0105] In this embodiment, the package manager can delete applications to be deleted from the data partition after an OTA upgrade. The applications to be deleted are those specified for deletion in the configuration file of the OTA upgrade package.
[0106] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0107] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0108] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0109] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0110] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0111] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0112] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0113] A 2D graphics engine is a graphics engine for 2D drawing.
[0114] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0115] It is understood that the software architecture provided in this application is only an example and does not constitute a limitation on the embodiments of this application.
[0116] The system upgrade method in this application embodiment is described in detail below, based on the above system structure:
[0117] After an OTA upgrade, when the electronic device is powered on, the package manager scans the pre-installed partitions to obtain the configuration files from the OTA upgrade package and the configuration files from the application packages in each pre-installed partition. The package manager then parses the configuration files from the application packages in the pre-installed partitions to obtain the application data information and caches this data information in memory. This data information may include one or more of the following: installation package information, permission information, component information, etc. Installation package information refers to the information about the installation package used when the application was installed; permission information refers to the permissions granted to the application during its use; and component information refers to the information about the components involved in the application's operation. Subsequently, the activity manager can use this data information in memory to launch the corresponding application.
[0118] The electronic device traverses the data partitions, removes application packages containing applications to be deleted, and obtains the application packages within the data partitions. The electronic device parses the application packages in the data partitions, installs the applications from the data partitions, and ensures there are no applications to be deleted in the data partitions. The package manager caches the configuration file data information from each application package in memory.
[0119] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be implemented independently or in combination with each other. The same or similar concepts or processes may not be described again in some embodiments.
[0120] For example, Figure 6 This is a flowchart illustrating a system upgrade method provided in an embodiment of this application. It exemplifies an electronic device where both the pre-installed partition and the data partition store an application package for application A, and an OTA upgrade is used to instruct the deletion of application A.
[0121] like Figure 6 As shown, the method includes:
[0122] S601. Electronic devices are powered on after an OTA upgrade.
[0123] In this embodiment, OTA upgrades can be either ROM upgrades or MR upgrades; no specific limitation is made here. OTA upgrades can be referred to the corresponding descriptions above, and will not be repeated here.
[0124] Understandably, after an electronic device replaces the contents of its pre-installed partition with an OTA update package, it will reboot to use the updated system.
[0125] For example, during a ROM upgrade, the OTA upgrade package includes the entire contents of the pre-installed partition. The electronic device can replace the contents of the pre-installed partition with the downloaded OTA upgrade package to achieve an OTA upgrade. During an MR upgrade, the OTA upgrade package includes the content in the pre-installed partition that needs to be updated (upgraded, modified). The electronic device can generate a replacement file using this OTA upgrade package and use the replacement file to replace the contents of the pre-installed partition. The replacement file includes the entire contents of the pre-installed partition.
[0126] S602: After the electronic device is powered on, the configuration file in the OTA upgrade package is parsed to obtain the applications to be deleted.
[0127] For example, the configuration file may include: the application package names of one or more applications to be deleted.
[0128] The application package name of the application to be deleted can also be replaced with any identifier of the application to be deleted, such as the name of the application to be deleted, etc. There are no specific restrictions here.
[0129] For example, the package manager in an electronic device parses the configuration file to obtain the application package name of the application to be deleted.
[0130] S603, Application of scanning and installing pre-made partitions in electronic equipment.
[0131] Pre-built partitions can be referred to the corresponding descriptions above, and will not be repeated here. In this embodiment, the pre-built partitions may include one or more of the following: system partition, vendor partition, vendor-customized partition, custom partition, preavs partition, preload partition, version partition, product partition, etc. No specific limitations are made here.
[0132] In this embodiment, the electronic device scans and installs applications in a pre-built partition to obtain a list of applications in the pre-built partition. This list includes the application identifiers of the applications in the pre-built partition. For example, taking the application identifier as the application package name, the electronic device scans and installs applications in the pre-built partition to obtain application list A, which stores the application package names of the applications in the pre-built partition.
[0133] For example, an electronic device can scan a pre-built partition and parse the scanned application packages to obtain the package information of the applications in the pre-built partition. The package information includes the application's data. The electronic device can then use this data to display the application's icon, launch the application, and perform other actions.
[0134] S604. The electronic device scans the database for path information corresponding to the pre-built partitions, deletes path information in the database that does not correspond to an application package, and records the deleted applications. The deleted applications are the applications corresponding to the deleted path information.
[0135] Taking the database corresponding to the system partition as an example, this database can be data / system / packages.xml. The database stores package information (package settings) for applications within the system partition.
[0136] In some embodiments, the electronic device scans path information stored in the database. If the application corresponding to the path information is not in application list A, the path information is deleted, and the application is recorded as a deleted application. If the application corresponding to the path information is in application list A, the path information is retained.
[0137] In other embodiments, the electronic device scans the path information stored in the database to obtain an application list B. Application list B includes: application identifiers corresponding to the path information; application list B is compared with application list A, and path information corresponding to applications not on application list A is deleted, with the application recorded as a deleted application.
[0138] The embodiments of this application do not limit the specific process of S604.
[0139] In this embodiment, the database corresponding to the pre-built partition is used to store the path information of the applications in the pre-built partition. This database is stored in the data partition. This database can be read and written by applications in the system partition, but not by applications in the data partition. The electronic device can find the application package of the application in the pre-built partition through the path information corresponding to the application in the pre-built partition, thereby launching the application.
[0140] Understandably, the path information for each application in the database typically includes one path. For example, taking application 1 in the pre-built partition as an example, the path information for application 1 could include the path / system / app / App1 / App1.apk.
[0141] In some scenarios, the path information for each application in the database includes multiple paths. When the path information for an application includes multiple paths, only one path is effective.
[0142] For example, after an electronic device upgrades an application in a pre-installed partition via an app store or webpage, the application corresponding to that partition has two path information entries stored in the database. One path corresponds to the pre-installed partition, and the other corresponds to the data partition. The path for the pre-installed partition is in a disabled state, while the path for the data partition is in an enabled state. A disabled state can be understood as prohibiting its use, and an enabled state can be understood as allowing its use.
[0143] For example, taking application 1 in a pre-built partition, and application 1 having been upgraded through downloading from an app store, webpage, or other means, the path information of application 1 includes two paths: the first path is / system / app / App1 / App1.apk; the second path is / data / app / com.android.app1 / base.apk. The first path may have a corresponding "false" flag to indicate a disabled state; the second path may have a corresponding "true" flag to indicate an active state. This application embodiment does not specifically limit the storage of path information in the database, nor the identification of disabled and active states.
[0144] Understandably, if the OTA upgrade is used to instruct the deletion of application 1, the application package corresponding to the first path is deleted from the pre-installed partition during the OTA upgrade. Adaptably, after the electronic device is powered on following the OTA upgrade, the applications scanned in the pre-installed partition do not include application 1. The electronic device performs an S604 scan of the path information in the database, and the scanned applications include application 1. Comparing the two applications, it is found that the application package corresponding to the first path does not exist; therefore, the path is deleted, and application 1 is recorded as a deleted application.
[0145] In some embodiments, the electronic device can record deleted applications by adding the application package name of the deleted application to a whitelist. The electronic device can also record deleted applications by adding identifiers or other methods. No specific limitations are made here.
[0146] In this way, electronic devices can use the database corresponding to the pre-built partition to identify applications deleted during OTA upgrades (applications that have already been deleted). By verifying the applications deleted during OTA upgrades, the system can further confirm the applications to be deleted in the configuration file, reducing the likelihood of the first application installed after an OTA upgrade being deleted, and reducing the chance of subsequent duplicate deletions of applications to be deleted. This can reduce the possibility of accidental deletion during subsequent OTA upgrades by users, improving the user experience.
[0147] S605, Application of scanning and installing data partitions in electronic devices.
[0148] In some embodiments, the electronic device scans the applications in the installed data partition to obtain an application list C, which stores the application identifiers of the applications in the data partition.
[0149] Data partitioning can be referred to the corresponding descriptions above. In this embodiment, data partitioning may include: a data partition.
[0150] For example, an electronic device can scan a data partition and parse the scanned application packages to obtain application data information. The electronic device can then use this application data information to display the application icon, launch the application, and perform other actions.
[0151] S606. If an electronic device is using an application that is to be deleted and has already been deleted, the application package of that application in the data partition shall be deleted. This allows for verification of the application to be deleted using the deleted application, reducing the need for duplicate deletions of the application to be deleted.
[0152] Electronic devices can also delete the application's data from the data partition. The details of this data can be found in the explanations above and will not be repeated here. This reduces the memory usage of the electronic device.
[0153] For example, a package manager in an electronic device removes the application package of the application to be deleted from the data partition.
[0154] For example, such as Figure 7 As shown, S606 may include: S6061-S6064.
[0155] See Figure 7 S6061, The electronic device obtains the application to be deleted based on the application to be deleted and the deleted application.
[0156] Understandably, electronic devices can find the application to be deleted by taking the intersection of the application to be deleted in the configuration file and the application to be deleted recorded by the electronic device.
[0157] For example, an electronic device can obtain the application package name of the application to be deleted based on the application package name of the application to be deleted and the application package names of the deleted applications. Subsequently, the application package can be queried and deleted based on the application package name of the application to be deleted.
[0158] The application to be deleted is an application that has already been deleted. For example, if the application package name of the application to be deleted is the same as the application package name of a deleted application, then the application is the one to be deleted.
[0159] In some embodiments, the electronic device can determine whether a deleted application is an application to be deleted by taking the intersection of the application to be deleted in the configuration file and the recorded application to be deleted.
[0160] Execute S6062 and / or S6063 for any application that needs to be deleted.
[0161] S6062. Is the application package of the application to be deleted located in the data partition?
[0162] Check if the application package path of the application to be deleted is within the data partition. For example, check if the application package path of the application to be deleted is under the data / app path.
[0163] In one possible implementation, the electronic device can query path information from the database using the application package name of the application to be deleted. If the path information for the application indicates a data partition, the application package of the application to be deleted is located in the data partition. If the path information for the application does not indicate a data partition, the application package of the application to be deleted is not located in the data partition. In this way, the electronic device in S6062 can further verify the application to be deleted, reducing the possibility of incorrect path information matching in the database and reducing accidental deletion.
[0164] It should be noted that some application packages in the pre-built partition may be configured not to be installed. Therefore, when the electronic device executes S602, it will not scan for and install these applications, and the applications may be recorded as deleted. For example, the pre-built partition may contain a custom scheme file (e.g., uninstall-apk, xml) where applications are configured not to be installed. In this way, the electronic device in S6062 can further verify applications that need to be deleted, reducing the possibility of incorrect path information matching in the database and minimizing accidental deletion.
[0165] For example, pre-built partitions may contain some shared application packages. Taking application package A shared by the ODM partition and the system partition as an example, after the application corresponding to application package A is upgraded, the data partition contains application package B corresponding to that application. The system partition may be configured not to install application package A, while the ODM partition may be configured to install application package A. The path information of the application package corresponding to that application may not be completely present in the data partition. In this way, the electronic device in S6062 can further verify the application to be deleted, reducing the possibility of incorrect path information matching in the database and reducing accidental deletion.
[0166] In one possible implementation, the electronic device queries the data partition based on the application package name of the application to be deleted. If the application package of the application to be deleted is found, the data partition stores the application package of the application to be deleted; if the application package of the application to be deleted is not found, the data partition does not store the application package of the application to be deleted.
[0167] If the application package of the application to be deleted is stored in the data partition, the electronic device executes S6063. If the application package of the application to be deleted is not stored in the data partition, the electronic device may not perform any processing.
[0168] In this way, electronic devices can further verify applications that need to be deleted, reducing the chance of incorrect path information matching in the database and minimizing accidental deletion.
[0169] S6063. Does the application package of the application to be deleted exist in the pre-built partition?
[0170] Is the path to the application package of the application to be deleted within the pre-built partition?
[0171] In one possible implementation, the electronic device can query the database based on the application package name of the application to be deleted. If the path information of the application to be deleted does not indicate a pre-built partition, the pre-built partition does not store the application package of the application to be deleted; if the path information of the application to be deleted indicates a pre-built partition, the pre-built partition stores the application package of the application to be deleted.
[0172] This reduces the chances of application packages in the pre-installed partition not being scanned, thus reducing the accidental deletion of pre-installed uninstallable applications during reinstallation.
[0173] In some embodiments, application packages in certain pre-built partitions are equipped with filter flags, preventing the electronic device from scanning and installing the application during S602. Since the database contains the path information corresponding to the application, the electronic device records the application as a deleted application in S603.
[0174] For example, after an electronic device uninstalls a pre-installed uninstallable application, it adds a filter identifier to the application's package, preventing the device from scanning the package during startup. Furthermore, the device stores the application's package path information in a recovery file. The application can then be recovered using this recovery file. Adaptably, the device can query the recovery file based on the application's package name. If the recovery file does not contain the application's path information, the pre-installed partition does not store the application's package; if the recovery file contains the application's path information, the pre-installed partition stores the application's package.
[0175] It should be noted that the applications in the pre-installed partition can be divided into two types: one is pre-installed and uninstallable (e.g., video applications, "WeChat application", etc.), and the other is pre-installed and non-uninstallable (e.g., settings application, calendar application, or phone application, etc.).
[0176] This reduces the chances of application packages in the pre-installed partition not being scanned, thus reducing the accidental deletion of pre-installed uninstallable applications during reinstallation.
[0177] In one possible implementation, the electronic device can query the prefab partition based on the application package name of the application to be deleted. If the application package of the application to be deleted is found, the prefab partition stores the application package of the application to be deleted; if the application package of the application to be deleted is not found, the prefab partition does not store the application package of the application to be deleted.
[0178] If the application package for the application to be deleted is not present in the pre-built partition, the electronic device executes S6064. If the application package for the application to be deleted is not stored in the pre-built partition, the electronic device may not perform any processing.
[0179] It is understandable that some applications in the pre-built partition may have filter flags set, preventing their application packages from being scanned and installed by electronic devices. Consequently, when executing S604 above, the application package of that application is not found, and the application with the filter flag is recorded as a deleted application. For example, the application with the filter flag can be a pre-built uninstallable application that has been uninstalled.
[0180] In this way, electronic devices can further verify applications that need to be deleted, reducing the chances that application packages in the pre-built partitions are not scanned and reducing accidental deletion.
[0181] In some embodiments, the electronic device may not execute S604. Adaptively, in S606, the electronic device deletes the application package of the application to be deleted from the data partition.
[0182] S6064. The electronic device deletes the application package of the application to be deleted, as well as the data information of the application to be deleted.
[0183] The data information may include: application installation package information, application permission information, application component information, etc. No specific limitations are specified here.
[0184] In summary, when deleting an application via OTA (Over-The-Air) upgrade, the application package for that application can be deleted from both the pre-installed partition and the data partition. This way, after the OTA upgrade, the application package will not be present in either the pre-installed or data partitions of the electronic device, and the application will not be displayed.
[0185] For example, taking system partitions and data partitions as examples, Figure 8 This is a schematic diagram illustrating the storage of applications before and after an OTA upgrade, provided as an embodiment of this application. After the electronic device updates applications 1 and 2 via methods such as downloading from an app store or a webpage, the storage partitions of the electronic device can be configured as follows: Figure 8 As shown in section a, system partition 1a of the electronic device includes: application packages for application 1, application packages for application 2, application packages for application 3, and application packages for application 4; data partition 2a includes: application packages for application 1, application packages for application 2, application packages for application 5, and application packages for application 6.
[0186] In this embodiment, after applications 1 and 2 are updated, the electronic device deletes applications 1 and 2 via OTA upgrade. The storage partitions of the electronic device can be as follows: Figure 8As shown in b. The system partition 1b of the electronic device includes application packages for Application 3 and Application 4; the data partition 2b includes application packages for Application 1, Application 2, Application 5, and Application 6. After this OTA upgrade, the electronic device can display the icons for Application 1 and Application 2.
[0187] For example, Figure 9 This is a schematic diagram of a system upgrade process provided in an embodiment of this application. Figure 9 As shown, the method includes:
[0188] S901, based on the first OTA upgrade, install the first application.
[0189] In this embodiment of the application, the first OTA upgrade is used to instruct the installation of the first application.
[0190] For example, the first OTA upgrade package may include: the application package of the first application. After the electronic device replaces the content in the pre-installed partition with the first OTA upgrade package, the pre-installed partition includes the application package of the first application. The process of the electronic device replacing the content in the pre-installed partition with the first OTA upgrade package can be referred to the corresponding description above, and will not be repeated here.
[0191] The first application is the application in the first OTA upgrade package. The first application can be any type of application, such as a camera application, a video application, etc., without specific limitations.
[0192] S902, Display the desktop, which includes the icon of the first application.
[0193] The icon of the first application can be any form of icon. For example, the icon of the first application can be an image, text, or a combination of both. This application embodiment does not impose specific limitations on the composition, shape, etc., of the icon of the first application.
[0194] For example, Figure 10 This is a desktop illustration of an electronic device before and after a first OTA upgrade, provided as an embodiment of this application.
[0195] Before the first OTA upgrade, the desktop of electronic devices could be like... Figure 10 As shown in 'a', the desktop includes: the current time, battery level, icon of application A, icon of application B, but does not include the icon of the first application.
[0196] After the first OTA upgrade, the desktop of the electronic device can be like... Figure 10 As shown in b, the desktop includes: current time, battery level, icon of application A, icon of application B, and icon of the first application.
[0197] S903, In response to the operation of upgrading the first application, upgrade the first application.
[0198] Upgrading the first application can be understood as updating the first application, or changing the version of the first application, etc.
[0199] The operation to upgrade the first application can be either the user downloading and installing the first application from the "App Store", or the user downloading and installing the first application from a browser, webpage, etc., or the user clicking the "Update" control in the first application. There are no specific limitations here.
[0200] After the first application is upgraded, the icon of the first application displayed on the desktop may or may not change; this is not a limitation. For example, if the icon of the first application changes after the upgrade, the icon of the first application may change from... Figure 10 Replace the square shown as b in the image with... Figure 10 The circle shown as c in the diagram. No specific limitations are specified here.
[0201] In some embodiments, upgrading the first application refers to storing the application package of the first application in the data partition. The application package of the first application in the data partition may be the same as or different from the application package of the first application stored in the prefab partition; no specific limitation is made here. The prefab partition and the data partition can be referred to the corresponding descriptions above, and will not be repeated here.
[0202] S904, based on the second OTA upgrade after upgrading the first application, the first application is not displayed on the desktop.
[0203] In this embodiment, the second OTA upgrade is used to instruct the deletion of the first application. For example, the first application may be uninstalled via OTA upgrade due to reasons such as the expiration of its usage period or the replacement with an application of the same type as the first application. No specific limitations are imposed here.
[0204] For example, the second OTA upgrade package may include a configuration file that instructs the removal of the first application. After the electronic device replaces the contents of the pre-installed partition with the second OTA upgrade package, the pre-installed partition no longer includes the application package of the first application. The electronic device also removes the application package of the first application from the data partition.
[0205] In this way, the electronic device will not display the first application after the second OTA upgrade.
[0206] For example, taking system partitions and data partitions as examples, Figure 11 This is a schematic diagram of storage partitions before and after an OTA upgrade, provided as an embodiment of this application. Figure 11As shown in Figure 'a', the system partition 1a of the electronic device includes: application packages for application 1, application packages for application 2, application packages for application 3, and application packages for application 4; the data partition 2a includes: application packages for application 5 and application packages for application 6.
[0207] After the electronic device updates Application 1 and Application 2 through methods such as downloading from the "App Store" or downloading from a webpage, the electronic device's storage partition can be updated as follows: Figure 11 As shown in b. System partition 1b of the electronic device includes: application packages for application 1, application packages for application 2, application packages for application 3, and application packages for application 4; data partition 2b includes: application packages for application 1, application packages for application 2, application packages for application 5, and application packages for application 6.
[0208] In this embodiment, after applications 1 and 2 are updated, the electronic device deletes applications 1 and 2 via OTA upgrade. The storage partitions of the electronic device can be as follows: Figure 11 As shown in 'c', the system partition 1c of the electronic device includes application packages for application 3 and application 4; the data partition 2c includes application packages for application 1, application 2, application 5, and application 6. After this OTA upgrade, the electronic device can display the icons for application 1 and application 2.
[0209] In one possible implementation, the upgrade package of the second OTA upgrade includes: a configuration file, which includes: an application identifier to be deleted, which includes: a first application identifier of the first application; based on the second OTA upgrade after upgrading the first application, the first application is not displayed on the desktop, which includes: deleting the first application package of the application to be deleted based on the upgrade package of the second OTA upgrade, the first application package being located in a first partition, which is not readable or writable; deleting the second application package of the application to be deleted based on the first application identifier, the second application package being located in a second partition, which is readable or writable; and the first application is not displayed on the desktop.
[0210] The application identifier to be deleted can be the package name, the application name, or any application identifier; there are no specific restrictions here. The first partition can correspond to the pre-built partition mentioned above, and the second partition can correspond to the data partition mentioned above. The application package can be an APK file. The first application can be any application; there are no specific restrictions here.
[0211] In this way, the electronic device can delete the application package in the second partition, so that the electronic device does not include the application package of the first application, and does not include the first application.
[0212] In one possible implementation, the second partition further includes a database, which stores path information of applications in the first partition; the second application package of the application to be deleted is deleted based on the first application identifier, including: after the second OTA upgrade, the device is powered on, the configuration file is parsed to obtain the application identifier to be deleted; the first path information in the database is deleted, and the first identifier corresponding to the first path information is recorded; the first path information is path information in the database that does not correspond to an application package; if the first identifier includes the first application identifier, the second application package is deleted.
[0213] The first identifier can be any identifier such as the application package name or the name of the application corresponding to the first path information, without any specific limitation here.
[0214] Electronic devices can identify the applications to be deleted during OTA upgrades (applications to be deleted) based on path information in the database and remove the first path information. This reduces the likelihood of the first application being deleted upon restarting after a second OTA upgrade, thus improving user experience and reducing the chance of accidental deletion during subsequent OTA upgrades.
[0215] In some embodiments, the first identifier can be the application package name of the application corresponding to the first path information. This facilitates subsequent retrieval of the application package.
[0216] It is understandable that the application packages stored in the first and second partitions typically carry the application package name. For example, the application package name can consist of: application package name, update count, and version. Alternatively, the application package name can consist of: a random value, application package name, update count, and version; no specific limitations are imposed here.
[0217] In one possible implementation, if the first identifier includes a first application identifier, deleting the second application package includes: if the first identifier includes a first application identifier, querying whether the path of the application package corresponding to the first application is in the second partition; if the application package corresponding to the first application is in the second partition, deleting the second application package.
[0218] In this embodiment, the existence of the application package corresponding to the first application in the second partition can be queried by application package name; alternatively, the path corresponding to the application package of the first application can be queried to see if it is within the second partition. For example, taking the second partition as a data partition, the query can be made to see if the path corresponding to the application package of the first application is data / app.
[0219] This allows for a reconfirmation of the application's package location, reducing the risk of accidental deletion due to incorrect package name matching or customized configurations.
[0220] In one possible implementation, deleting the second application package when the first identifier includes the first application identifier includes: querying the first partition to see if the application package of the first application exists; and deleting the second application package when the first partition does not include the application package of the first application.
[0221] In this embodiment, the application package name can be used to query whether the application package corresponding to the first application exists in the first partition; alternatively, the path corresponding to the application package of the first application can be queried to see if it is within the first partition.
[0222] This further verifies that the application package of the first application in the first partition has been deleted, reducing the possibility of accidental deletion due to the application package of the first application in the first partition not being scanned during boot.
[0223] In one possible implementation, the method further includes: deleting the data information of the first application when the second application package is deleted, the data information including one or more of the following: installation package information, permission information, or component information.
[0224] This removes all information from the first application, reducing the amount of memory used by the electronic device.
[0225] In one possible implementation, the first partition includes one or more of the following: system partition, vendor partition, odm partition, cust partition, preavs partition, preload partition, version partition, and product partition; the second partition includes: a data partition.
[0226] It should be noted that the module names involved in the embodiments of this application can all be defined as other names, as long as they can achieve the function of each module, and no specific restrictions are placed on the module names.
[0227] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0228] The system upgrade method of the embodiments of this application has been described above. The apparatus for performing the above method provided in the embodiments of this application is described below. Those skilled in the art will understand that the methods and apparatus can be combined with and referenced by each other, and the related apparatus provided in the embodiments of this application can perform the steps in the above method.
[0229] The system upgrade method provided in this application can be applied to electronic devices with OTA upgrade functionality. Electronic devices include terminal devices; the specific device form of the terminal device can be referred to the above-described related information, and will not be repeated here.
[0230] This application provides a terminal device, which includes a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the terminal device to perform the above-described method.
[0231] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.
[0232] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.
[0233] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0234] This application provides a computer program product, which includes a computer program that, when run, causes the computer to perform the above-described method.
[0235] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. 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 processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing 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.
[0236] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A system upgrade method, characterized in that, include: Based on the first OTA upgrade, the first application package of the first application is installed in the first partition, which is not readable or writable; Display a desktop, which includes the icon of the first application; In response to an operation to upgrade the first application, a second application package of the first application is installed in a second partition, which is readable and writable; the second partition also includes a database for storing path information of the applications in the first partition; Based on the upgrade package of the second OTA upgrade, the first application package of the first application is deleted; wherein, the upgrade package of the second OTA upgrade includes: a configuration file, the configuration file including: the first application identifier of the first application; After the second OTA upgrade is completed and the device is powered on, the configuration file is parsed to obtain the first application identifier of the first application; Delete the first path information in the database and record the first identifier corresponding to the first path information; the first path information is the path information in the database that does not correspond to an application package in the first partition; If the first identifier includes the first application identifier, delete the second application package of the first application; The first application is not displayed on the desktop; Wherein, deleting the second application package of the first application when the first identifier includes the first application identifier includes: If the first identifier includes the first application identifier, query whether the path of the application package corresponding to the first application is in the second partition; If the application package corresponding to the first application is located in the second partition, delete the second application package.
2. The method according to claim 1, characterized in that, The step of deleting the second application package of the first application when the first identifier includes the first application identifier includes: If the first identifier includes the first application identifier, query whether the application package of the first application exists in the first partition; If the first partition does not contain the application package of the first application, delete the second application package.
3. The method according to claim 2, characterized in that, The method further includes: In the case of deleting the second application package, the data information of the first application is deleted, and the data information includes one or more of the following: installation package information, permission information, or component information.
4. The method according to claim 2 or 3, characterized in that, The first partition includes one or more of the following: system partition, chip vendor partition, manufacturer-customized ODM partition, customized cust partition, preavs partition, preload partition, version partition, and product partition; The second partition includes: a data partition.
5. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the electronic device to perform the method as described in any one of claims 1-4.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-4.
7. A chip system, characterized in that, It includes at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a line, the at least one processor being configured to run a computer program or instructions to perform the method as described in any one of claims 1-4.
8. A computer program product, characterized in that, Includes a computer program that, when run, causes a computer to perform the method as described in any one of claims 1-4.