WO2016131294A1 - 版本升级处理方法及装置 - Google Patents

版本升级处理方法及装置 Download PDF

Info

Publication number
WO2016131294A1
WO2016131294A1 PCT/CN2015/092235 CN2015092235W WO2016131294A1 WO 2016131294 A1 WO2016131294 A1 WO 2016131294A1 CN 2015092235 W CN2015092235 W CN 2015092235W WO 2016131294 A1 WO2016131294 A1 WO 2016131294A1
Authority
WO
WIPO (PCT)
Prior art keywords
version
board
upgrade
final
module
Prior art date
Application number
PCT/CN2015/092235
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 WO2016131294A1 publication Critical patent/WO2016131294A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present invention relates to the field of communications, and in particular to a version upgrade processing method and apparatus.
  • the router version management subsystem mainly completes a series of actions such as downloading, running, adding, activating, excluding activation, commit, and deletion, and is also responsible for the message interaction with other subsystems and the need to run its subsystems together. version of.
  • Router systems often have new features that need to be developed, and new faults occur during use and testing, which requires an upgrade to the version used in the field.
  • the version upgrade fails. After the version upgrade fails, you need to roll back the version to the previous old version. There are various ways to reinstall it; re-activate the old version; if there is a standby board, you can use the standby board to start the version.
  • these versions of the fallback method require manual intervention, and the operator needs to have some understanding of the use of the router command to complete. There are many low-end and mid-range routers. There is no active/standby mechanism. If the version upgrade fails, only the reinstallation method can be used to implement the rollback of the version. Reinstallation requires more version startup time.
  • a large network communication equipment company runs a lot of router products in the operators. It is difficult for every engineering staff to go to the site to upgrade the version. The version is automatically upgraded. After the failure, it can automatically roll back. It is a very important function for the equipment manufacturer.
  • the embodiment of the invention provides a version upgrade processing method and device, so as to at least solve the problem of how to quickly fall back to the original version after the upgrade of the version in the related art fails.
  • a version upgrade processing method including: acquiring a first version that is being used by a board and a second version to be upgrade corresponding to the first version; detecting the board Whether the upgrade is successful, and the detection result is obtained; according to the detection result, the final version is started; wherein the final version is the first version or The second version.
  • the final version remains unchanged for the first version if the board upgrade failure is detected; or, when the If the board upgrade is successful, the final version is modified to the second version.
  • the first version is restarted by an automatic restart of the board.
  • obtaining the first version being used by the board and the second version to be upgrade corresponding to the first version comprises: downloading a version file from the server; parsing the version file to obtain the first version and the The second version is described.
  • the method includes: activating the first version and the second version.
  • a version upgrade processing apparatus including: an obtaining module, configured to acquire a first version being used by a board and a second version to be upgrade corresponding to the first version a detection module, configured to detect whether the board is upgraded successfully, and obtain a detection result; and the startup module is configured to start a final version according to the detection result; wherein the final version is the first version or the Second version.
  • the device further includes: a holding module, configured to keep the final version unchanged when the board upgrade fails, or modify the module, set to If the upgrade of the board is successful, the final version is modified to the second version.
  • a holding module configured to keep the final version unchanged when the board upgrade fails, or modify the module, set to If the upgrade of the board is successful, the final version is modified to the second version.
  • the startup module is further configured to restart the first version by automatically restarting the board if the board fails to be upgraded.
  • the obtaining module includes: a downloading unit, configured to download a version file from the server; and a parsing unit configured to parse the version file to obtain the first version and the second version.
  • the apparatus further includes: an activation module configured to activate the first version and the second version.
  • the first version that is being used by the board is obtained, and the second version to be upgraded corresponding to the first version is obtained; whether the board is upgraded successfully, the detection result is obtained; and the final version is started according to the detection result;
  • the final version is the first version or the second version. It solves the problem of how to quickly fall back to the original version after the upgrade of this version in the related technology, thereby shortening the rollback time of the original version and reducing the time of business interruption.
  • FIG. 1 is a flowchart of a version upgrade processing method according to an embodiment of the present invention.
  • FIG. 2 is a structural block diagram of a version upgrade processing apparatus according to an embodiment of the present invention.
  • FIG. 3 is a structural block diagram (1) of a version upgrade processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a structural block diagram (2) of a version upgrade processing apparatus according to an embodiment of the present invention.
  • FIG. 5 is a structural block diagram (3) of a version upgrade processing apparatus according to an embodiment of the present invention.
  • FIG. 6 is a network diagram of a front-end main control board and a background version server of a router according to an embodiment of the present invention
  • FIG. 7 is a flowchart of a router system parsing version generation installation directory according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of a fallback to an original version after a router upgrade version fails according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for processing a version upgrade according to an embodiment of the present invention. As shown in FIG. 1 , the process includes the following steps:
  • Step S102 Acquire a first version that is being used by the board and a second version that is to be upgraded corresponding to the first version.
  • Step S104 detecting whether the board is upgraded successfully, and obtaining a detection result
  • Step S106 Start a final version according to the detection result; wherein the final version is the first version or the second version.
  • the final version is the first version or the second version. Therefore, it is necessary to determine whether the final version is the first version or the second version. In an optional embodiment, according to the detection result, the board is detected before the final version is started. If the upgrade fails, the final version remains the same as the first version. Alternatively, if the upgrade of the board is successful, the final version is modified to the second version, and the upgrade can be performed according to the second version.
  • step S106 involves starting the final version according to the detection result.
  • the first version is restarted by the automatic restart of the board. Therefore, after the board upgrade fails, the original version is rolled back.
  • step S104 involves acquiring the first version that is being used by the board and the second version to be upgraded corresponding to the first version.
  • the first version or the second version may be obtained in multiple manners. Give an example of this Description.
  • the version file is downloaded from the server and the version file is parsed to obtain the first version and the second version.
  • the first version and the second version are activated. So that the board can start the first version or the second version.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • a version upgrade processing device is also provided in the embodiment, and the device is used to implement the foregoing embodiments and preferred embodiments, and details are not described herein.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • the apparatus includes: an obtaining module 22 configured to acquire a first version being used by a board and corresponding to the first version. The second version to be upgraded; the detecting module 24 is configured to detect whether the board is upgraded successfully, and the detection result is obtained; the startup module 26 is configured to start the final version according to the detection result; wherein the final version is the first version or Second version.
  • FIG. 3 is a structural block diagram (1) of a version upgrade processing apparatus according to an embodiment of the present invention.
  • the apparatus includes, in addition to all the modules shown in FIG. 2, a hold module 32, which is set to detect If the board fails to be upgraded, the final version remains unchanged for the first version.
  • the modification module 34 is configured to modify the final version to the second version if the board is successfully upgraded. .
  • the startup module 26 is further configured to restart the first version by automatically restarting the board if the board fails to be upgraded.
  • the obtaining module 22 includes: a downloading unit 222 configured to download a version file from a server; and a parsing unit 224 configured to The version file is parsed to obtain the first version and the second version.
  • FIG. 5 is a structural block diagram (3) of a version upgrade processing apparatus according to an embodiment of the present invention. As shown in FIG. 5, the apparatus further includes an activation module 52 configured to activate the first version and the second version.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be Set to store the program code used to perform the following steps:
  • S3 Start the final version according to the detection result; wherein the final version is the first version or the second version.
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • the processor executes the above S1, S2, and S3 according to the stored program code in the storage medium.
  • the following is an example of upgrading the router system version as an example.
  • the purpose of this alternative embodiment is to provide a method for the version to be automatically rolled back after a version upgrade fails in the router system. Ensure that the original version of the device continues to be used, so that the basic functions of the router system can operate normally.
  • FIG. 6 is a network diagram of a router's foreground control board and a background version server according to an embodiment of the present invention.
  • a version is added by using a background command, and the main control board downloads a version file from the background version server through the management interface.
  • the downloaded version file is written to the version directory of the disk of the master control board, and the version files in the version directory are resolved to the installation directory to form a single installation file.
  • Add configuration information to the available version configuration information 1 file including the version file name, version number, size, and version path.
  • the version can be activated.
  • one of the functions completed is to record the activated version information into the uncommitted version configuration information 2.
  • This configuration information also records the version file name, version number, size, and version path.
  • the upgrade flag is added to the upgrade configuration information.
  • the board is in the upgrade state and is ready to be upgraded.
  • the main control board opens the configuration information. 3, reads the upgrade flag, and finds that the board is in the upgrade state. It reads the configuration information 2, reads the version file name, version number, size, and version path. The version in the version path. Then set the upgrade flag in configuration information 3 to normal startup.
  • the function completed in the submit operation is to modify the content in the configuration information 4 of the currently used version of the main control board to the content in the configuration information 2, so as to facilitate normal startup next time.
  • the board will automatically restart. Open the configuration information 3, read the upgrade flag, and find that it is normal startup. Open the configuration information 4 and read the version file name, version number, size, and version path. Start the version file in the corresponding path to implement automatic rollback of the version.
  • the master downloads the version file through its management port.
  • the third step is to activate the version, create configuration information 2, add version information, and rewrite the upgrade flag in configuration information 3.
  • the fourth step is to restart the board, read the upgrade flag in configuration information 3, start the version in configuration information 2, and rewrite the upgrade flag in configuration information 3 to start normally.
  • the fifth step is to check whether the board upgrade is successful. If successful, submit the version and modify the content in configuration information 4 to the content in configuration information 2.
  • the main control board automatically restarts, and the upgrade flag in the configuration information 3 is read as normal, and the normal startup is started, and the version in the information 4 is started.
  • the main control board of the router system downloads the version from the version server in the background through the management port.
  • FIG. 7 is a flowchart of a router system parsing version generation installation directory according to an embodiment of the present invention. As shown in FIG. 7, the main control board puts the downloaded version into the version directory, because a version file has many independent processes. A file and its configuration files, which need to be parsed into an installation directory for other processes to download and use.
  • FIG. 8 is a flowchart of rolling back to the original version after the upgrade version of the router fails according to the embodiment of the present invention. As shown in FIG. 8, the process includes the following steps:
  • Step S802 Add the version, use the command add, download the version file from the background version server to the version directory of the main control board, and parse the version file into the installation directory.
  • Version A currently in use and version B to be upgraded the two version information: version file name, version number, size and version path are added to configuration information 1.
  • Step S804 Activate the version.
  • the version B has been added to the installation directory. You need to use the command active to set the status of the version to the active state to be used.
  • Create configuration information 2, including the version file name, version number, size, and The version path is used during the upgrade.
  • the upgrade flag in the configuration information 3 is the upgrade status. This flag is required to be used in the subsequent steps of restarting the board.
  • Step S806 Restart the board. You need to use the reload system command to restart the main control board. During the restart of the main control board, read the upgrade flag in configuration information 3. The current status of the board is upgraded. The data in configuration information 2 starts version B from the specified version path, and the upgrade flag in configuration information 3 is set to the normal state. This upgrade flag needs to be used when the version is rolled back.
  • Step S808 determining whether the board is successfully upgraded. If the determination result is yes, executing step S810, determining If the result is no, step S812 is performed.
  • Step S810 If the board upgrade is successful, execute the commit command to submit the version, and modify the content in the configuration information 4 to the content in the configuration 2.
  • the content in the configuration information 4 is read, and the latest information is started. Version B, the upgrade was successful.
  • Step S812 If the upgrade fails, the main control board does not perform the commit operation, and the timer is started. If the commit operation is not performed after a certain period of time, the board automatically restarts and reads the upgrade flag in the configuration information 3, and finds that it is normally started. The version in the configuration information 4 is started. At this time, the content in the configuration information 4 is also the configuration information of the version A, so the version A is started, and the version is automatically rolled back.
  • Version A is the version currently in use
  • version B is the version to be upgraded.
  • the upgrade version or the rollback version only has the version. Version B or version A needs to be enabled, eliminating the installation time of the version. Therefore, in the version upgrade or rollback, the time for the service interruption of the router product due to the upgrade is shortened.
  • the method and device for automatically rolling back the software version provided by the present invention, compared with the prior art, in the process of upgrading the router version, the number of router devices running by the office is often more, and the device supplier It is often difficult for engineers to visit the site and upgrade each device. If it fails, it will be reinstalled. A complete upgrade process, business often needs to be interrupted for a long time.
  • the invention solves the problem that the router system version upgrade fails, the version automatic rollback is implemented well, the last enabled version in the system is enabled, and the version's rollback time is shortened, which has strong practicability in practical applications. Therefore, in the router system, if the version upgrade fails, the version can be automatically rolled back, achieving an unattended upgrade. At the same time, the rollback time of the version is greatly shortened, reducing the time for business interruption.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the foregoing embodiments of the present invention can be applied to the field of communications, and solve the problem of how to quickly roll back to the original version after the upgrade of the version fails in the related art, thereby shortening the rollback time of the original version and reducing the time of service interruption.

Abstract

一种版本升级处理方法及装置,其中,该方法包括:获取单板正在使用的第一版本和与第一版本对应的待升级的第二版本(S102);检测单板是否升级成功,得到检测结果(S104);根据检测结果,启动最终版本;其中,该最终版本为第一版本或者第二版本(S106)。解决了相关技术中版本升级失败后如何快速回退至原来版本的问题,进而缩短了原来版本的回退时间,减少了业务中断的时间。

Description

版本升级处理方法及装置 技术领域
本发明涉及通信领域,具体而言,涉及一种版本升级处理方法及装置。
背景技术
现在的系统(例如路由器系统)中,不同的型号都有自己独立的版本,版本需要进行安装后,其功能才能正常运行。路由器的功能趋于复杂多样化,其版本的大小也逐渐变大,小一点的版本几十兆,大的集群路由器版本,有超过一个G的空间。为了管理好这么庞大的版本,在路由器系统中,就分离出一个路由器版本管理子系统。
路由器版本管理子系统,主要是完成版本下载,运行,添加,激活,除激活,提交,删除等一系列的动作,同时还负责与其他子系统之间的消息交互,共同运行其子系统所需要的版本。
路由器系统常常有新的功能需要开发,同时在使用和测试过程中,有新的故障出现,这就需要对现场使用的版本进行升级。
在路由器版本升级过程中,偶尔会出现版本升级失败的情况。版本升级失败后,就需要将版本回退到以前的老版本,通常的做法有多种,重新安装;重新激活老版本;如果有备板,可以使用备板启动,来切换版本。但是这些版本回退方法,都需要人工干预,需要操作人员对路由器命令的使用有一定的了解才能完成。有许多中低端路由器,是没有主备机制,如果版本升级失败,只有通过重新安装的办法来实现版本的回退,重新安装需要花费更多的版本启动时间。
一个大的网络通讯设备公司,在运营商中运行的路由器产品很多,很难做到每个工程人员都到现场去升级版本。实现版本自动升级,失败后,能自动回退,对设备商来说,是非常重要的功能。
针对相关技术中,本版升级失败后如何快速回退至原来版本的问题,还未提出有效的解决方案。
发明内容
本发明实施例提供了一种版本升级处理方法及装置,以至少解决相关技术中本版升级失败后如何快速回退至原来版本的问题。
根据本发明实施例的一个方面,提供了一种版本升级处理方法,包括:获取单板正在使用的第一版本和与所述第一版本对应的待升级的第二版本;检测所述单板是否升级成功,得到检测结果;根据所述检测结果,启动最终版本;其中,所述最终版本为所述第一版本或者 所述第二版本。
可选地,根据所述检测结果,启动最终版本之前包括:在检测到所述单板升级失败的情况下,所述最终版本保持为所述第一版本不变;或者,在检测到所述单板升级成功的情况下,将所述最终版本修改为所述第二版本。
可选地,根据所述检测结果,启动最终版本包括:在检测到所述单板升级失败的情况下,通过所述单板的自动重启,重新启动所述第一版本。
可选地,获取单板正在使用的第一版本和与所述第一版本对应的待升级的第二版本包括:从服务器中下载版本文件;解析所述版本文件获取所述第一版本和所述第二版本。
可选地,解析所述版本文件获取所述第一版本和所述第二版本之后包括:激活所述第一版本和所述第二版本。
根据本发明实施例的另一个方面,还提供了一种版本升级处理装置,包括:获取模块,设置为获取单板正在使用的第一版本和与所述第一版本对应的待升级的第二版本;检测模块,设置为检测所述单板是否升级成功,得到检测结果;启动模块,设置为根据所述检测结果,启动最终版本;其中,所述最终版本为所述第一版本或者所述第二版本。
可选地,所述装置还包括:保持模块,设置为在检测到所述单板升级失败的情况下,所述最终版本保持为所述第一版本不变;或者,修改模块,设置为在检测到所述单板升级成功的情况下,将所述最终版本修改为所述第二版本。
可选地,所述启动模块还设置为在检测到所述单板升级失败的情况下,通过所述单板的自动重启,重新启动所述第一版本。
可选地,所述获取模块包括:下载单元,设置为从服务器中下载版本文件;解析单元,设置为解析所述版本文件获取所述第一版本和所述第二版本。
可选地,所述装置还包括:激活模块,设置为激活所述第一版本和所述第二版本。
通过本发明实施例,采用获取单板正在使用的第一版本和与第一版本对应的待升级的第二版本;检测单板是否升级成功,得到检测结果;根据检测结果,启动最终版本;其中,该最终版本为第一版本或者第二版本。解决了相关技术中本版升级失败后如何快速回退至原来版本的问题,进而缩短了原来版本的回退时间,减少了业务中断的时间。
附图说明
此处所说明的附图用来提供对本发明实施例的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的版本升级处理方法的流程图;
图2是根据本发明实施例的版本升级处理装置的结构框图;
图3是根据本发明实施例的版本升级处理装置的结构框图(一);
图4是根据本发明实施例的版本升级处理装置的结构框图(二);
图5是根据本发明实施例的版本升级处理装置的结构框图(三);
图6是根据本发明实施例的路由器前台主控单板与后台版本服务器组网图;
图7是根据本发明实施例的路由器系统解析版本生成安装目录流程图;
图8是根据本发明实施例的路由器升级版本失败后回退至原来版本的流程图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
在本实施例中提供了一种版本升级处理方法,图1是根据本发明实施例的版本升级处理方法的流程图,如图1所示,该流程包括如下步骤:
步骤S102,获取单板正在使用的第一版本和与第一版本对应的待升级的第二版本;
步骤S104,检测该单板是否升级成功,得到检测结果;
步骤S106,根据检测结果,启动最终版本;其中,该最终版本为第一版本或者第二版本。
通过上述步骤,检测单板是否升级成功,根据得到的检查结果启动单板正在使用的第一版本或者待升级的第二版本,相比于相关技术中,版本升级失败后,就需要将版本回退到以前的老版本,需要重新安装或者重新激活老版本再或者使用备板启动,上述步骤解决了相关技术中本版升级失败后如何快速回退至原来版本的问题,进而缩短了原来版本的回退时间,减少了业务中断的时间。
该最终版本为第一版本或者第二版本,因此需要确定最终版本为第一版本还是为第二版本,在一个可选实施例中,根据该检测结果,启动最终版本之前,在检测到单板升级失败的情况下,该最终版本保持为第一版本不变;或者,在检测到该单板升级成功的情况下,将该最终版本修改为第二版本,进而可以根据第二版本进行升级。
上述步骤S106涉及到根据检测结果,启动最终版本,在一个可选实施例中,在检测到单板升级失败的情况下,通过单板的自动重启,重新启动第一版本。从而在单板升级失败之后,回退至原来的版本。
上述步骤S104涉及获取单板正在使用的第一版本和与该第一版本对应的待升级的第二版本,需要说明的是,可以通过多种方式获取上述第一版本或者第二版本,下面对此进行举例 说明。在一个可选实施例中,从服务器中下载版本文件,解析该版本文件获取第一版本和第二版本。
在一个可选实施例中,解析该版本文件获取第一版本和第二版本之后,激活第一版本和第二版本。以便于单板进行启动第一版本或者第二版本。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
在本实施例中还提供了一种版本升级处理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图2是根据本发明实施例的版本升级处理装置的结构框图,如图2所示,该装置包括:获取模块22,设置为获取单板正在使用的第一版本和与该第一版本对应的待升级的第二版本;检测模块24,设置为检测该单板是否升级成功,得到检测结果;启动模块26,设置为根据该检测结果,启动最终版本;其中,该最终版本为第一版本或者第二版本。
图3是根据本发明实施例的版本升级处理装置的结构框图(一),如图3所示,该装置除包括图2所示的所有模块外,还包括:保持模块32,设置为在检测到该单板升级失败的情况下,该最终版本保持为第一版本不变;或者,修改模块34,设置为在检测到该单板升级成功的情况下,将该最终版本修改为第二版本。
可选地,启动模块26还设置为在检测到该单板升级失败的情况下,通过该单板的自动重启,重新启动第一版本。
图4是根据本发明实施例的版本升级处理装置的结构框图(二),如图4所示,获取模块22包括:下载单元222,设置为从服务器中下载版本文件;解析单元224,设置为解析该版本文件获取该第一版本和该第二版本。
图5是根据本发明实施例的版本升级处理装置的结构框图(三),如图5所示,该装置还包括:激活模块52,设置为激活第一版本和第二版本。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被 设置为存储用于执行以下步骤的程序代码:
S1,获取单板正在使用的第一版本和与第一版本对应的待升级的第二版本;
S2,检测该单板是否升级成功,得到检测结果;
S3,根据检测结果,启动最终版本;其中,该最终版本为第一版本或者第二版本。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行上述S1、S2和S3。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
下面以路由器系统版本升级为例进行说明。
本可选实施例的目的在于,在路由器系统中,提供了一种版本升级失败后,版本能自动回退的方法。保证设备中原来版本继续使用,使路由器系统的基本功能能正常运行。
图6是根据本发明实施例的路由器前台主控单板与后台版本服务器组网图,如图6所示,使用后台命令添加版本,主控单板通过管理口从后台版本服务器下载版本文件,下载的版本文件写入到主控单板磁盘的版本目录中,解析版本目录中的版本文件,到安装目录中,形成单个的安装文件。
在可用版本配置信息1文件中添加配置信息,其中包括版本文件名称,版本号,大小和版本路径。
版本成功的添加完成后,就可以激活该版本,激活版本过程中,完成的一个功能是,将激活的版本信息记录到未提交版本配置信息2中。这个配置信息也记录了版本文件名称,版本号,大小和版本路径。将升级标志添加到升级配置信息3中,表示单板处于升级状态,准备升级版本。
重启主控单板,主控单板打开配置信息3,读取升级标志,发现单板处于升级状态,就读取配置信息2,读取版本文件名称,版本号,大小和版本路径,启动该版本路径中的版本。然后将配置信息3中的升级标志设置成正常启动。
启动成功后,如果发现版本运行正常,确认版本升级成功,就可以开始提交版本,执行提交操作。提交操作中完成的功能有,将主控单板的当前正在使用版本的配置信息4中内容修改成配置信息2中的内容,方便下次正常启动。
如果版本升级过程中失败,单板会自动重启,打开配置信息3,读取其中的升级标志,发现为正常启动,打开配置信息4,从中读取版本文件名称,版本号,大小和版本路径,启动对应路径中的版本文件,从而实现版本的自动回退。
本可选实施例包括以下步骤:
第一步,主控通过其管理口,下载版本文件。
第二步,添加版本文件,在配置信息1中添加版本信息。
第三步,激活版本,创建配置信息2,添加版本信息,改写配置信息3中的升级标志。
第四步,重启单板,读取配置信息3中的升级标志,启动配置信息2中的版本,改写配置信息3中的升级标志为正常启动。
第五步,检查单板升级是否成功,如果成功,就提交版本,将配置信息4中的内容修改成配置信息2中的内容。
第六步,如果升级失败,主控单板自动重启,读取配置信息3中的升级标志为正常值,开始正常启动,启动信息4中的版本。
第七步,开始启用旧版本,实现版本的回退。
如图6所示,路由器系统的主控单板通过管理口,从后台的版本服务器下载版本。
图7是根据本发明实施例的路由器系统解析版本生成安装目录流程图,如图7所示,主控单板将下载的版本放到版本目录中,由于一个版本文件中由很多个独立的进程文件以及其配置文件组成,这些文件需要解析到一个安装目录中,供其他的进程来下载使用。
版本文件解析成安装文件后,通过设置配置信息,控制主控单板在不同的时期启用不同的版本,实现了版本的自动回退功能,本发明可选实施例通过下面的方法来实现的,图8是根据本发明实施例的路由器升级版本失败后回退至原来版本的流程图,如图8所示,流程包括如下步骤:
步骤S802:添加版本,使用命令add,从后台的版本服务器中下载版本文件到主控单板的版本目录,解析该版本文件到安装目录中,这个时候,安装目录中就有了两个版本,目前正在使用的版本A和待升级的版本B,这两个版本信息:版本文件名称,版本号,大小和版本路径,都添加到配置信息1中。
步骤S804:激活版本,版本B已经添加到安装目录中,需要使用命令active将版本的状态设置成激活状态才能被使用,创建配置信息2,包含的信息有:版本文件名称,版本号,大小和版本路径,在升级的时候要使用这些信息;修改配置信息3中的升级标志为升级状态,这个标志在后面的重启单板的步骤中需要使用这个标志。
步骤S806:重启单板,需要使用reload system命令重启主控单板,主控单板重启过程中,读取配置信息3中的升级标志,发现单板目前的状态为升级状态,就开始读取配置信息2中的数据,从指定的版本路径中开始启动版本B,同时将配置信息3中的升级标志设置成正常状态,这个升级标志在版本回退的时候需要使用。
步骤S808:判断单板是否升级成功,在判断结果为是的情况下,执行步骤S810,在判断 结果为否的情况下,执行步骤S812。
步骤S810:如果单板升级成功,执行commit命令提交版本,将配置信息4中的内容修改成配置2中的内容,下次单板启动的时候,就读取配置信息4中的内容,启动最新的版本B,升级成功。
步骤S812:如果升级失败,主控单板不执行commit操作,启动定时器,超过一定时间,不执行commit操作,单板就自动重启,读取配置信息3中的升级标志,发现是正常启动,就开始启动配置信息4中的版本,这个时候,配置信息4中的内容还是版本A的配置信息,所以就启动版本A,从而实现的版本的自动回退。
路由器系统在升级过程中,安装目录中有两个版本,版本A和版本B,版本A为目前正在使用的版本,版本B为待升级的版本,无论是升级版本还是回退版本,版本都只需要启用版本B或者版本A,省除了版本的安装时间。所以在版本升级或者回退中,就缩短了路由器产品由于升级导致业务中断的时间。
综上所述,通过本发明提供的软件版本自动回退的方法及装置,与现有的技术相比,在路由器版本的升级过程中,局方运行的路由器设备数量往往比较多,设备供应商的工程人员往往很难做到亲临现场,对每台设备进行升级,如果失败后,还要重新安装。一个完整的升级过程,业务往往需要中断较长的时间。本发明解决了路由器系统版本升级失败后,能很好地实现版本自动回退,启用系统中上次启用的版本,缩短版本的回退时间,在实际应用中有很强的实用性。从而在路由器系统中,版本升级如果失败后,版本能自动回退,实现了无人值守的升级。同时版本的回退时间大大的缩短,减少了业务中断的时间。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
上述的本发明实施例,可以应用于通信领域,解决了相关技术中本版升级失败后如何快速回退至原来版本的问题,进而缩短了原来版本的回退时间,减少了业务中断的时间。

Claims (10)

  1. 一种版本升级处理方法,包括:
    获取单板正在使用的第一版本和与所述第一版本对应的待升级的第二版本;
    检测所述单板是否升级成功,得到检测结果;
    根据所述检测结果,启动最终版本;其中,所述最终版本为所述第一版本或者所述第二版本。
  2. 根据权利要求1所述的方法,其中,根据所述检测结果,启动最终版本之前包括:
    在检测到所述单板升级失败的情况下,所述最终版本保持为所述第一版本不变;或者,
    在检测到所述单板升级成功的情况下,将所述最终版本修改为所述第二版本。
  3. 根据权利要求2所述的方法,其中,根据所述检测结果,启动最终版本包括:
    在检测到所述单板升级失败的情况下,通过所述单板的自动重启,重新启动所述第一版本。
  4. 根据权利要求1所述的方法,其中,获取单板正在使用的第一版本和与所述第一版本对应的待升级的第二版本包括:
    从服务器中下载版本文件;
    解析所述版本文件获取所述第一版本和所述第二版本。
  5. 根据权利要求4中所述的方法,其中,解析所述版本文件获取所述第一版本和所述第二版本之后包括:
    激活所述第一版本和所述第二版本。
  6. 一种版本升级处理装置,包括:
    获取模块,设置为获取单板正在使用的第一版本和与所述第一版本对应的待升级的第二版本;
    检测模块,设置为检测所述单板是否升级成功,得到检测结果;
    启动模块,设置为根据所述检测结果,启动最终版本;其中,所述最终版本为所述第一版本或者所述第二版本。
  7. 根据权利要求6所述的装置,其中,所述装置还包括:
    保持模块,设置为在检测到所述单板升级失败的情况下,所述最终版本保持为所述第一版本不变;或者,
    修改模块,设置为在检测到所述单板升级成功的情况下,将所述最终版本修改为所述第二版本。
  8. 根据权利要求7所述的装置,其中,所述启动模块还设置为在检测到所述单板升级失败的情况下,通过所述单板的自动重启,重新启动所述第一版本。
  9. 根据权利要求6所述的装置,其中,所述获取模块包括:
    下载单元,设置为从服务器中下载版本文件;
    解析单元,设置为解析所述版本文件获取所述第一版本和所述第二版本。
  10. 根据权利要求9中所述的装置,其中,所述装置还包括:
    激活模块,设置为激活所述第一版本和所述第二版本。
PCT/CN2015/092235 2015-07-16 2015-10-19 版本升级处理方法及装置 WO2016131294A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510420861.X 2015-07-16
CN201510420861.XA CN106708541A (zh) 2015-07-16 2015-07-16 版本升级处理方法及装置

Publications (1)

Publication Number Publication Date
WO2016131294A1 true WO2016131294A1 (zh) 2016-08-25

Family

ID=56692164

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/092235 WO2016131294A1 (zh) 2015-07-16 2015-10-19 版本升级处理方法及装置

Country Status (2)

Country Link
CN (1) CN106708541A (zh)
WO (1) WO2016131294A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113312061A (zh) * 2021-05-08 2021-08-27 武汉中元华电科技股份有限公司 用于电力系统数据采集的程序升级方法及系统
CN113515291A (zh) * 2021-04-22 2021-10-19 北京汇钧科技有限公司 设备在线升级方法和装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107153560B (zh) * 2017-05-25 2020-12-15 微梦创科网络科技(中国)有限公司 版本升级方法、服务器和系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5922072A (en) * 1997-01-03 1999-07-13 Ncr Corporation Method and apparatus for creating alternate boot environments in a computer
CN1684427A (zh) * 2004-04-14 2005-10-19 华为技术有限公司 一种软件升级及回退方法
CN101453550A (zh) * 2007-11-29 2009-06-10 上海未来宽带技术及应用工程研究中心有限公司 一种机顶盒软件自动更新方法
WO2009079866A1 (fr) * 2007-12-25 2009-07-02 Zte Corporation Procédé et système srlatifs au processus de mise à niveau de micrologiciel de terminal mobile
CN102163152A (zh) * 2010-10-26 2011-08-24 青岛海信传媒网络技术有限公司 嵌入式终端设备的软件升级方法及装置
CN104156249A (zh) * 2014-08-18 2014-11-19 四川九成信息技术有限公司 嵌入式软件升级方法
CN104899065A (zh) * 2015-06-11 2015-09-09 武汉虹信通信技术有限责任公司 一种可批量软件在线恢复与软件在线升级的方法和系统

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5922072A (en) * 1997-01-03 1999-07-13 Ncr Corporation Method and apparatus for creating alternate boot environments in a computer
CN1684427A (zh) * 2004-04-14 2005-10-19 华为技术有限公司 一种软件升级及回退方法
CN101453550A (zh) * 2007-11-29 2009-06-10 上海未来宽带技术及应用工程研究中心有限公司 一种机顶盒软件自动更新方法
WO2009079866A1 (fr) * 2007-12-25 2009-07-02 Zte Corporation Procédé et système srlatifs au processus de mise à niveau de micrologiciel de terminal mobile
CN102163152A (zh) * 2010-10-26 2011-08-24 青岛海信传媒网络技术有限公司 嵌入式终端设备的软件升级方法及装置
CN104156249A (zh) * 2014-08-18 2014-11-19 四川九成信息技术有限公司 嵌入式软件升级方法
CN104899065A (zh) * 2015-06-11 2015-09-09 武汉虹信通信技术有限责任公司 一种可批量软件在线恢复与软件在线升级的方法和系统

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515291A (zh) * 2021-04-22 2021-10-19 北京汇钧科技有限公司 设备在线升级方法和装置
CN113312061A (zh) * 2021-05-08 2021-08-27 武汉中元华电科技股份有限公司 用于电力系统数据采集的程序升级方法及系统
CN113312061B (zh) * 2021-05-08 2022-07-01 武汉中元华电科技股份有限公司 用于电力系统数据采集的程序升级方法及系统

Also Published As

Publication number Publication date
CN106708541A (zh) 2017-05-24

Similar Documents

Publication Publication Date Title
CN107729066B (zh) 一种基于svn资源库自动化构建发布方法与装置
US9146839B2 (en) Method for pre-testing software compatibility and system thereof
KR102047216B1 (ko) 서비스의 2차 위치에서의 작업의 재생 기법
WO2017067448A1 (zh) 一种无线固件升级方法、系统及计算机存储介质
US10120672B2 (en) Method for offline updating virtual machine images
CN107844386B (zh) 一种数据备份、恢复方法及装置
US10114630B2 (en) Management of software and operating system updates required for the process of creating a virtual machine facsimile of an existing physical or virtual machine
US9405630B2 (en) Methods and apparatus to perform site recovery of a virtual data center
CN107193607B (zh) 用于更新代码文件的方法和装置、存储介质、处理器以及终端
US8661418B2 (en) Setting program, workflow creating method, and work flow creating apparatus
US20140096121A1 (en) Forcibly completing upgrade of distributed software in presence of failures
CN106095621B (zh) 一种安卓系统中Launcher运行异常的恢复方法及系统
US20120174086A1 (en) Extensible Patch Management
CN110225078B (zh) 一种应用服务更新方法、系统及终端设备
CN110347483B (zh) 物理机到虚拟机迁移方法、装置及存储介质
WO2016206514A1 (zh) 启动处理方法及装置
WO2018032757A1 (zh) 组件升级的方法及装置
CN111897558A (zh) 容器集群管理系统Kubernetes升级方法和装置
CN106201773A (zh) 实例系统、云系统及实例系统的升级或恢复方法
WO2016131294A1 (zh) 版本升级处理方法及装置
US20220326927A1 (en) Abort installation of firmware bundles
CN113434180B (zh) 应用的数据处理方法、装置、服务器和存储介质
CN106603289B (zh) 一种lmt配置文件平滑升级方法
CN111090546A (zh) 一种操作系统重启方法、装置、设备及可读存储介质
CN106293790B (zh) 基于Firefox操作系统的应用程序升级方法和装置

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

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

Country of ref document: EP

Kind code of ref document: A1