Firmware upgrading method, electronic equipment and storage medium

By using dual system upgrade packages and engines in Android systems, the problem that the A/B upgrade method is not compatible with non-A/B partition firmware is solved, and the compatibility and upgrade reliability of A/B and non-A/B partition firmware is achieved.

CN119960783AActive Publication Date: 2025-05-09FUZHOU ROCKCHIP SEMICON

Patent Information

Application Number
CN202411774685.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-05-09
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

In the existing Android system, the A/B upgrade method cannot be compatible with non-A/B partition firmware, and when there is a dependency between the A/B partition firmware and the non-A/B partition firmware, it is easy to cause upgrade exceptions and system crashes, destroying the reliability of A/B upgrades.

Method used

By obtaining the dual system upgrade package, calling the dual system upgrade engine for dual system upgrade, restarting the system after the upgrade is completed, and restoring or upgrading the non-A/B partitioned firmware in the boot bootloader firmware to ensure compatibility and reliability.

Benefits of technology

Compatibility between A/B partition firmware and non-A/B partition firmware is achieved, avoiding the system's inability to boot due to incompatibility with old non-A/B firmware, and ensuring the reliability of firmware upgrades, especially when there is a dependency coupling relationship.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119960783A_ABST
    Figure CN119960783A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware upgrading method, electronic equipment and a storage medium. The method comprises the steps that after A / B upgrading is completed, a system is restarted, bootstrap bootstrap firmware after upgrading is guided, and if a current bootstrap slot is equal to slot information before upgrading and firmware in a non-A / B partition is different from firmware of the non-A / B partition corresponding to the slot before upgrading, the bootstrap bootstrap bootstrap firmware in the non-A / B partition is started. If the non-A / B partition firmware is not equal to the non-A / B partition firmware corresponding to the slot before upgrading and the current starting slot is not set as the successful starting mark, upgrading the non-A / B partition firmware when the non-A / B partition upgrading completion mark is not the preset non-A / B partition upgrading completion magic number, and if the non-A / B partition firmware is not equal to the non-A / B partition firmware corresponding to the slot before upgrading and the current starting slot is not set as the successful starting mark, upgrading the non-A / B partition firmware. According to the method, the Android system is normally guided to be started after the A / B partition firmware and the non-A / B partition firmware are started and the preset non-A / B partition upgrading finishing magic number is written into the guide communication partition, and the firmware upgrading reliability can still be guaranteed when the A / B partition firmware and the non-A / B partition firmware have the dependency coupling relation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of embedded devices, and in particular to a method for upgrading firmware, an electronic device and a storage medium. Background Art

[0002] There are two main firmware OTA (Over-the-Air) upgrade methods in the Android system, one is the recovery upgrade method, and the other is the A / B (dual system) upgrade method.

[0003] The recovery upgrade method in the Android system is also called the non-A / B upgrade method. When using this upgrade method, it is required that all firmware to be upgraded in the Android system have only one corresponding partition, such as boot.img firmware corresponds to the only boot partition, system.img firmware corresponds to the only system partition, and uboot.img firmware corresponds to the only uboot partition; when upgrading, the corresponding firmware is upgraded to the corresponding partition, such as upgrading the boot.img firmware to the boot partition.

[0004] When using the A / B upgrade method in the Android system, it is required that all firmware to be upgraded in the Android system must have two partitions, A and B, and exist in the form of suffixes _a and _b. For example, the boot.img firmware requires two partitions, boot_a and boot_b, and the uboot.img firmware requires two partitions, uboot_a and uboot_b. The firmware of all A partitions in the A / B system constitutes the A slot system of the A / B system, and the firmware of all B partitions in the A / B system constitutes the B slot system of the A / B system. When performing an A / B upgrade, if the device is currently running the A slot system, the firmware to be upgraded will be upgraded to the B slot, and vice versa. This A / B slot method can ensure the reliability of firmware upgrades in the Android system.

[0005] The current Android system's recovery upgrade method and A / B upgrade method are incompatible, which means that if the A / B upgrade method is used, all firmware to be upgraded in the Android system must have two partitions, A and B, with the suffixes _a and _b. However, in some scenarios, in order to save space, it is necessary to use A / B partitions for key partitions in the Android system, and non-key and large-space partitions in non-A / B form (such as resource partitions and parameter configuration partitions in some products). When performing OTA upgrades on such a system, the A / B upgrade in the Android system cannot upgrade non-A / B partition firmware.

[0006] The existing methods for supporting the upgrade of non-A / B firmware in the A / B system all require that there should be no dependency between the A / B partition firmware and the non-A / B partition firmware. If there is a dependency between the A / B partition firmware and the non-A / B partition firmware, it is easy to cause the system to crash due to an upgrade anomaly, thereby destroying the reliability of the A / B upgrade. For example, a certain A / B partition X (corresponding to X_a and X_b) has a dependency on a certain non-A / B partition Y in the system. When the A / B upgrade upgrades X from X_a to X_b, the system runs the X_b firmware after the A / B upgrade is completed. At this time, if the Y firmware in the non-A / B partition has not been upgraded (for example, the non-A / B firmware can only be upgraded after the A / B upgrade is completed, or the power is accidentally turned off and restarted during the upgrade of the non-A / B firmware), the X_b firmware will not match the dependent Y firmware, thereby causing the A / B system to crash, completely destroying the reliability of the A / B system and the upgrade. Summary of the invention

[0007] The present invention provides a method for upgrading firmware, an electronic device and a storage medium, which can ensure the reliability of firmware upgrading when a dependent coupling relationship exists between A / B partition firmware and non-A / B partition firmware.

[0008] In one aspect of the present invention, a method for upgrading firmware is provided. The method comprises: obtaining a dual-system upgrade package, the dual-system upgrade package comprising a reserved partition firmware image file, the reserved partition firmware image file comprising a non-dual-system partition image file to be upgraded; constructing upgrade metadata based on information associated with the non-dual-system partition image file, and writing the upgrade metadata to a preset location of a boot communication partition; calling a dual-system upgrade engine to perform a dual-system upgrade based on the dual-system upgrade package, and restarting the system after the upgrade is completed to boot the upgraded boot program firmware; in the boot program firmware, if the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-dual-system partition is the same as the pre-upgrade slot information, If the non-dual system partition firmware corresponding to the slot is different, the firmware in the non-dual system partition is restored to the non-dual system partition firmware corresponding to the slot before the upgrade; if the current boot slot is not equal to the pre-upgrade slot information in the upgrade metadata, and the current boot slot is not set to a successful boot mark, the non-dual system partition upgrade completion mark is read from the boot communication partition, if the non-dual system partition upgrade completion mark read is not a preset non-dual system partition upgrade completion magic number, the non-dual system partition firmware is upgraded, and the preset non-dual system partition upgrade completion magic number is written in the boot communication partition; and the Android system is normally booted according to the preset process.

[0009] In another aspect of the present invention, an electronic device is provided, comprising a memory configured to store an executable program and a processor configured to execute the program so that the electronic device executes the above-mentioned method for upgrading firmware.

[0010] In another aspect of the present invention, a computer readable medium is provided, wherein a computer program is stored on the medium, and the computer program is executed by a processor to implement the above-mentioned method for upgrading firmware.

[0011] According to the present invention, a dual-system upgrade engine is called to perform a dual-system upgrade based on an acquired dual-system upgrade package, and after the upgrade is completed, the system is restarted to boot the upgraded boot program firmware. In the boot program firmware, if the current boot slot is equal to the slot information before the upgrade, and the firmware in the non-dual-system partition is different from the non-dual-system partition firmware corresponding to the slot before the upgrade, then the firmware in the non-dual-system partition is restored to the non-dual-system partition firmware corresponding to the slot before the upgrade. If the current boot slot is not equal to the slot information before the upgrade in the upgrade metadata, and the current boot slot is not set to a successful boot mark, then when the non-dual-system partition upgrade completion mark read is not a preset non-dual-system partition upgrade completion magic number, the non-dual-system partition firmware is upgraded, and Write the preset magic number for completing the non-dual system partition upgrade in the boot communication partition, and boot the Android system normally according to the preset process. The boot program firmware will only boot the device into the upgraded Android system normally according to the preset process after the non-dual system firmware upgrade is completed. This can ensure the compatibility between the dual system firmware and the non-dual system firmware, and avoid the situation where the system cannot be started due to incompatibility between the upgraded dual system firmware and the old non-dual system firmware. When there is a dependent coupling relationship between the dual system partition firmware and the non-dual system partition firmware, the reliability of the firmware upgrade can still be guaranteed. Regardless of whether an exception occurs at any time during the upgrade of the dual system firmware or the non-dual system firmware, the reliability of the entire upgrade process can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 A flowchart of the method for upgrading firmware according to an embodiment of the present invention;

[0013] Figure 2 A schematic diagram of a flow chart of a method for upgrading firmware according to an embodiment of the present invention;

[0014] Figure 3 FIG. 4 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0015] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0016] In the prior art, the method of supporting the upgrading of non-A / B firmware in the A / B system requires that there should be no dependency between the A / B partition firmware and the non-A / B partition firmware. If there is a dependency between the A / B partition firmware and the non-A / B partition firmware, it is easy for an upgrade anomaly to cause the system to crash, thereby destroying the reliability of the A / B upgrade.

[0017] In order to solve at least the above technical problems, the present disclosure provides a method for upgrading firmware. According to the present disclosure, a dual-system upgrade engine is called to perform a dual-system upgrade based on an acquired dual-system upgrade package, and the system is restarted after the upgrade is completed to boot the upgraded boot program firmware. In the boot program firmware, if the current boot slot is equal to the slot information before the upgrade, and the firmware in the non-dual system partition is different from the non-dual system partition firmware corresponding to the slot before the upgrade, then the firmware in the non-dual system partition is restored to the non-dual system partition firmware corresponding to the slot before the upgrade, and if the current boot slot is not equal to the slot information before the upgrade in the upgrade metadata, and the current boot slot is not set to a successful boot mark, then when the non-dual system partition upgrade completion mark read is not the preset non-dual system partition upgrade completion magic number, the non-dual system partition firmware is upgraded, and the preset non-dual system partition upgrade completion magic number is written in the boot communication partition, and the Android system is normally booted according to the preset process. In this way, since the bootloader firmware can only boot the device into the upgraded Android system normally according to the preset process after the non-A / B firmware is upgraded, this can ensure the compatibility between the A / B firmware and the non-A / B firmware, and avoid the situation where the system cannot be started due to incompatibility between the upgraded A / B firmware and the old non-A / B firmware. When there is a dependent coupling relationship between the A / B partition firmware and the non-A / B partition firmware, the reliability of the firmware upgrade can still be guaranteed. Regardless of whether an abnormality occurs at any time during the upgrade of the A / B firmware or the non-A / B firmware, the reliability of the entire upgrade process can be guaranteed.

[0018] Hereinafter, the technical solution according to the present disclosure will be described with reference to specific embodiments and in conjunction with the accompanying drawings.

[0019] Figure 1 1 is a flowchart showing a method 100 for upgrading firmware according to an embodiment of the present disclosure. Figure 1 The method 100 includes the following steps 102 to 112.

[0020] In step 102, a dual-system upgrade package is obtained, wherein the dual-system upgrade package includes a reserved partition firmware image file, and the reserved partition firmware image file includes a non-dual-system partition image file to be upgraded.

[0021] In some embodiments, a configuration item of whether the boot program firmware supports the file system is obtained. If the configuration item indicates that the boot program firmware supports the file system, the reserved partition firmware image file with the preset file system is generated, and the reserved partition firmware image file contains all non-dual system partition image files to be upgraded under the preset directory structure, and for each non-dual system partition image file to be upgraded, the partition name corresponding to the image file is used as the prefix of the image file name. If the configuration item indicates that the boot program firmware does not support the file system, the reserved partition firmware image file without the preset file system is generated, and the reserved partition firmware image file is an original image file composed of a file header of a preset size and a file body of a preset structure, and the file body contains all non-dual system partition image file data to be upgraded. In this way, it can be seamlessly integrated with the existing Android A / B system upgrade process without any modification to the A / B upgrade engine itself in the Android system.

[0022] In step 104, upgrade metadata is constructed based on information associated with the non-dual system partition image file, and the upgrade metadata is written to a preset location of the boot communication partition.

[0023] In some embodiments, the method 100 may further include: a reserved partition (such as reserved_a and reserverd_b) corresponding to the reserved partition firmware image file is added in the partition table, and the reserved partition has a dual-system form, the reserved partition firmware image file is generated according to the configuration item of whether the boot program firmware supports the file system, and the reserved partition firmware image file is added to the dual-system upgrade package during the process of building the dual-system upgrade package. In some embodiments, the firmware in the reserved partition can be upgraded by the dual-system upgrade engine.

[0024] In some embodiments, before step 102, the method 100 may further include: clearing the non-dual system partition upgrade completion mark at a preset position in the boot communication partition; determining the upgrade metadata magic number, digital digest algorithm type, metadata digital digest value, upgrade instructions, reserved partition mirror type, pre-upgrade slot information and non-dual system partition mirror information list.

[0025] In some embodiments, the upgrade metadata is generated according to the upgrade metadata magic number, the digital digest algorithm type, the metadata digital digest value, the upgrade instruction, the reserved partition image type, the pre-upgrade slot information, and the non-dual system partition image information list. In this way, by clearing the non-A / B partition upgrade completion mark at a preset position in the boot communication partition, and generating upgrade metadata, subsequent upgrade processes can be performed.

[0026] In step 106, the dual system upgrade engine is called to perform dual system upgrade based on the dual system upgrade package, and after the upgrade is completed, the system is restarted to boot the upgraded boot program firmware.

[0027] In step 108, in the boot program firmware, if the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-dual system partition is different from the non-dual system partition firmware corresponding to the slot before the upgrade, then the firmware in the non-dual system partition is restored to the non-dual system partition firmware corresponding to the slot before the upgrade.

[0028] In some embodiments, if the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-dual system partition is different from the non-dual system partition firmware corresponding to the slot before the upgrade, then the non-dual system partition firmware corresponding to the slot before the upgrade is written to the corresponding non-dual system partition according to the current reserved partition and the reserved partition image type of the upgrade metadata, and the upgrade metadata at a preset position in the boot communication partition is cleared.

[0029] In step 110, if the current boot slot is not equal to the pre-upgrade slot information in the upgrade metadata, and the current boot slot is not set to a successful boot mark (such as successful), then read the non-dual system partition upgrade completion mark from the boot communication partition, and if the non-dual system partition upgrade completion mark read is not a preset non-dual system partition upgrade completion magic number, then upgrade the non-dual system partition firmware, and write the preset non-dual system partition upgrade completion magic number in the boot communication partition. In some embodiments, the non-dual system partition firmware corresponding to the current boot slot is written to the corresponding non-dual system partition according to the current reserved partition and the reserved partition image type of the upgrade metadata.

[0030] In step 112, the Android system is normally booted according to the preset process.

[0031] In some embodiments, before step 108, the method 100 may further include: checking the legality of the upgrade metadata in the preset position of the boot communication partition, and if the check result is illegal, booting the Android system normally according to the preset process. In some embodiments, the upgrade metadata is read from the preset position of the boot communication partition, and it is determined whether the upgrade metadata magic number of the upgrade metadata is the preset upgrade metadata magic number. If not, it is determined that the check result is illegal. If so, the digital summary value of the data in the address space composed of the upgrade instruction, the reserved partition image type, the pre-upgrade slot information and the non-dual system partition image information list in the upgrade metadata is calculated according to the digital summary algorithm type of the upgrade metadata, and the calculated digital summary value is compared with the metadata digital summary value of the upgrade metadata. If the comparison result is inconsistent, it is determined that the check result is illegal. If the comparison result is consistent, it is determined whether the upgrade instruction in the upgrade metadata is a preset non-dual system partition image upgrade instruction. If it is not a preset non-dual system partition image upgrade instruction, it is determined that the check result is illegal. If it is a preset non-dual system partition image upgrade instruction, it is determined that the check result is legal.

[0032] In this way, the security of the entire upgrade process is ensured by checking the legitimacy of the upgrade metadata.

[0033] In some embodiments, before step 108, the method 100 may further include: reading the Android dual-system upgrade startup control information from the boot communication partition, and obtaining the current startup slot from the Android dual-system upgrade startup control information. In some embodiments, the method 100 may further include: if the current startup slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-dual system partition is the same as the non-dual system partition firmware corresponding to the slot before the upgrade, then clearing the upgrade metadata at the preset position in the boot communication partition, and booting the Android system normally according to the preset process.

[0034] In this way, if an accident occurs during the A / B firmware upgrade (such as power failure), since the A / B upgrade is not completed, the A / B upgrade engine in the Android system will not set the system to boot from the upgraded slot. When the system is powered on again, since in the boot program firmware, the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-A / B partition is the same as the non-A / B partition firmware corresponding to the slot before the upgrade, the upgrade metadata at the preset position in the boot communication partition is cleared at this time, and the Android system is booted normally according to the preset process. In this way, the upgrade can be restarted as needed after entering the Android system to ensure the reliability of the upgrade.

[0035] In some embodiments, the method 100 may further include: if the non-dual system partition upgrade completion mark read is a preset non-dual system partition upgrade completion magic number, then normally guiding the Android system to start according to a preset process.

[0036] In this way, if an accident occurs during the process of upgrading the non-A / B firmware (such as power failure), since the bootloader firmware itself is A / B and has been upgraded by the A / B upgrade engine before upgrading the non-A / B firmware, and the bootloader firmware starts upgrading the non-A / B partition firmware before accessing the content of the non-A / B partition firmware, the bootloader firmware will not crash due to the dependency between the bootloader firmware and the non-A / B partition firmware. After the system is powered on again, the bootloader firmware itself can always be started, so that the upgrade of the non-A / B firmware can continue after power is restarted; only after the non-A / B firmware is upgraded, the bootloader firmware will normally boot the device into the upgraded Android system according to the preset process, thereby ensuring the compatibility between the A / B firmware and the non-A / B firmware, and avoiding the situation where the system cannot be started due to incompatibility between the upgraded A / B firmware and the old non-A / B firmware.

[0037] In some embodiments, the method 100 may further include: if the current boot slot is not equal to the pre-upgrade slot information in the upgrade metadata, and the current boot slot has been set to a successful boot mark, then clearing the non-dual system partition upgrade completion mark and the upgrade metadata at a preset position in the boot communication partition, and booting the Android system normally according to the preset process.

[0038] In this way, if the upgrade is completed normally, but there is a problem with the upgraded A / B firmware itself, that is, the firmware slot after the upgrade is completed cannot be set as a successful startup mark by the A / B upgrade engine, then after the system restarts a preset number of times, the boot program firmware will be started according to the A / B upgrade specification to switch the current boot slot back to the slot before the upgrade, so that the old A / B firmware before the upgrade is used. At this time, the current boot slot is equal to the slot information before the upgrade, and the firmware in the non-A / B partition is different from the non-A / B partition firmware corresponding to the slot before the upgrade. According to the reserved partition image type of the current reserved partition and the upgrade metadata, the non-A / B partition firmware corresponding to the slot before the upgrade is written to the corresponding non-A / B partition, ensuring the compatibility between the A / B firmware and the non-A / B firmware, avoiding the situation where the system cannot be started due to the incompatibility between the old A / B firmware before the upgrade and the new non-A / B firmware, and finally clearing the upgrade metadata at the preset position in the boot communication partition, and booting the device normally according to the preset process to enter the Android system before the upgrade, and the upgrade can be restarted as needed after entering the Android system, effectively improving the reliability of the upgrade.

[0039] Hereinafter, application scenarios of the method and device for upgrading firmware according to embodiments of the present invention will be described by way of examples.

[0040] Figure 2 2 is a flowchart showing a method for upgrading firmware according to an embodiment of the present invention, including steps 201 to 215 .

[0041] In step 201, a reserved partition in A / B format (such as reserved_a and reserved_b) is added to the partition table. In some embodiments, the firmware in the reserved partition can be upgraded through an A / B upgrade engine.

[0042] In step 202, different types of reserved partition firmware image files are generated according to whether the boot program firmware supports the configuration item of the file system, which specifically includes the following steps (1) to (3).

[0043] (1) Obtain configuration items of whether the boot program firmware supports the file system.

[0044] (2) If the configuration item indicates that the boot program firmware supports the file system, a reserved partition firmware image file with a preset file system is generated. The reserved partition firmware image file contains all non-A / B partition image files to be upgraded under a preset directory structure, and for each non-A / B partition image file to be upgraded, the partition name corresponding to the image file is used as the prefix of the image file name.

[0045] For example, the prefix "param" of the non-A / B partition image file param.img to be upgraded is the partition name param corresponding to the non-A / B partition image file to be upgraded, that is, the image file name corresponding to the param partition is param.img.

[0046] (3) If the configuration item indicates that the boot program firmware does not support the file system, a reserved partition firmware image file without a preset file system is generated. The reserved partition firmware image file is an original image file consisting of a file header of a preset size and a file body of a preset structure. The file body contains all non-A / B partition image file data to be upgraded. The file header consists of a reserved image magic number, a digital summary algorithm type, an image file information digital summary, and an image file information item list. The image file information item list is a list consisting of image file information items, each image file information item consisting of an image name, an image data offset address, and an image data length. Specifically, the following steps (3-1) to (3-5) are included.

[0047] (3-1) Set the reserved image magic number to the preset reserved image magic number, and set the digital digest algorithm type to the preset digital digest algorithm type.

[0048] (3-2) For each non-A / B partition image file to be upgraded, first set the image file information item in the image file information item list, and then save the non-A / B partition image file data to the corresponding file body address space of the reserved partition firmware image file (i.e., the address space composed of the image data offset address and the image data length of the corresponding image file information item).

[0049] In some embodiments, setting the image file information item in the image file information item list includes:

[0050] The image name in the image file information item is set to the partition name corresponding to the non-A / B partition image file; the image data offset address in the image file information item is set to the starting position of the non-A / B partition image file data in the file body; the image data length in the image file information item is set to the size of the non-A / B partition image file.

[0051] (3-3) Calculate the digital summary of the image file information item list according to the digital summary algorithm type and use it as the digital summary of the image file information.

[0052] (3-4) Generate a file header of a reserved partition firmware image file without a preset file system according to the reserved image magic number, the digital digest algorithm type, the image file information digital digest and the image file information item list.

[0053] (3-5) All non-A / B partition image file data to be upgraded are converted into a file body of a reserved partition firmware image file without a preset file system.

[0054] In step 203, an A / B (dual system) upgrade package is constructed, and the reserved partition firmware image file is added to the A / B upgrade package. The A / B upgrade package includes the reserved partition firmware image file, and the reserved partition firmware image file includes the non-A / B partition image file to be upgraded.

[0055] In step 204, the non-A / B partition upgrade completion mark at a preset position in the boot communication partition is cleared.

[0056] In step 205, the upgrade metadata magic number, digital digest algorithm type, metadata digital digest value, upgrade instructions, reserved partition image type, pre-upgrade slot information and non-A / B partition image information list are determined. The non-A / B partition image information item list is a list composed of non-A / B partition image information items. The non-A / B partition image information item consists of an image name and an image digest value. Specifically, the following steps (1) to (9) are included.

[0057] (1) Set the upgrade metadata magic number to the preset upgrade metadata magic number.

[0058] (2) Set the digital digest algorithm type to the preset digital digest algorithm type.

[0059] (3) Set the upgrade command to the preset non-A / B partition image upgrade command.

[0060] (4) Obtain the current A / B slot information (i.e., the slot information before the upgrade, a or b), and save the current A / B slot information to the slot information before the upgrade.

[0061] (5) According to the current A / B slot information, the current A / B slot partition corresponding to the reserved partition is used as the current reserved partition (for example, if the current A / B slot information is a, reserved_a is the current reserved partition), and data of a preset size is read from the starting position of the current reserved partition as the image file header.

[0062] (6) Determine whether the reserved image magic number in the image file header is the preset reserved image magic number. If so, set the reserved partition image type to type one and execute step (7). If not, set the reserved partition image type to type two and execute step (8).

[0063] (7) Setting a non-A / B partition image information list according to the image file header specifically includes the following steps (7-1) to (7-2).

[0064] (7-1) Calculate the digital summary of the image file information item list in the image file header according to the digital summary algorithm type in the image file header, and compare the calculated digital summary with the digital summary of the image file information in the image file header. If they are inconsistent, an error message is displayed and the upgrade process is exited. If not, execute step (7-2).

[0065] (7-2) Traverse the list of image file information items in the image file header, and execute steps (7-2-1) to (7-2-4) for the traversed image file information items.

[0066] (7-2-1) Determine the non-A / B partition block device node (such as / dev / block / by-name / param) corresponding to the image name according to the image name of the corresponding image file information item (such as param); read all the contents of the determined corresponding non-A / B partition block device node as the corresponding image data; calculate the digital summary value of the corresponding image data according to the digital summary algorithm type of the upgraded metadata, and use the calculated digital summary value as the digital summary of the corresponding non-A / B partition image.

[0067] (7-2-2) According to the address space formed by the mirror data offset address and the mirror data length of the corresponding mirror file information item, read data of a size equal to the mirror data length of the corresponding mirror file information item from the mirror data offset address of the current reserved partition offset corresponding to the mirror file information item as the mirror file data; calculate the digital summary value of the mirror file data according to the digital summary algorithm type of the upgrade metadata, and compare the calculated digital summary value with the corresponding non-A / B partition mirror digital summary. If they are inconsistent, an error is prompted and the upgrade process is exited. If not, execute steps (7-2-3) to (7-2-4).

[0068] (7-2-3) Sequentially obtain the unused non-A / B partition image information items in the non-A / B partition image information list in the upgrade metadata as the current non-A / B partition image information items; set the image name of the current non-A / B partition image information item to the image name of the corresponding image file information item; set the image summary value of the current non-A / B partition image information item to the corresponding non-A / B partition image digital summary calculated above.

[0069] (7-2-4) If the corresponding image file information item is the last item in the image file information item list, execute step (9); otherwise, continue to traverse the next item in the image file information item list.

[0070] (8) Setting a non-A / B partition image information list according to all non-A / B partition image files to be upgraded under the reserved partition preset directory structure specifically includes the following steps (8-1) to (8-2).

[0071] (8-1) Mount the current reserved partition in read-only mode according to the preset file system type of the reserved partition firmware image file.

[0072] (8-2) Traverse all non-A / B partition image files to be upgraded under the preset directory structure of the current reserved partition, and for each non-A / B partition image file traversed, execute the following steps (8-2-1) to (8-2-4).

[0073] (8-2-1) Calculate the digital summary value of the corresponding non-A / B partition image file according to the digital summary algorithm type of the upgrade metadata, and use the calculated digital summary value as the digital summary of the image file.

[0074] (8-2-2) Determine the partition name of the non-A / B partition corresponding to the non-A / B partition image file according to the file name prefix of the corresponding non-A / B partition image file, and determine the non-A / B partition block device node corresponding to the non-A / B partition image file according to the partition name of the corresponding non-A / B partition.

[0075] Read all the contents of the determined corresponding non-A / B partition block device node as the corresponding non-A / B partition mirror data, and calculate the digital summary value of the non-A / B partition mirror data according to the digital summary algorithm type of the upgrade metadata, and compare the calculated digital summary value with the digital summary of the mirror file. If they are inconsistent, an error is prompted and the upgrade process is exited. If not, execute the following steps (8-2-3) to (8-2-4).

[0076] (8-2-3) Sequentially obtain the unused non-A / B partition image information items in the non-A / B partition image information list in the upgrade metadata as the current non-A / B partition image information items; set the image name of the current non-A / B partition image information item to the partition name of the corresponding non-A / B partition; set the image summary value of the current non-A / B partition image information item to the digital summary of the corresponding image file calculated above.

[0077] (8-2-4) If the non-A / B partition image file is the last non-A / B partition image file under the preset directory structure of the current reserved partition, execute step (9), otherwise continue to traverse the next non-A / B partition image file under the preset directory structure.

[0078] (9) Calculate the digital summary value of the data in the address space composed of the upgrade instruction, the reserved partition mirror type, the pre-upgrade slot information and the non-A / B partition mirror information list according to the digital summary algorithm type, and use the calculated digital summary value as the metadata digital summary value.

[0079] In step 206, the upgrade metadata is generated according to the upgrade metadata magic number, the digital digest algorithm type, the metadata digital digest value, the upgrade instruction, the reserved partition mirror type, the pre-upgrade slot information and the non-A / B partition mirror information list.

[0080] In step 207, the upgrade metadata is written to a preset location of the boot communication partition.

[0081] In step 208, the A / B upgrade engine is called to perform an A / B upgrade based on the A / B upgrade package. After the upgrade is completed, the system is restarted to boot the upgraded boot program firmware.

[0082] In step 209 , the legality of the upgrade metadata in the preset position of the boot communication partition is checked. If the check result is illegal, the Android system is normally booted according to the preset process. If the check result is legal, step 210 is executed.

[0083] In some embodiments, checking the legitimacy of the upgrade metadata in the preset location of the boot communication partition includes:

[0084] (1) Reading the upgrade metadata from a preset position of the boot communication partition, and determining whether the upgrade metadata magic number of the upgrade metadata is the preset upgrade metadata magic number; if not, determining that the check result is illegal; if so, calculating the digital summary value of the data in the address space consisting of the upgrade instruction, the reserved partition mirror type, the pre-upgrade slot information, and the non-A / B partition mirror information list in the upgrade metadata according to the digital summary algorithm type of the upgrade metadata.

[0085] (2) Compare the calculated digital digest value with the metadata digital digest value of the upgrade metadata. If the comparison result is inconsistent, determine that the check result is illegal. If the comparison result is consistent, determine whether the upgrade instruction in the upgrade metadata is a preset non-A / B partition image upgrade instruction. If it is not the preset non-A / B partition image upgrade instruction, determine that the check result is illegal. If it is the preset non-A / B partition image upgrade instruction, determine that the check result is legal.

[0086] In step 210, the Android A / B upgrade startup control information is read from the boot communication partition, and the current startup slot is obtained from the Android A / B upgrade startup control information.

[0087] In step 211, in the boot program firmware, determine whether the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata; if so, check whether the firmware in the non-A / B partition is the same as the non-A / B partition firmware corresponding to the slot before the upgrade. If they are the same, it means that the recovery is complete, then execute step 212; if they are not the same, execute step 213; if not, query whether the current boot slot has set the successful boot mark (such as successful) according to the Android A / B upgrade startup control information. If not, execute step 214; if it is set, execute step 215.

[0088] In step 212, the upgrade metadata at the preset location in the boot communication partition is cleared, and the Android system is normally booted according to the preset process.

[0089] In step 213, the non-A / B partition firmware corresponding to the slot before the upgrade is written to the corresponding non-A / B partition according to the reserved partition image type of the current reserved partition and the upgrade metadata; the upgrade metadata at the preset position in the boot communication partition is cleared, and the Android system is booted normally according to the preset process.

[0090] In some embodiments, it is checked whether the firmware in the non-A / B partition is the same as the non-A / B partition firmware corresponding to the slot before the upgrade. If they are the same, it means that the recovery is complete, and step 212 is executed. If they are not the same, step 213 is executed, which specifically includes the following steps (1) to (6).

[0091] (1) Set the recovery completion mark to completed.

[0092] (2) Traverse the non-A / B partition image information list in the upgrade metadata, and execute steps (2-1) to (2-2) for the traversed non-A / B partition image information items.

[0093] (2-1) Read all the data in the partition corresponding to the image name of the non-A / B partition image information item as the corresponding non-A / B partition image data, calculate the digital digest value of the non-A / B partition image data according to the digital digest algorithm type of the upgrade metadata, compare the calculated digital digest value with the image digest value of the non-A / B partition image information item, if they are inconsistent, set the recovery completion mark to incomplete, and execute the following step (3), otherwise, execute step (2-2).

[0094] (2-2) If the non-A / B partition mirror information item is the last item in the non-A / B partition mirror information list, execute step (3); otherwise, continue to traverse the next item in the non-A / B partition mirror information list.

[0095] (3) Determine whether the recovery completion mark is completed. If so, clear the upgrade metadata at the preset location in the boot communication partition and boot the Android system normally according to the preset process. If not, execute step (4).

[0096] (4) Determine whether the reserved partition image type of the upgrade metadata is type 1. If so, execute step (5); otherwise, execute step (6).

[0097] (5) Reading data of a preset size from the starting position of the current reserved partition as the image file header, and writing all non-A / B partition firmware data in the reserved partition to the corresponding non-A / B partition according to the image file information item list in the image file header, thereby restoring the firmware in the non-A / B partition to the non-A / B partition firmware corresponding to the slot before the upgrade, specifically including the following steps (5-1) to (5-2).

[0098] (5-1) Determine the current A / B slot partition corresponding to the reserved partition according to the pre-upgrade slot information in the upgrade metadata; use the current A / B slot partition corresponding to the determined reserved partition as the current reserved partition, for example, if the pre-upgrade slot information is a, then the current A / B slot partition corresponding to the determined reserved partition is reserved_a, and thus reserved_a is the current reserved partition; read data of a preset size from the starting position of the current reserved partition as the image file header, and determine whether the reserved image magic number in the image file header is the preset reserved image magic number, if so, execute the following step (5-2), otherwise execute step (6).

[0099] (5-2) Traverse the list of image file information items in the image file header, and execute steps (5-2-1) to (5-2-3) for the traversed image file information items.

[0100] (5-2-1) The partition name of the non-A / B partition to be upgraded is determined according to the image name of the image file information item, which is called the non-A / B partition to be restored.

[0101] (5-2-2) The current reserved partition is offset to the mirror data offset address of the corresponding mirror file information item, and then data with a size equal to the mirror data length of the mirror file information item is read as the mirror file data, and the read mirror file data is written to the non-A / B partition to be restored.

[0102] (5-2-3) If the image file information item is the last item in the image file information item list, clear the upgrade metadata at the preset location in the boot communication partition, and boot the Android system normally according to the preset process, otherwise continue to traverse the next item in the image file information item list.

[0103] (6) Mount the current reserved partition in read-only mode according to the preset file system type of the reserved partition firmware image file, and write all non-A / B partition image files to be upgraded under the preset directory structure of the current reserved partition to the corresponding non-A / B partition, thereby restoring the firmware in the non-A / B partition to the non-A / B partition firmware corresponding to the slot before the upgrade, specifically including steps (6-1) to (6-2).

[0104] (6-1) Determine the current A / B slot partition corresponding to the reserved partition according to the pre-upgrade slot information in the upgrade metadata; use the current A / B slot partition corresponding to the determined reserved partition as the current reserved partition, for example, if the pre-upgrade slot information is a, then the current A / B slot partition corresponding to the determined reserved partition is reserved_a, and thus reserved_a is the current reserved partition; mount the current reserved partition in read-only mode according to the preset file system type of the reserved partition firmware image file.

[0105] (6-2) Traverse all non-A / B partition image files to be upgraded under the preset directory structure of the current reserved partition, and execute steps (6-2-1) to (6-2-3) for the traversed non-A / B partition image files.

[0106] (6-2-1) The partition name of the non-A / B partition corresponding to the non-A / B partition image file is determined according to the file name prefix of the corresponding non-A / B partition image file, which is called the non-A / B partition to be restored.

[0107] (6-2-2) Read all data in the corresponding non-A / B partition image file as image file data, and write the read image file data to the non-A / B partition to be restored.

[0108] (6-2-3) If the non-A / B partition image file is the last non-A / B partition image file under the preset directory structure of the current reserved partition, clear the upgrade metadata at the preset location in the boot communication partition, and boot the Android system normally according to the preset process, otherwise continue to traverse the next non-A / B partition image file under the preset directory structure.

[0109] In step 214, a non-A / B partition upgrade completion mark is read from the boot communication partition; if the non-A / B partition upgrade completion mark read is not the preset non-A / B partition upgrade completion magic number, the non-A / B partition firmware corresponding to the current boot slot is written to the corresponding non-A / B partition according to the current reserved partition and the reserved partition image type of the upgrade metadata, and after the preset non-A / B partition upgrade completion magic number is written in the boot communication partition, the Android system is booted normally according to the preset process; if the non-A / B partition upgrade completion mark read is the preset non-A / B partition upgrade completion magic number, the Android system is booted normally according to the preset process.

[0110] In step 215, the non-A / B partition upgrade completion mark and the upgrade metadata at the preset position in the boot communication partition are cleared, and the Android system is normally booted according to the preset process.

[0111] In some embodiments, the Android A / B upgrade startup control information is used to query whether the current startup slot has set a successful startup flag (such as successful). If not, step 214 is executed; if it is set, step 215 is executed, which specifically includes steps (a) to (e).

[0112] (a) According to the Android A / B upgrade startup control information, query whether the current startup slot has set a successful startup mark (such as successful). If so, clear the non-A / B partition upgrade completion mark and upgrade metadata at the preset position in the boot communication partition, and boot the Android system normally according to the preset process. If not, execute step (b).

[0113] (b) Read the non-A / B partition upgrade completion mark from the preset position corresponding to the non-A / B partition upgrade completion mark preset in the boot communication partition, and determine whether the read non-A / B partition upgrade completion mark is the preset non-A / B partition upgrade completion magic number. If so, boot the Android system normally according to the preset process. If not, execute step (c).

[0114] (c) Determine whether the reserved partition image type of the upgrade metadata is type 1, if so, execute step (d), if not, execute step (e).

[0115] (d) Reading data of a preset size from the starting position of the current reserved partition as the image file header, writing all non-A / B partition firmware data in the reserved partition to the corresponding non-A / B partition according to the image file information item list in the image file header, thereby completing the upgrade of the non-A / B partition firmware, and writing a preset non-A / B partition upgrade completion magic number at a preset position in the boot communication partition, and booting the Android system normally according to the preset process, specifically including the following steps (d-1) to (d-2).

[0116] (d-1) Determine the current A / B slot partition corresponding to the reserved partition according to the current boot slot, and use the current A / B slot partition corresponding to the determined reserved partition as the current reserved partition. For example, if the current boot slot is a, the current A / B slot partition corresponding to the determined reserved partition is reserved_a, and thus reserved_a is the current reserved partition; read data of a preset size from the starting position of the current reserved partition as the image file header, and determine whether the reserved image magic number in the image file header is the preset reserved image magic number. If so, execute step (d-2), otherwise execute step (e).

[0117] (d-2) Traverse the list of image file information items in the image file header, and execute steps (d-2-1) to (d-2-3) for the traversed image file information items.

[0118] (d-2-1) Determine the partition name of the non-A / B partition to be upgraded according to the image name of the image file information item, which is called the non-A / B partition to be upgraded.

[0119] (d-2-2) Offset the current reserved partition to the image data offset address of the image file information item, read data with a size equal to the image data length of the image file information item as the image file data, and write the read image file data to the non-A / B partition to be upgraded.

[0120] (d-2-3) If the image file information item is the last item in the image file information item list, the preset non-A / B partition upgrade completion magic number is written to the preset position in the boot communication partition, and the Android system is booted normally according to the preset process, otherwise continue to traverse the next item in the image file information item list.

[0121] (e) Mount the current reserved partition in read-only mode according to the preset file system type of the reserved partition firmware image file, write all the non-A / B partition image files to be upgraded under the preset directory structure of the current reserved partition to the corresponding non-A / B partition, thereby completing the upgrade of the non-A / B partition firmware, write the preset non-A / B partition upgrade completion magic number into the preset position corresponding to the preset non-A / B partition upgrade completion mark in the boot communication partition, and boot the Android system normally according to the preset process, specifically including the following steps (e-1) to (e-2).

[0122] (e-1) Determine the current A / B slot partition corresponding to the reserved partition according to the current boot slot, and use the current A / B slot partition corresponding to the determined reserved partition as the current reserved partition. For example, if the current boot slot is a, then the current A / B slot partition corresponding to the determined reserved partition is reserved_a, and thus reserved_a is the current reserved partition; mount the current reserved partition in read-only mode according to the preset file system type of the reserved partition firmware image file.

[0123] (e-2) Traverse all non-A / B partition image files to be upgraded under the preset directory structure of the current reserved partition, and execute steps (e-2-1) to (e-2-3) for the traversed non-A / B partition image files.

[0124] (e-2-1) Determine the partition name of the non-A / B partition corresponding to the non-A / B partition image file according to the file name prefix of the corresponding non-A / B partition image file, which is called the non-A / B partition to be upgraded.

[0125] (e-2-2) Read all data in the non-A / B partition image file as image file data, and then write the read image file data to the non-A / B partition to be upgraded.

[0126] (e-2-3) If the non-A / B partition image file is the last non-A / B partition image file under the preset directory structure of the current reserved partition, then write the preset non-A / B partition upgrade completion magic number at the preset position in the boot communication partition, and boot the Android system normally according to the preset process, otherwise continue to traverse the next non-A / B partition image file under the preset directory structure.

[0127] According to yet another aspect of the present invention, Figure 3 2 is a schematic diagram showing an electronic device 300 for upgrading firmware according to an embodiment of the present invention. Figure 3 The electronic device 300 includes a memory 302, a processor 304, and an executable program stored in the memory and executable on the processor. The processor executes the program to enable the electronic device to implement the various steps of the method for upgrading firmware as described above.

[0128] According to another aspect of the present invention, a computer readable medium is provided, wherein a computer program is stored on the computer readable medium, and the computer program is executed by a processor to implement the method for upgrading firmware as described above.

[0129] In summary, the method for upgrading firmware, the electronic device and the storage medium provided by the present invention call the dual-system upgrade engine to perform a dual-system upgrade based on the acquired dual-system upgrade package, restart the system after the upgrade is completed, and boot the upgraded boot program firmware. In the boot program firmware, if the current boot slot is equal to the slot information before the upgrade, and the firmware in the non-dual system partition is different from the non-dual system partition firmware corresponding to the slot before the upgrade, then the firmware in the non-dual system partition is restored to the non-dual system partition firmware corresponding to the slot before the upgrade. If the current boot slot is not equal to the slot information before the upgrade in the upgrade metadata, and the current boot slot is not set to a successful startup mark, then when the non-dual system partition upgrade completion mark read is not a preset non-dual system partition upgrade completion magic number, the non-dual system partition is restored to the non-dual system partition. The system partition firmware is upgraded, and the preset non-dual system partition upgrade completion magic number is written into the boot communication partition, and the Android system is normally booted according to the preset process. Since the boot program firmware is only after the non-A / B firmware is upgraded, the device is normally booted into the upgraded Android system according to the preset process. This ensures the compatibility between the A / B firmware and the non-A / B firmware, and avoids the situation where the system cannot be started due to the incompatibility between the upgraded A / B firmware and the old non-A / B firmware. When there is a dependent coupling relationship between the A / B partition firmware and the non-A / B partition firmware, the reliability of the firmware upgrade can still be guaranteed. Whether an exception occurs at any time during the upgrade of the A / B firmware or the non-A / B firmware, the reliability of the entire upgrade process can be guaranteed. In addition, it can be seamlessly integrated with the existing Android A / B system upgrade process without any modification to the A / B upgrade engine itself in the Android system.

[0130] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for upgrading firmware, characterized in that: include: Obtaining a dual-system upgrade package, wherein the dual-system upgrade package includes a reserved partition firmware image file, and the reserved partition firmware image file includes a non-dual-system partition image file to be upgraded; Constructing upgrade metadata based on information associated with the non-dual system partition image file, and writing the upgrade metadata into a preset location of the boot communication partition; Invoking a dual-system upgrade engine to perform a dual-system upgrade based on the dual-system upgrade package, and restarting the system after the upgrade is completed to boot the upgraded boot program firmware; In the boot program firmware, if the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-dual system partition is different from the non-dual system partition firmware corresponding to the slot before the upgrade, then the firmware in the non-dual system partition is restored to the non-dual system partition firmware corresponding to the slot before the upgrade; If the current boot slot is not equal to the pre-upgrade slot information in the upgrade metadata, and the current boot slot is not set as a successful boot mark, then read the non-dual system partition upgrade completion mark from the boot communication partition, and if the read non-dual system partition upgrade completion mark is not a preset non-dual system partition upgrade completion magic number, then upgrade the non-dual system partition firmware, and write the preset non-dual system partition upgrade completion magic number into the boot communication partition; as well as Follow the preset process to boot the Android system normally.

2. The method according to claim 1, characterized in that Also includes: If the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-dual system partition is the same as the non-dual system partition firmware corresponding to the slot before the upgrade, clearing the upgrade metadata at the preset position in the boot communication partition; as well as Follow the preset process to boot the Android system normally.

3. The method according to claim 1, characterized in that A reserved partition corresponding to the reserved partition firmware image file is added in the partition table, and the reserved partition has a dual system form. The reserved partition firmware image file is generated according to the configuration item of whether the boot program firmware supports the file system, and the reserved partition firmware image file is added to the dual system upgrade package during the process of building the dual system upgrade package.

4. The method according to claim 1, characterized in that: Also includes: Clear the non-dual system partition upgrade completion mark at a preset position in the boot communication partition; as well as Determine the upgrade metadata magic number, digital digest algorithm type, metadata digital digest value, upgrade instructions, reserved partition image type, pre-upgrade slot information, and non-dual system partition image information list. Wherein constructing the upgrade metadata based on the information associated with the non-dual system partition image file includes: generating the upgrade metadata according to the upgrade metadata magic number, the digital digest algorithm type, the metadata digital digest value, the upgrade instruction, the reserved partition image type, the pre-upgrade slot information and the non-dual system partition image information list.

5. The method according to claim 1, characterized in that Also includes: Checking the legitimacy of the upgrade metadata in the preset location of the boot communication partition; as well as If the check result is illegal, the Android system will be booted normally according to the preset process.

6. The method according to claim 5, characterized in that Checking the legitimacy of the upgrade metadata in the preset location of the boot communication partition includes: Reading the upgrade metadata from a preset position of the boot communication partition, and determining whether the upgrade metadata magic number of the upgrade metadata is a preset upgrade metadata magic number; If not, the check result is determined to be illegal; If so, then calculating the digital summary value of the data in the address space composed of the upgrade instruction, the reserved partition image type, the pre-upgrade slot information and the non-dual system partition image information list in the upgrade metadata according to the digital summary algorithm type of the upgrade metadata, and comparing the calculated digital summary value with the metadata digital summary value of the upgrade metadata; If the comparison result is inconsistent, the check result is determined to be illegal; If the comparison result is consistent, determining whether the upgrade instruction in the upgrade metadata is a preset non-dual system partition image upgrade instruction; If it is not the preset non-dual system partition image upgrade instruction, determining that the check result is illegal; and If it is a preset non-dual system partition image upgrade instruction, it is determined that the check result is legal.

7. The method according to claim 1, characterized in that If the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-dual system partition is different from the non-dual system partition firmware corresponding to the slot before the upgrade, restoring the firmware in the non-dual system partition to the non-dual system partition firmware corresponding to the slot before the upgrade includes: If the current boot slot is equal to the pre-upgrade slot information in the upgrade metadata, and the firmware in the non-dual system partition is different from the non-dual system partition firmware corresponding to the slot before the upgrade, then write the non-dual system partition firmware corresponding to the slot before the upgrade into the corresponding non-dual system partition according to the current reserved partition and the reserved partition image type of the upgrade metadata; and The upgrade metadata at the preset position in the boot communication partition is cleared, and the Android system is normally booted according to the preset process.

8. The method according to claim 1, characterized in that Upgrading the non-dual system partition firmware includes: The non-dual system partition firmware corresponding to the current boot slot is written into the corresponding non-dual system partition according to the current reserved partition and the reserved partition image type of the upgrade metadata.

9. The method according to claim 1, characterized in that: Also includes: If the non-dual system partition upgrade completion mark read is a preset non-dual system partition upgrade completion magic number, the Android system is normally guided to start according to the preset process.

10. The method according to claim 1, characterized in that Also includes: If the current boot slot is not equal to the pre-upgrade slot information in the upgrade metadata, and the current boot slot has been set to a successful boot mark, then clear the non-dual system partition upgrade completion mark and upgrade metadata at the preset position in the boot communication partition, and boot the Android system normally according to the preset process.

11. The method according to claim 1, characterized in that: Also includes: The Android dual-system upgrade startup control information is read from the boot communication partition, and the current startup slot is obtained from the Android dual-system upgrade startup control information.

12. An electronic device, characterized in that: include: a memory configured to store an executable program; as well as A processor is configured to execute the program so that the electronic device performs the method according to any one of claims 1 to 11.

13. A computer readable medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Embedded multi-system upgrading method based on Hypervisor and computer readable storage medium

    CN111522569A

  • FOTA firmware upgrading method and device based on Android system

    CN113238771A

  • Method for upgrading firmware and electronic equipment

    CN114706608A

  • Application updating method, execution method, device and equipment of vehicle AB system

    CN116302002A

  • Method for upgrading OTA AB partitions of multiple operating systems in virtual machine

    CN117093246A

Cited By

  • System starting method based on virtual dual systems and electronic equipment

    CN121541931A