WO2018120100A1 - 一种掉电保护方法、装置及计算机 - Google Patents

一种掉电保护方法、装置及计算机 Download PDF

Info

Publication number
WO2018120100A1
WO2018120100A1 PCT/CN2016/113683 CN2016113683W WO2018120100A1 WO 2018120100 A1 WO2018120100 A1 WO 2018120100A1 CN 2016113683 W CN2016113683 W CN 2016113683W WO 2018120100 A1 WO2018120100 A1 WO 2018120100A1
Authority
WO
WIPO (PCT)
Prior art keywords
system configuration
folder
parameter
backup
configuration
Prior art date
Application number
PCT/CN2016/113683
Other languages
English (en)
French (fr)
Inventor
叶根
Original Assignee
深圳配天智能技术研究院有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳配天智能技术研究院有限公司 filed Critical 深圳配天智能技术研究院有限公司
Priority to PCT/CN2016/113683 priority Critical patent/WO2018120100A1/zh
Priority to CN201680086679.8A priority patent/CN109496299A/zh
Publication of WO2018120100A1 publication Critical patent/WO2018120100A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation

Definitions

  • the invention relates to the field of power failure protection, in particular to a power failure protection method, device and computer for protecting a system configuration parameter from being lost when an unexpected power failure occurs during software operation.
  • the software needs to call various system configuration parameters of the operating system during the running process.
  • the CNC system software also has several system configuration parameters related to the operating system.
  • the software will write the default system configuration parameters that come with the factory to the low-voltage non-volatile memory, such as hard disk, flash, and so on.
  • the user will modify these system configuration parameters according to the actual use. For example, you need to make changes based on what changes.
  • the modified system configuration parameters are also stored in non-volatile memory so that the software can re-read system configuration parameters the next time it is started. In the process of writing system configuration parameters to non-volatile memory, if an unexpected power failure occurs, the entire file that records the system configuration parameters may be damaged, resulting in the software not restarting after power supply.
  • UPS Uninterruptible Power
  • the UPS module can continue to provide short-term power to the system as a backup power source. With this time, the software system can complete a safe shutdown process.
  • This solution requires the addition of hardware modules, which adds additional cost.
  • Another way to solve this technical problem in the prior art is to store a set of default parameters in the system.
  • the default configuration parameters are used when the system fails to find that reading the configuration file fails. In this way, the system can still start up normally and enter the working state. Since all the configuration parameters will be restored to the default state, all the user's previous setting parameters will be lost, and the parameters need to be reconfigured. If there are many parameters, it will bring a lot of work.
  • the invention provides a power-down protection method for implementing protection of system configuration parameters during a software running process and a power-down restart process.
  • the method includes: modifying a system in a preset main configuration folder The configuration parameter is determined; whether the system configuration parameter in the main configuration folder is modified; if the system configuration parameter in the main configuration folder is modified, the system configuration parameter in the preset backup configuration folder is modified.
  • the power-down protection device includes: a first modification module, configured to modify a system configuration parameter in a preset main configuration folder during software running; and a first determination module, configured to be in a software running process Determining whether the system configuration parameter in the main configuration folder is modified; the second modification module is configured to modify the preset backup configuration folder after the configuration parameter of the main configuration folder system is modified during the running of the software.
  • System configuration parameters in .
  • the backup configuration folder is set in the external memory of the computer, and the configuration parameter of the backup configuration folder is modified.
  • the configuration parameter of the backup configuration folder is modified.
  • the software can be started by reading the system configuration parameters of the backup configuration folder, and the software only needs to modify the part of the system configuration parameters that are to be modified before power-off, without re-re- Modify all system configuration parameters.
  • the backup configuration folder is damaged, and the modified system configuration parameters are saved in the main configuration folder.
  • the software can be started by reading the system configuration parameters in the main configuration folder, and the system configuration parameters need not be modified after the software is started.
  • the method provided by the present invention does not need to add an additional hardware module, and only needs to write a piece of software code to solve the problem that the software restart fails when the system is unexpectedly powered down, and the cost is low.
  • 1 is a flow chart of a power failure protection method during software operation
  • Figure 2 is a flow chart of the power-down protection method during the power-down restart process
  • Figure 3 is a flow chart of "Modify system configuration parameters in the main configuration folder"
  • Figure 4 is a flow chart of "writing new system configuration parameters into the main configuration folder and backup action table"
  • Figure 5 is a flow chart of "determining whether the system configuration parameters in the main configuration folder have been modified"
  • Figure 6 is a flow chart of "Modify system configuration parameters in the backup configuration folder"
  • Figure 7 is a computer employing a power down protection method in accordance with an embodiment of the present invention.
  • an implementation manner is: after the system configuration parameter in the main configuration folder is completed, a signal is sent, and the system determines whether the system configuration parameter in the main configuration folder is modified by receiving the signal, if not received. This signal continues to modify the system configuration parameters in the main configuration folder.
  • the primary configuration folder and the backup configuration folder are pre-configured, for example, may be created by software in the external storage of the computer during the installation of the software.
  • the backup configuration folder in addition to setting the main configuration folder, the backup configuration folder is set in the external storage of the computer, and the modification of the system configuration parameters in the backup configuration folder must be in the main configuration folder. After the modification of the system configuration parameters is completed. In this way, if the power failure occurs in the stage of modifying the main configuration folder, the main configuration folder is damaged, and the backup configuration folder stores the system configuration parameters before the power failure.
  • the software restart process after power failure the software can be started by reading the system configuration parameters of the backup configuration folder, and the software only needs to modify the part of the system configuration parameters that are to be modified before power-off, without re-re- Modify all system configuration parameters.
  • the embodiment relates to a power-down protection method during a power-off restart process, and the method specifically includes:
  • system configuration parameters in the backup configuration folder can be synchronized with the system configuration parameters in the main configuration folder during the startup process after the software is powered off, so that the system configuration parameters are subsequently modified after the software startup.
  • the system configuration parameters that need to be modified in the main configuration folder and backup configuration folder are the same.
  • the backup configuration folder stores the system configuration parameters saved before the power failure, and the main configuration folder is damaged.
  • the system configuration parameters in the main configuration folder can be synchronized with the system configuration parameters in the backup configuration folder during the startup process after the software is powered off, so that the system configuration is modified before the software is restarted after the software is restarted.
  • the system configuration parameters that need to be modified in the main configuration folder and the backup configuration folder are the same.
  • the backup configuration folder in addition to setting the main configuration folder, the backup configuration folder is set in the external storage of the computer, and the modification of the system configuration parameters in the backup configuration folder must be in the main configuration folder. After the modification of the system configuration parameters is completed. In this way, if the power failure occurs in the stage of modifying the main configuration folder, the main configuration folder is damaged, and the backup configuration folder stores the system configuration parameters before the power failure.
  • the software restart process after power failure the software can be started by reading the system configuration parameters of the backup configuration folder, and the software only needs to modify the part of the system configuration parameters that are to be modified before power-off, without re-re- Modify all system configuration parameters.
  • the backup configuration folder is damaged, and the modified system configuration parameters are saved in the main configuration folder.
  • the software can be started by reading the system configuration parameters in the main configuration folder, and the system configuration parameters need not be modified after the software is started.
  • the software creates a mutex and an empty backup action table in the computer's memory.
  • the backup action table is empty, which means that this is the first time to modify the system configuration parameters after the software is started, so you can directly configure the new system. The parameters are written directly to the backup action table.
  • system configuration parameters of a single software are many, after the software is started, the system configuration parameters modified each time may be the same or different, and the two situations are separately processed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

一种能在软件运行过程及掉电重启过程中实现系统配置参数不丢失而且成本低的掉电保护方法、装置及计算机,在软件运行过程中,所述方法包括:修改主配置文件夹中的系统配置参数(110);判断主配置文件夹中的系统配置参数是否修改完毕(120);如果主配置文件夹中的系统配置参数修改完毕,则修改备份配置文件夹中的系统配置参数(130)。

Description

一种掉电保护方法、装置及计算机
【技术领域】
本发明涉及掉电保护领域,尤其涉及一种在软件运行过程中发生意外掉电时保护系统配置参数不丢失的掉电保护方法、装置及计算机。
【背景技术】
软件作为建立在操作系统之上的应用程序,其在运行过程中需要调用操作系统的各种系统配置参数。数控系统软件也有多个与操作系统相关的系统配置参数。在软件安装过程中,软件就会把出厂时自带的默认系统配置参数写入存储到掉电非易失存储器中,如硬盘,flash等。但在使用软件过程中,用户会根据实际使用情况对这些系统配置参数做修改。比如,就需要根据什么的变化做修改。修改后的系统配置参数也会存储到非易失存储器中,以便于软件在下次启动时能重新读取系统配置参数。在将系统配置参数写入非易失存储器的过程中,如果发生意外掉电,可能会导致整个记载系统配置参数的文件损坏,从而导致在供电后软件不能重新启动运行。
现有技术解决该技术问题的一种方法是添加UPS( Uninterruptible Power Supply)模块,即不间断电源。当系统意外掉电时,UPS模块作为后备电源可以继续为系统提供短时间的供电。利用这段时间,软件系统可以完成安全的关机流程。该方案需要添加硬件模块,会增加额外的成本。
现有技术解决该技术问题的另一种方法是是在系统中存储一套默认参数。当系统启动时发现读取配置文件失败时则采用默认配置参数。这样系统仍可以正常启动进入工作状态。由于所有的配置参数都会恢复为默认状态,用户之前的设置参数会全部丢失,需要重新对参数进行配置工作,如果参数较多,则会带来很大的工作量。
【发明内容】
本发明的目的在于提供一种既能在掉电时保护系统配置参数不丢失又能降低成本的掉电保护方法、装置及计算机。
本发明提供一种掉电保护方法,用于在软件运行过程及掉电重启过程中实现系统配置参数的保护在软件运行过程中,所述方法包括:修改预置的主配置文件夹中的系统配置参数;判断所述主配置文件夹中的系统配置参数是否修改完毕;如果所述主配置文件夹中的系统配置参数修改完毕,则修改预置的备份配置文件夹中的系统配置参数。
本实施例提供的掉电保护装置,包括:第一修改模块,用于在软件运行过程中修改预置的主配置文件夹中的系统配置参数;第一判断模块,用于在软件运行过程中判断所述主配置文件夹中的系统配置参数是否修改完毕;第二修改模块,用于在软件运行过程中当所述主配置文件夹系统配置参数修改完毕后,修改预置的备份配置文件夹中的系统配置参数。
本实施例还提供一种计算机,所述计算机包括处理器和存储器,所述处理器用于执行前述的掉电保护方法。
采用本发明提供的掉电保护方法、掉电保护装置和计算机,在计算机的外存储器中除了设置主配置文件夹外,还设置了备份配置文件夹,而且备份配置文件夹中系统配置参数的修改必须在主配置文件夹中系统配置参数的修改完成之后。这样如果掉电发生在修改主配置文件夹阶段,则主配置文件夹损坏,备份配置文件夹保存有掉电前的系统配置参数。在掉电后软件的再启动过程中,软件能通过读取备份配置文件夹的系统配置参数启动,而且软件启动后只需要修改掉电前准备修改的那部分系统配置参数就行,而不需要重新修改所有的系统配置参数。如果掉电发生在修改备份配置文件夹阶段,则备份配置文件夹损坏,而主配置文件夹中保存有修改后的系统配置参数。在掉电后软件的再启动过程中,软件能通过读取主配置文件夹中的系统配置参数启动,而且软件启动后不需要再修改系统配置参数。与现有技术相比,本发明提供的方法不需要添加额外的硬件模块,只需要编写一段软件代码就能解决在系统意外掉电时导致软件重新启动失效的问题,成本很低。
【附图说明】
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是在软件运行过程中掉电保护方法的流程图;
图2 是掉电重启过程中掉电保护方法的流程图;
图3 是“修改主配置文件夹中的系统配置参数”的流程图;
图4 是“将新系统配置参数写入主配置文件夹和备份动作表中”的流程图
图5 是“判断主配置文件夹中的系统配置参数是否修改完毕”的流程图;
图6 是“修改备份配置文件夹中的系统配置参数”的流程图;
图7是采用本发明实施例的掉电保护方法的计算机。
【具体实施方式】
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
实施例一
本实施例提供的掉电保护方法,用于在软件运行过程及掉电重启过程中实现系统配置参数的保护,在软件运行过程中,该方法包括:
110、修改主配置文件夹中的系统配置参数;
例如,由软件的设置项进入系统配置参数修改界面,找到要修改的参数项,在参数项后输入新的参数值,然后点击确定键。
120、判断主配置文件夹中的系统配置参数是否修改完毕;
例如,一种实现方式是:在主配置文件夹中的系统配置参数完毕后发送一个信号,系统通过是否收到该信号来判断主配置文件夹中的系统配置参数是否修改完毕,如果没有收到该信号,则继续修改主配置文件夹中的系统配置参数。
130、如果主配置文件夹中的系统配置参数修改完毕,则修改备份配置文件夹中的系统配置参数。
需要说明的是,主配置文件夹和备份配置文件夹是预先配置的,例如可以是在安装软件的过程中,由软件在计算机的外存储器中创建的。
采用本实施例提供的掉电保护方法,在计算机的外存储器中除了设置主配置文件夹外,还设置了备份配置文件夹,而且备份配置文件夹中系统配置参数的修改必须在主配置文件夹中系统配置参数的修改完成之后。这样如果掉电发生在修改主配置文件夹阶段,则主配置文件夹损坏,备份配置文件夹保存有掉电前的系统配置参数。在掉电后软件的再启动过程中,软件能通过读取备份配置文件夹的系统配置参数启动,而且软件启动后只需要修改掉电前准备修改的那部分系统配置参数就行,而不需要重新修改所有的系统配置参数。如果掉电发生在修改备份配置文件夹阶段,则备份配置文件夹损坏,而主配置文件夹中保存有修改后的系统配置参数。在掉电后软件的再启动过程中,软件能通过读取主配置文件夹中的系统配置参数启动,而且软件启动后不需要再修改系统配置参数。与现有技术相比,本发明提供的方法不需要添加额外的硬件模块,只需要编写一段软件代码(用C ++语言编写的话,代码不会超过500行)就能解决在系统意外掉电时导致软件重新启动失效的问题,成本很低。
实施例二
如图2所示,本实施例涉及在掉电重启过程中的掉电保护方法,该方法具体包括:
240、读取主配置文件夹中的系统配置参数;
250、判断主配置文件夹中的系统配置参数是否读取成功;
260、如果读取主配置文件夹中的系统配置参数成功,则将主配置文件夹中的系统配置参数写入备份配置文件夹中,然后运行软件;
如果掉电发生在修改备份配置文件夹的系统配置参数期间,则主配置文件夹中已经写入了新系统配置参数,而备份配置文件夹被损坏。采用本步骤后,备份配置文件夹中的系统配置参数能够在软件掉电后再次启动过程中与主配置文件夹中的系统配置参数同步,这样在再次软件启动后的后续修改系统配置参数过程中,主配置文件夹和备份配置文件夹中所需要修改的系统配置参数是一致的。
170 如果读取主配置文件夹中的系统配置参数失败,则读取备份配置文件夹中的系统配置参数;
171 判断备份配置文件夹中的系统配置参数是否读取成功;
172 如果读取备份配置文件夹中的系统配置参数失败,则在主配置文件夹中生成默认系统配置参数,然后再次启动软件。
173 如果读取备份配置文件夹中的系统配置参数成功,则将备份配置文件夹中的系统配置参数写入主配置文件夹,然后运行软件;
如果掉电发生在修改主配置文件夹的系统配置参数期间,则备份配置文件夹中存储有掉电前存入的系统配置参数,而主配置文件夹被损坏。采用本步骤后,主配置文件夹中的系统配置参数能够在软件掉电后再次启动过程中与备份配置文件夹中的系统配置参数同步,这样在再次软件启动后的继续掉电前修改系统配置参数过程中,主配置文件夹和备份配置文件夹中所需要修改的系统配置参数是一致的。
采用本实施例提供的掉电保护方法,在计算机的外存储器中除了设置主配置文件夹外,还设置了备份配置文件夹,而且备份配置文件夹中系统配置参数的修改必须在主配置文件夹中系统配置参数的修改完成之后。这样如果掉电发生在修改主配置文件夹阶段,则主配置文件夹损坏,备份配置文件夹保存有掉电前的系统配置参数。在掉电后软件的再启动过程中,软件能通过读取备份配置文件夹的系统配置参数启动,而且软件启动后只需要修改掉电前准备修改的那部分系统配置参数就行,而不需要重新修改所有的系统配置参数。如果掉电发生在修改备份配置文件夹阶段,则备份配置文件夹损坏,而主配置文件夹中保存有修改后的系统配置参数。在掉电后软件的再启动过程中,软件能通过读取主配置文件夹中的系统配置参数启动,而且软件启动后不需要再修改系统配置参数。
实施例三
如图3、4、5和6所示,本实施例主要是针对实施例一的110、120和130步骤做进一步的改进。
如图3所示, “110 修改主配置文件夹中的系统配置参数”进一步包括如下步骤:
111 创建互斥锁和备份动作表;
在软件每次启动过程中,软件都会在计算机的内存中创建互斥锁和空的备份动作表。
112 将互斥锁上锁,以防止其它线程同时访问备份动作表;
113 将新系统配置参数写入主配置文件夹和备份动作表中;
114 将互斥锁解锁。
如图4所示,“113 将新系统配置参数写入主配置文件夹和备份动作表中”进一步包括如下子步骤:
1131 判断备份动作表是否为空;
如果是本次软件启动后第一回修改系统配置参数,则备份动作表是空的。如果是本次软件启动后第N回(N≥2)修改系统配置参数,则备份动作表中会记载前面修改系统配置参数的记录,这样就需要考虑本回修改的系统配置参数是否会与上回修改的系统配置参数相冲突的问题。
1132 如果备份动作表是空的,则将新系统配置参数的参数项和参数值同时写入主配置文件夹和备份动作表;
软件每次启动时都会重新在内存储器中创建一个空的备份动作表,备份动作表是空的也就表明这是本次软件启动后第一回修改系统配置参数,因此可以直接把新系统配置参数直接写入备份动作表中。
1133 如果备份动作表不是空的,则进一步判断备份动作表中是否记录有新系统配置参数的参数项;
由于单个软件的系统配置参数很多,软件启动后,每一回修改的系统配置参数可能相同,也可能不同,对于这两种情形要分别处理。
1134 如果备份动作表中没有新系统配置参数的参数项,则将新系统配置参数的参数项和参数值同时写入主配置文件夹和备份动作表;
对于本回修改的系统配置参数与备份动作表中记载的系统配置参数相同的,则将备份动作表中相应参数项对应的参数值修改为新系统配置参数的参数项对应的参数值。
1135 如果备份动作表中有新系统配置参数的参数项,则将主配置文件夹和备份配置文件夹中相应参数项的参数值修改为新系统配置参数的参数项对应的参数值。
对于本回修改的系统配置参数与备份动作表中记载的系统配置参数不相同的,则将新系统配置参数的参数项和参数值直接写入备份动作表。
如图5所示, “120判断主配置文件夹中的系统配置参数是否修改完毕“进一步包括如下步骤:
121 在开始修改主配置文件夹中的系统配置参数的同时启动计时器;
一般而言,用户在软件的系统配置参数修改界面中按下确定键后,计时器就开始计时。
122 当计时达到N秒时,计时器发出主配置文件夹中的系统配置参数修改完毕的信号。
N秒设置成大于在正常情况下将软件的所有系统配置参数修改完毕所要花费的时间。N的具体数值与软件的系统配置参数个数相关,系统配置参数的个数越多,则N值越大。
如图6所示,“130 如果修改主配置文件夹中的系统配置参数完毕,则修改备份配置文件夹中的系统配置参数”的进一步包括如下步骤:
131 将互斥锁再次上锁,以防止其它线程同时访问备份动作表;
132 按照备份动作表的记载,将新系统配置参数写入备份配置文件夹;
每次修改主配置文件夹中的系统配置参数,都会同时在备份动作表中写入新的系统配置参数,因此只要按照备份动作表中的记载,将新系统配置参数写入备份配置文件夹,就能保证主配置文件夹和备份配置文件夹中的系统配置参数一致。这样在主配置文件夹在再次修改系统配置参数中因掉电而损坏的情况下,备份配置文件夹中能保留有主配置文件夹修改前的系统配置参数。
133 将互斥锁解锁。
采用本实施例提供的掉电保护方法,在计算机的外存储器中除了设置主配置文件夹外,还设置了备份配置文件夹,而且备份配置文件夹中系统配置参数的修改必须在主配置文件夹中系统配置参数的修改完成之后。这样如果掉电发生在修改主配置文件夹阶段,则主配置文件夹损坏,备份配置文件夹保存有掉电前的系统配置参数。在掉电后软件的再启动过程中,软件能通过读取备份配置文件夹的系统配置参数启动,而且软件启动后只需要修改掉电前准备修改的那部分系统配置参数就行,而不需要重新修改所有的系统配置参数。如果掉电发生在修改备份配置文件夹阶段,则备份配置文件夹损坏,而主配置文件夹中保存有修改后的系统配置参数。在掉电后软件的再启动过程中,软件能通过读取主配置文件夹中的系统配置参数启动,而且软件启动后不需要再修改系统配置参数。
实施例四
本实施例提供一种掉电保护装置,包括:第一修改模块,用于在软件运行过程中修改主配置文件夹中的系统配置参数;第一判断模块,用于在软件运行过程中判断主配置文件夹中的系统配置参数是否修改完毕;第二修改模块,用于在软件运行过程中当主配置文件夹系统配置参数修改完毕时,修改备份配置文件夹中的系统配置参数。
该掉电保护装置还包括:第一读取模块,用于在掉电重启过程中读取主配置文件夹中的系统配置参数;第二判断模块,用于在掉电重启过程中判断主配置文件夹中的系统配置参数是否读取成功;第三修改模块,用于在掉电重启过程中当读取主配置文件夹中的系统配置参数成功时,将备份配置文件夹中的系统配置参数修改为主配置文件夹中的系统配置参数;第二读取模块,用于在掉电重启过程中当读取主配置文件夹中的系统配置参数不成功时,读取备份配置文件夹中的系统配置参数。
该掉电保护装置还包括:计时器,用于在开始修改主配置文件夹中的系统配置参数时启动,并在计时达到N秒时,向第一判断模块发出主配置问价夹中的系统配置参数修改完毕的信号。
实施例五:
如图7所示,本发明实施例还提供一种计算机20,该计算机20至少包括处理器210和存储器220,处理器210和存储器220可通过总线230连接,处理器210用于执行前述实施例所描述的掉电保护方法,该方法的相关内容请参考前述实施例的描述,在此不再赘述。
以上所述仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (11)

  1. 一种掉电保护方法,用于在软件运行过程及掉电重启过程中实现系统配置参数的保护,其特征在于,在软件运行过程中,所述方法包括:
    修改预置的主配置文件夹中的系统配置参数;
    判断所述主配置文件夹中的系统配置参数是否修改完毕;
    如果所述主配置文件夹中的系统配置参数修改完毕,则修改预置的备份配置文件夹中的系统配置参数。
  2. 根据权利要求1所述的方法,其特征在于,在掉电重启过程中,所述方法还包括:
    读取所述主配置文件夹中的系统配置参数;
    判断所述主配置文件夹中的系统配置参数是否读取成功;
    如果读取所述主配置文件夹中的系统配置参数成功,则将所述备份配置文件夹的系统配置参数修改为所述主配置文件夹中的系统配置参数;
    如果读取所述主配置文件夹中的系统配置参数不成功,则读取所述备份配置文件夹中的系统配置参数。
  3. 根据权利要求2所述的掉电保护方法,其特征在于,所述读取所述备份配置文件夹中的系统配置参数的步骤包括:
    判断所述备份配置文件夹中的系统配置参数是否读取成功;
    如果读取所述备份配置文件夹中的系统配置参数成功,则将所述备份配置文件夹中的系统配置参数写入所述主配置文件夹;
    如果读取所述备份配置文件夹中的系统配置参数失败,则将所述主配置文件夹中的系统配置参数修改为默认系统配置参数。
  4. 根据权利要求1所述的掉电保护方法,其特征在于,所述修改预置的主配置文件夹中的系统配置参数包括:
    创建互斥锁和备份动作表;
    将所述互斥锁上锁,以防止其它线程同时访问所述备份动作表;
    将新的系统配置参数写入所述主配置文件夹和所述备份动作表中;
    将所述互斥锁解锁。
  5. 根据权利要求4所述的掉电保护方法,其特征在于,所述将新的系统配置参数写入主配置文件夹和备份动作表中的步骤包括:
    判断所述备份动作表是否为空;
    如果所述备份动作表是空的,则将新的系统配置参数的参数项和参数值同时写入所述主配置文件夹和所述备份动作表;
    如果所述备份动作表不是空的,则进一步判断所述备份动作表中是否记录有新的系统配置参数的参数项;
    如果所述备份动作表中没有新的系统配置参数的参数项,则将新的系统配置参数的参数项和参数值同时写入所述主配置文件夹和所述备份动作表;
    如果所述备份动作表中有新的系统配置参数的参数项,则将所述主配置文件夹和所述备份动作表中相应参数项的参数值修改为新的系统配置参数的参数项对应的参数值。
  6. 根据权利要求5所述的掉电保护方法,其特征在于,所述如果所述主配置文件夹中的系统配置参数修改完毕,则修改所述备份配置文件夹中的系统配置参数的步骤包括:
    将所述互斥锁上锁,以防止其它线程同时访问所述备份动作表;
    按照所述备份动作表的记载,将新系统配置参数写入所述备份配置文件夹;
    将所述互斥锁解锁。
  7. 根据权利要求1-6任一项所述的掉电保护方法,其特征在于,所述判断主配置文件夹中的系统配置参数是否修改完毕的步骤包括:
    在开始修改主配置文件夹中的系统配置参数的同时启动计时器;
    当计时达到N秒时,发出主配置文件夹中的系统配置参数修改完毕的信号;其中N为大于0的常数。
  8. 一种掉电保护装置,其特征在于,包括:
    第一修改模块,用于在软件运行过程中修改预置的主配置文件夹中的系统配置参数;
    第一判断模块,用于在软件运行过程中判断所述主配置文件夹中的系统配置参数是否修改完毕;
    第二修改模块,用于在软件运行过程中当所述主配置文件夹的系统配置参数修改完毕后,修改预置的备份配置文件夹中的系统配置参数。
  9. 根据权利要求8所述的掉电保护装置,其特征在于,还包括:
    第一读取模块,用于在掉电重启过程中读取所述主配置文件夹中的系统配置参数;
    第二判断模块,用于在掉电重启过程中判断所述主配置文件夹中的系统配置参数是否读取成功;
    第三修改模块,用于在掉电重启过程中当读取所述主配置文件夹中的系统配置参数成功时,将所述备份配置文件夹中的系统配置参数修改为所述主配置文件夹中的系统配置参数;
    第二读取模块,用于在掉电重启过程中当读取所述主配置文件夹中的系统配置参数不成功时,读取所述备份配置文件夹中的系统配置参数。
  10. 根据权利要求8或9所述的掉电保护装置,其特征在于,还包括:
    计时器,用于在开始修改所述主配置文件夹中的系统配置参数时启动,并在计时达到N秒时,向所述第一判断模块发出所述主配置文件夹中的系统配置参数修改完毕的信号;其中N为大于0的常数。
  11. 一种计算机,其特征在于,所述计算机包括处理器和存储器,所述处理器用于执行如权利要求1-7任一项所述的掉电保护方法。
PCT/CN2016/113683 2016-12-30 2016-12-30 一种掉电保护方法、装置及计算机 WO2018120100A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2016/113683 WO2018120100A1 (zh) 2016-12-30 2016-12-30 一种掉电保护方法、装置及计算机
CN201680086679.8A CN109496299A (zh) 2016-12-30 2016-12-30 一种掉电保护方法、装置及计算机

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/113683 WO2018120100A1 (zh) 2016-12-30 2016-12-30 一种掉电保护方法、装置及计算机

Publications (1)

Publication Number Publication Date
WO2018120100A1 true WO2018120100A1 (zh) 2018-07-05

Family

ID=62707916

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113683 WO2018120100A1 (zh) 2016-12-30 2016-12-30 一种掉电保护方法、装置及计算机

Country Status (2)

Country Link
CN (1) CN109496299A (zh)
WO (1) WO2018120100A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114185606A (zh) * 2021-12-14 2022-03-15 上海华信长安网络科技有限公司 一种基于嵌入式系统提高系统运行可靠性的方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110032A (zh) * 2011-02-23 2011-06-29 杭州海康威视数字技术股份有限公司 一种提高配置文件可靠性的方法及装置
CN104407888A (zh) * 2014-11-12 2015-03-11 苏州科达科技股份有限公司 一种嵌入式设备启动方法及系统
CN104424047A (zh) * 2013-08-20 2015-03-18 研祥智能科技股份有限公司 一种nvram数据恢复方法和装置
CN105955840A (zh) * 2016-01-27 2016-09-21 上海华测导航技术股份有限公司 一种接收配置文件管理方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9530233B2 (en) * 2013-10-10 2016-12-27 Adobe Systems Incorporated Action records associated with editable content objects
CN104598340A (zh) * 2013-11-01 2015-05-06 鸿富锦精密工业(深圳)有限公司 硬件故障的检测系统、电子装置及方法
CN105429788A (zh) * 2015-11-03 2016-03-23 上海斐讯数据通信技术有限公司 一种配置加载方法、系统、及一种路由器

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110032A (zh) * 2011-02-23 2011-06-29 杭州海康威视数字技术股份有限公司 一种提高配置文件可靠性的方法及装置
CN104424047A (zh) * 2013-08-20 2015-03-18 研祥智能科技股份有限公司 一种nvram数据恢复方法和装置
CN104407888A (zh) * 2014-11-12 2015-03-11 苏州科达科技股份有限公司 一种嵌入式设备启动方法及系统
CN105955840A (zh) * 2016-01-27 2016-09-21 上海华测导航技术股份有限公司 一种接收配置文件管理方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114185606A (zh) * 2021-12-14 2022-03-15 上海华信长安网络科技有限公司 一种基于嵌入式系统提高系统运行可靠性的方法和装置
CN114185606B (zh) * 2021-12-14 2023-11-28 上海华信长安网络科技有限公司 一种基于嵌入式系统提高系统运行可靠性的方法和装置

Also Published As

Publication number Publication date
CN109496299A (zh) 2019-03-19

Similar Documents

Publication Publication Date Title
WO2017177769A1 (zh) Ogg 版本部署方法、系统、服务器和存储介质
CN1326042C (zh) 容错计算机系统及其再同步方法和再同步程序
WO2018014582A1 (zh) 保单数据处理方法、装置、服务器和存储介质
WO2012106931A1 (zh) 一种应用程序的内存错误修复方法
WO2013133530A1 (en) Electronic device to restore mbr, method thereof, and computer-readable medium
WO2014015572A1 (zh) 一种Android自动测试跨应用的装置及方法
WO2018233037A1 (zh) 数据库集成测试方法、装置、服务器及存储介质
WO2016045193A1 (zh) 一种文件索引组织及修复的方法及装置
JP2014160483A (ja) 装置、方法、及び、プロセッサ
WO2018120100A1 (zh) 一种掉电保护方法、装置及计算机
WO2018218522A1 (zh) 一种ecu刷写失败后的数据刷新方法及数据刷新装置
WO2017075852A1 (zh) 一种保护mcu工作程序的方法及系统
CN111176887A (zh) MySQL误操作回滚方法、设备及系统
WO2017067292A1 (zh) 一种保证指纹数据稳定的方法、装置及终端
WO2018040177A1 (zh) 一种重新开机的方法及装置
WO2016054858A1 (zh) 一种恢复系统文件索引的方法及装置
WO2020143306A1 (zh) 对象互转方法、装置及存储介质、服务器
CN111177141A (zh) 利用MySQL并行复制恢复数据方法、设备及系统
WO2017185646A1 (zh) 事件提醒方法及系统
TW201525686A (zh) 基板管理控制器存取方法
WO2018209705A1 (zh) 嵌入式系统中管理文件的方法、嵌入式设备及其存储介质
WO2013135047A1 (zh) 实现单板即插即用的方法、单板及系统
JP2005135063A (ja) 情報処理装置及び情報処理装置の時計異常検出プログラム
CN113419676B (zh) 一种数据远程复制方法、系统、存储介质及设备
CN217880293U (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: 16925621

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

Country of ref document: EP

Kind code of ref document: A1