WO2022095758A1 - 终端升级的方法及终端 - Google Patents

终端升级的方法及终端 Download PDF

Info

Publication number
WO2022095758A1
WO2022095758A1 PCT/CN2021/126472 CN2021126472W WO2022095758A1 WO 2022095758 A1 WO2022095758 A1 WO 2022095758A1 CN 2021126472 W CN2021126472 W CN 2021126472W WO 2022095758 A1 WO2022095758 A1 WO 2022095758A1
Authority
WO
WIPO (PCT)
Prior art keywords
upgrade
partition
size
terminal
user data
Prior art date
Application number
PCT/CN2021/126472
Other languages
English (en)
French (fr)
Inventor
李海涛
刘元
陈超
靳倡荣
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022095758A1 publication Critical patent/WO2022095758A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • the present application relates to the field of system upgrade, and in particular, to a method and terminal for terminal upgrade.
  • the system upgrade needs to download the upgrade package through the over-the-air technology (OTA), and then store the downloaded upgrade package in the user data (data) partition, and then use the upgrade package to upgrade the terminal system from a low version to a High version.
  • OTA over-the-air technology
  • other partitions may occupy the space of the data partition, so that the data partition is modified, which will cause the upgrade package in the data partition in the file system to be damaged and the upgrade to fail.
  • the embodiments of the present application provide a method and terminal for upgrading a terminal.
  • the problem that the upgrade package is destroyed during the upgrade process is solved, resulting in an upgrade failure.
  • a method for upgrading a terminal including: receiving an upgrade package of a target version, where the upgrade package includes upgrade data of the target version; storing the upgrade package in a user data partition block device, wherein, The block device is in an unmounted state during the upgrade process, and the offset of the starting position of the upgrade package relative to the end of the block device is less than the available space after the block device is upgraded; The upgrade data is mapped into the memory of the terminal; based on the upgrade data in the memory, the terminal is upgraded from the current version to the target version.
  • the user data partition block device may also be represented by the data partition block device in the following, or the block device in the following is also the data partition block device here.
  • the terminal upgrade method by storing the upgrade package in the user data block device in an unmounted state, and using mmap to map the upgrade data to the memory, the terminal uses the upgrade data in the memory to update each Partitions are updated to realize system upgrade, which can ensure that the upgrade package is not damaged during the upgrade process, and improve the probability of successful OTA upgrade.
  • the method further includes: unloading the access path of the block device in the file system.
  • the method further includes: receiving first information sent by the OTA server, where the first information includes partition information in the target version; The first information and the partition information in the current version are used to determine that the size of the user data partition in the target version has changed relative to the size of the user data partition in the current version.
  • the method further includes: determining the block device according to the starting position of the upgrade package in the block device and the size of the user data partition block device. A first offset of the starting position relative to a reference position in the block device, where the reference position includes a position where the tail of the block device is located.
  • the method further includes: generating an upgrade command, where the upgrade command includes the path of the user data partition block device, the first offset, the the size of the upgrade package; and the upgrade command is stored in at least one spare partition, and the spare partition is a partition that is not updated during the upgrade process.
  • the first offset includes a byte alignment size, and the byte alignment size is used to make the starting position match the mmap reading mode integer multiples of byte position alignment.
  • the first information specifically includes indication information of the size of the user data partition in the target version, and the partition information in the current version includes the partition information in the current version.
  • User data partition size the determining, according to the first information and the partition information in the current version, that the user data partition size in the target version has changed relative to the user data partition size in the current version, including : when the size of the user data partition in the target version is different from the size of the user data partition in the current version, determine that the size of the user data partition in the target version has changed relative to the size of the user data partition in the current version .
  • the first information includes indication information of the size of other partitions except the user data partition in the target version
  • the partition information in the current version includes Indication information of the size of other partitions except the user data partition in the current version; determining the size of the user data partition in the target version relative to the size of the user data partition according to the first information and the partition information in the current version.
  • the size of the user data partition in the current version changes, including: when the sum of the sizes of the other partitions except the user data partition in the target version and the size of the other partitions other than the user data partition in the current version When the sums are different, it is determined that the size of the user partition in the target version has changed relative to the size of the user partition in the current version.
  • a terminal including: a download module for receiving an upgrade package of a target version, the upgrade package including upgrade data of the target version; and for storing the upgrade package in a user data partition block device, wherein the block device is in an unmounted state during the upgrade process, and the offset of the starting position of the upgrade package relative to the end of the block device is smaller than the available space after the block device is upgraded; an upgrade module is used to map the upgrade data to the memory of the terminal through the memory mapping function mmap; and based on the upgrade data in the memory, upgrade the terminal from the current version to the target version.
  • the terminal further includes: an unloading module, configured to unload the access path of the block device in the file system.
  • the terminal further includes a pre-download module and a judgment module, wherein the pre-download module is configured to receive the first information sent by the OTA server, and the The first information includes partition information in the target version; the judgment module is configured to determine, according to the first information and the partition information in the current version, the size of the user data partition in the target version relative to the size of the partition. The size of the user data partition in the current version has changed.
  • the terminal further includes an upgrade preprocessing module, configured to divide the user data into blocks according to the starting position of the upgrade package in the block device and the user data The size of the device, determining the first offset of the start position relative to the end of the block device.
  • the upgrade preprocessing module is further configured to generate an upgrade command, where the upgrade command includes the path of the user data partition block device, the first offset The amount of migration and the size of the upgrade package; the storage module is further configured to store the upgrade command in at least one backup partition, where the backup partition is a partition that is not updated during the upgrade process.
  • the first offset includes a byte alignment size
  • the byte alignment size is used to make the starting position match the mmap reading mode integer multiples of byte position alignment.
  • the first information specifically includes indication information of the size of the user data partition in the target version, and the partition information in the current version includes the partition information in the current version.
  • User data partition size the processing module is further configured to determine, when the user data partition size in the target version and the user data partition size in the current version are different, determine that the user data partition size in the target version is relative to the size of the user data partition in the target version. The size of the user data partition in the current version has changed.
  • the first information includes indication information of the size of other partitions except the user data partition in the target version
  • the partition information in the current version includes Indication information of the size of other partitions except the user data partition in the current version
  • the processing module is also used when the sum of the sizes of other partitions except the user data partition in the target version is equal to the current version
  • the sum of the sizes of other partitions except the user data partition in the target version is different, it is determined that the size of the user partition in the target version changes with respect to the size of the user partition in the current version.
  • a terminal including: a processor; a memory for storing executable instructions of the processor; wherein, when the processor executes the executable instructions, the terminal is implemented as follows Steps: receiving an upgrade package of the target version, the upgrade package including the upgrade data of the target version; storing the upgrade package in the user data partition block device, wherein the block device is in an unmounted state during the upgrade process , the offset of the starting position of the upgrade package relative to the tail of the block device is less than the available space after the upgrade of the block device; the upgrade data is mapped to the memory of the terminal through the memory mapping function mmap; Based on the upgrade data in the memory, the terminal is upgraded from the current version to the target version.
  • the terminal when the processor executes the executable instruction, the terminal is caused to implement the following step: unload the access path of the block device in the file system.
  • the terminal when the processor executes the executable instructions, the terminal is caused to implement the following steps: receiving the first information sent by the OTA server, the The first information includes partition information in the target version; according to the first information and the partition information in the current version, determine the size of the user data partition in the target version relative to the user data in the current version The partition size has changed.
  • the terminal when the processor executes the executable instructions, the terminal is caused to implement the following steps: according to the start of the upgrade package in the block device The starting position and the size of the user data partition block device are determined, and the first offset of the starting position relative to the reference position in the block device is determined, and the reference position includes the position where the tail of the block device is located.
  • the terminal when the processor executes the executable instruction, the terminal is caused to implement the following steps: generating an upgrade command, where the upgrade command includes the user data The path of the block device, the first offset, and the size of the upgrade package; the upgrade command is stored in at least one backup partition, and the backup partition is a partition that is not updated during the upgrade process.
  • the first offset includes a byte alignment size
  • the byte alignment size is used to make the starting position match the mmap reading mode integer multiples of byte position alignment.
  • the first information specifically includes indication information of the size of the user data partition in the target version, and the partition information in the current version includes the partition information in the current version.
  • User data partition size when the processor executes the executable instruction, the terminal is made to implement the following steps: when the user data partition size in the target version is different from the user data partition size in the current version, It is determined that the size of the user data partition in the target version has changed relative to the size of the user data partition in the current version.
  • the first information includes indication information of the size of other partitions in the target version except the user data partition
  • the partition information in the current version includes Indication information of the size of other partitions except the user data partition in the current version
  • the terminal is made to implement the following steps: when the user data partition is excluded from the target version When the sum of the sizes of other partitions other than the current version is different from the sum of the sizes of other partitions except the user data partition in the current version, determine the size of the user partition in the target version relative to the size of the user partition in the current version change.
  • a fourth aspect provides a communication system, characterized in that the communication system includes an OTA server and a terminal, wherein the terminal is configured to perform the terminal upgrade as described in any one of the implementation manners of the first aspect. method.
  • a computer-readable storage medium having program instructions, when the program instructions are directly or indirectly executed, such that any one of the implementation manners of the above-mentioned first aspect is implemented The method of terminal upgrade is realized.
  • a computer program is provided, when the computer program is executed in at least one processor, the method for upgrading a terminal according to any one of the implementation manners of the first aspect above is implemented.
  • a computer program product is provided.
  • the computer program is executed in at least one processor, the method for upgrading a terminal according to any one of the implementation manners of the first aspect can be realized. .
  • FIG. 1 is a schematic diagram of a terminal structure provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for upgrading a terminal provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a storage location of an upgrade package in a block device provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of another method for upgrading a terminal provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a graphical user interface provided by an embodiment of the present application.
  • FIG. 6A and FIG. 6B are schematic diagrams of partition changes before and after an upgrade provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a terminal structure provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and should not be understood as indicating or implying relative importance and implicitly indicating the number of the indicated technical features.
  • a reference to a "first”, “second” feature may expressly or implicitly include one or more of that feature.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the upgrade package is usually stored in the data partition of the file system through the file system. If the data partition is reduced, the data partition will be destroyed, so that the upgrade package will also be deleted accordingly. Damaged, resulting in inability to perform OTA upgrades.
  • an existing solution is to back up the upgrade package to memory, such as random access memory (RAM).
  • the upgrade package data to continue the upgrade process.
  • this solution has the following problems: first, the storage space of the memory is generally small, and with the development of the terminal system, the upgrade package becomes larger and larger, and the memory space is not enough to accommodate the upgrade package; in addition, since the memory is a temporary storage medium, If the power of the terminal is turned off, the data in the memory will be lost, causing the upgrade to fail.
  • an embodiment of the present application provides a method for upgrading a terminal, by storing the upgrade package in the data partition block device (the block device will be in an unmounted state during the upgrade process), and using the memory mapping function mmap method Map the upgrade data in the block device to the memory, and then the terminal reads the upgrade data in the memory to complete the upgrade.
  • the method in the embodiment of the present application can solve the problem that the upgrade package is destroyed and cannot be upgraded when the data partition changes, and in this method, the upgrade package does not need to be written into the memory, and the upgrade process is not limited by the memory space capacity, This increases the chances of a successful upgrade.
  • the terminal upgrade method provided in the embodiment of the present application may be applied to a scenario where terminals are wirelessly upgraded in batches on a terminal production line; or may also be applied to a scenario where a user or a maintenance point repairs and upgrades terminals.
  • the terminal upgrade method provided in the embodiments of the present application can be applied to mobile phones, tablet computers, TVs, wearable devices (such as smart watches, smart bracelets, smart glasses, smart jewelry, etc.), vehicle-mounted devices, augmented reality (AR) )/virtual reality (VR) devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs) and other electronic devices.
  • AR augmented reality
  • VR virtual reality
  • UMPCs ultra-mobile personal computers
  • PDAs personal digital assistants
  • This embodiment of the present application does not impose any limitation on the specific type of the terminal.
  • Exemplary embodiments of the terminal include piggybacking Terminals such as operating systems.
  • FIG. 1 it is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • the terminal 100 includes a pre-download module 101 , a determination module 102 , a download module 103 , an upgrade preprocessing module 104 and an upgrade module 105 .
  • each module can be connected in communication through the bus 106 .
  • the pre-download module 101 can be used to obtain the target version through channels including but not limited to wireless fidelity (wireless fidelity, WI-FI) download or universal serial bus (universal serial bus, USB) transmission and other channels.
  • Relevant information includes but is not limited to: upgrade package size, data partition information, etc.; data partition information may include partition size, starting position and other information, or may also include, but is not limited to, the partition table and other information that can be used to calculate the target The form of information about the starting position of the version data partition.
  • the judging module 102 can be used to judge whether the data partition in the current version and the target version has changed according to the relevant information of the target version obtained by the pre-download module, and the judging methods include but are not limited to the following two: ( 1) Determine whether the size of the data partition changes; (2) Determine whether the total size of the other partitions other than the data partition changes.
  • the download module 103 can be used to download the upgrade package. In addition, the download module 103 can also be used to calculate information such as the starting position of the upgrade package in the data partition block device.
  • the upgrade preprocessing module 104 can be used to calculate the storage location information of the upgrade package, such as the offset of the starting position of the upgrade package storage relative to the end of the data partition block device; in addition, the upgrade preprocessing module also It can be used to generate an upgrade command including the storage location information of the upgrade package, so that the upgrade module can obtain upgrade data according to the upgrade command.
  • the upgrade module 105 can be used to map the upgrade data in the data partition block device to the memory of the terminal through mmap, then read the upgrade data in the memory, update each partition, and realize the terminal upgrade .
  • the terminal may also include more or more functions than those shown in FIG. 1 .
  • the terminal may further include an unloading module for unloading the access path of the block device in the file system, which is not limited in this application.
  • FIG. 2 it is a schematic flowchart of a method for upgrading a terminal provided by an embodiment of the present application.
  • the method can be executed by a terminal, and mainly includes the following steps:
  • S201 Receive an upgrade package of a target version, where the upgrade package includes upgrade data of the target version.
  • the OTA server can make an upgrade package of the target version, and the upgrade package includes the upgrade data of the target version, such as a partition table of the target version, and the partition table can include the actual location of each partition in the target version (such as each partition starting position), the size of each partition, etc.
  • the OTA server may notify the terminal that the target version is available. For example, the OTA server sends a notification message to the terminal to indicate that the terminal has an available target version or an upgrade package of the target version available for download. In response to the notification message, the terminal may download the target version upgrade package by OTA.
  • the number of upgrade packages in this embodiment of the present application may be one or more.
  • the terminal may download each upgrade package in sections.
  • that the block device is in an unmounted state during the upgrade process means that, during the upgrade process, the file system does not include the access path of the block device of the data partition.
  • the terminal can delete the mapping relationship between the data partition block device and the file system by calling a system command.
  • the offset of the starting position of the upgrade package in the data partition block device relative to the end of the block device is less than or equal to the available space of the upgraded user data partition block device.
  • the storage location of the upgrade package in the data partition block device can be close to the end of the block device (as shown in Figure 3) to avoid being blocked by other partitions (the bootloader, boot, recovery, system, and data partitions shown in Figure 3). etc.) data coverage.
  • the size of the data partition block device of the terminal will be larger than the size of the upgrade package of the corresponding version (such as the target version). Therefore, if the upgrade package is stored at the end of the user data partition block device, it can be ensured that the upgrade process is complete. , even if the user data partition becomes smaller (for example, a part of the space is occupied by other partitions), the upgrade package data will not be overwritten, ensuring the smooth completion of the upgrade.
  • the multiple upgrade packages may be stored in sequence at the tail of the data partition block device.
  • the upgrade data is mapped to the memory of the terminal through the memory mapping function mmap.
  • the upgrade module of the terminal may map the upgrade package data into the memory according to the storage location of the upgrade package.
  • the upgrade module of the terminal can map the upgrade data in the data partition block device to the terminal memory by mmap according to the starting position of the upgrade package and the size of the upgrade package.
  • the above method maps the upgrade data in the block device to the terminal memory through the memory function mapping mmap, so that the terminal is no longer limited by the size of the memory during the upgrade process, and this method does not need to read/write the upgrade data. Actions that enable efficient access to data.
  • the upgrade module of the terminal can read the upgrade data from the terminal memory; after that, the upgrade module updates each partition according to the actual position (such as the starting position) of each partition indicated by the upgrade data and the size of each partition Make an update to upgrade the end system from the current version to the target version.
  • the upgrade package may be stored in the data partition block device in an unmounted state, and the upgrade package is stored at the block device layer.
  • the upgrade package when the upgrade package is stored in the data partition block device, the original data of the block device will be destroyed (for example, cleared), and the upgrade package can be continuously stored in a section of free space in the block device; during the upgrade process , the upgrade module can map the upgrade data to the terminal memory according to the storage location of the upgrade package in the block device, and then realize the system upgrade by reading the upgrade data in the memory.
  • the upgrade package in the terminal upgrade method provided by the embodiments of the present application, even if the data partition changes during the upgrade process, as long as the upgrade package is not covered by the upgrade data image, the upgrade package is available, and the upgrade process can continue to be performed.
  • the current method of storing the upgrade package in the data partition of the file system cannot make the upgrade package continuously distributed on the data partition block device, and if the size of the data partition of the file system changes during the upgrade process, or there are Other data writing may damage the data partition (for example, the data in the data partition is disordered), and the upgrade package in the data partition will inevitably be destroyed, resulting in the failure of the upgrade.
  • the terminal upgrade method by storing the upgrade package in the user data block device in an unmounted state, and using mmap to map the upgrade data to the memory, the terminal uses the upgrade data in the memory to update each The partition is updated to realize the system upgrade, which can ensure that the upgrade package is not damaged during the upgrade process, and improve the efficiency of the system version upgrade.
  • FIG. 4 shows a schematic flowchart of a method for upgrading a terminal provided by an embodiment of the present application.
  • the method can be executed by a terminal, and specifically includes the following steps:
  • the terminal obtains the first information of the upgrade package.
  • the first information is used to indicate the size of the upgrade package and the partition information of the target version.
  • the OTA server may send a notification message to the terminal to indicate that the terminal has an available target version or an upgrade package of the target version for download; after the terminal detects the notification message sent by the OTA server , you can prompt the user whether a version upgrade is required.
  • the terminal may pop up prompt information on the display interface to confirm to the user whether to perform version upgrade.
  • the terminal may pop up prompt information on the display interface to confirm to the user whether to perform version upgrade.
  • the terminal as a mobile phone as an example, as shown in FIG. 5 , a graphical user interface provided by the embodiment of the present application
  • the interface can be the main interface after the phone is unlocked, and the main interface includes a variety of applications (application, APP) such as clock, calendar, gallery, memo, and smart life.
  • applications application, APP
  • the mobile phone can pop up a prompt message on the main interface: "It has been detected that a new system version can be applied to your mobile phone. Do you want to update the version?" ; After that, if the mobile phone detects that the user clicks the "Confirm” icon, the upgrade operation is performed; if the mobile phone detects that the user clicks the "Cancel” icon, this version upgrade is not performed.
  • the mobile phone may further confirm to the user whether to perform the version upgrade after a preset period of time, which is not limited in this application.
  • the terminal when it detects that the user chooses to perform a version upgrade operation, it can request the OTA server to query the relevant information of the target version, such as the target version upgrade package size, data partition information in the target version, etc.; For the query request, the OTA server may send first information to the terminal, where the first information may be indication information of the upgrade package, and may be specifically used to indicate the size of the upgrade package, partition information of the target version, and the like.
  • the partition information of the target version includes, for example, the actual starting position of each partition in the target version, the size of each partition, and the like.
  • the first information may be the partition table of the target version.
  • the first information may include the size and starting position of the data partition in the target version; alternatively, the first information may also include the data that can calculate the size of the data partition and the starting position of the upgrade package in the target version information. In other words, the first information may directly or indirectly indicate the size and starting position of the data partition, which is not limited in this application.
  • the terminal may determine whether the size of the data partition has changed in the two versions based on the acquired first information in combination with the partition information in the current version.
  • FIG. 6A and FIG. 6B are schematic diagrams of the change of the data partition in the target version relative to the data partition in the current version.
  • FIG. 6A and FIG. 6B respectively show the bootloader partition, boot partition, recovery partition, system partition and data partition. partition. Specifically, in FIG. 6A , the space of the data partition in the target version becomes smaller relative to the space of the data partition in the current version; in FIG. 6B , the space of the data partition in the target version is relative to the space of the data partition in the current version. get bigger.
  • the upgrade package can be stored by means of file system writing.
  • the following describes the terminal upgrade method provided by the embodiment of the present application, mainly for the situation that the size of the data partition changes after the upgrade.
  • the upgrade package can be stored in the data partition through the file system, or can also be stored in the data in the unmounted state.
  • the data partition in the target version changes (for example, the space becomes smaller or larger)
  • the corresponding data partition under the file system will be destroyed during the upgrade process. If the upgrade package is stored in the data partition through the file system, the upgrade package will also be damaged and cannot be upgraded.
  • the size of the data partition of the terminal will be larger than the size of the upgrade package.
  • the method for terminal upgrade provided by the embodiment of the present application may further include the following steps:
  • the terminal may determine whether the upgrade package can be stored in the data partition block device based on the size of the upgrade package and the size of the data partition in the target version. For example, when the terminal determines that the size of the data partition in the target version is larger than the size of the upgrade package, it means that during the upgrade process, the available space of the data partition is sufficient to accommodate the upgrade package. At this time, it is determined that the upgrade package can be stored in the user data partition block device. That is, the upgrade package is stored in the block device dimension.
  • the path of the data partition block device may be unmounted in the file system, so that the data partition block device is in an unmounted state.
  • the way to make the block device in the unmounted state is, for example, calling a system command to unload the access path of the block device in the file system, or calling a system command to delete the mapping relationship between the data partition block device and the file system.
  • a block device if a block device is in a mounted state, the computer files and directories on the block device can be accessed by the user through the file system, and the user or the system can also write data into the block device through the file system.
  • the block device may be unmounted, so that the block device is in an unmounted state, so as to avoid writing of other data and ensure the integrity and availability of the upgrade package.
  • the block device may be in an unmounted state after the upgrade package is stored; or, before the upgrade package is stored, the block device may be in an unmounted state.
  • the embodiments of the present application only need to make the data partition block device in the unmounted state during the upgrade process, and the specific time for making the block device in the unmounted state is not limited.
  • the upgrade package can be stored in the block at the storage location (such as the starting location) calculated according to the preset criteria. in the device.
  • the first offset of the starting position of the upgrade package in the data partition block device relative to the end of the block device is less than or equal to the availability of the upgraded user data partition block device space.
  • the storage location of the upgrade package in the block device of the data partition may be close to the end of the block device (refer to FIG. 3 ) to avoid being overwritten by data of other partitions.
  • the starting position (starAddr) of the upgrade package can be calculated according to the size of the upgrade package of the target version (packageSize) and the size of the data partition block device (dataSize).
  • align is to align the starting position of the upgrade package at an integer multiple of the read mode (such as 4K), so as to ensure that the upgrade package data is smoothly mapped to the memory by mmap.
  • the data can be read smoothly at this time; if the starting position of the upgrade package is 1G and more than 1 byte , which is not an integer multiple of 4K, so the data cannot be read smoothly.
  • the size of the alignment byte can be used to increase the offset of the starting position of the upgrade package relative to the end of the data block device, so that the starting position is the same as
  • the positions of the integer multiple bytes of 4K are aligned to ensure that the upgrade module maps the upgrade data through mmap.
  • the embodiment of the present application uses the first offset of the start position of the upgrade package relative to the position of the tail end of the data segment block device to indicate the storage of the upgrade package Location.
  • the terminal can calculate the first offset (offset) of the starting position of the upgrade package relative to the end of the data partition block device according to the storage location information of the upgrade package in the block device.
  • the first offset The offset can be used to indicate where the upgrade package is stored.
  • an upgrade command for indicating the storage location of the upgrade package can be generated according to the storage location of the upgrade package, and the upgrade command is stored in the spare block, so that the upgrade data can be retrieved when needed (for example, in the scenario where the terminal is restarted after a power failure), find out exactly where the upgrade package is located, and continue the upgrade process.
  • the upgrade command may include information such as the data partition block device path information, the first offset, and the upgrade package size, or the upgrade command may also include other information that can be used to calculate the first offset. This is not limited.
  • the format of the upgrade command can be, for example:
  • the backup partition may be a pre-divided fixed partition, and the backup partition is not updated during the upgrade process. In other words, during the version iteration process, the location and size of the backup partition do not change.
  • the spare partition can be used to store startup parameters, and the startup parameters are used to indicate a restart mode type, such as a startup upgrade mode and the like.
  • the spare partition can also be used to store upgrade commands.
  • the spare partition is, for example, a misc partition.
  • the upgrade preprocessing module of the terminal may send a notification message to the upgrade module, notifying the upgrade module that the upgrade command can be read from the standby partition, and the upgrade package is stored according to the upgrade command. location to get the upgrade package data.
  • the upgrade module maps the upgrade data in the data partition block device to the terminal memory by mmap according to the new starting position, and continues the upgrade process.
  • the above method can avoid the problem that the upgrade package is lost, the upgrade module cannot read the upgrade data, and the upgrade fails in the scenario where the upgrade process unexpectedly stops due to the power failure of the terminal.
  • S405 Map the upgrade data in the data partition block device to the terminal memory by mmap.
  • the terminal upgrade module obtains storage location information of the upgrade package in the data partition block device according to the upgrade command. Specifically, the upgrade module can obtain information such as the path of the data partition block device, the first offset, the size of the data partition block device, and the upgrade package size of the upgrade package in the data partition block device through the upgrade command; and then calculate based on these information. The starting position of the upgrade package in the data partition block device.
  • the upgrade module maps the upgrade data to the terminal memory through mmap according to the storage location of the upgrade package.
  • the upgrade module of the terminal can verify the upgrade package, such as the signature and integrity of the upgrade package, to check whether the source of the upgrade package is from Legal and whether the upgrade package is complete.
  • the above method maps the upgrade data to the terminal memory through mmap, which can avoid the upgrade process being limited by the size of the memory. In other words, it can solve the problem of upgrade failure caused when the upgrade package size is larger than the memory capacity during the current upgrade.
  • the terminal system is upgraded based on the upgrade data in the terminal memory.
  • the upgrade module of the terminal can read the upgrade data from the terminal memory; after that, the upgrade module updates each partition according to the actual position (such as the starting position) of each partition indicated by the upgrade data and the size of each partition Make an update to upgrade the end system from the current version to the target version.
  • the upgrade module can refresh the data partition block device data by formatting or writing mirror data .
  • the terminal upgrade method by storing the upgrade package in the user data block device in an unmounted state, and using mmap to map the upgrade data to the memory, the terminal uses the upgrade data in the memory to update each Partitions are updated to realize system upgrade, which can ensure that the upgrade package is not damaged during the upgrade process, and improve the probability of successful OTA upgrade.
  • an embodiment of the present application further provides a schematic structural diagram of a terminal.
  • the terminal 700 includes a processor 701, a memory 702 and a communication interface 703, and a bus 704 connecting these devices.
  • the memory 702 includes computer instructions, and when the computer instructions are executed in the processor 701, the terminal 700 is made to implement the terminal upgrade method provided by the embodiment of the present application.
  • an embodiment of the present application further provides a communication system, including an OTA server and a terminal, wherein the OTA server and the terminal are used to perform the method for upgrading the terminal in the above-mentioned embodiments of the present application.
  • the embodiments of the present application also provide a computer-readable storage medium, the computer program storage medium has program instructions, and when the program instructions are directly or indirectly executed, the computer can implement the terminal upgrade provided by the embodiments of the present application. Methods.
  • the embodiments of the present application further provide a computer program, which, when the computer program is executed in at least one processor, enables the computer to implement the terminal upgrade method provided by the embodiments of the present application.
  • the embodiments of the present application also provide a computer program product, which, when the computer program is executed in at least one processor, enables the computer to implement the terminal upgrading method provided by the embodiments of the present application.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions can be sent from one website site, computer, server, or data center to another website site, computer, server or data center for transmission.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)), and the like.
  • the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
  • the program When the program is executed , which may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store program codes.

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

本申请实施例提供一种终端升级的方法及终端,属于系统升级领域。该方法包括:接收目标版本的升级包,所述升级包包括所述目标版本的升级数据;将所述升级包存储在用户数据分区块设备,其中,所述块设备在升级过程中为未挂载状态,所述升级包的起始位置相对于所述块设备尾部的偏移量小于所述块设备升级后的可用空间;通过内存映射函数mmap将所述升级数据映射至所述终端的内存中;基于所述内存中的升级数据,将所述终端由当前版本升级为所述目标版本。本申请实施例提供的方法,可以解决升级过程中,由于data分区变化导致的升级失败的问题。

Description

终端升级的方法及终端
本申请要求于2020年11月04日提交国家知识产权局、申请号为202011219326.5、申请名称为“终端升级的方法及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及系统升级领域,尤其涉及一种终端升级的方法及终端。
背景技术
用户为了获得最新的使用体验,需要对终端进行系统升级。通常来说,系统升级要通过空中下载技术(over the air,OTA)下载升级包,之后将下载的升级包存储在用户数据(data)分区,再利用该升级包将终端系统由低版本升级为高版本。然而,由于在升级过程中,其它分区可能会占用data分区的空间,使data分区被修改,从而会导致文件系统中的data分区中的升级包被破坏,升级失败。
发明内容
本申请实施例提供了一种终端升级的方法及终端,通过将升级包存储于块设备中,解决了升级包在升级过程中被破坏,导致升级失败的问题。
第一方面,提供了一种终端升级的方法,包括:接收目标版本的升级包,所述升级包包括所述目标版本的升级数据;将所述升级包存储在用户数据分区块设备,其中,所述块设备在升级过程中为未挂载状态,所述升级包的起始位置相对于所述块设备尾部的偏移量小于所述块设备升级后的可用空间;通过内存映射函数mmap将所述升级数据映射至所述终端的内存中;基于所述内存中的升级数据,将所述终端由当前版本升级为所述目标版本。
其中,用户数据分区块设备在后文中也可用data分区块设备来表示,或者,后文中的块设备也是这里的数据分区块设备。
根据本申请实施例提供的终端升级的方法,通过将升级包存储在未挂载状态的用户数据块设备中,并利用mmap方式将升级数据映射至内存,使终端利用内存中的升级数据对各分区进行更新,实现系统升级,能够保证升级包在升级过程中不被破坏,提高OTA升级成功的几率。
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:卸载所述块设备在文件系统中的访问路径。
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:接收所述OTA服务器发送的第一信息,所述第一信息包括所述目标版本中的分区信息;根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:根据所述升级包在所述块设备中的起始位置和所述用户数据分区块设备的大小,确定所述起始位置 相对于所述块设备中参考位置的第一偏移量,所述参考位置包括所述块设备尾部所在的位置。
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:生成升级命令,所述升级命令包括所述用户数据分区块设备的路径、所述第一偏移量、所述升级包大小;将所述升级命令存储于至少一个备用分区中,所述备用分区为在升级过程中不更新的分区。
结合第一方面,在第一方面的某些实现方式中,所述第一偏移量包括字节对齐大小,所述字节对齐大小用于使所述起始位置与所述mmap读取方式的整数倍字节位置对齐。
结合第一方面,在第一方面的某些实现方式中,所述第一信息具体包括所述目标版本中用户数据分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中用户数据分区大小;所述根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化,包括:当所述目标版本中的用户数据分区大小和所述当前版本中用户数据分区大小不同时,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
结合第一方面,在第一方面的某些实现方式中,所述第一信息包括所述目标版本中除用户数据分区之外的其他分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中除用户数据分区之外的其他分区大小的指示信息;所述根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化,包括:当所述目标版本中除用户数据分区之外的其它分区大小的总和与所述当前版本中除用户数据分区之外的其它分区大小的总和不同时,确定所述目标版本中的用户分区大小相对于所述当前版本中的用户分区大小发生变化。
第二方面,提供了一种终端,包括:下载模块,用于接收目标版本的升级包,所述升级包包括所述目标版本的升级数据;并用于将所述升级包存储在用户数据分区块设备,其中,所述块设备在升级过程中为未挂载状态,所述升级包的起始位置相对于所述块设备尾部的偏移量小于所述块设备升级后的可用空间;升级模块,用于通过内存映射函数mmap将所述升级数据映射至所述终端的内存中;并基于所述内存中的升级数据,将所述终端由当前版本升级为所述目标版本。
结合第二方面,在第二方面的某些实现方式中,所述终端还包括:卸载模块,用于卸载所述块设备在文件系统中的访问路径。
结合第二方面,在第二方面的某些实现方式中,所述终端还包括预下载模块和判断模块,其中,所述预下载模块,用于接收所述OTA服务器发送的第一信息,所述第一信息包括所述目标版本中的分区信息;所述判断模块,用于根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
结合第二方面,在第二方面的某些实现方式中,所述终端还包括升级预处理模块,用于根据所述升级包在所述块设备中的起始位置和所述用户数据分区块设备的大小, 确定所述起始位置相对于所述块设备尾部的第一偏移量。
结合第二方面,在第二方面的某些实现方式中,所述升级预处理模块,还用于生成升级命令,所述升级命令包括所述用户数据分区块设备的路径、所述第一偏移量、所述升级包大小;所述存储模块,还用于将所述升级命令存储于至少一个备用分区中,所述备用分区为在升级过程中不更新的分区。
结合第二方面,在第二方面的某些实现方式中,所述第一偏移量包括字节对齐大小,所述字节对齐大小用于使所述起始位置与所述mmap读取方式的整数倍字节位置对齐。
结合第二方面,在第二方面的某些实现方式中,所述第一信息具体包括所述目标版本中用户数据分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中用户数据分区大小;所述处理模块,还用于当所述目标版本中的用户数据分区大小和所述当前版本中用户数据分区大小不同时,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
结合第二方面,在第二方面的某些实现方式中,所述第一信息包括所述目标版本中除用户数据分区之外的其他分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中除用户数据分区之外的其他分区大小的指示信息;所述处理模块,还用于当所述目标版本中除用户数据分区之外的其它分区大小的总和与所述当前版本中除用户数据分区之外的其它分区大小的总和不同时,确定所述目标版本中的用户分区大小相对于所述当前版本中的用户分区大小发生变化。
第三方面,提供了一种终端,包括:处理器;存储器,用于存储所述处理器的可执行指令;其中,当所述处理器执行所述可执行指令时,使得所述终端实现如下步骤:接收目标版本的升级包,所述升级包包括所述目标版本的升级数据;将所述升级包存储在用户数据分区块设备,其中,所述块设备在升级过程中为未挂载状态,所述升级包的起始位置相对于所述块设备尾部的偏移量小于所述块设备升级后的可用空间;通过内存映射函数mmap将所述升级数据映射至所述终端的内存中;基于所述内存中的升级数据,将所述终端由当前版本升级为所述目标版本。
结合第三方面,在第三方面的某些实现方式中,当所述处理器执行所述可执行指令时,使得所述终端实现如下步骤:卸载所述块设备在文件系统中的访问路径。
结合第三方面,在第三方面的某些实现方式中,当所述处理器执行所述可执行指令时,使得所述终端实现如下步骤:接收所述OTA服务器发送的第一信息,所述第一信息包括所述目标版本中的分区信息;根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
结合第三方面,在第三方面的某些实现方式中,当所述处理器执行所述可执行指令时,使得所述终端实现如下步骤:根据所述升级包在所述块设备中的起始位置和所述用户数据分区块设备的大小,确定所述起始位置相对于所述块设备中参考位置的第一偏移量,所述参考位置包括所述块设备尾部所在的位置。
结合第三方面,在第三方面的某些实现方式中,当所述处理器执行所述可执行指令时,使得所述终端实现如下步骤:生成升级命令,所述升级命令包括所述用户数据 分区块设备的路径、所述第一偏移量、所述升级包大小;将所述升级命令存储于至少一个备用分区中,所述备用分区为在升级过程中不更新的分区。
结合第三方面,在第三方面的某些实现方式中,所述第一偏移量包括字节对齐大小,所述字节对齐大小用于使所述起始位置与所述mmap读取方式的整数倍字节位置对齐。
结合第三方面,在第三方面的某些实现方式中,所述第一信息具体包括所述目标版本中用户数据分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中用户数据分区大小;当所述处理器执行所述可执行指令时,使得所述终端实现如下步骤:当所述目标版本中的用户数据分区大小和所述当前版本中用户数据分区大小不同时,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
结合第三方面,在第三方面的某些实现方式中,所述第一信息包括所述目标版本中除用户数据分区之外的其他分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中除用户数据分区之外的其他分区大小的指示信息;当所述处理器执行所述可执行指令时,使得所述终端实现如下步骤:当所述目标版本中除用户数据分区之外的其它分区大小的总和与所述当前版本中除用户数据分区之外的其它分区大小的总和不同时,确定所述目标版本中的用户分区大小相对于所述当前版本中的用户分区大小发生变化。
第四方面,提供了一种通信系统,其特征在于,所述通信系统包括OTA服务器和终端,其中,所述终端用于执行如第一方面的任一项实现方式中所述的终端升级的方法。
第五方面,提供了一种计算机可以读存储介质,所述计算机程序存储介质具有程序指令,当所述程序指令被直接或者间接执行时,使得如上述第一方面中的任一实现方式所述的终端升级的方法得以实现。
第六方面,提供了一种计算机程序,当所述计算机程序在至少一个处理器中执行时,使所述如上述第一方面中的任一实现方式中所述的终端升级的方法得以实现。
第七方面,提供了一种计算机程序产品,当所述计算机程序在至少一个处理器中执行时,使所述如上述第一方面中的任一实现方式中所述的终端升级的方法得以实现。
附图说明
图1是本申请实施例提供的一种终端结构的示意图。
图2是本申请实施例提供的一种终端升级的方法的示意性流程图。
图3是本申请实施例提供的一种升级包在块设备中存储位置的示意图。
图4是本申请实施例提供的另一种终端升级的方法的示意性流程图。
图5是本申请实施例提供的一种图形用户界面的示意图。
图6A和图6B是本申请实施例提供的一种升级前后分区变化的示意图。
图7是本申请实施例提供的一种终端结构的示意图。
具体实施方式
下面结合本申请实施例中的附图对本申请实施例进行描述。
需要说明的是,本申请实施例的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,除非另有说明,“多个”是指两个或多于两个,“至少一个”、“一个或多个”是指一个、两个或两个以上。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性护着隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”特征可以明示或者隐含地包括一个或者更多个该特征。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
随着终端系统版本的演进,在终端由低版本升级到高版本时,会出现系统空间不够的问题,这时就需要增大系统分区,减小用户数据(data)分区。然而,正如背景技术所介绍的,目前的升级过程,通常会通过文件系统把升级包存储在文件系统的data分区,如果data分区减小,该data分区会被破坏,使升级包也随之被破坏,导致无法进行OTA升级。
为解决上述问题,现有的一种方案是:把升级包备份到内存,如随机存储记忆体(random access memory,RAM)中,当data分区中的升级包被破坏时,还可以利用内存中的升级包数据使升级进程继续。然而,该方案存在以下问题:首先,内存的存储空间一般较小,而随着终端系统的发展,升级包越来越大,内存空间不足以容纳升级包;另外,由于内存为临时存储介质,如果遇到终端电源关闭等情况时,内存中的数据会丢失,导致升级失败。
针对上述问题,本申请实施例提供了一种终端升级的方法,通过将升级包存储在data分区块设备(该块设备在升级过程中会处于未挂载状态),并利用内存映射函数mmap方式将块设备中的升级数据映射到内存中,之后终端读取内存中的升级数据完成升级。本申请实施例中的方法,可以解决在data分区变化时,升级包被破坏而无法升级的问题,并且在该方法中,升级包无需写入内存,升级过程不会受限于内存空间容量,从而提高了升级成功的几率。
本申请实施例提供的终端升级的方法可以应用于如终端产线上对终端批量无线升级的场景中;或者,也可以应用于用户或维修点等对终端进行修复升级的场景中。
本申请实施例提供的终端升级的方法可以应用于手机、平板电脑、电视、可穿戴设备(如智能手表、智能手环、智能眼镜、智能首饰等)、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算 机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备上。本申请实施例对终端的具体类型不做任何限制。终端的示例性实施例包括搭载
Figure PCTCN2021126472-appb-000001
等操作系统的终端。
示例性的,如图1所示,为本申请实施例提供的一种终端的结构示意图。其中,终端100包括预下载模块101,判断模块102,下载模块103,升级预处理模块104以及升级模块105。其中,各个模块可以通过总线106进行通信连接。
在一些实施例中,预下载模块101,可以用于通过包括并不限于无线保真(wireless fidelity,WI-FI)下载或者通用串行总线(universal serial bus,USB)传输等通道获取目标版本的相关信息;该相关信息包括并不限于:升级包大小,data分区信息等;data分区信息又可以包括分区大小、起始位置等信息,或者还可以包括并不限于以分区表等可以计算出目标版本data分区起始位置的信息形式。
在一些实施例中,判断模块102,可以用于根据预下载模块获取到的目标版本的相关信息,判断当前版本和目标版本中的data分区是否变化,判断方式包括并不限于以下两种:(1)判断data分区大小是否变化;(2)判断除data分区之外的其它分区大小的总量是否变化。
在一些实施例中,下载模块103,可以用于下载升级包。此外,下载模块103,还可以用于计算升级包在data分区块设备中的起始位置等信息。
在一些实施例中,升级预处理模块104,可以用于计算升级包存储的起始位置相对于data分区块设备尾部的偏移量等升级包的存储位置信息;此外,升级预处理模块,还可以用于生成包括有升级包存储位置信息的升级命令,使得升级模块能根据升级命令获取升级数据。
在一些实施例中,升级模块105,可以用于将data分区块设备中的升级数据通过mmap方式映射到终端的内存中,之后读取内存中的升级数据,对各分区进行更新,实现终端升级。
应理解,本申请实施例中,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将终端内部结构划分成不同的功能模块,以完成以上描述的全部或部分功能,对于模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时,终端还可以包括比图1所示更多或更少的模块,如终端还可以包括卸载模块,用于卸载块设备在文件系统中的访问路径,本申请对此不做限定。
以下结合附图,对本申请实施例提供的终端升级的方法,进行具体的介绍。
示例性的,如图2所示,为本申请实施例提供的一种终端升级的方法的流程示意图。该方法可以由终端来执行,主要包括以下步骤:
S201,接收目标版本的升级包,该升级包包括目标版本的升级数据。
在一些实施例中,OTA服务器可以制作目标版本的升级包,该升级包包括目标版本的升级数据,如目标版本的分区表,该分区表可以包括目标版本中各分区的实际位置(如各分区的起始位置)、各分区的大小等信息。
在一些实施例中,OTA服务器生成目标版本后,可以通知终端有可用的目标版本。例如,OTA服务器向终端发送通知消息,以指示终端有可用的目标版本或者目标版本 的升级包可供下载。响应于该通知消息,终端可以由OTA下载目标版本升级包。
其中,本申请实施例中的升级包可以为一个或者多个。可选地,当升级包有多个时,终端可以分段下载各个升级包。
S202,将升级包存储在用户数据分区块设备,该块设备在升级过程中为未挂载状态,且升级包的起始位置相对于块设备尾部的第一偏移量小于块设备升级后的可用空间。
其中,块设备在升级过程中为未挂载状态是指:在升级过程中,在文件系统上不包括该data分区块设备的访问路径。换言之,在升级之前,终端可以通过调用系统命令删除data分区块设备和文件系统之间的映射关系。
在一种实现方式中,升级包在data分区块设备中的起始位置相对于该块设备尾端的偏移量小于或等于升级后的用户数据分区块设备的可用空间。具体地,升级包在data分区块设备中的存储位置可以靠近块设备的尾部(如图3所示),以避免被其他分区(如图3示出的bootloader、boot、recovery、system、data分区等)的数据覆盖。
应理解,通常来说,终端的data分区块设备的大小会大于对应版本(如目标版本)升级包的大小,因此,如果将升级包存储在用户数据分区块设备的尾部,能够保证在升级过程中,即使该用户数据分区变小(如被其它分区占据一部分空间),也不会覆盖到该升级包数据,保证升级顺利完成。
在一些实施例中,当升级包有多个时,该多个升级包可以依次排列存储在data分区块设备的尾部。
S203,通过内存映射函数mmap将升级数据映射至终端的内存中。
在一些实施例中,终端的升级模块可以根据升级包的存储位置,将升级包数据映射至内存中。
具体地,终端的升级模块可以根据升级包的起始位置以及升级包大小,通过mmap方式将data分区块设备中的升级数据映射到终端内存。
应理解,上述方法通过内存函数映射mmap将块设备中的升级数据映射至终端内存,使得终端在升级过程中,不再受限于内存的大小,该方式无需对升级数据进行读取/写入动作,能实现高效访问数据。
S204,基于内存中的升级数据,由当前版本升级为目标版本。
在一些实施例中,终端的升级模块可以由终端内存中读取升级数据;之后,升级模块根据升级数据所指示的各分区的实际位置(如起始位置)以及各分区的大小,对各分区进行更新,使终端系统由当前版本升级为目标版本。
应理解,本申请实施例提供的终端升级的方法,可以将升级包存储于未挂载状态下的data分区块设备中,是在块设备层存储升级包。其中,当升级包存储到data分区块设备后,该块设备原有的数据会遭到破坏(如被清除),升级包可以连续地存储在该块设备中的一段可用空间上;在升级过程中,升级模块可以根据该升级包在块设备中的存储位置,将升级数据映射至终端内存,再通过读取内存中的升级数据,实现系统升级。换言之,本申请实施例提供的终端升级的方法,即使data分区在升级过程中会发生变化,只要升级包没有被升级数据镜像覆盖,那么升级包就是可用的,该升级过程就可以继续执行。而目前采用的将升级包存储于文件系统的data分区的方式,无 法使升级包在data分区块设备上连续分布,并且,如果在升级过程中,该文件系统data分区的大小发生变化,或者有其他数据写入,都可能会使data分区遭到破坏(如data分区中的数据错乱),该data分区中的升级包不可避免地也会被破坏,从而导致升级失败。
根据本申请实施例提供的终端升级的方法,通过将升级包存储在未挂载状态的用户数据块设备中,并利用mmap方式将升级数据映射至内存,使终端利用内存中的升级数据对各分区进行更新,实现系统升级,能够保证升级包在升级过程中不被破坏,提高系统版本升级的效率。
为更好的理解本申请实施例提供的终端升级的方法,以下结合附图对该方法的具体流程进行更为详细的介绍。
示例性的,图4示出了本申请实施例提供的一种终端升级的方法的示意性流程图。该方法可以由终端来执行,具体包括以下步骤:
S401,终端获取升级包的第一信息。
其中,该第一信息用于指示升级包大小以及目标版本的分区信息。
在一些实施例中,OTA服务器生成可用的目标版本后,可以向终端发送通知消息,以指示终端有可用的目标版本或者目标版本的升级包可供下载;终端检测到OTA服务器发送的通知消息后,可以向用户提示是否需要进行版本升级。
示例性的,终端可以在显示界面上弹出提示信息,以向用户确认是否执行版本升级。以终端是手机为例,如图5所示,为本申请实施例提供的一种图形用户界面
(graphical user interface,GUI)示意图,该界面可以为手机解锁后的主界面,该主界面包括如时钟、日历、图库、备忘录、智慧生活等多款应用程序(application,APP)。其中,当手机接收到OTA服务器发送的通知消息后,响应于该通知消息,手机可以在主界面弹出提示信息:“检测到有新的系统版本可以应用于您的手机,是否进行版本更新?”;之后,如果手机检测到用户点击“确认”图标,则执行升级操作;如果手机检测到用户点击“取消”图标,则不执行本次版本升级。可选地,当用户选择不进行版本升级时,手机还可以在预设的一段时间之后,再次向用户确认是否进行版本升级,本申请对此不做限定。
在一些实施例中,当终端检测到用户选择进行版本升级的操作时,可以向OTA服务器请求查询目标版本的相关信息,如目标版本升级包大小、目标版本中data分区信息等;响应于终端的查询请求,OTA服务器可以向终端发送第一信息,该第一信息可以是升级包的指示信息,具体可用于指示升级包大小、目标版本的分区信息等。其中,目标版本的分区信息例如包括目标版本中各分区实际的起始位置、各分区大小等。可选地,第一信息可以是目标版本的分区表。
在一些可能的实现方式中,第一信息可以包括目标版本中data分区的大小和起始位置;或者,第一信息可以也包括能够计算出该目标版本中data分区大小和升级包起始位置的信息。换言之,第一信息可以通过直接或者间接的方式指示data分区大小和起始位置,本申请对此不作限定。
S402,判断data分区大小是否变化。
在一些实施例中,终端可以基于获取到的第一信息结合当前版本中的分区信息, 判断在两个版本中data分区大小是否发生变化。
如图6A和图6B所示,分别为目标版本中data分区相对于当前版本中data分区发生变化的示意图,图6A和图6B分别示出了bootloader分区、boot分区、recovery分区、system分区以及data分区。具体地,在图6A中,目标版本中的data分区的空间相对于当前版本中data分区的空间变小;在图6B中,目标版本中的data分区的空间相对于当前版本中data分区的空间变大。
其中,若data分区大小发生变化,则确定在块设备维度存储升级包;若data分区大小未发生变化,则可以通过文件系统写入的方式,存储升级包。以下主要针对升级后data分区大小发生变化的情形,对本申请实施例提供的终端升级的方法进行介绍。
应理解,当目标版本中data分区没有发生变化时,意味着升级过程中data分区不需要被破坏,升级包可以通过文件系统存储至data分区,或者,也可以存储至未挂载状态下的data分区块设备中;而当目标版本中data分区发生变化时(如空间变小或变大),那么在升级过程中,该文件系统下对应的data分区会遭到破坏,此时,若继续将升级包通过文件系统存储至data分区,则升级包也会遭到破坏,无法实现升级。
一般来说,终端的data分区大小会大于升级包大小,然而为了进一步确定在升级过程中data分区的可用空间是否足以容纳升级包,本申请实施例提供的终端升级的方法还可以包括以下步骤:
可选地,终端可以基于升级包的大小以及目标版本中data分区大小,确定是否可以将升级包存储于data分区块设备中。例如,当终端确定目标版本中data分区大小大于升级包大小时,说明在升级过程中,该data分区的可用空间足以容纳升级包,此时,确定升级包可以存储于用户数据分区块设备中,也即在块设备维度存储升级包。
S403,将升级包写入data分区块设备。
在一些实施例中,当在步骤S402中确定目标版本中的data分区大小发生变化时,可以在文件系统中卸载data分区块设备的路径,使得data分区块设备处于未挂载状态。具体地,使块设备处于未挂载状态的方式例如为:调用系统命令卸载块设备在文件系统中的访问路径,或者调用系统命令删除data分区块设备与文件系统之间的映射关系。
应理解,通常来说,块设备如果是挂载状态,那么该块设备上的计算机文件和目录可以供用户通过文件系统访问,用户或者系统也可以通过文件系统将数据写入块设备。然而,当块设备中存储有升级包时,若该块设备仍然处于挂载状态,那么在升级过程中有其它数据写入该块设备时,会使得升级包遭到破坏,导致升级失败。因此,在本申请实施例中,可以将块设备卸载,使块设备处于未挂载状态,以避免其他数据的写入,保证升级包的完整性和可用性。
可选地,可以在升级包存储完成后,使块设备处于未挂载状;或者,也可以在升级包存储之前,使块设备处于未挂载状态。本申请实施例只需满足使data分区块设备在升级过程中处于未挂载状态即可,对使块设备处于未挂载状态的具体时间不作限定。
应理解,当升级包存入data分区块设备后,该块设备之前的数据会遭到破坏,如被清除,升级包可以按照预设准则计算的存储位置(如起始位置)存储于该块设备中。
当终端将升级包存储至data分区块设备时,升级包在data分区块设备中的起始位置相对于该块设备尾端的第一偏移量小于或等于升级后的用户数据分区块设备的可用 空间。具体地,升级包在data分区块设备中的存储位置可以靠近块设备的尾部(参考图3),以避免被其他分区的数据覆盖。
具体地,升级包的起始位置(starAddr)可以根据目标版本升级包的大小(packageSize)和data分区块设备大小(dataSize)计算得出,计算方式为:starAddr=dataSize-packageSize-align,其中,align为字节对齐所需要的大小。
应理解,这里之所以需要考虑字节对齐所需要的大小,是因为当后续采用mmap方式由data分区块设备中读取升级包数据时,需要从读取方式(如4K)的整数倍的位置开始,才能顺利读取数据。换言之,align是为了使升级包的起始位置对齐在读取方式(如4K)的整数倍的位置,以保证通过mmap方式将升级包数据顺利映射至内存中。
举例来说,当mmap方式以4K为读取单位读取数据时,若升级包的起始位置为1G,此时可以顺利读取数据;若升级包的起始位置为1G多1字节时,其不是4K的整数倍,因而无法使数据被顺利读取,此时,可以利用对齐字节的大小,增加升级包起始位置相对data分区块设备尾部的偏移量,使得起始位置与4K的整数倍字节的位置对齐,从而保证升级模块通过mmap方式映射升级数据。
S404,将升级命令写入至少一个备用分区。
应理解,在实际的升级过程中,经常会由于终端断电等情况,导致升级进程意外停止,然而,当终端重新启动时,由于之前升级进行可能已经使data分区发生了变动,基于之前升级包存储位置映射的升级数据可能会发生错误。因此,为了便于对升级包的查找以及保证升级包位置的准确性,本申请实施例利用升级包的起始位置相对于data分区块设备尾端位置的第一偏移量来指示升级包的存储位置。
具体来说,终端可以根据升级包在块设备中的存储位置信息,计算升级包的起始位置相对于data分区块设备尾端的第一偏移量(offset),在升级过程中,该第一偏移量可以用于指示升级包的存储位置。其中,第一偏移量可以根据data分区块设备的大小(dataSize)以及升级包的起始位置(starAddr)计算获得,计算方式为:offset=dataSize-starAddr。
在一些实施例中,当升级包存储完毕后,可以根据升级包的存储位置生成用于指示升级包存储位置的升级命令,并且将升级命令存储于备用分块中,以便在需要重新获取升级数据时(如在终端断电后重启的场景下),准确地查找到升级包所在的位置,继续升级进程。
示例性的,升级命令可以包括data分区块设备路径信息、第一偏移量以及升级包大小等信息,或者,升级命令还可以包括能够用于计算出第一偏移量的其它信息,本申请对此不作限定。其中,升级命令的格式例如可以为:
--updata_package=/dev/block/by-name/userdata:offset:packageSize。
在一些实施例中,备用分区可以为预划分的一块固定分区,该备用分区在升级过程中不进行更新,换言之,在版本迭代过程中,该备用分区的位置、大小等均不发生变化。该备用分区可以用于存储启动参数,该启动参数用于指示重新启动的模式类型,如启动升级模式等。其中,该备用分区还可以用于存储升级命令。示例性的,备用分区例如为misc分区。
在一些实施例中,将升级命令存储至备用分区后,终端的升级预处理模块可以向升级模块发送通知消息,通知升级模块可以到备用分区读取升级命令,根据升级命令指示的升级包的存储位置,获取升级包数据。
举例来说,假设在终端断电时,分区表已更新导致data分区已经发生变化,由于此时备用分区的升级命令中存储有升级包相对于data分区块设备尾端的第一偏移量(offset)和更新后的data分区块设备大小(newDataSize),因此,在终端重启后,升级模块可以通过offset和newDataSize计算升级包在新的data分区块设备中的实际位置,其中,升级包新的起始位置为:newstarAddr=newDataSize-offset。之后,升级模块根据新的起始位置,通过mmap方式把data分区块设备中的升级数据映射至终端内存中,继续升级进程。
上述方法通过将升级命令,存储在至少一个备用分区,可以避免在终端断电等情况导致的升级进程意外停止的场景下,升级包丢失,升级模块无法读取升级数据,致使升级失败的问题。
S405,通过mmap方式将data分区块设备中的升级数据映射到终端内存中。
其中,终端升级模块根据升级命令获取升级包在data分区块设备中的存储位置信息。具体地,升级模块可以通过升级命令获知升级包在data分区块设备中的data分区块设备的路径、第一偏移量、data分区块设备大小、升级包大小等信息;之后再根据这些信息计算出升级包在data分区块设备中的起始位置。
在一些实施例中,升级模块根据升级包的存储位置,通过mmap方式将升级数据映射到终端内存中。
在一些实施例中,当升级包通过mmap方式映射至终端内存之后,终端的升级模块可以对升级包进行校验,如对升级包签名和完整性的校验,以检查该升级包的来源是否合法以及升级包是否完整。
上述方法通过mmap方式将升级数据映射到终端内存,可以避免升级过程受限于内存的大小,换言之,能够解决目前升级时,当升级包大小大于内存容量时,导致的升级失败的问题。
S406,基于终端内存中的升级数据,对终端系统进行升级。
在一些实施例中,终端的升级模块可以由终端内存中读取升级数据;之后,升级模块根据升级数据所指示的各分区的实际位置(如起始位置)以及各分区的大小,对各分区进行更新,使终端系统由当前版本升级为目标版本。
在一些实施例中,由于data分区块设备存储升级包后,该data分区被破坏,因此,在各分区更新完毕后,升级模块可以通过格式化或者写镜像数据的方式刷好data分区块设备数据。
根据本申请实施例提供的终端升级的方法,通过将升级包存储在未挂载状态的用户数据块设备中,并利用mmap方式将升级数据映射至内存,使终端利用内存中的升级数据对各分区进行更新,实现系统升级,能够保证升级包在升级过程中不被破坏,提高OTA升级成功的几率。
示例性的,如图7所示,本申请实施例还提供了一种终端结构示意图。该终端700包括处理器701,存储器702以及通信接口703,以及连接这些器件的总线704。其中, 存储器702中包括计算机指令,当所述计算机指令在处理器701中被执行时,使得终端700实现本申请实施例提供的终端升级的方法。
此外,本申请实施例还提供了一种通信系统,包括OTA服务器和终端,其中OTA服务器和终端用于执行上文所述的本申请实施例中的终端升级的方法。
本申请实施例还提供了一种计算机可读存储介质,所述计算机程序存储介质具有程序指令,当所述程序指令被直接或者间接执行时,使得所述计算机实现本申请实施例提供的终端升级的方法。
本申请实施例还提供了一种计算机程序,当所述计算机程序在至少一个处理器中执行时,使得所述计算机实现本申请实施例提供的终端升级的方法。
本申请实施例还提供了一种计算机程序产品,当所述计算机程序在至少一个处理器中执行时,使得所述计算机实现本申请实施例提供的终端升级的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。

Claims (20)

  1. 一种终端升级的方法,其特征在于,应用于终端,包括:
    接收目标版本的升级包,所述升级包包括所述目标版本的升级数据;
    将所述升级包存储在用户数据分区块设备,其中,所述块设备在升级过程中为未挂载状态,所述升级包的起始位置相对于所述块设备尾部的偏移量小于所述块设备升级后的可用空间;
    通过内存映射函数mmap将所述升级数据映射至所述终端的内存中;
    基于所述内存中的升级数据,将所述终端由当前版本升级为所述目标版本。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    卸载所述块设备在文件系统中的访问路径。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    接收OTA服务器发送的第一信息,所述第一信息包括所述目标版本中的分区信息;
    根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:
    根据所述升级包在所述块设备中的起始位置和所述用户数据分区块设备的大小,确定所述起始位置相对于所述块设备中尾部的第一偏移量。
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:
    生成升级命令,所述升级命令包括所述用户数据分区块设备的路径、所述第一偏移量、所述升级包大小;
    将所述升级命令存储于至少一个备用分区中,所述备用分区是在升级过程中不更新的分区。
  6. 根据权利要求4或5所述的方法,其特征在于,所述第一偏移量包括字节对齐大小,所述字节对齐大小用于使所述起始位置与所述mmap读取方式的整数倍字节位置对齐。
  7. 根据权利要求3-6中任一项所述的方法,其特征在于,第一信息具体包括所述目标版本中用户数据分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中用户数据分区大小;
    所述根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化,包括:
    当所述目标版本中的用户数据分区大小和所述当前版本中用户数据分区大小不同时,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
  8. 根据权利要求3-6中任一项所述的方法,其特征在于,第一信息包括所述目标版本中除用户数据分区之外的其他分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中除用户数据分区之外的其他分区大小的指示信息;
    所述根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化,包括:
    当所述目标版本中除用户数据分区之外的其它分区大小的总和与所述当前版本中 除用户数据分区之外的其它分区大小的总和不同时,确定所述目标版本中的用户分区大小相对于所述当前版本中的用户分区大小发生变化。
  9. 一种终端,其特征在于,包括:
    下载模块,用于接收目标版本的升级包,所述升级包包括所述目标版本的升级数据;并将所述升级包存储在用户数据分区块设备,其中,所述块设备在升级过程中为未挂载状态,所述升级包的起始位置相对于所述块设备尾部的偏移量小于所述块设备升级后的可用空间;
    升级模块,用于通过内存映射函数mmap将所述升级数据映射至所述终端的内存中;并基于所述内存中的升级数据,将所述终端由当前版本升级为所述目标版本。
  10. 根据权利要求9所述的终端,其特征在于,所述终端还包括:
    卸载模块,还用于卸载所述块设备在文件系统中的访问路径。
  11. 根据权利要求9或10所述的终端,其特征在于,所述终端还包括预下载模块和判断模块,其中,
    所述预下载模块,用于接收OTA服务器发送的第一信息,所述第一信息包括所述目标版本中的分区信息;
    所述判断模块,用于根据所述第一信息和所述当前版本中的分区信息,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
  12. 根据权利要求9-11中任一项所述的终端,其特征在于,所述终端还包括升级预处理模块,用于根据所述升级包在所述块设备中的起始位置和所述用户数据分区块设备的大小,确定所述起始位置相对于所述块设备尾部的第一偏移量。
  13. 根据权利要求12所述的终端,其特征在于,所述升级预处理模块,还用于生成升级命令,所述升级命令包括所述用户数据分区块设备的路径、所述第一偏移量、所述升级包大小;并将所述升级命令存储于至少一个备用分区中,所述备用分区为在升级过程中不更新的分区。
  14. 根据权利要求12或13所述的终端,其特征在于,所述第一偏移量包括字节对齐大小,所述字节对齐大小用于使所述起始位置与所述mmap读取方式的整数倍字节位置对齐。
  15. 根据权利要求11-14中任一项所述的终端,其特征在于,第一信息具体包括所述目标版本中用户数据分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中用户数据分区大小;
    所述判断模块,还用于当所述目标版本中的用户数据分区大小和所述当前版本中用户数据分区大小不同时,确定所述目标版本中的用户数据分区大小相对于所述当前版本中的用户数据分区大小发生变化。
  16. 根据权利要求11-14中任一项所述的终端,其特征在于,第一信息包括所述目标版本中除用户数据分区之外的其他分区大小的指示信息,所述当前版本中的分区信息包括所述当前版本中除用户数据分区之外的其他分区大小的指示信息;
    所述判断模块,还用于当所述目标版本中除用户数据分区之外的其它分区大小的总和与所述当前版本中除用户数据分区之外的其它分区大小的总和不同时,确定所述目标版本中的用户分区大小相对于所述当前版本中的用户分区大小发生变化。
  17. 一种终端,其特征在于,包括:
    处理器;
    存储器,用于存储所述处理器的可执行指令;
    当所述处理器执行所述可执行指令时,使得所述终端实现如权利要求1至8中任一项所述的方法。
  18. 一种通信系统,其特征在于,所述通信系统包括OTA服务器和终端,其中,所述终端用于执行如权利要求1至8中任一项所述的方法。
  19. 一种计算机可以读存储介质,其特征在于,所述计算机程序存储介质具有程序指令,当所述程序指令被直接或者间接执行时,使所述计算机实现如权利要求1至8中任一项所述的方法。
  20. 一种计算机程序,其特征在于,当所述计算机程序在至少一个处理器中执行时,使所述计算机实现如权利要求1至8中任一项所述的方法。
PCT/CN2021/126472 2020-11-04 2021-10-26 终端升级的方法及终端 WO2022095758A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011219326.5 2020-11-04
CN202011219326.5A CN114443081A (zh) 2020-11-04 2020-11-04 终端升级的方法及终端

Publications (1)

Publication Number Publication Date
WO2022095758A1 true WO2022095758A1 (zh) 2022-05-12

Family

ID=81361797

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/126472 WO2022095758A1 (zh) 2020-11-04 2021-10-26 终端升级的方法及终端

Country Status (2)

Country Link
CN (1) CN114443081A (zh)
WO (1) WO2022095758A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115175171A (zh) * 2022-06-29 2022-10-11 智己汽车科技有限公司 车辆ota升级系统及车辆ota升级方法
CN115952564A (zh) * 2023-03-01 2023-04-11 荣耀终端有限公司 数据写入方法和终端设备
WO2024000535A1 (zh) * 2022-06-30 2024-01-04 北京小米移动软件有限公司 分区表更新方法、装置、电子设备及存储介质
CN115175171B (zh) * 2022-06-29 2024-05-14 智己汽车科技有限公司 车辆ota升级系统及车辆ota升级方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116719670B (zh) * 2022-09-30 2024-04-12 荣耀终端有限公司 数据处理的方法、电子设备及可读存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8898417B1 (en) * 2009-10-20 2014-11-25 Micron Technology, Inc. Block-based storage device with a memory-mapped interface
WO2016183951A1 (zh) * 2015-05-15 2016-11-24 中兴通讯股份有限公司 一种系统升级方法及终端
US9557983B1 (en) * 2010-12-29 2017-01-31 Emc Corporation Flexible storage application deployment mechanism
CN106484448A (zh) * 2015-08-28 2017-03-08 青岛海信移动通信技术股份有限公司 一种软件升级方法及装置
CN109062598A (zh) * 2018-06-26 2018-12-21 珠海全志科技股份有限公司 一种安全的ota升级方法及系统
CN109086078A (zh) * 2017-06-14 2018-12-25 展讯通信(上海)有限公司 安卓系统升级方法、装置、服务器及移动终端

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8898417B1 (en) * 2009-10-20 2014-11-25 Micron Technology, Inc. Block-based storage device with a memory-mapped interface
US9557983B1 (en) * 2010-12-29 2017-01-31 Emc Corporation Flexible storage application deployment mechanism
WO2016183951A1 (zh) * 2015-05-15 2016-11-24 中兴通讯股份有限公司 一种系统升级方法及终端
CN106484448A (zh) * 2015-08-28 2017-03-08 青岛海信移动通信技术股份有限公司 一种软件升级方法及装置
CN109086078A (zh) * 2017-06-14 2018-12-25 展讯通信(上海)有限公司 安卓系统升级方法、装置、服务器及移动终端
CN109062598A (zh) * 2018-06-26 2018-12-21 珠海全志科技股份有限公司 一种安全的ota升级方法及系统

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115175171A (zh) * 2022-06-29 2022-10-11 智己汽车科技有限公司 车辆ota升级系统及车辆ota升级方法
CN115175171B (zh) * 2022-06-29 2024-05-14 智己汽车科技有限公司 车辆ota升级系统及车辆ota升级方法
WO2024000535A1 (zh) * 2022-06-30 2024-01-04 北京小米移动软件有限公司 分区表更新方法、装置、电子设备及存储介质
CN115952564A (zh) * 2023-03-01 2023-04-11 荣耀终端有限公司 数据写入方法和终端设备
CN115952564B (zh) * 2023-03-01 2023-08-15 荣耀终端有限公司 数据写入方法和终端设备

Also Published As

Publication number Publication date
CN114443081A (zh) 2022-05-06

Similar Documents

Publication Publication Date Title
WO2022095758A1 (zh) 终端升级的方法及终端
US9286164B2 (en) Electronic device to restore MBR, method thereof, and computer-readable medium
US8539471B2 (en) Updating firmware of an electronic device
US7793283B2 (en) Communication terminal software updating method, communication terminal, and software updating method
US20120102477A1 (en) Firmware update method and apparatus for a mobile device
CN111796856B (zh) 差分升级方法及装置、存储介质、计算机设备
US20040093597A1 (en) Firmware update system for facilitating firmware update in mobile handset related applications
KR101555210B1 (ko) 휴대용 단말기에서 내장 대용량 메모리를 이용한 컨텐츠 다운로드 방법 및 장치
US20230393840A1 (en) File update method and apparatus, device and storage medium
US20100268867A1 (en) Method and apparatus for updating firmware as a background task
CN110825563B (zh) 系统恢复方法、装置以及电子设备
CN109086078B (zh) 安卓系统升级方法、装置、服务器及移动终端
US20120221609A1 (en) Data Storage System and Method
WO2023169035A1 (zh) 操作系统的升级方法、电子设备及存储介质
CN115599747A (zh) 一种分布式存储系统的元数据同步方法、系统及设备
CN112148337A (zh) 一种固件升级方法及装置
US11861349B2 (en) Modular firmware updates in an information handling system
CN114780019A (zh) 电子设备的管理方法、装置、电子设备及存储介质
CN103559059A (zh) 一种快速的免介质Linux系统升级方法
US20210349855A1 (en) Method of data structuring for difference between old and new data and device thereof
CN111124294B (zh) 一种扇区映射信息的管理方法及装置、存储介质和设备
CN110737455A (zh) 固件的更新方法、装置及电子设备
CN107436783B (zh) 一种用于移动终端的差分升级方法、存储介质及移动终端
EP3992783A1 (en) Patch releasing method, server and terminal device
US9971532B2 (en) GUID partition table based hidden data store system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21888455

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21888455

Country of ref document: EP

Kind code of ref document: A1