Operating system upgrade method and electronic device

By writing and installing pre-installed applications in the user data partition, the problem that applications cannot be enabled after the new version of the operating system is upgraded, and the human-computer interaction efficiency of electronic devices is improved.

CN118484211BActive Publication Date: 2025-02-14HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311627154.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2025-02-14
Estimated Expiration
2043-11-29

AI Technical Summary

Technical Problem

In the prior art, the upgrade data packets of the new version of the operating system cannot carry the applications that need to be pre-installed, resulting in the original applications that cannot be enabled after the electronic device is upgraded, and the user needs to download them again, affecting the efficiency of human-computer interaction.

Method used

Before upgrading to a new version of the operating system, write the program files of the preinstalled application to the user data partition. After the upgrade, the preinstalled application will be installed and its installation path will be adjusted to point to the user data partition.

Benefits of technology

It realizes the preservation of the original application after the operating system version is upgraded, avoiding manual downloads by users, and improving the human-computer interaction efficiency of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118484211B_ABST
    Figure CN118484211B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide an operating system upgrade method and an electronic device, which relate to the field of computer technology. The problem of pre-installed application programs being lost after the operating system is upgraded is solved. The specific scheme is: before the electronic device is upgraded to the first version of the operating system, the electronic device writes one or more program files of the target application in the user data partition; the electronic device obtains a first upgrade package, the first upgrade package is used to upgrade the operating system of the electronic device to the first version of the operating system, and the first upgrade package does not contain the program files of the target application; the electronic device responds to the first upgrade package and upgrades the operating system to the first version of the operating system; after the operating system is upgraded to the first version of the operating system, one or more target applications are pre-installed; wherein, before and after the upgrade to the first version of the operating system, the installation path of one or more target applications is changed from a path pointing to the system partition to a path pointing to the user data partition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an operating system upgrade method and electronic equipment. Background Art

[0002] Electronic devices usually pre-install some applications. The program files of the pre-installed applications are usually included in the upgrade data package of the operating system, so that when the upgrade data package of the operating system is installed, the applications that need to be pre-installed can be automatically installed, which is convenient for users.

[0003] Currently, the upgrade data package of the new version of the operating system cannot carry applications that need to be pre-installed (such as so-called pre-installed applications). After the electronic device is upgraded to the new version of the operating system, the applications that were originally pre-installed in the electronic device cannot be directly activated, and the user must re-download the above applications, which affects the human-computer interaction efficiency of the electronic device. Summary of the invention

[0004] In view of this, the present application provides an operating system upgrade method and an electronic device. Before upgrading to a new version of the operating system, program files of pre-installed applications are stored in a user data partition. After upgrading to the new version of the operating system, the pre-installed applications are installed in the user data partition to improve the human-computer interaction efficiency of the electronic device.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides an operating system upgrade method, which is applied to an electronic device, wherein one or more target applications are pre-installed in the electronic device, and the installation path of the one or more target applications points to the system partition of the electronic device. The method comprises: before the electronic device is upgraded to a first version of the operating system, the electronic device writes the program files of the one or more target applications in a user data partition; the electronic device obtains a first upgrade package, the first upgrade package is used to upgrade the operating system of the electronic device to the first version of the operating system, and the first upgrade package does not contain the program files of the target applications; the electronic device upgrades the operating system to the first version of the operating system in response to the first upgrade package; after the operating system is upgraded to the first version of the operating system, the one or more target applications are pre-installed; wherein, before and after the upgrade to the first version of the operating system, the installation path of the one or more target applications is changed from a path pointing to the system partition to a path pointing to the user data partition.

[0007] The pre-installed target application may be an application program automatically installed by the electronic device.

[0008] In the above embodiment, for an electronic device that has pre-installed applications, if the upgrade data package (first upgrade package) used to upgrade the operating system to the first version does not contain any pre-installed applications, the program files of the pre-installed target applications are written into the user data partition before upgrading to the first version of the operating system. During the actual upgrade of the operating system to the first version, the installation path of the target application is changed from the path pointing to the system partition to the path pointing to the user data partition, so as to retain the target application and avoid the user manually downloading the target application after the version upgrade, thereby improving the human-computer interaction efficiency of the device.

[0009] In other possible embodiments, the target application may be all applications that have been preinstalled. In other embodiments, the target application may also be an application that has been preinstalled and has not been deleted. In other embodiments, the target application may also be an application that has been preinstalled and used by the user.

[0010] In some embodiments, before the electronic device obtains the first upgrade package, the method also includes: the electronic device obtains a second upgrade package, the second upgrade package is used to upgrade the operating system of the electronic device to a second version of the operating system, the second upgrade package includes a transit packet, the transit packet includes program files of the one or more target applications, the second version is different from the first version; in response to the second upgrade package, the electronic device upgrades the operating system to the second version of the operating system; the electronic device writes the program files of the one or more target applications in the user data partition, including: in the process of upgrading the operating system to the second version of the operating system, writing the program files of the one or more target applications carried in the transit packet into the user data partition.

[0011] In the above embodiment, during the process of upgrading the operating system to the intermediate version (second version), the program file of the target application is written into the user data partition so that the installation path of the target application can be changed to a path pointing to the user data partition.

[0012] In some embodiments, writing the program files of the one or more target applications in the transit packet into the user data partition includes: writing the transit packet into the user data partition; parsing out the program files of the one or more target applications in the transit packet and writing them into the user data partition.

[0013] In some embodiments, before the electronic device upgrades the operating system to the second version of the operating system, the method also includes: the electronic device determines that the second upgrade package passes the signature verification process and the authentication process; writes the transit packet into the user data partition, including: storing the transit packet in a first path pointing to the user data partition, the path name of the first path contains specified characters, and the specified characters indicate that the data stored in the first path is exempt from authentication processing; parsing the program files of the one or more target applications in the transit packet and writing them into the user data partition, including: storing the program files of the one or more target applications parsed from the transit packet in the second path pointing to the user data partition.

[0014] In the above embodiment, the problem that data from the same data packet can only be authenticated once is solved, thereby avoiding upgrade anomalies.

[0015] In some embodiments, after the program files of the one or more target applications parsed from the transit packet are stored in the second path pointing to the user data partition, the method further includes: writing target tag information in the basic partition of the electronic device, indicating that the program files of the target application have been written to the user data partition and the data is complete; after the operating system is upgraded to the first version of the operating system and before pre-installing the one or more target applications, the method further includes: the electronic device determining that the basic partition contains the target tag information.

[0016] In the above embodiment, the target mark information is checked, which can indicate that the program file of the target application has been stored in the user data partition. By checking the target mark information, the reliability of subsequent installation of the target application from the user data partition is improved.

[0017] In other embodiments, if the electronic device determines that the basic partition does not contain the target application, before installing the target application, it can also re-download the program file corresponding to the target application from the cloud server that provides the upgrade package.

[0018] In some embodiments, the second upgrade package also includes preinstalled data, and the preinstalled data also includes program files of the one or more target applications. In the process of upgrading the operating system to the second version of the operating system, the method also includes: the electronic device writes the preinstalled data to the system partition of the electronic device; after upgrading the operating system to the second version of the operating system, the method also includes: the electronic device performs a first restart; during the first restart, the electronic device installs the one or more target applications in response to the preinstalled data of the system partition; wherein, when the operating system of the electronic device is the second version of the operating system, the installation path of the preinstalled one or more target applications points to the system partition.

[0019] In the above embodiment, during the period when the operating system is upgraded to the transition version, the electronic device will also retain the pre-installed target application to avoid the user being unable to normally use the pre-installed target application during the temporary upgrade to the transition version.

[0020] In some embodiments, after the operating system is upgraded to the first version of the operating system, the system partition does not contain the preinstalled data.

[0021] In some embodiments, after the operating system is upgraded to the first version of the operating system and before the preinstallation of the one or more target applications, the method further includes: the electronic device performing a second restart; during the second restart process, mounting the program files of the one or more target applications in the user data partition to the system partition.

[0022] In some embodiments, mounting the program files of the one or more target applications in the user data partition to the system partition includes: moving the program files of the one or more target applications from a second path to a third path, the second path and the third path are paths pointing to different storage areas in the user data partition, and there is an association between the third path and the system partition; writing a first image file into the system partition, the first image file including image files corresponding to the program files of the one or more target applications; preinstalling the one or more target applications after the operating system is upgraded to the first version of the operating system includes: accessing the third path in response to scanning the first image file during the process of the electronic device scanning the system partition; and installing the corresponding target application in response to the program file found under the third path.

[0023] In the above embodiment, the electronic device can automatically install the target application from the user data partition when it is upgraded and restarted, thereby improving the human-computer interaction efficiency of the electronic device.

[0024] In some embodiments, after the electronic device writes the program files of the one or more target applications in the user data partition, the method further includes: the electronic device writes a status file in the user data partition, indicating that the program files of the one or more target applications have been completely written to the user data partition; before moving the program files of the one or more target applications from the second path to the third path, the method further includes: the electronic device determines that the user data partition contains the status file.

[0025] In the above embodiment, whether the program file of the target application in the user data partition is complete can be determined by whether the status file exists. Only when the program file is complete, the target application is pre-installed in the user data partition to avoid abnormalities during the installation of the target application in the user data partition.

[0026] In some embodiments, before mounting the program files of one or more target applications in the user data partition to the system partition, the method also includes: the electronic device determining that the current version number of the operating system is the first version; the electronic device determining that the first version is a specified version or determining that the release time of the first version is later than the specified version.

[0027] In some embodiments, before the electronic device writes the program files of the one or more target applications in the user data partition, the method also includes: displaying a first prompt window, the first prompt window including a first control and corresponding prompt information, the prompt information corresponding to the first control indicating that the operating system is upgraded to a first version of the operating system and that the pre-installed applications are retained; and detecting that a user clicks on the first control.

[0028] In the above embodiment, the target application can be retained when upgrading to the first version of the operating system according to the user's instruction.

[0029] In a second aspect, an embodiment of the present application provides an electronic device, in which one or more target applications are pre-installed, and the installation path of the one or more target applications points to the system partition of the electronic device. The electronic device includes one or more processors and a memory, and the memory is used to store computer instructions. When the one or more processors execute the computer instructions, the one or more processors are used to:

[0030] Before upgrading to a first version of an operating system, writing program files of the one or more target applications in a user data partition; obtaining a first upgrade package, the first upgrade package being used to upgrade the operating system of the electronic device to the first version of an operating system, the first upgrade package not containing program files of the target applications; upgrading the operating system to the first version of an operating system in response to the first upgrade package; after the operating system is upgraded to the first version of an operating system, preinstalling the one or more target applications; wherein, before and after upgrading to the first version of an operating system, the installation path of the one or more target applications is changed from a path pointing to the system partition to a path pointing to the user data partition.

[0031] In some embodiments, before the electronic device obtains the first upgrade package, the one or more processors are used to: obtain a second upgrade package, the second upgrade package is used to upgrade the operating system of the electronic device to a second version of the operating system, the second upgrade package includes a transit packet, the transit packet includes program files of the one or more target applications, the second version is different from the first version; in response to the second upgrade package, upgrade the operating system to the second version of the operating system; in the process of upgrading the operating system to the second version of the operating system, write the program files of the one or more target applications carried in the transit packet to the user data partition.

[0032] In some embodiments, the one or more processors are used to: write the transit packet into the user data partition; parse out the program files of the one or more target applications in the transit packet, and write them into the user data partition.

[0033] In some embodiments, before the electronic device upgrades the operating system to the second version of the operating system, the one or more processors are used to: determine that the second upgrade package passes the signature verification and authentication processing; store the transit packet in a first path pointing to the user data partition, wherein the path name of the first path contains specified characters, and the specified characters indicate that the data stored in the first path is exempt from authentication processing; and store the program files of the one or more target applications parsed from the transit packet in the second path pointing to the user data partition.

[0034] In some embodiments, after the program files of the one or more target applications parsed from the transit packet are stored in the second path pointing to the user data partition, the one or more processors are used to: write target tag information in the basic partition of the electronic device, indicating that the program files of the target application have been written to the user data partition and the data is complete; after the operating system is upgraded to the first version of the operating system and before the one or more target applications are preinstalled, the one or more processors are used to: determine that the basic partition contains the target tag information.

[0035] In some embodiments, the second upgrade package also includes preinstalled data, and the preinstalled data also includes program files of the one or more target applications. In the process of upgrading the operating system to the second version of the operating system, the one or more processors are used to: write the preinstalled data into the system partition of the electronic device;

[0036] After upgrading the operating system to the second version of the operating system, the one or more processors are used to: perform a first restart; during the first restart, install the one or more target applications in response to the preinstalled data of the system partition; wherein, when the operating system of the electronic device is the second version of the operating system, the installation path of the preinstalled one or more target applications points to the system partition.

[0037] In some embodiments, after the operating system is upgraded to the first version of the operating system, the system partition does not contain the preinstalled data.

[0038] In some embodiments, after the operating system is upgraded to the first version of the operating system and before the preinstallation of the one or more target applications, the one or more processors are used to: perform a second restart; and during the second restart, mount the program files of the one or more target applications in the user data partition to the system partition.

[0039] In some embodiments, the one or more processors are used to: move the program files of the one or more target applications from a second path to a third path, where the second path and the third path are paths pointing to different storage areas in the user data partition, and there is an association between the third path and the system partition; write a first image file into the system partition, where the first image file includes an image file corresponding to the program files of the one or more target applications; during the process of the electronic device scanning the system partition, in response to scanning the first image file, access the third path; and in response to the program file found under the third path, install the corresponding target application.

[0040] In some embodiments, after the electronic device writes the program files of the one or more target applications in the user data partition, the one or more processors are used to: write a status file in the user data partition to indicate that the program files of the one or more target applications have been completely written to the user data partition; before moving the program files of the one or more target applications from the second path to the third path, the one or more processors are used to: determine that the user data partition contains the status file.

[0041] In some embodiments, before mounting the program files of the one or more target applications in the user data partition to the system partition, the one or more processors are used to: determine that the current version number of the operating system is the first version; determine that the first version is a specified version or determine that the release time of the first version is later than the specified version.

[0042] In some embodiments, before the electronic device writes the program files of the one or more target applications in the user data partition, the one or more processors are used to: display a first prompt window, the first prompt window including a first control and corresponding prompt information, the prompt information corresponding to the first control indicates that the operating system is upgraded to a first version of the operating system and that the pre-installed applications are retained; and detect that a user clicks on the first control.

[0043] In a third aspect, an embodiment of the present application provides a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method in the above-mentioned first aspect and possible embodiments thereof.

[0044] In a fourth aspect, the present application provides a computer program product. When the computer program product is run on the above-mentioned electronic device, the electronic device executes the method in the above-mentioned first aspect and possible embodiments thereof.

[0045] In a fifth aspect, the present application provides a chip system, which is applied to an electronic device and stores a computer program. When the computer program is executed, the electronic device executes the method in the above-mentioned first aspect and its possible embodiments.

[0046] It can be understood that the electronic devices, computer storage media and computer program products provided in the above-mentioned aspects are all applied to the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1This is an example diagram of changes in the data storage structure of the operating system when the upgrade data package 1 is installed in some embodiments;

[0048] Figure 2 An example diagram of changes in the data storage structure of the operating system when the upgrade data package 2 is installed in some embodiments;

[0049] Figure 3 An example diagram of changes in the data storage structure of the operating system when installing the upgrade data package 3 provided in the embodiment of the present application;

[0050] Figure 4 An example diagram of changes in the data storage structure of the operating system when the upgrade data package 2 is installed after the upgrade data package 3 is installed according to an embodiment of the present application;

[0051] Figure 5 for Figure 4 An example diagram of changes in the data storage structure of the operating system after installation and restart in the scenario shown;

[0052] Figure 6 This is one of the example diagrams of the operating system upgrade scenario provided in the embodiment of the present application;

[0053] Figure 7 The second example diagram of the operating system upgrade scenario provided in the embodiment of the present application;

[0054] Figure 8 One of the step flow charts of the operating system upgrade method provided in the embodiment of the present application;

[0055] Fig. 9 The second step flow chart of the operating system upgrade method provided in the embodiment of the present application;

[0056] Fig.10 The third step flow chart of the operating system upgrade method provided in the embodiment of the present application;

[0057] Fig.11 The fourth step flow chart of the operating system upgrade method provided in the embodiment of the present application;

[0058] Fig.12 This is a diagram showing an example structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0060] The implementation of this embodiment will be described in detail below with reference to the accompanying drawings.

[0061] The embodiment of the present application provides a device upgrade method, which can be applied to electronic devices. It can be understood that the electronic device needs to be installed with an operating system before it can be used by the user.

[0062] Exemplarily, the electronic devices include but are not limited to smartphones, smart headphones, tablet computers, smart refrigerators, smart speakers, etc., which can be installed with operating systems. Exemplary embodiments of operating systems include but are not limited to operating systems that have been published in related technologies.

[0063] The data storage structure of the operating system in an electronic device is as follows Figure 1 As shown, the data storage structure of the operating system includes a Common partition, a system partition and a user data partition (Userdata).

[0064] The Common partition is a basic partition that stores system data that is not involved in the operating system upgrade. In some embodiments, the Common partition may include at least one sub-partition, such as an oeminfo sub-partition. The data stored in the oeminfo sub-partition is not easily lost.

[0065] The user data partition (Userdata) is used to store the user's personal data, such as APPs installed by the user, pictures, documents, videos and other personal data saved by the user.

[0066] The system partition is used to store the system data of the operating system. Exemplarily, the system partition is further divided into a static partition and a dynamic partition (Super).

[0067] Figure 1 The system partition shown in includes a static partition. After the electronic device is started, the basic partition (Common), the static partition and the dynamic partition (Super) can be loaded in sequence to realize operation based on the operating system.

[0068] In other embodiments, the static partition may also include a static partition (A) and a static partition (B). The static partition (A) and the static partition (B) back up each other, that is, the structures of the static partition (A) and the static partition (B) correspond to each other. In the case of two static partitions, two operating systems can be virtualized in the electronic device, such as operating system A and operating system B. When the electronic device is started, it needs to run based on any one of the operating systems. Exemplarily, when the electronic device needs to run based on operating system A, the electronic device starts from static partition (A): loads the basic partition (Common), static partition (A) and dynamic partition (Super) in sequence; and exemplarily, when the electronic device needs to run based on operating system B, the electronic device starts from static partition (B): loads the basic partition (Common), static partition (B) and dynamic partition (Super) in sequence.

[0069] Take the Universal Flash Storage (UFS) in the Master Boot Record (MBR) format as an example. In the MBR (Master Boot Sector, the first sector of UFS, i.e., the 0th cylinder 0th head 1st sector of the C / H / S address) of UFS, the description of the startup sequence of the electronic device is saved, for example, starting from the static partition (A) (the startup sequence mark is A) or starting from the static partition (B) (the startup sequence mark is A). After the electronic device is started, the startup sequence of the electronic device is first read from the MBR of UFS. Then, according to the boot sequence read, the electronic device can load the data in the system partition, such as the loading of the basic partition (Common), static partition (A) and dynamic partition (Super) in sequence as described in the above example, or the loading of the basic partition (Common), static partition (B) and dynamic partition (Super) in sequence.

[0070] In addition, the dynamic partition (Super) can also contain multiple sub-partitions, such as a user-defined partition (cust) and a pre-installed partition (preload). The cust partition is used to store configuration content added according to third-party customer requirements. The preload partition is used to store program files of applications that need to be pre-installed.

[0071] Understandably, dynamic partitioning also includes Figure 1 Other partitions not shown in the figure, for example, preas, preavs, System, system_ext, vendor, product, Odm, version, etc.

[0072] In some embodiments, the process of upgrading the operating system of the electronic device is as follows:

[0073] First, the electronic device can obtain an upgrade data package 1 through over-the-air technology (OTA). The upgrade data package 1 can be used to upgrade the operating system to the target version 1.

[0074] The target version may be the operating system version that the electronic device needs to reach after the upgrade, may be the latest released operating system version, or may be the operating system version that the user specifies to go back to. This application does not specifically limit this. Of course, upgrading to different target versions requires different upgrade data packages. In subsequent embodiments, target version 1, target version 2, and target version 3 are used to distinguish different target versions.

[0075] In some embodiments, the upgrade data package 1 includes data for updating multiple partitions in the operating system. Figure 1 As shown, the upgrade data package 1 includes a pre-installed application 1. The pre-installed application 1 may include program files of one or more application programs that need to be pre-installed. In addition, the upgrade data package 1 also includes data for updating the basic partition, the static partition, and other sub-partitions in the dynamic partition, which is not specifically limited in the embodiment of the present application.

[0076] Secondly, after obtaining the upgrade data packet 1, the electronic device can parse the upgrade data packet 1 and write the data carried in the upgrade data packet 1 into the corresponding partition. For example, the pre-installed application 1 in the upgrade data packet 1 is written into the preload partition. It can be understood that the above process can refer to the relevant technology and will not be repeated here. In subsequent embodiments, writing the data carried in the upgrade data packet 1 into the corresponding partition can be referred to as the electronic device installing the upgrade data packet 1.

[0077] Finally, the electronic device is restarted to make the upgraded operating system effective. During the restart process, the electronic device can perform the upgraded optimization, for example, installing the pre-installed application 1 (also referred to as the target application) in the preload partition.

[0078] In this way, after upgrading the upgrade data package 1 to the target version 1, the user can directly use the pre-installed application 1 in the electronic device. The installation path of the pre-installed application 1 points to the storage space of the system partition. In subsequent embodiments, the path pointing to the system partition (or user data partition) can be referred to as the path of the system partition (or user data partition).

[0079] Currently, newly manufactured electronic devices need to remove the link of pre-installed application programs. Correspondingly, the upgrade data package corresponding to the new version of the operating system does not contain the program files of the pre-installed applications.

[0080] For example, the new version of the operating system corresponds to Figure 2As shown in the upgrade data package 2 (first upgrade package), the electronic device can upgrade the operating system to a new version of the operating system based on the upgrade data package 2, such as upgrading to the target version 2 (first version).

[0081] like Figure 2 As shown, the upgrade data package 2 does not contain pre-installed applications. In addition, the upgrade data package corresponding to the operating system version whose version release time is later than the target version 2 also does not contain pre-installed applications.

[0082] However, in addition to the new devices that need to install the new version of the operating system, the old devices also need to be upgraded to the new version of the operating system. It can be understood that the above-mentioned old devices can generally refer to electronic devices that were manufactured earlier and have pre-installed applications, such as Figure 1 An electronic device is shown with upgrade package 1 installed.

[0083] like Figure 2 As shown, after the old device installs the upgrade data package 2, the data in the preload partition is overwritten by the upgrade data a from the upgrade data package 2. The upgrade data a is the data for the preload partition in the upgrade data package 2. It can be understood that the upgrade data package 2 cannot carry the preinstalled application 1, and the upgrade data a from the upgrade data package 2 does not contain the preinstalled application 1.

[0084] After the upgrade data package 2 is installed, the overwritten data in the preload partition includes the preinstalled application 1, which causes the preinstalled application 1 to be unable to be used normally.

[0085] It is understandable that for the owner of the old device, the pre-installed applications 1 include the applications that have been actually used. The applications that have been actually used also maintain the owner's relevant data, such as account number, downloaded files, usage progress information, etc.

[0086] Obviously, after the operating system is upgraded to the target version 2, all pre-installed applications 1 cannot be used normally, thereby causing the owner's application data to be lost, forcing the owner to re-download the corresponding application program, which is a cumbersome process and has low human-computer interaction efficiency.

[0087] In addition, the pre-installed applications 1 may also include applications that can affect the normal operation of the device. If such applications cannot be used normally, the user will be forced to re-download the corresponding applications, which is a cumbersome process and has low human-computer interaction efficiency.

[0088] In order to improve the above problems, an embodiment of the present application provides an operating system upgrade method, which is applied to an electronic device. Before the electronic device is upgraded to the target version 2, the program files that need to be pre-installed are written into the user data partition. At this time, the program files that need to be pre-installed in the user data partition are not effective, and the normal operation of the electronic device is not affected.

[0089] After upgrading to target version 2, the program files that need to be pre-installed in the user data partition are set to take effect. Correspondingly, the electronic device can automatically install the corresponding pre-installed applications based on the program files in the user data partition, solving the problem of application data loss after the operating system version of the old device is upgraded, avoiding users from manually installing the original pre-installed applications, and improving the human-computer interaction efficiency of the electronic device.

[0090] For example, when the electronic device has pre-installed applications installed, Figure 3 As shown, the electronic device runs on target version 1, and in the data storage structure of the operating system of the electronic device, the preload partition stores preinstalled application 1. In this scenario, the operating system can be upgraded to the intermediate version (second version) using upgrade data package 3 (second upgrade package) first.

[0091] The transit version may be an operating system version between the target version 1 and the target version 2, and is used to connect the target version 1 and the target version 2.

[0092] The upgrade data package 3 includes the pre-installed application 1 to be written into the preload partition. It can be understood that the pre-installed application 1 in the upgrade data package 3 can ensure that after the operating system is upgraded to the transit version, the actual pre-installed application programs in the electronic device remain unchanged and do not affect the normal use of the user.

[0093] The upgrade data package 3 also includes a backup pre-installed application .IMG file to be written into the user data partition, wherein the backup pre-installed application .IMG file is a backup file of the pre-installed application 1 and may be a compressed file of the pre-installed application 1 .

[0094] It is understandable that the backup pre-installed application .IMG is a file data. After being written into the user data partition, if it is not set to be valid, for example, it is not mounted to the dynamic partition, for the electronic device, it is no different from other file data in the user data partition, and the electronic device will not automatically process the backup pre-installed application .IMG. In this way, when the electronic device is running in the transition version, the backup pre-installed application .IMG will not affect the normal operation of the electronic device.

[0095] In addition, in some embodiments, most of the upgrade data in the upgrade data package 3 is the same as that in the upgrade data package 1. For example, compared with the upgrade data package 1, the upgrade data package 3 adds a backup pre-installed application .IMG.

[0096] In other embodiments, most of the upgrade data in the upgrade data package 3 may be the same as that in the upgrade data package 2. For example, compared with the upgrade data package 2, the upgrade data package 3 adds a backup preinstalled application .IMG and a preinstalled application 1 for the preload partition.

[0097] In the embodiment of the present application, the upgrade data package 3, in addition to including the backup pre-installed application .IMG and the pre-installed application 1 for the preload partition, does not specifically limit other upgrade data. It only needs to ensure that the operating system of the electronic device can run normally after upgrading to the transit version.

[0098] In some embodiments, after the backup pre-installed application .IMG is written to the user data partition, a mark information 1 may be written in the Oeminfo partition of the base partition, and the mark information 1 is used to indicate that the backup pre-installed application .IMG has been installed in the user data partition and does not need to be repaired, so as to avoid repeatedly obtaining the backup pre-installed application .IMG and repeatedly writing the backup pre-installed application .IMG to the user data partition after restarting the electronic device. In other possible embodiments, this step may also be skipped, and the embodiments of the present application do not specifically limit this.

[0099] After the electronic device installs the upgrade data package 3, the electronic device is restarted. During the restart process, when the electronic device scans the preinstalled application 1 in the preload partition, the preinstalled application 1 can be automatically installed. After that, the user can use the electronic device normally until entering the electronic device to perform the second upgrade, that is, upgrading from the transit version to the target version 2.

[0100] like Figure 4 As shown, when the operating system of the electronic device is a transit version, the electronic device can initiate a second upgrade in response to a user operation, or can automatically perform the second upgrade. During the second upgrade, the electronic device can install the upgrade data packet 2, for example, writing the upgrade data in the upgrade data packet 2 into the corresponding partition.

[0101] Among them, the upgrade data packet 2 includes upgrade data a for the preload partition, and the upgrade data a does not contain the preinstalled application 1. After the upgrade data a from the upgrade data packet 2 is written to the preload partition, the original preinstalled application 1 in the preload partition is overwritten, or is called cleared. In addition, during the conventional operating system upgrade process, the data in the user data partition will not be modified to ensure the user's data security. Accordingly, after installing the upgrade data packet 2, the data in the user data partition remains unchanged, that is, the user data partition still contains the backup preinstalled application .IMG. In addition, the backup preinstalled application .IMG is still in an invalid state.

[0102] In addition, the data in the basic partition of the electronic device does not participate in the upgrade of the operating system. During the installation of the upgrade data package 2, the electronic device does not process the backup pre-installed application .IMG, for example, the backup pre-installed application .IMG is not deleted. In this scenario, the marking information 1 in the oeminfo partition remains unchanged, and the user continues to be prompted that the backup pre-installed application .IMG has been installed in the data partition and does not need to be repaired.

[0103] After installing the upgrade data package 2, the electronic device can perform a post-upgrade restart. During the restart process, the electronic device sets the backup pre-installed application .IMG to be valid. For example, the image file of the backup pre-installed application .IMG can be mounted to the cust partition. For details, please refer to the subsequent embodiments and will not be repeated here. Figure 5 As shown, after the electronic device is restarted, in the data storage structure of the operating system of the electronic device, the cust partition contains the image file of the backup pre-installed application.IMG, and the user data partition contains the backup pre-installed application.IMG. After the image file of the backup pre-installed application.IMG is mounted to the cust partition, the backup pre-installed application.IMG is a valid installable file for the electronic device.

[0104] In addition, according to the process of restarting after upgrading, the package manager service (PMS) in the electronic device can scan the partitions corresponding to the operating system. When the PMS scans the cust partition, it accesses the backup preinstalled application .IMG stored in the user data partition through the image file of the backup preinstalled application .IMG, and based on the backup preinstalled application .IMG, preinstalls the preinstalled application 1 corresponding to the backup preinstalled application .IMG.

[0105] In this way, Figure 3 to Figure 5 During the process of upgrading the electronic device from target version 1 to the transit version and then from the transit version to the target version 2, the pre-installed applications in the electronic device remain unchanged, and the user's normal use of the pre-installed applications is not affected.

[0106] Later, when upgrading to an operating system that is released later than target version 2 (e.g., target version 3), the image file of the backup pre-installed application .IMG can be mounted to the cust partition again, so that PMS can pre-install the application corresponding to the backup pre-installed application .IMG again in advance during the restart process, avoiding the loss of user application data and improving the human-computer interaction efficiency of the device.

[0107] In some embodiments, during the process of upgrading the electronic device from target version 2 to target version 3, the step of upgrading to the intermediate version may not be performed to reduce the upgrade time. In other embodiments, during the process of upgrading the electronic device from target version 2 to target version 3, the step of upgrading to the intermediate version may be repeated to improve the reliability of the upgrade, which is not specifically limited in the embodiments of the present application.

[0108] Of course, the electronic device can also flexibly decide whether to upgrade to the transit version first and then to the target version according to actual conditions.

[0109] For example, the electronic device can determine whether it needs to be upgraded to the intermediate version first according to whether there is marking information 1 in the Oeminfo partition.

[0110] For example, if the tag information 1 is written in the Oeminfo partition, the electronic device can directly install the upgrade data package of the target version. Afterwards, when restarting, the image file of the backup pre-installed application .IMG in the user data partition is mounted again to the cust partition.

[0111] For another example, if the tag information 1 is not written in the Oeminfo partition, the electronic device can obtain the upgrade data package 3 corresponding to the transfer version, first upgrade to the transfer version based on the upgrade data package 3, and then install the upgrade data package of the target version. Afterwards, when restarting, the image file of the backup pre-installed application .IMG in the user data partition is mounted again to the cust partition.

[0112] It can be understood that the above-mentioned marking information 1 can not only indicate that a backup pre-installed application .IMG has been stored in the electronic device, but also needs to indicate the integrity of the backup pre-installed application .IMG in the electronic device. In some embodiments, when the backup pre-installed application .IMG has not been written to the electronic device and there is no marking information 1 in the Oeminfo partition, the electronic device can determine that it needs to be upgraded to the transit version first, and then upgraded to the target version. If the backup pre-installed application .IMG written into the electronic device is damaged (such as power failure during the writing process), or the written backup pre-installed application .IMG is accidentally deleted, the electronic device may not upgrade to the transit version, but only re-download the backup pre-installed application .IMG and write it to the user data partition of the electronic device.

[0113] Exemplarily, the electronic device may operate the version number of the operating system to determine whether it needs to be upgraded to the intermediate version first.

[0114] For example, if the release time indicated by the version number of the current operating system of the electronic device is earlier than the release time indicated by the target version 2, and the version number is different from the transit version, the electronic device can obtain the upgrade data package 3 corresponding to the transit version, and first upgrade to the transit version based on the upgrade data package 3. Then, install the upgrade data package of the target version. Afterwards, when restarting, the image file of the backup pre-installed application .IMG in the user data partition is mounted to the cust partition again.

[0115] For example, if the release time indicated by the version number of the current operating system of the electronic device is later than the release time indicated by the target version 2, or if the version number of the current operating system of the electronic device is the same as the transit version, the electronic device can directly install the upgrade data package of the target version. Afterwards, when restarting, the image file of the backup pre-installed application .IMG in the user data partition is mounted again to the cust partition.

[0116] In some embodiments, for an electronic device that has pre-installed applications, if the pre-installed applications include applications that will affect the normal use of the electronic device if deleted, in a scenario where it is necessary to upgrade the operating system based on an upgrade data package that does not contain pre-installed applications (e.g., upgrade data package 2), the electronic device can execute the above-mentioned operating system upgrade method to avoid losing the pre-installed applications.

[0117] In other embodiments, in the scenario where the operating system needs to be upgraded based on an upgrade data package that does not contain pre-installed applications (e.g., upgrade data package 2), the user may be asked whether to retain the pre-installed applications. When the user indicates to retain the pre-installed applications, the electronic device may execute the above operating system upgrade method to avoid losing the pre-installed applications.

[0118] In an exemplary scenario, the electronic device has pre-installed applications 1 such as a clock application, an email application, and a music application. Correspondingly, the main interface of the electronic device may include application icons of the pre-installed applications 1 .

[0119] for example, Figure 6 The main interface 601 of the electronic device is shown, and the main interface 601 displays an application icon 602-1 of a clock application, an application icon 602-2 of an email application, and an application icon 602-3 of a music application. For example, the pre-installed application 1 includes a clock application, an email application, and a music application.

[0120] When the electronic device detects a newly released operating system version (eg, target version 2), if the upgrade data package 2 corresponding to the target version 2 does not contain a pre-installed application, such as Figure 6As shown, the electronic device can display an upgrade notification box 603 (first prompt window) on the current user interface (such as the main interface 601). The upgrade notification box 603 includes upgrade reminder information, and the upgrade reminder information is used to prompt the user to choose whether to upgrade the operating system. In addition, the upgrade notification box 603 includes a control 604 (first control) indicating that the pre-installed application is retained after the upgrade and a control 605 indicating that the pre-installed application is not retained after the upgrade. Relative to the control 604, prompt information is displayed, such as upgrading and retaining the pre-installed application. Relative to the control 605, prompt information is also displayed, such as upgrading and not retaining the pre-installed application.

[0121] Exemplarily, in response to the user clicking on control 604, the electronic device may upgrade the operating system of the target version 1 to the intermediate version of the operating system. Before the upgrade, the preload partition in the data storage structure of the operating system of the electronic device contains the program files of the preinstalled application 1. After the upgrade, the preload partition in the data storage structure of the operating system of the electronic device still contains the program files of the preinstalled application 1. In addition, the user data partition contains a backup preinstalled application .IMG. The backup preinstalled application .IMG may be a backup file of the preinstalled application 1 in the preload partition, such as a backup of the program files of the clock application, the email application, and the music application.

[0122] As another example, Figure 7 As shown, in response to the user clicking on control 604, the electronic device can be directly upgraded to target version 2. Before the upgrade, in the data storage structure of the operating system of the electronic device, the preload partition contains the program files of the preinstalled application 1. After the upgrade, in the data storage structure of the operating system of the electronic device, there are no program files of any application in the preload partition.

[0123] In this scenario, when the electronic device is restarted after the upgrade, the preload partition does not contain the preinstalled application 1, so the preinstalled application 1 will not be installed. After the restart, the preinstalled applications 1 in the electronic device are invalid, and the corresponding application icons are also deleted. In this way, the application icons 602-1, 602-2, and 602-3 of the main interface 601 disappear.

[0124] In addition, Figure 6 In the scenario shown, after upgrading to the intermediate version, the electronic device restarts to make the intermediate version effective. During the restart process, the electronic device can install the corresponding pre-installed application 1 according to the program file in the preload partition. Figure 6 As shown, after the upgrade and restart, the main interface 601 still displays the application icons of the pre-installed application 1, for example, the application icon 602-1, the application icon 602-2 and the application icon 602-3 disappear.

[0125] In some embodiments, after the electronic device is upgraded to the intermediate version, an upgrade prompt box 606 may be displayed. The prompt information in the upgrade prompt box 606 is used to prompt the user whether to immediately upgrade the operating system to the target version 2. In addition, the upgrade prompt box 606 includes a control 607 indicating immediate upgrade and a control 608 indicating later upgrade.

[0126] Exemplarily, in response to the user clicking on control 608 , the electronic device continues to run on the intermediate version of the operating system, the user can use the electronic device normally, and instructs the electronic device to run preinstalled application 1 .

[0127] As another example, Figure 6 As shown, in response to the user clicking on control 607, the electronic device can upgrade the operating system of the intermediate version to the operating system of the target version 2. Before the upgrade, in the data storage structure of the operating system of the electronic device, the preload partition contains the program files of the preinstalled application 1, and the user data partition includes the backup preinstalled application .IMG. After the upgrade, in the data storage structure of the operating system of the electronic device, the preload partition does not contain the program files of the preinstalled application 1, and the user data partition contains the backup preinstalled application .IMG.

[0128] In other possible embodiments, the electronic device may not display the upgrade prompt box 606. After the electronic device is upgraded to the intermediate version and restarted, the next operating system upgrade is automatically executed, such as upgrading the operating system from the intermediate version to the target version 2.

[0129] In other possible embodiments, after the electronic device determines that the cloud server has released an upgrade data packet of a new version of the operating system, the upgrade data packet can be automatically downloaded. When the electronic device is idle, the operating system upgrade is automatically performed based on the upgrade data packet. For example, when a newly released upgrade data packet 3 and upgrade data packet 2 are detected, the above-mentioned upgrade data packet 3 and upgrade data packet 2 can be downloaded. When the electronic device is idle, it can be automatically upgraded to the transit version based on upgrade data packet 3, and then upgraded to the target version 2 based on upgrade data packet 2. The method of determining whether the electronic device is idle can refer to the relevant technology. For example, it can be determined that the device is idle during a specific period of time (nighttime) and when the electronic device is charging.

[0130] In some embodiments, the electronic device performs a restart after the upgrade again. During the restart process, the electronic device can mount the backup pre-installed application .IMG to the cust partition, for example, register the image file of the backup pre-installed application .IMG to the cust partition. In this way, when the PMS scans the cust partition, it can jump to access the backup pre-installed application .IMG through the image file of the backup pre-installed application .IMG, and automatically install the corresponding pre-installed application 1 based on the backup pre-installed application .IMG.

[0131] In this way, it can ensure that newly manufactured electronic devices can skip the process of pre-installing applications, and it can also ensure that old devices can retain the original pre-installed applications after being upgraded.

[0132] In the embodiment of the present application, when the electronic device upgrades the operating system version and needs to retain the pre-installed applications, the operating version upgrade method can be executed, such as Figure 8 As shown, the method may include the following steps:

[0133] S1, write the backup file corresponding to the pre-installed application into the user data partition.

[0134] The preinstalled application may be an application program preinstalled in the electronic device before the upgrade, such as the preinstalled application 1 mentioned in the above embodiment. The backup file may be the backup preinstalled application .IMG mentioned in the above embodiment.

[0135] In some embodiments, the electronic device can write the backup file corresponding to the pre-installed application to the user data partition by upgrading to the intermediate version. In other embodiments, it can also be in response to user operations to directly download the backup file corresponding to the pre-installed application and write it to the user data partition. In the subsequent embodiments, the above S1 is mainly introduced by taking the method of upgrading to the intermediate version as an example.

[0136] As a way to achieve this, Fig. 9 As shown, the steps of writing the backup pre-installed application .IMG corresponding to the pre-installed application 1 to the user data partition by upgrading to the transit version are as follows:

[0137] S101, the online update client application (online update client apk, ouc apk) obtains the upgrade data package 3.

[0138] Exemplarily, in a feasible implementation scheme, the ouc apk of the electronic device can periodically initiate a package search request to the upgrade server, and the package search request includes the version number of the operating system currently running the electronic device (for example, version 7.1.0.101); the upgrade server retrieves whether there is an upgrade data packet 2 with a newer version number (for example, version 8.0.0.100) based on the operating system version number in the package search request.

[0139] In some embodiments, if there is an updated version of the upgrade data package 2, and there is a transit version between the updated version and the current version (such as version 7.1.0.1), the upgrade server can first feedback the download address of the transit version of the upgrade data package 3 to the electronic device; the electronic device downloads the upgrade data package 3 according to the download address.

[0140] If there is an updated version of upgrade data package 2, and there is no intermediate version between the updated version and the current version, the upgrade server can first feedback the download address of the updated version of upgrade data package 2 to the electronic device; the electronic device downloads the upgrade data package 2 according to the download address and performs a regular operating system upgrade.

[0141] In other embodiments, if there is an updated version of the upgrade data packet 2, the search request contains information indicating that the pre-installed application is retained, and the upgrade server can first feedback the download address of the transfer version of the upgrade data packet 3 to the electronic device; the electronic device downloads according to the download address of the upgrade data packet 3. If there is an updated version of the upgrade data packet 2, the search request does not contain information indicating that the pre-installed application is retained, and the download address of the updated version of the upgrade data packet 2 can be first fed back to the electronic device; the electronic device downloads according to the download address of the upgrade data packet 2 to perform a conventional operating system upgrade.

[0142] In the subsequent embodiments, the acquisition of the upgrade data package 3 is taken as an example for description.

[0143] S102, ouc apk triggers update engine to enter the upgrade process.

[0144] In some embodiments, ouc apk can download and save the upgrade data package 3 to the user data partition (Userdata). After the upgrade data package 3 is written to the user data partition, ouc apk starts the upgrade engine (updateengine), and the upgrade engine (update engine) upgrades the operating system according to the upgrade data package 3, and the process enters S103.

[0145] As an example, after ouc apk obtains the upgrade data package 3, it sets the startup attribute of the upgrade engine in ouc apk and sets the startup attribute to true. The servicemanger resident in the background of the operating system monitors the startup attribute of the upgrade engine. When the servicemanger detects that the startup attribute of the upgrade engine is true, the servicemanger starts the upgrade engine.

[0146] Ouc apk obtains the status of the update engine through binder communication. When ouc apk confirms that the update engine is successfully started, ouc apk passes the upgrade parameters to the update engine (for example, whether the current upgrade operation is a file update operation or a file disk operation), triggering the update engine to enter the upgrade process. For example, the process enters S103.

[0147] S103, the update engine verifies the signature and authenticates the upgrade data packet 3.

[0148] Exemplarily, based on the META-INF (i.e., digital signature) in the upgrade data packet 3, it is possible to check whether the upgrade data packet 3 has been tampered with during transmission. The above process can be called signature verification. The specific implementation details of the signature verification can refer to the relevant technology and will not be repeated here. In addition, the cloud server can also be requested to authenticate the upgrade data packet 3 stored in the electronic device. For specific details, refer to the relevant technology and will not be repeated here. After the upgrade data packet 3 passes the signature verification and authentication, it can be determined that the upgrade data packet 3 has passed the inspection, or that the inspection is successful.

[0149] If the verification is successful, the update engine can upgrade the operating system based on the upgrade data package 3. Prior to this, the electronic device can write the backup pre-installed application .IMG in the upgrade data package 3 into the user data partition, that is, the process enters S104.

[0150] S104, the update engine detects that there is a transfer packet in the upgrade data packet 3.

[0151] In some embodiments, when a transit packet (e.g., update-cota-normal.zip) is configured in the upgrade data packet 3, a corresponding configurable tag, such as cota-version-in-ota.tag, will also be configured in the upgrade data packet 3. When the update engine detects cota-version-in-ota.tag, it can be identified that the upgrade data packet 3 contains a transit packet (e.g., update-cota-normal.zip). The transit packet carries the backup pre-installed application .IMG.

[0152] S105, the update engine stores the transit packet to the designated storage path 1 in the user data partition.

[0153] In some embodiments, the update engine can decompress the transit packet corresponding to the configurable tag to the specified storage path 1 (first path) during the process of parsing the upgrade data packet 3. The above-mentioned specified storage path 1 can indicate a storage space in the user data partition, and the data packets stored in the storage space can be exempted from authentication.

[0154] Exemplarily, the electronic device is pre-configured with a magic number, such as 12345. The magic number may be referred to as a designated character. The path name of the designated storage path 1 may carry the magic number, for example, the designated storage path 1 may be data / update / atl / 12345 / , which includes the magic number "12345".

[0155] In some embodiments, after the transit packet is stored in the designated storage path 1, the update engine can search and continue to process the transit packet through the designated storage path 1. When the update engine searches for the transit packet, it determines that the data packet stored in the designated storage path 1 is an authentication-free data packet through the magic word in the designated storage path 1. That is, the update engine can identify that the transit packet is an authentication-free data packet, and the process enters S106.

[0156] S106, the update engine installs the transit packet and verifies the signature of the transit packet.

[0157] In some embodiments, the above-mentioned installation transit packet may be: the update engine creates an installation path for the transit packet (e.g., designated storage path 2), and then parses the transit packet, and writes the parsed data file into the storage space corresponding to the designated storage path 2. The designated storage path 2 may indicate a storage space in the user data partition, for example, the designated storage path 2 may be data / cota / cota-normal / reboot-update.

[0158] Exemplarily, the above-mentioned transit packet also includes the digital signature of the transit packet. During the installation of the transit packet, after the update engine parses the digital signature, it can verify the signature based on the digital signature carried by the transit packet. The specific implementation process can refer to relevant technologies and will not be elaborated here.

[0159] It can be understood that the transit packet comes from the designated storage path 1, and the designated storage path 1 contains the magic word, and the data packets stored therein are exempt from authentication, that is, when installing the transit packet from the designated storage path 1, only the signature verification can be performed. In this way, in the case of signature verification failure, the update engine can instruct the ouc apk to re-download the upgrade data packet 3, and the process enters S101 again, or, only the ouc apk re-downloads the transit packet. In the case of successful signature verification, the process enters S107.

[0160] S107, the update engine stores the backup pre-installed application .IMG parsed from the transfer packet in the storage space indicated by the designated storage path 2.

[0161] In some embodiments, the above-mentioned transit packet also carries a backup pre-installed application .IMG. After the transit packet is successfully verified, it indicates that the content in the transit packet is complete, has not been tampered with, and is reliable. In this scenario, the update engine decompresses the backup pre-installed application .IMG carried by the transit packet to the designated storage path 2 (second path). After the backup pre-installed application .IMG is decompressed to the designated storage path 2, a status file 1 indicating that the installation is complete can also be written to the designated storage path 2. The status file 1 corresponds to the backup pre-installed application .IMG, and is used to indicate that the complete backup pre-installed application .IMG has been stored under the designated storage path 2.

[0162] S108, the update engine updates the data in each partition of the operating system based on the upgrade data packet 3.

[0163] In some embodiments, the above S108 may refer to the implementation details of conventional operating system upgrades in related technologies.

[0164] Taking the electronic device using the virtual A / B operating system as an example, when the electronic device runs on the A operating system, according to the upgrade data packet 3, a data writing operation is performed on the static partition (B) to upgrade the static partition (B);

[0165] For example, if the upgrade data package 3 contains the data of the static partition of the transfer version, the update engine overwrites the data for the static partition from the data upgrade package 3 to the static partition (B). A virtual dynamic partition is created in the user data partition (Userdata) according to the upgrade data package 3, and the upgrade data for the dynamic partition (Super) from the upgrade data package 3 is written to the virtual dynamic partition. For example, if the upgrade data package 3 contains the data of the dynamic partition of the transfer version, the device writes the data of the dynamic partition (Super) of the transfer version to the virtual dynamic partition.

[0166] The upgrade data of the dynamic partition (Super) saved in the user data partition (Userdata) includes multiple COW files, each COW file corresponds to a sub-partition of the dynamic partition (Super), and the COW file is named corresponding to the sub-partition of the dynamic partition (Super) to which it is directed.

[0167] In the upgrade data package 3, the COW file of the upgrade data of the dynamic partition (Super) is compressed and saved in the form of binary code. In the upgrade data package 3, each COW file is named according to the sub-partition of the dynamic partition (Super) to which it is directed. After S110, the data in the virtual dynamic partition can also be written to the dynamic partition of the operating system, and the data of the static partition (B) can be mirrored to the static partition (B). For details, please refer to the description in the subsequent embodiments.

[0168] After the upgrade data in the upgrade data package 3 is written into the corresponding partition, for example, the data for the static partition is written into the static partition B, and the data for the dynamic partition is written into the virtual dynamic partition, the process enters S109.

[0169] Taking the electronic device using a single operating system as an example, the update engine directly overwrites the data from the data upgrade package 3 for the static partition to the static partition, and directly overwrites the data from the data upgrade package 3 for the dynamic partition to the dynamic partition, and the process enters S109.

[0170] It can be understood that the upgrade data package 3 includes upgrade data b (preinstalled data) for the preinstalled partition. The above upgrade data b includes the program file of the preinstalled application 1. When updating the data in each partition of the operating system, the upgrade data b can be overwritten into the preinstalled partition.

[0171] S109, the update engine writes a mark information 1 in the basic partition, indicating that the backup pre-installed application .IMG has been installed and does not need to be repaired.

[0172] The tag information 1 (target tag information) includes a state identifier 1 (Oeminfo-xxx-IMG) whose value is 1, and a state identifier 2 (Oeminfo-xxx-IMG-resume) whose value is 2.

[0173] Exemplarily, the status flag 1 can be configured as a value of 1 (e.g., 1) and a value of 3 (e.g., 0). When the status flag 1 is a value of 1, it indicates that the backup file of the preinstalled application has been written into the user data partition; when the status flag 1 is a value of 3, it indicates that the backup file of the preinstalled application has not been written into the user data partition.

[0174] Exemplarily, status identifier 2 can be configured as value 2 (e.g., 0) and value 4 (e.g., 1), wherein when status identifier 2 is value 2, it indicates that the backup file of the pre-installed application is complete and does not need to be repaired; when status identifier 2 is value 4, it indicates that the backup file of the pre-installed application needs to be repaired.

[0175] When the backup pre-installed application .IMG has been written into the user data partition and the backup pre-installed application .IMG is complete, the update engine "writes status identifier 1 to value 1 and status identifier 2 to value 2" in the Oeminfo partition of the base partition, which can also be called writing tag information 1.

[0176] When the backup pre-installed application .IMG has been written into the user data partition and the backup pre-installed application .IMG is damaged or deleted, the update engine "writes status identifier 1 to value 1 and status identifier 2 to value 4" in the Oeminfo partition of the base partition, which can also be called writing tag information 2.

[0177] When the electronic device is formatted, for example, all data in the user data partition is deleted, the update engine "writes status identifier 1 to value 3 and status identifier 2 to value 4" in the Oeminfo partition of the base partition, which can also be called writing tag information 3, indicating that there is no backup of pre-installed applications .IMG in the user data partition.

[0178] In short, different tag information can be written to the Oeminfo partition to indicate whether there is a backup of pre-installed applications .IMG in the user data partition, and whether the backup of pre-installed applications .IMG is complete. In the inti stage, ouc apk can decide whether to re-download the transfer package or re-download the upgrade data package 3 based on the tag information in the Oeminfo partition.

[0179] S110, update engine triggers restart.

[0180] In some embodiments, the device power is turned off and then turned on again.

[0181] In addition, when the electronic device adopts a virtual A / B operating system, during the restart process of the electronic device, the boot sequence of the electronic device is changed from booting from the static partition (A) to booting from the static partition (B). For example, before restarting the electronic device, rewrite the boot sequence identifier of the master boot record (Master Boot Record, MBR), and rewrite the boot sequence identifier from A to B. After the electronic device is powered on, the electronic device reads the boot sequence identifier as B, and the electronic device boots from the static partition (B). For example, the electronic device first loads the basic partition (Common), and then loads the static partition (B), so as to boot from the static partition (B).

[0182] After that, the electronic device loads the dynamic partition (Super) and the virtual dynamic partition of the user data partition (Userdata). In this way, the electronic device takes effect after restarting, and then starts the merge process, for example, in the background, the data of the virtual dynamic partition is written to the dynamic partition (Super). In addition, the data in the static partition (B) can be overwritten to the static partition (A).

[0183] In addition, during the restart of the electronic device, the init process can report the tag information 1 to the ouc apk, so that oucapk determines that there is no need to re-download the transfer packet, and then the process enters S111.

[0184] S111, the update engine determines that the current operating system version is earlier than the target version 2.

[0185] In some embodiments, the basic partition may include the version number of the current operating system, and the update engine may query the version number of the current operating system. For example, the current operating system version is a transit version, and the corresponding version number is 7.1.0.1. The version numbers are arranged in ascending order, and the version number of the transit version is arranged before the version number (8.0.0.100) of the target version 2 (specified version). In this way, it can be determined that the transit version is earlier than the target version 2, and the process enters S112.

[0186] In some embodiments, during the restart of the electronic device, the PMS may also scan the system partition, and when the program file of the preinstalled application 1 in the preinstalled partition is scanned, the corresponding preinstalled application 1 is installed. Afterwards, the installation path of the preinstalled application 1 in the electronic device is the storage path in the system partition.

[0187] S112, the update engine starts the second operating system upgrade.

[0188] In some embodiments, the above S112 may be to upgrade the operating system based on the upgrade data packet 2, so that the operating system is upgraded from the transit version to the target version 2. In other embodiments, after S111, the electronic device may display the user interface, and the user may use the electronic device normally. Before S112, the electronic device may also receive an operation instructing the user to upgrade to the target version 2, that is, in response to the user's instruction, start the second operating system upgrade.

[0189] Through the above S101 to S112, the electronic device writes the backup pre-installed application .IMG into the user data partition. Figure 8 As shown, the above method may further include the following steps:

[0190] S2, when upgrading to a new version of the operating system, mount the backup file to the cust partition, and instruct the electronic device to pre-install the application corresponding to the backup file.

[0191] In some embodiments, the latest version of the operating system may be target version 2, or other versions later than target version 2, such as target version 3. In subsequent embodiments, the latest version is mainly described as target version 2.

[0192] As an implementation method, the above S2 can be implemented by improving the process of upgrading to the target version 2. Fig.10 As shown, the above S2 may include the following steps:

[0193] S201, ouc apk obtains upgrade data package 2, which includes data for upgrading to target version 2.

[0194] S202, ouc apk triggers update engine to enter the upgrade process.

[0195] S203, the update engine verifies the signature and authenticates the upgrade data packet 2.

[0196] In some embodiments, the implementation details of the above S201 to S203 may refer to the above S101 to S103 and will not be described in detail here.

[0197] S204, after the update engine detects that the upgrade data packet 2 does not contain the transfer packet, it updates the data in each partition of the operating system based on the upgrade data packet 2.

[0198] In some embodiments, the implementation details of the above S204 may refer to S108 and will not be described in detail here.

[0199] S205, the update engine triggers a restart.

[0200] In some embodiments, when the electronic device uses the A / B operating system, during the restart process, a merge process can be started, for example, the data of the virtual dynamic partition is stored in the dynamic partition (Super) in the background. In addition, the data in the static partition (B) can be overwritten in the static partition (A).

[0201] S206 , the update engine determines that the current operating system version is target version 2 or a version later than target version 2.

[0202] In some embodiments, the update engine may query the version number of the current operating system, and compare the queried version number with the version number of the target version 2 (specified version) to identify whether the current operating system version is the target version 2 or is later than the target version 2. If the current operating system version is the target version 2, or the current operating system version is later than the target version 2, the process proceeds to S207.

[0203] S207, the update engine moves the backup pre-installed application .IMG to the designated storage path 3 in the user partition.

[0204] The designated storage path 3 may indicate a storage space in the user data partition, and the storage space is associated with the cust partition. For example, the designated storage path 3 may be / data / cust / mount.

[0205] In some embodiments, before moving the backup pre-installed application .IMG, it is also possible to check whether there is a state file 1 under the specified storage path 2. If the state file 1 exists, the backup pre-installed application .IMG is moved to the specified storage path 3. If the state file 1 does not exist, the process ends.

[0206] S208, the update engine mounts the backup image file of the pre-installed application .IMG to the directory corresponding to the cust partition.

[0207] In some embodiments, after the image file of the backup pre-installed application .IMG is mounted to the directory corresponding to the cust partition, the function and content of registering the above-mentioned backup pre-installed application .IMG in the cust partition of the operating system is realized.

[0208] S209, the update engine instructs the PMS to start scanning, and when scanning the cust partition, installs the application corresponding to the backup pre-installed application .IMG.

[0209] In some embodiments, when the PMS scans the cust partition, it identifies the program files of the application programs that need to be preinstalled in the user data partition based on the image file of the backup preinstalled application .IMG. Correspondingly, the PMS can access the designated storage path 3, and then install the corresponding preinstalled application 1 based on the backup preinstalled application .IMG in the designated storage path 3. Afterwards, the installation path of the preinstalled application 1 in the electronic device is the storage path in the user data partition.

[0210] As shown in the above-mentioned embodiments, when the operating system of the electronic device is updated from target version 1 to the transit version, and from the transit version to the target version 2, the actual pre-installed application program remains unchanged, but the installation path of the pre-installed application 1 is changed from the storage path within the system partition to the storage path within the user data partition.

[0211] In other embodiments, Fig.11 As shown, after the electronic device obtains an upgrade data package of any version (eg, called a target upgrade package), the following steps may be performed:

[0212] S301, detecting whether the target upgrade package contains a transfer packet.

[0213] When there is a transfer packet, the process enters S302. When there is no transfer packet, the process enters S303.

[0214] S302, write the backup pre-installed application .IMG carried in the transfer packet into the user data partition.

[0215] S303: Based on the target upgrade package, update the data of each partition of the operating system to upgrade the electronic device to the version indicated by the target upgrade package.

[0216] S304, triggering a device restart.

[0217] S305: During the restart process, the current operating system version is detected.

[0218] S306: Whether the current operating system version is higher than or equal to the target version 2.

[0219] When the version of the current operating system is lower than the target version 2, the process ends. When the version of the current operating system is higher than or equal to the target version 2, the process enters S307.

[0220] S307, mount the backup pre-installed application .IMG to the cust partition.

[0221] S308, when the cust partition is scanned, the application indicated by the backup pre-installed application .IMG is automatically installed.

[0222] The embodiment of the present application also provides an electronic device, which may include: a memory and one or more processors. The memory and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform each step in the above embodiment. Of course, the electronic device includes but is not limited to the above memory and one or more processors.

[0223] Please refer to Fig.12 , Fig.12 A possible hardware structure diagram of an electronic device is shown:

[0224] like Fig.12 As shown, the electronic device 100 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, a battery 142, 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0225] Among them, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.

[0226] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0227] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0228] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0229] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0230] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0231] It is understandable that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0232] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0233] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc.

[0234] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0235] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element (image sensor) through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0236] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include N cameras 193, where N is a positive integer greater than 1.

[0237] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0238] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0239] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0240] The embodiment of the present application also provides a chip system, which can be applied to the electronic device in the aforementioned embodiment. The chip system includes at least one processor and at least one interface circuit. The processor can be the processor in the above-mentioned electronic device. The processor and the interface circuit can be interconnected through a line. The processor can receive and execute computer instructions from the memory of the above-mentioned electronic device through the interface circuit. When the computer instructions are executed by the processor, the electronic device can execute the various steps in the above-mentioned embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.

[0241] In some embodiments, through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0242] Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0243] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.

[0244] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A method for upgrading an operating system, characterized in that: Applied to an electronic device, the electronic device has one or more target applications pre-installed in it, and the installation path of the one or more target applications points to the system partition of the electronic device, the method includes: The electronic device obtains a second upgrade package, where the second upgrade package is used to upgrade the operating system of the electronic device to a second version of the operating system, where the second upgrade package includes a transfer packet, where the transfer packet includes the program files of the one or more target applications, and the second version is different from the first version; In response to the second upgrade package, the electronic device upgrades the operating system to the second version of the operating system; In the process of upgrading the operating system to the second version of the operating system, writing the program files of the one or more target applications carried in the transfer packet into the user data partition; The electronic device obtains a first upgrade package, where the first upgrade package is used to upgrade the operating system of the electronic device to the first version of the operating system, and the first upgrade package does not contain the program file of the target application; The electronic device upgrades the operating system to the first version of the operating system in response to the first upgrade package; After the operating system is upgraded to the first version of the operating system, preinstalling the one or more target applications; Before upgrading to the first version of the operating system, the installation path of the one or more target applications points to the system partition; after upgrading to the first version of the operating system, the installation path of the one or more target applications points to the user data partition.

2. The method according to claim 1, characterized in that The step of writing the program files of the one or more target applications in the transit packet into the user data partition includes: Writing the transit packet into the user data partition; Parse the program files of the one or more target applications in the transit packet and write them into the user data partition.

3. The method according to claim 2, characterized in that Before the electronic device upgrades the operating system to the second version of the operating system, the method further includes: The electronic device determines that the second upgrade package passes the signature verification process and the authentication process; Writing the transit packet into the user data partition comprises: storing the transit packet in a first path pointing to the user data partition, wherein the path name of the first path includes a specified character, and the specified character indicates that the data stored in the first path is exempted from authentication processing; The step of parsing the program files of the one or more target applications in the transit packet and writing them into the user data partition includes: storing the program files of the one or more target applications parsed from the transit packet in a second path pointing to the user data partition.

4. The method according to claim 3, characterized in that After the program files of the one or more target applications parsed from the transit packet are stored in the second path pointing to the user data partition, the method further includes: Writing target marking information into the basic partition of the electronic device, indicating that the program file of the target application has been written into the user data partition and the data is complete; After the operating system is upgraded to the first version of the operating system and before the one or more target applications are preinstalled, the method further includes: the electronic device determining that the basic partition contains the target marking information.

5. The method according to any one of claims 1 to 4, characterized in that: The second upgrade package also includes preinstalled data, and the preinstalled data also includes program files of the one or more target applications. The preinstalled data is different from the transfer packet. In the process of upgrading the operating system to the second version of the operating system, the method further includes: The electronic device writes the preinstalled data into a system partition of the electronic device; After upgrading the operating system to the second version of the operating system, the method further includes: The electronic device performs a first restart; During the first restart process, the electronic device installs the one or more target applications in response to the preinstalled data of the system partition; wherein, when the operating system of the electronic device is the second version of the operating system, the installation path of the preinstalled one or more target applications points to the system partition.

6. The method according to claim 5, characterized in that After the operating system is upgraded to the first version of the operating system, the system partition does not contain the preinstalled data.

7. The method according to claim 5, characterized in that After the operating system is upgraded to the first version of the operating system and before the one or more target applications are preinstalled, the method further includes: The electronic device performs a second restart; During the second restart process, the program files of the one or more target applications in the user data partition are mounted to the system partition.

8. The method according to claim 7, characterized in that The step of mounting the program files of the one or more target applications in the user data partition to the system partition includes: Moving the program files of the one or more target applications from the second path to the third path, wherein the second path and the third path are paths pointing to different storage areas in the user data partition, and the third path is associated with the system partition; Writing a first image file into the system partition, the first image file including image files corresponding to the program files of the one or more target applications; After the operating system is upgraded to the first version of the operating system, preinstalling the one or more target applications includes: in a process in which the electronic device scans the system partition, in response to scanning the first image file, accessing the third path; In response to the program file found under the third path, the corresponding target application is installed.

9. The method according to claim 8, characterized in that After the electronic device writes the program files of the one or more target applications in the user data partition, the method further includes: the electronic device writes a status file in the user data partition to indicate that the program files of the one or more target applications have been completely written into the user data partition; Before moving the program files of the one or more target applications from the second path to the third path, the method further includes: the electronic device determining that the user data partition contains the status file.

10. The method according to claim 7, characterized in that Before mounting the program files of the one or more target applications in the user data partition to the system partition, the method further includes: The electronic device determines that the current version number of the operating system is the first version; The electronic device determines that the first version is a specified version or determines that a release time of the first version is later than the specified version.

11. The method according to any one of claims 1 to 4, characterized in that: Before the electronic device writes the program files of the one or more target applications in the user data partition, the method further includes: Displaying a first prompt window, wherein the first prompt window includes a first control and corresponding prompt information, wherein the prompt information corresponding to the first control indicates that the operating system is upgraded to a first version of the operating system and that the pre-installed application is retained; It is detected that the user clicks the first control.

12. An electronic device, characterized in that: The electronic device comprises: a processor and a memory, wherein the memory is used to store computer instructions. When the processor executes the computer instructions, the electronic device executes the method as claimed in any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a computer program or instructions. When the computer program or instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data processing method, data processing device and vehicle-mounted terminal

    CN112099819A

  • Operation system upgrading method and device, storage medium and computer program product

    CN115729586A