CN111158952A - Method for automatically backing up configuration file by using external storage equipment - Google Patents
Method for automatically backing up configuration file by using external storage equipment Download PDFInfo
- Publication number
- CN111158952A CN111158952A CN201911271092.6A CN201911271092A CN111158952A CN 111158952 A CN111158952 A CN 111158952A CN 201911271092 A CN201911271092 A CN 201911271092A CN 111158952 A CN111158952 A CN 111158952A
- Authority
- CN
- China
- Prior art keywords
- external storage
- configuration
- file
- storage device
- backup
- 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 30
- 238000012423 maintenance Methods 0.000 abstract description 7
- 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
- 230000005540 biological transmission Effects 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
- 238000012544 monitoring process Methods 0.000 description 1
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/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 an external storage device, which comprises the following steps: judging whether the backup file in the external storage device is the same as the configuration file of the application program, if not, copying the backup file in the external storage device to a configuration file directory of the application program for updating; judging whether a function interface of the configuration parameters is called, if so, judging whether a backup file in the external storage equipment is the same as a configuration file of the application program, and if not, copying the configuration file of the application program into the external storage equipment for backuping, wherein the invention can realize the following effects: the reliability of the configuration files in the operation process of the system is guaranteed, extra configuration workload brought to engineering personnel due to the fact that the configuration files are lost or inconsistent in the operation and maintenance process of the system is reduced, secondary debugging is avoided, and the overall operation safety and reliability of the electric energy acquisition 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 an external storage device.
Background
Along with the continuous development of economy in China, the electricity consumption of society is increased day by day, the accuracy and the real-time performance of electric energy data are required to be higher by an electric energy acquisition system, a remote electric energy data terminal is used as a key ring for electric energy data acquisition and uploading of a power main grid, the performance of a hardware platform is greatly improved, an embedded Linux operating system is generally adopted, and the running quantity of the remote electric energy data terminal in a transformer substation and a power plant is increased more and more. In the process of operation and maintenance, because the operating environment of each substation and power plant is different, the parameter configuration files for operating each system are also various, and once the system fails, a background maintenance tool cannot be connected to the system, the main board needs to be replaced or the initialization program needs to be upgraded again, at this time, the parameter files for operating the system need to be reconfigured, and generally, either an engineer starts to reconfigure from the beginning or a person or a company who calls for previous configuration inquires whether the configuration files of the plant are backed up. In any method, a lot of time is wasted, and it cannot be guaranteed that backup files of other people are the latest backup files, 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 a configuration file by using an external storage device.
A method for automatically backing up configuration files by using an external storage device comprises the following steps:
judging whether the backup file in the external storage device is the same as the configuration file of the application program, if not, copying the backup file in the external storage device to a configuration file directory of the application program for updating;
and judging whether a function interface of the configuration parameters is called, if so, judging whether the backup file in the external storage equipment 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 equipment for backuping.
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 programs, comparing the MD5 codes of the backup files in the external storage device with the MD5 codes of the configuration files of the application programs, if the MD5 codes of the backup files in the external storage device and the MD5 codes of the configuration files of the application programs are the same, judging that the backup files in the external storage device are the same as the configuration files of the application programs, and if the MD5 codes of the backup files in the external storage device and the MD5 codes of the configuration files of the application programs are different.
Preferably, the method further comprises the following steps:
and detecting whether the external storage equipment has the backup file, and if the external storage equipment does not have the backup file, copying the configuration file of the application program into the external storage equipment.
Preferably, the external storage device adopts a TF card or an SD card.
By using the present invention, the following effects can be achieved: the reliability of the configuration files in the operation process of the system is guaranteed, extra configuration workload brought to engineering personnel due to the fact that the configuration files are lost or inconsistent in the operation and maintenance process of the system is reduced, secondary debugging is avoided, and the overall operation safety and reliability of the electric energy acquisition system are improved.
Drawings
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
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 a configuration file by using an external storage device according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited to these embodiments.
The basic idea of the invention is to judge whether the backup file in the external storage device is the same as the configuration file of the application program, if not, the backup file in the external storage device is copied to the program configuration file directory of the application program for updating; judging whether a function interface of the configuration parameters is called, if so, judging whether a backup file in the external storage equipment is the same as the configuration file of the application program, if not, copying the configuration file of the application program into the external storage equipment for backuping, thereby realizing automatic updating and backuping of the external storage equipment, ensuring the reliability of the configuration file in the operation process of the system, reducing extra configuration workload brought to engineering personnel because the configuration file is lost or inconsistent in the operation and maintenance process of the system, avoiding the occurrence of secondary debugging and improving the safety and reliability of the whole operation of the electric energy acquisition system.
The invention provides a method for automatically backing up configuration files by using an external storage device, which comprises the following steps as shown in figures 1-2:
s1: and 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 backup file in the external storage device to a configuration file directory 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: detecting whether a backup file exists in the external storage equipment, copying the configuration file of the application program into the external storage equipment if the backup file does not exist, and judging whether the backup file in the external storage equipment is the same as the configuration file of the application program if the backup file exists.
In consideration of the use of a new external storage device, the internal part of the external storage device does not store backup files, so that when the external storage device is judged to have no backup files, only the configuration files of the application program need to be copied into the external storage device, and the comparison with the configuration files of the application program is not needed.
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 includes: and obtaining MD5 codes of the backup files in the external storage device and the configuration files of the application programs, comparing the MD5 codes of the backup files in the external storage device with the MD5 codes of the configuration files of the application programs, if the MD5 codes of the backup files in the external storage device and the MD5 codes of the configuration files of the application programs are the same, judging that the backup files in the external storage device are the same as the configuration files of the application programs, and if the MD5 codes of the backup files in the external storage device and the MD5 codes of the configuration files of the application programs are different.
The MD5 code is a 128-bit hash value generated by a widely used cryptographic hash function to ensure the integrity of the information transmission. In the Linux system, a unique command MD5sum is used for calculating the MD5 code of each file, and the MD5 code generated by different file contents is different.
S2: and judging whether a function interface of the configuration parameters is called, if so, judging whether the backup file in the external storage equipment 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 equipment for backuping.
In this embodiment, the method for determining whether there is a function interface call for configuring parameters includes: the application program can create 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, an independent monitoring thread in the application program can monitor the message queue all the time, and the function interface with the configuration parameter is judged to be called as long as the message exists.
If yes, the configuration file of the application program is possible to be updated, so that the backup file in the external storage device needs to be backed up.
In the same way, the use of a new external storage device is considered, and no backup file is stored in the external storage device, so that when the external storage device is judged to have no backup file, only the configuration file of the application program needs to be copied into the external storage device, and the comparison with the configuration file of the application program is not needed.
And when the external storage equipment has the backup file, judging whether the backup file in the external storage equipment 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 equipment for backuping. The method for determining whether the backup file in the external storage device is the same as the configuration file of the application program in step S2 is the same as the MD5 code comparison method in step S1.
Step S1 enables automatic update of the configuration file of the application program, and step S2 enables automatic backup of the external storage device. The external storage device can automatically back up the latest configuration file as long as the configuration parameters are changed, and when the device fails, the external storage device is pulled out and is plugged into a new mainboard again, and the new mainboard can automatically update the backup file in the external storage device to the application program configuration file directory again after the system is started. Therefore, the reliability of the configuration files in the operation 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 operation and maintenance process of the system, the occurrence of secondary debugging is avoided, and the overall operation safety and reliability of the electric energy acquisition system are improved.
In this embodiment, the external storage device may adopt a TF card or an SD card or other storage devices. Taking a TF card as an example, only a relevant drive is customized in a Linux system, the TF card can be automatically identified, the device file name of the TF card can be seen in a file system device directory, a partition table viewing command fdisk with a parameter (-l) can be used for viewing partition table information, then a backup file directory is created in the file system by an mkdir command, a mount command is added in a system startup script to mount the TF card to the backup file directory, and thus the TF card can be automatically mounted to the backup file directory every time the system is started.
The hardware platform supporting TF card expansion, such as an ARM-Cortex-A9 processor chip, can be compatible with other Cortex series processor technologies, and provides a high-expansibility solution, and a Linux operating system capable of automatically identifying TF cards is customized and installed; 2) checking a TF card equipment file by using a command under a Linux system, creating a directory of a backup configuration file in a file system, and adding the command to mount the TF card to the directory of the configuration file in a system starting file; 3) writing two SHELL command scripts, wherein the first function is to automatically update the configuration files from the TF card, the second function is to automatically backup the configuration files into the TF card, MD5 code detection of the configuration files and the backup files is realized in the scripts, and the configuration files are judged to be updated or backed up according to different MD5 codes; 4) after the system is started, the first script is automatically executed, and whether the configuration file of the system needs to be updated or not is judged; 5) after the application program runs, the configuration file operation interface function is monitored, and when the action of operating the configuration file from the outside is met, the second script is executed, 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 configuration files by the method, which is not described in this embodiment.
Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.
Claims (4)
1. A method for automatically backing up configuration files by using an external storage device is characterized by comprising the following steps:
judging whether the backup file in the external storage device is the same as the configuration file of the application program, if not, copying the backup file in the external storage device to a configuration file directory of the application program for updating;
and judging whether a function interface of the configuration parameters is called, if so, judging whether the backup file in the external storage equipment 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 equipment for backuping.
2. The method of claim 1, wherein the determining whether the backup file in the external storage device is the same as the configuration file of the application comprises:
and obtaining MD5 codes of the backup files in the external storage device and the configuration files of the application programs, comparing the MD5 codes of the backup files in the external storage device with the MD5 codes of the configuration files of the application programs, if the MD5 codes of the backup files in the external storage device and the MD5 codes of the configuration files of the application programs are the same, judging that the backup files in the external storage device are the same as the configuration files of the application programs, and if the MD5 codes of the backup files in the external storage device and the MD5 codes of the configuration files of the application programs are different.
3. The method for automatically backing up the configuration file by using the external storage device according to any one of claims 1 to 2, further comprising:
and detecting whether the external storage equipment has the backup file, and if the external storage equipment does not have the backup file, copying the configuration file of the application program into the external storage equipment.
4. The method of claim 1, wherein the external storage device is a TF card or 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 true CN111158952A (en) | 2020-05-15 |
CN111158952B 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) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112083963A (en) * | 2020-09-04 | 2020-12-15 | 深圳市视美泰技术股份有限公司 | System function configuration method based on external storage medium and related equipment |
CN113204383A (en) * | 2021-05-14 | 2021-08-03 | 山东英信计算机技术有限公司 | Method, device and system for storing BMC configuration parameters and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050125464A1 (en) * | 2003-12-04 | 2005-06-09 | International Business Machines Corp. | System, method and program for backing up a computer program |
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 |
-
2019
- 2019-12-12 CN CN201911271092.6A patent/CN111158952B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050125464A1 (en) * | 2003-12-04 | 2005-06-09 | International Business Machines Corp. | System, method and program for backing up a computer program |
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 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112083963A (en) * | 2020-09-04 | 2020-12-15 | 深圳市视美泰技术股份有限公司 | System function configuration method based on external storage medium and related equipment |
CN112083963B (en) * | 2020-09-04 | 2024-04-16 | 深圳市视美泰技术股份有限公司 | System function configuration method based on external storage medium and related equipment |
CN113204383A (en) * | 2021-05-14 | 2021-08-03 | 山东英信计算机技术有限公司 | Method, device and system for storing BMC configuration parameters and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111158952B (en) | 2024-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5842976B2 (en) | Power supply device, program, and control method | |
CN107220100A (en) | One kind exploitation O&M method, device and cloud computing PaaS platform | |
CN109656742B (en) | Node exception handling method and device and storage medium | |
CN111416821A (en) | Internet of things equipment information acquisition method, system and device | |
CN109299064B (en) | Database monitoring method and terminal equipment | |
CN111488181B (en) | Task scheduling method, device, storage medium and server | |
CN111857777B (en) | System updating method and device based on double-core intelligent ammeter and computer equipment | |
CN111158952B (en) | Method for automatically backing up configuration files by using external storage device | |
CN111475515A (en) | Compensation management method and device for failed task, computer equipment and storage medium | |
CN113422692A (en) | Method, device and storage medium for detecting and processing node faults in K8s cluster | |
CN105975333A (en) | Method and device for running control of application programs | |
CN109558209B (en) | Monitoring method for virtual machine | |
CN109766131B (en) | System and method for realizing intelligent automatic software upgrading based on multithreading technology | |
TW202131170A (en) | Firmware corruption recovery | |
CN111352662A (en) | Server starting sequence control method, system, terminal and storage medium | |
CN107766063A (en) | A kind of method and system of batch upgrade software | |
CN116149713A (en) | Program upgrading method and device for all-level equipment under tree-type heterogeneous network | |
CN115454515A (en) | System processing method and device and electronic equipment | |
CN110427280B (en) | Cache management method, system, computer equipment and storage medium | |
CN111177116B (en) | Intelligent database management platform and management method thereof | |
CN113110955B (en) | System disk repair method, storage medium and device | |
CN111354178B (en) | Remote control method, system, terminal and storage medium for Lora monitoring equipment | |
CN117234606B (en) | BIOS configuration data synchronization method and device | |
Zhang et al. | A Scheme and Implementation of Automatic Deployment of Multilingual Industrial Mechanism Model Based on OpenStack | |
Liu et al. | A dual-core embedded device security upgrade solution for ARM-Linux and microcontroller integration |
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 |