System upgrading method, electronic equipment and computer readable medium

By retaining intermediate data in the system upgrade method, the problem that the terminal device cannot be turned on and run in the virtual AB upgrade solution is solved, and the system repair and continuous upgrade are realized, ensuring the normal user experience.

CN119440564APending Publication Date: 2025-02-14ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310948538.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

During the system upgrade process, the virtual AB upgrade solution may cause serious problems such as terminal equipment not being turned on and running, users being unable to use, and the intermediate data cannot be upgraded again and the terminal cannot be repaired.

Method used

Provide a system upgrade method, by parsing the upgrade files required for this round of upgrades, obtaining intermediate data, and saving them in memory. Even after the system upgrade is successful, the intermediate data is not deleted, but is retained in the system partition. If the upgraded system has a startup exception, you can use the retained intermediate data to upgrade the system again to achieve system repair.

Benefits of technology

By retaining intermediate data, the problem of possible startup abnormalities in the system after upgrading is solved, and the system is repaired and continuous upgrades are achieved, avoiding serious problems such as the device being unable to boot and users being unable to use it.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440564A_ABST
    Figure CN119440564A_ABST
Patent Text Reader

Abstract

The invention provides a system upgrading method, which comprises the following steps of: analyzing an upgrading file required by the round of upgrading to obtain intermediate data required by the round of upgrading; storing intermediate data required by the round of upgrading in a memory; the system is upgraded according to the intermediate data needed by the round of upgrading to obtain a system of a target version, and after the system of the target version is obtained, the intermediate data needed by the round of upgrading is reserved in the memory. The invention further provides electronic equipment and a computer readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a system upgrade method, an electronic device, and a computer-readable medium. Background Art

[0002] At present, the Android system adopts a virtual AB upgrade solution for the differential upgrade function of Over-the-Air Technology (OTA) technology in order to take into account the purpose of background silent upgrade and system partition occupying as little storage space as possible.

[0003] However, the use of the AB upgrade solution may sometimes lead to serious problems such as the upgraded terminal device being unable to boot and operate and users being unable to use it. Summary of the invention

[0004] Embodiments of the present disclosure provide a system upgrade method, an electronic device, and a computer-readable medium.

[0005] As a first aspect of the present disclosure, a system upgrade method is provided, comprising: parsing an upgrade file required for a current round of upgrade to obtain intermediate data required for the current round of upgrade; storing the intermediate data required for the current round of upgrade in a memory; upgrading the system according to the intermediate data required for the current round of upgrade to obtain a target version of the system, wherein after obtaining the target version of the system, the intermediate data required for the current round of upgrade is retained in the memory.

[0006] As a second aspect of the present disclosure, there is provided an electronic device, comprising: one or more processors;

[0007] A memory having an executable program stored thereon, wherein the one or more processors call the executable program to implement the system upgrade method described in the first aspect.

[0008] As a third aspect of the present disclosure, a computer-readable medium is provided, on which an executable program is stored, and when the executable program is called, the system upgrade method described in the first aspect can be implemented.

[0009] In the system upgrade method provided by the embodiment of the present disclosure, after obtaining the upgrade file required for the current round of upgrade, the file is first parsed to obtain the intermediate data required for the current round of upgrade, and after the system is upgraded according to the intermediate data required for the current round of upgrade, the intermediate data required for the current round of upgrade is not deleted, but retained in the system partition. If the upgraded system (i.e., the target version of the system) has a startup abnormality, the system can be upgraded again using the retained intermediate data to achieve system repair. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flowchart of an implementation method of the system upgrade method provided by the present disclosure;

[0011] Figure 2 It is a flowchart of another implementation method of the system upgrade method provided by the present disclosure;

[0012] Figure 3 is a flowchart of an implementation method of step S120;

[0013] Figure 4 It is a flowchart of another implementation method of the system upgrade method provided by the present disclosure;

[0014] Figure 5 It is a flowchart of an implementation method of a memory partitioning method;

[0015] Figure 6 It is a schematic diagram of a module for showing an implementation method of system partitions and user partitions;

[0016] Figure 7 It is a schematic diagram of a module for illustrating an implementation method of a system partition and a user partition in the related art, wherein the system partition does not have an extended metadata partition;

[0017] Figure 8 It is a schematic diagram of a module for illustrating an implementation method of a system partition and a user partition provided by the present disclosure, wherein an extended metadata partition is set for the system partition;

[0018] Fig. 9 is a schematic diagram of a module of an electronic device provided by the present disclosure;

[0019] Fig.10 is a schematic diagram of a computer-readable medium provided by the present disclosure. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the system upgrade method, electronic device, and computer-readable medium provided by the present disclosure are described in detail below with reference to the accompanying drawings.

[0021] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.

[0022] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0023] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0024] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.

[0025] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.

[0026] The characteristics of the virtual AB upgrade solution are mainly reflected in the following four aspects: (1) Partitions that occupy a small amount of storage space, such as boot and kernel partitions, are upgraded repeatedly using the A / B ping-pong mechanism; (2) The system partition has a large miscellaneous storage space and adopts a single partition mechanism. At the same time, this partition reserves some free areas for the growth of the system partition; (3) The intermediate data during the OTA upgrade process is temporarily stored in the free area of ​​the system partition or in the user space, and then the intermediate data is differentially calculated with the system partition data and written to the corresponding position of the system partition; (4) During the upgrade, the mapping relationship of the intermediate data of the user partition on the disk is saved in the metadata partition. After the upgrade is completed, the mapping relationship of the metadata partition is cleared and the intermediate data file is deleted.

[0027] Since the system partition uses a single partition and has no A / B ping-pong mechanism, if data abnormalities occur in the partition during the upgrade process, the system partition will be damaged, causing the terminal device to be unable to boot and run. If the intermediate data is deleted, it is impossible to upgrade again and the terminal cannot be repaired.

[0028] In view of this, as a first aspect of the present disclosure, a system upgrade method is provided, such as Figure 1 As shown, the system upgrade method includes:

[0029] In step S110, the upgrade file required for this round of upgrade is parsed to obtain the intermediate data required for this round of upgrade;

[0030] In step S120, the intermediate data required for this round of upgrade is stored in the memory;

[0031] In step S130, the system is upgraded according to the intermediate data required for this round of upgrade to obtain the target version of the system.

[0032] After obtaining the target version of the system, the intermediate data required for the current round of upgrade is still retained in the memory.

[0033] In the system upgrade method provided by the embodiment of the present disclosure, after obtaining the upgrade file required for the current round of upgrade, the file is first parsed to obtain the intermediate data required for the current round of upgrade, and after the system is upgraded according to the intermediate data required for the current round of upgrade, the intermediate data required for the current round of upgrade is not deleted, but retained in the system partition. If the upgraded system (i.e., the target version of the system) has a startup abnormality, the system can be upgraded again using the retained intermediate data to achieve system repair.

[0034] It should be pointed out that for system files, there are both identical parts and different parts between the two versions. The "intermediate data" here refers to the difference file between the current version of the system file and the target version of the system file, which is often called "differential data". When upgrading the current version of the system file, in order to improve the upgrade efficiency, only the parts that are different between the current version and the target version can be upgraded. During the upgrade, the intermediate data needs to be written into the corresponding physical memory to complete the corresponding upgrade.

[0035] In the disclosed embodiment, a "round" of upgrades may include one upgrade or multiple upgrades, and the upgrades performed before obtaining the upgrade file corresponding to the new version of the system all belong to the same round of upgrades. Moreover, each upgrade is performed using the "intermediate data required for this round of upgrades".

[0036] For example, the version number of the currently running system is V1.0, and this round of upgrade is to upgrade the system to the system with version number V1.1, and the next version of the system with version number V1.1 is the system with version number V1.2. After receiving the upgrade file corresponding to the system with version number V1.1, if the upgrade file corresponding to the system with version number V1.2 is not received, each system upgrade performed belongs to the same round of "upgrade".

[0037] In order to facilitate repairing the system, in an exemplary embodiment, Figure 2 As shown, the system upgrade method also includes:

[0038] In step S140, when the target version of the system is abnormal, the step of upgrading the system according to the intermediate data required for the current round of upgrade is performed again.

[0039] It is easy to understand that in the same round of upgrades, the systems obtained by different upgrades are all target version systems.

[0040] In the present disclosure, the storage location of the intermediate data required for this round of upgrade in the memory is usually not specifically limited. Generally, the memory may include a system partition and a user partition. If the storage space of the free part of the system partition is sufficient, all the intermediate data required for this round of upgrade can be stored in the storage space of the free part of the system partition.

[0041] As another optional implementation, Figure 3 As shown, the memory may also include a metadata partition and an extended metadata partition. The storing of the intermediate data required for the current round of upgrade in the memory includes:

[0042] In step S121, when the size of the intermediate data required for the current round of upgrade exceeds the storage space size of the free part of the system partition, a first part of the intermediate data required for the current round of upgrade is stored in the free part of the system partition, and a second part of the intermediate data required for the current round of upgrade except the first part is stored in the user partition, wherein the size of the first part does not exceed the storage space size of the free part of the system partition;

[0043] In step S122, a mapping relationship between the physical block address of the user partition storing the second part of the intermediate data required for this round of upgrade and the second part of the intermediate data required for this round of upgrade is stored in the metadata partition and the extended metadata partition.

[0044] Since there is no super block in the user partition, when the second part of the intermediate data required for the current round of upgrade is stored in the user partition, it is necessary to establish a mapping relationship between the physical block address of the user partition storing the second part of the intermediate data required for the current round of upgrade and the second part of the intermediate data required for the current round of upgrade. Through the mapping relationship, the second part of the intermediate data required for the upgrade can be obtained in the user partition.

[0045] After the upgrade is completed, the mapping relationship in the metadata partition needs to be deleted. In other words, "deleting the mapping relationship in the metadata partition" indicates that the first upgrade in this round of upgrade is completed. The mapping relationship stored in the extended metadata partition is equivalent to backing up the mapping relationship in the "metadata partition".

[0046] In order to facilitate backing up the mapping relationship, in an exemplary implementation, the size of the metadata partition is the same as the size of the extended metadata partition, and the format of the metadata partition is the same as the format of the extended metadata partition.

[0047] In the present disclosure, there is no special limitation on the timing of storing the mapping relationship in the extended metadata partition. As an optional implementation, the mapping relationship can be written into the extended metadata partition at the same time as the mapping relationship is written into the metadata partition; as another optional implementation, the mapping relationship can be written into the extended metadata partition after the mapping relationship is written into the metadata partition.

[0048] Accordingly, if Figure 4 As shown, after the step of upgrading the system according to the intermediate data required for the current round of upgrading is performed for the first time in the current round of upgrading, the system upgrading method further includes:

[0049] In step S150, the mapping relationship in the metadata partition is deleted.

[0050] Accordingly, the step of re-performing the step of upgrading the system according to the intermediate data required for the current round of upgrading includes:

[0051] In step S141, the second part of the intermediate data required for the current round of upgrade stored in the user partition is determined according to the mapping relationship stored in the extended metadata partition;

[0052] In step S142, the system is upgraded according to the first part of the intermediate data required for the current round of upgrade stored in the system partition and the second part of the intermediate data required for the current round of upgrade stored in the user partition.

[0053] In order to save storage space, the upgrade files required for this upgrade can be retained until the next upgrade. In other words, when upgrading locally, delete the intermediate data required for the previous upgrade. Figure 4 As shown, before step S110, the system upgrade method may further include:

[0054] In step S102, the upgrade files required for this round of upgrade are obtained;

[0055] In step S104, the intermediate data corresponding to the version before the current round of upgrade is deleted.

[0056] It should be explained that the "version before this round of upgrade" is the version that is running before receiving the upgrade file required for this round of upgrade. It can also be called the "current version".

[0057] As described above, the system is upgraded using a virtual AB upgrade solution. That is, the memory of the current electronic device includes a first static partition, a second static partition, a metadata partition, an extended metadata partition, a system partition, and a user partition. Among them, the first static partition stores the current version of the system data. During the system upgrade process, the system operation is not stopped. That is, the system upgrade method also includes:

[0058] The current version of the system data stored in the first static storage area is run.

[0059] Correspondingly, in the step of upgrading the system according to the intermediate data required for this round of upgrading, the system data stored in the second static storage area is upgraded.

[0060] As described above, in the case where the target version of the system is abnormal, the step of upgrading the system according to the intermediate data required for the current round of upgrade is performed again.

[0061] In the present disclosure, there is no special limitation on how to determine whether the target version of the system is abnormal. As an optional implementation, as long as the target version of the system cannot operate normally, the target version of the system can be considered to be abnormal.

[0062] Of course, after the target version in the second static storage area is upgraded, the system may not be able to run due to unstable data in the storage, and restarting the system can solve this problem.

[0063] If the upgrade data is abnormal and causes damage to the super partition (also known as the dynamic partition), this abnormality cannot be solved by restarting, and can only be solved by re-upgrading the system. In other words, this abnormality can be the abnormality identified in step S140. Accordingly, after storing the target version of the data in the second static storage area, the system upgrade method further includes:

[0064] Running the target version of the system stored in the second static storage area;

[0065] In the case where the target version of the system cannot be run, setting the startup flag bit;

[0066] Restarting the target version of the system in the second static storage area;

[0067] When the startup flag is set, it is determined that the system of the target version is abnormal.

[0068] If the boot flag is not set after restarting the system, the normal boot process will be entered.

[0069] If the startup mark is set, it is determined that the system of the target version is abnormal, and the step of upgrading according to the intermediate data needs to be re-executed.

[0070] In the present disclosure, the electronic device may periodically send a detection signal to the server to determine whether an upgrade file of a new system version appears, and if an upgrade file of a new system version appears, the upgrade file is acquired.

[0071] Combine the following Figure 5 and Figure 6 An exemplary description is given of an implementation of the system upgrade method provided in the present disclosure.

[0072] like Figure 5 As shown, the memory of the electronic device includes a first static partition, a second static partition, a metadata partition, an extended metadata partition, a system partition, and a user partition. The first static partition includes a boot partition A and a subsystem partition A, and the second static partition includes a boot partition B and a subsystem partition B.

[0073] When an OTA upgrade is triggered, obtain the upgrade files required for this round of upgrade.

[0074] Parse the upgrade files required for this round of upgrade to obtain the copy on write (cow) files carrying the intermediate data required for this round of upgrade, wherein the cow files also record the addresses of the specific physical blocks of the intermediate data (i.e., differential data) in the system partition. If the free area of ​​the system partition cannot save all cow files, the cow files that cannot be accommodated by the system partition are saved in the user partition (that is, the cow files of the first part are stored in the system partition, and the cow files of the second part are stored in the user partition, wherein the storage space required for the cow files of the first part does not exceed the storage space of the free part of the system partition), and store the mapping relationship between the cow files of the second part and the physical block addresses of the cow files of the second part stored in the user partition in the metadata partition.

[0075] like Figure 6As shown in the figure, according to the actual situation, the system partition is further divided into the logical partition system, the logical partition vendor, and the logical partition product. After the sizes of these three partitions are set according to the system requirements, the remaining part is the free area of ​​the system partition. The cow file generated for the logical partition system is system_cow.img, the cow file generated for the logical partition vendor is vendor_cow.img, and the file generated for the logical partition product is product_cow.img. Similarly, saving the cow file in the user partition also generates the cow file of the corresponding logical partition.

[0076] After completing the parsing of the upgrade files required for this round of upgrade, the block address of the cow file stored in the user partition in the physical memory is also recorded in the metadata partition. After the mapping relationship between the block address in the metadata partition and the cow file is fully established, the data in the metadata partition is backed up to the extended metadata partition.

[0077] After the system restarts, it starts in snapshot mode. When the startup is complete, the corresponding block data in the cow file will be written to the corresponding logical partition in the system partition. At the same time, the cow file content will not be changed during the upgrade process and will not be deleted after the upgrade is completed.

[0078] If data anomalies occur during the system upgrade process or after the upgrade, the system cannot start normally due to damage to the logical partition data in the system partition, the system can be booted into recovery mode because the boot partition and each sub-partition adopt the AB ping-pong mechanism. In this mode, the cow file in the free area of ​​the system partition is first read, and the differential data of the cow file is forced to be written to the corresponding physical block to which the corresponding logical partition belongs; secondly, since the extended metadata partition records the block address of the cow file in the user partition in the physical memory, the cow file of the user partition is read according to the mapping relationship in the extended metadata partition and the differential data is written to the corresponding block of the physical memory to complete the re-upgrade operation of the system partition.

[0079] Combine the following Figure 7 and Figure 8 Another embodiment of the present disclosure is explained and described.

[0080] The method provided in this embodiment is executed by an electronic device with a virtual AB system. According to the requirements, the storage of the electronic device can be divided into a boot partition, a kernel partition, a subsystem partition, a dynamic partition, a user partition, a metadata partition, and an accompanying readable and writable partition or a read-only partition. Among them, the boot partition can be specifically a preloader partition; the kernel partition can be specifically a boot partition and a dtbo partition; each subsystem partition can be specifically a tee partition of a trusted OS, a pm partition of a power management subsystem, etc.; a modem partition related to a mobile network, and a dynamic partition can be specifically a super partition. At the same time, the super partition can be further divided into logical partitions system, logical partition vendor, logical partition product, and logical partition system_ext, etc. according to the time size. The total size of the logical partition system, logical partition vendor, logical partition product and logical partition system_ext shall not exceed the size of the super partition. In addition to the logical partition system, logical partition vendor, logical partition product and logical partition system_ext, the super partition can further reserve some free areas, so that the logical partitions added in the super after the upgrade can be dynamically divided from the free areas. Usually, the free areas can be set to occupy 5% to 25% of the super partition space; the user partition can be the userdata partition, the metadata partition can be the metadata partition, and the accompanying read-write partitions can be the misc partition, vbmeta partition vbmeta_system partition, vbmeta_vendor partition, vbmeta_product partition and vbmeta_system_ext partition. The boot and subsystem partitions and some accompanying partitions can be configured as two parts, AB.

[0081] The storage also includes an extended metadata partition, which is used as a backup of the current metadata partition. The size and format of the extended metadata partition are consistent with those of the metadata partition. The backup is triggered after the metadata partition establishes the mapping relationship between the intermediate data and the user partition, or its mapping data is synchronized to the extended metadata partition in real time during the mapping relationship establishment process. The extended metadata partition can be a metadata_ext partition, and its size and format are consistent with those of the metadata partition.

[0082] Each partition in the device stores the device system software version file. When the system starts, it boots with partition A, and loads preloader_a, tee_a, pm_a, boot_a, dtbo_a, and the super partition according to slot_a, and loads user data related to the userdata partition; it boots with partition B, and loads preloader_b, tee_b, pm_b, boot_b, dtbo_b, and the super partition according to slot_b, and loads user data related to the userdata partition. In this implementation, when the system starts, it starts with partition A.

[0083] Since the system needs to continuously solve existing problems of the current version of the software, it will be continuously updated iteratively. The upgrade work will be started by interacting with the server to detect whether there is a new image version. If there is an upgrade file corresponding to the corresponding new version of the system on the server side, the download and upgrade operation will be started. For the sake of convenience, the software currently running on the device is called the original software version, and the software version to be upgraded is called the target software version.

[0084] Download the corresponding new version software upgrade package according to the server's configuration address and save it in the user partition such as the userdata partition.

[0085] The system parses the differential data in the target version upgrade package stored in the user partition, upgrades the boot partition, subsystem partition and kernel partition, and generates the target version data using the data in preloader_a, tee_a, pm_a, boot_a, dtbo_a and the differential data of the corresponding partitions in the target version upgrade package, and writes it into preloader_b, tee_b, pm_b, boot_b and dtbo_b.

[0086] The system parses the differential data according to the target version upgrade package stored in the user partition, generates the intermediate differential data of the target version corresponding to each logical partition in the super partition, and generates the operation sequence corresponding to the differential data and the specific block address in each logical partition corresponding to the differential data. These data are stored in the free area of ​​the super partition as system_b_cow.img, vendor_b_cow.img, product_b_cow.img, and system_ext_cow.img. When the free area in the super partition is not enough to store all cow files, the differential data of the extra cow files are stored in the userdata partition, and the specific block address and mapping relationship of the differential data in the userdata partition are stored in the metadata partition. At the same time, the specific block address and mapping relationship of the differential data in the userdata partition are synchronously backed up and stored in the metadata_ext partition.

[0087] According to the mapping relationship recorded in system_b_cow.img, vendor_b_cow.img, product_b_cow.img, system_ext_cow.img or metadata, the snapshot file of the target version is generated together with system, vendor, product, and system_ext in the super partition. At the same time, the boot partitions, subsystem partitions, and kernel partitions are switched to start from the B partition.

[0088] The device starts from the preloader_b, tee_b, pm_b, boot_b, and dtbo_b partitions according to the settings, and loads the snapshot file of the target version generated in the previous step and the user partition related data to complete the startup and then update the dynamic partition. The system reads system_b_cow.img, vendor_b_cow.img, product_b_cow.img, and system_ext_cow.img, or reads the cow file in the userdata partition from the mapping relationship recorded in metadata_ext, and writes it to the physical block corresponding to system, vendor, product, and system_ext in the dynamic partition, completing the data merge operation from the current version to the target version of the dynamic partition, and deletes the mapping relationship between the cow file recorded in the metadata partition and the userdata partition. In addition, after the operation sequence is completed, keep system_b_cow.img, vendor_b_cow.img, product_b_cow.img, and system_ext_cow.img unchanged or not deleted. If part of the cow is saved in the userdata partition due to insufficient free space in the super partition, after the data in the super partition is merged, this part of the cow data saved in the userdata partition will remain unchanged and not deleted. The mapping relationship of the cow files recorded in metadatax_ext in the userdata partition will not be modified or deleted until the next upgrade.

[0089] When the system cannot be started due to abnormal upgrade data or damage to the super partition caused by unstable data in the memory, first set the boot mark bit record and then restart the system.

[0090] After the system starts, it determines whether the boot flag is set. If not, it enters the normal boot process. If it is set, it reads system_b_cow.img, vendor_b_cow.img, product_b_cow.img, system_ext_cow.img, or reads the cow file in the userdata partition from the mapping relationship recorded in metadata_ext, and forcibly writes the differential block data stored in it to the physical block corresponding to system, vendor, product, and system_ext in the dynamic partition. After completion, the system is restarted with the B partition.

[0091] As a second aspect of the present disclosure, an electronic device is provided, such as Fig. 9 As shown, the electronic device includes:

[0092] One or more processors 101;

[0093] The memory 102 stores an executable program, and the one or more processors 101 call the executable program to implement the system upgrade method provided in the first aspect of the present disclosure.

[0094] In an exemplary embodiment, the power control module may further include one or more I / O interfaces 103 connected between the processor 101 and the memory 102 and configured to implement information exchange between the processor and the memory.

[0095] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 103 is connected between the processor 601 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus), etc.

[0096] In the present disclosure, the memory may be built in the electronic device, or may be connected to the electronic device in other ways.

[0097] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.

[0098] In the present disclosure, the memory includes a user partition, a system partition, a metadata partition, and an extended metadata partition.

[0099] The system partition is used to store the first part of the intermediate data required for this round of upgrade, and the size of the first part does not exceed the storage space size of the free part of the system partition;

[0100] The user partition is used to store a second part of the intermediate data required for this round of upgrade except the first part;

[0101] The metadata partition and the extended metadata partition are both used to store the mapping relationship between the physical block address of the user partition of the second part of the intermediate data required for this round of upgrade and the second part of the intermediate data required for this round of upgrade.

[0102] In an exemplary implementation, the size of the metadata partition is the same as the size of the extended metadata partition, and the format of the metadata partition is the same as the format of the extended metadata partition.

[0103] As a third aspect of the present disclosure, Fig.10 As shown, a computer-readable storage medium is provided, on which an executable program is stored. When the executable program is called, the above-mentioned power control method provided in the first aspect of the present disclosure can be implemented.

[0104] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0105] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A system upgrade method, comprising: Parse the upgrade files required for this round of upgrade to obtain the intermediate data required for this round of upgrade; The intermediate data required for this round of upgrade is stored in the memory; The system is upgraded according to the intermediate data required for this round of upgrade to obtain a target version of the system, wherein after obtaining the target version of the system, the intermediate data required for this round of upgrade is still retained in the memory.

2. The system upgrade method according to claim 1, wherein: The memory includes a user partition, a system partition, a metadata partition and an extended metadata partition, and the intermediate data required for the current round of upgrade is stored in the memory, including: When the size of the intermediate data required for the current round of upgrade exceeds the storage space size of the free part of the system partition, a first part of the intermediate data required for the current round of upgrade is stored in the free part of the system partition, and a second part of the intermediate data required for the current round of upgrade except the first part is stored in the user partition, wherein the size of the first part does not exceed the storage space size of the free part of the system partition; The mapping relationship between the physical block address of the user partition storing the second part of the intermediate data required for the current round of upgrade and the second part of the intermediate data required for the current round of upgrade is stored in the metadata partition and the extended metadata partition; The system upgrade method further includes: In the case where the target version of the system is abnormal, the step of upgrading the system according to the intermediate data required for the current round of upgrade is performed again.

3. The system upgrade method according to claim 2, wherein: The size of the metadata partition is the same as that of the extended metadata partition, and the format of the metadata partition is the same as that of the extended metadata partition.

4. The system upgrade method according to claim 2, wherein: After the step of upgrading the system according to the intermediate data required for the current round of upgrading is performed for the first time in the current round of upgrading, the system upgrading method further includes: Deleting the mapping relationship in the metadata partition; The step of re-performing the system upgrade according to the intermediate data required for the current round of upgrade includes: Determine, according to the mapping relationship stored in the extended metadata partition, a second part of the intermediate data required for the current round of upgrade stored in the user partition; The system is upgraded according to the first part of the intermediate data required for the current round of upgrade stored in the system partition and the second part of the intermediate data required for the current round of upgrade stored in the user partition.

5. The system upgrade method according to any one of claims 1 to 4, wherein: Before parsing the upgrade files required for this round, the system upgrade method further includes: Get the upgrade files required for this round of upgrade; Delete the intermediate data corresponding to the version before this round of upgrade.

6. The system upgrade method according to any one of claims 1 to 4, wherein: The storage space of the current electronic device includes a first static partition, a second static partition, a metadata partition, an extended metadata partition, a system partition and a user partition; The system upgrade method further includes: Running the current version of system data stored in the first static storage area; In the step of upgrading the system according to the intermediate data required for this round of upgrading, the system data stored in the second static storage area is upgraded.

7. The system upgrade method according to claim 6, wherein: The step of upgrading the current version of the system data stored in the second static storage area includes: Generate target version data using the current version data in the first static storage area and the intermediate data required for this round of upgrade; The target version of data is stored in the second static storage area.

8. The system upgrade method according to claim 7, wherein: After storing the target version of data in the second static storage area, the system upgrade method further includes: Running the target version of the system stored in the second static storage area; In the case where the target version of the system cannot be run, setting the startup flag bit; Restarting the target version of the system in the second static storage area; When the startup flag is set, it is determined that the system of the target version is abnormal.

9. An electronic device, comprising: one or more processors; A memory having an executable program stored thereon, wherein the one or more processors call the executable program to implement the system upgrade method described in any one of claims 1 to 8.

10. The electronic device according to claim 9, wherein: The memory includes a user partition, a system partition, a metadata partition and an extended metadata partition. The system partition is used to store the first part of the intermediate data required for this round of upgrade, and the size of the first part does not exceed the storage space size of the free part of the system partition; The user partition is used to store a second part of the intermediate data required for this round of upgrade except the first part; The metadata partition and the extended metadata partition are both used to store the mapping relationship between the physical block address of the user partition of the second part of the intermediate data required for this round of upgrade and the second part of the intermediate data required for this round of upgrade.

11. The electronic device according to claim 10, wherein: The size of the metadata partition is the same as that of the extended metadata partition, and the format of the metadata partition is the same as that of the extended metadata partition.

12. A computer-readable medium having an executable program stored thereon, which can implement the system upgrade method according to any one of claims 1 to 8 when the executable program is called.