Backup and recovery system for substation equipment software system based on LVM snapshot
By using LVM snapshot management tools and liveCD recovery tools, rapid backup and recovery of intelligent substation equipment software systems are achieved, solving the problem of rapid recovery in the event of equipment failure and ensuring stable power supply from the power grid.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING LINX SOFTWARE CORP
- Filing Date
- 2022-04-18
- Publication Date
- 2026-07-03
AI Technical Summary
When an unrecoverable software failure occurs in a smart substation, on-site personnel are unable to quickly restore the equipment to normal function, resulting in the equipment being unable to operate normally for an extended period and affecting the stable power supply of the power grid.
The backup and recovery system based on LVM snapshots uses LVM partitioning components, snapshot management tools, bootloaders, and liveCD recovery tools to back up and restore the software system of substation equipment. It supports command line and graphical interface operation and can boot into the liveCD environment for snapshot recovery when the equipment fails to start normally.
It enables standalone system backup and recovery without the need for additional equipment. It is easy to operate, has a fast backup speed, and allows on-site personnel to quickly restore the equipment to normal status, ensuring stable power supply and safe production.
Smart Images

Figure CN114780291B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid substation equipment technology, and in particular to a backup and recovery system, method, electronic device and storage medium for substation equipment software system based on LVM snapshots. Background Technology
[0002] Many smart substations are located in remote mountainous areas with poor transportation. When irreversible software failures occur in the station control equipment, on-site personnel often lack computer skills or expertise. Only by sending technicians to the site to reinstall the system and equipment software can normal functionality be restored. Due to the inconvenient transportation, each round trip for technicians takes a considerable amount of time. This not only prevents the faulty equipment from operating normally for an extended period but also affects the stable power supply from the power grid.
[0003] Substation users typically want to restore equipment to normal operating condition as quickly as possible. Currently, the main methods for achieving system restoration include the following:
[0004] 1. First, use an external storage device to back up the system, and then restore the system from the backup in case of a failure. This method requires the purchase of additional storage devices and is inconvenient to use.
[0005] 2. Using dedicated hardware to achieve system restore function. Some hard drive protection cards will set the hard drive to read-only protection state. After that, all write operations on the hard drive will be rewritten to a temporary data area. Then, when the system restarts, this temporary data area is discarded, so the system state can be restored. The main problem with this method is that it is not flexible. It can only restore to one state and cannot achieve multiple backups and multiple restores. It is only suitable for special occasions such as internet cafes.
[0006] 3. Network backup and restore can be achieved using dedicated software and backup servers on a local area network. However, equipment at the substation site operates as a standalone unit, which is subject to limitations. Summary of the Invention
[0007] This invention provides a backup and recovery system, method, electronic device, and storage medium for substation equipment software systems based on LVM snapshots. Based on LVM (Logical Volume Manager) snapshots, it enables backup and recovery of software systems for intelligent substation equipment.
[0008] In a first aspect, embodiments of the present invention provide a backup and recovery system for a substation equipment software system based on LVM snapshots, the backup and recovery system comprising:
[0009] The LVM partitioning component creates LVM partitions on the hard disk using the LVM thin pool format in the LVM partitioning component, and formats the partitions into the required file system format.
[0010] A snapshot management tool is used to back up the existing system state and to recover corrupted files.
[0011] The bootloader and liveCD recovery tool, bootloader, display a list of snapshots on the LVM partition, start the liveCD to execute the snapshot management tool, and restore the LVM partition through the snapshot selected in the snapshot management tool.
[0012] As one possible implementation of the present invention, the root partition of the software system is built on an LVM partition; the liveCD is started to execute the snapshot management tool, and the damaged root partition is restored by the snapshot selected in the snapshot management tool.
[0013] As one possible implementation of the present invention, the LVM partitioning component creates LVM logical volume partitions on the hard disk using the LVM thin pool format, and formats the created LVM logical volume partitions into the required file system.
[0014] As one possible implementation of the present invention, the snapshot management tool has a command-line interface and a graphical interface, which are used to perform operations such as creating, viewing, merging, deleting and restoring snapshots.
[0015] Secondly, embodiments of the present invention provide a backup and recovery method for a substation equipment software system based on LVM snapshots, the backup and recovery method comprising:
[0016] Using the LVM partitioning component of the system installation program, an LVM partition is created, and the root partition of the software system is created on the LVM partition; then the LVM partition is formatted into the required file system format, and the operating system and device software are installed;
[0017] Use snapshot management tools to back up the existing system state;
[0018] If the substation equipment can start normally, perform file recovery and partition recovery operations using the backup management tool to restore the system to its previous normal operating state. If the substation equipment cannot start normally, restart the equipment to enter the bootloader. In the bootloader interface, select the snapshot to be restored, and then boot into the liveCD runtime environment. Start the liveCD to execute the snapshot management tool and restore the damaged root partition using the selected snapshot.
[0019] As one possible implementation of the present invention, after selecting a snapshot, the specified snapshot is mounted to a temporary directory using a snapshot management tool. By comparing the differences between the temporary directory and the LVM partition mount directory, the files with differences are displayed in a list format.
[0020] Copy the file with the same name from the specified snapshot to the directory mounted on the LVM partition to restore the file.
[0021] As one possible implementation of the present invention, if the substation equipment can start normally and restore the LVM partition, it can be achieved by implementing the following steps:
[0022] Launch the snapshot management tool;
[0023] Select the snapshot you want to restore from the snapshot management tool;
[0024] The snapshot management tool is used to merge the snapshot and LVM partition that need to be restored, so that the LVM partition is restored to the snapshot state.
[0025] Thirdly, embodiments of the present invention provide an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method described in the second aspect.
[0026] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the second aspect.
[0027] Beneficial effects
[0028] This invention provides a backup and recovery system, method, electronic device, and storage medium for substation equipment software systems based on LVM snapshots. The backup and recovery system includes: an LVM partitioning component, which creates LVM partitions on the hard disk using the LVM thin pool format and formats the partitions into the required file system format; a snapshot management tool for backing up the existing system state and recovering corrupted files; and a bootloader and liveCD recovery tool. The bootloader displays a list of snapshots on the LVM partition, and the liveCD is launched to execute the snapshot management tool, restoring the LVM partition using the selected snapshot. Based on LVM (Logical Volume Manager) snapshots, this invention enables backup and recovery of software systems for intelligent substation equipment. Compared with existing technologies, the advantages of this invention are: 1. Pure software implementation, requiring no additional backup equipment to achieve backup and recovery functions for a single system. 2. Fast backup speed, with minimal impact on the production and operation of substation equipment. 3. Simple operation; even personnel at the intelligent substation site without computer skills can quickly restore the equipment to normal operating status through simple operations when software failures occur. This is of positive significance for ensuring stable power supply and safe production in the power grid.
[0029] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0030] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements.
[0031] Appendix Figure 1 This is a schematic diagram of the backup and recovery structure of a substation equipment software system based on LVM snapshots according to an embodiment of the present invention;
[0032] Appendix Figure 2 This is a flowchart illustrating a backup and recovery method for a substation equipment software system based on LVM snapshots, according to an embodiment of the present invention.
[0033] Appendix Figure 3 This is a flowchart of the LVM partitioning process according to an embodiment of the present invention;
[0034] Appendix Figure 4 This is a system backup flowchart according to an embodiment of the present invention;
[0035] Appendix Figure 5This is a system recovery flowchart according to an embodiment of the present invention;
[0036] Appendix Figure 6 A structural diagram of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation
[0037] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.
[0038] It should be noted that the embodiments of the present invention are described only to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention.
[0039] This invention provides a backup and recovery system for substation equipment software systems based on LVM snapshots. LVM snapshots can restore an LVM partition to its state at the time the snapshot was created. Therefore, as long as the substation equipment's software system is installed on an LVM partition, the backup and recovery of the equipment software system's state can be achieved using the LVM snapshot mechanism. (Appendix) Figure 1 This is a schematic diagram of the backup and recovery structure of a substation equipment software system based on LVM snapshots according to an embodiment of the present invention; specifically, as shown... Figure 1 As shown, the system includes:
[0040] LVM partition component 1 creates an LVM partition on the hard disk using the LVM thin pool format in the LVM partition component, and formats the partition into the required file system format.
[0041] Snapshot Management Tool 2 is used to back up the existing substation equipment software system status. It also helps restore corrupted files. The tool has both a command-line interface and a graphical interface for creating, viewing, merging, deleting, and restoring snapshots. If the equipment can still boot into the system normally, the snapshot management tool can be used to restore individual corrupted files or the entire snapshot backup.
[0042] The bootloader and liveCD recovery tool 3, booterloader, display a list of snapshots on the LVM partition, and launch the liveCD to execute the snapshot management tool. The LVM partition is then restored using a snapshot selected by the snapshot management tool. When substation equipment fails to boot the software system normally, the bootloader can guide the user into the liveCD's runtime environment to perform system recovery operations. Booterloader can display a list of snapshots on the LVM partition in a menu format; after selecting a snapshot, the user can restore the specified partition. Since the software system on the root partition is corrupted, the runtime environment on the root partition cannot be used. Therefore, the snapshot management tool requires a runtime environment independent of the root partition to run the recovery tool. The liveCD in this invention integrates a minimal system runtime environment and an LVM snapshot management tool; even if all files on the root partition are deleted using the liveCD, the entire root partition can still be successfully restored.
[0043] This embodiment provides a backup and recovery system for substation equipment software systems based on LVM snapshots. The backup and recovery system includes: an LVM partitioning component, which creates LVM partitions on the hard drive using the LVM thin pool format within the LVM partitioning component and formats the partitions into the required file system format; a snapshot management tool, used to back up the existing system state and also to recover corrupted files; and a bootloader and liveCD recovery tool. The bootloader displays a list of snapshots on the LVM partition, and the liveCD is launched to execute the snapshot management tool, restoring the LVM partition using the selected snapshot from the snapshot management tool. Based on LVM (Logical Volume Manager) snapshots, this embodiment achieves backup and recovery of software systems for intelligent substation equipment. Compared with existing technical solutions, the advantages of this embodiment are: 1. Pure software implementation, requiring no additional backup equipment to achieve backup and recovery functions for a single system. 2. Fast backup speed, with minimal impact on the production and operation of substation equipment. 3. Simple operation; even personnel at the intelligent substation site without computer skills can quickly restore the equipment to its normal operating state through simple operations when software failures occur. This is of positive significance for ensuring stable power supply and safe production in the power grid.
[0044] In this embodiment, LVM snapshots are used as the backup and recovery mechanism, which is compatible with various file systems such as ext2 / ext3 / ext4, xfs, fat, etc., without affecting the functionality and extended attributes of files. When installing substation equipment software systems, the hard disk is partitioned using the LVM thin pool format. Fixed-size LVM snapshots are prone to the problem of becoming unusable when the partition is full. Using LVM thin pools to manage LVM snapshots can avoid this problem, greatly increasing the practicality of the present invention.
[0045] Furthermore, this invention requires no external equipment and can complete backup and recovery operations on a single machine. Multiple snapshot backups can be performed, and any one of the snapshots can be specified for system recovery. Backup operations are achieved by creating LVM snapshots of partitions. Backup speed is fast, and the impact on the use of substation equipment is minimal.
[0046] When restoring the system, you can restore individual files or entire partitions. If the root file system is completely corrupted and cannot boot normally, you can use the bootloader to enter a liveCD runtime environment to restore the entire root file system.
[0047] In some embodiments, the root partition of the software system is built on an LVM partition; the liveCD is started to execute the snapshot management tool, and the corrupted root partition is restored using the snapshot selected in the snapshot management tool. The LVM partitioning component in the system installer requires partitioning the hard drive in LVM format and using the LVM snapshot function to back up and restore the system. This is because the operating system's root partition also needs to be backed up. Therefore, during system installation, the hard drive is partitioned using the LVM thin pool format, the created LVM logical volume partition is formatted to the required file system, and the software system's root partition is also built on an LVM partition. If the user finds the system abnormal after modifying the device software system, as long as the system can still boot normally, file recovery and partition recovery operations can be performed using the backup management tool to restore the system to its previous normal operating state. If the device can no longer boot normally, and the root partition is completely corrupted, the device can be restarted to enter the bootloader. Then, in the bootloader interface, a snapshot for restoration can be selected, and the system can be booted into the liveCD runtime environment to restore the corrupted root partition using the specified snapshot.
[0048] It should be noted that LVM logical volume partitions are created within the LVM thin pool. Multiple partitions can be created as needed. Since these partitions are created within the LVM thin pool, no actual disk space is allocated during creation. During use, the LVM thin pool dynamically allocates the required disk space based on the data written to the hard drive. Furthermore, after formatting the LVM logical volume partitions, the operating system installation continues. The final step of the system installation is to install the bootloader and liveCD recovery tools. This is a necessary measure to ensure that the root file system can be restored even if the substation equipment software system fails to boot normally. After completing the system installation and restarting the system, the backup and recovery functions of this invention can be used.
[0049] Because of LVM's disk block redirection mechanism, snapshot creation does not require data copying and can be completed quickly. However, if backing up the entire substation equipment's software system, snapshots need to be created sequentially for all partitions of the software system. Since the entire software system is installed on LVM partitions, creating an LVM partition snapshot also simultaneously creates a snapshot of the entire system. Subsequently, when restoring the LVM partition state using the LVM partition snapshot, the entire system state is also restored simultaneously.
[0050] After creating a snapshot, check the snapshot information to confirm successful creation. You can then continue creating snapshots for other partitions until all partitions have snapshots created. Multiple snapshots can be created for the same partition. Each snapshot has a unique numerical designation. This allows you to specify the snapshot to use for system recovery when restoring the substation equipment software system.
[0051] When a system malfunctions, different methods can be used to restore the system depending on the specific circumstances. First, determine if the substation equipment can restart normally. If the equipment software system is severely damaged and cannot restart normally, then restore the root partition. For detailed implementation methods, please refer to the method examples.
[0052] Based on the same inventive concept, embodiments of the present invention also provide a backup and recovery method for a substation equipment software system based on LVM snapshots, as described in the following embodiments: Since the principle of this backup and recovery method for a substation equipment software system based on LVM snapshots is similar to that of a backup and recovery system for a substation equipment software system based on LVM snapshots, the implementation of the backup and recovery method for a substation equipment software system based on LVM snapshots can refer to the implementation of a backup and recovery system for a substation equipment software system based on LVM snapshots; repeated details will not be elaborated further. As used below, the terms "unit" or "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the system described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0053] Appendix Figure 2 This is a flowchart illustrating a backup and recovery method for a substation equipment software system based on LVM snapshots, according to an embodiment of the present invention.
[0054] See Figure 2 This embodiment provides a backup and recovery method for a substation equipment software system based on LVM snapshots. The backup and recovery method includes:
[0055] S1. Using the LVM partitioning component of the system installation program, create an LVM partition and place the root partition of the software system on the LVM partition; then format the LVM partition into the required file system format and install the operating system and device software.
[0056] S2. Use a snapshot management tool to back up the existing system state;
[0057] S3. If the substation equipment can start normally, perform file recovery and partition recovery operations using the backup management tool to restore the system to its previous normal operating state. If the substation equipment cannot start normally, restart the equipment to enter the bootloader. In the bootloader interface, select the snapshot to be restored, and then boot into the liveCD runtime environment. Start the liveCD to execute the snapshot management tool and restore the damaged root partition using the selected snapshot in the snapshot management tool.
[0058] In some embodiments, after selecting a snapshot, the specified snapshot is mounted to a temporary directory using a snapshot management tool. By comparing the differences between the temporary directory and the LVM partition mount directory, files with differences are displayed in a list. Files with the same name from the specified snapshot are copied to the directory mounted on the LVM partition to restore the files.
[0059] When performing a file recovery operation, since the snapshot has been mounted to a temporary directory, the recovery operation needs to copy the file with the same name from the snapshot to the directory mounted on the LVM partition in order to recover the file.
[0060] The beneficial effects of the present invention will be described below with reference to a preferred embodiment:
[0061] Specifically, during the installation of the substation equipment software system, the system installer calls the LVM partitioning component to partition the hard drive according to the LVM thin pool format. (See attached...) Figure 3 As shown,
[0062] S1. Using the LVM partitioning component of the system installation program, create an LVM partition and place the root partition of the software system on the LVM partition; then format the LVM partition into the required file system format and install the operating system and device software.
[0063] Step S1 in this embodiment specifically includes:
[0064] S11: When performing partitioning operations, the entire hard drive must be used and an LVM thin pool must be configured. Only then can the LVM partitioning component in the installer be invoked for subsequent partitioning operations.
[0065] S12: Configure LVM Thin Pools. Specifies that the hard disks should be partitioned using the LVM Thin Pool format.
[0066] S13: Create an LVM logical volume group. Multiple volume groups can be created as needed.
[0067] S14: Create an LVM thin pool within the created LVM volume group. Theoretically, multiple LVM thin pools can be created within an LVM volume group, but for ease of management, it's usually best to create only one thin pool within a single volume group. This thin pool manages all the disk space of the volume group.
[0068] S15: Create LVM logical volume partitions within the created LVM thin pool. Multiple partitions can be created as needed. Since these partitions are created within the LVM thin pool, no actual disk space is allocated during creation. The actual disk space required is dynamically allocated by the LVM thin pool based on the data written to the disk during subsequent use.
[0069] S16: Format the created LVM logical volume partition into the required file system, such as ext2 / ext3 / ext4, xfs, etc.
[0070] S17: After completing the formatting of the LVM logical volume partition, continue with the installation of the operating system.
[0071] S18: In the final step of system installation, install the bootloader and liveCD recovery tools. This is a necessary measure to ensure that the root file system can be restored even if the system fails to boot normally. After completing the system installation and restarting the system, the backup and recovery functions of this invention can be used.
[0072] S2. Use a snapshot management tool to back up the existing system state;
[0073] When a user wants to back up the system, they can perform step S2, such as... Figure 4 As shown, it specifically includes:
[0074] S21: Start the snapshot management tool. The snapshot management tool has a command-line interface and a graphical interface. The two interfaces have the same effect.
[0075] S22: Create Snapshot Configuration. This step mainly generates the configuration file for the snapshot management tool. This configuration file describes which partition to back up, how many snapshots to back up, and other configuration management information.
[0076] S23: Create a snapshot of the specified partition. This step calls the system's LVM commands to create an LVM snapshot of the specified partition. Due to LVM's disk block redirection mechanism, data copying is not required when creating a snapshot; if backing up the entire substation equipment's software system, snapshots need to be created for all system partitions sequentially. Since the entire system is installed on the LVM partition, creating an LVM partition snapshot also simultaneously creates a snapshot of the entire system. Subsequently, when restoring the LVM partition state using the LVM partition snapshot, the entire system state is also restored simultaneously.
[0077] S24: After creating a snapshot, check the snapshot information to confirm that the snapshot was created successfully. Then you can continue to create snapshots for other partitions until snapshots have been created for all partitions.
[0078] Multiple snapshots can be created for the same partition. Each snapshot has a unique numerical designation. This allows you to specify the snapshot to use when restoring the system.
[0079] If the substation equipment can start normally, perform file recovery and partition recovery operations using the backup management tool to restore the system to its previous normal operating state. If the substation equipment cannot start normally, restart the equipment to enter the bootloader. In the bootloader interface, select the snapshot to be restored, and then boot into the liveCD runtime environment. Start the liveCD to execute the snapshot management tool and restore the damaged root partition using the selected snapshot.
[0080] When a system malfunctions, different methods can be used to restore the system depending on the specific circumstances. First, determine if the substation equipment can restart normally. If the equipment's software system is severely damaged and cannot restart normally, then in this case... Figure 5 As shown, the specific steps required to restore the system include:
[0081] S321: Reboot the device to enter the bootloader interface.
[0082] S322: Select "Snapshot Recovery" from the bootloader interface menu. This will display all LVM partitions.
[0083] S323: Select the LVM partition to perform snapshot recovery. All snapshots on the LVM partition will then be displayed in a list. Different snapshots have different numbers.
[0084] S324: Select a snapshot to restore the system.
[0085] S325: Start the liveCD to execute the LVM snapshot management tool and restore the LVM partition using the selected snapshot.
[0086] If the system can still boot normally, and you only need to restore individual files, you can do so by following these steps:
[0087] S331: Start the snapshot management tool.
[0088] S332: Since an LVM partition may have multiple snapshots, users need to choose which snapshot's state to restore files to. After the user selects a snapshot, the snapshot management tool mounts the user-specified snapshot to a temporary directory and then compares this temporary directory with the LVM partition's mount directory. After the comparison, the files with differences are displayed in a list. The user can then choose which file from the list to restore.
[0089] S333: Perform file recovery operation. Since the snapshot has been mounted to a temporary directory, the recovery operation needs to copy the file with the same name from the snapshot to the directory mounted on the LVM partition, thus achieving file recovery.
[0090] If you wish to restore the entire partition directly when the system boots up normally, you can do so by following these steps:
[0091] S341. Start the snapshot management tool;
[0092] S342. Select the snapshot to be restored from the snapshot management tool;
[0093] S343. The snapshot and LVM partition to be restored are merged using the snapshot management tool, so that the LVM partition is restored to the state corresponding to the snapshot. The LVM snapshot can be automatically deleted after the merge operation is completed.
[0094] This invention also provides a computer electronic device. Figure 6 A schematic diagram of the structure of an electronic device to which embodiments of the present invention can be applied is shown, such as... Figure 6 As shown, this computer electronic device includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for system operation. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0095] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a hard disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.
[0096] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0097] The units or modules described in the embodiments of the present invention can be implemented in software or in hardware.
[0098] In another aspect, the present invention also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the backup and recovery method for a substation equipment software system based on LVM snapshots described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into an electronic device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the backup and recovery method for a substation equipment software system based on LVM snapshots described in the present invention.
[0099] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention is not limited to the specific combination of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in this invention.
Claims
1. A backup and recovery method for a substation equipment software system based on LVM snapshots, characterized in that, include: Create an LVM logical volume group, create an LVM thin pool within the LVM logical volume group, create an LVM partition within the LVM thin pool, and establish the root partition of the substation equipment software system on the LVM partition; then format the LVM partition to the required file system format, and install the operating system and equipment software. In the final step of the operating system installation, install the bootloader and liveCD recovery tools. The liveCD integrates a minimal system operating environment and snapshot management tools. Use a snapshot management tool to back up the existing system state. This includes: starting the snapshot management tool, creating a snapshot configuration, creating a snapshot for the specified partition, and then confirming that the snapshot has been successfully created. When a software fault occurs in substation equipment, determine whether the substation equipment can start normally. If the substation equipment can start normally, determine whether to restore individual files or the entire partition. If individual files need to be recovered, the snapshot management tool is launched. After the user selects a snapshot, the snapshot management tool mounts the user-specified snapshot to a temporary directory. Then, the differences between the temporary directory and the LVM partition's mount directory are compared. After the comparison, the files with differences are displayed in a list, allowing the user to select files from the list for recovery. Files with the same name from the snapshot are copied to the directory mounted on the LVM partition to achieve file recovery. If the entire partition needs to be recovered, the snapshot management tool is launched, the snapshot to be recovered is selected, and the snapshot management tool merges the snapshot to be recovered with the LVM partition to restore the LVM partition to its snapshot state. If the substation equipment fails to start normally, restart the substation equipment to enter the bootloader. In the bootloader interface, select the snapshot to be restored, and then boot into the liveCD runtime environment. Start the liveCD to execute the snapshot management tool and restore the damaged root partition through the selected snapshot in the snapshot management tool.
2. A backup and recovery system for substation equipment software systems based on LVM snapshots, characterized in that, For performing the backup and recovery method as described in claim 1, the backup and recovery system includes: The LVM partitioning component is used to create LVM partitions on a hard drive using the LVM thin pool format and format the partitions into the required file system format. Snapshot management tools are used to back up the existing substation equipment software system status and to recover corrupted files; The bootloader and liveCD recovery tool, bootloader, display a list of snapshots on the LVM partition, start the liveCD to execute the snapshot management tool, and restore the LVM partition through the snapshot selected in the snapshot management tool.
3. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method as described in claim 1.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in claim 1.