CN114003436A - Software backup method and device - Google Patents

Software backup method and device Download PDF

Info

Publication number
CN114003436A
CN114003436A CN202111282792.2A CN202111282792A CN114003436A CN 114003436 A CN114003436 A CN 114003436A CN 202111282792 A CN202111282792 A CN 202111282792A CN 114003436 A CN114003436 A CN 114003436A
Authority
CN
China
Prior art keywords
backup
main system
directory
files
main
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
Application number
CN202111282792.2A
Other languages
Chinese (zh)
Inventor
刘彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
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 Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202111282792.2A priority Critical patent/CN114003436A/en
Publication of CN114003436A publication Critical patent/CN114003436A/en
Pending legal-status Critical Current

Links

Images

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
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • 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
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure relates to a software backup method and device, the method comprising: when the main system fails, a backup system pre-stored in the safety equipment is obtained; wherein the backup system includes only one executable restore command; after the safety equipment is started, a backup system is used for carrying out file recovery on a main system with a fault, so that the main system is recovered to a factory state; and starting the operating system by using the main system which is restored to the factory state. The embodiment of the disclosure effectively improves the problems and the defects of the existing backup system, enables the backup system to have complete backup capability, ensures the safety and the reliability of the backup system, and is not damaged or interfered.

Description

Software backup method and device
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a software backup method and apparatus.
Background
The safety equipment is provided with a backup system, namely when the main system software cannot be started due to some reason, the main system software can be entered into the backup system to be updated and replaced, or the backup system is directly used for working, so that the safety of the system can be guaranteed.
The security device usually has two backup systems, namely a complete system form and a small system form. However, for a backup system in a complete system form, two mutually independent and parallel systems exist in a safety device, which is easy to cause confusion of users, because only one part of hardware resources and data exists, the backup system can affect a main system in different degrees in working and using, and meanwhile, the backup system also has the hidden trouble that the backup system cannot work due to self upgrading or configuration parameter change, thereby losing the meaning of the backup system. For a backup system in a small system form, although a main system software error can be repaired through upgrading, the system cannot be started due to configuration file or a certain knowledge base error, and the backup system does not have the complete capability of the backup system.
Therefore, the complete system and the small system have disadvantages in terms of software backup in the security device, and a better backup scheme is lacking at present.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present disclosure provides a software backup method and apparatus.
The present disclosure provides a software backup method, including:
when the main system fails, a backup system pre-stored in the safety equipment is obtained; wherein the backup system includes only one executable restore command;
after the safety equipment is started, the backup system is used for recovering files of the main system with faults, so that the main system is recovered to a factory state;
and starting the operating system by using the main system which is restored to the factory state.
Optionally, the performing, by using the backup system, file recovery on the primary system that has a failure includes:
copying the license file in the main system directory into a temporary directory for storage;
deleting all files in the main system directory;
expanding and copying a system software compressed package which is stored in advance in the backup system into the main system directory;
checking whether the files in the main system directory are successfully and correctly copied one by one;
if so, copying the license file in the temporary directory into the main system directory.
Optionally, the method further includes: and deleting the files which are not successfully copied and are correct in the main system directory.
Optionally, in the process of performing file recovery on the failed main system by using the backup system, the recovered files at least include: software program files, factory configuration files and a dependent knowledge base.
Optionally, the backup system accesses the security device through a serial port of the security device.
Optionally, the fault occurring in the main system includes: the host system cannot boot or log in.
The present disclosure also provides a software backup apparatus, including:
the acquisition module is used for acquiring a backup system prestored in the safety equipment when the main system fails; wherein the backup system includes only one executable restore command;
the recovery module is used for recovering the content of the main system with the fault by using the backup system after the safety equipment is started, so that the main system is recovered to a factory state;
and the starting module is used for starting the operating system by using the main system which is restored to the factory state.
Optionally, the recovery module includes:
the storage unit is used for copying the license file in the main system directory into a temporary directory for storage;
a clearing unit, configured to delete all files in the main system directory;
the first copying unit is used for expanding and copying a system software compressed package which is stored in advance in the backup system into the main system directory;
the checking unit is used for checking whether the files in the main system directory are successfully and correctly copied one by one;
a second copying unit configured to copy the license file in the temporary directory into the main system directory in a case of yes.
Optionally, the emptying unit is further configured to: and deleting the files which are not successfully copied and are correct in the main system directory.
Optionally, in the process that the recovery module uses the backup system to recover the file of the failed main system, the recovered file at least includes: software program files, factory configuration files and a dependent knowledge base.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the embodiment of the disclosure provides a software backup method and a device, wherein the method comprises the following steps: when the main system fails, a backup system pre-stored in the safety equipment is obtained; wherein the backup system includes only one executable restore command; after the safety equipment is started, a backup system is used for carrying out file recovery on a main system with a fault, so that the main system is recovered to a factory state; and starting the operating system by using the main system which is restored to the factory state. The embodiment of the disclosure effectively improves the problems and the defects of the existing backup system, enables the backup system to have complete backup capability, ensures the safety and the reliability of the backup system, and is not damaged or interfered.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a flowchart of a software backup method according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a file recovery method according to an embodiment of the disclosure;
fig. 3 is a block diagram of a software backup device according to an embodiment of the disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
The security device usually has two backup systems, namely a complete system form and a small system form. The complete system is completely the same as the main system, has all functions of the main system and can work independently; the small system has only one upgrading function and is used for upgrading the main system software and repairing the main system software error to restore the normal operation of the system, and the small system has no other functions and cannot work independently. However, for a backup system in a complete system form, confusion of user use is easily caused, the main system is affected to different degrees in working use, and meanwhile, the backup system has the hidden danger that the backup system cannot work due to self upgrading or configuration parameter change, so that the meaning of the backup system is lost. For a backup system in a small system form, the system cannot be started due to configuration file or a certain knowledge base error, and the backup system does not have the complete capability of the backup system. Therefore, in terms of software backup in the security device, a better backup scheme capable of taking both backup capability and security into consideration is lacking at present. Based on this, the embodiment of the disclosure provides a software backup method and device.
Referring to a flowchart of a software backup method shown in fig. 1, the method may be applied to a security device, and the software backup method provided in this embodiment includes the following steps:
step S1, when the primary system fails, a backup system pre-stored in the security device is obtained. Wherein the backup system includes only one executable restore command.
In this embodiment, the backup system is only used when the main system of the safety device fails, and the failure of the main system includes: the main system can not start, log in, forget that the password of the administrator can not enter the system, and cause any faults that the main system can not start to work normally, such as program error, configuration error and other dependence deficiency. The backup system is used and needs to be selected to enter when the system is loaded, and the backup system in the embodiment accesses the safety device through the serial port of the safety device.
And starting or restarting the safety equipment under the condition that the backup system is connected with the safety equipment through the serial port.
Step S2, after the security device is started, the backup system is used to perform file recovery on the failed main system, so that the main system is restored to a factory state.
In practical application, after the security device is started, prompt information for entering the main system or the backup system is displayed on the display interface. When the selection operation of the user for the prompt information is not monitored, that is, the user does not select to enter the main system or the backup system, the security system defaults to enter the main system after the preset monitoring time duration is reached. And under the condition that the selection operation of the user for the prompt information is monitored, entering a main system or a backup system selected by the user according to the selection operation. It will be appreciated that in the event of a failure of the primary system, the selection operation is an operation to select entry into the backup system.
After entering the backup system, only one recovery command can be executed by the backup system, and other operations are not allowed to be carried out. Executing the recovery command, and performing file recovery on the failed main system by using the backup system, wherein in the process, the recovered files at least include but are not limited to: software program files, factory configuration files and dependent knowledge base. And restoring the file of the main system to restore the main system to a factory state.
For easy understanding, as shown in fig. 2, the present embodiment provides a specific method for performing file recovery on a failed primary system by using a backup system, including the following steps:
in step S201, the license file in the main system directory is copied to the temporary directory for storage. Since the license file is generated by registration after the secure device leaves the factory, the present embodiment copies the license file to the temporary directory and retains it, not in the restored file described above. Subsequently, upon recovery of the license file, the license file in the temporary directory may be copied to the main system directory.
In step S202, all files in the main system directory are deleted. And deleting all files in the main system directory, namely emptying the main system directory, wherein the main system is not existed after the step is completed.
In step S203, the system software compressed package in the pre-saved and backup system is expanded and copied into the main system directory. Specifically, a system software compressed package pre-stored in the backup system at the time of factory is used, and is expanded and copied in a main system directory, and the file contents in the system software compressed package include all the files to be restored, such as the software program files, the configuration files at the time of factory, and the dependent knowledge base.
Step S204, checking whether the files in the main system directory are successfully and correctly copied one by one.
Specifically, each file in the main system directory can be used as a current file one by one, and the current file is checked to ensure that the current file is copied successfully and correctly. If it is verified that the current file is not copied successfully and correctly, step S202 is performed, that is, the file that is not copied successfully and correctly in the main system directory is deleted. If the current file copy is verified to be successful and correct, the following step S205 is performed.
In step S205, the license file in the temporary directory is copied into the main system directory.
When the license file in the temporary directory is copied into the main system directory, the main system is reestablished, and the main system is restored to the system in a factory state.
After the failed main system is restored to the factory state according to the above steps, the following step S3 is executed.
In step S3, the operating system is started up with the main system restored to the factory state.
Thus, a complete software backup recovery process is completed.
In summary, the software backup method provided in the embodiment of the present disclosure includes: when the main system fails, the acquired backup system is used for carrying out file recovery on the failed main system, and then the main system which is recovered to the factory state is used for starting the operating system. In the technical scheme, the backup system only has one recovery command for recovering the main system to the factory state, and other operations are not allowed, so that the backup system is not allowed to be upgraded or updated, and the safety and reliability of the backup system are ensured. Meanwhile, the backup system has complete backup capability, and when any fault occurs in the main system, the backup system can be used for file recovery without returning to a factory for processing. Therefore, the software backup method provided by the embodiment effectively improves the problems and the defects of the existing backup system, so that the backup system can have complete backup capability, and the software backup method can ensure the safety and the reliability of the backup system and is not damaged or interfered.
According to the software backup method provided by the above embodiment, the embodiment of the present disclosure provides a software backup apparatus, as shown in fig. 3, the apparatus includes the following modules.
An obtaining module 301, configured to obtain a backup system pre-stored in the security device when the primary system fails; wherein the backup system includes only one executable restore command;
a recovery module 302, configured to, after the security device is started, perform content recovery on the main system that has a failure by using the backup system, so that the main system is recovered to a factory state;
a starting module 303, configured to start the operating system by using the main system restored to the factory state.
In one embodiment, the recovery module 302 includes:
the storage unit is used for copying the license file in the main system directory into a temporary directory for storage;
a clearing unit, configured to delete all files in the main system directory;
the first copying unit is used for expanding and copying a system software compressed package which is stored in advance in the backup system into the main system directory;
the checking unit is used for checking whether the files in the main system directory are successfully and correctly copied one by one;
a second copying unit configured to copy the license file in the temporary directory into the main system directory in a case of yes.
In an embodiment, the emptying unit is further configured to: and deleting the files which are not successfully copied and are correct in the main system directory.
In an embodiment, during the process of recovering the file of the primary system with the backup system, the recovery module 302 recovers the file of the primary system with the failure, where the recovered file at least includes: software program files, factory configuration files and a dependent knowledge base.
The device provided by the embodiment has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 4, the electronic device 400 includes one or more processors 401 and memory 402.
The processor 401 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.
Memory 402 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by processor 401 to implement the software backup method of the embodiments of the present disclosure described above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 400 may further include: an input device 403 and an output device 404, which are interconnected by a bus system and/or other form of connection mechanism (not shown). The input device 403 may also include, for example, a keyboard, a mouse, and the like.
The output device 404 may output various information to the outside, including the determined distance information, direction information, and the like. The output devices 404 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device 400 relevant to the present disclosure are shown in fig. 4, omitting components such as buses, input/output interfaces, and the like. In addition, electronic device 400 may include any other suitable components depending on the particular application.
Further, the present embodiment also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is used for executing the software backup method.
The software backup method, apparatus, electronic device and computer program product of medium provided by the embodiments of the present disclosure include a computer-readable storage medium storing program codes, where instructions included in the program codes may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for software backup, comprising:
when the main system fails, a backup system pre-stored in the safety equipment is obtained; wherein the backup system includes only one executable restore command;
after the safety equipment is started, the backup system is used for recovering files of the main system with faults, so that the main system is recovered to a factory state;
and starting the operating system by using the main system which is restored to the factory state.
2. The method of claim 1, wherein the performing, with the backup system, a file recovery on the failed primary system comprises:
copying the license file in the main system directory into a temporary directory for storage;
deleting all files in the main system directory;
expanding and copying a system software compressed package which is stored in advance in the backup system into the main system directory;
checking whether the files in the main system directory are successfully and correctly copied one by one;
if so, copying the license file in the temporary directory into the main system directory.
3. The method of claim 2, further comprising:
and deleting the files which are not successfully copied and are correct in the main system directory.
4. The method of claim 1, wherein during the file recovery of the failed primary system using the backup system, the recovered files comprise at least: software program files, factory configuration files and a dependent knowledge base.
5. The method of claim 1, wherein the backup system accesses the secure device through a serial port of the secure device.
6. The method of claim 1, wherein the failure of the primary system comprises: the host system cannot boot or log in.
7. A software backup apparatus, comprising:
the acquisition module is used for acquiring a backup system prestored in the safety equipment when the main system fails; wherein the backup system includes only one executable restore command;
the recovery module is used for recovering the content of the main system with the fault by using the backup system after the safety equipment is started, so that the main system is recovered to a factory state;
and the starting module is used for starting the operating system by using the main system which is restored to the factory state.
8. The apparatus of claim 7, wherein the recovery module comprises:
the storage unit is used for copying the license file in the main system directory into a temporary directory for storage;
a clearing unit, configured to delete all files in the main system directory;
the first copying unit is used for expanding and copying a system software compressed package which is stored in advance in the backup system into the main system directory;
the checking unit is used for checking whether the files in the main system directory are successfully and correctly copied one by one;
a second copying unit configured to copy the license file in the temporary directory into the main system directory in a case of yes.
9. The apparatus of claim 8, wherein the emptying unit is further configured to:
and deleting the files which are not successfully copied and are correct in the main system directory.
10. The apparatus of claim 7, wherein the recovery module, during the file recovery of the failed primary system by the backup system, recovers the file at least comprising: software program files, factory configuration files and a dependent knowledge base.
CN202111282792.2A 2021-11-01 2021-11-01 Software backup method and device Pending CN114003436A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111282792.2A CN114003436A (en) 2021-11-01 2021-11-01 Software backup method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111282792.2A CN114003436A (en) 2021-11-01 2021-11-01 Software backup method and device

Publications (1)

Publication Number Publication Date
CN114003436A true CN114003436A (en) 2022-02-01

Family

ID=79926110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111282792.2A Pending CN114003436A (en) 2021-11-01 2021-11-01 Software backup method and device

Country Status (1)

Country Link
CN (1) CN114003436A (en)

Similar Documents

Publication Publication Date Title
RU2461053C2 (en) Self-controlled processing device
US20150089479A1 (en) Method for pre-testing software compatibility and system thereof
CN106951345B (en) Consistency test method and device for disk data of virtual machine
US20200364114A1 (en) Node Down Recovery Method and Apparatus, Electronic Device, and Storage Medium
KR100758292B1 (en) A method for renovating the computer operating system
US20160132420A1 (en) Backup method, pre-testing method for environment updating and system thereof
CN106775610B (en) Electronic equipment starting method and electronic equipment
CN107818029B (en) Automatic test method for cloud hard disk data recovery consistency
CN109032838B (en) Automatic verification method for consistency of backup and recovery data of virtual machine
WO2001040944A2 (en) Method and system for recovery infrastructure for computer systems
CN108345464A (en) A kind of the startup method and Android vehicle device of Android system
CN113032183A (en) System management method, device, computer equipment and storage medium
CN114676118B (en) Database switching method, device, equipment and storage medium
CN114003436A (en) Software backup method and device
CN115509815A (en) Method and device for protecting data in server
JP2005284902A (en) Terminal device, control method and control program thereof, host device, control method and control program thereof, and method, system, and program for remote updating
CN112882871B (en) Host conflict detection method, device, equipment and storage medium
CN113127883B (en) Locking method, device, equipment and medium for platform firmware protection recovery
KR102221593B1 (en) System for maintaining the installation envoronment of computer terminals
CN111427718B (en) File backup method, file recovery method and file recovery device
CN111783162B (en) Data protection implementation method and device and computer equipment
CN111897583A (en) Equipment starting method and embedded equipment
CN112579358B (en) Backup point detection method, device, equipment and storage medium
CN113127044A (en) BMC upgrading method and device and related components
CN111106947B (en) Node downtime repairing method and device, electronic equipment and readable storage medium

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