CN113553220A - Embedded system parameter backup method - Google Patents
Embedded system parameter backup method Download PDFInfo
- Publication number
- CN113553220A CN113553220A CN202111111251.3A CN202111111251A CN113553220A CN 113553220 A CN113553220 A CN 113553220A CN 202111111251 A CN202111111251 A CN 202111111251A CN 113553220 A CN113553220 A CN 113553220A
- Authority
- CN
- China
- Prior art keywords
- data
- system parameter
- updating
- backup
- parameter
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention discloses an embedded system parameter backup method, which respectively arranges system parameter data and system parameter backup data for storing configurable system parameters required by system power failure storage and power up recovery on two different sectors of a disk. At least one of the two data is correct during erasing and writing, so that the system can be started and operated normally. In addition, when the system parameters change in the system operation process, the system parameter backup parameters are erased and updated on the premise of ensuring that the system parameter data are correct, so that the safety of the data can be effectively maintained in the repeated restart process of the system, and the system data is prevented from being wrong or lost.
Description
Technical Field
The invention relates to the field of embedded systems, in particular to a parameter backup method of an embedded system.
Background
When the embedded system is at high temperature, high humidity, unstable power supply fluctuation, insufficient voltage load capacity or insufficient battery power, the system is repeatedly powered on and off to restart, and internal parameters of the system may be lost in the restarting process, so that the system returns to factory settings or even data is completely lost, and the system cannot be normally started.
Disclosure of Invention
The invention mainly aims to provide an embedded system parameter backup method capable of protecting system data safety.
The invention provides a method for backing up parameters of an embedded system.A configurable system parameter required by the system for power failure storage and power-on recovery is stored in a structure body, and the structure body also comprises two parameters of the data length and the data check value of the structure body; the backup method comprises the following steps:
the structural body storing the configurable system parameters required by the system for power failure storage and power restoration is respectively stored on two different sectors on the disk; one of the data is used as system parameter data, and the other data is used as system parameter backup data;
after the system is started, reading the system parameter data, verifying the structural body data length of the system parameter data and the data inspection value, and if the verification is successful, sequentially executing a main program; if the verification fails, reading the system parameter backup data, verifying the structure data length and the data check value of the system parameter backup data, and if the verification succeeds, sequentially executing a main program; if the verification fails, starting a system default configuration parameter to ensure that the system is normally started;
in the system operation process, when system parameters change, firstly, erasing and writing updating are carried out on the system parameter data, and erasing and writing results are fed back; if the system parameter data is successfully erased and written, erasing and writing the system parameter backup parameter; and if the system parameter data fails, erasing and updating the system parameter data continuously until the system parameter backup parameter is erased after the system parameter data succeeds, and erasing and updating the system parameter backup parameter on the premise of ensuring that the system parameter data is correct, so that the safety of the data can be effectively maintained in the repeated restarting process of the system, and the system data is prevented from being mistaken or lost.
Preferably, when the system updates the system parameter data and the system parameter backup data in an erasing manner, the system determines whether the erasing update result is correct and then continues the erasing update operation at intervals.
Preferably, the erasure updating operation is continued after one second interval after determining whether the erasure updating result is correct.
Preferably, the erasure updating is directly ended if the erasure updating of the system parameter data fails three times consecutively.
Preferably, the erasure updating is directly ended if the erasure updating of the system parameter backup data fails three times continuously.
The embedded system parameter backup method has the beneficial effects that:
1) the system parameter data and the system parameter backup data are set, so that at least one of the two data is correct during erasing and writing, and the system can be started and operated normally.
2) On the premise of ensuring that the system parameter data is correct, the system parameter backup parameters are erased, written and updated, so that the safety of the data can be effectively maintained in the repeated restarting process of the system, and the system data is prevented from being wrong or lost.
Drawings
Fig. 1 is a flowchart of the embedded system parameter backup method according to the present invention in the case of system startup.
Fig. 2 is a flowchart of the embedded system parameter backup method of the present invention during the system operation process.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1 and fig. 2, an embodiment of the embedded system parameter backup method of the present invention is provided:
a parameter backup method of embedded system, the system parameter of the configurability that the power failure that the system needs is preserved, power-on is replied to store in a structure, the structure also includes two parameters of data length and data check value of the structure; the backup method comprises the following steps:
the mechanism body storing the configurable system parameters for power-down storage and power-up reply required by the system is respectively stored on two different sectors on the disk, and in the embodiment, the two sectors are changed into an A sector and a B sector, wherein the A sector stores system parameter data, and the B sector stores system parameter backup data.
After the system is started, reading system parameter data in the sector A, verifying the length of structural body data in the system parameter data and a data verification value, if the verification is successful, sequentially executing a main program, if the verification is failed, reading system parameter backup data stored in the sector B, similarly verifying the length of the structural body data in the system parameter backup data and the data verification value, and if the verification is successful, sequentially executing the main program; if the verification fails, starting the default configuration parameters of the system to ensure the normal starting of the system.
In the system operation process, when system parameters change, firstly, erasing and writing updating are carried out on system parameter data in the sector A, and an erasing and writing mechanism is fed back to the main control chip; if the system parameter data is successfully erased and updated, the method is used for filtering the erasing failure caused by the abnormal restart of the embedded system easily caused by the fluctuation of the power supply voltage and insufficient load, so that the system parameter backup data in the sector B needs to be erased and updated after one second; if the system parameter data is failed to be erased and updated, the system parameter data is continuously attempted to be erased and updated in the previous three failures until the system parameter data is successfully erased and updated, and the system parameter backup parameters are updated and erased on the premise that the system parameter data is correct, so that the safety of the data can be effectively kept in the repeated restarting process of the system, and the system data is prevented from being mistaken or lost. If the attempt is more than three times or fails, the erasing and writing updating is directly finished and the error is reported. On the premise of successful erasing and writing update of the system parameter data in the A sector, the erasing and writing update is also directly finished when the system parameter backup data in the B sector fails three times continuously.
The embedded system parameter backup method has the beneficial effects that:
1) the system parameter data and the system parameter backup data are set, so that at least one of the two data is correct during erasing and writing, and the system can be started and operated normally.
2) On the premise of ensuring that the system parameter data is correct, the system parameter backup parameters are erased, written and updated, so that the safety of the data can be effectively maintained in the repeated restarting process of the system, and the system data is prevented from being wrong or lost.
The above description is only for the preferred embodiment of the present invention and is not intended to limit the scope of the present invention, and all equivalent structural changes made by using the contents of the present specification and the drawings, or any other related technical fields, are included in the scope of the present invention.
Claims (5)
1. A method for backing up parameters of an embedded system is characterized in that the configurable system parameters of power failure storage and power-on recovery required by the system are stored in a structure body, and the structure body also comprises two parameters of data length and data check value of the structure body; the backup method comprises the following steps:
the structural body storing the configurable system parameters required by the system for power failure storage and power restoration is respectively stored on two different sectors on the disk; one of the data is used as system parameter data, and the other data is used as system parameter backup data;
after the system is started, reading the system parameter data, verifying the structural body data length of the system parameter data and the data inspection value, and if the verification is successful, sequentially executing a main program; if the verification fails, reading the system parameter backup data, verifying the structure data length and the data check value of the system parameter backup data, and if the verification succeeds, sequentially executing a main program; if the verification fails, starting a system default configuration parameter to ensure that the system is normally started;
in the system operation process, when system parameters change, firstly, erasing and writing updating are carried out on the system parameter data, and erasing and writing results are fed back; if the system parameter data is successfully erased and written, erasing and writing the system parameter backup parameter; and if the system parameter data fails, erasing and updating the system parameter data continuously until the system parameter backup parameter is erased after the system parameter data succeeds, and erasing and updating the system parameter backup parameter on the premise of ensuring that the system parameter data is correct, so that the safety of the data can be effectively maintained in the repeated restarting process of the system, and the system data is prevented from being mistaken or lost.
2. The embedded system parameter backup method according to claim 1, wherein when the system updates the system parameter data and the system parameter backup data by erasure, it is determined whether the erasure updating result is correct and then the erasure updating operation is continued at an interval.
3. The embedded system parameter backup method according to claim 2, wherein the erasing and writing updating operation is continued after an interval of one second after determining whether the erasing and writing updating result is correct.
4. The embedded system parameter backup method according to claim 1, wherein the erasure updating is directly ended if the erasure updating of the system parameter data fails three times consecutively.
5. The embedded system parameter backup method according to claim 1, wherein the erasure updating is directly ended if the system parameter backup data fails to be erased and updated three times consecutively.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111111251.3A CN113553220A (en) | 2021-09-23 | 2021-09-23 | Embedded system parameter backup method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111111251.3A CN113553220A (en) | 2021-09-23 | 2021-09-23 | Embedded system parameter backup method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113553220A true CN113553220A (en) | 2021-10-26 |
Family
ID=78106542
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111111251.3A Pending CN113553220A (en) | 2021-09-23 | 2021-09-23 | Embedded system parameter backup method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113553220A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030107918A1 (en) * | 2001-10-31 | 2003-06-12 | Hitachi, Ltd. | Nonvolatile memory device |
CN1821978A (en) * | 2006-01-16 | 2006-08-23 | 深圳创维-Rgb电子有限公司 | Method for operating data in non-volatile storage in embedded system |
US20100027149A1 (en) * | 2008-07-31 | 2010-02-04 | Boonyurn Pirat | Oscillation test for off track write |
CN103914407A (en) * | 2012-12-30 | 2014-07-09 | 航天信息股份有限公司 | Secure digital memory (SD) card power down protection and restoring method and SD card with power down protection function |
CN106844166A (en) * | 2016-12-28 | 2017-06-13 | 上海华为技术有限公司 | A kind of data processing method and device |
CN110442473A (en) * | 2019-07-30 | 2019-11-12 | 深圳市元征科技股份有限公司 | A kind of non-volatile data storage method, apparatus, electronic equipment and medium |
CN111522686A (en) * | 2020-03-27 | 2020-08-11 | 北京经纬恒润科技有限公司 | Nonvolatile data reading and writing method and device |
CN112540725A (en) * | 2020-11-26 | 2021-03-23 | 深圳腾视科技有限公司 | Nonvolatile data storage method, embedded system and storage medium |
-
2021
- 2021-09-23 CN CN202111111251.3A patent/CN113553220A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030107918A1 (en) * | 2001-10-31 | 2003-06-12 | Hitachi, Ltd. | Nonvolatile memory device |
CN1821978A (en) * | 2006-01-16 | 2006-08-23 | 深圳创维-Rgb电子有限公司 | Method for operating data in non-volatile storage in embedded system |
US20100027149A1 (en) * | 2008-07-31 | 2010-02-04 | Boonyurn Pirat | Oscillation test for off track write |
CN103914407A (en) * | 2012-12-30 | 2014-07-09 | 航天信息股份有限公司 | Secure digital memory (SD) card power down protection and restoring method and SD card with power down protection function |
CN106844166A (en) * | 2016-12-28 | 2017-06-13 | 上海华为技术有限公司 | A kind of data processing method and device |
CN110442473A (en) * | 2019-07-30 | 2019-11-12 | 深圳市元征科技股份有限公司 | A kind of non-volatile data storage method, apparatus, electronic equipment and medium |
CN111522686A (en) * | 2020-03-27 | 2020-08-11 | 北京经纬恒润科技有限公司 | Nonvolatile data reading and writing method and device |
CN112540725A (en) * | 2020-11-26 | 2021-03-23 | 深圳腾视科技有限公司 | Nonvolatile data storage method, embedded system and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190287626A1 (en) | Data overwriting device and data overwriting method | |
US7444543B2 (en) | Data control unit capable of correcting boot errors, and corresponding self-correction method | |
US10643668B1 (en) | Power loss data block marking | |
JP5077726B1 (en) | Computer, control method thereof and program | |
JP2002351685A (en) | Data updating method and controller for nonvolatile memory | |
KR20120021210A (en) | Handling errors during device bootup from a non-volatile memory | |
CN102024502B (en) | Flash device testing method and device as well as board and network equipment | |
CN107678420B (en) | engine data online storage method | |
CN105354063B (en) | Program on-line upgrading method and system | |
CN111552592A (en) | Double-backup starting method and system | |
CN111045870B (en) | Method, device and medium for saving and restoring metadata | |
CN101373451A (en) | Computer system for protecting double-basic input /output system program and control method thereof | |
US6483746B2 (en) | Electronic apparatus | |
CN108170456B (en) | Firmware upgrading method and device for electronic equipment | |
CN114490185A (en) | FPGA system parameter backup method | |
JP2010067098A (en) | Information processor, information processing method, and information processing program | |
CN113553220A (en) | Embedded system parameter backup method | |
CN117632301A (en) | MCU double BootROM program starting method | |
CN116361817A (en) | Protection method of ubi file system under Linux | |
US10866867B2 (en) | Method of error correction in a flash memory | |
CN111066002A (en) | Method for determining the integrity of driving data of a control unit of a motor vehicle | |
JP2010117752A (en) | Data holding method of electronic equipment and electronic equipment | |
CN110990052B (en) | Configuration preservation method and device | |
CN111209132A (en) | Embedded system, power failure protection method, electronic device and storage medium | |
CN113434086A (en) | Data storage method and device, nonvolatile memory device and memory |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20211026 |
|
RJ01 | Rejection of invention patent application after publication |