WO2019062576A1 - 一种***升级异常断电的保护方法及终端设备 - Google Patents

一种***升级异常断电的保护方法及终端设备 Download PDF

Info

Publication number
WO2019062576A1
WO2019062576A1 PCT/CN2018/105978 CN2018105978W WO2019062576A1 WO 2019062576 A1 WO2019062576 A1 WO 2019062576A1 CN 2018105978 W CN2018105978 W CN 2018105978W WO 2019062576 A1 WO2019062576 A1 WO 2019062576A1
Authority
WO
WIPO (PCT)
Prior art keywords
offset value
upgrade
image file
system image
terminal device
Prior art date
Application number
PCT/CN2018/105978
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 晶晨半导体(上海)股份有限公司
Priority to US16/324,607 priority Critical patent/US20210382789A1/en
Publication of WO2019062576A1 publication Critical patent/WO2019062576A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/30Means for acting in the event of power-supply failure or interruption, e.g. power-supply fluctuations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1417Boot up procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1435Saving, restoring, recovering or retrying at system level using file system or storage system metadata
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and a terminal device for protecting a system from abnormal power failure.
  • the system upgrade mainly refers to the repair and optimization of the terminal device system.
  • the prompt message “Upgrading, Do not power off...” is usually displayed to inform the user that the system is being upgraded. Upgrade the system to prevent artificial power loss, so that half of the system update is destroyed and the bricks are changed. The brick change means that the system cannot start normally. Often the user's operational awareness can not be controlled, sudden power outages are unpredictable, which leads to the power failure in the upgrade process is unavoidable, the prompt can only reduce the probability of occurrence, essentially can not solve the upgrade power down brick The problem. As the capacity of the flash storage medium increases, the backup partition can be used to restore the system image file of the damaged storage partition when the storage partition is damaged. However, for the terminal equipment that has been mass-produced, in order to ensure downward compatibility, it is not realistic to increase the partition, and upgrading the changed partition is also a great risk.
  • a system upgrade method for abnormal power failure which is applied to system upgrade of a terminal device, wherein the terminal device includes a plurality of storage partitions, and each of the storage partitions respectively stores a first system image file and a first a second system image file, and a first offset value corresponding to the first system image file, and a second offset value corresponding to the second system image file;
  • Step S1 Obtain a startup offset value of the storage partition.
  • Step S2 When the startup offset value is the first offset value, starting the first system image file;
  • Step S3 Obtain an upgrade file, perform the upgrade operation on the obtained second system image file in the current storage partition, and set the startup offset value to the Second offset value;
  • Step S4 Perform an upgrade operation on the first system image file that is started, and set the startup offset value to the first offset value when the upgrade succeeds.
  • the startup offset value is the second offset value, as shown in FIG. 2, the following steps are performed:
  • Step A1 Start the second system image file.
  • step A2 the upgrade file is obtained, and the obtained upgrade file is used to perform an upgrade operation on the first system image file in the current storage partition, and the startup offset value is set to be The first offset value;
  • Step A3 Perform an upgrade operation on the activated second system image file, and set the startup offset value to the second offset value when the upgrade succeeds.
  • step S3 performing an upgrade operation on the second system image file, further comprising the following steps:
  • Step S31 Determine whether the second system image file is successfully upgraded.
  • step S33 If no, go to step S33;
  • Step S32 after the start offset value is set to the second offset value, the process proceeds to step S4;
  • step S33 a prompt message indicating that the upgrade failed is formed, and exits.
  • a method for performing an upgrade operation on the first image file that is started includes the following steps:
  • Step S41 Determine whether the first image file is successfully upgraded.
  • step S42 If yes, go to step S42;
  • Step S42 setting the startup offset value to the first offset value and exiting
  • Step S43 After saving the startup offset value as the second offset value, when the terminal device starts up again, the second system image file is started according to the second offset value.
  • the size of each of the storage partitions is more than twice the size of the saved first image file or more than twice the size of the second image file.
  • the terminal device further includes a boot partition, where the boot partition is used to save a boot loader.
  • the foregoing technical solution has the following advantages or advantages: by saving two system image files in one storage partition, when booting into one of the system image files, performing an upgrade operation on another system image file first, and then performing the upgrade operation on the current system
  • the image file performs the upgrade operation. Even if the power fails and the upgrade fails, the terminal device can be started normally. This overcomes the defect that the terminal device fails to start normally when the system device is powered off during the system upgrade operation.
  • FIG. 1 is a flowchart of an embodiment of a method for protecting an abnormal power failure of a system upgrade according to the present invention
  • FIG. 2 is a flowchart of an embodiment of a method for protecting a system upgrade abnormal power failure according to an embodiment of the present invention
  • FIG. 3 is a flowchart of an embodiment of upgrading a second system image upgrade file in an embodiment of a method for protecting an abnormal power failure of a system upgrade according to an embodiment of the present invention
  • FIG. 4 is a flowchart of an embodiment of upgrading a first system image upgrade file in an embodiment of a method for protecting an abnormal power outage of a system according to the present invention.
  • the technical solution of the present invention includes a protection method for abnormal power-off of system upgrade.
  • An embodiment of a method for protecting a system from abnormal power failure is applied to system upgrade of a terminal device, where the terminal device includes multiple storage partitions, and each storage partition stores a first system image file and a second system image respectively. a file, and a first offset value corresponding to the first system image file, and a second offset value corresponding to the second system image file;
  • Step S1 Obtain a startup offset value of a storage partition
  • Step S2 when the startup offset value is the first offset value, starting the first system image file
  • step S3 an upgrade file is obtained, and the obtained upgrade file is upgraded to the second system image file in the current storage partition, and the startup offset value is set to a second offset value when the upgrade is successful.
  • Step S4 Perform an upgrade operation on the first system image file that is started, and set the startup offset value to the first offset value when the upgrade succeeds.
  • the terminal device fails to start normally due to power failure during the upgrade process, and the problem of inconvenience of increasing the backup partition is increased.
  • system image file is a system image file of two identical systems, and the first system image file is named for the difference description, and the second system is Image file
  • the obtained system offset value is the first offset value
  • the first system image file is started, and the upgrade file is first upgraded to the second system image file during the upgrade, and the second system image file is upgraded at this time.
  • the upgrade fails.
  • the startup offset value is still the first offset value and enters the first system image file.
  • the startup offset value is set to the second offset value, and continue to perform the upgrade operation on the first system image file that is started. If the power failure occurs or the upgrade fails, the terminal device The second system image file is entered from the start offset value to the second offset value, and the start offset value is set to the first offset value.
  • Step A1 Start a second system image file.
  • Step A2 Obtain an upgrade file, perform an upgrade operation on the first system image file in the current storage partition, and set the startup offset value to a first offset value when the upgrade succeeds;
  • Step A3 Perform an upgrade operation on the activated second system image file, and set the startup offset value to the second offset value when the upgrade succeeds.
  • the second system image file is entered, and then the upgrade operation is performed from the first system image file. If the upgrade operation fails, the terminal device is again At startup, the startup offset value will still be the second offset value to enter the second system image file;
  • the startup offset value is finally set to the second offset value. If the upgrade succeeds, the terminal device will enter the first system image file.
  • step S3 performing an upgrade operation on the second system image file further includes the following steps:
  • Step S31 Determine whether the second system image file is successfully upgraded.
  • step S33 If no, go to step S33;
  • Step S32 after setting the startup offset value to the second offset value, the process proceeds to step S4;
  • step S33 a prompt message indicating that the upgrade failed is formed, and exits.
  • the startup offset value is set to the second offset value after the second system image file is successfully upgraded. If the upgrade fails, if the power is turned off, the startup offset value will not be set to the second offset value, which will still be the first offset value.
  • step S33 if the upgrade of the second system image file fails, the information related to the upgrade failure is prompted, waiting for the next upgrade trigger, and the upgrade is performed again.
  • step S4 a method for performing an upgrade operation on the first image file that is started includes the following steps:
  • Step S41 Determine whether the first image file is successfully upgraded.
  • step S42 If yes, go to step S42;
  • Step S42 setting the startup offset value to the first offset value and exiting
  • Step S43 After the startup offset value is saved as the second offset value, the second system image file is started according to the second offset value when the terminal device starts up again.
  • the upgrade operation of the current first system image file is continued, and if the upgrade is successful, the offset value is started.
  • the startup offset value is set to the second offset value after the second image file is successfully upgraded.
  • the terminal device starts up again, it will enter from the second system image file.
  • the size of each storage partition is more than twice the size of the saved first image file, or more than twice the size of the second image file.
  • the size of each storage partition must be more than twice the size of the saved system image file to ensure that the size of the storage partition after the upgrade is sufficient for storage. Two system image files and their corresponding upgrade files.
  • the terminal device further includes a boot partition for saving a boot loader.
  • the booting program is first booted to boot the system image file corresponding to the storage partition.
  • the terminal device saves two system image files in each storage partition, and when booting into one of the system image files, performs an upgrade operation on another system image file first, and then the current system image file.
  • the upgrade operation is performed. Even if the power fails and the upgrade fails, the terminal device can be started normally. This overcomes the defect that the terminal device fails to start normally when the system upgrade operation occurs during the system upgrade operation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Retry When Errors Occur (AREA)

Abstract

一种***升级异常断电的保护方法,应用于终端设备的***升级,包括以下步骤:步骤S1、获取一存储分区的启动偏移值;步骤S2、当启动偏移值为第一偏移值时,启动第一***镜像文件;步骤S3、获取一升级文件,将获取的升级文件对当前的存储分区中第二***镜像文件执行升级操作,并于升级成功时将启动偏移值设置为第二偏移值;步骤S4、继续对启动的第一***镜像文件执行升级操作,并于升级成功时将启动偏移值设置为第一偏移值。该方法克服了现有技术中终端设备在执行***升级操作时出现断电,导致终端设备***无法正常启动的缺陷。

Description

一种***升级异常断电的保护方法及终端设备 技术领域
本发明涉及通信技术领域,尤其涉及一种***升级异常断电的保护方法及终端设备。
背景技术
***升级,主要是指对终端设备***的修复及优化,现有的终端设备在升级操作时通常会出现“正在升级,请勿断电......”的提示信息,以告知用户正在升级***,防止人为的掉电,使得***更新了一半被破坏导致变砖,其中变砖是指***无法正常的启动。往往用户的操作意识是无法掌控的,突然的停电也是无法预料的,这就导致了,升级过程掉电是无法避免的,提示仅仅只能减少发生的概率,本质上无法解决升级掉电变砖的问题。随着flash存储介质容量的增大,可通过增加的备份分区,用来保证其中一个存储分区被破坏的时候,可以使用备份分区来还原被破坏的存储分区的***镜像文件。但是对于已经量产的终端设备,为了保证向下的兼容性,去增加分区是不太现实的,且升级变更分区,也是具有较大的风险性。
发明内容
针对现有技术中终端设备在执行升级操作时出现断电时存在的上述问题,现提供一种旨在对终端设备执行升级操作时,即使出现断电也不会影响存储分区中***镜像文件的正常启动的保护方法及终端设备。
具体技术方案如下:
一种***升级异常断电的保护方法,应用于终端设备的***升级,其特征在于,所述终端设备包括多个存储分区,每个所述存储分区分别存储一第一***镜像文件以及一第二***镜像文件,以及与所述第一***镜像文件对应的一第一偏移值,与所述第二***镜像文件对应的一第二偏移值;
包括以下步骤:
步骤S1、获取一所述存储分区的启动偏移值;
步骤S2、当所述启动偏移值为所述第一偏移值时,启动所述第一***镜像文件;
步骤S3、获取一升级文件,将获取的所述升级文件对当前的所述存储分区中所述第二***镜像文件执行升级操作,并于升级成功时将所述启动偏移值设置为所述第二偏移值;
步骤S4、继续对启动的所述第一***镜像文件执行升级操作,并于升级成功时将所述启动偏移值设置为所述第一偏移值。
优选的,当所述启动偏移值为所述第二偏移值时,如图2所示,执行以下步骤:
步骤A1、启动所述第二***镜像文件;
步骤A2、获取所述升级文件,将获取的所述升级文件对当前的所述存储分区中的所述第一***镜像文件执行升级操作,并于升级成功时将所述启动偏移值设置为所述第一偏移值;
步骤A3、继续对启动的所述第二***镜像文件执行升级操作,并于升级成功时将所述启动偏移值设置为所述第二偏移值。
优选的,在所述步骤S3中,对所述第二***镜像文件执行升级操作,还包括以下步骤:
步骤S31、判断所述第二***镜像文件是否升级成功;
若是,执行步骤S32;
若否,执行步骤S33;
步骤S32、将所述启动偏移值设置为所述第二偏移值后,转向步骤S4;
步骤S33、则形成一升级失败的提示信息,并退出。
优选的,在所述步骤S4中,对启动的所述第一镜像文件执行升级操作的方法,包括以下步骤:
步骤S41、判断所述第一镜像文件是否升级成功;
若是,执行步骤S42;
若否,执行步骤S43;
步骤S42、将所述启动偏移值设置为所述第一偏移值并退出;
步骤S43、将所述启动偏移值保存为所述第二偏移值后,所述终端设备再次启动时会根据所述第二偏移值启动所述第二***镜像文件。
优选的,每个所述存储分区的大小为保存的所述第一镜像文件大小的2倍以上,或者为所述第二镜像文件大小的2倍以上。
优选的,所述终端设备还包括一启动分区,所述启动分区用以保存一启动引导程序。
还包括一种终端设备,其中,适用于上述的***升级异常断电的保护方法。
上述技术方案具有如下优点或有益效果:通过在一个存储分区中保存两个***镜像文件,可在启动进入其中一个***镜像文件时,对另一***镜像文件先执行升级操作,然后对当前的***镜像文件执行升级操作,即使断电导致升级失败,终端设备还是可以正常启动,克服了现有技术中终端设备在执行***升级操作时出现断电,导致终端设备***无法正常启动的缺陷。
附图说明
参考所附附图,以更加充分的描述本发明的实施例。然而,所附附图仅用于说明和阐述,并不构成对本发明范围的限制。
图1为本发明一种***升级异常断电的保护方法的实施例的流程图;
图2为本发明一种***升级异常断电的保护方法的实施例中,关于进入第二***镜像升级文件实施例的流程图;
图3为本发明一种***升级异常断电的保护方法的实施例中,关于升级第二***镜像升级文件实施例的流程图;
图4为本发明一种***升级异常断电的保护方法的实施例中,关于升级第一***镜像升级文件实施例的流程图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。
需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。
下面结合附图和具体实施例对本发明作进一步说明,但不作为本发明的限定。
本发明的技术方案中包括一种***升级异常断电的保护方法。
一种***升级异常断电的保护方法的实施例,应用于终端设备的***升级,其中,终端设备包括多个存储分区,每个存储分区分别存储一第一***镜像文件以及一第二***镜像文件,以及与第一***镜像文件对应的一第一偏移值,与第二***镜像文件对应的一第二偏移值;
如图1所示,包括以下步骤:
步骤S1、获取一存储分区的启动偏移值;
步骤S2、当启动偏移值为第一偏移值时,启动第一***镜像文件;
步骤S3、获取一升级文件,将获取的升级文件对当前的存储分区中第二***镜像文件执行升级操作,并于升级成功时将启动偏移值设置为第二偏移值;
步骤S4、继续对启动的第一***镜像文件执行升级操作,并于升级成功时将启动偏移值设置为第一偏移值。
针对现有技术中,终端设备在升级过程中由于出现断电,导致终端设备***升级异常无法正常启动的问题,以及通过增加备份分区存在的不便的问题。
本发明中,通过在存储分区中分别保存一***镜像文件,需要说明的是上述的***镜像文件为两个相同***的***镜像文件,为了区别描述命名为第一***镜像文件,和第二***镜像文件;
当获取的***的启动偏移值为第一偏移值时,启动第一***镜像文件,在升级时首先将获取的升级文件对第二***镜像文件进行升级,若此时第二***镜像文件升级失败,终端设备下次启动时依旧是启动偏移值为第一偏移值进入第一***镜像文件;
当第二***镜像文件升级成功后,将启动偏移值设置为第二偏移值,并继续对启动的第一***镜像文件执行升级操作,若此时出现断电或者升级失败,则终端设备会从启动偏移值为第二偏移值进入第二***镜像文件,若启 动偏移值设置为第一偏移值。上述方案,克服了现有技术中升级***过程中出现的断电导致终端设备的***无法正常启动的缺陷。
在一种较优的实施方式中,如图2所示,当启动偏移值为第二偏移值时,执行以下步骤:
步骤A1、启动第二***镜像文件;
步骤A2、获取升级文件,将获取的升级文件对当前的存储分区中的第一***镜像文件执行升级操作,并于升级成功时将启动偏移值设置为第一偏移值;
步骤A3、继续对启动的第二***镜像文件执行升级操作,并于升级成功时将启动偏移值设置为第二偏移值。
上述技术方案中,若获取的启动偏移值为第二偏移值,则进入第二***镜像文件,然后从第一***镜像文件开始执行升级操作,若此时升级操作失败,则终端设备再次启动时依旧会是启动偏移值为第二偏移值进入第二***镜像文件;
当第一***镜像文件执行升级操作成功后,将启动偏移值设置为第一偏移值,并继续对当前的第二***镜像文件执行升级操作,若此时出现断电或者其他原因导致升级失败,此时终端设备会从启动偏移值为第一偏移值进入第一***镜像文件,若升级成功则会将启动偏移值最终设置为第二偏移值。
在一种较优的实施方式中,如图3所示,在步骤S3中,对第二***镜像文件执行升级操作,还包括以下步骤:
步骤S31、判断第二***镜像文件是否升级成功;
若是,执行步骤S32;
若否,执行步骤S33;
步骤S32、将启动偏移值设置为第二偏移值后,转向步骤S4;
步骤S33、则形成一升级失败的提示信息,并退出。
上述技术方案中,在终端设备进入第一***镜像文件,对第二***镜像文件执行升级操作时,需要保证第二***镜像文件升级成功之后,才将启动偏移值设置为第二偏移值,若升级失败如出现断电,则启动偏移值不会被设置为第二偏移值,依旧会是第一偏移值。
在步骤S33中,如果升级第二***镜像文件失败,则提示升级失败的相关信息,等待下次升级触发,再次进行升级。
在一种较优的实施方式中,如图4所示,在步骤S4中,对启动的第一镜像文件执行升级操作的方法,包括以下步骤:
步骤S41、判断第一镜像文件是否升级成功;
若是,执行步骤S42;
若否,执行步骤S43;
步骤S42、将启动偏移值设置为第一偏移值并退出;
步骤S43、将启动偏移值保存为第二偏移值后,终端设备再次启动时会根据第二偏移值启动第二***镜像文件。
上述技术方案中,当进入第一***镜像文件之后,并且在对第二***镜像文件升级成功之后,会继续对当前的第一***镜像文件执行升级操作,若升级成功,则启动偏移值会设置成第一偏移值,以保证终端设备再次启动时,能够继续进入第一***镜像文件;
若升级失败,则此时启动偏移值会是在成功升级第二镜像文件后,设置成的第二偏移值,终端设备再次启动时会从第二***镜像文件进入。
在一种较优的实施方式中,每个存储分区的大小为保存的第一镜像文件大小的2倍以上,或者为第二镜像文件大小的2倍以上。
上述技术方案中,为了保证终端设备的每个***镜像文件能够升级成功,每个存储分区的大小必须是其保存的***镜像文件大小的2倍以上,以保证升级之后的存储分区的大小足够存储两个***镜像文件以及其对应的升级文件。
在一种较优的实施方式中,终端设备还包括一启动分区,启动分区用以保存一启动引导程序。
上述技术方案中,终端设备启动之后,首先会通过启动引导程序引导启动存储分区对应的***镜像文件。
还包括一种终端设备,其中,适用于上述的***升级异常断电的保护方法。
上述技术方案中,终端设备通过在每个存储分区中保存两个***镜像文件,可在启动进入其中一个***镜像文件时,对另一***镜像文件先执行升 级操作,然后对当前的***镜像文件执行升级操作,即使断电导致升级失败,终端设备还是可以正常启动,克服了现有技术中终端设备在执行***升级操作时出现断电,导致终端设备***无法正常启动的缺陷。
以上所述仅为本发明较佳的实施例,并非因此限制本发明的实施方式及保护范围,对于本领域技术人员而言,应当能够意识到凡运用本发明说明书及图示内容所作出的等同替换和显而易见的变化所得到的方案,均应当包含在本发明的保护范围内。

Claims (7)

  1. 一种***升级异常断电的保护方法,应用于终端设备的***升级,其特征在于,所述终端设备包括多个存储分区,每个所述存储分区分别存储一第一***镜像文件以及一第二***镜像文件,以及与所述第一***镜像文件对应的一第一偏移值,与所述第二***镜像文件对应的一第二偏移值;
    包括以下步骤:
    步骤S1、获取一所述存储分区的启动偏移值;
    步骤S2、当所述启动偏移值为所述第一偏移值时,启动所述第一***镜像文件;
    步骤S3、获取一升级文件,将获取的所述升级文件对当前的所述存储分区中所述第二***镜像文件执行升级操作,并于升级成功时将所述启动偏移值设置为所述第二偏移值;
    步骤S4、继续对启动的所述第一***镜像文件执行升级操作,并于升级成功时将所述启动偏移值设置为所述第一偏移值。
  2. 根据权利要求1所述的保护方法,其特征在于,当所述启动偏移值为所述第二偏移值时,执行以下步骤:
    步骤A1、启动所述第二***镜像文件;
    步骤A2、获取所述升级文件,将获取的所述升级文件对当前的所述存储分区中的所述第一***镜像文件执行升级操作,并于升级成功时将所述启动偏移值设置为所述第一偏移值;
    步骤A3、继续对启动的所述第二***镜像文件执行升级操作,并于升级成功时将所述启动偏移值设置为所述第二偏移值。
  3. 根据权利要求1所述的保护方法,其特征在于,在所述步骤S3中,对所述第二***镜像文件执行升级操作,还包括以下步骤:
    步骤S31、判断所述第二***镜像文件是否升级成功;
    若是,执行步骤S32;
    若否,执行步骤S33;
    步骤S32、将所述启动偏移值设置为所述第二偏移值后,转向步骤S4;
    步骤S33、则形成一升级失败的提示信息,并退出。
  4. 根据权利要求1所述的保护方法,其特征在于,在所述步骤S4中,对启动的所述第一镜像文件执行升级操作的方法,包括以下步骤:
    步骤S41、判断所述第一镜像文件是否升级成功;
    若是,执行步骤S42;
    若否,执行步骤S43;
    步骤S42、将所述启动偏移值设置为所述第一偏移值并退出;
    步骤S43、将所述启动偏移值保存为所述第二偏移值后,所述终端设备再次启动时会根据所述第二偏移值启动所述第二***镜像文件。
  5. 根据权利要求1所述的保护方法,其特征在于,每个所述存储分区的大小为保存的所述第一镜像文件大小的2倍以上,或者为所述第二镜像文件大小的2倍以上。
  6. 根据权利要求1所述的保护方法,其特征在于,所述终端设备还包括一启动分区,所述启动分区用以保存一启动引导程序。
  7. 一种终端设备,其特征在于,适用于权利要求1-6中任一所述的***升级异常断电的保护方法。
PCT/CN2018/105978 2017-09-26 2018-09-17 一种***升级异常断电的保护方法及终端设备 WO2019062576A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/324,607 US20210382789A1 (en) 2017-09-26 2018-09-17 Method for protecting system from being powered off during upgrade and terminal device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710882851.7 2017-09-26
CN201710882851.7A CN107577563A (zh) 2017-09-26 2017-09-26 一种***升级异常断电的保护方法及终端设备

Publications (1)

Publication Number Publication Date
WO2019062576A1 true WO2019062576A1 (zh) 2019-04-04

Family

ID=61039412

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/105978 WO2019062576A1 (zh) 2017-09-26 2018-09-17 一种***升级异常断电的保护方法及终端设备

Country Status (3)

Country Link
US (1) US20210382789A1 (zh)
CN (1) CN107577563A (zh)
WO (1) WO2019062576A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577563A (zh) * 2017-09-26 2018-01-12 晶晨半导体(上海)股份有限公司 一种***升级异常断电的保护方法及终端设备
CN108170455B (zh) * 2018-03-12 2021-04-27 晶晨半导体(上海)股份有限公司 升级包的打包方法以及升级方法
CN110347418B (zh) * 2019-06-28 2023-09-29 晶晨半导体(上海)股份有限公司 控制***升级方法及控制***
CN112416411B (zh) * 2019-08-23 2023-08-18 百度在线网络技术(北京)有限公司 升级方法及装置、设备端、服务器、计算机可读介质
CN117389578A (zh) * 2022-07-05 2024-01-12 中兴通讯股份有限公司 云终端***升级方法、装置、云终端和存储介质
CN117707626A (zh) * 2022-10-09 2024-03-15 荣耀终端有限公司 ***启动方法及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420328A (zh) * 2008-12-03 2009-04-29 杭州华三通信技术有限公司 远程升级现场可编程门阵列的***、接口卡及方法
CN102103509A (zh) * 2010-11-23 2011-06-22 Tcl集团股份有限公司 一种互联网电视远程自动升级方法
CN106020865A (zh) * 2016-05-10 2016-10-12 百度在线网络技术(北京)有限公司 一种***升级方法和装置
EP3179366A1 (en) * 2014-08-06 2017-06-14 ZTE Corporation Method and terminal for ota updating
CN107577563A (zh) * 2017-09-26 2018-01-12 晶晨半导体(上海)股份有限公司 一种***升级异常断电的保护方法及终端设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281464A (zh) * 2013-07-12 2015-01-14 上海明波通信技术股份有限公司 嵌入式产品***软件升级方法
CN105094927B (zh) * 2015-08-28 2018-06-12 东方网力科技股份有限公司 一种设备固件升级方法和装置
CN107193603A (zh) * 2017-05-25 2017-09-22 绵阳美菱软件技术有限公司 一种智能家电的升级方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420328A (zh) * 2008-12-03 2009-04-29 杭州华三通信技术有限公司 远程升级现场可编程门阵列的***、接口卡及方法
CN102103509A (zh) * 2010-11-23 2011-06-22 Tcl集团股份有限公司 一种互联网电视远程自动升级方法
EP3179366A1 (en) * 2014-08-06 2017-06-14 ZTE Corporation Method and terminal for ota updating
CN106020865A (zh) * 2016-05-10 2016-10-12 百度在线网络技术(北京)有限公司 一种***升级方法和装置
CN107577563A (zh) * 2017-09-26 2018-01-12 晶晨半导体(上海)股份有限公司 一种***升级异常断电的保护方法及终端设备

Also Published As

Publication number Publication date
US20210382789A1 (en) 2021-12-09
CN107577563A (zh) 2018-01-12

Similar Documents

Publication Publication Date Title
WO2019062576A1 (zh) 一种***升级异常断电的保护方法及终端设备
EP1899814B1 (en) Firmware update for consumer electronic device
US10866623B2 (en) Information handling system and method to detect and recover from no power/no post failures
TWI633487B (zh) 自動回復基本輸入輸出系統映像檔的方法及電腦系統
JP2011090481A (ja) 情報処理装置及びシステム設定方法
CN111182033B (zh) 一种交换机还原的方法和设备
WO2021103745A1 (zh) 一种引导程序的保护设计方法
US20200394144A1 (en) Information processing system, information processing device, bios updating method for information processing device, and bios updating program for information processing device
JP2010224847A (ja) 計算機システム及び設定管理方法
CN106775674B (zh) 一种基于通用引导加载程序的设备及其启动方法
CN111767172A (zh) 一种基于看门狗及bootloader的机顶盒自修复办法
CN113867807A (zh) 一种缩短服务器上电时间的方法、装置、设备和存储介质
TW202131170A (zh) 韌體損壞恢復技術
JP2014170306A (ja) 情報処理装置、起動障害からの自動復旧方法、及び起動障害からの自動復旧プログラム
CN111078452A (zh) 一种bmc固件镜像恢复方法与装置
CN102541585A (zh) 一种远程升级方法及嵌入式***
CN109086085A (zh) 一种操作***启动管理方法和装置
CN104834574B (zh) 一种解决***分区损坏的方法及装置
US6721882B1 (en) Method and apparatus for warm starting a system where the system includes region(s) of software code incapable of warm starting
JP3231561B2 (ja) バックアップメモリ制御方式
CN112579348A (zh) 一种通过统计***启动次数恢复出厂设置的方法
US9529581B2 (en) Circuit and method for writing program codes of basic input/output system
CN108170247A (zh) Bmc掉电恢复方法和装置
CN114655140B (zh) 一种车辆启动控制方法和相关装置
US20220206823A1 (en) Information processing method and electronic apparatus

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: 18863728

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: 18863728

Country of ref document: EP

Kind code of ref document: A1