CN111158952B - Method for automatically backing up configuration files by using external storage device - Google Patents
Method for automatically backing up configuration files by using external storage device Download PDFInfo
- Publication number
- CN111158952B CN111158952B CN201911271092.6A CN201911271092A CN111158952B CN 111158952 B CN111158952 B CN 111158952B CN 201911271092 A CN201911271092 A CN 201911271092A CN 111158952 B CN111158952 B CN 111158952B
- Authority
- CN
- China
- Prior art keywords
- external storage
- configuration
- application program
- storage device
- files
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000012544 monitoring process Methods 0.000 claims description 2
- 238000012423 maintenance Methods 0.000 abstract description 6
- 230000000694 effects Effects 0.000 abstract description 2
- 238000013515 script Methods 0.000 description 5
- 238000005192 partition Methods 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
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/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1435—Saving, restoring, recovering or retrying at system level using file system or storage system metadata
-
- 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)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to the technical field of computers, in particular to a method for automatically backing up configuration files by using external storage equipment, which comprises the following steps: judging whether the backup files in the external storage equipment are the same as the configuration files of the application program, if not, copying the backup files in the external storage equipment to the configuration file catalogue of the application program for updating; judging whether a function interface call of the configuration parameters exists, if so, judging whether the backup file in the external storage device is the same as the configuration file of the application program, and if not, copying the configuration file of the application program into the external storage device for re-backup, wherein the invention can realize the following effects: the reliability of configuration files in the running process of the system is ensured, extra configuration workload is brought to engineering personnel due to the loss or inconsistency of the configuration files in the running and maintenance process of the system, the occurrence of secondary debugging is avoided, and the overall running safety and reliability of the electric energy collection system are improved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method for automatically backing up configuration files by using external storage equipment.
Background
Along with the continuous development of the economy in China, the social electricity consumption is also increased, the accuracy and the real-time performance of the electric energy data are both required to be higher by the electric energy acquisition system, the remote electric energy data terminal is used as a key ring for electric energy data acquisition and uploading of the electric power main network, the performance of a hardware platform is also improved greatly, an embedded Linux operating system is generally adopted, and the running quantity of the embedded Linux operating system in a transformer substation and a power plant is also increased. In the process of operation and maintenance, because the operation environments of each transformer substation and each power plant are different, the parameter configuration files of each system operation are also various, and once the system fails, a background maintenance tool cannot be connected with the system, and then a main board needs to be replaced or an initialization program needs to be updated again, and at this time, the operation parameter files of the system need to be reconfigured, generally, an engineer starts reconfiguration from scratch or calls to find out whether the configuration files of the plant are backed up or not. In either method, a lot of time is wasted, and the fact that the backup files on the hands of other people are the latest backup files cannot be guaranteed, so that the workload of secondary debugging is caused, and the operation and maintenance cost is increased.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method for automatically backing up configuration files by using an external storage device.
A method for automatically backing up configuration files using an external storage device, comprising:
judging whether the backup files in the external storage equipment are the same as the configuration files of the application program, if not, copying the backup files in the external storage equipment to the configuration file catalogue of the application program for updating;
judging whether a function interface call of the configuration parameters exists, if so, judging whether the backup file in the external storage device is the same as the configuration file of the application program, and if not, copying the configuration file of the application program into the external storage device for re-backup.
Preferably, the determining whether the backup file in the external storage device is the same as the configuration file of the application program includes:
and obtaining MD5 codes of the backup files in the external storage device and the configuration files of the application program, comparing the MD5 codes of the backup files in the external storage device with the MD5 codes of the configuration files of the application program, judging that the backup files in the external storage device are identical to the configuration files of the application program if the MD5 codes are identical to the MD5 codes of the configuration files of the application program, and judging that the backup files in the external storage device are different from the configuration files of the application program if the MD5 codes are different from the configuration files of the application program.
Preferably, the method further comprises:
and detecting whether the backup file exists in the external storage device, and if the backup file does not exist, copying the configuration file of the application program into the external storage device.
Preferably, the external storage device adopts a TF card or an SD card.
By using the invention, the following effects can be achieved: the reliability of configuration files in the running process of the system is ensured, extra configuration workload is brought to engineering personnel due to the loss or inconsistency of the configuration files in the running and maintenance process of the system, the occurrence of secondary debugging is avoided, and the overall running safety and reliability of the electric energy collection system are improved.
Drawings
The invention will be described in further detail with reference to the drawings and the detailed description.
FIG. 1 is a schematic block diagram of a method for automatically backing up configuration files using an external storage device according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method for automatically backing up configuration files using an external storage device according to an embodiment of the present invention.
Detailed Description
The technical scheme of the present invention will be further described with reference to the accompanying drawings, but the present invention is not limited to these examples.
The basic idea of the invention is to judge whether the backup files in the external storage device are the same as the configuration files of the application program, if not, the backup files in the external storage device are copied to the program configuration file catalog of the application program for updating; judging whether a function interface of the configuration parameters is called, if yes, judging whether the backup files in the external storage equipment are the same as the configuration files of the application program, if not, copying the configuration files of the application program into the external storage equipment for re-backup, thereby realizing automatic updating and re-backup of the external storage equipment, ensuring the reliability of the configuration files in the running process of the system, reducing the extra configuration workload brought to engineering personnel due to the loss or inconsistency of the configuration files in the running process of the system, avoiding the occurrence of secondary debugging, and improving the overall running safety and reliability of the electric energy collection system.
The invention provides a method for automatically backing up configuration files by using external storage equipment, which is shown in figures 1-2 and comprises the following steps:
s1: and judging whether the backup files in the external storage device are the same as the configuration files of the application program, and if not, copying the backup files in the external storage device to the configuration file catalogue of the application program for updating.
Before judging whether the backup file in the external storage device is the same as the configuration file of the application program, the method further comprises the following steps: and detecting whether the backup file exists in the external storage device, if the backup file does not exist, copying the configuration file of the application program into the external storage device, and if the backup file exists, judging whether the backup file in the external storage device is identical with the configuration file of the application program.
In consideration of the use of the new external storage device, the backup file is not stored in the external storage device, so that when the backup file is judged to be not in the external storage device, the configuration file of the application program is only required to be copied into the external storage device, and comparison with the configuration file of the application program is not required.
In this embodiment, the method for determining whether the backup file in the external storage device is the same as the configuration file of the application program is as follows: and obtaining MD5 codes of the backup files in the external storage device and the configuration files of the application program, comparing the MD5 codes of the backup files in the external storage device with the MD5 codes of the configuration files of the application program, judging that the backup files in the external storage device are identical to the configuration files of the application program if the MD5 codes are identical to the MD5 codes of the configuration files of the application program, and judging that the backup files in the external storage device are different from the configuration files of the application program if the MD5 codes are different from the configuration files of the application program.
MD5 code is a 128-bit hash generated by a widely used cryptographic hash function to ensure that the information transfer is completely consistent. The Linux system has a special command MD5sum to calculate the MD5 code of each file, and the MD5 codes generated by different file contents are different.
S2: judging whether a function interface call of the configuration parameters exists, if so, judging whether the backup file in the external storage device is the same as the configuration file of the application program, and if not, copying the configuration file of the application program into the external storage device for re-backup.
In this embodiment, the method for judging whether there is a function interface call of the configuration parameter is: the application program creates a shared message queue, the end of the function of the configuration parameter sends a message to the shared message queue of the application program, and an independent monitoring thread in the application program always monitors the message queue, and the function interface with the configuration parameter is called as long as the message exists.
If so, the configuration file of the application program is possibly updated, so that the backup file in the external storage device needs to be backed up.
The use of the new external storage device is considered, and the backup file is not stored in the external storage device, so that when the backup file is judged to be not in the external storage device, the configuration file of the application program is only required to be copied into the external storage device, and comparison with the configuration file of the application program is not required.
When the backup files are in the external storage device, judging whether the backup files in the external storage device are the same as the configuration files of the application program, and if not, copying the configuration files of the application program into the external storage device for re-backup. In step S2, the method of judging whether the backup file in the external storage device is the same as the configuration file of the application program also adopts the MD5 code comparison method in step S1.
Step S1 realizes automatic update of the configuration file of the application program, and step S2 realizes automatic backup of the external storage device. The external storage device can automatically backup the latest configuration file only if configuration parameters are changed, and when the device fails, the external storage device is pulled out and reinserted on a new main board, and the backup file in the external storage device can be automatically updated to the application program configuration file catalog again after the new main board starts the system. Therefore, the reliability of the configuration file in the running process of the system is ensured, the extra configuration workload is brought to engineering personnel because the configuration file is lost or inconsistent in the running and maintenance process of the system is reduced, the occurrence of secondary debugging is avoided, and the overall running safety and reliability of the electric energy collection system are improved.
In this embodiment, the external storage device may be a TF card, an SD card, or other storage devices. Taking a TF card as an example, the TF card can be automatically identified only by customizing a related driver under a Linux system, the device file name of the TF card can be seen under a file system device directory, the partition table information can be checked by using a partition table checking command fdisk with parameters (-l), then a backup file directory is created in the file system by using an mkdir command, and a mount command is added in a system starting script to mount the TF card to the backup file directory, so that the TF card can be automatically mounted to the backup file directory every time the system is started.
The hardware platform supporting the expansion of the TF card, such as an ARM-Cortex-A9 processor chip, can be compatible with other Cortex series processor technologies, provides a solution with high expansibility, and custom installs a Linux operating system capable of automatically identifying the TF card; 2) Checking TF card equipment files by using commands under a Linux system, creating a catalog of backup configuration files in a file system, and adding commands to mount TF cards to the catalog of the configuration files in a system starting file; 3) Writing two SHELL command scripts, wherein the first function is to automatically update the configuration file from the TF card, the second function is to automatically backup the configuration file to the TF card, the MD5 code detection of the configuration file and the backup file is realized in the script, and the update or backup of the configuration file is judged according to the difference of the MD5 codes; 4) After the system is started, a first script is automatically executed, and whether the configuration file of the system needs to be updated is judged; 5) After the application program runs, the operation interface function of the configuration file is monitored, and the second script is executed when the action of the external operation configuration file is encountered, so that the automatic backup of the configuration file can be realized.
It should be noted that, other types of storage devices also implement automatic backup and update of the configuration file by the method, which is not described in this embodiment.
Those skilled in the art may make various modifications or additions to the described embodiments or substitutions thereof without departing from the spirit of the invention or exceeding the scope of the invention as defined in the accompanying claims.
Claims (4)
1. A method for automatically backing up configuration files using an external storage device, comprising:
judging whether the backup files in the external storage equipment are the same as the configuration files of the application program, if not, copying the backup files in the external storage equipment to the configuration file catalogue of the application program for updating;
judging whether a function interface call of the configuration parameters exists, if so, judging whether the backup file in the external storage device is the same as the configuration file of the application program, and if not, copying the configuration file of the application program into the external storage device for re-backup;
the method for judging whether the function interface with the configuration parameters is called comprises the following steps: the application program creates a shared message queue, the end of the function of the configuration parameter sends a message to the shared message queue of the application program, and an independent monitoring thread in the application program always monitors the message queue, and only if the message exists, the function interface with the configuration parameter is judged to be called.
2. The method for automatically backing up configuration files by using an external storage device according to claim 1, wherein the determining whether the configuration files of the external storage device and the configuration files of the application program are the same comprises:
and obtaining MD5 codes of the backup files in the external storage device and the configuration files of the application program, comparing the MD5 codes of the backup files in the external storage device with the MD5 codes of the configuration files of the application program, judging that the backup files in the external storage device are identical to the configuration files of the application program if the MD5 codes are identical to the MD5 codes of the configuration files of the application program, and judging that the backup files in the external storage device are different from the configuration files of the application program if the MD5 codes are different from the configuration files of the application program.
3. The method for automatically backing up configuration files by using an external storage device according to any one of claims 1 to 2, further comprising:
and detecting whether the backup file exists in the external storage device, and if the backup file does not exist, copying the configuration file of the application program into the external storage device.
4. The method for automatically backing up configuration files by using an external storage device according to claim 1, wherein the external storage device adopts a TF card or an SD card.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911271092.6A CN111158952B (en) | 2019-12-12 | 2019-12-12 | Method for automatically backing up configuration files by using external storage device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911271092.6A CN111158952B (en) | 2019-12-12 | 2019-12-12 | Method for automatically backing up configuration files by using external storage device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111158952A CN111158952A (en) | 2020-05-15 |
CN111158952B true CN111158952B (en) | 2024-03-29 |
Family
ID=70557066
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911271092.6A Active CN111158952B (en) | 2019-12-12 | 2019-12-12 | Method for automatically backing up configuration files by using external storage device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111158952B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112083963B (en) * | 2020-09-04 | 2024-04-16 | 深圳市视美泰技术股份有限公司 | System function configuration method based on external storage medium and related equipment |
CN113204383B (en) * | 2021-05-14 | 2023-04-14 | 山东英信计算机技术有限公司 | Method, device and system for storing BMC configuration parameters and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101576807A (en) * | 2009-06-25 | 2009-11-11 | 用友软件股份有限公司 | Operating method of management software on mobile storage device |
CN105549985A (en) * | 2014-10-29 | 2016-05-04 | 任子行网络技术股份有限公司 | Method and system for enhancing reliability of Linux application system |
CN109254871A (en) * | 2018-08-13 | 2019-01-22 | 国网浙江省电力有限公司 | A kind of online de-redundancy method of efficient virtual-machine data |
CN109408282A (en) * | 2018-08-31 | 2019-03-01 | 深圳市有方科技股份有限公司 | Application Backup restoration methods, equipment and computer readable storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7127480B2 (en) * | 2003-12-04 | 2006-10-24 | International Business Machines Corporation | System, method and program for backing up a computer program |
-
2019
- 2019-12-12 CN CN201911271092.6A patent/CN111158952B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101576807A (en) * | 2009-06-25 | 2009-11-11 | 用友软件股份有限公司 | Operating method of management software on mobile storage device |
CN105549985A (en) * | 2014-10-29 | 2016-05-04 | 任子行网络技术股份有限公司 | Method and system for enhancing reliability of Linux application system |
CN109254871A (en) * | 2018-08-13 | 2019-01-22 | 国网浙江省电力有限公司 | A kind of online de-redundancy method of efficient virtual-machine data |
CN109408282A (en) * | 2018-08-31 | 2019-03-01 | 深圳市有方科技股份有限公司 | Application Backup restoration methods, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111158952A (en) | 2020-05-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101071392B (en) | Method and system for maintaining backup copies of firmware | |
JP5206750B2 (en) | Power supply and program | |
CN103164295B (en) | Enterprise information technology (IT) business virtualization disaster recovery method based on zettabyte file system (ZFS) and kernel-based virtual machine (KVM) kernel virtual underlying system | |
CN111158952B (en) | Method for automatically backing up configuration files by using external storage device | |
CN107741852B (en) | Service deployment method based on cluster software | |
CN104239166A (en) | Method for realizing file backup for running virtual machine | |
CN104951395A (en) | Debugging information processing method and device for embedded system | |
CN109933182A (en) | A kind of server power failure diagnostic method, device and system | |
CN109388526B (en) | Control circuit and reset operation method | |
CN109299064B (en) | Database monitoring method and terminal equipment | |
CN103942128A (en) | Double-computer reinforcing method for high-performance job scheduling management node | |
WO2020224236A1 (en) | Apparatus, method and system for blockchain data processing, and storage medium | |
CN111857777A (en) | System updating method and device based on double-core intelligent electric meter and computer equipment | |
CN104899116A (en) | Data backup method, source server, target server and system | |
CN112261114A (en) | Data backup system and method | |
CN103618634A (en) | Method for automatically finding nodes in cluster | |
CN104516744A (en) | Software updating method and system | |
CN105975333A (en) | Method and device for running control of application programs | |
CN112732412A (en) | Service configuration file processing method and device, storage medium and electronic equipment | |
US7519857B2 (en) | Method, apparatus, and system for a software based business continuity solution for a computing environment | |
CN111488117A (en) | Method, electronic device, and computer-readable medium for managing metadata | |
CN115454515A (en) | System processing method and device and electronic equipment | |
US20160077861A1 (en) | Information processing system, storage apparatus, and program | |
CN108156264B (en) | Data synchronization method oriented to dual-computer redundancy | |
CN111177116B (en) | Intelligent database management platform and management method thereof |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |