CN115562697B - Upgrade method, device and storage medium - Google Patents

Upgrade method, device and storage medium Download PDF

Info

Publication number
CN115562697B
CN115562697B CN202210390468.0A CN202210390468A CN115562697B CN 115562697 B CN115562697 B CN 115562697B CN 202210390468 A CN202210390468 A CN 202210390468A CN 115562697 B CN115562697 B CN 115562697B
Authority
CN
China
Prior art keywords
partition
upgrade
recorded
information
partition table
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
CN202210390468.0A
Other languages
Chinese (zh)
Other versions
CN115562697A (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210390468.0A priority Critical patent/CN115562697B/en
Priority to CN202310475784.2A priority patent/CN116909610A/en
Publication of CN115562697A publication Critical patent/CN115562697A/en
Application granted granted Critical
Publication of CN115562697B publication Critical patent/CN115562697B/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
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Landscapes

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

Abstract

The application provides an upgrading method, equipment and a storage medium. By setting the upgrade condition of the inner card, and when determining whether the upgrade meets the upgrade condition of the inner card, firstly writing the image files corresponding to the partitions except the user data in the first upgrade package into the corresponding partitions in the memory according to the first partition table, then upgrading the first partition table according to the second partition table, and re-creating the mapping relation between the device nodes of the partitions in the memory according to the upgraded first partition table, further creating the file system corresponding to the formatted user data partitions according to the mapping relation after the user data partitions are formatted, thereby overcoming the problem that the first upgrade package cannot be found after the partition change is needed to be overcome in the upgrade of the inner card, and ensuring that the image files of all the partitions are written into the correct positions when the electronic equipment is upgraded from the burn version to the user version under the condition that the partition table is changed, and overcoming the limitation of the transmission speed of external storage equipment.

Description

Upgrade method, device and storage medium
Technical Field
The present disclosure relates to the field of electronic technologies, and in particular, to an upgrade method, apparatus, and storage medium.
Background
It is well known that current electronic devices, such as smart screens, cell phones, tablet computers, personal computers (Personal Computer, PC devices) and the like, have internal memory (colloquially: flash memory). Depending on the configuration and requirements of different products, the capacity of flash memory varies, and for convenience of management and maintenance, flash memory is usually divided into a plurality of areas during use, which we call "partition". The partition can not only isolate the system partition and the user data partition from each other, but also enhance the system stability. Taking an electronic device designed and developed by an Android platform as an example, when a flash memory of the electronic device is partitioned at present, a partition table (GUID Partition Table, GPT partition table) is generally identified according to a global unique identifier.
For an electronic device developed by an Android platform design, such as a smart screen, a version (hereinafter referred to as a burn-in version) used on a production line and a commercial version (hereinafter referred to as a user version) of the electronic device at the time of delivery are inconsistent, so that when the electronic device is upgraded from the burn-in version to the user version, in order to ensure that image files of each partition in an upgrade package can be accurately written into a corresponding partition, an upgrade scheme is currently adopted, the upgrade package is stored in an external storage device, such as a secure digital card (Secure Digital Memory Card, an SD card) and a USB flash disk (U disk), then the partition table stored in the device is upgraded according to the partition table of the upgrade package in the external storage device, and then the image files of each partition in the upgrade package are written into the partition which is repartitioned in the device. Although the image files of each partition can be written into the correct position under the condition of changing the partition table, the actual reading speed is only 20MB/s due to the limited reading speed of external storage devices such as SD cards, U disks and the like, and particularly, a plurality of chips do not support USB3.0 interfaces, and the size of an upgrade package is usually about 2G. And for the electronic equipment with larger volume and no built-in battery, when the smart screen is upgraded from a burning version to a user version, the quantity of smart screens which can be simultaneously placed on one assembly line is limited, so that the unit hour productivity (UPH) can be influenced, and further the production cost is increased.
Therefore, it is desirable to provide an upgrade scheme to solve the above-mentioned technical problems when the electronic device is upgraded from the burn-in version to the user version.
Disclosure of Invention
In order to solve the technical problems, the application provides an upgrading method, equipment and a storage medium, which aim to ensure that when electronic equipment is upgraded from a burning version to a user version, image files of each partition can be still written into correct positions under the condition that a partition table is changed, and the limit of the transmission speed of external storage equipment such as an SD card and a U disk can be overcome.
In a first aspect, the present application provides an upgrade method. The method is applied to the electronic equipment and comprises the following steps: responding to the received upgrade instruction, and entering an engineering mode; acquiring an upgrade flag bit, wherein the upgrade flag bit is used for indicating an upgrade mode of the upgrade; when the upgrade flag bit indicates that the upgrade mode of the upgrade is external card upgrade and a first upgrade package exists in a user data partition of a memory of the electronic equipment, determining whether the upgrade meets the upgrade of an internal card according to partition information recorded in a first partition table stored in the memory and partition information recorded in a second partition table stored in the first upgrade package, wherein the upgrade mode of the internal card is an upgrade mode of loading upgrade data from the user data partition, and the upgrade of the external card is an upgrade mode of loading upgrade data from an external storage device mounted on the electronic equipment; when the upgrade is determined to meet the requirement of the internal card upgrade, according to a first partition table, writing image files corresponding to partitions except the user data partition in a first upgrade package into the corresponding partitions in the memory; upgrading the first partition table according to the second partition table; re-creating a mapping relation between the device nodes of the partition in the memory and the memory according to the updated first partition table; and formatting the user data partition, and creating a file system corresponding to the formatted user data partition according to the mapping relation. Therefore, by setting the upgrade condition of the inner card and determining whether the upgrade meets the upgrade condition of the inner card, firstly writing the image files corresponding to the partitions except the user data in the first upgrade package into the corresponding partitions in the memory according to the first partition table, then upgrading the first partition table according to the second partition table, and re-creating the mapping relation between the equipment nodes of the partitions in the memory according to the upgraded first partition table, and further creating the file system corresponding to the formatted user data partitions according to the mapping relation after the user data partitions are formatted, the problem that the first upgrade package cannot be found after the partition change is needed to be overcome in the upgrade of the inner card is solved, so that when the electronic equipment is upgraded from the burn version to the user version, the image files of all the partitions can be written into the correct positions still under the condition that the partition table is changed, and the limit of the transmission speed of external storage equipment such as an SD card and a U disk can be overcome.
In addition, by storing the first upgrade package in the user data partition of the memory of the electronic device, the upgrade operation does not need to plug and unplug an external memory device, so that the user operation is simplified, and the stability is higher.
According to the first aspect, partition information of a system partition, partition information of a special partition corresponding to a burn-in version and partition information of a user data partition are recorded in a first partition table, and the partition information of the system partition, the partition information of the special partition and the partition information of the user data partition are recorded in the first partition table according to the sequence of the system partition, the special partition and the user data partition; the partition information of the system partition and the partition information of the user data partition are recorded in the second partition table, and the partition information of the system partition and the partition information of the user data partition are recorded in the second partition table according to the sequence of the system partition and the user data partition; the first partition table corresponds to a burn-in version, the second partition table corresponds to a user version, and the system partition is a partition with both the burn-in version and the user version. In this way, by placing the special partition in the burned version in front of the user data partition and next to the user data partition, the rest of the system partition keeps the same position as the user version, so that when the system partition before the user data partition is upgraded by using the inner card, the problem that the partition and the image file are not matched in position after the user version is upgraded even if the first partition table is not upgraded can be ensured.
According to the first aspect, or any implementation manner of the first aspect, determining whether the upgrade meets the inner card upgrade according to partition information recorded in a first partition table stored in a memory and partition information recorded in a second partition table stored in a first upgrade package includes: determining whether the partition information of the system partition recorded in the second partition table is identical to the partition information of the system partition recorded in the first partition table according to the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package; when the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table, determining that the upgrade meets the requirement of the inner card upgrade; and when the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table, determining that the upgrade does not meet the requirement of the inner card upgrade.
According to the first aspect, or any implementation manner of the first aspect, according to partition information recorded in a first partition table stored in a memory and partition information recorded in a second partition table stored in a first upgrade package, determining whether partition information of a system partition recorded in the second partition table is the same as partition information of a system partition recorded in the first partition table includes: determining a first starting position and an occupied first space size of a system partition recorded in a first partition table according to partition information recorded in the first partition table stored in a memory; determining a second starting position of a system partition recorded in a second partition table and a second occupied space according to partition information recorded in the second partition table stored in the first upgrade package; when the first starting position is the same as the second starting position and the first space is the same as the second space, determining that the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table; otherwise, determining that the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table. In this way, it can be determined whether the partition information of the system partition recorded in the first partition table and the partition information of the system partition recorded in the second partition table are identical according to the start position and the space size of each system partition.
According to the first aspect, or any implementation manner of the first aspect, according to partition information recorded in a first partition table stored in a memory and partition information recorded in a second partition table stored in a first upgrade package, determining whether partition information of a system partition recorded in the second partition table is the same as partition information of a system partition recorded in the first partition table includes: determining a first starting position and a first ending position of a system partition recorded in a first partition table according to partition information recorded in the first partition table stored in a memory; determining a second starting position and a second ending position of a system partition recorded in a second partition table according to partition information recorded in the second partition table stored in the first upgrade package; when the first starting position is the same as the second starting position and the first ending position is the same as the second ending position, determining that the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table; otherwise, determining that the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table. In this way, it is possible to determine whether the partition information of the system partition recorded in the first partition table and the partition information of the system partition recorded in the second partition table are identical according to the start position and the end position of each system partition.
According to the first aspect, or any implementation manner of the first aspect, the creating, according to the updated first partition table, a mapping relationship between a device node of a partition in a memory and the memory includes: the mapping relation between the equipment nodes of the system partition in the memory and the memory is re-established according to the partition information of the system partition recorded in the updated first partition table; and re-creating the mapping relation between the equipment nodes of the user data partition in the memory and the memory according to the partition information of the user data partition recorded in the updated first partition table, and merging the space occupied by the proprietary partition into the user data partition. Because the user data partition can directly format and create the file system without upgrading the image file, the upgrade from the burn-in version to the user version can be completed quickly and efficiently by combining the special partition under the burn-in version into the user data partition.
According to the first aspect, or any implementation manner of the first aspect, the upgrade flag bit is recorded in a mis partition of the memory, where the mis partition is used to record system setting information; before determining whether the upgrade meets the inner card upgrade according to the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package, the method further comprises: and replacing the upgrading zone bit recorded in the MIsc partition, wherein the replaced upgrading zone bit is used for indicating that the upgrading mode of the current upgrading is the internal card upgrading. Therefore, if the process of upgrading from the burn-in version to the user version is interrupted, after the next retrigger, the process can be upgraded according to the upgrade process of the inner card without judging again, and the processing process is simplified.
According to the first aspect, or any implementation manner of the first aspect, when it is determined that the current upgrade does not meet the upgrade of the inner card, ending the current upgrade; after finishing the upgrading, if the upgrading instruction is received again, responding to the upgrading instruction, and re-entering the engineering mode; and reading the replaced upgrade flag bit from the MIsc partition, acquiring a first upgrade package from the user data partition, and executing the step of determining whether the partition information of the system partition recorded in the second partition table is identical to the partition information of the system partition recorded in the first partition table according to the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package. Therefore, if the process of upgrading from the burn-in version to the user version is interrupted, after the next retrigger, the process can be upgraded according to the upgrade process of the inner card without judging again, and the processing process is simplified.
According to the first aspect, or any implementation manner of the first aspect, after creating a file system corresponding to the formatted user data partition according to the mapping relationship, the method further includes: and clearing the upgrade flag bit recorded in the misc partition. Therefore, after the electronic equipment is upgraded from the burn-in version to the user version, the upgrading process is not executed by the electronic equipment because of the operation of the user after the electronic equipment leaves a factory and is put into use by clearing the upgrading zone bit recorded in the MIsc partition.
According to the first aspect, or any implementation manner of the first aspect, the method further includes: when the upgrade flag bit indicates that the upgrade mode of the upgrade is external card upgrade and the first upgrade package does not exist in the user data partition, mounting external storage equipment; after the external storage device is successfully mounted, loading a third partition table in the second upgrade package from the external storage device; upgrading the first partition table according to the third partition table; re-creating a mapping relation between the equipment nodes of the partition in the memory and the memory according to the partition information recorded in the updated first partition table; and writing the image file corresponding to each partition in the second upgrade package into the corresponding partition in the memory. When the internal card cannot be used for upgrading, the external storage device is loaded, and upgrading data in the upgrading package, such as a third partition table and an image file of a partition, are read from the external storage device, so that whether the electronic device supports the internal card upgrading or not can be ensured, the electronic device can be upgraded from a burn-in version to a user version, and the success of the upgrading is ensured.
In a second aspect, the present application provides an electronic device. The electronic device includes: a memory and a processor, the memory and the processor coupled; the memory stores program instructions that, when executed by the processor, cause the electronic device to perform the instructions of the first aspect or of the method in any possible implementation of the first aspect.
In a third aspect, the present application provides a computer readable medium for storing a computer program comprising instructions for performing the method of the first aspect or any possible implementation of the first aspect.
In a fourth aspect, the present application provides a computer program comprising instructions for performing the method of the first aspect or any possible implementation of the first aspect.
In a fifth aspect, the present application provides a chip comprising processing circuitry, a transceiver pin. Wherein the transceiver pin and the processing circuit communicate with each other via an internal connection path, the processing circuit performing the method of the first aspect or any one of the possible implementation manners of the first aspect to control the receiving pin to receive signals and to control the transmitting pin to transmit signals.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of an electronic device exemplarily shown;
FIG. 2 is a flow diagram illustrating an upgrade method provided by one embodiment of the present application;
FIG. 3 is a flow chart illustrating an upgrade method provided by yet another embodiment of the present application;
FIG. 4 is a schematic flow diagram of an exemplary illustrated external card upgrade;
FIG. 5 is a schematic diagram illustrating an exemplary satisfaction of an inside card upgrade condition;
FIG. 6 is a schematic diagram of partition information recorded in a first partition table shown schematically;
FIG. 7 is a diagram illustrating a partition information format in a second partition table prior to parsing;
FIG. 8 is a diagram illustrating a format of partition information in a second partition table after parsing;
FIG. 9 is a schematic diagram illustrating an upgrade to a first partition table according to a second partition table.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone.
The terms first and second and the like in the description and in the claims of embodiments of the present application are used for distinguishing between different objects and not necessarily for describing a particular sequential order of objects. For example, the first target object and the second target object, etc., are used to distinguish between different target objects, and are not used to describe a particular order of target objects.
In the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the description of the embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" means two or more. For example, the plurality of processing units refers to two or more processing units; the plurality of systems means two or more systems.
In order to better understand the technical solution provided in the present application, before describing the technical solution of the embodiment of the present application, a description is first given of an upgrade procedure of an electronic device, such as a smart screen (including chips, image quality, sound quality, content and wisdom, which are provided on the premise of no advertisement when the electronic device is started) from a burn-in version to a user version. Specifically, under the burn-in version, the smart screen is related to the test flow, so that the partition table of the smart screen records partition information of the system partition and partition information of the user data partition which are both the same as the user version, and also records partition information of the partition (hereinafter referred to as a special partition) which is specially used for recording the test information, namely under the burn-in version, the memory (hereinafter referred to as a flash memory or flash) of the smart screen is divided into the system partition and the user data partition, and also into the special partition. These proprietary partitions are not needed after shipment, i.e., after upgrade to user version, so the smart screen must be upgraded from burned to user version before shipment, and these proprietary partitions are removed. That is, the partition information recorded in the partition table under the burn-in version is inconsistent with the partition information recorded in the partition table under the user version, so before the image file of each partition is written into the partition in the flash, the partition table in the intelligent screen needs to be updated into the partition table corresponding to the user version, and then the image file is written, so that the image file can be ensured to be written into a correct position. Since only the user data partition (userdata partition) can store the upgrade package in the smart screen, and the userdata partition is usually the last partition, before the userdata partition, the burn-in version is several more proprietary partitions than the user version, and the space occupied by these proprietary partitions is larger, when upgrading to the user version, the proprietary partitions must be recycled (the space occupied by these proprietary partitions is a part of the userdata partition after recycling), so the positions of the burn-in version and the userdata partition of the user version are definitely different, once the partition is changed before upgrading, the new file system after re-mounting the userdata partition cannot find the file under the old file system, so the upgrade is currently performed by adopting a mode of inserting a USB (or external storage and inserting an SD card) (hereinafter referred to as external card upgrade), and the upgrade package is placed into external storage devices such as a USB (U) and an SD card, so that the upgrade can be performed even if the partition position changes.
It should be noted that, although the change of the partition table may be implemented by using the external card upgrade (since the upgrade package is not in the userdata partition, after the partition table is updated, upgrade data, such as an image file, is still read from the external storage device, so that there is no case that the upgrade package cannot be found), because the external storage device, such as a USB disk, has a limited reading speed, especially many chips do not support the USB3.0 interface, which results in an actual reading speed of only 20MB/s, and the size of the upgrade package is usually about 2G. In the upgrading process, the upgrade package is required to be checked and then upgraded, so that the upgrade package is required to be read twice, and the 20MB/s reading and writing speed can cause overlong upgrade time, thereby affecting the upgrading efficiency of the production line. In addition, for the electronic device with larger volume and no built-in battery, when the smart screen is upgraded from a burn-in version to a user version, the number of smart screens which can be simultaneously placed in one assembly line is limited, so that the Unit Per Hour (UPH) capacity can be influenced, and further the production cost is increased. But the flash in the intelligent screen, whether the flash is an embedded multimedia card (Embedded Multi Media Card, emmc) flash or a universal flash (Univeral Flash Storage, ufs) flash, has higher read-write speed (usually up to 100MB/s and even faster), so that the limitation of the transmission speed of the external storage device can be overcome by placing the upgrade package into the flash for upgrading (called as the upgrade of the internal card later), and the plug-in and plug-out of the external storage device are reduced, so that the operation of a user is more convenient and the stability is higher. However, the upgrade of the inner card needs to overcome the problem that the upgrade package cannot be found after the partition changes.
Therefore, in order to solve the problem, the upgrading method provided by the application is provided, so that when the electronic equipment is upgraded from the burn-in version to the user version, the image files of each partition can be still written into the correct position under the condition that the partition table is changed, and the limit of the transmission speed of external storage equipment such as an SD card and a U disk can be overcome.
For example, the electronic device to which the technical solution provided in the present application is applicable may be, for example, a smart screen, a mobile phone, a tablet, a PC, etc., and the hardware structure thereof is shown in fig. 1.
For example, referring to fig. 1, an electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (universal serial bus, USB) interface 130, charge management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, sensor module 180, keys 190, motor 191, indicator 192, camera 193, display 194, and subscriber identity module (subscriber identification module, SIM) card interface 195, among others.
For example, in particular, in the technical solution provided in the embodiments of the present application, when a burn-in version of an electronic device used on a production line is upgraded to a user version, an upgrade package is specifically stored in the internal memory 121, that is, in a flash in advance.
In addition, in order to ensure that the upgrade package stored in the internal memory 121 cannot be used or that the electronic device can still be upgraded from the burn-in version to the user version without the upgrade package, the upgrade package may be stored in the external storage device in advance.
By way of example, in practical applications, the external storage device may be, for example, a secure digital card (Secure Digital Memory Card, SD card), a USB flash drive (U-disc), OTG (Over-the-Go), or the like.
For example, when the external storage device is an SD card, the SD card may be connected to the electronic device through the external memory interface 120, so that the electronic device may read data in the upgrade package from the SD card, such as a partition table, and configuration information corresponding to a partition recorded in the partition table during the upgrade process.
For example, when the external storage device is a USB disk, the USB disk may access the electronic device through the USB interface 130, so that the electronic device may read data in the upgrade package, such as a partition table, and configuration information corresponding to a partition recorded in the partition table, from the USB disk in the upgrade process.
In addition, it should be noted that OTG is specifically applied to the connection between different devices or mobile devices, and is mainly used for data interaction. Therefore, regarding the manner of using OTG to complete the upgrade, reference may be made to the manner of using the usb disk to complete the upgrade, which is not described herein.
Furthermore, it should be understood that the foregoing description is only illustrative for better understanding of the technical solutions of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
In addition, in practical applications, the audio module 170 may include, for example, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, and the like.
By way of example, the sensor module 180 may include, for example, a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
In addition, in practical applications, the key 190 may include, for example, a power key (power key), a home key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
In the technical solution provided in the embodiments of the present application, the electronic device is triggered to enter the engineering mode (Recovery mode) to upgrade from the burn-in version to the user version, for example, by pressing the home key and the start key simultaneously (for example, pressing 5 seconds simultaneously) for a long time, or by sending an upgrade instruction to the electronic device through the PC device that establishes the communication connection, which is not listed here again, but is not limited thereto in this application.
In practical applications, the communication connection between the PC device and the electronic device may be established by a wired connection manner such as a network cable or a USB data cable, or by a wireless link manner such as bluetooth, wireless fidelity (WI-FI), near field communication (Near Field Communication, NFC), which are not listed here, but are not limited thereto.
In addition, it should be noted that, in practical applications, the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc.
It will be appreciated that in particular implementations, the different processing units may be separate devices or may be integrated in one or more processors.
Further, in some implementations, the controller may be a neural hub and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
In addition, memory in the processor 110 is primarily used for storing instructions and data. In some implementations, the memory in the processor 110 is a cache memory.
Further, it is understood that in an actual application scenario, executable program codes that trigger the electronic device 100 to implement various functional applications and data processing are stored in the internal memory 121, and these executable program codes include instructions.
As to the hardware architecture of the electronic device 100, it should be understood that the electronic device 100 shown in fig. 1 is merely an example, and in particular implementations, the electronic device 100 may have more or fewer components than shown, may combine two or more components, or may have different component configurations. The various components shown in fig. 1 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
Implementation details of the technical solution provided in the present application are described below, and the following details are provided only for facilitating understanding, and are not necessary to implement the present embodiment.
Exemplary, referring to fig. 2, the specific implementation steps of this embodiment include:
Step 101, responding to the received upgrade instruction, and entering an engineering mode.
It can be appreciated that the upgrade instruction in this embodiment is specifically an instruction for triggering the electronic device to enter an engineering mode (Recovery mode, also referred to as Recovery mode). In practical applications, the upgrade instruction may be sent to the electronic device by a PC device that establishes a communication connection with the electronic device, or may be generated by a specific key combination of the electronic device, for example, when a home key and a start key are pressed simultaneously for a long time.
In practical application, the electronic device is restarted when responding to the received upgrade instruction, and the Recovery mode is selected to be entered in the restarting process.
Accordingly, after entering the Recovery mode, the electronic device may obtain the partition table corresponding to the user version from the upgrade package stored in the corresponding storage location (such as the external storage device or the user data partition) according to the upgrade mode indicated by the upgrade flag bit, so as to upgrade the electronic device from the burn-in version to the user version according to the partition table corresponding to the user version and the partition table corresponding to the burn-in version stored currently.
For example, in practical applications, the external storage device may be, for example, a secure digital card (Secure Digital Memory Card, SD card), a USB flash drive (U-disk), OTG, or the like.
In addition, it should be noted that after entering the Recovery mode, the Recovery process is started, that is, the upgrade method provided by the present embodiment is specifically completed by the Recovery process.
In order to facilitate explanation of the technical solution provided in this embodiment, the partition table stored in the memory of the electronic device is hereinafter referred to as a first partition table, the upgrade package stored in the internal memory 121 is referred to as a first upgrade package, the partition table in the first upgrade package is referred to as a second partition table, the upgrade package stored in the external memory is referred to as a second upgrade package, and the partition table in the second upgrade package is referred to as a third partition table.
Step 102, obtaining an upgrade flag bit.
Specifically, in this embodiment, the upgrade flag bit is recorded in a risc partition of the flash, and is used to indicate an upgrade mode of the upgrade.
It will be appreciated that the MIsc partition has a boot loader control block (Bootloader Control Block, BCB) for storing Recovery boot information, system configuration information for the ON/OFF switch, etc. Therefore, after the electronic device enters the Recovery mode, the Recovery process reads the stored Recovery guide information, that is, the upgrade flag bit in this embodiment, from the risc partition.
In addition, it should be noted that, regarding the electronic device entering the Recovery mode for the first time, the upgrade flag bit read by the Recovery process from the MIsc partition is written into the MIsc partition by the electronic device in the normal startup mode (loading the data of the basic partition (common partition), the data of the static partition, and the data of the dynamic partition (super partition) in turn, so that the electronic device runs to the operating system corresponding to the burned version before upgrading).
For example, in some implementations, different upgrade flag bits may be agreed to correspond to different upgrade modes, for example, an upgrade mode of an upgrade flag bit "factory_sd_update" is agreed to indicate that the upgrade mode is an external card upgrade, that is, an upgrade mode of loading upgrade data (partition table, image file corresponding to a partition, etc.) from an external storage device mounted on an electronic device, such as an SD card, a U disc, or an OTG, in a process of upgrading from a burn-in version to a user version.
For example, in other implementations, it may be agreed that an upgrade flag bit "factor_flash_update" indicates that the upgrade mode is an upgrade mode of an inner card, that is, in a process of upgrading from a burn-in version to a user version, a Recovery process needs to load upgrade data (a partition table, an image file corresponding to the partition, etc.) from a user data partition of a flash.
For example, in other implementations, an upgrade flag bit "factor_ OTA _update" may be agreed to indicate that the upgrade mode is an OTA upgrade, which is typically an iterative upgrade to a user version after the electronic device is upgraded to a user version, or an iterative upgrade to a burn-in version under a burn-in version.
For example, in other implementations, an upgrade flag bit "factor_reset" may be agreed to indicate a factory reset.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
In addition, it should be noted that, in order to enable the upgrade scheme provided in this embodiment to be compatible with the existing method of upgrading the electronic device from the burn-in version to the user version by mounting the external storage device and loading the upgrade data in the external storage device, it may be agreed that the electronic device enters the Recovery mode for the first time, the upgrade flag bit read by the Recovery process from the mis partition does not include the upgrade flag bit of the internal card upgrade provided in this embodiment, which is "factor_flash_update", but further determines whether the first upgrade packet used for upgrading exists in the user data partition to determine whether the upgrade can be changed from the external card upgrade to the internal card upgrade when the upgrade flag bit is "factor_sd_update" indicating the external card upgrade. Therefore, the scheme of both outer card upgrading and inner card upgrading can be achieved without changing the existing mode of entering Recovery and triggering the process of upgrading from the burned version to the user version.
Step 103, when the upgrade flag bit indicates that the upgrade mode of the upgrade is external card upgrade and a first upgrade package exists in a user data partition of a memory of the electronic device, determining whether the upgrade meets the requirement of internal card upgrade according to partition information recorded in a first partition table stored in the memory and partition information recorded in a second partition table stored in the first upgrade package.
In this embodiment, the partition information of the system partition, the partition information of the exclusive partition (for example, the partition required to be used in the version test) corresponding to the burn-in version, and the partition information of the user data partition are recorded in the first partition table, and the partition information of the system partition, the partition information of the exclusive partition, and the partition information of the user data partition are recorded in the first partition table according to the sequence of the system partition, the exclusive partition, and the user data partition; the second partition table records partition information of the system partition and partition information of the user data partition, and the partition information of the system partition and the partition information of the user data partition are recorded in the second partition table according to the sequence of the system partition and the user data partition.
Further, it is understood that in this embodiment, the first partition table corresponds to a burn-in version, the second partition table corresponds to a user version, and the system partition is a partition of both the burn-in version and the user version.
By way of example, in some implementations, the system partition may include, for example, a mboot partition storing a boot program, a boot partition storing setting information for a boot item, a super partition storing system core data, a version partition storing version information, a load partition storing preload information, etc., which are not listed here.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
For example, in order to ensure that the problem that the upgrade package cannot be found after the partition change can be overcome when the internal card upgrade is adopted, the embodiment specifies that the partition information recorded in the first partition table and the partition information recorded in the second partition table are recorded according to the above specified sequence, and since the user data partition may not write the image file, when determining whether the upgrade meets the internal card upgrade, whether the partition information of the system partition recorded in the second partition table is identical to the partition information of the system partition recorded in the first partition table can be determined directly according to the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package.
Correspondingly, when the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table, determining that the upgrade meets the requirement of the internal card upgrade; and when the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table, determining that the upgrade does not meet the requirement of the inner card upgrade.
It is understood that, regarding the manner in which the partition information of the system partition recorded in the second partition table is determined to be the same as the partition information of the system partition recorded in the first partition table, it is possible to follow that the positions and the occupied sizes of the system partitions recorded in the two partition tables are the same.
For example, in some implementations, it may be determined whether the partition information of the system partitions recorded in the two partition tables is the same by comparing the starting location of each system partition recorded in the two partition tables and the amount of space occupied. Specific implementation manners may be, for example: determining a first starting position and an occupied first space size of a system partition recorded in a first partition table according to partition information recorded in the first partition table stored in a memory, and determining a second starting position and an occupied second space size of the system partition recorded in a second partition table according to partition information recorded in the second partition table stored in a first upgrade package; then comparing the two initial positions and the space sizes respectively, and determining that the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table when the first initial position is the same as the second initial position and the first space size is the same as the second space size; otherwise, determining that the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table.
For example, in other implementations, it may be determined whether the partition information of the system partitions recorded in the two partition tables is the same by comparing the start position and the end position of each system partition recorded in the two partition tables. Specific implementation manners may be, for example: determining a first starting position and a first ending position of a system partition recorded in a first partition table according to partition information recorded in the first partition table stored in a memory, and determining a second starting position and a second ending position of the system partition recorded in a second partition table according to partition information recorded in the second partition table stored in a first upgrade package; comparing the two initial positions with the two end positions, and determining that the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table when the first initial position is the same as the second initial position and the first end position is the same as the second end position; otherwise, determining that the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
In addition, it should be noted that, considering that the upgrade may be interrupted in the actual application due to power outage, abnormal upgrade package, and the like, in order to re-power up the electronic device when it is determined that the upgrade package exists in the user data partition, after updating the upgrade package, the electronic device may directly skip the judgment of the previous step, obtain the first upgrade package from the user data partition, and further determine whether the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table, so as to complete the subsequent upgrade by directly adopting the internal card upgrade manner, thereby simplifying the processing flow. When the upgrade flag bit indicates that the upgrade is an external card upgrade and a first upgrade package exists in the user data partition, the Recovery process can replace the upgrade flag bit recorded in the MIsc partition before determining whether the upgrade meets the requirement of the internal card upgrade according to partition information recorded in a first partition table stored in a memory and partition information recorded in a second partition table stored in the first upgrade package.
It can be understood that, in this embodiment, the replaced upgrade flag bit is specifically used to indicate that the upgrade mode of the upgrade is the upgrade of the inner card.
For example, if the upgrade flag bit of the external card upgrade is designated as "factor_sd_update", and the upgrade flag bit of the internal card upgrade is designated as "factor_flash_update", the replacement of the upgrade flag bit recorded in the mis partition in this embodiment essentially replaces "factor_sd_update" with "factor_flash_update", so that if the process from the burn-in version to the user version is interrupted, after the next retrigger, the upgrade can be performed according to the internal card upgrade process without judging again, and the processing process is simplified.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
In addition, it should be noted that if it is determined through the above determination that the current upgrade does not satisfy the upgrade of the inside card, since the flow of the upgrade of the inside card has already been entered, the current upgrade may be ended in this case.
Correspondingly, after finishing the upgrading, if the upgrading instruction is received again, the electronic equipment responds to the upgrading instruction and reenters the engineering mode. Then, the Recovery process reads the replaced upgrade flag bit, for example, "factor_flash_update", from the risc partition, obtains the first upgrade package from the user data partition, and then performs the step of determining whether the partition information of the system partition recorded in the second partition table is identical to the partition information of the system partition recorded in the first partition table according to the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package. Thus, the step of judging whether the external card is upgraded or not can be skipped, and the processing flow is simplified.
In addition, it should be noted that in some implementation manners, a process of triggering to mount the external storage device when the current upgrade is determined not to satisfy the upgrade of the inner card, and then loading the upgrade data in the second upgrade package from the external storage device to upgrade the electronic device from the burn-in version to the user version may be set.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
In addition, it should be further noted that if the upgrade flag bit indicates that the upgrade mode of the upgrade is an external card upgrade and the first upgrade package does not exist in the user data partition, the electronic device may mount an external storage device, for example, an SD card, or a usb disk, or an OTG.
Correspondingly, after the external storage device is successfully mounted (any one of the external storage device is successfully mounted), loading a third partition table in the second upgrade package from the external storage device; and then updating the first partition table according to the third partition table, re-creating a mapping relation between the equipment nodes of the partitions in the memory and the memory according to the partition information recorded in the updated first partition table, and writing the image file corresponding to each partition in the second update package into the corresponding partition in the memory.
When the internal card cannot be used for upgrading, the external storage device is loaded, and upgrading data in the upgrading package, such as a third partition table and an image file of a partition, are read from the external storage device, so that whether the electronic device supports the internal card upgrading or not can be ensured, the electronic device can be upgraded from a burn-in version to a user version, and the success of the upgrading is ensured.
And 104, when the upgrade meets the requirement of the internal card upgrade, writing the image files corresponding to the partitions except the user data partition in the first upgrade package into the corresponding partitions in the memory according to the first partition table.
Specifically, when the upgrade satisfies the internal card upgrade, that is, the partition information of the system partition recorded in the first partition table is the same as the partition information of the system partition recorded in the second partition table, so that the image files corresponding to the partitions except the user data partition in the first upgrade package can be written into the corresponding partitions in the flash according to the first partition table currently stored in the flash without updating the first partition table.
In addition, it can be understood that, because the partition information of the system partition recorded in the first partition table is the same as the partition information of the system partition recorded in the second partition table, in some implementations, the image file corresponding to the partition except the user data partition in the first upgrade package may also be written into the corresponding partition in the flash according to the second partition table.
In addition, it should be noted that, because the partition information of the system partition and the partition information of the user data partition are recorded in the second partition table corresponding to the user version, that is, the partition information of the exclusive partition specific to the burn-in version is not recorded, the above-mentioned writing the image files corresponding to the partitions except the user data partition in the first upgrade package into the corresponding partition in the flash, specifically, writing the image files corresponding to the system partitions in the first upgrade package into the corresponding partition in the flash.
For example, the boot-related image boot. Img is written to the boot partition, and the system image super. Img (integrated with the android system core) is written to the super partition.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
Step 105, upgrade the first partition table according to the second partition table.
It is understood that, since the second partition table is stored in the upgrade package, there may be a case where the format of partition information recorded in the second partition table is different from the format of partition information recorded in the first partition table. Therefore, in order to upgrade the first partition table successfully according to the second partition table, when the Recovery process upgrades the first partition table according to the second partition table, the Recovery process may analyze the partition information recorded in the second partition table first, and then upgrade the partition information recorded in the first partition table according to the analyzed partition information recorded in the second partition table.
For example, in some implementations, the format of the partition information recorded in the first partition table may be determined first, and then the partition information recorded in the second partition table may be parsed according to the format of the partition information recorded in the first partition table.
For example, in other implementations, a unified format may be pre-agreed, and then the partition information recorded in the first partition table is parsed and the partition information recorded in the second partition table is parsed according to the agreed unified format, so as to ensure that the formats of the partition information recorded in the two partition tables are the same.
In addition, in general, when the partition information recorded in the first partition table is updated according to the partition information recorded in the second partition table after the analysis, the partition information recorded in the second partition table may be directly replaced with all the partition information recorded in the first partition table, or may be replaced with only a different part, for example, the partition information of the system partition recorded in the first partition table is kept unchanged, and the partition information of the other partitions (the exclusive partition and the user data partition) is replaced with the partition information of the user data partition in the second partition table.
For example, the replacement mode may be an overwriting mode, or all partition information recorded in the first partition table is deleted first, then the partition information recorded in the second partition table after parsing is written into the first partition table, or the first partition table is directly deleted from the memory, and then the second partition table is entirely stored in the memory.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
In addition, it should be further understood that if an external card upgrade mode is adopted when the electronic device is upgraded from the burn-in version to the user version, the format conversion may also be performed on the third partition table in the second upgrade package, and then the operation of upgrading the first partition table according to the third partition table is performed, where the format conversion mode may refer to the conversion mode of the second partition table, which is not described herein again.
Accordingly, the operation of updating the first partition table according to the third partition table may be to directly replace all partition information recorded in the first partition table with partition information recorded in the third partition table, and regarding the replacing manner, the replacing manner may refer to the manner of replacing all partition information recorded in the first partition table with partition information recorded in the second partition table, which is not described herein again.
And 106, re-creating the mapping relation between the device nodes of the partitions in the memory and the memory according to the updated first partition table.
After the first partition table is updated by adopting the method of upgrading the inner card, the mapping relationship between the device nodes of the partition in the memory and the memory is re-created according to the updated first partition table, and the method specifically comprises the following two steps: (1) The mapping relation between the equipment nodes of the system partition in the memory and the memory is re-established according to the partition information of the system partition recorded in the updated first partition table; (2) And re-creating the mapping relation between the equipment nodes of the user data partition in the memory and the memory according to the partition information of the user data partition recorded in the updated first partition table, and merging the space occupied by the proprietary partition into the user data partition. Because the user data partition can directly format and create the file system without upgrading the image file, the upgrade from the burn-in version to the user version can be completed quickly and efficiently by combining the special partition under the burn-in version into the user data partition.
In addition, in practical application, no matter in the internal card upgrading mode or the external card upgrading mode, when the mapping relationship between the device nodes of the partition in the memory and the memory is re-created according to the updated first partition table after the first partition table is upgraded, the method can be specifically implemented as follows.
For example, in some implementations, regarding the manner of recreating the mapping relationship between the device node of the partition in the memory and the memory according to the partition information recorded in the updated first partition table, for example, the starting position and the ending position of each partition may be determined according to the partition information recorded in the updated first partition table, and then the mapping relationship between the device node of the partition in the memory and the memory may be recreated according to the starting position and the ending position of each partition.
For example, in other implementations, regarding the manner of recreating the mapping relationship between the device node and the memory of the partition in the memory according to the partition information recorded in the updated first partition table, for example, the starting position and the offset of each partition may be determined first according to the partition information recorded in the updated first partition table; and then, the mapping relation between the device nodes of the partition in the memory and the memory is re-created according to the starting position and the offset of each partition.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
And step 107, formatting the user data partition, and creating a file system corresponding to the formatted user data partition according to the mapping relation.
Therefore, the upgrading of the electronic equipment from the burn-in version to the user version can be completed by formatting the user data partition and creating a file system corresponding to the formatted user data partition.
In addition, by formatting the user data partition, the first upgrade package pre-stored in the user data partition can be deleted, so that the upgrade version is prevented from flowing out.
In addition, after the user data partition is formatted and a file system corresponding to the formatted user data partition is created according to the mapping relationship, the upgrade flag bit recorded in the MIsc partition can be cleared. Therefore, after the electronic equipment is upgraded from the burn-in version to the user version, the upgrading process is not executed by the electronic equipment because of the operation of the user after the electronic equipment leaves a factory and is put into use by clearing the upgrading zone bit recorded in the MIsc partition.
According to the upgrading method provided by the embodiment, through setting the inner card upgrading conditions and when determining whether the upgrading meets the inner card upgrading conditions or not, firstly writing the image files corresponding to the partitions except the user data in the first upgrading packet into the corresponding partitions in the memory according to the first partition table, upgrading the first partition table according to the second partition table, re-creating the mapping relation between the equipment nodes of the partitions in the memory according to the upgraded first partition table, and further creating the file system corresponding to the formatted user data partitions according to the mapping relation after the user data partitions are formatted, the problem that the first upgrading packet cannot be found after partition change is needed to be overcome in the inner card upgrading is solved, so that when the electronic equipment is upgraded from a burned version to a user version, the image files of all the partitions are still written into the correct positions under the condition that the partition table is changed, and the limitation of the transmission speed of external storage equipment such as an SD card and a U disk can be overcome.
In addition, by storing the first upgrade package in the user data partition of the memory of the electronic device, the upgrade operation does not need to plug and unplug an external memory device, so that the user operation is simplified, and the stability is higher.
In order to better understand the upgrading method provided in the present application, the following embodiments are specifically described with reference to fig. 3 to 9 in terms of various scenarios to which the upgrading method provided in the present application is applicable.
Exemplary, referring to fig. 3, the specific implementation steps of this embodiment include:
in step 201, in response to the received upgrade instruction, the electronic device is triggered to restart.
For example, in some implementations, the upgrade instruction received by the electronic device may be sent to the electronic device by a PC device that establishes a communication connection with the electronic device, or may be generated by the electronic device when a home key and a power-on key of the electronic device are pressed simultaneously.
It can be appreciated that the electronic device will restart after receiving the upgrade instruction, regardless of the manner in which the upgrade instruction is received.
Step 202, when the electronic device is started, a start flag bit recorded in the MIsc partition is read.
For example, after the electronic device triggers the electronic device to restart in response to the received upgrade instruction, when the electronic device enters the startup procedure, the electronic device accesses the MIsc partition first, and reads the startup flag bit recorded in the MIsc partition.
It can be understood that the start flag bit in this embodiment is specifically used to indicate which mode the electronic device enters in the current start operation.
By way of example, regarding modes that an electronic device may enter, for example, normal mode, recovery mode, and the like may be included.
In the normal mode, the electronic device loads the data of the basic partition, the data of the static partition and the data of the dynamic partition in sequence in the starting process, so that the electronic device runs to the operating system currently installed by the electronic device.
In addition, it should be noted that, regarding the start flag bit for indicating different start modes, it may be pre-agreed and written into the mis partition. The starting flag bit is not limited in this embodiment, and for example, the manner of writing to the mig partition may be referred to the existing standard, and will not be described here.
Step 203, it is determined whether the start flag bit indicates to enter the Recovery mode.
Specifically, if the start flag bit read from the misc partition indicates that the electronic device is started up at this time, or enters the Recovery mode, that is, indicates to enter the normal mode, step 204 is executed; if the start flag bit read from the misc partition indicates that the current start-up electronic device needs to enter the Recovery mode, step 205 is performed.
Step 204, normal start-up.
It will be appreciated that the normal start-up in step 204 is to put the electronic device into a normal mode. Therefore, the electronic device can sequentially load the data of the basic partition, the data of the static partition and the data of the dynamic partition in the starting process, so that the electronic device can be operated to the operating system currently installed by the electronic device.
Details of the specific start-up of different system partition structures, such as an AB system partition structure, a virtual AB system partition structure, and a non-AB system partition structure, may be found in the existing standards and will not be described in detail herein.
Step 205, load Recovery mirror image, enter Recovery mode.
It can be appreciated that when the Recovery image is loaded and the Recovery process is started after the Recovery image enters the Recovery mode, that is, the upgrade operation performed in the Recovery mode is performed by the Recovery process.
Step 206, reading the upgrade flag bit recorded in the MIsc partition.
It is to be noted that, step 206 in this embodiment is substantially the same as step 102 in the above embodiment, and specific implementation details may be referred to the description of step 102, which is not repeated here.
Step 207, it is determined whether the upgrade flag bit indicates an upgrade of the external card.
It can be understood that, as can be seen from the description of the above embodiment, when the electronic device first enters the Recovery mode from the burn-in version to perform the upgrade operation, the upgrade flag bit recorded in the mis partition does not indicate the upgrade of the inner card, and whether the upgrade of the inner card is adopted is judged if the upgrade flag bit indicates the upgrade of the outer card, and the upgrade process of the inner card is triggered only if the upgrade flag bit meets the condition of the upgrade of the inner card, so after the upgrade flag bit is read from the mis partition, whether the upgrade flag bit is the upgrade flag bit indicating the upgrade of the outer card is judged.
Accordingly, if the upgrade flag bit is not the upgrade flag bit indicating the upgrade of the external card, executing other operation flows indicated by the upgrade flag bit, i.e., executing step 208; if the upgrade flag bit is an upgrade flag bit, e.g., "factor_sd_update", indicating an upgrade of the external card, step 209 is performed.
Step 208, other operational flows.
Illustratively, if the upgrade flag bit is an upgrade flag bit indicating an OTA upgrade, e.g., "factor OTA update," an iterative upgrade of the version of the current operating system is performed. Specifically, if the electronic device is currently upgraded to the user version, the operation flow to be performed is an iterative upgrade to the user version, and if the electronic device is currently under the burn-in version, the electronic device is an iterative upgrade to the burn-in version.
Illustratively, if the upgrade flag bit is an upgrade flag bit, e.g., "factor_reset," indicating a factory reset, then the operation to restore the factory settings is performed.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
Step 209, find the upgrade package.
Specifically, since the upgrade flag bit read from the MIsc partition indicates that the external memory device, such as an SD card, or a usb disk, or an OTG, is to be mounted in normal conditions, and then the upgrade package is searched from the external memory device that is successfully mounted. However, in order to preferentially adopt the inner card upgrade mode under the condition of the upgrade scheme provided by the embodiment, the outer card upgrade is indicated by the upgrade flag bit read from the misc partition, and when the upgrade package is searched, the upgrade package can be searched under the appointed path of the userdata partition.
In addition, it should be noted that, since the userdata partition has a file system, when the update package is stored and searched, the update package is stored and searched not by the start position and the end position of the update package, but by the file system recording the actual position of the update package after the update package is placed at a certain position, for example, a/data/update, so the above-mentioned user data partition searches the update package, which is essentially to the position specified in the file system, for example, the position of the/data/update.
In addition, the mounting specifically refers to mounting the external storage device under a specified path, so that the electronic device can access the external storage device, and read the upgrade data in the upgrade package from the external storage device, for example, a partition table, an image file corresponding to each partition, and the like.
In addition, it should be noted that, in a specific implementation, not only the external storage device needs to be mounted, but also the userdata partition needs to be mounted, so that the upgrade package can be searched at the position of/data/update.
For example, for OTG, when the OTG is inserted into a corresponding data interface on an electronic device, such as the external memory interface 120, or the USB interface 130, a device node is created on the dev/block, and this node represents the OTG, but is just a node, and cannot access the content in the OTG, and if the node corresponding to the userdata partition is also under the dev/block, the node cannot be directly accessed by accessing the userdata partition, and the userdata partition needs to be mounted on the data directory to be accessed. OTG is also the same and must be mounted for access.
In addition, it should be noted that, since the nodes corresponding to the SD card and the OTG (corresponding to the disk) are fixed, when the SD card is mounted, whether the nodes exist or not is checked, when the SD card exists, the mounting is performed, and when the nodes exist, the mounting is performed according to the sequence, the OTG is mounted, the SD card is not found or mounted, the SD card is mounted, and the SD card is mounted.
Based on the above-mentioned mounting and searching principle, in practical application, if it is agreed that when the electronic device is updated from the burn-in version to the user version, the external card is preferentially used for updating, then when the update package is searched, mounting is performed according to the sequence allocated to the SD card and the OTG, if the current sequence is that the OTG is first mounted, the OTG is removed from the mounting to find the update package, the SD card is removed from the mounting to mount the SD card, and the SD card is removed from the mounting to find the update package. If the SD card is not mounted, or the upgrade package cannot be found, an inner card upgrade mode is considered to be adopted, namely, the user data partition is mounted to the data catalog, then the upgrade package is found under the/data/update path, and if the SD card is not mounted, or the upgrade package cannot be found, the upgrade process is exited, and the user reason is prompted.
Based on the above-mentioned mounting and searching principle, in practical application, if it is agreed that when the electronic device is updated from the burn-in version to the user version, the internal card is preferentially used for updating, then when the upgrade package is searched, the userdata partition is firstly mounted to the data directory, then the upgrade package is searched under the/data/update path, if the upgrade package is not mounted, or the upgrade package cannot be searched, the external card is considered to be adopted for updating, that is, mounting is performed according to the sequence allocated to the SD card and the OTG, if the current sequence is that the OTG is firstly mounted, the OTG is firstly found when the upgrade package is mounted, the SD card is firstly mounted, the upgrade package is firstly found, if the SD card is also not mounted, or the upgrade package is not found, the current upgrade flow is exited, and the user is prompted.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
Step 210, determining whether the path of the upgrade package is/data/update.
Specifically, if the path of the upgrade package is not/data/update, for example, is the path corresponding to the SD card or the path corresponding to the OTG, that is, the upgrade package does not exist in the userdata partition, the upgrade cannot be performed by using the inner card, and only the upgrade can be performed by using the outer card, which is the case, step 211 is executed; if the path of the upgrade package is/data/update, that is, it indicates that the userdata partition has an upgrade package, the upgrade may be performed by using an add-in card, in which case step 212 is performed.
Step 211, the external card upgrade process.
For example, referring to fig. 4, the implementation process of the external card upgrade procedure specifically includes:
in sub-step 210-1, it is checked whether the second upgrade package is qualified.
It should be noted that, for convenience of distinction, in this embodiment, the partition table still stored in the flash, that is, the partition table already existing in the electronic device is referred to as a first partition table, the upgrade package found from the userdata partition is referred to as a first upgrade package, the partition table in the first upgrade package is referred to as a second partition table, the upgrade package found from the external storage device is referred to as a second upgrade package, and the partition table in the second upgrade package is referred to as a third partition table.
Therefore, when the searched upgrade package is from the external storage device, that is, the second upgrade package, before the first partition table is refreshed according to the third partition table, it is necessary to check whether the second upgrade package is qualified.
Illustratively, in some implementations, the partition information recorded in the third partition table may be checked against a cyclic redundancy check code (Cyclic Redundancy Check, CRC) recorded in the third partition table, and whether the image file is complete, error-free.
Accordingly, after determining that the second upgrade package is qualified, a sub-step 210-2 may be performed, otherwise, a sub-step 210-7 may be performed, and the upgrade fails, for example, the upgrade is ended, and the reason for the upgrade failure is fed back to the user.
In sub-step 210-2, the first partition table is refreshed according to the third partition table in the second upgrade package.
For example, in some implementations, the format of the partition information recorded in the first partition table may be determined first, and then the partition information recorded in the third partition table may be parsed according to the format of the partition information recorded in the first partition table.
For example, in other implementations, a unified format may be pre-agreed, and then the partition information recorded in the first partition table is parsed and the partition information recorded in the third partition table is parsed according to the agreed unified format, so as to ensure that the formats of the partition information recorded in the two partition tables are the same.
In addition, in general, when the partition information recorded in the first partition table is updated according to the partition information recorded in the third partition table after the analysis, the partition information recorded in the third partition table may be directly replaced with all the partition information recorded in the first partition table, or only a different portion may be replaced, for example, the partition information of the system partition recorded in the first partition table is kept unchanged, and the partition information of the other partitions (the exclusive partition and the user data partition) may be replaced with the partition information of the user data partition in the third partition table.
For example, the replacement mode may be an overwriting mode, or all partition information recorded in the first partition table is deleted first, then the partition information recorded in the third partition table after parsing is written into the first partition table, or the first partition table is directly deleted from the memory, and then the third partition table is entirely stored in the memory.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
Sub-step 210-3 reloads the partition according to the refreshed first partition table.
It is to be noted that, in this embodiment, the sub-step 210-3 is substantially the same as the step 106 in the above embodiment, and specific implementation details may be referred to the description of the step 106, which is not repeated here.
And a sub-step 210-4 of writing the image files of all the partitions in the second upgrade package into the corresponding reloaded partitions.
For example, the image file corresponding to the system partition is written into the reloaded system partition, and the image file corresponding to the user data partition is written into the reloaded user data partition.
In substep 210-5, the upgrade flag bit recorded in the MIsc partition is cleared.
Therefore, after the electronic equipment is upgraded from the burn-in version to the user version, the upgrading process is not executed by the electronic equipment because of the operation of the user after the electronic equipment leaves a factory and is put into use by clearing the upgrading zone bit recorded in the MIsc partition.
Sub-step 210-6, reboots the electronic device.
Thus, after restarting the electronic device, the electronic device may be upgraded from the burn-in version to the user version.
Substep 210-7, the upgrade fails.
The upgrade procedure for upgrading the external card is described here, and details not described in this embodiment can be found in the existing standard, and will not be described here again.
Step 212, modify the upgrade flag bit of the misc partition record.
For example, if the default upgrade flag bit "factor_flash_update" is used to indicate that the upgrade mode of the upgrade is the inside card upgrade, and the default upgrade flag bit "factor_sd_update" is used to indicate that the upgrade mode of the upgrade is the outside card upgrade, the upgrade flag bit of the modified misc partition record in step 212 may be, for example, the "factor_sd_update" is replaced with the "factor_flash_update", so that if the process of upgrading from the burn-in version to the user version is interrupted, after the next retrigger, the upgrade can be performed according to the inside card upgrade process without further judgment, thereby simplifying the processing flow.
Step 213, checking whether the upgrade package is qualified.
It will be appreciated that the manner of checking whether the upgrade package (here, the first upgrade package) is acceptable is substantially the same as the manner of checking whether the second upgrade package is acceptable, that is, whether the partition information recorded in the second partition table, and the image file, are complete and error-free may be checked according to the cyclic CRC recorded in the second partition table.
Accordingly, after determining that the first upgrade package is qualified, step 214 may be executed, otherwise step 215 is executed, and the upgrade fails, for example, the upgrade is ended, and the reason for the upgrade failure is fed back to the user.
Step 214, it is determined whether the inside card upgrade is satisfied.
As can be seen from the description of the above embodiments, the premise of the upgrade of the add-in card is to ensure that the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table, and that the system partition needs to be placed before the userdata partition, and that the proprietary partition specific to the burn-in version needs to be immediately adjacent to the userdata partition, which is described below in connection with fig. 5 for better understanding.
For example, referring to fig. 5, if the electronic device is currently in a burn-in version, and the burn-in version includes a system partition, a proprietary partition, and a user data partition (userdata partition), while the system partition includes a mboot partition, a boot partition, a..the super partition, a version partition, a reload partition, etc., the proprietary partition includes flash_imaging, etc. Then, the user version to be upgraded needs to include a system partition and a user data partition, and the system partition also needs to include a mboot partition, a boot partition, a..the above partition, a version partition, a load partition, and the like, and the positions and the occupied spaces of the system partitions are the same.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment. In practice, the system partition may include any one or several of the above listed partitions, or partitions other than the above listed partitions, which are not listed here, and the embodiment is not limited thereto.
Step 215, upgrade fails.
For example, when the upgrade fails and the upgrade process is finished, the specific reason of the upgrade failure can be fed back to the user (such as a server of a manufacturer), so that the technician can quickly locate and solve the problem according to the feedback reason.
And step 216, upgrading the partition outside the userdata partition according to the first partition table and the upgrading package.
With continued reference to fig. 5, in step 216, the partitions other than the userdata partition are updated according to the first partition table and the upgrade package, specifically, the partition information of the system partitions and the image files of the system partitions in the first upgrade package recorded in the first partition table are updated, for example, the image files corresponding to the mboot partition are written into the mboot partition, the image files corresponding to the boot partition are written into the boot partition, the image files corresponding to the super partition are written into the super partition, the image files corresponding to the version partition are written into the version partition, and the image files corresponding to the reload partition are written into the reload partition.
In addition, it should be noted that, in practical application, the writing sequence of the image files corresponding to different system partitions is specifically determined according to one script file in the first upgrade package.
Illustratively, in some implementations, it may be agreed that each line of the script file represents a command, and when step 216 is performed, the command corresponding to each line in the script file is parsed, and then control of the upgrade order is implemented according to the commands.
For example, in some implementations, the name of the script file may be agreed to be "updater-script", and for a line of commands currently read in the script file, for example, "write_raw_image", "/dev/block/boot/by-name/tvconfig", "0") "is known by parsing, specifically writing the image file tvconfig.
It will be appreciated that a "0" in the above command represents tvconfig. Img this image file is in a non-sparse matrix (spark) format.
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
Step 217, refreshing the first partition table according to the second partition table in the upgrade package.
In addition, as can be seen from the above description, in order to unify the formats of the first partition table and the second partition table, the second partition table may be parsed into the format of the first partition table, or both partition tables may be parsed into a agreed unified format.
For convenience of explanation, this embodiment will be described by taking a format of parsing the second partition table into the first partition table as an example.
Illustratively, assume that the format of the first partition table is as shown in FIG. 6. Wherein each ENTRY represents a partition, and for different entries, the sequence numbers are used, for example ENTRY [1] represents the first partition, the partition name is "super", the start position is "0x00290000", the End position End is "0x009F3FFF", and the Size is "3967811584Bytes"; ENTRY [2] represents a second partition with a partition name of "version", a start position of "0x009F4000", an End position of "0x00A73FFF", and a Size of "268435456Bytes"; enTRY [3] represents a third partition, the partition name is "preload", the start position is "0x00A74000", the End position End is "0x00B6FFFF", and the Size is "528482304Bytes"; ENTRY [4] represents a fourth partition with a partition name of "flash_aging", a start position of "0x00B70000", an End position of "0x00C6FFFF", and a Size of "536870912Bytes"; ENTRY [5] represents a fifth partition with a partition name of "userdata", a start position of "0x00C70000", an End position of "0x0150D7FF", and a Size of "4625268736Bytes".
For example, referring to fig. 7, a data format before the second partition table is parsed is shown, in which bare data is recorded, that is, pure data, no simple analysis is performed on the data or no basis is made for the source of the data. Therefore, it is impossible to know which partition (partition name) corresponds to each line of data, and the information such as the start position, end position, and partition size of the current partition recorded therein. Therefore, it is necessary to analyze the data to obtain the partition information corresponding to which partition (partition name) each line of data is, wherein the information such as the start position, end position, and partition size of the current partition is recorded. Therefore, in this embodiment, after the second partition table is parsed according to the format shown in fig. 6, the obtained content may be as shown in fig. 8, for example.
For example, see fig. 8. Each ENTRY represents a partition, and for different entries, the sequence numbers are used, for example ENTRY [1] represents the first partition, the partition name is "super", the start position is "0x00290000", the End position End is "0x009F3FFF", and the Size is "3967811584Bytes"; ENTRY [2] represents a second partition with a partition name of "version", a start position of "0x009F4000", an End position of "0x00A73FFF", and a Size of "268435456Bytes"; enTRY [3] represents a third partition, the partition name is "preload", the start position is "0x00A74000", the End position End is "0x00B6FFFF", and the Size is "528482304Bytes"; ENTRY [4] represents a fourth partition with a partition name of "userdata", a start position of "0x00B70000", an End position of "0x0150D7FF", and a Size of "999397785Bytes".
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
In addition, for a more intuitive understanding of step 217, the following description is made in connection with fig. 9.
For example, referring to fig. 9, if the partition information recorded in the first partition table in the electronic apparatus has partition information of three general types of partitions of a system partition (start position a, end position B, sizeS 1), a proprietary partition (start position C, end position D, sizeS 2), a user data partition (start position E, end position F, sizeS 3), and the partition information recorded in the second partition table has partition information of two general types of partitions of a system partition (start position a, end position B, sizeS 1), a user data partition (start position C, end position F, sizeS 4), and SizeS4 is the sum of Size2 and SizeS. If the first partition table is updated according to the second partition table, the partition information recorded in the updated first partition packet is: partition information of two main types of partitions, namely, a system partition (a starting position A, an ending position B, sizeS 1) and a user data partition (a starting position C, an ending position F, sizeS 4).
It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not to be taken as the only limitation of the present embodiment.
Step 218, reloading the partition according to the refreshed first partition table.
It should be noted that, in this embodiment, the partition is reloaded according to the refreshed first partition table, which specifically means that the mapping relationship between the device node of the partition in the memory and the memory is recreated according to the refreshed first partition table.
Illustratively, the starting address, ending address, and size of each partition after reloading are as shown in FIG. 9, and the form of the partition after reloading may be changed from the burn-in version shown in FIG. 5 to the user version.
Step 219, formatting userdata and creating a file system.
It should be noted that, some generated data may be generated before the userdata partition is formatted, including the set data, the installation data of the Android application installation package (Android application package, APK), and the like. After formatting the userdata partition, the data, including the first upgrade package, is purged, thereby preventing version overflow.
Accordingly, after formatting the userdata partition, the data is reinstalled and generated when the electronic device is restarted.
Further, as can be seen from the description of the above embodiments, the operation of creating a file system in step 219 is specifically created according to the mapping relationship created in step 218 in practical application, that is, the file system corresponding to the formatted user data partition is created according to the mapping relationship.
Step 220, the upgrade flag bit recorded in the MIsc partition is cleared.
Therefore, after the electronic equipment is upgraded from the burn-in version to the user version, the upgrading process is not executed by the electronic equipment because of the operation of the user after the electronic equipment leaves a factory and is put into use by clearing the upgrading zone bit recorded in the MIsc partition.
Step 221, restarting the electronic device.
Thus, after restarting the electronic device, the electronic device may be upgraded from the burn-in version to the user version.
The specific implementation flow for upgrading the electronic device from the burn-in version to the user version provided in this embodiment is described here, and details not described in this embodiment may refer to the description of the embodiment shown in fig. 1, which is not repeated here.
Furthermore, it should be understood that the electronic device, in order to achieve the above-described functions, includes corresponding hardware and/or software modules that perform the respective functions. The steps of an algorithm for each example described in connection with the embodiments disclosed herein may be embodied in hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application in conjunction with the embodiments, but such implementation is not to be considered as outside the scope of this application.
In addition, it should be noted that, in an actual application scenario, the upgrade method provided in the foregoing embodiments implemented by the electronic device may also be performed by a chip system included in the electronic device, where the chip system may include a processor. The chip system may be coupled to a memory such that the chip system, when running, invokes a computer program stored in the memory, implementing the steps performed by the electronic device described above. The processor in the chip system can be an application processor or a non-application processor.
In addition, the embodiment of the application further provides a computer readable storage medium, wherein computer instructions are stored in the computer readable storage medium, and when the computer instructions run on the electronic device, the electronic device is caused to execute the related method steps to implement the upgrading method in the embodiment.
In addition, the embodiment of the application further provides a computer program product, when the computer program product runs on the electronic device, the electronic device is caused to execute the related steps, so as to realize the upgrading method in the embodiment.
In addition, embodiments of the present application also provide a chip (which may also be a component or module) that may include one or more processing circuits and one or more transceiver pins; the transceiver pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the related method steps to implement the upgrading method in the above embodiment, so as to control the receiving pin to receive signals and control the transmitting pin to transmit signals.
In addition, as can be seen from the foregoing description, the electronic device, the computer-readable storage medium, the computer program product, or the chip provided in the embodiments of the present application are used to perform the corresponding methods provided above, and therefore, the advantages achieved by the method can refer to the advantages in the corresponding methods provided above, which are not repeated herein.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (12)

1. An upgrade method, applied to an electronic device, comprising:
responding to the received upgrade instruction, and entering an engineering mode;
acquiring an upgrade flag bit, wherein the upgrade flag bit is used for indicating an upgrade mode of the upgrade;
when the upgrade flag bit indicates that the upgrade mode of the upgrade is an external card upgrade and a first upgrade package exists in a user data partition of a memory of the electronic device, determining whether the upgrade meets the upgrade of an internal card according to partition information recorded in a first partition table stored in the memory and partition information recorded in a second partition table stored in the first upgrade package, wherein the upgrade of the internal card is an upgrade mode of loading upgrade data from the user data partition, and the upgrade of the external card is an upgrade mode of loading upgrade data from an external storage device mounted on the electronic device;
When the upgrade meets the requirement of the internal card upgrade, according to the first partition table, writing image files corresponding to the partitions except the user data partition in the first upgrade package into the corresponding partitions in the memory;
upgrading the first partition table according to the second partition table;
re-creating a mapping relation between the equipment nodes of the partition in the memory and the memory according to the updated first partition table;
and formatting the user data partition, and creating a file system corresponding to the formatted user data partition according to the mapping relation.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the partition information of the system partition, the partition information of the special partition corresponding to the burn-in version and the partition information of the user data partition are recorded in the first partition table, and the partition information of the system partition, the partition information of the special partition and the partition information of the user data partition are recorded in the first partition table according to the sequence of the system partition, the special partition and the user data partition;
the partition information of the system partition and the partition information of the user data partition are recorded in the second partition table, and the partition information of the system partition and the partition information of the user data partition are recorded in the second partition table according to the sequence of the system partition and the user data partition;
The first partition table corresponds to a burn-in version, the second partition table corresponds to a user version, and the system partition is a partition of both the burn-in version and the user version.
3. The method according to claim 2, wherein determining whether the upgrade satisfies an inside card upgrade according to partition information recorded in a first partition table stored in the memory and partition information recorded in a second partition table stored in the first upgrade package, comprises:
determining whether the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table according to the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package;
when the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table, determining that the upgrade meets the inner card upgrade;
and when the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table, determining that the upgrade does not meet the requirement of the internal card upgrade.
4. The method of claim 3, wherein determining whether the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table based on the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package, comprises:
determining a first starting position and an occupied first space size of the system partition recorded in a first partition table according to partition information recorded in the first partition table stored in the memory;
determining a second starting position and an occupied second space size of the system partition recorded in the second partition table according to partition information recorded in the second partition table stored in the first upgrade package;
when the first starting position is the same as the second starting position and the first space size is the same as the second space size, determining that partition information of the system partition recorded in the second partition table is the same as partition information of the system partition recorded in the first partition table;
Otherwise, determining that the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table.
5. The method of claim 3, wherein determining whether the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table based on the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package, comprises:
determining a first starting position and a first ending position of the system partition recorded in a first partition table according to partition information recorded in the first partition table stored in the memory;
determining a second starting position and a second ending position of the system partition recorded in the second partition table according to the partition information recorded in the second partition table stored in the first upgrade package;
when the first starting position is the same as the second starting position and the first ending position is the same as the second ending position, determining that the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table;
Otherwise, determining that the partition information of the system partition recorded in the second partition table is different from the partition information of the system partition recorded in the first partition table.
6. The method of claim 2, wherein the recreating the mapping relationship between the device nodes of the partition in the memory and the memory according to the updated first partition table comprises:
the mapping relation between the equipment nodes of the system partition in the memory and the memory is re-established according to the partition information of the system partition recorded in the updated first partition table;
and re-creating a mapping relation between equipment nodes of the user data partition in the memory and the memory according to the partition information of the user data partition recorded in the updated first partition table, and merging the space occupied by the special partition into the user data partition.
7. The method of any one of claims 1 to 6, wherein the upgrade flag bit is recorded in a misc partition of the memory, the misc partition being used to record system setting information;
Before determining whether the upgrade meets the inner card upgrade according to the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrade package, the method further includes:
and replacing the upgrade flag bit recorded in the MIsc partition, wherein the upgrade flag bit after replacement is used for indicating that the upgrade mode of the upgrade is the upgrade of the inner card.
8. The method of claim 7, wherein the method further comprises:
ending the upgrade when the upgrade is determined to not meet the upgrade of the inner card;
after finishing the upgrading, if the upgrading instruction is received again, responding to the upgrading instruction, and reentering the engineering mode;
and reading the replaced upgrading flag bit from the misc partition, acquiring the first upgrading packet from the user data partition, and executing the step of determining whether the partition information of the system partition recorded in the second partition table is the same as the partition information of the system partition recorded in the first partition table according to the partition information recorded in the first partition table stored in the memory and the partition information recorded in the second partition table stored in the first upgrading packet.
9. The method of claim 8, wherein after creating a file system corresponding to the user data partition after formatting according to the mapping relationship, the method further comprises:
and clearing the upgrade flag bit recorded in the misc partition.
10. The method according to any one of claims 1 to 6, further comprising:
when the upgrade flag bit indicates that the upgrade mode of the upgrade is the upgrade of the external card and the first upgrade package does not exist in the user data partition, mounting external storage equipment;
after the external storage device is successfully mounted, loading a third partition table in a second upgrade package from the external storage device;
upgrading the first partition table according to the third partition table;
the mapping relation between the equipment nodes of the partition in the memory and the memory is re-established according to the partition information recorded in the updated first partition table;
and writing the image file corresponding to each partition in the second upgrade package into the corresponding partition in the memory.
11. An electronic device, the electronic device comprising: a memory and a processor, the memory and the processor coupled; the memory stores program instructions that, when executed by the processor, cause the electronic device to perform the upgrade method of any one of claims 1-10.
12. A computer readable storage medium comprising a computer program which, when run on an electronic device, causes the electronic device to perform the upgrade method of any one of claims 1 to 10.
CN202210390468.0A 2022-04-14 2022-04-14 Upgrade method, device and storage medium Active CN115562697B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210390468.0A CN115562697B (en) 2022-04-14 2022-04-14 Upgrade method, device and storage medium
CN202310475784.2A CN116909610A (en) 2022-04-14 2022-04-14 Upgrade method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210390468.0A CN115562697B (en) 2022-04-14 2022-04-14 Upgrade method, device and storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202310475784.2A Division CN116909610A (en) 2022-04-14 2022-04-14 Upgrade method, device and storage medium

Publications (2)

Publication Number Publication Date
CN115562697A CN115562697A (en) 2023-01-03
CN115562697B true CN115562697B (en) 2023-05-23

Family

ID=84736908

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202310475784.2A Pending CN116909610A (en) 2022-04-14 2022-04-14 Upgrade method, device and storage medium
CN202210390468.0A Active CN115562697B (en) 2022-04-14 2022-04-14 Upgrade method, device and storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310475784.2A Pending CN116909610A (en) 2022-04-14 2022-04-14 Upgrade method, device and storage medium

Country Status (1)

Country Link
CN (2) CN116909610A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176824A (en) * 2013-03-15 2013-06-26 青岛海信移动通信技术股份有限公司 System upgrade method and system upgrade device
CN103645918A (en) * 2013-12-10 2014-03-19 深圳市道通科技有限公司 Software upgrading method and device for industrial endoscope
CN103853565A (en) * 2012-11-28 2014-06-11 京信通信系统(中国)有限公司 Method and device for firmware upgrading based on ARM
CN113867764A (en) * 2021-09-28 2021-12-31 重庆长安汽车股份有限公司 Method and system for upgrading vehicle MCU through multiple channels

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009211132A (en) * 2008-02-29 2009-09-17 Hitachi Ltd Storage system and data migration method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103853565A (en) * 2012-11-28 2014-06-11 京信通信系统(中国)有限公司 Method and device for firmware upgrading based on ARM
CN103176824A (en) * 2013-03-15 2013-06-26 青岛海信移动通信技术股份有限公司 System upgrade method and system upgrade device
CN103645918A (en) * 2013-12-10 2014-03-19 深圳市道通科技有限公司 Software upgrading method and device for industrial endoscope
CN113867764A (en) * 2021-09-28 2021-12-31 重庆长安汽车股份有限公司 Method and system for upgrading vehicle MCU through multiple channels

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Ali Ahari 等."Energy efficient partitioning of dynamic reconfigurable MRAM-FPGAs".《2015 25th International Conference on Field Programmable Logic and Applications (FPL)》.2015,第1-6页. *
韩晓峰 等."SD卡直接引导的NAND Flash烧写方法".《单片机与嵌入式系统应用》.2016,第43-45页. *

Also Published As

Publication number Publication date
CN116909610A (en) 2023-10-20
CN115562697A (en) 2023-01-03

Similar Documents

Publication Publication Date Title
US8719810B2 (en) Program upgrade system and method for over the air-capable mobile terminal
US9301164B2 (en) Method, system, and terminal for performing system update between mobile communication terminals
US8954805B2 (en) Computer booting method and computer system
US8448187B2 (en) Conflict resolution apparatus
CN109089108B (en) Test method and system
CN114265616B (en) Upgrading method of operating system, electronic equipment and storage medium
CN113868156B (en) System upgrade power-down protection method, electronic device and storage medium
CN117707626A (en) System starting method and electronic equipment
US20050010914A1 (en) Method for upgrading firmware
CN114780120B (en) Upgrade method, device and storage medium
CN116400938B (en) Operating system upgrading method, device and storage medium
CN116719670B (en) Data processing method, electronic device and readable storage medium
CN115562697B (en) Upgrade method, device and storage medium
CN116382791B (en) Configuration file protection method and electronic equipment
CN116700768B (en) Application processing method and related device
CN115951920A (en) Mobile equipment upgrading method and device, storage unit and mobile equipment
CN112463199A (en) System upgrading method and terminal
CN112181467B (en) Method and device for upgrading memory firmware of terminal, terminal and storage medium
CN113190244A (en) Method and device for upgrading wireless module, computer equipment and storage medium
WO2024114029A1 (en) Operating system upgrade method and electronic device
CN117270914B (en) System upgrading method, device, equipment and medium of terminal equipment
CN115629777B (en) BMC heterogeneous upgrading method, system, equipment and readable storage medium
CN116069370A (en) Method, apparatus, storage medium and computer program product for upgrading a cold patch
CN117707630A (en) Interrupt processing method, device and storage medium in partition switching process
CN117707565A (en) Terminal equipment and upgrading method thereof

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