CN113238771B - Android system-based FOTA firmware upgrading method and device - Google Patents

Android system-based FOTA firmware upgrading method and device Download PDF

Info

Publication number
CN113238771B
CN113238771B CN202110460412.3A CN202110460412A CN113238771B CN 113238771 B CN113238771 B CN 113238771B CN 202110460412 A CN202110460412 A CN 202110460412A CN 113238771 B CN113238771 B CN 113238771B
Authority
CN
China
Prior art keywords
partition
firmware
upgrading
information
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110460412.3A
Other languages
Chinese (zh)
Other versions
CN113238771A (en
Inventor
纪大峣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rockchip Electronics Co Ltd
Original Assignee
Rockchip Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rockchip Electronics Co Ltd filed Critical Rockchip Electronics Co Ltd
Priority to CN202110460412.3A priority Critical patent/CN113238771B/en
Publication of CN113238771A publication Critical patent/CN113238771A/en
Application granted granted Critical
Publication of CN113238771B publication Critical patent/CN113238771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an android system-based FOTA firmware upgrading method and device, wherein the method comprises the following steps: formulating an upgrading data packet and storing the upgrading data packet in a preset storage medium; writing first upgrading information into a first position in a firmware partition of equipment to be upgraded; controlling the equipment to be upgraded to enter an upgrading mode, analyzing the first upgrading information, acquiring the upgrading program, upgrading the firmware of all the partition images recorded in the dependency configuration information according to the first upgrading function, and upgrading the firmware of all the partition images recorded in the system image configuration information according to the second upgrading function. According to the FOTA firmware upgrading method based on the android system, the old platform firmware in the equipment to be upgraded can be completely upgraded into the new platform firmware, the physical partition table of the equipment to be upgraded is supported to be randomly changed, and the requirements under different application scenes are effectively met.

Description

Android system-based FOTA firmware upgrading method and device
Technical Field
The invention relates to the field of firmware upgrading, in particular to an FOTA firmware upgrading method and device based on an android system.
Background
The Firmware upgrading technology is realized by using an upgrading data packet as input through an FOTA Firmware upgrading engine.
In the prior art, for different large versions of Android systems, the basic platform architecture thereof may vary greatly and be different, mainly for two reasons:
on one hand, due to upgrade transition of underlying chip platform technologies based on different Android large-version adaptations, the technology transition is often incompatible. For example, the partition table format of a manufacturer serial chip Android 7.1 platform and a platform behind Android 9.0 is changed from MBR to GPT, which is an incompatible change of the underlying technology.
Another aspect is because technology transitions between different large versions of the Android operating system itself are also generally incompatible. For example, four operating system platforms, namely Android 7.1, Android 9.0, Android 10.0 and Android 11, are provided, and in the aspect of an operating system, the system part of the Android 7.1 basically has only one system.img image file corresponding to one system physical partition; the Android 9.0 has a plurality of Android system image files such as system.img, vendor.img and odm.img which correspond to a plurality of physical partitions such as system, vendor and odm; android 10.0 further introduces dynamic partition super; android 11 introduces GKI to support a general kernel, and adds a vendor _ boot, which causes the whole boot process to be changed substantially.
Based on the above two reasons, in order to implement upgrade of the Android system platform across large versions, for example, from Android 7.1 to Android 10.0, a common practice of domestic and foreign manufacturers is to call a device using an old Android operating system platform as legacy device, and to support upgrade of legacy device to a new Android operating system, a commonly used practice is to compile a system in the new Android operating system platform in a legacy device manner, ignore newly added incompatible innovative features in the new operating system, enable main parts of the new operating system to normally work on the legacy device, that is, insert features in the new system that are compatible with the old system into a partition table of the legacy device, thereby implementing upgrade of the Android system platform across large versions. The upgrading mode of the Android system platform spanning large versions meets the requirements (particularly in GUI (graphical user interface) of users for upgrading the old system to the new system and using part of functions of the new system. But compared with a device that fully uses the new Android operating system (called launch device), the user does not enjoy innovative technology incompatible with the old system in the new system even after the system is upgraded.
In addition, in the existing Android system firmware upgrade, whether the recovery firmware upgrade engine (firmware upgrade engine takes an upgrade package as an input and returns a core firmware upgrade program of an upgrade result) of the non-AB firmware or the AB firmware upgrade engine depends on each existing partition node, and the upgrade of each partition firmware is completed through the partition device nodes, which means that the partition table of the device cannot be changed in the upgrade process. Nor can it be upgraded from a non-AB system to an AB system or vice versa.
The FOTA supporting partition table upgrade usually adopts the following methods: 1. the method supports the change of the physical partition table, but only supports partial change of the partition table or supports certain specific modes of change; 2. any partition table change is basically supported, and due to the fact that the customized upgrading package is adopted, the customized upgrading package cannot be compatible with the standard Android upgrading package, and upgrading of the upgrading client and the upgrading server is needed.
Disclosure of Invention
Therefore, a technical scheme of FOTA based on the android system needs to be provided to solve the technical problems that the partition table of the device cannot be changed arbitrarily in the prior art and the upgraded new system cannot embody part of content incompatible with the old system.
In order to achieve the above object, the present application provides, in a first aspect, a FOTA firmware upgrade method based on an android system, where the method includes:
formulating an upgrading data packet and storing the upgrading data packet in a preset storage medium; the upgrading data packet comprises a partition table description file, an upgrading program and an upgrading function; the partition table description file comprises dependency configuration information and system mirror image configuration information; the upgrading function comprises a first upgrading function and a second upgrading function;
writing first upgrading information into a first position in a firmware partition of equipment to be upgraded; the first upgrading information comprises a first upgrading instruction and first path information; the first path information and the address path of the upgrading data packet in the preset storage medium;
controlling the equipment to be upgraded to enter an upgrading mode, analyzing the first upgrading information, acquiring the upgrading program, upgrading the firmware of all the partition images recorded in the dependency configuration information according to the first upgrading function, and upgrading the firmware of all the partition images recorded in the system image configuration information according to the second upgrading function.
Further, the upgrade functions further include a third upgrade function; the method further comprises the following steps:
writing second upgrading information into a second position in the firmware partition of the equipment to be upgraded; the second upgrading information comprises a second upgrading instruction and second path information; the second path information corresponds to the first path information;
and the upgrading program executes the third upgrading function, analyzes the second upgrading information in the second position, erases all the originally stored contents in the second position after acquiring the second path information, writes the second path information and the erasing completion mark into the second position again, and restarts the equipment to be upgraded.
Further, the method comprises:
and reading the erasing completion mark at the second position, and erasing the readable and writable area of the equipment to be upgraded.
Further, the method comprises:
and creating a mark file under a preset storage directory of the equipment to be upgraded, writing the second path information into the mark file, and erasing all contents stored in the current second position again.
Further, the method comprises:
restarting the equipment to be upgraded, entering a firmware system after upgrading, judging whether the mark file exists, if so, indicating that the firmware is upgraded successfully, and executing data recovery operation of the readable and writable area according to a data recovery instruction of a user.
Further, the partition table description file also includes partition layout configuration information; the firmware partition of the equipment to be upgraded comprises a boot communication partition; the upgrading the firmware of all the partition images recorded in the dependency configuration information according to the first upgrading function includes:
extracting the partition layout configuration information to a memory of the equipment to be upgraded, analyzing the partition layout configuration file, and recording the partition information of each partition; the partition information comprises partition names corresponding to the partitions, and initial positions and length information in a preset storage medium;
extracting the dependency configuration information to a memory of the equipment to be upgraded, analyzing the dependency configuration information, and sequentially extracting names of all partition mirror images in the dependency configuration information;
reading and storing first upgrading information in the first position, and upgrading a partition table according to the partition layout configuration information;
judging whether the first line of the dependence configuration information is a first preset character string representing the firmware of the A/B system, if so, setting an A/B mark as true;
traversing the names of all partition images extracted by the dependency configuration information, and eliminating a first preset character string used for marking the firmware of the A/B system in a first row of the dependency configuration information;
searching a starting position and an offset address corresponding to a guide communication partition in the partition information extracted according to the partition layout configuration information, and performing all write 0x0 operations on the partition;
and writing all the content recorded in the current first position into a second position, writing a first upgrading function completion mark into the second position, and then restarting the equipment to be upgraded.
Further, the method comprises:
naming the firmware image file according to a preset naming rule, searching the firmware image file meeting the first name requirement in the upgrading data packet according to a keyword corresponding to the preset naming rule, and extracting the searched firmware image file into external storage equipment; otherwise, directly extracting the data into the memory of the equipment to be upgraded;
comparing the name of each searched partition mirror image with each partition name in the partition information extracted from the partition layout configuration information, if the name of the partition mirror image has a corresponding matched partition name in the partition layout configuration information, performing all 0x0 writing operations on the mirror image partition corresponding to the partition name, and then performing firmware upgrading operations on the extracted firmware mirror image file;
if the partition image name does not have a corresponding matched partition name in the partition layout configuration file, and the A/B mark is true at the moment, format change is carried out according to the current partition name, two partition names aiming at the A/B system are constructed, however, the two constructed partition names aiming at the A/B system are compared with the partition names in the partition information extracted by the partition layout configuration information, if a matched partition item is found, firstly, all 0x0 writing operations are carried out on the image partition, and then, firmware upgrading operations are carried out on the extracted firmware image file.
Further, the partition table description file also includes partition layout configuration information; the firmware partition of the equipment to be upgraded comprises a boot communication partition; the upgrading the firmware of all the partition images recorded in the system image configuration information according to the second upgrading function includes:
extracting the partition layout configuration information to a memory of the equipment to be upgraded, analyzing the partition layout configuration file, and recording the partition information of each partition; the partition information comprises partition names corresponding to the partitions, and initial positions and length information in a preset storage medium;
extracting the system mirror image configuration information in the upgrade data packet to a memory, then analyzing the system mirror image configuration information, and sequentially extracting the names of all partition mirror images in the system mirror image configuration information;
judging whether the first line of the system mirror image configuration information is a second preset character string for marking the firmware of the A/B system, if so, indicating that the firmware in the upgrade data packet is specific to the A/B system, and setting the A/B mark as true;
and traversing the names of all the partition images in the system image configuration information, and eliminating a second preset character string used for marking the A/B system firmware in the first line of the system image configuration information.
Further, the method comprises:
naming the firmware image file according to a preset naming rule, searching the firmware image file meeting the second name requirement in the upgrading data packet according to a keyword corresponding to the preset naming rule, and extracting the searched firmware image file into external storage equipment;
comparing the name of each searched partition mirror image with each partition name in the partition information extracted from the partition layout configuration information, if the name of the partition mirror image has a corresponding matched partition name in the partition layout configuration information, performing all 0x0 writing operations on the mirror image partition corresponding to the partition name, and then performing firmware upgrading operations on the extracted firmware mirror image file;
if the partition mirror image name does not have a corresponding matched partition name in the partition layout configuration file, and the A/B mark is true at the moment, format change is carried out according to the current partition name, two partition names aiming at the A/B system are constructed, however, the constructed two partition names aiming at the A/B system are compared with the partition names in the partition information extracted by the partition layout configuration information, if a matched partition item is found, firstly, 0x0 operation is completely written to the mirror image partition, and then, firmware upgrading operation is carried out on the extracted firmware mirror image file.
The second aspect of the present invention also provides a FOTA firmware upgrade apparatus of an android system, where the apparatus is configured to perform the method according to any one of the first aspect of the present invention.
Compared with the prior art, the Android system-based FOTA firmware upgrading method and device can completely upgrade the platform version of the Android operating system to another large version, completely reprogram and upgrade the whole storage medium of legacy equipment, upgrade all firmware from the partition table to all new version platforms, enable the firmware in the legacy equipment to be completely consistent with launch equipment after upgrading, and enjoy all innovative technical experiences that all launch equipment can enjoy.
Drawings
Fig. 1 is a flowchart of a FOTA firmware upgrading method based on an android system according to an embodiment of the present invention;
fig. 2 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention;
fig. 3 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention;
fig. 4 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention;
fig. 5 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention;
fig. 6 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention;
fig. 7 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention;
fig. 8 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention;
fig. 9 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention;
fig. 10 is a flowchart of a FOTA firmware upgrading method based on the android system according to another specific embodiment of the present invention.
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
The invention provides an Android system-based FOTA firmware upgrading method, which can support mutual upgrading of large versions of any Android operating system, realize that one Android operating system platform version is completely upgraded to another large version, and simultaneously support any change upgrading aiming at a device partition table, including change of a partition table format, such as changing MBR into GPT, and does not depend on partition device nodes. Particularly, the firmware upgrading method provided by the invention also supports mutual upgrading of the non-AB firmware and the AB firmware of the Android system. And only requires that the device has an available external storage medium (TF/SD card or U-disk) at the time of upgrade, and that the new and old platform firmware contains a "boot communication partition" (part of the firmware partition) for communication at various stages of firmware upgrade.
Meanwhile, the method can be compatible with the existing Android standard upgrading system in the process of upgrading the firmware, the upgrading data packet is compressed and filed by zip, signed by signapk.jar and compatible with the standard Android upgrading packet, so that the existing Android upgrading client and the existing Android upgrading server can be seamlessly compatible with the firmware upgrading engine (namely, the FOTA firmware upgrading device based on the Android system).
Fig. 1 is a flowchart of a FOTA firmware upgrading method based on the android system according to a specific embodiment of the present invention. The method comprises the following steps:
firstly, entering a step S101 to formulate an upgrading data packet, and storing the upgrading data packet in a preset storage medium; the upgrading data packet comprises a partition table description file, an upgrading program and an upgrading function; the partition table description file comprises dependency configuration information and system mirror image configuration information; the upgrade function includes a first upgrade function and a second upgrade function.
Then step S102 is carried out, first upgrading information is written into a first position in a firmware partition of the equipment to be upgraded; the first upgrading information comprises a first upgrading instruction and first path information; and the first path information and the address path of the upgrade data packet in the preset storage medium.
And then step S103 is entered to control the equipment to be upgraded to enter an upgrading mode, the first upgrading information is analyzed, the upgrading program is obtained, the firmware of all the partition images recorded in the dependency configuration information is upgraded according to the first upgrading function, and the firmware of all the partition images recorded in the system image configuration information is upgraded according to the second upgrading function.
In the application, the device to be upgraded comprises a firmware partition, the firmware partition comprises a boot communication partition, and the first upgrade information is written into a first position of the boot communication partition in advance; the first path information is the path information of the upgrade data packet in the preset storage medium.
As shown in FIG. 2, in some embodiments, the upgrade functions further include a third upgrade function; the method further comprises the following steps:
firstly, entering a step S201 to write second upgrading information into a second position in a firmware partition of equipment to be upgraded; the second upgrading information comprises a second upgrading instruction and second path information; the second path information corresponds to the first path information. Preferably, the second path information is a mirror image of the first path information, that is, the original first path information is copied and stored in the second location.
And then, step S202 is entered, where the upgrade program executes the third upgrade function, analyzes the second upgrade information in the second location, obtains the second path information, erases all the contents originally stored in the second location, writes the second path information and the erasure completion flag into the second location again, and restarts the device to be upgraded.
In certain embodiments, the method comprises: and reading the erasing completion mark at the second position, and erasing the readable and writable area of the equipment to be upgraded. Preferably, the method comprises: and creating a mark file under a preset storage directory of the equipment to be upgraded, writing the second path information into the mark file, and erasing all contents stored in the current second position again.
In certain embodiments, the method comprises: restarting the equipment to be upgraded, entering a firmware system after upgrading, judging whether the mark file exists, if so, indicating that the firmware is upgraded successfully, and executing data recovery operation of the readable and writable area according to a data recovery instruction of a user.
As shown in FIG. 3, in some embodiments, the partition table description file also includes partition layout configuration information; the firmware partition of the equipment to be upgraded comprises a boot communication partition; the upgrading the firmware of all the partition images recorded in the dependency configuration information according to the first upgrading function includes:
firstly, step S301 is entered to extract the partition layout configuration information to the memory of the equipment to be upgraded, the partition layout configuration file is analyzed, and the partition information of each partition is recorded; the partition information comprises partition names corresponding to the partitions, and initial positions and length information in a preset storage medium;
then step S302 is entered to extract the dependency configuration information to the memory of the equipment to be upgraded, then the dependency configuration information is analyzed, and the names of all the partition mirror images in the dependency configuration information are extracted in sequence;
then step S303 is carried out to read and store the first upgrading information in the first position, and a partition table is upgraded according to the partition layout configuration information;
then step S304 is carried out to judge whether the first line of the dependency configuration information is a first preset character string representing the firmware of the A/B system, if so, the A/B mark is set to be true;
then, step S305 is carried out, names of all partition images extracted by the dependency configuration information are traversed, and a first preset character string used for marking the A/B system firmware in a first row of the dependency configuration information is removed;
then, step S306 is performed to search for the start position and offset address corresponding to the pilot communication partition in the partition information extracted according to the partition layout configuration information, and perform all write operations 0x0 on the partition;
and then, step S307 is performed to write all the content recorded in the current first position into the second position, write the first upgrade function completion flag into the second position, and then restart the device to be upgraded.
As shown in fig. 4, in some embodiments, the method comprises:
firstly, step S401 is entered, a firmware image file is named according to a preset naming rule, the firmware image file meeting the first name requirement is searched in the upgrading data packet according to a keyword corresponding to the preset naming rule, and the searched firmware image file is extracted into an external storage device; otherwise, directly extracting the data into the memory of the equipment to be upgraded;
then step S402 is entered to compare the names of the searched partition images with the names of the partition images in the partition information extracted from the partition layout configuration information, if the names of the partition images have corresponding matched partition names in the partition layout configuration information, all 0x0 writing operations are carried out on the image partitions corresponding to the partition names, and then firmware upgrading operations are carried out on the extracted firmware image files;
step S401 may be followed by step S403, if the partition image name does not have a corresponding matching partition name in the partition layout configuration file, and at this time, the a/B flag is true, then format change is performed according to the current partition name, two partition names for the a/B system are constructed, however, the two constructed partition names for the a/B system are compared with the partition names in the partition information extracted by the partition layout configuration information, if a matching partition item is found, first all 0x0 writing operations are performed on the image partition, and then firmware upgrade operations are performed on the extracted firmware image file.
As shown in fig. 5, the partition table description file further includes partition layout configuration information; the firmware partition of the equipment to be upgraded comprises a boot communication partition; the upgrading the firmware of all the partition images recorded in the system image configuration information according to the second upgrading function includes:
firstly, step S501 is carried out to extract the partition layout configuration information to the memory of the equipment to be upgraded, the partition layout configuration file is analyzed, and the partition information of each partition is recorded; the partition information comprises partition names corresponding to the partitions, and initial positions and length information in a preset storage medium;
then step S502 is carried out to extract the system mirror image configuration information in the upgrading data packet to a memory, then the system mirror image configuration information is analyzed, and the names of all the partition mirror images in the system mirror image configuration information are sequentially extracted;
then step S503 is carried out to judge whether the first line of the system image configuration information is a second preset character string for marking the firmware of the A/B system, if so, the firmware in the upgrade data packet is indicated to be specific to the A/B system, and the A/B mark is set to be true;
and then, step S504 is carried out, names of all partition images in the system image configuration information are traversed, and second preset character strings used for marking the A/B system firmware in the first line of the system image configuration information are removed.
As shown in fig. 6, in certain embodiments, the method comprises:
firstly, step S601 is carried out, a firmware image file is named according to a preset naming rule, the firmware image file meeting the requirement of a second name is searched in an upgrading data packet according to a keyword corresponding to the preset naming rule, and the searched firmware image file is extracted into external storage equipment;
then step S602 is entered, the names of the searched partition images are compared with the names of the partition images in the partition information extracted from the partition layout configuration information, if the names of the partition images have corresponding matched partition names in the partition layout configuration information, all 0x0 writing operations are carried out on the image partitions corresponding to the partition names, and then firmware upgrading operations are carried out on the extracted firmware image files;
step S601 may also be followed by step S603, if the partition image name does not have a corresponding matching partition name in the partition layout configuration file, and at this time, the a/B flag is true, then format change is performed according to the current partition name, two partition names for the a/B system are constructed, however, the two constructed partition names for the a/B system are compared with the partition names in the partition information extracted by the partition layout configuration information, if a matching partition item is found, first all 0x0 writing operations are performed on the image partition, and then firmware upgrade operations are performed on the extracted firmware image file.
The second aspect of the present invention also provides a FOTA firmware upgrade apparatus of the android system, where the apparatus is configured to perform the method according to the first aspect of the present invention.
The following describes in detail the FOTA firmware upgrade method of the android system according to the present application with reference to fig. 7 to 10 of the present application.
As shown in fig. 7, a general framework flowchart of the firmware upgrading method according to the present application is as follows:
first, in step S701, a firmware upgrade package is created and signed according to the configuration requirements of the upgrade package.
And then, the client checks the upgrade package in step S702, judges whether the upgrade package is a completely upgraded upgrade package across platforms or not, and if so, places the upgrade package in an external storage and performs possible data backup operation.
And then, step S703 is performed to write an upgrade instruction, a storage path of an upgrade package, and a flag of the upgrade package into the cross-platform complete upgrade to the fixed location 1 of the "boot communication partition", restart the device, and enter a recovery mode.
Then, step S704 is entered to read the fixed location 1 of the "boot communication partition" in recovery, and if there is a mark of complete upgrade across platforms, only the validity of the upgrade package is checked, and no other form of check is performed on the upgrade package.
Then, step S705 is performed to extract the update-bank program in the upgrade package and operate the update-bank program, and then the update-bank program starts firmware upgrade according to the upgrade script update-script.
And then step S706 is performed to execute the upgrade instruction 1 in the upgrade script update-script to complete the firmware upgrade of all partition images described in the "platform recovery image dependent configuration file".
And then step S707 is performed to execute the upgrade instruction 2 in the upgrade script update-script to complete the firmware upgrade of all partition images described in the "platform system image configuration file".
And then step S708 is executed to execute an upgrade instruction 3 in the upgrade script update-script, after the upgrade instruction 3 is parsed, the content of the fixed position 2 of the boot communication partition is first read, the storage path information of the upgrade package is acquired, then the content in the fixed position 2 of the boot communication partition is erased, the erasure flag and the storage path information of the upgrade package are written in the position, and finally the device is restarted to enter recovery.
And then, step S709 recovery is carried out to read the fixed position 2 of the 'boot communication partition', if an erasing mark exists, erasing operation is carried out on the user readable and writable partition in the platform, wherein the erasing operation comprises data and Cache.
And then, step S710 is performed to create a mark file under the/cache/recovery, and the storage path information of the upgrade package read by the fixed position 2 of the "boot communication partition" is written in the mark file, which indicates that the upgrade is completed this time, and the content of the fixed position 2 of the "boot communication partition" is erased.
And then, entering step S711 to restart the device, entering the upgraded system, and the upgrade client may determine that the cross-platform upgrade is completed according to the tag file of/cache/recovery/and perform data recovery operation as needed.
The firmware upgrade package is an "upgrade data package", and in the present application, the firmware upgrade package includes the following three contents: (1) upgrading the engine configuration file; (2) an upgrade-program (update-bind) and an upgrade-script (update-script); (3) a firmware image file.
The upgrade engine configuration file generally includes the following three types, specifically:
first, the platform recovery image depends on a configuration file (e.g., play _ fw _ complete. txt), i.e., the aforementioned "dependent configuration information".
The image dependency configuration file describes names of all partition images involved in a process of starting recovery by a corresponding Android platform, and the names generally include a boot program partition image, a system partition image related to chip security, a security check partition image storing recovery image integrity check information, and a recovery partition image (recovery. If the firmware upgrade package (i.e., the upgrade data package) is a firmware file of the android a/B system, the corresponding recovery partition image is a boot image (since the android a/B system does not have recovery.
The image dependency configuration file records the name of a partition image (e.g., uboot, trust, recovery) for each row. Each partition image corresponds to only one row, that is, even if the name of the partition image recorded in each row of the a/B system firmware does not have suffixes _ a and _ B, for example, when the android system is an a/B system, there are uboot _ a and uboot _ B, but only one row of uboot is configured in the configuration file, there is only one firmware image file named uboot.
If the firmware upgrade package is a firmware file of an android A/B system, the first line of the image dependent configuration file is a special string to indicate that the firmware in the firmware upgrade package is of an A/B system.
Second, a platform system image configuration file (e.g., play _ fw _ system. txt), i.e., the aforementioned "system image configuration information".
The platform system image configuration file describes names of all other partition images except the partition image described in the "platform recovery image dependency configuration file" in the Android platform, and generally, the other partition images include boot partition images (boot. If the firmware upgrade package is a firmware file of the Android a/B system, it is not necessary to write a boot partition image (boot. img) here, because in the Android a/B system, the functionality of recovery is included in the boot partition image (boot. img), and thus is described in the "platform recovery image dependent configuration file".
Similar to the "platform recovery image dependency configuration file", each row of the platform system image configuration file records the name of a partition image (e.g., system, super), and each partition image corresponds to only one row. That is, even though the name of the partition image recorded in each row of the a/B system firmware does not have suffixes _ a and _ B, such as system _ a and system _ B when the a/B system is used, only one row of system is configured in the platform system image configuration file, only one firmware image file named system. If the firmware upgrade package is a firmware file of the android A/B system, the first line of the configuration file is a special string to indicate that the firmware in the firmware upgrade package is of the A/B system.
Third, a partition layout configuration file (e.g., parameter. txt), i.e., the aforementioned "partition layout configuration information".
The partition layout configuration file describes the starting position, the length and the partition table type (GPT or MBR) of each partition of the Android platform in the flash storage medium.
The upgrade script may be named updatescript, which includes the following three special instructions: upgrade instruction 1 (i.e., the first upgrade function mentioned earlier), upgrade instruction 2 (i.e., the second upgrade function mentioned earlier), and upgrade instruction 3 (i.e., the third upgrade function mentioned earlier).
The upgrade instruction 1 is used to complete firmware upgrade of all partition images described in "platform recovery image dependent configuration file" and restart the device when executed. The upgrade instructions 2 are executed to perform a firmware upgrade of all partition images described by the "platform system image configuration file". The upgrade instructions 3 are executed to write an erase flag at the fixed location 2 of the boot communication partition and restart the device.
The upgrade program is named update-binary and is used for realizing three special instructions in the upgrade script.
The firmware image file is composed of all firmware forming an Android platform, and comprises each partition image described in two configuration files, namely a platform recovery image dependency configuration file and a platform system image configuration file, namely the names of the partition images indicated by each row of the two configuration files correspond to one firmware image file. Each firmware image file is commanded with a "name of partition image + a specific suffix" which may be either a.bin or an.img, etc., to distinguish the different partition image files.
As shown in fig. 8, the method steps implemented when the upgrade instruction 1 is executed specifically include:
the method first proceeds to step S801 to extract a partition layout configuration file in the firmware upgrade package to a memory, and then parses the partition layout configuration file, and records the name of each partition, the start position and the length information in the storage medium.
And then, step S802 is performed to extract the platform recovery image dependency configuration file in the firmware upgrade package to the memory, and then the recovery image dependency configuration file is analyzed, and the names of all partition images in the configuration file are sequentially extracted.
Then, the flow advances to step S803 to read and save the contents of the "boot communication partition" fixed position 1.
And then step S804 is carried out to upgrade the partition table according to the partition layout configuration file.
And then, step S805 is performed to determine whether the first line of the platform recovery image dependent configuration file is a special character string for marking the firmware of the a/B system, if so, it indicates that the firmware in the upgrade package is for the a/B system, and the a/B flag is set to be true.
And then, the method goes to step 806 to traverse the names of all the partition images extracted by the platform recovery image dependency configuration file, and excludes the possible special character strings used for marking the firmware of the A/B system in the first row of the configuration file.
Then, step S807 is performed to determine whether the end of the partition image name list is reached, if not, step S808 is performed to construct a firmware image file according to the rule of "name of partition image + specific suffix", and the firmware image file is searched in the firmware upgrade package. And if the name of the partition image is recovery or boot, extracting the found firmware image file into an external storage device, otherwise, directly extracting the firmware image file into a memory.
Then, the process proceeds to step S809 to compare the names of the partitions in the partition information extracted from the partition layout configuration file with the names of the partitions according to the names of the partition images.
Then, step S810 is performed to determine whether the partition mirror names have corresponding matching partition names in the partition layout configuration file, if not, step S811 is performed to determine whether the AB flag is true, if the determination in step S811 is positive, step S812 is performed to construct two partition names for the a/B system for the partition mirror name + "_ a" and the partition mirror name + "_ B", and then the constructed 2 new partition names are compared with the partition names in the partition information extracted from the partition layout configuration file.
Step S812 may be followed by step S813 of determining whether a matching partition is found, if yes, step S814 is followed by performing a write operation of 0x0 on the corresponding partition, and then a firmware upgrade operation is performed according to the extracted firmware image file, and step S814 may be followed by step S816 of reading the name of the next partition image.
If the determination in step S810 is yes, step S815 may be performed to perform a write operation of 0x0 on the partition, and then a firmware upgrade operation may be performed according to the extracted firmware image file, and step S815 may be followed by step S816 to read a name of a next partition image. If the determination in step S811 is no or the determination in step S813 is no, the process may proceed to step S816 to read the next partition mirror name, and after step S816, the process may proceed to step S807 again to determine whether the end of the partition mirror name list is reached.
If the determination in step S807 is yes, step S817 may be performed to search the start position and offset of the "boot communication partition" in the storage medium from the partition information extracted from the partition layout configuration file, and perform a write-all 0x0 operation on the partition. After step S817, step S818 may be proceeded to write the content of the previously read "boot communication partition" fixed location 1 into the fixed location 2 of the "boot communication partition" of the new platform, and attach the special mark character string that marks the completion of the upgrade instruction 1 to the fixed location 2 of the "boot communication partition" of the new platform. After step S818, the process may enter step S819 to restart the device, and enter a recovery mode, where the firmware used in the restart process is the firmware of the new platform upgraded by the upgrade instruction 1
Of course, in this embodiment, the process may further proceed to step S820 to read the fixed location 2 of the "guidance communication partition" before step S801 is executed, and the process may proceed to step S821 after step S820 to determine whether or not there is a special flag character string in which the flag update command 1 is completed, and if so, the upgrade program may be exited, otherwise, the process may proceed to step S801.
As shown in fig. 9, the method steps implemented when the upgrade instruction 2 is executed specifically include:
step S901 is first executed to extract the partition layout configuration file in the firmware upgrade package into the memory, and then the partition layout configuration file is parsed to record the name of each partition, the start position and the length information in the storage medium.
Then step S902 is performed to extract the "platform system image configuration file" in the firmware upgrade package to the memory, and then the platform system image configuration file is analyzed, and the names of all partition images in the configuration file are sequentially extracted.
And then step S903 is carried out to judge whether the first line of the platform system image configuration file is a special character string for marking the firmware of the A/B system, if so, the firmware in the upgrade package is indicated to the A/B system, and the A/B mark is set to be true.
And then step S904 is entered to traverse all the partition image names extracted from the platform system image configuration file, and exclude the first row of the configuration file from possible special character strings for marking the a/B system firmware.
And then, step S905 is performed to determine whether the end of the partition image name list is reached, if so, the upgrade procedure is exited, otherwise, step S906 is performed to construct a firmware image file according to the rule of "name of partition image + specific suffix", search the firmware image file in the firmware upgrade package, and extract the searched firmware image file into the external storage device.
Then, step 907 is carried out to judge whether the partition mirror name has a corresponding matched partition name in the partition layout configuration file, if so, step 908 is carried out to write 0x0 into the partition, and then firmware upgrading operation is carried out according to the extracted firmware mirror file; otherwise, the process proceeds to step S910 to determine whether the AB flag is true.
If the determination result in step S910 is yes, step S911 is proceeded to construct two partition names for the a/B system for the partition mirror name + "_ a" and the partition mirror name + "_ B", and then compare the constructed 2 new partition names with the partition names in the partition information extracted from the partition layout configuration file. Then, the process proceeds to step S912 to determine whether a matching partition is found, and if the determination result in step S912 is yes, the process proceeds to step S913 to perform all operations of writing 0x0 to the corresponding partition, and then performs a firmware upgrade operation according to the extracted firmware image file.
After step S908, step S910, step S912, or step S913, the process may proceed to step S909 to read the name of the next partition image, step S909 may proceed to step S905 again, and the upgrade process exits if step S905 determines yes.
As shown in fig. 9, the method steps implemented when the upgrade instruction 3 is executed specifically include:
first, the process proceeds to step S1001, where the content of the fixed location 2 of the boot communication partition is read, and the storage path information of the upgrade package is acquired.
Then, the process proceeds to step S1002 to erase the contents in the fixed location 2 of the boot communication partition, and then to write the erase flag and the storage path information of the upgrade package in this location.
Then, the process goes to step S1003 to restart the device and enter recovery.
The following is a detailed description of the steps involved in the firmware upgrade method according to an actual application scenario of the method:
1. and completely compiling all firmware of the Android platform, manufacturing an upgrade package according to the composition requirements of the upgrade package, and signing the upgrade package by using signapk.
2. And after the upgrading client side acquires the firmware upgrading packet in an online or offline mode, verifying the legality of the upgrading packet. And meanwhile, judging whether the upgrade package contains a platform recovery image dependent configuration file and/or a platform system image configuration file, if so, indicating that the Android firmware upgrade package is a cross-platform completely upgraded firmware upgrade package, and completely reprogramming the flash, so that the firmware upgrade package needs to be placed in an external storage device for possible data backup operation. And if the equipment does not have external storage, prompting the user to insert an external storage medium (TF/SD card or U disk) or abandon the upgrade.
3. If the firmware upgrading packet is legal, the firmware upgrading packet is placed in an external storage after possible data backup is completed, an upgrading instruction, a storage path of the upgrading packet and a mark of the upgrading packet are written into a fixed position 1 of a 'boot communication partition', the upgrading is changed into cross-platform complete upgrading, then the equipment is restarted, and a recovery mode is entered.
4. In recovery, the fixed position 1 of the boot communication partition is read, if a mark of complete cross-platform upgrade exists, the validity of the upgrade package is only checked, and no other form of check is performed on the upgrade package. And extracting and running an upgrade program update-bind in the upgrade package, and then starting firmware upgrade according to the upgrade script update-script by the update-bind.
5. And executing the upgrade instruction 1 in the upgrade script update-script to complete the firmware upgrade of all partition images described in the platform recovery image dependent configuration file. This process does not allow the device to be powered down midway through. The execution flow of the "upgrade instruction 1" is as follows (1) to (10):
(1) the fixed position 2 of the "boot communication partition" is read, and whether or not there is a special tag character string in which the tag upgrade instruction 1 has been completed is determined. If the special mark character string of the upgrade instruction 1 is completed, exiting the upgrade instruction 1, otherwise, continuing to execute the following step (2) to extract the partition layout configuration file (such as parameter. txt) in the firmware upgrade package to the memory, then parsing the partition layout configuration file, and recording the name, the initial position and the length information of each partition in the storage medium.
(3) Extracting a platform recovery image dependent configuration file (such as play _ fw _ complete. txt) in a firmware upgrade package to a memory, then analyzing the recovery image dependent configuration file, and sequentially extracting the names of all partition images in the configuration file.
(4) The content of the fixed position 1 of the boot communication partition is read and stored, and the content comprises an upgrading instruction, a storage path of an upgrading packet and a mark of whether the upgrading is completely carried out across platforms or not.
(5) And upgrading the partition table according to the partition layout configuration file.
(6) Judging whether the first line of the platform recovery image dependent configuration file is a special character string for marking the firmware of the A/B system, if so, indicating that the firmware in the upgrade package is specific to the A/B system, and setting the A/B mark as true.
(7) And (4) traversing the names of all the partition images extracted in the step (3), and excluding the special character strings used for marking the firmware of the A/B system in the step (6).
a \ according to the rule of 'the name of the partition image + the specific suffix', constructing a firmware image file, and searching the firmware image file in a firmware upgrade package. And if the name of the partition image is recovery or boot, extracting the found firmware image file into an external storage device, otherwise, directly extracting the firmware image file into a memory.
b, comparing the names of the partition images with the partition names in the partition information extracted from the partition layout configuration file in the step (2), if the partition image names have corresponding matched partition names in the partition layout configuration file, firstly writing 0x0 on the partition, and then performing firmware upgrading operation according to the firmware image file extracted in the step (a).
If the partition image name does not correspond to a matched partition name in the partition layout configuration file, and the A/B mark is true at the moment, two partition names aiming at the A/B system are constructed for the partition image name + "_ a" and the partition image name + "_ B", then the constructed 2 new partition names are compared with the partition names in the partition information extracted by the partition layout configuration file, if a matched partition item is found, firstly, all 0x0 writing operations are carried out on the partition, and then, firmware upgrading operations are carried out according to the firmware image file extracted in (a).
(8) And (3) searching the initial position and offset of the 'boot communication partition' in the storage medium from the partition information extracted from the partition layout configuration file in the step (2), and performing a total write operation of 0x0 on the partition.
(9) And (4) writing the content of the fixed position 1 of the 'boot communication partition' read in the step (4) into the fixed position 2 of the 'boot communication partition' of the new platform, and adding a special mark character string for marking that the upgrade instruction 1 is completed at the fixed position 2 of the 'boot communication partition' of the new platform.
(10) The device restarts and re-enters recovery mode.
6. The firmware used in the restart process is the firmware of the new platform upgraded by the upgrade instruction 1. In recovery of the new platform firmware, the fixed position 2 of the boot communication partition is read, if an upgrade instruction exists and a mark for complete upgrade across platforms exists, only the validity of the upgrade package is checked firstly, and no check is performed on the upgrade package in any other form. And then extracting and operating an upgrade program update-binary in the upgrade package, and then starting firmware upgrade according to the upgrade script update-script by the update-binary. Continuing from the above step 5, when the upgrade instruction 1 in the upgrade script update-script is executed, since the special flag character string marking that the upgrade instruction 1 has been completed exists in the fixed position 2 of the "boot communication partition", the upgrade instruction 1 is exited. The upgrade order 2 of the following step 7 is started.
7. And executing the upgrade instruction 2 in the upgrade script updatescript to complete the firmware upgrade of all partition images described by the platform system image configuration file. The process supports the unexpected power failure of the equipment, and after the equipment is powered on again, the boot program is started to reboot the equipment into a recovery mode through the upgrading instruction in the fixed position 2 of the boot communication partition, and the step 6 is executed again. The execution flows (1) to (4) of the "upgrade instruction 2" are as follows:
(1) and extracting the partition layout configuration file in the firmware upgrade package to a memory, then analyzing the partition layout configuration file, and recording the name of each partition, the initial position and the length information in the flash storage medium.
(2) Extracting a platform system image configuration file (such as plat _ fw _ system. txt) in a firmware upgrade package to a memory, then analyzing the platform system image configuration file, and sequentially extracting the names of all partition images in the configuration file.
(3) And judging whether the first line of the platform system image configuration file is a special character string for marking the firmware of the A/B system, if so, indicating that the firmware in the upgrade package is specific to the A/B system, and setting the A/B mark as true.
(4) And (3) traversing the names of all the partition images extracted in the step (2), and excluding the special character strings for marking the firmware of the A/B system in the step (3).
a \ according to the rule of 'the name of the partition image plus a specific suffix', constructing a firmware image file, searching the firmware image file in a firmware upgrade package, and extracting the searched firmware image file into an external storage device.
And b, comparing the names of the partition images with the partition names in the partition information extracted from the partition layout configuration file in the step (1), if the partition image names have corresponding matched partition names in the partition layout configuration file, firstly performing all operations of writing 0x0 on the partition, and then performing firmware upgrading operation according to the firmware image file extracted in the step (a).
If the partition image name does not correspond to a matched partition name in the partition layout configuration file, and the A/B mark is true at the moment, two partition names aiming at the A/B system are constructed for the partition image name + "_ a" and the partition image name + "_ B", then the constructed 2 new partition names are compared with the partition names in the partition information extracted by the partition layout configuration file, if a matched partition item is found, firstly, all 0x0 writing operations are carried out on the partition, and then, firmware upgrading operations are carried out according to the firmware image file extracted in (a).
8. Executing an upgrade instruction 3 in the upgrade script update-script:
the instruction first reads the content of the fixed position 2 of the boot communication partition, and acquires the storage path information of the upgrade package.
Then erasing the content in the fixed position 2 of the boot communication partition, writing an erasing mark and the storage path information of the upgrade package in the position, and finally restarting the device to enter recovery.
And 9, reading the fixed position 2 of the 'boot communication partition', and if an erasing mark exists, performing erasing operation on the user readable and writable partition in the platform, wherein the erasing operation comprises data and cache. And finally, creating a mark file in/cache/recovery/next, and writing the storage path information of the upgrade package read by the fixed position 2 of the 'boot communication partition' into the mark file to indicate that the upgrade is finished at this time. The contents of fixed location 2 of the "boot communication partition" are erased.
10. And restarting the equipment and entering the upgraded system. The upgrading client can judge that the cross-platform upgrading is completed according to the mark files/cache/recovery/and carry out data recovery operation according to the requirement.
The beneficial effects obtained by adopting the firmware upgrading method are as follows:
(1) the technology can support mutual upgrading of large versions of any Android operating system, and support any change upgrading aiming at the device partition table, including change of the partition table format, such as changing MBR into GPT. Independent of the partition device node. In particular, mutual upgrading of non-AB firmware and AB firmware of the Android system is supported. The device is only required to have available external storage media (TF/SD card or U disk) at the time of upgrading, and the new platform firmware and the old platform firmware all contain a 'boot communication partition' for communication of different stages of firmware upgrading. The invention can completely upgrade the firmware in legacy equipment to be consistent with launch equipment. In this way, subsequent device firmware maintenance is significantly improved while improving user experience.
(2) Meanwhile, the technology can be compatible with the existing Android standard upgrading system, the upgrading package is compressed and filed by zip, signed by signapk. Therefore, the existing Android upgrading client and the existing Android upgrading server can be seamlessly compatible with the firmware upgrading engine.
Finally, it should be noted that, although the above embodiments have been described herein, the scope of the present invention is not limited thereby. Therefore, based on the innovative concepts of the present invention, the technical solutions of the present invention can be directly or indirectly applied to other related technical fields by making changes and modifications to the embodiments described herein, or by using equivalent structures or equivalent processes performed in the content of the present specification and the attached drawings, which are included in the scope of the present invention.

Claims (8)

1. An FOTA firmware upgrading method based on an android system is characterized by comprising the following steps:
formulating an upgrading data packet and storing the upgrading data packet in a preset storage medium; the upgrading data packet comprises a partition table description file, an upgrading program and an upgrading function; the partition table description file comprises dependency configuration information and system mirror image configuration information; the upgrading function comprises a first upgrading function and a second upgrading function;
writing first upgrading information into a first position in a firmware partition of equipment to be upgraded; the first upgrading information comprises a first upgrading instruction and first path information; the first path information is an address path of the upgrade data packet in the preset storage medium;
controlling equipment to be upgraded to enter an upgrading mode, analyzing the first upgrading information, acquiring the upgrading program, upgrading the firmware of all the partition images recorded in the dependency configuration information according to the first upgrading function, and upgrading the firmware of all the partition images recorded in the system image configuration information according to the second upgrading function;
the partition table description file also comprises partition layout configuration information; the firmware partition of the equipment to be upgraded comprises a boot communication partition; the upgrading the firmware of all the partition images recorded in the dependency configuration information according to the first upgrading function includes:
extracting the partition layout configuration information to a memory of the equipment to be upgraded, analyzing the partition layout configuration file, and recording the partition information of each partition; the partition information comprises partition names corresponding to the partitions, and initial positions and length information in a preset storage medium;
extracting the dependency configuration information to a memory of the equipment to be upgraded, analyzing the dependency configuration information, and sequentially extracting names of all partition mirror images in the dependency configuration information;
reading and storing first upgrading information in the first position, and upgrading a partition table according to the partition layout configuration information;
judging whether the first line of the dependence configuration information is a first preset character string representing the firmware of the A/B system, if so, setting an A/B mark as true;
traversing the names of all partition images extracted by the dependency configuration information, and eliminating a first preset character string used for marking the firmware of the A/B system in a first row of the dependency configuration information;
searching a starting position and an offset address corresponding to a guide communication partition in the partition information extracted according to the partition layout configuration information, and performing all write 0x0 operations on the partition;
writing all the content recorded in the current first position into a second position, writing a first upgrading function completion mark into the second position, and then restarting the equipment to be upgraded;
the partition table description file also comprises partition layout configuration information; the firmware partition of the equipment to be upgraded comprises a boot communication partition; the upgrading the firmware of all the partition images recorded in the system image configuration information according to the second upgrading function includes:
extracting the partition layout configuration information to a memory of the equipment to be upgraded, analyzing the partition layout configuration file, and recording the partition information of each partition; the partition information comprises partition names corresponding to the partitions, and initial positions and length information in a preset storage medium;
extracting the system mirror image configuration information in the upgrade data packet to a memory, then analyzing the system mirror image configuration information, and sequentially extracting the names of all partition mirror images in the system mirror image configuration information;
judging whether the first line of the system mirror image configuration information is a second preset character string for marking the firmware of the A/B system, if so, indicating that the firmware in the upgrade data packet is specific to the A/B system, and setting the A/B mark as true;
and traversing the names of all the partition images in the system image configuration information, and eliminating a second preset character string used for marking the A/B system firmware in the first line of the system image configuration information.
2. The android-system-based FOTA firmware upgrade method of claim 1, in which the upgrade functions further include a third upgrade function; the method further comprises the following steps:
writing second upgrading information into a second position in the firmware partition of the equipment to be upgraded; the second upgrading information comprises a second upgrading instruction and second path information; the second path information corresponds to the first path information;
and the upgrading program executes the third upgrading function, analyzes the second upgrading information in the second position, erases all the contents originally stored in the second position after acquiring the second path information, writes the second path information and the erasing completion mark into the second position again, and restarts the equipment to be upgraded.
3. The android-based FOTA firmware upgrade method of claim 2, the method comprising:
and reading the erasing completion mark at the second position, and erasing the readable and writable area of the equipment to be upgraded.
4. The android-based FOTA firmware upgrade method of claim 2, the method comprising:
and creating a mark file under a preset storage directory of the equipment to be upgraded, writing the second path information into the mark file, and erasing all contents stored in the current second position again.
5. The android-based FOTA firmware upgrade method of claim 4, the method comprising:
restarting the equipment to be upgraded, entering a firmware system after upgrading, judging whether the mark file exists, if so, indicating that the firmware is upgraded successfully, and executing data recovery operation of the readable and writable area according to a data recovery instruction of a user.
6. The android-based FOTA firmware upgrade method of claim 1, the method comprising:
naming the firmware image file according to a preset naming rule, searching the firmware image file meeting the first name requirement in the upgrading data packet according to a keyword corresponding to the preset naming rule, and extracting the searched firmware image file into external storage equipment; otherwise, directly extracting the data into the memory of the equipment to be upgraded;
comparing the name of each searched partition mirror image with each partition name in the partition information extracted from the partition layout configuration information, if the name of the partition mirror image has a corresponding matched partition name in the partition layout configuration information, performing all 0x0 writing operations on the mirror image partition corresponding to the partition name, and then performing firmware upgrading operations on the extracted firmware mirror image file;
if the partition mirror image name does not have a corresponding matched partition name in the partition layout configuration file, and the A/B mark is true at the moment, format change is carried out according to the current partition name, two partition names aiming at the A/B system are constructed, however, the constructed two partition names aiming at the A/B system are compared with the partition names in the partition information extracted by the partition layout configuration information, if a matched partition item is found, firstly, 0x0 operation is completely written to the mirror image partition, and then, firmware upgrading operation is carried out on the extracted firmware mirror image file.
7. The android-based FOTA firmware upgrade method of claim 1, the method comprising:
naming the firmware image file according to a preset naming rule, searching the firmware image file meeting the second name requirement in the upgrading data packet according to a keyword corresponding to the preset naming rule, and extracting the searched firmware image file into external storage equipment;
comparing the name of each searched partition mirror image with each partition name in the partition information extracted from the partition layout configuration information, if the name of the partition mirror image has a corresponding matched partition name in the partition layout configuration information, performing all 0x0 writing operations on the mirror image partition corresponding to the partition name, and then performing firmware upgrading operations on the extracted firmware mirror image file;
if the partition mirror image name does not have a corresponding matched partition name in the partition layout configuration file, and the A/B mark is true at the moment, format change is carried out according to the current partition name, two partition names aiming at the A/B system are constructed, however, the constructed two partition names aiming at the A/B system are compared with the partition names in the partition information extracted by the partition layout configuration information, if a matched partition item is found, firstly, 0x0 operation is completely written to the mirror image partition, and then, firmware upgrading operation is carried out on the extracted firmware mirror image file.
8. An FOTA firmware upgrade device of an android system, characterized in that the device is configured to perform the method of any of claims 1 to 7.
CN202110460412.3A 2021-04-27 2021-04-27 Android system-based FOTA firmware upgrading method and device Active CN113238771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110460412.3A CN113238771B (en) 2021-04-27 2021-04-27 Android system-based FOTA firmware upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110460412.3A CN113238771B (en) 2021-04-27 2021-04-27 Android system-based FOTA firmware upgrading method and device

Publications (2)

Publication Number Publication Date
CN113238771A CN113238771A (en) 2021-08-10
CN113238771B true CN113238771B (en) 2022-06-21

Family

ID=77129413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110460412.3A Active CN113238771B (en) 2021-04-27 2021-04-27 Android system-based FOTA firmware upgrading method and device

Country Status (1)

Country Link
CN (1) CN113238771B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610341A (en) * 2022-03-22 2022-06-10 Oppo广东移动通信有限公司 Production line flashing method and device, electronic equipment, chip and storage medium
CN115033259A (en) * 2022-05-31 2022-09-09 珠海视熙科技有限公司 Firmware upgrading method and device, storage medium and electronic equipment
CN114995893B (en) * 2022-08-01 2022-11-01 摩尔线程智能科技(北京)有限责任公司 Firmware management method, flash memory, host and storage medium
CN117971283A (en) * 2024-03-28 2024-05-03 深流微智能科技(深圳)有限公司 Firmware upgrading method of graphic processor, terminal equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086078A (en) * 2017-06-14 2018-12-25 展讯通信(上海)有限公司 Android system upgrade method, device, server and mobile terminal
CN109960523A (en) * 2017-12-22 2019-07-02 浙江宇视科技有限公司 A kind of firmware upgrade method and device of embedded device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7219343B2 (en) * 2003-04-10 2007-05-15 International Business Machines Corporation Firmware update mechanism in a multi-node data processing system
CN106610840A (en) * 2015-10-22 2017-05-03 深圳市中兴微电子技术有限公司 FOTA (Firmware Over-The-Air) upgrade method and system
CN109240720B (en) * 2018-08-23 2021-11-26 瑞芯微电子股份有限公司 Firmware upgrading method of android system and storage device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086078A (en) * 2017-06-14 2018-12-25 展讯通信(上海)有限公司 Android system upgrade method, device, server and mobile terminal
CN109960523A (en) * 2017-12-22 2019-07-02 浙江宇视科技有限公司 A kind of firmware upgrade method and device of embedded device

Also Published As

Publication number Publication date
CN113238771A (en) 2021-08-10

Similar Documents

Publication Publication Date Title
CN113238771B (en) Android system-based FOTA firmware upgrading method and device
KR100987628B1 (en) Method for updating firmware in embedded controller and medium recorded update firmware
CN113064604B (en) Firmware upgrading method and device
CN101763279B (en) BootLoader architectural design method
JP6568947B2 (en) In-vehicle control device, program update system, and program update software
CN102667716A (en) Methods and devices for updating firmware of a component using a firmware update application
CN103294572A (en) Electronic device to restore MBR, and method thereof
CN112558980A (en) Multi-software-package management method and device
CN102023908A (en) Method and device for backing up boot program
US9715874B2 (en) Techniques for updating an automatic speech recognition system using finite-state transducers
US20150309878A1 (en) Method and computation node for processing application data
CN101409074A (en) Method for updating embedded speech identification system function
CN104536788A (en) System and method enabling installation of application to be automatic
US8196093B2 (en) Apparatus and method for componentizing legacy system
CN109614325A (en) A kind of method and device, electronic equipment and the storage medium of determining control property
KR20070024307A (en) Information processing apparatus, information processing apparatus control program, and information processing apparatus control method
CN109375953B (en) Operating system starting method and device
CN101506772A (en) Environment state changes to alter functionality
CN116302011B (en) Firmware upgrading method for cable monitoring equipment
KR100228717B1 (en) Method of coping with power off in laser printer
CN113791812B (en) Firmware upgrading method and storage device
CN114706608A (en) Method for upgrading firmware and electronic equipment
CN115599400A (en) Method, system and medium for rapidly constructing Docker mirror image
CN114610516A (en) Application program repairing method and device, computer equipment and storage medium
CN113467797B (en) Program updating method, device and system and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant