WO2018033062A1 - System disk management method and device - Google Patents

System disk management method and device Download PDF

Info

Publication number
WO2018033062A1
WO2018033062A1 PCT/CN2017/097505 CN2017097505W WO2018033062A1 WO 2018033062 A1 WO2018033062 A1 WO 2018033062A1 CN 2017097505 W CN2017097505 W CN 2017097505W WO 2018033062 A1 WO2018033062 A1 WO 2018033062A1
Authority
WO
WIPO (PCT)
Prior art keywords
disk
data
image file
system disk
memory
Prior art date
Application number
PCT/CN2017/097505
Other languages
French (fr)
Chinese (zh)
Inventor
成汝勇
孙蒙恩
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018033062A1 publication Critical patent/WO2018033062A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • 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
    • 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
    • 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/1466Management of the backup or restore process to make the backup process non-disruptive
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD

Definitions

  • the present disclosure relates to the field of operating system technologies, and in particular, to a system disk management method and apparatus.
  • the system disk management method and apparatus provided by the embodiments of the present disclosure mainly solve the problem of long-term service interruption caused by system hard disk replacement.
  • an embodiment of the present disclosure provides a system disk management method, including:
  • the memory disk file is used to perform disk data recovery on the system disk.
  • the embodiment of the present disclosure further provides a system disk management apparatus, including:
  • the backup module is configured to obtain disk data of the system disk, back up the disk data in the memory, and generate a memory image file;
  • a recovery module configured to perform disk data recovery on the system disk by using the memory image file after the system disk is updated.
  • the embodiment of the present disclosure further provides a computer storage medium having stored therein computer executable instructions for performing the system disk management method of any of the foregoing.
  • the system disk data is backed up in the memory through the memory mirror file, and the system disk replacement and the fast service recovery are completed in the case that the server device is powered off. Improve user service quality.
  • FIG. 1 is a flowchart of a method for managing a system disk according to Embodiment 1 of the present disclosure
  • FIG. 2 is a flowchart of a system disk management method according to Embodiment 2 of the present disclosure
  • FIG. 3 is a flowchart of a system disk management method according to Embodiment 3 of the present disclosure.
  • FIG. 4 is a schematic diagram of a system disk management apparatus according to Embodiment 4 of the present disclosure.
  • FIG. 5 is a schematic diagram of a system disk management terminal according to Embodiment 5 of the present disclosure.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • the embodiment of the present disclosure provides a system disk management method, and the specific process is shown in FIG. 1 .
  • the backup configuration files that need to be backed up are prepared.
  • the files and data to be backed up in the obtained system disk are compressed to generate a memory image file, which is stored in the memory as a backup file of the running operating system.
  • the system disk update includes replacing the new system disk, and replacing the new system disk can replace the system disk by hot swapping, so that the entire server device does not need to be powered off.
  • the memory image file in the memory is rewritten to the new system disk, which can quickly restore the system operation.
  • the system disk management method provided by the embodiment of the present disclosure can complete the replacement of the system disk and the rapid recovery of the service, and improve the service quality of the user, by backing up the disk data in the memory.
  • the update of the solution system disk of the embodiment of the present disclosure further includes reinstalling the system on the system disk, rewriting the memory image file in the memory to the system disk, and restarting the system operation. If the solution of the embodiment of the present disclosure is applied to another scenario, corresponding changes to the content of the solution should also be considered as belonging to the protection scope of the present disclosure.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • the embodiment of the present disclosure provides a system disk management method. For details, see FIG. 2 .
  • the backup configuration files that need to be backed up are prepared.
  • the data stored in the system disk is read, and the read data is taken as the disk data to be backed up.
  • the previously read disk data to be backed up is compressed to generate a memory image file, which is stored in the memory as a backup file of the running operating system.
  • the backup configuration file periodically traverse the file path or directory path in the configuration file, and compare the current data with the generated memory image file data according to a specific algorithm.
  • the newly added data is the first time the data file is written to the memory image file. Before this data file is created, it needs to be created. The updated data is written to the memory image file before the data file, and the original memory image file needs to be deleted. Then, the new data is added to the image file through the compression algorithm to complete the update.
  • S207 Generates a memory image file of the newly added data in an incremental manner.
  • the updated data file is newly added data, and the memory image file of the newly added data is generated in an incremental manner.
  • Incremental mode means that when the updated disk data is newly added, that is, the data file is completely generated for the first time, all the data is directly packaged into an image file according to the compression algorithm and stored in the memory as a memory image file.
  • S208 Generate a memory image file of the updated data by using a differential method.
  • the updated data file is updated data
  • a memory image file of the updated data is generated in a differential manner.
  • the differential mode means that when the disk data is updated before the data file exists, the original memory image file is deleted, and the new data is added to the image file through the compression algorithm and stored in the memory as a memory image file.
  • Updating the system disk involves replacing the new disk or repairing the disk, and you need to rewrite the operating system-related data on the disk.
  • Replacing a new system disk can replace the system disk by hot swap, so you do not need to power off the entire server device.
  • the update message When the update message is detected, it indicates that the system disk needs to be updated. At this time, the memory is read and written to the system disk and other related actions. The memory can no longer make any changes to the data in the system disk, ensuring that the memory is running at this time. The information is separated from the operating system disk to ensure that the operating system does not change reset during disk operations such as disk replacement. Because I have been synchronizing the data in the backup system disk. At this time, the memory is read and written to the system disk. It can also avoid the difference between the actual data on the disk and the data in the memory image file during the time difference between re-importing data. The system is unstable after the system disk is replaced.
  • Restoring the message requires writing the in-memory memory image file to the current system disk. It can be delivered by the user after updating the system disk.
  • the memory image file is extracted from the memory, and the updated system disk is written back to the system disk, and the corresponding image file is generated at the corresponding disk location.
  • the image file is decompressed and released to the corresponding specific directory to restore the system environment, service version, and data.
  • the prompt message informs that manual manual intervention processing is required, and the update system disk processing can be re-executed.
  • the system disk management method provided by the embodiment of the present disclosure can restore the recovery of the system disk and the disk data by backing up the disk data in the memory, without interrupting the service service, and improving the user service quality.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • the embodiment of the present disclosure provides a system disk management method. For details, see FIG. 3 .
  • the backup configuration file contains the data such as the necessary files required for the operating system to run. It analyzes the important files and necessary files on the system disk and collects various types of files.
  • the backup configuration file read the data stored in the system disk, create a corresponding disk image file on the system disk, and use the disk image file as the disk data.
  • the backup configuration file periodically traverse the file path or directory path in the configuration file, and compare the current data with the generated disk image file data according to a specific algorithm.
  • the updated data file is added to the attribute, and two types of new data and updated data are added.
  • the newly added data is that the data file is written to the disk image file for the first time. There is no such data file before. In this case, the hard disk image file is updated in an incremental manner. Incremental mode means that when the disk data is newly added, that is, the data file is completely generated for the first time, all the data is directly packaged into an image file according to the compression algorithm and stored in the disk as a disk image file.
  • the update data is already written to the disk image file before the data file, and the hard disk image file is updated in a differential manner.
  • the differential mode refers to deleting the original disk image file when the disk data is updated data, that is, the data file.
  • the new data is added to the image file through the compression algorithm and stored in the disk as a disk image file.
  • the memory image file is updated to maintain the consistency of the two image data. You can also compare disk image files and memory image files periodically to determine whether the two mirrored data are consistent. Before updating the memory image file, you can mask the memory read and write operations on the system disk and other related actions. The memory can no longer make any changes to the data in the system disk, so that the system disk data does not change anymore, so the disk image file is not If the disk image file is changed when the memory image file is updated, the two mirrored data of the memory image file and the disk image file cannot be consistent. After the memory image file is updated, you can restore the memory to the system disk read and write operations and other related actions.
  • Updating the memory image file requires judging that the updated data file is added to the attribute, and there are two types of new data and updated data.
  • the newly added data is the first time that the data file is written into the memory image file.
  • the updated data is directly packaged into an image file and stored in the memory according to the compression algorithm, as a memory image file.
  • the update data is written to the memory image file before the data file is deleted.
  • the original memory image file is deleted in a differential manner, and the new data is added to the image file through the compression algorithm and stored in the memory as a memory image file.
  • Updating the system disk involves replacing the new disk or repairing the disk, and you need to rewrite the operating system-related data on the disk.
  • Replacing a new system disk can replace the system disk by hot swap, so you do not need to power off the entire server device.
  • the memory When listening to the update message, the memory is read and written to the system disk and other related actions, the memory can no longer make any changes to the data in the system disk, ensuring that the information running in the memory is separated from the operating system disk. To ensure that the operating system does not change reset during disk operations such as disk replacement. Because the data in the backup system disk has been synchronized before, the memory is read and written to the system disk at this time, and the data in the disk can be prevented from being different from the data in the memory image file during the time difference of re-importing data. The system is unstable after the system disk is replaced.
  • Restoring the message requires writing the in-memory memory image file to the current system disk. It can be delivered by the user after updating the system disk.
  • S311 Write the memory image file back to the updated system disk to generate a corresponding image file.
  • the memory image file is extracted from the memory, and the updated system disk is written back to the system disk, and the corresponding image file is generated at the corresponding disk location.
  • the image file is decompressed and released to the corresponding specific directory to restore the system environment, service version, and data.
  • the prompt message informs that manual manual intervention processing is required, and the update system disk processing can be re-executed.
  • the system disk management method provided by the embodiment of the present disclosure can back up the memory image file in the backup process by establishing a disk image file to back up the disk data in the disk and then synchronizing the memory image file in the memory.
  • the memory does not need to be traversed each time.
  • IO Input/Output, Input/Output interface
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • FIG. 4 is a specific schematic diagram. The following describes each module and function further, including:
  • the backup module 401 is configured to obtain disk data of the system disk, back up the disk data in the memory, and generate a memory image file.
  • the backup configuration file contains the operating system.
  • the catalog of necessary data such as necessary files is compiled by analyzing various important files and necessary files on the system disk and collecting various types of files.
  • the obtaining the disk data of the system disk includes reading the data stored in the system disk according to the backup configuration file, and using the read data as the disk data. Backing up disk data in memory generates a corresponding memory image file based on the read data.
  • Obtaining the disk data of the system disk also includes monitoring the disk image file created on the system disk and using the disk image file as the disk data. In this way, a disk image file is created in the system disk, and then a corresponding memory image file is created in the memory according to the disk image file.
  • the memory image file of the newly added data is generated in an incremental manner; when the disk data is updated data, the memory image file of the updated data is generated in a differential manner.
  • the newly added data is the first time the data file is written to the memory image file. Before this data file is created, it needs to be created. The updated data is written to the memory image file before the data file, and the original memory image file needs to be deleted. Then, the new data is added to the image file through the compression algorithm to complete the update.
  • the recovery module 402 is configured to use the memory image file to perform disk data recovery on the system disk after the system disk is updated.
  • the recovery module is configured to listen for update messages used to characterize the update system disk, including updating the new disk or repairing the disk.
  • update messages used to characterize the update system disk, including updating the new disk or repairing the disk.
  • the memory is read and written to the system disk, and the memory can no longer make any changes to the data in the system disk, ensuring that the information running in the memory is separated from the operating system disk at this time, and the disk is guaranteed to be replaced.
  • the operating system does not change reset during the update disk operation. Because the data in the backup system disk has been synchronized before, the memory is read and written to the system disk at this time, and the data in the disk can be prevented from being different from the data in the memory image file during the time difference of re-importing data.
  • the system is unstable after the system disk is replaced.
  • the recovery module is also configured to listen for recovery messages used to characterize the recovery system disk. When the recovery message is detected, the memory image file is written back to the updated system disk, the image file is generated, the image file is decompressed, and the file is released to the corresponding specific directory to restore the system environment, service version, and data.
  • the system disk management device provided by the embodiment of the present disclosure can restore the recovery of the system disk and the disk data by backing up the disk data in the memory, without interrupting the service service, and improving the user service quality.
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • the embodiment of the present disclosure provides a terminal, including a system disk, a memory, and a system disk management device of Embodiment 4. Referring to FIG. 5 .
  • the terminal provided by the embodiment of the present disclosure can back up the disk data in the memory through the system disk management device, and complete the recovery of the system disk and the disk data, without interrupting the service service and improving the user service quality.
  • modules or steps of the above embodiments of the present disclosure can be used universally.
  • computing devices which may be centralized on a single computing device or distributed over a network of computing devices, optionally implemented in program code executable by the computing device, such that they may be
  • the storage is performed by a computing device in a computer storage medium (ROM/RAM, disk, optical disk), and in some cases, the steps shown or described may be performed in an order different from that herein, or they may be separately It is made by making individual integrated circuit modules, or by making a plurality of modules or steps of them into a single integrated circuit module. Therefore, the present disclosure is not limited to any specific combination of hardware and software.

Landscapes

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

Abstract

The present disclosure provides a system disk management method and device, and a computer storage medium. System disk data is backed up into a memory by means of a memory mirroring file, and the system disk is replaced and a service is rapidly recovered in a case in which a server device is not powered off, thereby improving service quality of users.

Description

一种系统磁盘管理方法和装置System disk management method and device 技术领域Technical field
本公开涉及操作系统技术领域,尤其涉及一种系统磁盘管理方法和装置。The present disclosure relates to the field of operating system technologies, and in particular, to a system disk management method and apparatus.
背景技术Background technique
在目前电信服务器市场领域,因为业务的整合发展,传统的刀片式专用服务器越来越难以支持高并发、大数据量的运算,设备和业务维护变的越发复杂。因此电信市场的硬件采购在向通用服务器方向发展。而在通用服务器市场领域,厂商的通用做法是配置多块操作系统磁盘插槽,做RAID(Redundant Arrays of Independent Disks,磁盘阵列)的方式来提高系统盘数据的稳定性,其中RAID有硬RAID和软RAID的方式。通过硬件堆积方式来进行操作系统磁盘数据的冗余设计,提高系统运行的稳定性,进而提高业务运行的稳定性,减低维护工作量,达到提高用户满意度、数据安全性的要求。In the current telecom server market, due to the integration of services, traditional blade-type dedicated servers are increasingly difficult to support high-concurrency, large-volume computing, and equipment and service maintenance become more complex. Therefore, hardware procurement in the telecommunications market is moving toward general-purpose servers. In the general-purpose server market, the common practice of the manufacturer is to configure multiple operating system disk slots and RAID (Redundant Arrays of Independent Disks) to improve the stability of the system disk data. RAID has hard RAID and Soft RAID mode. The redundancy of the operating system disk data is designed by the hardware stacking method to improve the stability of the system operation, thereby improving the stability of the business operation, reducing the maintenance workload, and meeting the requirements for improving user satisfaction and data security.
但上述方案存在以下系统硬盘更换影响业务服务的问题:However, the above solutions have the following problems:
由于系统盘运行一段时间后会出现坏道或者其他情况导致需要更换系统磁盘,尤其是SSD(Solid State Drives,固态硬盘)硬盘擦写次数限制,会很容易导致磁盘损坏,需要更换系统磁盘;而更换系统磁盘的时候,需要做业务数据备份,操作系统和业务的安装等操作,导致业务中断很长时间,影响用户体验。If the system disk runs for a period of time, bad sectors or other conditions may result in the need to replace the system disk. In particular, the SSD (Solid State Drives) hard disk erasing limit is very likely to cause disk damage and the system disk needs to be replaced. When you replace a system disk, you need to perform service data backup, operating system, and service installation. This causes service interruption for a long time and affects the user experience.
发明内容Summary of the invention
本公开实施例提供的系统磁盘管理方法和装置,主要要解决的技术问题是系统硬盘更换导致的长时间业务中断。The system disk management method and apparatus provided by the embodiments of the present disclosure mainly solve the problem of long-term service interruption caused by system hard disk replacement.
为解决上述技术问题,本公开实施例提供一种系统磁盘管理方法,包括:To solve the above technical problem, an embodiment of the present disclosure provides a system disk management method, including:
获取系统磁盘的磁盘数据;Obtain disk data of the system disk;
将所述磁盘数据备份在内存中,生成内存镜像文件;Backing up the disk data in the memory to generate a memory image file;
在所述系统磁盘发生更新后,使用所述内存镜像文件,对所述系统磁盘进行磁盘数据恢复。After the system disk is updated, the memory disk file is used to perform disk data recovery on the system disk.
本公开实施例还提供一种系统磁盘管理装置,包括:The embodiment of the present disclosure further provides a system disk management apparatus, including:
备份模块,配置成获取系统磁盘的磁盘数据,将所述磁盘数据备份在内存中,生成内存镜像文件;The backup module is configured to obtain disk data of the system disk, back up the disk data in the memory, and generate a memory image file;
恢复模块,配置成在所述系统磁盘发生更新后,使用所述内存镜像文件,对所述系统磁盘进行磁盘数据恢复。And a recovery module configured to perform disk data recovery on the system disk by using the memory image file after the system disk is updated.
本公开实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述的任一项的系统磁盘管理方法。 The embodiment of the present disclosure further provides a computer storage medium having stored therein computer executable instructions for performing the system disk management method of any of the foregoing.
本公开的有益效果是:The beneficial effects of the present disclosure are:
根据本公开实施例提供的系统磁盘管理方法、装置以及计算机存储介质,通过内存镜像文件将系统磁盘数据备份在内存中,在服务器设备不断电的情形下,完成系统磁盘的更换和业务的快速恢复,提高用户服务质量。According to the system disk management method and device and the computer storage medium provided by the embodiments of the present disclosure, the system disk data is backed up in the memory through the memory mirror file, and the system disk replacement and the fast service recovery are completed in the case that the server device is powered off. Improve user service quality.
附图说明DRAWINGS
图1为本公开实施例一提供的一种系统磁盘管理方法的流程图;FIG. 1 is a flowchart of a method for managing a system disk according to Embodiment 1 of the present disclosure;
图2为本公开实施例二提供的一种系统磁盘管理方法的流程图;2 is a flowchart of a system disk management method according to Embodiment 2 of the present disclosure;
图3为本公开实施例三提供的一种系统磁盘管理方法的流程图;3 is a flowchart of a system disk management method according to Embodiment 3 of the present disclosure;
图4为本公开实施例四提供的一种系统磁盘管理装置的示意图;4 is a schematic diagram of a system disk management apparatus according to Embodiment 4 of the present disclosure;
图5为本公开实施例五提供的一种系统磁盘管理终端的示意图。FIG. 5 is a schematic diagram of a system disk management terminal according to Embodiment 5 of the present disclosure.
具体实施方式detailed description
下面通过具体实施方式结合附图对本公开实施例作进一步详细说明。The embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
实施例一:Embodiment 1:
为了达到在服务器设备不断电的情形下,完成系统磁盘的更换和业务的快速恢复的目的,本公开实施例提供了一种系统磁盘管理方法,具体流程请参见图1。In order to achieve the purpose of the system disk replacement and the rapid recovery of the service in the case that the server device is powered off, the embodiment of the present disclosure provides a system disk management method, and the specific process is shown in FIG. 1 .
S101,获取系统磁盘的磁盘数据。S101. Obtain disk data of a system disk.
通过对系统磁盘中重要文件和必要文件进行分析,并集合业务的版本文件和数据文件,整理制作成需要进行备份的备份配置文件。By analyzing the important files and necessary files in the system disk, and collecting the version files and data files of the business, the backup configuration files that need to be backed up are prepared.
S102,将所述磁盘数据备份在内存中,生成内存镜像文件。S102. Back up the disk data in the memory to generate a memory image file.
根据之前的备份配置文件,将获取到的系统磁盘中的需要备份的文件及数据压缩生成内存镜像文件,存放在内存中,作为现运行操作系统的备份文件。According to the previous backup configuration file, the files and data to be backed up in the obtained system disk are compressed to generate a memory image file, which is stored in the memory as a backup file of the running operating system.
S103,在所述系统磁盘发生更新后,使用所述内存镜像文件,对所述系统磁盘进行磁盘数据恢复。S103. After the system disk is updated, use the memory image file to perform disk data recovery on the system disk.
系统磁盘发生更新包括更换新的系统磁盘,更换新的系统磁盘可以通过热插拔更换系统磁盘,就不需要将整个服务器设备关机下电。更换完成后,将内存中的内存镜像文件重新写入到新的系统磁盘,可以迅速恢复系统运行。The system disk update includes replacing the new system disk, and replacing the new system disk can replace the system disk by hot swapping, so that the entire server device does not need to be powered off. After the replacement is complete, the memory image file in the memory is rewritten to the new system disk, which can quickly restore the system operation.
本公开实施例提供的系统磁盘管理方法,通过在内存中备份磁盘数据,能够在服务器设备不断电的情形下,完成系统磁盘的更换和业务的快速恢复,提高用户服务质量。The system disk management method provided by the embodiment of the present disclosure can complete the replacement of the system disk and the rapid recovery of the service, and improve the service quality of the user, by backing up the disk data in the memory.
显然,本领域的技术人员应该明白,本公开实施例的方案系统磁盘发生更新还包括在系统磁盘上重新安装系统,将内存中的内存镜像文件重新写入到系统磁盘,重新开始系统运行。若将本公开实施例的方案应用于别的场景时,对方案内容进行相应改变,也都应当视为属于本公开的保护范围。Obviously, those skilled in the art should understand that the update of the solution system disk of the embodiment of the present disclosure further includes reinstalling the system on the system disk, rewriting the memory image file in the memory to the system disk, and restarting the system operation. If the solution of the embodiment of the present disclosure is applied to another scenario, corresponding changes to the content of the solution should also be considered as belonging to the protection scope of the present disclosure.
实施例二:Embodiment 2:
本公开实施例提供一种系统磁盘管理方法,具体流程请参见图2。 The embodiment of the present disclosure provides a system disk management method. For details, see FIG. 2 .
S201,设置备份配置文件。S201, setting a backup configuration file.
通过对系统磁盘中重要文件和必要文件进行分析,并集合业务的版本文件和数据文件,整理制作成需要进行备份的备份配置文件。By analyzing the important files and necessary files in the system disk, and collecting the version files and data files of the business, the backup configuration files that need to be backed up are prepared.
S202,读取系统磁盘存储的数据,将读取到的数据作为磁盘数据。S202. Read data stored in a system disk, and use the read data as disk data.
根据备份配置文件,读取系统磁盘中存储的数据,将读取到的数据作为将要备份的磁盘数据。According to the backup configuration file, the data stored in the system disk is read, and the read data is taken as the disk data to be backed up.
S203,将所述磁盘数据备份在内存中,生成内存镜像文件。S203. Back up the disk data in the memory to generate a memory image file.
将之前读取到的、将要备份的磁盘数据压缩生成内存镜像文件,存放在内存中,作为现运行操作系统的备份文件。The previously read disk data to be backed up is compressed to generate a memory image file, which is stored in the memory as a backup file of the running operating system.
S204,监控系统磁盘的备份配置文件中的数据。S204. Monitor data in a backup configuration file of the system disk.
根据备份配置文件,定时遍历配置文件中的文件路径或者目录路径,根据特定算法,将当前数据跟已经生成的内存镜像文件数据进行对比。According to the backup configuration file, periodically traverse the file path or directory path in the configuration file, and compare the current data with the generated memory image file data according to a specific algorithm.
S205,判断数据是否更新。若否,则转回到S204;若是,则转到S206。S205. Determine whether the data is updated. If not, the process returns to S204; if yes, the process goes to S206.
在循环检测完所有数据后,根据对比结果判断数据是否更新。若否,则根据对比结果判断数据没有被更新,转回到S204,继续监控系统磁盘的备份配置文件中的数据;若是,则根据对比结果判断数据被更新,转到S206。After all the data has been detected in the loop, it is judged based on the comparison result whether the data is updated. If not, the data is not updated according to the comparison result, and the process returns to S204 to continue monitoring the data in the backup configuration file of the system disk; if yes, the data is updated according to the comparison result, and the process goes to S206.
S206,判断数据是否为新增数据。若是,则转到S207;若否,则转到S208。S206. Determine whether the data is new data. If yes, go to S207; if no, go to S208.
根据对比结果判断数据被更新后,判断被更新的数据文件加入属性,分新增数据和更新数据2种类型。新增数据为该数据文件第一次被写入内存镜像文件,之前没有这个数据文件,需要被创建;更新数据为该数据文件之前已经被写入内存镜像文件,需要将原来的内存镜像文件删除,再将新的数据通过压缩算法加入到镜像文件中,完成更新。After judging that the data is updated according to the comparison result, it is judged that the updated data file is added to the attribute, and two types of new data and updated data are added. The newly added data is the first time the data file is written to the memory image file. Before this data file is created, it needs to be created. The updated data is written to the memory image file before the data file, and the original memory image file needs to be deleted. Then, the new data is added to the image file through the compression algorithm to complete the update.
S207,采用增量方式,生成新增数据的内存镜像文件。S207: Generates a memory image file of the newly added data in an incremental manner.
此时,被更新的数据文件为新增数据,采用增量方式,生成新增数据的内存镜像文件。增量方式指当更新的磁盘数据为新增数据即数据文件完全是第一次生成时,直接将所有数据根据压缩算法,打包创建成一个镜像文件存入内存,作为内存镜像文件。At this time, the updated data file is newly added data, and the memory image file of the newly added data is generated in an incremental manner. Incremental mode means that when the updated disk data is newly added, that is, the data file is completely generated for the first time, all the data is directly packaged into an image file according to the compression algorithm and stored in the memory as a memory image file.
S208,采用差分方式,生成更新数据的内存镜像文件。S208: Generate a memory image file of the updated data by using a differential method.
此时,被更新的数据文件为更新数据,采用差分方式,生成更新数据的内存镜像文件。差分方式指当磁盘数据为更新数据即数据文件之前已经存在时,将原来的内存镜像文件删除,再将新的数据通过压缩算法加入到镜像文件中,存入内存,作为内存镜像文件。At this time, the updated data file is updated data, and a memory image file of the updated data is generated in a differential manner. The differential mode means that when the disk data is updated before the data file exists, the original memory image file is deleted, and the new data is added to the image file through the compression algorithm and stored in the memory as a memory image file.
S209,监听用于表征更新系统磁盘的更新消息。S209. Monitor an update message for characterizing the update system disk.
更新系统磁盘包括更换新磁盘或者修复磁盘,需要在磁盘上重新写入操作系统相关的数据。更换新的系统磁盘可以通过热插拔更换系统磁盘,就不需要将整个服务器设备关机下电。Updating the system disk involves replacing the new disk or repairing the disk, and you need to rewrite the operating system-related data on the disk. Replacing a new system disk can replace the system disk by hot swap, so you do not need to power off the entire server device.
S210,屏蔽内存对系统磁盘的读写操作。S210, shielding the memory from reading and writing to the system disk.
在监听到更新消息时,说明系统磁盘需要更新,此时屏蔽内存对系统磁盘的读写操作以及相关其它动作,内存就不能再对系统磁盘中的数据进行任何更改,确保此时内存中运行的信息和操作系统磁盘分离开来,保证换盘等更新磁盘操作期间操作系统不会变化复位。因为 之前一直在同步备份系统磁盘中的数据,此时屏蔽内存对系统磁盘的读写操作,还可以避免在重新导入数据的这段时间差内,磁盘中实际数据与内存镜像文件中的数据有差异导致系统磁盘更换后系统不稳定。When the update message is detected, it indicates that the system disk needs to be updated. At this time, the memory is read and written to the system disk and other related actions. The memory can no longer make any changes to the data in the system disk, ensuring that the memory is running at this time. The information is separated from the operating system disk to ensure that the operating system does not change reset during disk operations such as disk replacement. Because I have been synchronizing the data in the backup system disk. At this time, the memory is read and written to the system disk. It can also avoid the difference between the actual data on the disk and the data in the memory image file during the time difference between re-importing data. The system is unstable after the system disk is replaced.
S211,监听用于表征恢复系统磁盘的恢复消息。S211. Monitor a recovery message used to represent the recovery system disk.
恢复消息即需要将内存中的内存镜像文件写入现在的系统磁盘。可以在更新系统磁盘后,由用户下发。Restoring the message requires writing the in-memory memory image file to the current system disk. It can be delivered by the user after updating the system disk.
S212,将内存镜像文件回写到更新后的系统磁盘,生成对应的镜像文件。S212: Write the memory image file back to the updated system disk to generate a corresponding image file.
在监听到恢复消息时,从内存中提取出内存镜像文件,回写到更新后的系统磁盘即将内存镜像文件重新写入系统磁盘,在对应的磁盘位置生成对应的镜像文件。When the recovery message is detected, the memory image file is extracted from the memory, and the updated system disk is written back to the system disk, and the corresponding image file is generated at the corresponding disk location.
S213,解压镜像文件。S213, extract the image file.
待镜像文件生成后,将镜像文件解压缩,释放到对应的具体目录,实现系统环境、业务版本以及数据的还原。After the image file is generated, the image file is decompressed and released to the corresponding specific directory to restore the system environment, service version, and data.
S214,判断更新系统磁盘是否成功。若是,则转到S215;若否,则转到S216。S214. Determine whether the update system disk is successful. If yes, go to S215; if no, go to S216.
在恢复系统磁盘完成后,检测数据是否更新完成,操作系统是否能够正常运行,若是,则判断更新系统磁盘成功,转到S215;若否,则转到S216。After the recovery of the system disk is completed, it is detected whether the data update is completed, whether the operating system can run normally, and if so, it is judged that the update system disk is successful, and the process goes to S215; if not, the process goes to S216.
S215,还原所有的系统磁盘操作功能。S215, restore all system disk operation functions.
之前屏蔽内存对系统磁盘的读写操作以及相关其它动作,现还原所有系统对系统磁盘的操作功能,系统正常运行。Before the memory is read and written to the system disk and other related actions, all system functions on the system disk are restored, and the system runs normally.
S216,提示需要手动干预处理。S216, the prompt requires manual intervention processing.
若判断更新系统磁盘失败,则提示信息告知需要人工手动干预处理,可以重新执行更新系统磁盘处理等。If it is judged that the update of the system disk fails, the prompt message informs that manual manual intervention processing is required, and the update system disk processing can be re-executed.
本公开实施例提供的系统磁盘管理方法,通过在内存中备份磁盘数据,能够完成更新系统磁盘和磁盘数据的恢复,不需中断业务服务,提高用户服务质量。The system disk management method provided by the embodiment of the present disclosure can restore the recovery of the system disk and the disk data by backing up the disk data in the memory, without interrupting the service service, and improving the user service quality.
显然,本领域的技术人员应该明白,若将本公开实施例的方案应用于别的场景时,对方案内容进行相应改变,也都应当视为属于本公开的保护范围。Obviously, those skilled in the art should understand that if the solution of the embodiments of the present disclosure is applied to other scenarios, corresponding changes to the content of the solution should be considered as belonging to the protection scope of the present disclosure.
实施例三:Embodiment 3:
本公开实施例提供一种系统磁盘管理方法,具体流程请参见图3。The embodiment of the present disclosure provides a system disk management method. For details, see FIG. 3 .
S301,设置备份配置文件。S301. Set a backup configuration file.
备份配置文件包含操作系统运行需要的必备文件等数据的目录,是通过对系统磁盘中重要文件和必要文件进行分析,集合各类文件整理制作成的。The backup configuration file contains the data such as the necessary files required for the operating system to run. It analyzes the important files and necessary files on the system disk and collects various types of files.
S302,建立系统磁盘的磁盘镜像文件。S302. Create a disk image file of the system disk.
根据备份配置文件,读取系统磁盘中存储的数据,在系统磁盘中建立对应的磁盘镜像文件,将磁盘镜像文件作为磁盘数据。According to the backup configuration file, read the data stored in the system disk, create a corresponding disk image file on the system disk, and use the disk image file as the disk data.
S303,建立系统磁盘的内存镜像文件。S303. Create a memory image file of the system disk.
根据系统磁盘中作为磁盘数据建立的磁盘镜像文件,在内存中对应磁盘镜像文件建立内存镜像文件。 Create a memory image file in the memory corresponding to the disk image file based on the disk image file created as disk data on the system disk.
S304,监控磁盘镜像文件。S304. Monitor the disk image file.
根据备份配置文件,定时遍历配置文件中的文件路径或者目录路径,根据特定算法,将当前数据跟已经生成的磁盘镜像文件数据进行对比。According to the backup configuration file, periodically traverse the file path or directory path in the configuration file, and compare the current data with the generated disk image file data according to a specific algorithm.
S305,判断数据是否更新。若否,则转回到S304;若是,则转到S306。S305. Determine whether the data is updated. If not, the process returns to S304; if yes, the process goes to S306.
在循环检测完所有数据后,根据对比结果判断数据是否更新。若否,则根据对比结果判断数据没有被更新,转回到S304,继续监控;若是,则根据对比结果判断数据被更新,转到S306。After all the data has been detected in the loop, it is judged based on the comparison result whether the data is updated. If not, the data is not updated according to the comparison result, and the process returns to S304 to continue monitoring; if so, the data is updated according to the comparison result, and the process proceeds to S306.
S306,更新磁盘镜像文件。S306. Update the disk image file.
根据对比结果判断数据被更新后,判断被更新的数据文件加入属性,分新增数据和更新数据2种类型。新增数据为该数据文件第一次被写入磁盘镜像文件,之前没有这个数据文件,此时采用增量方式,更新硬盘镜像文件。增量方式指当所述磁盘数据为新增数据即数据文件完全是第一次生成时,直接将所有数据根据压缩算法,打包创建成一个镜像文件存入磁盘,作为磁盘镜像文件。After judging that the data is updated according to the comparison result, it is judged that the updated data file is added to the attribute, and two types of new data and updated data are added. The newly added data is that the data file is written to the disk image file for the first time. There is no such data file before. In this case, the hard disk image file is updated in an incremental manner. Incremental mode means that when the disk data is newly added, that is, the data file is completely generated for the first time, all the data is directly packaged into an image file according to the compression algorithm and stored in the disk as a disk image file.
更新数据为该数据文件之前已经被写入磁盘镜像文件,此时采用差分方式,更新硬盘镜像文件。差分方式指当所述磁盘数据为更新数据即数据文件之前已经存在时,将原来的磁盘镜像文件删除,再将新的数据通过压缩算法加入到镜像文件中,存入磁盘,作为磁盘镜像文件。The update data is already written to the disk image file before the data file, and the hard disk image file is updated in a differential manner. The differential mode refers to deleting the original disk image file when the disk data is updated data, that is, the data file. The new data is added to the image file through the compression algorithm and stored in the disk as a disk image file.
S307,更新内存镜像文件,与磁盘镜像文件保持一致。S307. Update the memory image file to be consistent with the disk image file.
在磁盘镜像文件被更新后,更新内存镜像文件,保持两个镜像数据的一致性。也可以定期比较磁盘镜像文件和内存镜像文件,来判断两个镜像数据是否一致。在更新内存镜像文件前,可以屏蔽内存对系统磁盘的读写操作以及相关其它动作,内存就不能再对系统磁盘中的数据进行任何更改,可以保证系统磁盘数据不再变化,从而磁盘镜像文件不再变化,避免在更新内存镜像文件的时候,磁盘镜像文件改变,导致内存镜像文件与磁盘镜像文件两个镜像数据不能保持一致。在更新内存镜像文件完成后,可以恢复内存对系统磁盘的读写操作以及相关其它动作。After the disk image file is updated, the memory image file is updated to maintain the consistency of the two image data. You can also compare disk image files and memory image files periodically to determine whether the two mirrored data are consistent. Before updating the memory image file, you can mask the memory read and write operations on the system disk and other related actions. The memory can no longer make any changes to the data in the system disk, so that the system disk data does not change anymore, so the disk image file is not If the disk image file is changed when the memory image file is updated, the two mirrored data of the memory image file and the disk image file cannot be consistent. After the memory image file is updated, you can restore the memory to the system disk read and write operations and other related actions.
更新内存镜像文件需要判断被更新的数据文件加入属性,分新增数据和更新数据2种类型。新增数据为该数据文件第一次被写入内存镜像文件,采用增量方式,直接将更新的数据根据压缩算法,打包创建成一个镜像文件存入内存,作为内存镜像文件。Updating the memory image file requires judging that the updated data file is added to the attribute, and there are two types of new data and updated data. The newly added data is the first time that the data file is written into the memory image file. In the incremental mode, the updated data is directly packaged into an image file and stored in the memory according to the compression algorithm, as a memory image file.
更新数据为该数据文件之前已经被写入内存镜像文件,采用差分方式,将原来的内存镜像文件删除,再将新的数据通过压缩算法加入到镜像文件中,存入内存,作为内存镜像文件。The update data is written to the memory image file before the data file is deleted. The original memory image file is deleted in a differential manner, and the new data is added to the image file through the compression algorithm and stored in the memory as a memory image file.
S308,监听用于表征更新系统磁盘的更新消息。S308. Monitor an update message for characterizing the update system disk.
更新系统磁盘包括更换新磁盘或者修复磁盘,需要在磁盘上重新写入操作系统相关的数据。更换新的系统磁盘可以通过热插拔更换系统磁盘,就不需要将整个服务器设备关机下电。Updating the system disk involves replacing the new disk or repairing the disk, and you need to rewrite the operating system-related data on the disk. Replacing a new system disk can replace the system disk by hot swap, so you do not need to power off the entire server device.
S309,屏蔽内存对系统磁盘的读写操作。S309, the memory is read and written to the system disk.
在监听到更新消息时,屏蔽内存对系统磁盘的读写操作以及相关其它动作,内存就不能再对系统磁盘中的数据进行任何更改,确保此时内存中运行的信息和操作系统磁盘分离开 来,保证换盘等更新磁盘操作期间操作系统不会变化复位。因为之前一直在同步备份系统磁盘中的数据,此时屏蔽内存对系统磁盘的读写操作,还可以避免在重新导入数据的这段时间差内,磁盘中实际数据与内存镜像文件中的数据有差异导致系统磁盘更换后系统不稳定。When listening to the update message, the memory is read and written to the system disk and other related actions, the memory can no longer make any changes to the data in the system disk, ensuring that the information running in the memory is separated from the operating system disk. To ensure that the operating system does not change reset during disk operations such as disk replacement. Because the data in the backup system disk has been synchronized before, the memory is read and written to the system disk at this time, and the data in the disk can be prevented from being different from the data in the memory image file during the time difference of re-importing data. The system is unstable after the system disk is replaced.
S310,监听用于表征恢复系统磁盘的恢复消息。S310. Monitor a recovery message used to represent the recovery system disk.
恢复消息即需要将内存中的内存镜像文件写入现在的系统磁盘。可以在更新系统磁盘后,由用户下发。Restoring the message requires writing the in-memory memory image file to the current system disk. It can be delivered by the user after updating the system disk.
S311,将内存镜像文件回写到更新后的系统磁盘,生成对应的镜像文件。S311: Write the memory image file back to the updated system disk to generate a corresponding image file.
在监听到恢复消息时,从内存中提取出内存镜像文件,回写到更新后的系统磁盘即将内存镜像文件重新写入系统磁盘,在对应的磁盘位置生成对应的镜像文件。When the recovery message is detected, the memory image file is extracted from the memory, and the updated system disk is written back to the system disk, and the corresponding image file is generated at the corresponding disk location.
S312,解压镜像文件。S312, extract the image file.
待镜像文件生成后,将镜像文件解压缩,释放到对应的具体目录,实现系统环境、业务版本以及数据的还原。After the image file is generated, the image file is decompressed and released to the corresponding specific directory to restore the system environment, service version, and data.
S313,判断更新系统磁盘是否成功。若是,则转到S314;若否,则转到S315。S313. Determine whether the update system disk is successful. If yes, go to S314; if no, go to S315.
在恢复系统磁盘完成后,检测数据是否更新完成,操作系统是否能够正常运行,若是,则判断更新系统磁盘成功,转到S314;若否,则转到S315。After the recovery of the system disk is completed, it is detected whether the data update is completed, whether the operating system can run normally, and if so, it is judged that the update system disk is successful, and the process goes to S314; if not, the process goes to S315.
S314,还原所有的系统磁盘操作功能。S314, restore all system disk operation functions.
之前屏蔽内存对系统磁盘的读写操作以及相关其它动作,现还原所有系统对系统磁盘的操作功能,系统正常运行。Before the memory is read and written to the system disk and other related actions, all system functions on the system disk are restored, and the system runs normally.
S315,提示需要手动干预处理。S315, prompting that manual intervention is required.
若判断更新系统磁盘失败,则提示信息告知需要人工手动干预处理,可以重新执行更新系统磁盘处理等。If it is judged that the update of the system disk fails, the prompt message informs that manual manual intervention processing is required, and the update system disk processing can be re-executed.
本公开实施例提供的系统磁盘管理方法,通过在磁盘中建立磁盘镜像文件备份磁盘数据,再在内存中同步建立内存镜像文件,能够在备份过程中分步备份内存镜像文件,内存不用每次遍历备份配置文件,只定时与磁盘镜像文件同步即可,降低磁盘之间的读写IO(Input/Output,输入/输出接口)操作,同时也降低CPU(Central Processing Unit,中央处理器)使用率,能够有效解决现有RAID盘之间进行高频的同步时,CPU和系统磁盘的IO冲高的问题,同时完成更新系统磁盘和磁盘数据的恢复,不需中断业务服务,提高用户服务质量。The system disk management method provided by the embodiment of the present disclosure can back up the memory image file in the backup process by establishing a disk image file to back up the disk data in the disk and then synchronizing the memory image file in the memory. The memory does not need to be traversed each time. Back up the configuration file and synchronize it with the disk image file at regular intervals to reduce the read/write IO (Input/Output, Input/Output interface) operations between the disks and reduce the CPU (Central Processing Unit) usage. It can effectively solve the problem of high CPU synchronization between the CPU and the system disk when the high frequency synchronization between the existing RAID disks is completed, and at the same time complete the recovery of the system disk and disk data, without interrupting the service service and improving the user service quality.
显然,本领域的技术人员应该明白,若将本公开实施例的方案应用于别的场景时,对方案内容进行相应改变,也都应当视为属于本公开的保护范围。Obviously, those skilled in the art should understand that if the solution of the embodiments of the present disclosure is applied to other scenarios, corresponding changes to the content of the solution should be considered as belonging to the protection scope of the present disclosure.
实施例四:Embodiment 4:
本公开实施例提供一种系统磁盘管理装置,具体示意图请参见图4。下面对各模块及功能进行进一步说明,包括:The embodiment of the present disclosure provides a system disk management device, and FIG. 4 is a specific schematic diagram. The following describes each module and function further, including:
备份模块401,用于获取系统磁盘的磁盘数据,将磁盘数据备份在内存中,生成内存镜像文件。The backup module 401 is configured to obtain disk data of the system disk, back up the disk data in the memory, and generate a memory image file.
获取系统磁盘的磁盘数据前需要设置备份配置文件,备份配置文件包含操作系统运行需 要的必备文件等数据的目录,是通过对系统磁盘中重要文件和必要文件进行分析,集合各类文件整理制作成的。Before you can obtain the disk data of the system disk, you need to set the backup configuration file. The backup configuration file contains the operating system. The catalog of necessary data such as necessary files is compiled by analyzing various important files and necessary files on the system disk and collecting various types of files.
其中获取系统磁盘的磁盘数据包括按照备份配置文件读取系统磁盘存储的数据,将读取到的数据作为磁盘数据。将磁盘数据备份在内存中即根据读取到的数据生成对应的内存镜像文件。The obtaining the disk data of the system disk includes reading the data stored in the system disk according to the backup configuration file, and using the read data as the disk data. Backing up disk data in memory generates a corresponding memory image file based on the read data.
获取系统磁盘的磁盘数据还包括监控在系统磁盘建立的磁盘镜像文件,将磁盘镜像文件作为磁盘数据。这种方式需要在系统磁盘中建立磁盘镜像文件,然后根据磁盘镜像文件,在内存中建立对应的内存镜像文件。Obtaining the disk data of the system disk also includes monitoring the disk image file created on the system disk and using the disk image file as the disk data. In this way, a disk image file is created in the system disk, and then a corresponding memory image file is created in the memory according to the disk image file.
生成内存镜像文件后,需要一直监控备份配置文件中的磁盘数据是否改变,改变即说明磁盘数据需要更新。若改变,需要判断将要更新的数据文件属性是新增数据还是更新数据。根据属性不同,采用不同的更新方法。当磁盘数据为新增数据时,采用增量方式,生成新增数据的内存镜像文件;当磁盘数据为更新数据时,采用差分方式,生成更新数据的内存镜像文件。新增数据为该数据文件第一次被写入内存镜像文件,之前没有这个数据文件,需要被创建;更新数据为该数据文件之前已经被写入内存镜像文件,需要将原来的内存镜像文件删除,再将新的数据通过压缩算法加入到镜像文件中,完成更新。After the memory image file is generated, you need to monitor whether the disk data in the backup configuration file changes. If the change indicates that the disk data needs to be updated. If it changes, you need to judge whether the data file attribute to be updated is new data or updated data. Different update methods are used depending on the attributes. When the disk data is newly added, the memory image file of the newly added data is generated in an incremental manner; when the disk data is updated data, the memory image file of the updated data is generated in a differential manner. The newly added data is the first time the data file is written to the memory image file. Before this data file is created, it needs to be created. The updated data is written to the memory image file before the data file, and the original memory image file needs to be deleted. Then, the new data is added to the image file through the compression algorithm to complete the update.
恢复模块402,配置成在系统磁盘发生更新后,使用内存镜像文件,对系统磁盘进行磁盘数据恢复。The recovery module 402 is configured to use the memory image file to perform disk data recovery on the system disk after the system disk is updated.
恢复模块配置成监听用于表征更新系统磁盘的更新消息,更新所述系统磁盘包括更换新磁盘或者修复磁盘。在监听到更新消息时,屏蔽内存对系统磁盘的读写操作,内存就不能再对系统磁盘中的数据进行任何更改,确保此时内存中运行的信息和操作系统磁盘分离开来,保证换盘等更新磁盘操作期间操作系统不会变化复位。因为之前一直在同步备份系统磁盘中的数据,此时屏蔽内存对系统磁盘的读写操作,还可以避免在重新导入数据的这段时间差内,磁盘中实际数据与内存镜像文件中的数据有差异导致系统磁盘更换后系统不稳定。The recovery module is configured to listen for update messages used to characterize the update system disk, including updating the new disk or repairing the disk. When listening to the update message, the memory is read and written to the system disk, and the memory can no longer make any changes to the data in the system disk, ensuring that the information running in the memory is separated from the operating system disk at this time, and the disk is guaranteed to be replaced. The operating system does not change reset during the update disk operation. Because the data in the backup system disk has been synchronized before, the memory is read and written to the system disk at this time, and the data in the disk can be prevented from being different from the data in the memory image file during the time difference of re-importing data. The system is unstable after the system disk is replaced.
恢复模块还配置成监听用于表征恢复系统磁盘的恢复消息。在监听到恢复消息时,将内存镜像文件回写到更新后的系统磁盘,生成镜像文件,解压镜像文件,释放到对应的具体目录,实现系统环境、业务版本以及数据的还原。The recovery module is also configured to listen for recovery messages used to characterize the recovery system disk. When the recovery message is detected, the memory image file is written back to the updated system disk, the image file is generated, the image file is decompressed, and the file is released to the corresponding specific directory to restore the system environment, service version, and data.
本公开实施例提供的系统磁盘管理装置,通过在内存中备份磁盘数据,能够完成更新系统磁盘和磁盘数据的恢复,不需中断业务服务,提高用户服务质量。The system disk management device provided by the embodiment of the present disclosure can restore the recovery of the system disk and the disk data by backing up the disk data in the memory, without interrupting the service service, and improving the user service quality.
显然,本领域的技术人员应该明白,若将本公开实施例的装置应用于别的场景时,对装置模块进行相应增减,也都应当视为属于本公开的保护范围。Obviously, those skilled in the art should understand that if the device of the embodiment of the present disclosure is applied to other scenarios, the corresponding increase or decrease of the device module should be considered as belonging to the protection scope of the present disclosure.
实施例五:Embodiment 5:
本公开实施例提供一种终端,包括系统磁盘、内存、以及实施例4的系统磁盘管理装置,请参见图5。The embodiment of the present disclosure provides a terminal, including a system disk, a memory, and a system disk management device of Embodiment 4. Referring to FIG. 5 .
本公开实施例提供的终端,通过系统磁盘管理装置,能够在内存中备份磁盘数据,完成更新系统磁盘和磁盘数据的恢复,不需中断业务服务,提高用户服务质量。The terminal provided by the embodiment of the present disclosure can back up the disk data in the memory through the system disk management device, and complete the recovery of the system disk and the disk data, without interrupting the service service and improving the user service quality.
显然,本领域的技术人员应该明白,上述本公开实施例的各模块或各步骤可以用通用的 计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在计算机存储介质(ROM/RAM、磁碟、光盘)中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。所以,本公开不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the modules or steps of the above embodiments of the present disclosure can be used universally. Implemented by computing devices, which may be centralized on a single computing device or distributed over a network of computing devices, optionally implemented in program code executable by the computing device, such that they may be The storage is performed by a computing device in a computer storage medium (ROM/RAM, disk, optical disk), and in some cases, the steps shown or described may be performed in an order different from that herein, or they may be separately It is made by making individual integrated circuit modules, or by making a plurality of modules or steps of them into a single integrated circuit module. Therefore, the present disclosure is not limited to any specific combination of hardware and software.
以上内容是结合具体的实施方式对本公开实施例所作的进一步详细说明,不能认定本公开的具体实施只局限于这些说明。对于本公开所属技术领域的普通技术人员来说,在不脱离本公开构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本公开的保护范围。 The above content is a further detailed description of the embodiments of the present disclosure in conjunction with the specific embodiments, and the specific implementation of the present disclosure is not limited to the description. It is to be understood by those skilled in the art that the present invention may be construed as being limited to the scope of the present disclosure.

Claims (12)

  1. 一种系统磁盘管理方法,其特征在于,包括:A system disk management method, comprising:
    获取系统磁盘的磁盘数据;Obtain disk data of the system disk;
    将所述磁盘数据备份在内存中,生成内存镜像文件;Backing up the disk data in the memory to generate a memory image file;
    在所述系统磁盘发生更新后,使用所述内存镜像文件,对所述系统磁盘进行磁盘数据恢复。After the system disk is updated, the memory disk file is used to perform disk data recovery on the system disk.
  2. 如权利要求1所述的系统磁盘管理方法,其特征在于,所述获取系统磁盘的磁盘数据包括:The system disk management method according to claim 1, wherein the obtaining the disk data of the system disk comprises:
    读取所述系统磁盘存储的数据,将读取到的数据作为所述磁盘数据;Reading data stored in the system disk, and using the read data as the disk data;
    或者,or,
    监控所述系统磁盘的磁盘镜像文件,将所述磁盘镜像文件作为所述磁盘数据。Monitoring a disk image file of the system disk, and using the disk image file as the disk data.
  3. 如权利要求1或2所述的系统磁盘管理方法,其特征在于,所述将所述磁盘数据备份在内存中,生成内存镜像文件包括:The system disk management method according to claim 1 or 2, wherein the backing up the disk data in a memory, and generating a memory image file comprises:
    当所述磁盘数据为新增数据时,采用增量方式,生成所述新增数据的内存镜像文件;When the disk data is newly added data, the memory image file of the newly added data is generated in an incremental manner;
    或者,or,
    当所述磁盘数据为更新数据时,采用差分方式,生成所述更新数据的内存镜像文件。When the disk data is update data, a memory image file of the update data is generated in a differential manner.
  4. 如权利要求1至3中任一项所述的系统磁盘管理方法,其特征在于,所述在所述系统磁盘发生更新后,使用所述内存镜像文件,对所述系统磁盘进行磁盘数据恢复包括:The system disk management method according to any one of claims 1 to 3, wherein the disk data recovery of the system disk is performed by using the memory image file after the system disk is updated. :
    监听用于表征恢复所述系统磁盘的恢复消息;Listening for recovery messages used to characterize recovery of the system disk;
    在监听到所述恢复消息时,将所述内存镜像文件回写到更新后的系统磁盘,生成对应的镜像文件;When the recovery message is detected, the memory image file is written back to the updated system disk to generate a corresponding image file;
    解压所述镜像文件。Extract the image file.
  5. 如权利要求1至4中任一项所述的系统磁盘管理方法,其特征在于,还包括:The system disk management method according to any one of claims 1 to 4, further comprising:
    监听用于表征更新所述系统磁盘的更新消息,所述更新所述系统磁盘包括更换新磁盘或者修复磁盘;Monitoring an update message for characterizing updating the system disk, the updating the system disk including replacing a new disk or repairing a disk;
    在监听到所述更新消息时,屏蔽内存对所述系统磁盘的读写操作。When the update message is heard, the memory is read and written to the system disk.
  6. 一种系统磁盘管理装置,其特征在于,包括:A system disk management device, comprising:
    备份模块,配置成获取系统磁盘的磁盘数据,将所述磁盘数据备份在内存中,生成内存镜像文件;The backup module is configured to obtain disk data of the system disk, back up the disk data in the memory, and generate a memory image file;
    恢复模块,配置成在所述系统磁盘发生更新后,使用所述内存镜像文件,对所述系统磁盘进行磁盘数据恢复。And a recovery module configured to perform disk data recovery on the system disk by using the memory image file after the system disk is updated.
  7. 如权利要求6所述的系统磁盘管理装置,其特征在于,所述备份模块配置成读取所述系统磁盘存储的数据,将读取到的数据作为所述磁盘数据;或者,监控所述系统磁盘的磁盘镜像文件,将所述磁盘镜像文件作为所述磁盘数据。The system disk management apparatus according to claim 6, wherein the backup module is configured to read data stored in the system disk, use the read data as the disk data; or monitor the system A disk image file of the disk, and the disk image file is used as the disk data.
  8. 如权利要求6或7所述的系统磁盘管理装置,其特征在于,所述备份模块配置成 当所述磁盘数据为新增数据时,采用增量方式,生成所述新增数据的内存镜像文件;或者,当所述磁盘数据为更新数据时,采用差分方式,生成所述更新数据的内存镜像文件。A system disk management apparatus according to claim 6 or 7, wherein said backup module is configured to When the disk data is newly added data, the memory image file of the newly added data is generated in an incremental manner; or, when the disk data is updated data, the memory of the updated data is generated by using a differential manner. Image file.
  9. 如权利要求6至8中任一项所述的系统磁盘管理装置,其特征在于,所述恢复模块配置成监听用于表征恢复所述系统磁盘的恢复消息,在监听到所述恢复消息时,将所述内存镜像文件回写到更新后的系统磁盘,生成镜像文件,解压所述镜像文件。The system disk management apparatus according to any one of claims 6 to 8, wherein the recovery module is configured to monitor a recovery message for characterizing recovery of the system disk, when the recovery message is monitored, Write the memory image file back to the updated system disk, generate an image file, and extract the image file.
  10. 如权利要求6至9任一项所述的系统磁盘管理装置,其特征在于,所述恢复模块还配置成监听用于表征更新所述系统磁盘的更新消息,所述更新所述系统磁盘包括更换新磁盘或者修复磁盘,在监听到所述更新消息时,屏蔽内存对所述系统磁盘的读写操作。The system disk management apparatus according to any one of claims 6 to 9, wherein the recovery module is further configured to monitor an update message for characterizing the update of the system disk, the updating the system disk including replacement The new disk or the repair disk, when the update message is monitored, the memory is read and written to the system disk.
  11. 一种终端,其特征在于,包括系统磁盘、内存、以及如权利要求6至10任一项所述的系统磁盘管理装置。A terminal characterized by comprising a system disk, a memory, and a system disk management device according to any one of claims 6 to 10.
  12. 一种计算机存储介质,所述计算机存储介质存储有执行指令,所述执行指令用于执行权利要求1至5中任一项所述的方法。 A computer storage medium storing execution instructions for performing the method of any one of claims 1 to 5.
PCT/CN2017/097505 2016-08-17 2017-08-15 System disk management method and device WO2018033062A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610682879.1 2016-08-17
CN201610682879.1A CN107765990A (en) 2016-08-17 2016-08-17 A kind of system disk management method and device

Publications (1)

Publication Number Publication Date
WO2018033062A1 true WO2018033062A1 (en) 2018-02-22

Family

ID=61197250

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/097505 WO2018033062A1 (en) 2016-08-17 2017-08-15 System disk management method and device

Country Status (2)

Country Link
CN (1) CN107765990A (en)
WO (1) WO2018033062A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827323A (en) * 2022-12-01 2023-03-21 摩尔线程智能科技(北京)有限责任公司 Method, apparatus and computer readable medium for restoring files

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932113A (en) * 2018-06-28 2018-12-04 郑州云海信息技术有限公司 A kind of disk management method, device, equipment and readable storage medium storing program for executing
CN109683983B (en) * 2018-12-11 2021-09-24 海信视像科技股份有限公司 Method and equipment for generating and loading mirror image file
CN115373908A (en) * 2021-05-21 2022-11-22 华为技术有限公司 Data storage method and related device
CN114416434B (en) * 2022-03-30 2022-07-08 苏州浪潮智能科技有限公司 Bare metal disk backup method and device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1534490A (en) * 2003-03-31 2004-10-06 联想(北京)有限公司 Realization method of computer hard disk data restoring and back-up
CN1940875A (en) * 2005-09-26 2007-04-04 英业达股份有限公司 Fast data standby processing method and system for computer platform
CN1991777A (en) * 2005-12-27 2007-07-04 英业达股份有限公司 Data prepackage system and method for mirror document
CN103019890A (en) * 2012-12-24 2013-04-03 清华大学 Block-level disk data protection system and method thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003050683A1 (en) * 2001-08-31 2003-06-19 Legend (Beijing) Limited Method for backing up and recovering data in the hard disk of a computer
US20070128899A1 (en) * 2003-01-12 2007-06-07 Yaron Mayer System and method for improving the efficiency, comfort, and/or reliability in Operating Systems, such as for example Windows
CN1873632A (en) * 2005-06-03 2006-12-06 英业达股份有限公司 Identification system and method for hot plug peripheral unit
CN101110036A (en) * 2007-08-22 2008-01-23 中兴通讯股份有限公司 Method and device for batch installing operating system
CN103019804B (en) * 2012-12-28 2016-05-11 中国人民解放军国防科学技术大学 The virtualized VPS quick migration method of OpenVZ
CN105353982B (en) * 2015-10-28 2018-12-11 浪潮(北京)电子信息产业有限公司 A kind of data access processing method and device based on circulation array

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1534490A (en) * 2003-03-31 2004-10-06 联想(北京)有限公司 Realization method of computer hard disk data restoring and back-up
CN1940875A (en) * 2005-09-26 2007-04-04 英业达股份有限公司 Fast data standby processing method and system for computer platform
CN1991777A (en) * 2005-12-27 2007-07-04 英业达股份有限公司 Data prepackage system and method for mirror document
CN103019890A (en) * 2012-12-24 2013-04-03 清华大学 Block-level disk data protection system and method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827323A (en) * 2022-12-01 2023-03-21 摩尔线程智能科技(北京)有限责任公司 Method, apparatus and computer readable medium for restoring files
CN115827323B (en) * 2022-12-01 2024-02-02 摩尔线程智能科技(北京)有限责任公司 Method, apparatus and computer readable medium for restoring files

Also Published As

Publication number Publication date
CN107765990A (en) 2018-03-06

Similar Documents

Publication Publication Date Title
WO2018033062A1 (en) System disk management method and device
US9645892B1 (en) Recording file events in change logs while incrementally backing up file systems
WO2021169277A1 (en) Data synchronization method, apparatus and device, and computer-readable storage medium
US10303570B2 (en) Method and apparatus for managing data recovery of distributed storage system
US8868858B2 (en) Method and apparatus of continuous data backup and access using virtual machines
US11144405B2 (en) Optimizing database migration in high availability and disaster recovery computing environments
US20150213100A1 (en) Data synchronization method and system
US8578203B2 (en) Providing a backup service from a remote backup data center to a computer through a network
US10204016B1 (en) Incrementally backing up file system hard links based on change logs
US10726042B2 (en) Replication control using eventually consistent meta-data
US10809922B2 (en) Providing data protection to destination storage objects on remote arrays in response to assignment of data protection to corresponding source storage objects on local arrays
CN111984465A (en) Database remote backup method, device, medium and electronic equipment
US9262290B2 (en) Flash copy for disaster recovery (DR) testing
US11550677B2 (en) Client-less database system recovery
WO2015043155A1 (en) Method and device for network element backup and recovery based on command set
CN104750755A (en) Method and system for recovering data after switching between main database and standby database
US11144233B1 (en) Efficiently managing point-in-time copies of data within a primary storage system
CN105389231A (en) Database dual-computer backup method and system
JP6070146B2 (en) Information processing apparatus and backup method
US11093380B1 (en) Automated testing of backup component upgrades within a data protection environment
CN113064766A (en) Data backup method, device, equipment and storage medium
WO2018076696A1 (en) Data synchronization method and out-of-band management device
CN115955488A (en) Distributed storage copy cross-computer room placement method and device based on copy redundancy
US8782006B1 (en) Method and apparatus for file sharing between continuous and scheduled backups
US8595271B1 (en) Systems and methods for performing file system checks

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17841034

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17841034

Country of ref document: EP

Kind code of ref document: A1