CN102831034A - Multimode backup and quick recovery method based on embedded Linux device - Google Patents
Multimode backup and quick recovery method based on embedded Linux device Download PDFInfo
- Publication number
- CN102831034A CN102831034A CN2012102884351A CN201210288435A CN102831034A CN 102831034 A CN102831034 A CN 102831034A CN 2012102884351 A CN2012102884351 A CN 2012102884351A CN 201210288435 A CN201210288435 A CN 201210288435A CN 102831034 A CN102831034 A CN 102831034A
- Authority
- CN
- China
- Prior art keywords
- application
- snapshot
- state
- flash
- linux
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000011084 recovery Methods 0.000 title claims abstract description 22
- 230000006870 function Effects 0.000 claims description 51
- 238000013515 script Methods 0.000 claims description 33
- 238000005192 partition Methods 0.000 claims description 29
- 230000008569 process Effects 0.000 claims description 22
- 230000002093 peripheral effect Effects 0.000 claims description 12
- 230000003287 optical effect Effects 0.000 claims description 2
- 238000011112 process operation Methods 0.000 claims 1
- 230000009286 beneficial effect Effects 0.000 abstract description 3
- 238000004321 preservation Methods 0.000 description 6
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000006837 decompression Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明提供了一种基于嵌入式装置Linux的多状态备份和快速恢复方法,可以大大缩嵌入式Linux设备从上电至期望工作状态的时间,一般可在5秒之内,缩短了设备工作中断时间,对于复杂环境下的嵌入式设备很有裨益;而且,可以事先面向多种应用状态保存多个状态配置选项,恢复时根据具体情况还原至期望状态,灵活适应多种现场使用情况;还有,对嵌入式Linux改动较小,大部分是对嵌入式Linux的模型抽象,独立编程,仅需做少部分的Linux代码补丁,便于该方法在多种专用嵌入式Linux设备上应用;再者,采用压缩格式保存各种快照映像,大大地减少Flash的资源需求,对CPU和内存也无特殊要求。
The invention provides a multi-state backup and fast recovery method based on embedded device Linux, which can greatly shorten the time from power-on to expected working state of embedded Linux devices, generally within 5 seconds, and shorten the interruption of device work Time is very beneficial for embedded devices in complex environments; moreover, multiple state configuration options can be saved in advance for various application states, and restored to the desired state according to the specific situation when restoring, flexibly adapting to various on-site usage situations; and , the changes to embedded Linux are small, most of which are model abstraction to embedded Linux, independent programming, and only need to do a small number of Linux code patches, which is convenient for the method to be applied on various special-purpose embedded Linux devices; moreover, Various snapshot images are saved in a compressed format, which greatly reduces the resource requirements of Flash, and has no special requirements for CPU and memory.
Description
技术领域 technical field
本发明属于计算机技术领域,具体涉及一种基于嵌入式装置Linux的多状态备份和快速恢复方法。The invention belongs to the technical field of computers, and in particular relates to a multi-state backup and fast recovery method based on embedded device Linux.
背景技术 Background technique
嵌入式设备主要是由嵌入式处理器、相关支撑硬件和嵌入式软件系统组成,它是集软硬件于一体的可独立工作的器件。嵌入式软件包括与硬件相关的底层软件、操作系统、图形界面、通信协议、数据库系统和应用软件等。嵌入式Linux作为一种主要的开源免费、功能强大的操作系统被广泛地应用于众多的嵌入式设备中。从软件角度来看,嵌入式设备具有不可修改性、配置较低、系统专业性和实时性较强等特点。因此,对于各种专用的嵌入式设备,实现通用的多状态备份和快速恢复功能对于缩短工作中断时间、适应复杂工作环境、改善用户体验,都是很有意义的。Embedded equipment is mainly composed of embedded processors, related supporting hardware and embedded software systems. It is a device that integrates software and hardware and can work independently. Embedded software includes hardware-related underlying software, operating systems, graphical interfaces, communication protocols, database systems, and application software. Embedded Linux, as a main open source, free and powerful operating system, is widely used in many embedded devices. From the perspective of software, embedded devices have the characteristics of non-modification, low configuration, system professionalism and strong real-time performance. Therefore, for various special embedded devices, it is very meaningful to realize the general multi-state backup and fast recovery function to shorten the work interruption time, adapt to the complex work environment and improve the user experience.
嵌入式Linux具有源码开放、安全可靠、内核可定制等特点,是众多嵌入式设备系统平台的首选。但是由于Linux基于文件的体系结构,系统启动时间过长的问题难以根本改善,再计入各应用程序的加载时间,一般要花费几十秒。Embedded Linux has the characteristics of open source code, safety and reliability, and customizable kernel. It is the first choice for many embedded device system platforms. However, due to the file-based architecture of Linux, it is difficult to fundamentally improve the problem of too long system startup time, and when the loading time of each application is included, it usually takes tens of seconds.
发明内容 Contents of the invention
为克服上述缺陷,本发明提供了一种基于嵌入式装置Linux的多状态备份和快速恢复方法,大大缩短了嵌入式Linux设备从上电至期望工作状态的时间,一般可在5秒之内,而且缩短了设备工作中断时间,对于复杂环境下的嵌入式设备很有裨益,解决了系统启动时间过长的问题,具有恢复时间短、易用性好和资源占用少的特点。For overcoming above-mentioned defect, the present invention provides a kind of multi-state backup and fast recovery method based on embedded device Linux, greatly shorten the time of embedded Linux device from power-on to expected working state, generally within 5 seconds, Moreover, it shortens the interruption time of equipment work, which is very beneficial to embedded equipment in complex environments, solves the problem of long system startup time, and has the characteristics of short recovery time, good usability and low resource occupation.
为实现上述目的,本发明提供一种基于嵌入式装置Linux的多状态备份和快速恢复方法,包括状态备份过程和快速恢复过程,其特征在于,所述状态备份过程包括步骤:For achieving the above object, the present invention provides a kind of multi-state backup and fast recovery method based on embedded device Linux, comprising state backup process and fast recovery process, it is characterized in that, described state backup process comprises steps:
(101).保存应用环境下相关的工作状态,转化为应用信息快照和应用功能快照,压缩写入Flash中的对应配置选项区块;(101). Save the relevant working status under the application environment, convert it into an application information snapshot and an application function snapshot, compress and write it into the corresponding configuration option block in Flash;
(102).在退出应用环境后,保存设备驱动层的工作状态,转化为驱动快照,压缩写入Flash;(102). After exiting the application environment, save the working state of the device driver layer, convert it into a driver snapshot, compress and write it into Flash;
(103).保存CPU的状态信息和Linux的运行环境,即形成内核快照,将内核快照压缩写入Flash;(103). Save the status information of the CPU and the operating environment of Linux, that is, form a kernel snapshot, and compress and write the kernel snapshot into Flash;
其中,Flash包括Flash分区0、Flash分区1、Flash分区2和Flash分区3。Wherein, the Flash includes Flash partition 0, Flash partition 1, Flash partition 2 and Flash partition 3.
所述快速恢复过程包括步骤:The fast recovery process includes steps:
(201).拷贝Flash中的FastRecover BIOS至内存中执行;(201). Copy the FastRecover BIOS in the Flash to execute in memory;
(202).解压、解析Flash中的内核快照和驱动快照,初始化相应的CPU寄存器、内存和外设;(202). Decompress and analyze the kernel snapshot and driver snapshot in Flash, and initialize the corresponding CPU registers, memory and peripherals;
(203).确定需要加载的配置选项号,解压并解析Flash中对应的应用信息快照和应用功能快照至指定内存;(203). Determine the configuration option number that needs to be loaded, decompress and parse the corresponding application information snapshot and application function snapshot in Flash to the designated memory;
(204).嵌入式装置的控制权交由Linux,获取对应的应用信息脚本、应用功能脚本,由其进行顺序地初始化。(204). The control right of the embedded device is handed over to Linux, and the corresponding application information script and application function script are obtained and initialized sequentially.
本发明提供的优选技术方案中,所述步骤101包括如下步骤:In the preferred technical solution provided by the present invention, the step 101 includes the following steps:
(101-1).利用脚本程序检测设备的当前应用状态,获取内核模块信息、进程运行信息、磁盘挂载信息和应用配置信息,并将它们整合为应用信息脚本;(101-1). Use the script program to detect the current application status of the device, obtain kernel module information, process running information, disk mounting information and application configuration information, and integrate them into application information scripts;
(101-2).将应用信息脚本转化为应用信息快照格式;(101-2). Converting the application information script into an application information snapshot format;
(101-3).分析主功能器件的当前寄存器表,及该器件相关接口部分的配置寄存器值,形成应用功能脚本;(101-3). Analyze the current register table of the main function device and the configuration register value of the relevant interface part of the device to form an application function script;
(101-4).将应用功能脚本转化为应用功能快照格式;(101-4). Convert the application function script into the application function snapshot format;
(101-5).将应用信息快照和应用功能快照压缩填入Flash分区3的配置选项N块区,N的选择根据多状态选择策略的规则确定,至此就把应用的某种状态完整保存进行N区块中。(101-5). Compress and fill the application information snapshot and application function snapshot into the configuration option N block area of Flash partition 3. The choice of N is determined according to the rules of the multi-state selection strategy. So far, a certain state of the application is completely saved. In block N.
本发明提供的第二优选技术方案中,在所述步骤101-3中,主功能器件就是设备中的多状态保存对象,所述多状态保存对象包括:工业交换机的交换芯片和无源光网络终端的PON芯片。In the second preferred technical solution provided by the present invention, in the step 101-3, the main functional device is the multi-state storage object in the device, and the multi-state storage object includes: the switching chip of the industrial switch and the passive optical network Terminal PON chip.
本发明提供的第三优选技术方案中,所述步骤101中的使用Perl脚本语言探测应用环境下的进程运行、模块加载、磁盘挂载和应用配置获取应用信息,记录状态信息,并拷贝配置文件。In the third preferred technical solution provided by the present invention, in the step 101, use Perl scripting language to detect process running, module loading, disk mounting and application configuration in the application environment to obtain application information, record status information, and copy configuration files .
本发明提供的第四优选技术方案中,所述步骤102包括如下步骤:In the fourth preferred technical solution provided by the present invention, the step 102 includes the following steps:
(102-1).杀掉运行的应用进程、卸载掉已挂载的盘符、并卸载掉已加载的内核模块;(102-1). Kill the running application process, unload the mounted drive letter, and unload the loaded kernel module;
(102-2).保存各外设驱动模块的寄存器值及相关接口的寄存器值,形成驱动寄存器表;(102-2). Save the register values of each peripheral driver module and the register values of the relevant interfaces to form a driver register table;
(102-3).将驱动寄存器表转化为驱动快照;(102-3). Convert the driver register table into a driver snapshot;
(102-4).将驱动快照压缩,并填入Flash分区2中。(102-4). Compress the driver snapshot and fill it into the Flash partition 2.
本发明提供的第五优选技术方案中,所述步骤103包括如下步骤:In the fifth preferred technical solution provided by the present invention, the step 103 includes the following steps:
(103-1).保存当前CPU的各寄存器状态值,获取内存中Linux运行相关的数据结构转化为内存表;(103-1). Save the status values of each register of the current CPU, obtain the data structure related to Linux operation in the memory and convert it into a memory table;
(103-2).将所述寄存器值和内存表统一转化为内核快照;(103-2). Convert the register value and memory table into a kernel snapshot;
(103-3).将内核快照压缩填入Flash分区1中。(103-3). Fill the compressed kernel snapshot into Flash partition 1.
本发明提供的第六优选技术方案中,所述步骤201包括如下步骤:In the sixth preferred technical solution provided by the present invention, the step 201 includes the following steps:
(201-1).系统上电或者重启时,首先加载bootloader,在bootloader中选择是否进入FastRecover模式;(201-1). When the system is powered on or restarted, first load the bootloader, and select whether to enter the FastRecover mode in the bootloader;
(201-2).拷贝Flash分区0中的FastRecoer BIOS至内存并执行;(201-2). Copy the FastRecoer BIOS in the Flash partition 0 to the memory and execute it;
其中,FastRecoer BIOS具有解压缩、恢复快照的功能。Among them, FastRecoer BIOS has the functions of decompressing and restoring snapshots.
本发明提供的第七优选技术方案中,所述步骤202包括如下步骤:In the seventh preferred technical solution provided by the present invention, the step 202 includes the following steps:
(202-1).解压并解析Flash分区1中的内核快照,恢复相应的CPU寄存器、内存中的Linux相关数据结构;(202-1). Decompress and parse the kernel snapshot in Flash partition 1, restore the corresponding CPU registers, Linux-related data structures in memory;
(202-2).解压并解析Flash分区2中的驱动快照,恢复外设寄存器、相关接口寄存器,并对外设进行初始化。(202-2). Decompress and analyze the driver snapshot in Flash partition 2, restore the peripheral registers and related interface registers, and initialize the peripherals.
本发明提供的第八优选技术方案中,所述步骤203包括如下步骤:In the eighth preferred technical solution provided by the present invention, the step 203 includes the following steps:
(203-1).根据面向应用的多状态选择策略确定需要加载的配置选项N值;(203-1). Determine the configuration option N value to be loaded according to the application-oriented multi-state selection strategy;
(203-2).解压并解析Flash分区3中配置选项块N中的应用信息快照和应用功能快照至指定内存区域;(203-2). Decompress and analyze the application information snapshot and application function snapshot in the configuration option block N in the Flash partition 3 to the designated memory area;
其中,各个N值对应不同的应用状态;多状态划分根据具体应用确定,包括:与具体应用策略对应的多种状态,即每种状态适应一种应用策略;区分装置的全速或低速运行的状态;和区分装置的省电模式或是正常模式的状态。Among them, each N value corresponds to a different application state; the multi-state division is determined according to the specific application, including: multiple states corresponding to specific application strategies, that is, each state is suitable for an application strategy; distinguishing the state of full-speed or low-speed operation of the device ; and to distinguish the state of the device in power saving mode or normal mode.
本发明提供的第九优选技术方案中,所述步骤204包括如下步骤:In the ninth preferred technical solution provided by the present invention, the step 204 includes the following steps:
(204-1).嵌入式装置的控制权交给Linux内核主程序,并在内存指定位置获取应用信息脚本和应用功能脚本;(204-1). The control right of the embedded device is handed over to the main program of the Linux kernel, and the application information script and application function script are obtained at the designated location of the memory;
(204-2).按照应用信息脚本挂载磁盘、加载模块、执行进程和配置参数;(204-2). Mount the disk, load the module, execute the process and configure parameters according to the application information script;
(204-3).按照应用功能脚本初始化相应的主功能器件。(204-3). Initialize the corresponding main function device according to the application function script.
与现有技术比,本发明提供的一种基于嵌入式装置Linux的多状态备份和快速恢复方法,可以大大缩嵌入式Linux设备从上电至期望工作状态的时间,一般可在5秒之内,缩短了设备工作中断时间,对于复杂环境下的嵌入式设备很有裨益;而且,可以事先面向多种应用状态保存多个状态配置选项,恢复时根据具体情况还原至期望状态,灵活适应多种现场使用情况;还有,对嵌入式Linux改动较小,大部分是对嵌入式Linux的模型抽象,独立编程,仅需做少部分的Linux代码补丁,便于该方法在多种专用嵌入式Linux设备上应用;再者,采用压缩格式保存各种快照映像,大大地减少Flash的资源需求,对CPU和内存也无特殊要求。Compared with the prior art, the present invention provides a multi-state backup and fast recovery method based on embedded device Linux, which can greatly shorten the time for embedded Linux devices from power-on to expected working state, generally within 5 seconds , which shortens the interruption time of device work, which is very beneficial for embedded devices in complex environments; moreover, multiple state configuration options can be saved in advance for various application states, and restored to the desired state according to the specific situation when restoring, flexibly adapting to various On-the-spot use situation; Also, to embedded Linux change less, most are to the model abstraction of embedded Linux, independent programming, only need to do the Linux code patch of a small part, be convenient to this method in multiple special-purpose embedded Linux devices In addition, various snapshot images are saved in a compressed format, which greatly reduces the resource requirements of Flash, and has no special requirements for CPU and memory.
附图说明 Description of drawings
图1为基于嵌入式装置Linux的多状态备份和快速恢复方法的概括流程图。FIG. 1 is a general flowchart of a multi-state backup and fast recovery method based on embedded device Linux.
图2为方法执行的总体层次图。Figure 2 is an overall hierarchical diagram of method execution.
图3为状态备份过程的流程图。FIG. 3 is a flow chart of the state backup process.
图4为快速恢复过程的流程图。FIG. 4 is a flow chart of the fast recovery process.
具体实施方式 Detailed ways
如图1、2所示的一种基于嵌入式装置Linux的多状态备份和快速恢复方法,包括状态备份过程和快速恢复过程,所述状态备份过程包括步骤:A kind of multi-state backup and fast recovery method based on embedded device Linux as shown in Figure 1, 2, comprise state backup process and fast recovery process, described state backup process comprises steps:
步骤101:保存应用环境下相关的工作状态,转化为应用信息快照和应用功能快照,压缩写入Flash中的对应配置选项区块。Step 101: Save the relevant working status in the application environment, convert it into application information snapshot and application function snapshot, compress and write to the corresponding configuration option block in Flash.
步骤102:在退出应用环境后,保存设备驱动层的工作状态,转化为驱动快照,压缩写入Flash。Step 102: After exiting the application environment, save the working state of the device driver layer, convert it into a driver snapshot, compress and write it into Flash.
步骤103:保存CPU的状态信息和Linux的运行环境,即形成内核快照,将内核快照压缩写入Flash。Step 103: saving the status information of the CPU and the operating environment of Linux, that is, forming a kernel snapshot, and compressing and writing the kernel snapshot into Flash.
所述快速恢复过程包括步骤:The fast recovery process includes steps:
步骤201:拷贝Flash中的FastRecover BIOS至内存中执行,由该程序来主导后续的恢复过程。Step 201: Copy the FastRecover BIOS in the Flash to the memory for execution, and this program will lead the subsequent recovery process.
步骤202:解压、解析Flash中的内核快照和驱动快照,初始化相应的CPU寄存器、内存、外设。Step 202: Decompress and analyze the kernel snapshot and driver snapshot in Flash, and initialize corresponding CPU registers, memory, and peripherals.
步骤203:确定需要加载的配置选项号,解压、解析Flash中对应的应用信息快照和应用功能快照至指定内存。Step 203: Determine the configuration option number to be loaded, decompress and parse the corresponding application information snapshot and application function snapshot in the Flash to the designated memory.
步骤204:控制权交由Linux,获取对应的应用信息脚本、应用功能脚本,由其进行顺序地初始化。Step 204: The control right is handed over to Linux, and the corresponding application information script and application function script are obtained, and then initialized sequentially.
所述步骤101中的应用信息的获取是使用Perl脚本语言探测应用环境下的进程运行、模块加载、磁盘挂载、应用配置等状况,记录状态信息,拷贝配置文件。The acquisition of the application information in the step 101 is to use the Perl scripting language to detect conditions such as process running, module loading, disk mounting, and application configuration in the application environment, record status information, and copy configuration files.
所述步骤101中的应用功能快照是针对主功能器件的状态保存,即设备多状态保存的主要对象,主功能器件的选择根据具体情况来定,例如交换机中即可选择设备中的交换芯片进行状态保存和恢复,从而实现多种交换配置状态的备份,当然也可以针对多个功能器件的组合状态保存。具体实现是使用Perl脚本查看功能寄存器的状态,运用预先设计的规则,将其转化为相应的配置脚本,此部分内容需要根据应用进行定制设计。The application function snapshot in the step 101 is for the state preservation of the main function device, that is, the main object of multi-state preservation of the equipment. The selection of the main function device is determined according to the specific situation. State preservation and recovery, so as to realize the backup of various switching configuration states, and of course, it can also save the combined state of multiple functional devices. The specific implementation is to use the Perl script to view the status of the function register, and use the pre-designed rules to convert it into a corresponding configuration script. This part of the content needs to be customized according to the application.
所述步骤102中退出应用环境才进行后续的状态保存工作,即杀掉应用进程、卸载磁盘、卸载模块后,这样后续只需要备份一个最小的Linux系统,从而简化了对设备驱动层和内核层的状态保存,同时使权利要求3中的配置选项保存完全面向应用层,便于实现多状态选择策略。Exit the application environment in the step 102 to carry out subsequent state preservation work, that is, after killing the application process, unloading the disk, and unloading the module, so that the follow-up only needs to back up a minimum Linux system, thereby simplifying the device driver layer and the kernel layer state preservation, while making the configuration option preservation in claim 3 completely oriented to the application layer, so as to facilitate the realization of a multi-state selection strategy.
所述状态备份步骤中多处使用快照功能和压缩保存功能。这些功能都用C语言开发,在linux环境下直接运行的,其中快照功能根据对象不同有脚本快照、寄存器快照、内存快照三种,分别用不同类型的数据结构和算法来实现。压缩保存功能用即是常用的GZIP格式完成的。In the state backup step, the snapshot function and the compressed storage function are used in many places. These functions are all developed in C language and run directly under the Linux environment. According to different objects, the snapshot function has three types: script snapshot, register snapshot, and memory snapshot, which are realized by different types of data structures and algorithms. The compression and saving function is completed with the commonly used GZIP format.
所述步骤201中FastRecover BIOS是用C语言开发的,是一个独立运行的程序,在Linux启动之前承担了恢复快照的工作,具有解压、解析快照等功能,是权利要求5所述功能的逆操作。In the step 201, FastRecover BIOS is developed with C language, and is an independently running program, which undertakes the work of recovering snapshots before Linux starts, and has functions such as decompression and parsing snapshots, which is the inverse operation of the functions described in claim 5 .
其中,各个N值对应不同的应用状态;多状态划分根据具体应用确定,包括:与具体应用策略对应的多种状态,即每种状态适应一种应用策略;区分装置的全速或低速运行的状态;和区分装置的省电模式或是正常模式的状态。Among them, each N value corresponds to a different application state; the multi-state division is determined according to the specific application, including: multiple states corresponding to specific application strategies, that is, each state is suitable for an application strategy; distinguishing the state of full-speed or low-speed operation of the device ; and to distinguish the state of the device in power saving mode or normal mode.
通过下面的实施例对状态备份过程作进一步解释。The state backup process is further explained through the following embodiments.
如图3所示,所述状态备份过程包括步骤如下:As shown in Figure 3, the state backup process includes the following steps:
1.利用脚本程序检测设备的当前应用状态,获取内核模块信息、进程运行信息、磁盘挂载信息、应用配置信息,并将它们整合为应用信息脚本。1. Use the script program to detect the current application status of the device, obtain kernel module information, process running information, disk mount information, and application configuration information, and integrate them into application information scripts.
2.将应用信息脚本转化为应用信息快照格式。2. Convert the application information script into an application information snapshot format.
3.分析主功能器件的当前寄存器表,及其相关接口的寄存器值,形成应用功能脚本。此处的主功能器件就是设备中的多状态保存的主要对象。3. Analyze the current register table of the main function device and the register values of related interfaces to form an application function script. The main functional device here is the main object of multi-state storage in the device.
4.将应用功能脚本转化为应用功能快照格式。4. Convert the application function script into the application function snapshot format.
5.将应用信息快照和应用功能快照压缩填入Flash分区3的配置选项N块区,N的选择根据多状态选择策略的规则确定,至此就把应用的某种状态完整保存进行N区块中。5. Compress the application information snapshot and application function snapshot into the configuration option N block area of Flash partition 3. The choice of N is determined according to the rules of the multi-state selection strategy. So far, a certain state of the application is completely saved in the N block .
6.杀掉运行的应用进程、卸载掉已挂载的盘符、卸载掉已加载的内核模块。6. Kill the running application process, uninstall the mounted drive letter, and uninstall the loaded kernel module.
7.保存此状态下各外设驱动模块的寄存器值及相关接口的I寄存器值,形成驱动寄存器表。7. Save the register values of each peripheral driver module and the I register value of the relevant interface in this state to form a driver register table.
8.将驱动寄存器表转化为驱动快照。8. Convert the driver register table into a driver snapshot.
9.将驱动快照压缩,并填入Flash分区2中。9. Compress the driver snapshot and fill it into Flash partition 2.
10.保存当前CPU的各寄存器状态值,获取内存中Linux运行相关的数据结构转化为内存表。10. Save the status value of each register of the current CPU, obtain the data structure related to Linux operation in the memory and convert it into a memory table.
11.将上述寄存器值和内存表统一转化为内核快照。11. Convert the above register values and memory tables into a kernel snapshot.
12.将内核快照压缩填入Flash分区1中。12. Compress the kernel snapshot into Flash partition 1.
13.至此,状态备份过程完成,可以重启或者关机。13. At this point, the status backup process is complete, and you can restart or shut down.
通过下面的实施例对快速恢复过程作进一步解释。The fast recovery process is further explained by the following examples.
如图4所示,所述快速恢复过程包括步骤:As shown in Figure 4, the fast recovery process includes steps:
1.系统上电或者重启时,首先加载bootloader,在bootloader中选择是否进入FastRecover模式。1. When the system is powered on or restarted, first load the bootloader, and select whether to enter the FastRecover mode in the bootloader.
2.拷贝Flash分区0中的FastRecoer BIOS至内存,在内存中执行FastRecoerBIOS,该程序具有解压缩、恢复快照等功能。2. Copy the FastRecoer BIOS in Flash partition 0 to the memory, and execute FastRecoerBIOS in the memory. This program has the functions of decompression and snapshot restoration.
3.解压、解析Flash分区1中的内核快照恢复相应的CPU寄存器、内存中的Linux相关数据结构。3. Decompress and analyze the kernel snapshot in Flash partition 1 to restore the corresponding CPU registers and Linux-related data structures in memory.
4.解压、解析Flash分区2中的驱动快照恢复外设寄存器、相关接口寄存器,以及进行一些必要外设初始化。4. Decompress and analyze the driver snapshot in Flash partition 2 to restore peripheral registers and related interface registers, and initialize some necessary peripherals.
5.根据状态选择策略确定需要加载的配置选项N值。5. Determine the configuration option N value that needs to be loaded according to the state selection strategy.
6.解压、解析Flash分区3中配置选项块N中的应用信息快照和应用功能快照至指定内存区域。6. Decompress and parse the application information snapshot and application function snapshot in the configuration option block N in Flash partition 3 to the designated memory area.
7.控制权交给Linux内核主程序Main,并在内存指定位置获取应用信息脚本、应用功能脚本7. The control right is handed over to the Linux kernel main program Main, and the application information script and application function script are obtained at the specified location in the memory
8.按照应用信息脚本挂载磁盘、加载模块、执行进程、配置参数。8. Follow the application information script to mount disks, load modules, execute processes, and configure parameters.
9.按照应用功能脚本初始化相应的主功能器件至指定工作状态。9. According to the application function script, initialize the corresponding main function device to the specified working state.
10.此时设备即完全恢复至期望的工作状态。10. At this point, the equipment is fully restored to the expected working state.
需要声明的是,本发明内容及具体实施方式意在证明本发明所提供技术方案的实际应用,不应解释为对本发明保护范围的限定。本领域技术人员在本发明的精神和原理启发下,可作各种修改、等同替换、或改进。但这些变更或修改均在申请待批的保护范围内。It should be declared that the contents and specific implementation methods of the present invention are intended to prove the practical application of the technical solutions provided by the present invention, and should not be construed as limiting the protection scope of the present invention. Those skilled in the art may make various modifications, equivalent replacements, or improvements under the inspiration of the spirit and principles of the present invention. But these changes or modifications are all within the protection scope of the pending application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210288435.1A CN102831034B (en) | 2012-08-14 | 2012-08-14 | Based on multimode backup and the quick recovery method of embedded equipment Linux |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210288435.1A CN102831034B (en) | 2012-08-14 | 2012-08-14 | Based on multimode backup and the quick recovery method of embedded equipment Linux |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102831034A true CN102831034A (en) | 2012-12-19 |
CN102831034B CN102831034B (en) | 2016-04-20 |
Family
ID=47334183
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210288435.1A Active CN102831034B (en) | 2012-08-14 | 2012-08-14 | Based on multimode backup and the quick recovery method of embedded equipment Linux |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102831034B (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103544097A (en) * | 2013-10-21 | 2014-01-29 | 广东威创视讯科技股份有限公司 | Journal storing method, journal storing system, journal reading method and journal reading system of embedded system |
CN103761197A (en) * | 2014-01-16 | 2014-04-30 | 深圳市亿维自动化技术有限公司 | Method and system for storing data by using Flash and RAM (random-access memory) |
CN104468419A (en) * | 2014-12-22 | 2015-03-25 | 上海斐讯数据通信技术有限公司 | Method and system for recovering configuration of interchanger and interchanger |
CN106164866A (en) * | 2014-04-08 | 2016-11-23 | 微软技术许可有限责任公司 | The efficient migration of client-side WEB state |
WO2018098834A1 (en) * | 2016-11-29 | 2018-06-07 | 邦彦技术股份有限公司 | Method for ensuring normal booting of linux operating system |
CN110806950A (en) * | 2019-09-19 | 2020-02-18 | 平安科技(深圳)有限公司 | Snapshot generation method and device based on polymorphic storage mechanism and computer equipment |
CN110837343A (en) * | 2019-09-27 | 2020-02-25 | 华为技术有限公司 | Snapshot processing method and device and terminal |
CN113076220A (en) * | 2020-01-06 | 2021-07-06 | 阿里巴巴集团控股有限公司 | Data processing method and device, electronic equipment and computer readable medium |
CN114064348A (en) * | 2020-07-29 | 2022-02-18 | 中移(苏州)软件技术有限公司 | A backup and restoration method, apparatus, device, and computer-readable storage medium |
CN114218010A (en) * | 2022-02-14 | 2022-03-22 | 柏科数据技术(深圳)股份有限公司 | Data backup and recovery method, system, terminal equipment and storage medium |
CN114900630A (en) * | 2022-03-25 | 2022-08-12 | 青岛信芯微电子科技股份有限公司 | Monitor, data processing method, device and medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110191769A1 (en) * | 2010-02-04 | 2011-08-04 | Storage Appliance Corporation | Automated Network Backup Device and Method |
CN102495812A (en) * | 2011-12-15 | 2012-06-13 | 江苏中科梦兰电子科技有限公司 | Hard disk data protection and recovery method of Linux platform |
CN102567136A (en) * | 2010-12-15 | 2012-07-11 | 研祥智能科技股份有限公司 | Backup and recovery method of computer system, device and computer system |
-
2012
- 2012-08-14 CN CN201210288435.1A patent/CN102831034B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110191769A1 (en) * | 2010-02-04 | 2011-08-04 | Storage Appliance Corporation | Automated Network Backup Device and Method |
CN102567136A (en) * | 2010-12-15 | 2012-07-11 | 研祥智能科技股份有限公司 | Backup and recovery method of computer system, device and computer system |
CN102495812A (en) * | 2011-12-15 | 2012-06-13 | 江苏中科梦兰电子科技有限公司 | Hard disk data protection and recovery method of Linux platform |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103544097B (en) * | 2013-10-21 | 2016-04-13 | 广东威创视讯科技股份有限公司 | The log storing method of embedded system, system and log read method and system |
CN103544097A (en) * | 2013-10-21 | 2014-01-29 | 广东威创视讯科技股份有限公司 | Journal storing method, journal storing system, journal reading method and journal reading system of embedded system |
CN103761197A (en) * | 2014-01-16 | 2014-04-30 | 深圳市亿维自动化技术有限公司 | Method and system for storing data by using Flash and RAM (random-access memory) |
CN106164866B (en) * | 2014-04-08 | 2020-01-10 | 微软技术许可有限责任公司 | Efficient migration of client-side WEB state |
CN106164866A (en) * | 2014-04-08 | 2016-11-23 | 微软技术许可有限责任公司 | The efficient migration of client-side WEB state |
CN104468419A (en) * | 2014-12-22 | 2015-03-25 | 上海斐讯数据通信技术有限公司 | Method and system for recovering configuration of interchanger and interchanger |
WO2018098834A1 (en) * | 2016-11-29 | 2018-06-07 | 邦彦技术股份有限公司 | Method for ensuring normal booting of linux operating system |
CN110806950A (en) * | 2019-09-19 | 2020-02-18 | 平安科技(深圳)有限公司 | Snapshot generation method and device based on polymorphic storage mechanism and computer equipment |
CN110837343A (en) * | 2019-09-27 | 2020-02-25 | 华为技术有限公司 | Snapshot processing method and device and terminal |
CN113076220A (en) * | 2020-01-06 | 2021-07-06 | 阿里巴巴集团控股有限公司 | Data processing method and device, electronic equipment and computer readable medium |
CN113076220B (en) * | 2020-01-06 | 2024-05-31 | 阿里巴巴集团控股有限公司 | Data processing method, device, electronic device and computer readable medium |
CN114064348A (en) * | 2020-07-29 | 2022-02-18 | 中移(苏州)软件技术有限公司 | A backup and restoration method, apparatus, device, and computer-readable storage medium |
CN114218010A (en) * | 2022-02-14 | 2022-03-22 | 柏科数据技术(深圳)股份有限公司 | Data backup and recovery method, system, terminal equipment and storage medium |
CN114900630A (en) * | 2022-03-25 | 2022-08-12 | 青岛信芯微电子科技股份有限公司 | Monitor, data processing method, device and medium |
Also Published As
Publication number | Publication date |
---|---|
CN102831034B (en) | 2016-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102831034B (en) | Based on multimode backup and the quick recovery method of embedded equipment Linux | |
US10216531B2 (en) | Techniques for virtual machine shifting | |
US10353779B2 (en) | Systems and methods for detection of firmware image corruption and initiation of recovery | |
US20110179260A1 (en) | Method for integrating operating system into bios chip and method for booting operating system from server | |
US20150324216A1 (en) | Self-repairing configuration service for virtual machine migration | |
US20150324227A1 (en) | Techniques for virtual machine migration | |
CN108432219A (en) | Recovering method and terminal equipment for failing to start the terminal equipment | |
US20200349009A1 (en) | Information Handling System And Method To Restore System Firmware To A Selected Restore Point | |
CN113505014B (en) | Fault diagnosis file acquisition method and device | |
CN105159703B (en) | The method and system of factory reset | |
CN104572354A (en) | Backup and restoration method for operating system based on restoration service and equipment thereof | |
KR20130068630A (en) | Method for initializing embedded device and apparatus thereof | |
CN113703821A (en) | Cloud mobile phone updating method, device, equipment and storage medium | |
CN103890713A (en) | Apparatus and method for managing register information in processing system | |
US11740969B2 (en) | Detecting and recovering a corrupted non-volatile random-access memory | |
CN115951949A (en) | Recovery method and device for configuration parameters of BIOS (basic input output System) and computing equipment | |
CN101515834A (en) | Main control card, switching system based on multi-backup main control card, switching method of switching system | |
US11593141B2 (en) | Atomic groups for configuring HCI systems | |
US20150347234A1 (en) | Recovery method for portable touch-control device and portable touch-control device using the same | |
US20140115378A1 (en) | System and method for restoring network configuration parameters | |
CN111309358A (en) | A kind of CPLD firmware upgrade method, apparatus, equipment and readable storage medium | |
CN113900934B (en) | Multi-mirror hybrid refresh test method, system, terminal and storage medium | |
CN114816023B (en) | Server backup function optimization method, system, terminal and storage medium | |
CN113778485B (en) | System operation method and device of electronic chip, electronic chip and storage medium | |
CN114661670A (en) | File decompression method, system and device based on Fuse file system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C41 | Transfer of patent application or patent right or utility model | ||
TR01 | Transfer of patent right |
Effective date of registration: 20160426 Address after: 100192 Beijing city Haidian District Qinghe small Camp Road No. 15 Patentee after: China Electric Power Research Institute Patentee after: State Grid Smart Grid Institute Patentee after: State Grid Corporation of China Address before: 100192 Beijing city Haidian District Qinghe small Camp Road No. 15 Patentee before: China Electric Power Research Institute Patentee before: State Grid Corporation of China |
|
C56 | Change in the name or address of the patentee | ||
CP01 | Change in the name or title of a patent holder |
Address after: 100192 Beijing city Haidian District Qinghe small Camp Road No. 15 Patentee after: China Electric Power Research Institute Patentee after: GLOBAL ENERGY INTERCONNECTION RESEARCH INSTITUTE Patentee after: State Grid Corporation of China Address before: 100192 Beijing city Haidian District Qinghe small Camp Road No. 15 Patentee before: China Electric Power Research Institute Patentee before: State Grid Smart Grid Institute Patentee before: State Grid Corporation of China |