WO2015176454A1 - 一种软件升级方法及装置 - Google Patents

一种软件升级方法及装置 Download PDF

Info

Publication number
WO2015176454A1
WO2015176454A1 PCT/CN2014/087474 CN2014087474W WO2015176454A1 WO 2015176454 A1 WO2015176454 A1 WO 2015176454A1 CN 2014087474 W CN2014087474 W CN 2014087474W WO 2015176454 A1 WO2015176454 A1 WO 2015176454A1
Authority
WO
WIPO (PCT)
Prior art keywords
upgrade
software version
software
partition
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2014/087474
Other languages
English (en)
French (fr)
Inventor
张广东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to EP14892661.1A priority Critical patent/EP3147782A4/en
Priority to US15/311,851 priority patent/US20170206079A1/en
Publication of WO2015176454A1 publication Critical patent/WO2015176454A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 operations
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/84Using snapshots, i.e. a logical point-in-time copy of the data

Definitions

  • the invention relates to a technology related to software upgrade of a consumer wireless terminal device (with internet connection function), in particular to a wireless software upgrade service implementation on a data product such as a mobile phone or a UFI/DC.
  • the terminal software in the user's hands is effectively and reliably upgraded by means of over-the-air wireless download. Vendors can more quickly introduce new terminals to the market and increase user satisfaction and acceptance of their terminals.
  • the firmware is stored in binary on the storage medium, so the file can be regarded as a byte stream.
  • File-based byte stream attributes the difference between files can be accurately expressed in bytes
  • the terminal software update is implemented with an update package containing only the difference between bytes, suitable for wireless-based software updates, which can save users A large amount of traffic.
  • the embodiment of the invention provides a software upgrade method and device to solve at least the problem of improving the software upgrade success rate.
  • a software upgrade method including:
  • the terminal sets the time for re-upgrading the software version according to the current software version upgrade status
  • the upgrade package of the new software version is obtained wirelessly;
  • the step of setting the time for the software version to be upgraded again according to the current software version upgrade status includes:
  • the terminal When the terminal is shut down without software version detection, or the terminal does not need to perform software upgrade, or the terminal does not detect the available upgrade package, or detects the available upgrade package and the user does not perform software upgrade, set the first fixed length period for the terminal The time for software version detection and re-upgrade is adjusted to the first fixed length period.
  • the step of setting the time for the software version to be upgraded again according to the current software version upgrade status includes:
  • the second fixed length period is set, so that the terminal adjusts the software version detection and the time of the upgrade again to the second fixed length period.
  • the step of upgrading the partition data segment by segment in a partition upgrade manner by using the obtained upgrade package includes:
  • the terminal settings are used to characterize the upgrade flag for starting the software upgrade
  • the storage and differential upgrade processing of the partition data to be upgraded in the current partition of the software version is sequentially performed until the software upgrade of the current partition of the software version is completed;
  • the partition data to be upgraded in the other partitions are sequentially stored and differentially upgraded, until the software upgrade of all partitions of the software version is completed.
  • the method further comprises:
  • the upgrade status information of the last software upgrade is read, and the saved partition data is restored to the corresponding position in the software version partition by using the upgrade status information;
  • a software upgrading apparatus comprising:
  • the setting module is set to set the time for upgrading the software version according to the current software version upgrade status of the terminal;
  • the detection module is set to perform software version detection according to the set time
  • Obtaining a module configured to obtain an upgrade package of the new software version wirelessly if a new software version is detected
  • the upgrade module is set to use the obtained upgrade package to upgrade the partition data segment by segment in a partition upgrade mode.
  • the setting module is configured when the terminal is powered off without software version detection, or the terminal does not need to perform software upgrade, or the terminal does not detect an available upgrade package, or detects an available upgrade package and the user does not perform software upgrade. For a certain period of time, the terminal adjusts the time of software version detection and re-upgrade to the first fixed length period.
  • the setting module sets a second fixed length period when the terminal initiates software version detection failure or the data service is unavailable, so that the terminal adjusts the software version detection and the re-upgrade time to the second fixed length period.
  • the upgrade module is configured to set an upgrade flag used to represent a startup software upgrade; determine a section of the partition data to be upgraded in the current partition of the software version, and store the partition data to the backup data area;
  • the partition data to be upgraded is subjected to differential upgrade processing, and the upgrade status information of the partition data is saved; and the partition data to be upgraded in the current partition of the software version is sequentially stored and differentially upgraded until the software version is completed.
  • the software upgrade of the current partition; according to the partition of the software version, the partition data to be upgraded in the other partitions are sequentially stored and differentially upgraded, until the software upgrade of all partitions of the software version is completed.
  • the method further comprises:
  • the restore module is configured to detect whether the upgrade flag is set when the terminal is powered on, and if the upgrade flag is detected, read the upgrade status information of the last software upgrade, and use the upgrade status information to store the stored partition data. Restore to the appropriate location in the software version partition to use the restored partition data to perform storage and differential upgrade processing again to complete the software version upgrade.
  • the version detection policy implements the timing detection function on the terminal, completes the timing detection, the failure processing, and the like, and can improve the success rate of the FOTA software download;
  • the software rewriting strategy implements the software version rewriting function on the terminal, and completes the backup of the original software version. Protection and data error handling caused by abnormal power failure.
  • FIG. 1 is a schematic block diagram of a software upgrade method according to an embodiment of the present invention.
  • FIG. 2 is a block diagram of a software upgrade apparatus according to an embodiment of the present invention.
  • FIG. 3 is a flow chart of version verification of a FOTA software upgrade provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a backup and restore control strategy when software is rewritten according to an embodiment of the present invention.
  • FIG. 1 is a schematic block diagram of a software upgrade method according to an embodiment of the present invention. As shown in FIG. 1, the steps include:
  • Step S101 The terminal sets a time for re-upgrading the software version according to the current software version upgrade status.
  • the first fixed length period is set when the terminal is powered off without software version detection, or the terminal does not need to perform software upgrade, or the terminal does not detect an available upgrade package, or detects an available upgrade package and the user does not perform software upgrade. And setting a second fixed length period when the terminal initiates software version detection failure or the data service is unavailable, so that the terminal adjusts the software version detection and the time of the upgrade again to the first or second fixed length period.
  • the invention can greatly improve the success rate of software downloading by judging the current software version upgrade status, dynamically adjusting the time of software version detection and upgrade, and performing software version detection and upgrade with respect to a fixed time point.
  • Step S102 Perform software version detection according to the set time.
  • Step S103 If a new software version is detected, the upgrade package of the new software version is obtained wirelessly.
  • Step S104 Using the acquired upgrade package, the partition data is upgraded segment by segment in a partition upgrade manner.
  • the terminal is configured to represent an upgrade flag for starting a software upgrade, determine a section of the partition data to be upgraded in the current partition of the software version, and store the partition data to the backup data area;
  • the upgraded partition data is differentially upgraded, and the upgrade status information of the partitioned data is saved.
  • the partition data to be upgraded in the current partition of the software version is sequentially stored and differentially upgraded until the current partition of the software version is completed.
  • the terminal detects whether the upgrade flag has been set when the device is powered on again. If it detects that the upgrade flag has been set, it reads the upgrade status information of the last software upgrade and uses the upgrade. Status information, restore the stored partition data to the corresponding location in the software version partition; then, with the restored partition data, perform storage and differential upgrade processing again to complete the software version upgrade.
  • the invention can restore the original data when the terminal performs data error processing caused by abnormal power failure, thereby ensuring normal upgrade of the software.
  • FIG. 2 is a block diagram of a software upgrading apparatus according to an embodiment of the present invention. As shown in FIG. 2, the method includes: a setting module 21, a detecting module 22, an obtaining module 23, and an upgrading module 24. among them:
  • the setting module 21 sets a time for re-upgrading the software version according to the current software version upgrade status of the terminal, specifically, the terminal is shut down without software version detection, or the terminal does not need to perform software upgrade, or the terminal does not detect
  • the first fixed-length period is set when the upgrade package is available, or the available upgrade package is detected, and the user does not perform the software upgrade
  • the second fixed-length period is set when the terminal initiates software version detection failure or the data service is unavailable, so that the terminal detects the software version and The time of the upgrade again is adjusted to the first or second fixed length period.
  • the detecting module 22 performs software version detection according to the set time.
  • the obtaining module 23 wirelessly acquires an upgrade package of the new software version when detecting a new software version.
  • the upgrade module 24 uses the acquired upgrade package to upgrade the partition data segment by segment in a partition upgrade manner. Specifically, the upgrade module 24 sets an upgrade flag for characterizing the start of the software upgrade before performing the software upgrade. And determining a piece of partition data to be upgraded in the current partition of the software version, and storing the partition data to the backup data area; performing differential upgrade processing on the determined partition data to be upgraded, and saving the partition data Upgrade status information; then, through the storage and differential upgrade processing of the partition data to be upgraded in the current partition of the software version, until the software upgrade of the current partition of the software version is completed; finally, according to the partition of the software version, the other partitions are sequentially The partition data to be upgraded in each section is stored and differentially upgraded until the software upgrade of all partitions of the software version is completed.
  • the device further includes a restoration module, which detects whether an upgrade flag has been set when the terminal is powered on, and if it detects that the upgrade flag is set, reads the upgrade status information of the last software upgrade, and uses the upgrade status. Information, restore the stored partition data to the corresponding location in the software version partition, in order to use the restored partition data, and then perform storage and differential upgrade processing to complete the software version upgrade.
  • a restoration module which detects whether an upgrade flag has been set when the terminal is powered on, and if it detects that the upgrade flag is set, reads the upgrade status information of the last software upgrade, and uses the upgrade status. Information, restore the stored partition data to the corresponding location in the software version partition, in order to use the restored partition data, and then perform storage and differential upgrade processing to complete the software version upgrade.
  • the terminal needs to perform FOTA upgrade, it first needs to interact with the server through the network according to the OMA protocol, and ask if there is a software update version available on the server. If there is, the user is prompted to download. If not, the user is prompted to have no new version.
  • Step S301 The terminal determines whether it is the first booting. If it is the first booting, step S302 is performed, otherwise step S303 is performed.
  • Step S302 Reset the detection update time.
  • Step S303 Perform a version detection initialization process.
  • Step S304 Waiting for the timer to time out.
  • Step S305 The timer expires, the FOTA detection is initiated, and the next update time is reset.
  • Step S306 determining whether it is necessary to continue the detection, if necessary, executing step S304, otherwise ending the flow.
  • T is the version detection time period set by the user, and the unit is day, and there are three choices of 1, 15, and 30.
  • the timer is reset.
  • the next automatic upgrade time is: period T plus a random time within 24 hours, that is, random within 24 hours.
  • the timer is reset, and the next automatic upgrade time is: a random time within 24 hours, so as to provide the user with more detection times.
  • the above abnormal conditions include:
  • the automatic upgrade time is not available when the data service is unavailable
  • the software rewriting operation needs to be performed, that is, the original software version of the terminal is flashed according to the content of the differential package.
  • the specific strategy implementation of software rewriting is illustrated by using FIG. 4 as an example.
  • the software version of the terminal is generally stored on the storage medium in the form of a partition (partition).
  • the leftmost block in the figure is the "unrewriteable version", which is never rewritten and has the ability to boot the system;
  • the blocks named "Version 1", “Version 2", and “Version n” are the normal partitions of the system, which are the software versions that FOTA can upgrade;
  • the rightmost block in Figure 4 is the "Backup Data Area", where The round frame is the "upgrade flag", and the "backup data area” is used to store the backup of the data that was overwritten when the FOTA software was upgraded.
  • step b Differentially upgrade and rewrite the data that has been read in step b, record the current upgrade status information, and save it;
  • step d Differentially upgrade and rewrite the data that has been read in step d, record the current upgrade status information, and save it;
  • the present invention has the following technical effects:
  • the invention can improve the software version download success rate and the upgrade success rate.
  • the software upgrade method and apparatus have the following beneficial effects: the version detection policy implements the timing detection function on the terminal, completes the timing detection, the failure processing, and the like, and can improve the success rate of the FOTA software download;
  • the software rewriting strategy implements the software version rewriting function on the terminal, and completes the backup protection of the original software version and the data error processing caused by abnormal power failure.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种软件升级方法及装置,所述方法包括:终端根据当前软件版本升级状况,设置对软件版本进行再次升级的时间;按照所设置的时间,进行软件版本检测;若检测到新软件版本,则无线获取所述新软件版本的升级包;利用所获取的升级包,以分区升级方式逐段对分区数据进行升级。本发明能够提高软件下载的成功率,以及完成对原有软件版本的备份保护及异常掉电引起的数据错误处理。

Description

一种软件升级方法及装置 技术领域
本发明涉及与消费类无线终端设备(具备连接互联网功能)软件升级相关的技术,特别涉及在手机、UFI/DC等数据类产品上的无线软件升级服务实现。
背景技术
随着人们对通信的需求不断增加以及3/4G通信技术的不断发展,出现了大量的无线类消费电子产品,它们为人们提供了各种各样的数据服务,方便人们随时随地沟通和资源共享。
当终端产品到被送到用户手中之后,厂商对终端的软件维护就成了一个重大的问题,当厂商需要修复终端软件中的故障或者添加新的功能时,就需要重新改写终端上的软件版本。如果一一把用户手中的终端回收回来进行软件升级,显然是一件费时、费力的工作,为解决该问题便产生了固件升级(Firmware Over-The-Air,简称为FOTA)技术,也就是软件的无线升级技术。
通过空中无线下载的方式有效、可靠的对用户手中的终端软件进行升级。厂商能够更加快速地向市场推出具有新功能的终端并以此提高用户对其终端的满意度和认可度。
在固件更新环境下,固件都以二进制方式保存在存储介质上,所以文件都可被看作是字节流。基于文件的字节流属性,文件间的差异就可以以字节为单位来精确表示,用仅包含字节间差异的更新包来实现终端软件更新,适合基于无线的软件更新,能为用户节省大批的流量。
发明内容
本发明实施例提供了一种软件升级方法及装置,以至少解决提高软件升级成功率的问题。
根据本发明的一个方面,提供了一种软件升级方法,包括:
终端根据当前软件版本升级状况,设置对软件版本进行再次升级的时间;
按照所设置的时间,进行软件版本检测;
若检测到新软件版本,则无线获取所述新软件版本的升级包;
利用所获取的升级包,以分区升级方式逐段对分区数据进行升级。
优选地,所述的终端根据当前软件版本升级状况,设置对软件版本进行再次升级的时间的步骤包括:
当终端关机而未进行软件版本检测、或终端不需要进行软件升级、或终端未检测到可用升级包、或检测到可用升级包而用户不进行软件升级时,设置第一定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第一定长时段。
优选地,所述的终端根据当前软件版本升级状况,设置对软件版本进行再次升级的时间的步骤包括:
当终端发起软件版本检测失败或数据服务不可用时,设置第二定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第二定长时段。
优选地,所述的利用所获取的升级包,以分区升级方式逐段对分区数据进行升级的步骤包括:
终端设置用来表征启动软件升级的升级标志;
确定软件版本当前分区中的一段待升级的分区数据,并将所述分区数据存储至备份数据区;
对已确定的所述待升级的分区数据进行差分升级处理,并保存所述分区数据的升级状态信息;
通过对软件版本当前分区中的各段待升级的分区数据依次进行存储和差分升级处理,直至完成软件版本当前分区的软件升级;
按照软件版本的分区,依次对其它分区中的各段待升级的分区数据进行存储和差分升级处理,直至完成软件版本全部分区的软件升级。
优选地,还包括:
终端开机时检测是否已设置升级标志;
若检测到已设置升级标志,则读取上一次软件升级的升级状态信息,并利用所述升级状态信息,将已存储的分区数据还原至软件版本分区中的相应位置;
利用已还原的分区数据,再次进行存储和差分升级处理,以便完成软件版本升级。
根据本发明的另一方面,提供了一种软件升级装置,包括:
设置模块,设置为根据终端当前软件版本升级状况,设置对软件版本进行再次升级的时间;
检测模块,设置为按照所设置的时间,进行软件版本检测;
获取模块,设置为若检测到新软件版本,则无线获取所述新软件版本的升级包;
升级模块,设置为利用所获取的升级包,以分区升级方式逐段对分区数据进行升级。
优选地,所述设置模块在终端关机而未进行软件版本检测、或终端不需要进行软件升级、或终端未检测到可用升级包、或检测到可用升级包而用户不进行软件升级时,设置第一定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第一定长时段。
优选地,所述设置模块在终端发起软件版本检测失败或数据服务不可用时,设置第二定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第二定长时段。
优选地,所述升级模块设置为设置用来表征启动软件升级的升级标志;确定软件版本当前分区中的一段待升级的分区数据,并将所述分区数据存储至备份数据区;对已确定的所述待升级的分区数据进行差分升级处理,并保存所述分区数据的升级状态信息;通过对软件版本当前分区中的各段待升级的分区数据依次进行存储和差分升级处理,直至完成软件版本当前分区的软件升级;按照软件版本的分区,依次对其它分区中的各段待升级的分区数据进行存储和差分升级处理,直至完成软件版本全部分区的软件升级。
优选地,还包括:
还原模块,设置为在终端开机时检测是否已设置升级标志,若检测到已设置升级标志,则读取上一次软件升级的升级状态信息,并利用所述升级状态信息,将已存储的分区数据还原至软件版本分区中的相应位置,以便利用已还原的分区数据,再次进行存储和差分升级处理,从而完成软件版本升级。
与现有技术相比较,本发明的有益效果在于:
其中,版本检测策略实现终端上的定时检测功能,完成定时检测、失败处理等,能够提升FOTA软件下载的成功率;软件改写策略实现终端上的软件版本改写功能,完成对原有软件版本的备份保护及异常掉电引起的数据错误处理。
附图说明
图1是本发明实施例提供的软件升级方法原理框图;
图2是本发明实施例提供的软件升级装置框图;
图3是本发明实施例提供的FOTA软件升级的版本检测流程图;
图4是本发明实施例提供的软件改写时的备份和还原控制策略示意图。
具体实施方式
以下结合附图对本发明的优选实施例进行详细说明,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。
图1是本发明实施例提供的软件升级方法原理框图,如图1所示,步骤包括:
步骤S101:终端根据当前软件版本升级状况,设置对软件版本进行再次升级的时间。
具体地说,当终端关机而未进行软件版本检测、或终端不需要进行软件升级、或终端未检测到可用升级包、或检测到可用升级包而用户不进行软件升级时设置第一定长时段,当终端发起软件版本检测失败或数据服务不可用时设置第二定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第一或第二定长时段。
本发明通过对当前软件版本升级状况进行判断,动态地调整软件版本检测及升级的时间,相对于固定时间点进行软件版本检测及升级的技术方案,能够大幅提高软件下载的成功率。
步骤S102:按照所设置的时间,进行软件版本检测。
步骤S103:若检测到新软件版本,则无线获取所述新软件版本的升级包。
步骤S104:利用所获取的升级包,以分区升级方式逐段对分区数据进行升级。
具体地说,终端设置用来表征开始进行软件升级的升级标志,确定软件版本当前分区中的一段待升级的分区数据,并将所述分区数据存储至备份数据区;对已确定的所述待升级的分区数据进行差分升级处理,并保存所述分区数据的升级状态信息;通过对软件版本当前分区中的各段待升级的分区数据依次进行存储和差分升级处理,直至完成软件版本当前分区的软件升级;按照软件版本的分区,依次对其它分区中的各段待升级的分区数据进行存储和差分升级处理,直至完成软件版本全部分区的软件升级。
若在软件升级过程中,出现关机等异常情况,终端在再次开机时检测是否已设置升级标志,若检测到已设置升级标志,则读取上一次软件升级的升级状态信息,并利用所述升级状态信息,将已存储的分区数据还原至软件版本分区中的相应位置;然后,利用已还原的分区数据,再次进行存储和差分升级处理,以便完成软件版本升级。
本发明通过对原有软件版本的备份保护,使终端在发生异常掉电等情况引起的数据错误处理时能够还原原有数据,从而保证软件实现正常升级。
图2是本发明实施例提供的软件升级装置框图,如图2所示,包括:设置模块21、检测模块22、获取模块23和升级模块24。其中:
所述设置模块21根据终端当前软件版本升级状况,设置对软件版本进行再次升级的时间,具体地说,在终端关机而未进行软件版本检测、或终端不需要进行软件升级、或终端未检测到可用升级包、或检测到可用升级包而用户不进行软件升级时设置第一定长时段,在终端发起软件版本检测失败或数据服务不可用时设置第二定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第一或第二定长时段。
所述检测模块22按照所设置的时间,进行软件版本检测。
所述获取模块23在检测到新软件版本时,无线获取所述新软件版本的升级包。
所述升级模块24利用所获取的升级包,以分区升级方式逐段对分区数据进行升级,具体地说,所述升级模块24在进行软件升级前,设置用来表征开始进行软件升级的升级标志,然后确定软件版本当前分区中的一段待升级的分区数据,并将所述分区数据存储至备份数据区;对已确定的所述待升级的分区数据进行差分升级处理,并保存所述分区数据的升级状态信息;然后通过对软件版本当前分区中的各段待升级的分区数据依次进行存储和差分升级处理,直至完成软件版本当前分区的软件升级;最后按照软件版本的分区,依次对其它分区中的各段待升级的分区数据进行存储和差分升级处理,直至完成软件版本所有分区的软件升级。
进一步地,所述装置还进一步包括还原模块,其在终端开机时检测是否已设置升级标志,若检测到已设置升级标志,则读取上一次软件升级的升级状态信息,并利用所述升级状态信息,将已存储的分区数据还原至软件版本分区中的相应位置,以便利用已还原的分区数据,再次进行存储和差分升级处理,从而完成软件版本升级。
本发明提供的FOTA技术的版本检测策略和软件改写策略,与FOTA软件升级的健壮性紧密相连。以下结合图3和图4所示实施例对本发明进行进一步说明。
一、版本检测策略
终端如果需要进行FOTA升级首先需要通过网络按OMA协议来与服务器交互,询问服务器上是否有可用的软件更新版本,如果有则提示用户下载,如无则提示用户没有新版本。
为了提升FOTA软件升级版本的检测成功率,版本检测的流程如图3所示,步骤包括:
步骤S301:终端判断是否为首次开机,若是首次开机,则执行步骤S302,否则执行步骤S303。
步骤S302:重设检测更新时间。,
步骤S303:进行版本检测初始化过程。
步骤S304:等待定时器超时。
步骤S305:定时器超时,发起FOTA检测并重设下一次更新时间。
步骤S306:判断是否需要继续检测,若需要,则执行步骤S304,否则结束流程。
例如,假设T为用户设置的版本检测时间周期,单位为天,有1、15、30三种选择。
1)首次开机自动升级时间设置。
默认的第一次自动升级的时间为设备第一次开机的时间加上一个T天内的随机时间(设为x,长度以分钟为单位记),0<x<=T*24*60;
2)本次自动升级时间到,在发起本次自动升级的同时需要重置定时器。
下次自动升级时间为:周期T加上一个24小时内的随机时间,24小时内的随机时间设为x,长度以分钟为单位记,0<x<=24*60;
3)异常情况下的定时器重置。
a)、如果本次自动升级发生下述异常情况1、2、3,则重置定时器,下次自动升级时间为:周期T加上一个24小时内的随机时间,即24小时内的随机时间设为x,长度以分钟为单位记0<x<=24*60。
b)、如果本次自动升级发生下述异常情况4,则重置定时器,下次自动升级时间为:24小时之内的随机时间,以便给用户多提供检测次数。
c)、如果本次自动升级发生下述异常情况5、6,则重置定时器,下次自动升级时间为:6小时之后,以便给用户多提供检测次数。
上述异常情况包括:
1、如果检测到升级包但用户不升级;
2、如果检测到没有可用升级包;
3、自动升级时间到时,设备漫游不需要升级;
4、用户错过自动检测并关机;
5、自动升级时间到时数据服务不可用;
6、自动升级时间到时发起检测新版本失败。
二、软件改写策略
当FOTA的差分升级包被下载到终端设备之后,则需要执行软件的改写操作,即依据差分包的内容刷写终端原有软件版本。下面以图4为例说明软件改写的具体策略实现。
终端的软件版本一般都以分块(分区)的形式保存在存储介质上,图中4最左端的块为“不可改写版本”,它从来不被会改写且具备启动系统的能力;图4中名为“版本1”、“版本2”、“版本n”的块为系统正常分区,为FOTA可对其进行升级的软件版本;图4中最右端的块为“备份数据区”,其中的圆框为“升级标志”,“备份数据区”用于存放FOTA软件升级时被改写数据的备份。
1)正常情况下的软件改写策略:
FOTA软件升级开始前设置“备份数据区”中的“升级标志”;
读取“版本x”(例如图4所示版本1)分区中的一段数据保存到“备份数据区”;
对步骤b中已读取的那段数据进行差分升级、改写,记录当前升级状态信息并保存;
重复执行b、c步骤依次进行差分升级,完成一个分区升级后再升级另一个分区,直至所有分区升级完成;
清除“备份数据区”中的“升级标志”,完成本次版本升级,重启终端。
当上述正常FOTA升级过程中因某些原因(如用户强行拔电池、电池电量不足自动关机)导致FOTA被中断时,在下一次终端开机时按下述策略进行改写或还原。
2)异常情况下的软件改写策略
检查“备份数据区”中的“升级标志”是否被设置,如已设置则转b步骤;如未设置则转h步骤;
读取上一次FOTA升级的升级状态信息,依据该升级状态信息及“备份数据区”中的备份数据把发生异常的分区数据还原;
判断是否已连续两次进入异常处理,是则转h步骤结束本次FOTA升级;
读取被还原后的“版本x”分区中的一段数据保存到“备份数据区”;
对步骤d中已读取的那段数据进行差分升级、改写,记录当前升级状态信息并保存;
重复执行d、e步骤依次进行差分升级,完成一个分区升级后再升另一个分区,直至所有分区升级完成;
清除“备份数据区”中的“升级标志”,完成本次版本升级,重启终端;
正常启动终端。
综上所述,本发明具有以下技术效果:
本发明能够提高软件版本下载成功率和升级成功率。
尽管上文对本发明进行了详细说明,但是本发明不限于此,本技术领域技术人员可以根据本发明的原理进行各种修改。因此,凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。
工业实用性
如上所述,本发明实施例提供的一种软件升级方法及装置具有以下有益效果:版本检测策略实现终端上的定时检测功能,完成定时检测、失败处理等,能够提升FOTA软件下载的成功率;软件改写策略实现终端上的软件版本改写功能,完成对原有软件版本的备份保护及异常掉电引起的数据错误处理。

Claims (10)

  1. 一种软件升级方法,包括:
    终端根据当前软件版本升级状况,设置对软件版本进行再次升级的时间;
    按照所设置的时间,进行软件版本检测;
    若检测到新软件版本,则无线获取所述新软件版本的升级包;
    利用所获取的升级包,以分区升级方式逐段对分区数据进行升级。
  2. 根据权利要求1所述的方法,其中,所述的终端根据当前软件版本升级状况,设置对软件版本进行再次升级的时间的步骤包括:
    当终端关机而未进行软件版本检测、或终端不需要进行软件升级、或终端未检测到可用升级包、或检测到可用升级包而用户不进行软件升级时,设置第一定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第一定长时段。
  3. 根据权利要求1所述的方法,其中,所述的终端根据当前软件版本升级状况,设置对软件版本进行再次升级的时间的步骤包括:
    当终端发起软件版本检测失败或数据服务不可用时,设置第二定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第二定长时段。
  4. 根据权利要求1-3任意一项所述的方法,其中,所述的利用所获取的升级包,以分区升级方式逐段对分区数据进行升级的步骤包括:
    终端设置用来表征启动软件升级的升级标志;
    确定软件版本当前分区中的一段待升级的分区数据,并将所述分区数据存储至备份数据区;
    对已确定的所述待升级的分区数据进行差分升级处理,并保存所述分区数据的升级状态信息;
    通过对软件版本当前分区中的各段待升级的分区数据依次进行存储和差分升级处理,直至完成软件版本当前分区的软件升级;
    按照软件版本的分区,依次对其它分区中的各段待升级的分区数据进行存储和差分升级处理,直至完成软件版本全部分区的软件升级。
  5. 根据权利要求4所述的方法,其中,还包括:
    终端开机时检测是否已设置升级标志;
    若检测到已设置升级标志,则读取上一次软件升级的升级状态信息,并利用所述升级状态信息,将已存储的分区数据还原至软件版本分区中的相应位置;
    利用已还原的分区数据,再次进行存储和差分升级处理,以便完成软件版本升级。
  6. 一种软件升级装置,包括:
    设置模块,设置为根据终端当前软件版本升级状况,设置对软件版本进行再次升级的时间;
    检测模块,设置为按照所设置的时间,进行软件版本检测;
    获取模块,设置为若检测到新软件版本,则无线获取所述新软件版本的升级包;
    升级模块,设置为利用所获取的升级包,以分区升级方式逐段对分区数据进行升级。
  7. 根据权利要求6所述的装置,其中,所述设置模块在终端关机而未进行软件版本检测、或终端不需要进行软件升级、或终端未检测到可用升级包、或检测到可用升级包而用户不进行软件升级时,设置第一定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第一定长时段。
  8. 根据权利要求6所述的装置,其中,所述设置模块在终端发起软件版本检测失败或数据服务不可用时,设置第二定长时段,以便终端将软件版本检测及再次升级的时间调整至所述第二定长时段。
  9. 根据权利要求6至8中任意一项所述的装置,其中,所述升级模块设置为设置用来表征启动软件升级的升级标志;确定软件版本当前分区中的一段待升级的分区数据,并将所述分区数据存储至备份数据区;对已确定的所述待升级的分区数据进行差分升级处理,并保存所述分区数据的升级状态信息;通过对软件版本当前分区中的各段待升级的分区数据依次进行存储和差分升级处理,直至完成软件版本当前分区的软件升级;按照软件版本的分区,依次对其它分区中的各段待升级的分区数据进行存储和差分升级处理,直至完成软件版本全部分区的软件升级。
  10. 根据权利要求9所述的装置,其中,还包括:
    还原模块,设置为在终端开机时检测是否已设置升级标志,若检测到已设置升级标志,则读取上一次软件升级的升级状态信息,并利用所述升级状态信息,将已存储的分区数据还原至软件版本分区中的相应位置,以便利用已还原的分区数据,再次进行存储和差分升级处理,从而完成软件版本升级。
PCT/CN2014/087474 2014-05-19 2014-09-25 一种软件升级方法及装置 Ceased WO2015176454A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP14892661.1A EP3147782A4 (en) 2014-05-19 2014-09-25 Method and device for upgrading software
US15/311,851 US20170206079A1 (en) 2014-05-19 2014-09-25 Method and Device for Upgrading Software

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410212169.3 2014-05-19
CN201410212169.3A CN105094875A (zh) 2014-05-19 2014-05-19 一种软件升级方法及装置

Publications (1)

Publication Number Publication Date
WO2015176454A1 true WO2015176454A1 (zh) 2015-11-26

Family

ID=54553335

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/087474 Ceased WO2015176454A1 (zh) 2014-05-19 2014-09-25 一种软件升级方法及装置

Country Status (4)

Country Link
US (1) US20170206079A1 (zh)
EP (1) EP3147782A4 (zh)
CN (1) CN105094875A (zh)
WO (1) WO2015176454A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110045971A (zh) * 2018-01-16 2019-07-23 浙江宇视科技有限公司 系统升级恢复方法及装置
CN110399153A (zh) * 2019-07-25 2019-11-01 Oppo广东移动通信有限公司 系统升级方法、装置、终端及计算机可读存储介质
WO2021223658A1 (zh) * 2020-05-07 2021-11-11 支付宝(杭州)信息技术有限公司 小程序的更新
CN114253590A (zh) * 2021-11-24 2022-03-29 青岛海尔科技有限公司 嵌入式软件的加密式差分升级方法、装置、设备及介质
CN115629780A (zh) * 2022-09-29 2023-01-20 郑州云智信安安全技术有限公司 基于升级包组仓库和组件校验的跨版本软件升级方法及系统

Families Citing this family (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229483A (zh) * 2016-03-23 2017-10-03 福建福昕软件开发股份有限公司 在本地服务被禁用或停止情况下执行本地服务功能的方法
CN105893084B (zh) * 2016-03-29 2019-04-30 青岛海信移动通信技术股份有限公司 版本升级方法及终端设备
CN107341024B (zh) * 2016-04-28 2020-02-14 华为技术有限公司 系统升级方法和系统升级装置
JP6852148B2 (ja) * 2016-09-14 2021-03-31 ユー−ブロックス、アクチエンゲゼルシャフトu−blox AG ソフトウェアアップデートシステム、ファームウェアオーバーザエアーアップデートシステム、及び、クライアントデバイスをアップデートする方法
CN106598686B (zh) * 2017-01-03 2020-03-06 青岛海信移动通信技术股份有限公司 系统分区中实现差分升级调试的方法和装置
CN106874040A (zh) * 2017-01-17 2017-06-20 武汉天喻教育科技有限公司 基于Windows服务实现PC端软件静默升级的系统及方法
CN107436783B (zh) * 2017-07-14 2021-04-20 惠州Tcl移动通信有限公司 一种用于移动终端的差分升级方法、存储介质及移动终端
US10868853B2 (en) * 2018-06-08 2020-12-15 Verizon Patent And Licensing Inc. System and method for image file generation and management
CN110619235B (zh) * 2018-06-18 2024-07-26 松下电器(美国)知识产权公司 管理方法、管理装置及记录介质
CN109032632B (zh) * 2018-07-13 2021-11-09 高新兴物联科技有限公司 一种fota升级方法、无线通信终端及存储介质
CN111405543B (zh) * 2019-01-02 2023-04-07 中国移动通信有限公司研究院 一种无线固件升级中的数据包推送下载方法、装置及系统
CN109753299A (zh) * 2019-01-16 2019-05-14 Oppo广东移动通信有限公司 一种系统升级方法、装置以及计算机存储介质
CN109901860B (zh) * 2019-02-21 2022-07-01 华数传媒网络有限公司 一种Android手机软件版本控制方法
CN110032382A (zh) * 2019-03-25 2019-07-19 深圳猛犸电动科技有限公司 一种汽车电子控制单元升级方法、系统及终端设备
KR102088167B1 (ko) * 2019-08-27 2020-03-12 루나 주식회사 소프트웨어 업데이트 에이전트 장치 및 이를 통한 패치방법
CN111131861B (zh) * 2019-12-31 2022-03-01 深圳Tcl新技术有限公司 恢复分区的升级方法、终端和存储介质
CN111414185B (zh) * 2020-02-28 2023-01-10 浙江吉利新能源商用车集团有限公司 一种终端升级方法、装置、终端及存储介质
CN111651304B (zh) * 2020-07-16 2024-02-27 南方电网数字电网科技(广东)有限公司 基于双芯智能电表的软件恢复方法、装置和计算机设备
CN112162773B (zh) * 2020-10-10 2022-09-02 北京紫光展锐通信技术有限公司 差分升级方法及装置、存储介质、终端
CN112559003B (zh) * 2020-11-17 2023-03-03 东风汽车集团有限公司 域控制器软件升级方法、装置及域控制器
CN112416796B (zh) * 2020-12-03 2023-11-17 北京东土科技股份有限公司 一种软件升级测试的方法和装置
CN112559349B (zh) * 2020-12-16 2024-04-09 合安科技技术有限公司 一种程序的运行方法及运行装置
CN112486544B (zh) * 2020-12-16 2024-07-02 网宿科技股份有限公司 一种软件升级方法及装置
CN113254056B (zh) * 2021-04-16 2022-04-19 荣耀终端有限公司 一种更新预警及故障修复的方法及设备
CN112988204B (zh) * 2021-05-19 2021-08-31 西安羚控电子科技有限公司 一种无人机软件远程升级及回滚的方法
CN113918200A (zh) * 2021-09-30 2022-01-11 深圳市戴升智能科技有限公司 高效可靠的嵌入式设备应用程序无线升级方法
CN113986313B (zh) * 2021-12-09 2025-08-26 北京奕斯伟计算技术股份有限公司 软件升级方法、装置、电子设备以及存储介质
CN114500508B (zh) * 2022-01-25 2024-10-01 深圳友讯达科技股份有限公司 一种燃气表升级方法、装置及电子设备
CN114879991B (zh) * 2022-04-25 2023-05-02 杭州振华仪表有限公司 一种软件升级方法、系统及存储介质
CN115118718B (zh) * 2022-08-30 2022-12-16 深圳市华曦达科技股份有限公司 安卓终端设备升级更新方法、系统和可读存储介质
CN115509641A (zh) * 2022-10-26 2022-12-23 厦门亿联网络技术股份有限公司 一种双BootLoader启动方法及装置
CN116661812B (zh) * 2022-11-25 2024-04-02 荣耀终端有限公司 设备升级方法、电子设备及系统
CN115981697A (zh) * 2022-12-15 2023-04-18 苏州磐联集成电路科技股份有限公司 具有自恢复机制的固件更新方法
CN115964071A (zh) * 2023-01-18 2023-04-14 杭州鹏成新能源科技有限公司 一种具备历史版本保存功能的软件分区升级方法
CN117311840B (zh) * 2023-05-10 2024-09-24 荣耀终端有限公司 应用启动方法、电子设备以及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101374147A (zh) * 2008-09-10 2009-02-25 深圳华为通信技术有限公司 一种软件升级检测的方法、装置及系统
CN103309712A (zh) * 2013-06-25 2013-09-18 惠州Tcl移动通信有限公司 一种手机软件升级方法及其系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6308061B1 (en) * 1996-08-07 2001-10-23 Telxon Corporation Wireless software upgrades with version control
CN100501679C (zh) * 2007-02-27 2009-06-17 华为技术有限公司 一种电子设备
WO2009074444A2 (en) * 2007-12-13 2009-06-18 Telefonaktiebolaget L M Ericsson (Publ) Updating firmware of an electronic device
CN101377744B (zh) * 2008-09-24 2012-02-15 华为终端有限公司 一种终端设备软件升级恢复方法及装置
KR101332815B1 (ko) * 2012-02-29 2013-11-27 주식회사 팬택 휴대용 단말을 위한 재부팅 처리 장치 및 방법

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101374147A (zh) * 2008-09-10 2009-02-25 深圳华为通信技术有限公司 一种软件升级检测的方法、装置及系统
CN103309712A (zh) * 2013-06-25 2013-09-18 惠州Tcl移动通信有限公司 一种手机软件升级方法及其系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3147782A4 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110045971A (zh) * 2018-01-16 2019-07-23 浙江宇视科技有限公司 系统升级恢复方法及装置
CN110045971B (zh) * 2018-01-16 2023-03-24 浙江宇视科技有限公司 系统升级恢复方法及装置
CN110399153A (zh) * 2019-07-25 2019-11-01 Oppo广东移动通信有限公司 系统升级方法、装置、终端及计算机可读存储介质
CN110399153B (zh) * 2019-07-25 2023-11-03 Oppo广东移动通信有限公司 系统升级方法、装置、终端及计算机可读存储介质
WO2021223658A1 (zh) * 2020-05-07 2021-11-11 支付宝(杭州)信息技术有限公司 小程序的更新
CN114253590A (zh) * 2021-11-24 2022-03-29 青岛海尔科技有限公司 嵌入式软件的加密式差分升级方法、装置、设备及介质
CN115629780A (zh) * 2022-09-29 2023-01-20 郑州云智信安安全技术有限公司 基于升级包组仓库和组件校验的跨版本软件升级方法及系统

Also Published As

Publication number Publication date
CN105094875A (zh) 2015-11-25
EP3147782A4 (en) 2017-05-31
US20170206079A1 (en) 2017-07-20
EP3147782A1 (en) 2017-03-29

Similar Documents

Publication Publication Date Title
WO2015176454A1 (zh) 一种软件升级方法及装置
CN112486554B (zh) 一种车载联网终端软件升级方法
WO2019062635A1 (zh) 升级方法和装置
US8539471B2 (en) Updating firmware of an electronic device
CN102693139B (zh) 一种无线升级手机软件的方法及系统
US8136108B2 (en) Updating firmware with multiple processors
CN106325929B (zh) 一种固件升级方法、固件升级装置、冰箱和服务端
CN104375844A (zh) 固件升级方法及装置
CN104166577B (zh) 一种移动终端系统升级的方法和装置
CN104427119B (zh) 通信终端及其非易失性数据的处理方法
CN106610840A (zh) 一种无线固件升级方法及系统
CN101377744A (zh) 一种终端设备软件升级恢复方法及装置
US20160170735A1 (en) Operating system updating method by using a checklist
CN109491698A (zh) 基于热补丁的系统更新方法及装置
CN103685391B (zh) 一种使用静态网络地址的终端设备的自动升级方法
CN101807152B (zh) 自我验证选择只读存储器的基本输出入系统及其验证方法
CN101247268B (zh) 终端系统版本的同步方法和装置
CN112416411B (zh) 升级方法及装置、设备端、服务器、计算机可读介质
CN105824722A (zh) 计算机云端备份还原系统
CN117369844A (zh) Ota升级方法、装置、设备以及存储介质
CN107766063A (zh) 一种批量升级软件的方法及系统
CN108322540A (zh) 客制化数据导入方法、终端及计算机可读存储介质
CN105159713A (zh) 一种显示屏固件升级方法及系统
CN104683594A (zh) 一种由sim卡主导的手机操作系统加载方法
CN105376732A (zh) 一种实现固件升级的方法和移动终端

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2014892661

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014892661

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 15311851

Country of ref document: US