CN112256492A - Block device backup method, device and storage medium - Google Patents
Block device backup method, device and storage medium Download PDFInfo
- Publication number
- CN112256492A CN112256492A CN202011533237.8A CN202011533237A CN112256492A CN 112256492 A CN112256492 A CN 112256492A CN 202011533237 A CN202011533237 A CN 202011533237A CN 112256492 A CN112256492 A CN 112256492A
- Authority
- CN
- China
- Prior art keywords
- storage area
- backup
- block device
- modified
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1438—Restarting or rejuvenating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1456—Hardware arrangements for backup
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention belongs to the technical field of computer storage, and discloses a block device backup method, a block device backup device and a storage medium. The method comprises the following steps: when the operating system is abnormally restarted, searching a target storage area identifier with a modified state as a modified state from area state information, wherein the area state information comprises each storage area identifier in the block device to be backed up and a modified state corresponding to each storage area identifier; determining a corresponding target storage area according to the target storage area identifier; and backing up the data in the target storage area. By the above method, when the operating system is abnormally restarted, the target storage area with the modified state as the modified state in the area state information is inquired, the target storage area with the modified and un-backed up data of the block device before restarting can be determined, and the un-backed up data in the target storage area is backed up, so that differential backup or incremental backup can be normally performed.
Description
Technical Field
The present invention relates to the field of computer storage technologies, and in particular, to a block device backup method, apparatus, device, and storage medium.
Background
When the existing block-level backup system works, a bitmap is often required to be generated for recording which blocks are changed, and the blocks which are changed can be accurately backed up by combining the bitmap when differential backup or incremental backup is performed next time.
This bitmap must be saved on disk and can be used again after system reboot. The time for recording the bitmap to the disk can be different, and the conventional block-level backup system on the market usually refreshes the disk at regular time or when the system is shut down, and generally does not refresh the disk every time the bitmap is changed, so that the burden of the system is greatly increased, and the operation of a service system is influenced.
If the system suddenly crashes or loses power, the change information recorded in the bitmap since the last time it was flushed to disk will be lost because they are still in memory and have not been flushed to disk. After the system is restarted, the bitmap cannot be used, the differential backup or incremental backup can not be carried out again, the basic backup or the full data backup must be carried out again, if the bitmap is a large disk, the time for carrying out the basic backup is long, the user experience is seriously influenced, and the product competitiveness is reduced.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a block device backup method, a block device backup device and a block device backup storage medium, and aims to solve the technical problem that in the prior art, an operating system suddenly goes wrong or goes down, and basic backup or full data backup is required to be carried out again when differential backup or incremental backup cannot be carried out any more.
In order to achieve the above object, the present invention provides a block device backup method, including the following steps:
when the operating system is abnormally restarted, searching a target storage area identifier with a modified state as a modified state from area state information, wherein the area state information comprises each storage area identifier in the block device to be backed up and a modified state corresponding to each storage area identifier;
determining a corresponding target storage area according to the target storage area identifier;
and backing up the data in the target storage area.
Optionally, before the step of searching the target storage area identifier whose modified state is the modified state from the area change record when the operating system is abnormally restarted, the method further includes:
when a data modification request is received, determining a corresponding storage area identifier to be modified according to the data modification request;
and updating the modification state corresponding to the identification of the area to be modified in the area state information into a modified state.
Optionally, the step of determining, when a data modification request is received, a corresponding to-be-modified storage area identifier according to the data modification request includes:
when a data modification request is received, determining the address of a block device to be modified according to the data modification request;
searching a storage area identifier corresponding to the address of the block device to be modified from a preset mapping relation, and using the searched storage area identifier as the storage area identifier to be modified, wherein the preset mapping relation comprises: the correspondence between each storage area identification and the block device address range.
Optionally, before the step of determining the address of the block device to be modified according to the data modification request when the data modification request is received, the method further includes:
acquiring the capacity of a block device to be backed up;
dividing the block equipment to be backed up into a preset number of storage areas according to the capacity, and determining the address range of the block equipment corresponding to each storage area;
acquiring storage area identifications corresponding to the storage areas;
and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation.
Optionally, the step of using the correspondence between the storage area identifier of each storage area and the address range of the block device as a preset mapping relationship includes:
generating corresponding modified states for the storage area identifications in the area state information, and setting the modified states corresponding to the storage area identifications to be unmodified states respectively;
distributing corresponding storage area identifications for each storage area;
and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation.
Optionally, after the step of using the correspondence between the storage area identifier of each storage area and the address range of the block device as the preset mapping relationship, the method further includes:
acquiring address information of backup equipment;
establishing an index relationship between the block device address range of each storage area and the backup address range corresponding to the backup device according to the address information;
and backing up the data of each storage area in the block equipment to be backed up to a backup address range corresponding to the backup equipment according to the index relation.
Optionally, the step of backing up the data in the target storage area includes:
determining a corresponding target backup address range of the target storage area in the backup device according to the index relation;
and clearing the data in the target backup address range, and backing up the data in the target storage area to the target backup address range of the backup device.
In addition, to achieve the above object, the present invention further provides a block device backup apparatus, including:
the searching module is used for searching a target storage area identifier of which the modification state is the modified state from area state information when the operating system is abnormally restarted, wherein the area state information comprises all storage area identifiers in the block device to be backed up and modification states corresponding to all the storage area identifiers;
the determining module is used for determining a corresponding target storage area according to the target storage area identifier;
and the backup module is used for backing up the data in the target storage area.
In addition, to achieve the above object, the present invention further provides a block device backup device, including: a memory, a processor and a block device backup program stored on the memory and executable on the processor, the block device backup program configured to implement the steps of the block device backup method as described above.
Furthermore, to achieve the above object, the present invention further provides a storage medium having stored thereon a block device backup program, which when executed by a processor implements the steps of the block device backup method as described above.
When the operating system is abnormally restarted, searching a target storage area identifier of which the modification state is the modified state from area state information, wherein the area state information comprises all storage area identifiers in the block device to be backed up and modification states corresponding to all the storage area identifiers; determining a corresponding target storage area according to the target storage area identifier; and backing up the data in the target storage area. By the mode, when the operating system is abnormally restarted, the target storage area with the modified state as the modified state in the area state information is inquired, the target storage area with the modified and un-backed data in the block device before restarting can be determined, and the un-backed data in the target storage area is backed up, so that differential backup or incremental backup can be normally performed, the problem that full backup is needed due to loss of modified records caused by abnormal operating system can not be generated, and system resources are greatly saved.
Drawings
Fig. 1 is a schematic structural diagram of a block device backup device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a block device backup method according to a first embodiment of the present invention;
FIG. 3 is a diagram of area status information according to an embodiment of a block device backup method of the present invention;
FIG. 4 is a flowchart illustrating a block device backup method according to a second embodiment of the present invention;
FIG. 5 is a flowchart illustrating a block device backup method according to a third embodiment of the present invention;
fig. 6 is a block diagram of a block device backup apparatus according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a block device backup device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the block device backup device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the block device backup device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a block device backup program.
In the block device backup apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the block device backup device according to the present invention may be disposed in the block device backup device, and the block device backup device calls the block device backup program stored in the memory 1005 through the processor 1001 and executes the block device backup method according to the embodiment of the present invention.
An embodiment of the present invention provides a block device backup method, and referring to fig. 2, fig. 2 is a schematic flowchart of a first embodiment of a block device backup method according to the present invention.
In this embodiment, the block device backup method includes the following steps:
step S100: when the operating system is abnormally restarted, searching a target storage area identifier with a modified state as a modified state from area state information, wherein the area state information comprises each storage area identifier in the block device to be backed up and the modified state corresponding to each storage area identifier.
It should be noted that the execution main body of this embodiment may be a terminal device, for example, a computer, an operating system is equipped on the terminal device for interacting with a user, and the operating system may be Windows, Linux, and the like, which is not limited in this embodiment.
It can be understood that the abnormal restart is a restart caused by the abnormal shutdown of the operating system, and the reason of the abnormal restart includes a sudden system failure, a downtime, or a sudden power failure, and the like, which is not limited in this embodiment.
It should be noted that the area status information records a storage area identifier including each storage area in the block device and a modification status corresponding to the storage area identifier. The storage area identifier is an identifier for distinguishing the storage area, and the corresponding storage area can be found through the storage area identifier. For example: if the storage area identifier is 100 and the corresponding modification state is 1, it indicates that the data in the storage area identified as 100 in the block device has been modified after the last backup, and the data in the storage area is the target storage area and needs to be backed up again.
It should be noted that the modified state includes a modified state and an unmodified state. When the modification state is the modified state, the data in the corresponding storage area is modified again after the last backup, and when the modification state is the unmodified state, the data in the corresponding storage area is unmodified after the last backup. For example: as shown in fig. 3, the modified state is 1, which indicates a modified state, and the modified state is 0, which indicates an unmodified state.
It should be understood that the area state information is recorded in a non-volatile storage medium, such as a magnetic disk, and the embodiment is not limited in that the modification state can be recorded in bits.
It should be noted that a block device is a type of i/o device, and stores information in fixed-size blocks, each block has its own address, and data of a certain length can be read from any position of the device, such as a hard disk, a U-disk, an SD card, and the like.
Step S200: and determining a corresponding target storage area according to the target storage area identifier.
It should be noted that, there is a corresponding relationship between the target storage area and the target storage area identifier, and the corresponding target storage area can be found through the target storage area identifier.
Step S300: and backing up the data in the target storage area.
Further, step S300 includes: determining a corresponding target backup address range of the target storage area in the backup device according to the index relation; and clearing the data in the target backup address range, and backing up the data in the target storage area to the target backup address range of the backup device.
It should be noted that the backup device may be a nonvolatile storage medium, and the capacity of the backup device should be greater than or equal to the capacity of the block device. The backup device is used for performing full backup and incremental backup or differential backup on the block device.
It is understood that the address information of the backup device includes the number of the storage unit in the backup device. The block device comprises a plurality of storage areas, and each storage area corresponds to a block device address range. The backup address range should be equal in size to the block device address range corresponding to each storage area. And establishing an index relationship between the address range of the block device corresponding to each storage area and the backup address range corresponding to the backup device, and fully backing up the data in the block device to the backup device according to the index relationship.
It should be noted that, because the operating system is abnormally restarted, the data in the target storage area has been modified, but the data in the target backup address range corresponding to the target storage area has no corresponding backup, so that the data in the target backup address range needs to be cleared, and then the data in the target storage area is backed up to the target backup address range of the backup device, so as to obtain the latest backup data, and the full backup does not need to be performed again. For example: the target storage area with the storage area identification 001 has data modified before the operating system fails, but the operating system does not backup the modified data in the target storage area due to a sudden failure. After the operating system is restarted, inquiring the area state information to know that the data in the target storage area 001 is modified and is not backed up, wherein the target backup address of the target storage area 001 in the backup device is 0H-3fffffffH according to the index relationship, at this time, the data in 0H-3 fffffh needs to be cleared, and the data in the target storage area 001 is backed up to 0H-3 fffffh.
It is understood that after the data in the target storage area is backed up, the modified state corresponding to the target storage area identification is updated to an unmodified state.
In this embodiment, when an operating system is abnormally restarted, a target storage area identifier whose modification state is a modified state is searched from area state information, where the area state information includes storage area identifiers in a block device to be backed up and modification states corresponding to the storage area identifiers; determining a corresponding target storage area according to the target storage area identifier; and backing up the data in the target storage area. By the mode, when the operating system is abnormally restarted, the target storage area with the modified state as the modified state in the area state information is inquired, the target storage area with the modified and un-backed data in the block device before restarting can be determined, and the un-backed data in the target storage area is backed up, so that differential backup or incremental backup can be normally performed, the problem that full backup is needed due to loss of modified records caused by abnormal operating system can not be generated, and system resources are greatly saved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a block device backup method according to a second embodiment of the present invention.
Based on the first embodiment, before the step S100, the block device backup method in this embodiment further includes:
step S010: and when a data modification request is received, determining a corresponding storage area identifier to be modified according to the data modification request.
Further, step S010 includes: when a data modification request is received, determining the address of a block device to be modified according to the data modification request; searching a storage area identifier corresponding to the address of the block device to be modified from a preset mapping relation, and using the searched storage area identifier as the storage area identifier to be modified, wherein the preset mapping relation comprises: the correspondence between each storage area identification and the block device address range.
It should be noted that the data modification request refers to a request generated by the operating system when a user needs to modify data in the fast device when interacting with the operating system, and the request includes a device address of a block to be modified for data modification.
It can be understood that, according to the address of the block device to be modified, the modified storage area to which the address of the block device to be modified belongs can be found, and the address range of the block device corresponding to the modified storage area is obtained. According to the preset mapping relation, the storage area identification to be modified corresponding to the block device address range can be searched from the area state information.
Step S020: and updating the modification state corresponding to the identification of the area to be modified in the area state information into a modified state.
It should be noted that, because the data in the storage area to be modified is modified, the modification state corresponding to the identification of the storage area to be modified needs to be updated to the modified state. If the modified state is already the modified state, the modified state is maintained as the modified state.
In the embodiment, when a data modification request is received, a corresponding storage area identifier to be modified is determined according to the data modification request; and updating the modification state corresponding to the identification of the area to be modified in the area state information into a modified state. Through the above manner, in the embodiment, when the data of the block device is modified, the modification state of the storage area identifier corresponding to the storage area of the corresponding block device is immediately updated, so as to record the modification state of the storage area, thereby preventing the problem that the full backup is required due to the loss of the record of the storage area with the changed data under an abnormal condition.
Referring to fig. 5, fig. 5 is a flowchart illustrating a block device backup method according to a third embodiment of the present invention.
Based on the second embodiment, before the step S010, the block device backup method according to this embodiment further includes:
step S001: and acquiring the capacity of the block equipment to be backed up.
It should be noted that the capacity of the block device to be backed up refers to the storage capacity, for example: 128GB, 256GB, etc., and the present embodiment is not limited.
Step S002: and dividing the block equipment to be backed up into a preset number of storage areas according to the capacity, and determining the address range of the block equipment corresponding to each storage area.
It can be understood that, according to the difference of the storage capacity of the block devices to be backed up, the preset number of the partitions of the block devices to be backed up is also different, and the larger storage capacity can be partitioned into the preset number of storage areas, where the preset number can be 128, 256, 512, and the like, and this embodiment is not limited.
Step S003: and acquiring storage area identifications corresponding to the storage areas.
It should be noted that the storage area identifiers are used to distinguish different storage areas, and a preset number of storage area identifiers may be generated according to the order of the storage areas.
Step S004: and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation.
Further, step S004 includes: generating corresponding modified states for the storage area identifications in the area state information, and setting the modified states corresponding to the storage area identifications to be unmodified states respectively; distributing corresponding storage area identifications for each storage area; and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation.
It can be understood that, by dividing the block devices into a preset number of storage areas, each storage area occupies a corresponding block device address range, and a mapping relationship is established between a corresponding block device address of each storage area and a corresponding storage area identifier, so that the corresponding identifier is conveniently searched through addresses.
It should be understood that the modified state should be an unmodified state if the corresponding modified state is assigned to each storage region identification for the first time.
Further, after step S004, the method further includes: acquiring address information of backup equipment; establishing an index relationship between the block device address range of each storage area and the backup address range corresponding to the backup device according to the address information; and backing up the data of each storage area in the block equipment to be backed up to a backup address range corresponding to the backup equipment according to the index relation.
It should be noted that the backup device may be a nonvolatile storage medium, and the capacity of the backup device should be greater than or equal to the capacity of the block device. The backup device is used for performing full backup and incremental backup or differential backup on the block device.
It is understood that the address information of the backup device includes the number of the storage unit in the backup device. The block device comprises a plurality of storage areas, and each storage area corresponds to a block device address range. The backup address range should be equal in size to the block device address range corresponding to each storage area. And establishing an index relationship between the address range of the block device corresponding to each storage area and the backup address range corresponding to the backup device, and fully backing up the data in the block device to the backup device according to the index relationship.
The embodiment obtains the capacity of the block device to be backed up; dividing the block equipment to be backed up into a preset number of storage areas according to the capacity, and determining the address range of the block equipment corresponding to each storage area; acquiring storage area identifications corresponding to the storage areas; and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation. Through the above manner, the embodiment may divide the block device to be backed up into the preset number of storage areas, and obtain the address range of each storage area in the block device, even if a large disk may be divided into the preset number of areas, such as 256 or 512 areas, if all the areas are changed and are recorded and written to the disk, only 256 or 512 IO may be generated at most, and there is almost no influence on the system.
In addition, an embodiment of the present invention further provides a storage medium, where the storage medium stores a block device backup program, and the block device backup program, when executed by a processor, implements the steps of the block device backup method described above.
Referring to fig. 6, fig. 6 is a block diagram of a block device backup apparatus according to a first embodiment of the present invention.
As shown in fig. 6, a block device backup apparatus according to an embodiment of the present invention includes:
the searching module 10 is configured to search, when the operating system is abnormally restarted, a target storage area identifier whose modified state is a modified state from area state information, where the area state information includes storage area identifiers in the block device to be backed up and modification states corresponding to the storage area identifiers;
a determining module 20, configured to determine a corresponding target storage area according to the target storage area identifier;
and the backup module 30 is configured to backup data in the target storage area.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
In this embodiment, when an operating system is abnormally restarted, a target storage area identifier whose modification state is a modified state is searched from area state information, where the area state information includes storage area identifiers in a block device to be backed up and modification states corresponding to the storage area identifiers; determining a corresponding target storage area according to the target storage area identifier; and backing up the data in the target storage area. By the mode, when the operating system is abnormally restarted, the target storage area with the modified state as the modified state in the area state information is inquired, the target storage area with the modified and un-backed data in the block device before restarting can be determined, and the un-backed data in the target storage area is backed up, so that differential backup or incremental backup can be normally performed, the problem that full backup is needed due to loss of modified records caused by abnormal operating system can not be generated, and system resources are greatly saved.
In an embodiment, the search module 10 is further configured to determine, when a data modification request is received, a corresponding to-be-modified storage area identifier according to the data modification request; and updating the modification state corresponding to the identification of the area to be modified in the area state information into a modified state.
In an embodiment, the search module 10 is further configured to determine, when a data modification request is received, an address of a block to be modified according to the data modification request; searching a storage area identifier corresponding to the address of the block device to be modified from a preset mapping relation, and using the searched storage area identifier as the storage area identifier to be modified, wherein the preset mapping relation comprises: the correspondence between each storage area identification and the block device address range.
In an embodiment, the searching module 10 is further configured to obtain a capacity of a block device to be backed up; dividing the block equipment to be backed up into a preset number of storage areas according to the capacity, and determining the address range of the block equipment corresponding to each storage area; acquiring storage area identifications corresponding to the storage areas; and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation.
In an embodiment, the search module 10 is further configured to generate a corresponding modified state for each storage area identifier in the area state information, and set the modified state corresponding to each storage area identifier as an unmodified state respectively; distributing corresponding storage area identifications for each storage area; and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation.
In an embodiment, the search module 10 is further configured to obtain address information of the backup device; establishing an index relationship between the block device address range of each storage area and the backup address range corresponding to the backup device according to the address information; and backing up the data of each storage area in the block equipment to be backed up to a backup address range corresponding to the backup equipment according to the index relation.
In an embodiment, the backup module 30 is further configured to determine, according to the index relationship, a target backup address range corresponding to the target storage area in the backup device; and clearing the data in the target backup address range, and backing up the data in the target storage area to the target backup address range of the backup device.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the block device backup method provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A block device backup method, comprising:
when the operating system is abnormally restarted, searching a target storage area identifier with a modified state as a modified state from area state information, wherein the area state information comprises each storage area identifier in the block device to be backed up and a modified state corresponding to each storage area identifier;
determining a corresponding target storage area according to the target storage area identifier;
and backing up the data in the target storage area.
2. The block device backup method according to claim 1, wherein before the step of searching the target storage area identifier whose modified state is the modified state from the area change record when the operating system is abnormally restarted, the method further comprises:
when a data modification request is received, determining a corresponding storage area identifier to be modified according to the data modification request;
and updating the modification state corresponding to the identification of the area to be modified in the area state information into a modified state.
3. The block device backup method according to claim 2, wherein the step of determining the corresponding to-be-modified storage area identifier according to the data modification request when receiving the data modification request comprises:
when a data modification request is received, determining the address of a block device to be modified according to the data modification request;
searching a storage area identifier corresponding to the address of the block device to be modified from a preset mapping relation, and using the searched storage area identifier as the storage area identifier to be modified, wherein the preset mapping relation comprises: the correspondence between each storage area identification and the block device address range.
4. The block device backup method according to claim 3, wherein before the step of determining the address of the block device to be modified according to the data modification request when the data modification request is received, further comprising:
acquiring the capacity of a block device to be backed up;
dividing the block equipment to be backed up into a preset number of storage areas according to the capacity, and determining the address range of the block equipment corresponding to each storage area;
acquiring storage area identifications corresponding to the storage areas;
and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation.
5. The block device backup method according to claim 4, wherein the step of using the correspondence between the storage area identifier of each storage area and the address range of the block device as a preset mapping relationship comprises:
generating corresponding modified states for the storage area identifications in the area state information, and setting the modified states corresponding to the storage area identifications to be unmodified states respectively;
distributing corresponding storage area identifications for each storage area;
and taking the corresponding relation between the storage area identification of each storage area and the address range of the block device as a preset mapping relation.
6. The block device backup method according to claim 5, wherein after the step of using the correspondence between the storage area identifier of each storage area and the address range of the block device as the preset mapping relationship, the method further comprises:
acquiring address information of backup equipment;
establishing an index relationship between the block device address range of each storage area and the backup address range corresponding to the backup device according to the address information;
and backing up the data of each storage area in the block equipment to be backed up to a backup address range corresponding to the backup equipment according to the index relation.
7. The block device backup method according to claim 6, wherein the step of backing up the data in the target storage area comprises:
determining a corresponding target backup address range of the target storage area in the backup device according to the index relation;
and clearing the data in the target backup address range, and backing up the data in the target storage area to the target backup address range of the backup device.
8. A block device backup apparatus, characterized in that the block device backup apparatus comprises:
the searching module is used for searching a target storage area identifier of which the modification state is the modified state from area state information when the operating system is abnormally restarted, wherein the area state information comprises all storage area identifiers in the block device to be backed up and modification states corresponding to all the storage area identifiers;
the determining module is used for determining a corresponding target storage area according to the target storage area identifier;
and the backup module is used for backing up the data in the target storage area.
9. A block device backup device, characterized in that the device comprises: memory, a processor and a block device backup program stored on the memory and executable on the processor, the block device backup program being configured to implement the steps of the block device backup method according to any of claims 1 to 7.
10. A storage medium having stored thereon a block device backup program which, when executed by a processor, implements the steps of the block device backup method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011533237.8A CN112256492A (en) | 2020-12-22 | 2020-12-22 | Block device backup method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011533237.8A CN112256492A (en) | 2020-12-22 | 2020-12-22 | Block device backup method, device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112256492A true CN112256492A (en) | 2021-01-22 |
Family
ID=74225308
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011533237.8A Pending CN112256492A (en) | 2020-12-22 | 2020-12-22 | Block device backup method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112256492A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113505026A (en) * | 2021-09-10 | 2021-10-15 | 深圳市科力锐科技有限公司 | Method, device and equipment for verifying backup data and storage medium |
CN113535470A (en) * | 2021-06-23 | 2021-10-22 | 浙江中控技术股份有限公司 | Configuration backup method and device, electronic equipment and storage medium |
CN117170942A (en) * | 2023-11-03 | 2023-12-05 | 腾讯科技(深圳)有限公司 | Database backup method based on file system snapshot and related equipment |
CN117591345A (en) * | 2024-01-18 | 2024-02-23 | 柏科数据技术(深圳)股份有限公司 | Ceph-specific data synchronization method, device, equipment and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1466030A (en) * | 2002-06-28 | 2004-01-07 | 联想(北京)有限公司 | Method for preventing destroying file system in abnormal power cutting off |
CN101344868A (en) * | 2008-08-28 | 2009-01-14 | 北京握奇数据系统有限公司 | Data backup and acquiring method and device |
CN104391760A (en) * | 2014-11-24 | 2015-03-04 | 华为技术有限公司 | Data backup method, server and system |
CN106105161A (en) * | 2014-03-18 | 2016-11-09 | Netapp股份有限公司 | To cloud data storage device Backup Data while maintaining storage efficiency |
CN108255740A (en) * | 2017-12-07 | 2018-07-06 | 深圳市中易通安全芯科技有限公司 | A kind of FLASH equilibriums erasing-writing method and system |
CN111143323A (en) * | 2019-12-02 | 2020-05-12 | 新华三大数据技术有限公司 | MPP database management method, device and system |
CN111338842A (en) * | 2018-12-19 | 2020-06-26 | 中国移动通信集团云南有限公司 | File backup method and device |
-
2020
- 2020-12-22 CN CN202011533237.8A patent/CN112256492A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1466030A (en) * | 2002-06-28 | 2004-01-07 | 联想(北京)有限公司 | Method for preventing destroying file system in abnormal power cutting off |
CN101344868A (en) * | 2008-08-28 | 2009-01-14 | 北京握奇数据系统有限公司 | Data backup and acquiring method and device |
CN106105161A (en) * | 2014-03-18 | 2016-11-09 | Netapp股份有限公司 | To cloud data storage device Backup Data while maintaining storage efficiency |
CN104391760A (en) * | 2014-11-24 | 2015-03-04 | 华为技术有限公司 | Data backup method, server and system |
CN108255740A (en) * | 2017-12-07 | 2018-07-06 | 深圳市中易通安全芯科技有限公司 | A kind of FLASH equilibriums erasing-writing method and system |
CN111338842A (en) * | 2018-12-19 | 2020-06-26 | 中国移动通信集团云南有限公司 | File backup method and device |
CN111143323A (en) * | 2019-12-02 | 2020-05-12 | 新华三大数据技术有限公司 | MPP database management method, device and system |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113535470A (en) * | 2021-06-23 | 2021-10-22 | 浙江中控技术股份有限公司 | Configuration backup method and device, electronic equipment and storage medium |
CN113505026A (en) * | 2021-09-10 | 2021-10-15 | 深圳市科力锐科技有限公司 | Method, device and equipment for verifying backup data and storage medium |
CN113505026B (en) * | 2021-09-10 | 2021-12-24 | 深圳市科力锐科技有限公司 | Method, device and equipment for verifying backup data and storage medium |
CN117170942A (en) * | 2023-11-03 | 2023-12-05 | 腾讯科技(深圳)有限公司 | Database backup method based on file system snapshot and related equipment |
CN117170942B (en) * | 2023-11-03 | 2024-02-13 | 腾讯科技(深圳)有限公司 | Database backup method based on file system snapshot and related equipment |
CN117591345A (en) * | 2024-01-18 | 2024-02-23 | 柏科数据技术(深圳)股份有限公司 | Ceph-specific data synchronization method, device, equipment and storage medium |
CN117591345B (en) * | 2024-01-18 | 2024-05-14 | 柏科数据技术(深圳)股份有限公司 | Ceph-specific data synchronization method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112256492A (en) | Block device backup method, device and storage medium | |
CN108388599B (en) | Electronic device, data migration and calling method and storage medium | |
US20230136649A1 (en) | Method and apparatus for restoring running status of application, and storage medium | |
CN112965856B (en) | Backup data-based fast fine-grained recovery method and device | |
CN102799464A (en) | Virtual machine creation method, virtual machine creation system, virtual machine resetting method and virtual machine resetting system | |
CN109445902B (en) | Data operation method and system | |
CN110532123B (en) | Fault transfer method and device of HBase system | |
CN110727698A (en) | Database access method and device, computer equipment and storage medium | |
CN105320578A (en) | Method and apparatus for backing up and recovering APP | |
WO2014120205A1 (en) | Replacement of a corrupt driver variable record | |
CN115495025A (en) | Method and device for managing abnormal memory block | |
CN106610859A (en) | Program update method, device and system, and imaging box | |
CN112783866B (en) | Data reading method, device, computer equipment and storage medium | |
CN111124294B (en) | Sector mapping information management method and device, storage medium and equipment | |
CN115858251B (en) | Control method and device of substrate control unit, electronic equipment and storage medium | |
CN108681494B (en) | Backup data restoration method and device, user equipment and storage medium | |
CN113505026B (en) | Method, device and equipment for verifying backup data and storage medium | |
CN110795282A (en) | Data rollback method, device, equipment and storage medium | |
CN113704177B (en) | Storage method, system and related components of server firmware upgrade file | |
CN115454329A (en) | Management method, device, equipment and storage medium for storage cluster equipment | |
CN113190244A (en) | Method and device for upgrading wireless module, computer equipment and storage medium | |
JP7568572B2 (en) | Surveillance equipment | |
CN111131051A (en) | Route issuing method and device | |
CN113590388B (en) | UBOOT-based SPL rollback method and device, storage medium and terminal | |
CN112527652B (en) | Test information updating method, device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210122 |