CN113868023B - Snapshot method and device of storage system, electronic equipment and readable storage medium - Google Patents

Snapshot method and device of storage system, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113868023B
CN113868023B CN202111124044.1A CN202111124044A CN113868023B CN 113868023 B CN113868023 B CN 113868023B CN 202111124044 A CN202111124044 A CN 202111124044A CN 113868023 B CN113868023 B CN 113868023B
Authority
CN
China
Prior art keywords
snapshot
data
copy
write operation
bitmap
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.)
Active
Application number
CN202111124044.1A
Other languages
Chinese (zh)
Other versions
CN113868023A (en
Inventor
蒋米传
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202111124044.1A priority Critical patent/CN113868023B/en
Publication of CN113868023A publication Critical patent/CN113868023A/en
Application granted granted Critical
Publication of CN113868023B publication Critical patent/CN113868023B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]

Abstract

The application discloses a snapshot method and device of a storage system, electronic equipment and a readable storage medium. The method comprises the steps that when the copy snapshot is created when the write is detected, a corresponding bitmap is automatically allocated for the source volume; bits of the bitmap correspond to the data blocks of the source volume one by one; when a data writing request is received, judging whether copy-on-write is needed or not according to the marking bit of the bitmap and the data backup failure record information; if the copy-on-write is needed, firstly copying the data in the source volume to the snapshot volume, updating the bitmap, and then writing the data to be written corresponding to the data writing request into the source volume; and if the copy-on-write is not needed, the data to be written is directly written into the source volume. The application can realize data backup by copying snapshot mode when writing on the basis of not influencing host business.

Description

Snapshot method and device of storage system, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a snapshot method and apparatus of a storage system, an electronic device, and a readable storage medium.
Background
In the information age, data is related to the death of an enterprise, and it is becoming more important to ensure data security. Different disaster recovery backup techniques are required for different scenarios, and common data protection techniques in storage systems include local backup and remote backup. When high-efficiency and quick backup is needed, a local backup technology can be adopted generally; when the need to deal with regional disasters arises, the remote backup technology is generally selected to perform data backup.
Snapshot is a common local backup technique that can backup data at any point in time, and can also be used to roll back when data is needed. In order to reduce the impact of snapshots on services, in a business scenario with more reads and less writes, related art generally chooses to use a Copy of write (Copy-on-write) snapshot mode to perform data backup. Specifically, after the COW snapshot is started for the data volume, when a certain data block of the data volume is updated for the first time, the data in the data volume needs to be backed up to the snapshot volume first, and then new data is written into the data volume. However, if the snapshot is abnormal in the data backup process, the snapshot cannot backup old data to the snapshot volume, so that new data cannot be written to the data volume, and the host service is affected.
In view of this, how to perform data backup by the copy-on-write snapshot manner without affecting the host service is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application provides a snapshot method, a snapshot device, electronic equipment and a readable storage medium of a storage system, which realize data backup in a snapshot mode of copying when writing on the basis of not affecting host business.
In order to solve the technical problems, the embodiment of the application provides the following technical scheme:
an aspect of an embodiment of the present application provides a snapshot method of a storage system, including:
when the copy-on-write snapshot is detected to be created, a corresponding bitmap is automatically allocated for the source volume; bits of the bitmap are in one-to-one correspondence with the data blocks of the source volume; the bit is used for marking whether the corresponding data block is subjected to copy-on-write operation or not;
when a data writing request is received, judging whether copy-on-write operation is needed according to the mark information of the bitmap and the data backup failure record information;
if the copy-on-write operation is needed, firstly copying the data in the source volume to a snapshot volume, updating the bitmap, and then writing the data to be written corresponding to the data writing request into the source volume; and if the copy-on-write operation is not needed, directly writing the data to be written into the source volume.
Optionally, the determining whether the copy-on-write operation is needed according to the marking information of the bitmap and the data backup failure record information includes:
determining a target data block of the data to be written corresponding to the data writing request, which is written into the source volume, so as to determine a target bit corresponding to the bitmap according to the target data block;
if the marking information of the target bit is that the copy-on-write operation has occurred, judging that the copy-on-write operation is not needed;
if the marking information of the target bit is not copy-on-write operation, judging whether the snapshot volume failure times in the data backup failure record information are larger than a preset time threshold value or not;
if the snapshot volume failure times in the data backup failure record information are greater than or equal to a preset time threshold, judging that copy-on-write operation is not needed; and if the snapshot volume failure times of the data backup failure record information are smaller than a preset time threshold, judging that copy-on-write operation is needed.
Optionally, after the copy-on-write snapshot is detected to be created, the method further includes:
creating a snapshot state thread in advance, wherein the snapshot state thread is used for monitoring the snapshot running state of the storage system and recording the snapshot failure times;
and starting the snapshot state thread.
Optionally, before determining whether the copy-on-write operation is needed according to the flag information and the data backup failure record information of the bitmap, the method further includes:
displaying a visual user page, wherein the visual user page comprises a snapshot failure frequency recording function starting selection item and a frequency threshold generation mode selection item; the frequency threshold generation mode selection item comprises a default option and a custom option; the frequency threshold is the maximum allowable value of the snapshot failure frequency;
responding to a snapshot failure times recording function starting instruction of a user, and automatically starting the snapshot failure times recording function;
when a default option selection instruction is detected, setting the frequency threshold as a default value;
and when the digital input instruction is detected, setting the frequency threshold as a numerical value carried in the digital input instruction.
Optionally, before determining whether the copy-on-write operation is needed according to the flag information and the data backup failure record information of the bitmap, the method further includes:
an instruction monitoring thread for monitoring target shortcut instruction input is pre-established;
starting the instruction monitoring thread;
judging whether the target shortcut instruction exists or not;
if the target shortcut instruction exists, setting the frequency threshold as a numerical value carried in the target shortcut instruction; and if the target shortcut instruction does not exist, setting the frequency threshold as a default value.
Optionally, after the writing the data to be written directly into the source volume if the copy-on-write operation is not required, the method further includes:
packaging the obtained log information into a data packet with a preset format;
and sending the data packet with the preset format to a target path, and sending snapshot stopping warning information at the same time.
Another aspect of an embodiment of the present application provides a snapshot device of a storage system, including:
the bitmap allocation module is used for automatically allocating a corresponding bitmap to the source volume when the copy snapshot is created when the write is detected; bits of the bitmap are in one-to-one correspondence with the data blocks of the source volume;
the copy-on-write operation judging module is used for judging whether copy-on-write operation is needed or not according to the marking information of the bitmap and the data backup failure record information when a data writing request is received;
the copy-on-write operation execution module is used for copying the data in the source volume to the snapshot volume and updating the bitmap if the copy-on-write operation is needed, and then writing the data to be written corresponding to the data writing request into the source volume;
and the data writing module is used for directly writing the data to be written into the source volume if the copy-on-write operation is not needed.
Optionally, the copy-on-write operation determining module is further configured to:
determining a target data block of the data to be written corresponding to the data writing request, which is written into the source volume, so as to determine a target bit corresponding to the bitmap according to the target data block;
if the marking information of the target bit is that the copy-on-write operation has occurred, judging that the copy-on-write operation is not needed;
if the marking information of the target bit is not copy-on-write operation, judging whether the snapshot volume failure times in the data backup failure record information are larger than a preset time threshold value or not;
if the snapshot volume failure times in the data backup failure record information are greater than or equal to a preset time threshold, judging that copy-on-write operation is not needed; and if the snapshot volume failure times of the data backup failure record information are smaller than a preset time threshold, judging that copy-on-write operation is needed.
The embodiment of the application also provides an electronic device, which comprises a processor, wherein the processor is used for implementing the steps of the snapshot method of the storage system according to any one of the previous claims when executing the computer program stored in the memory.
Finally, an embodiment of the present application provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the snapshot method of the storage system according to any of the preceding claims.
The technical scheme provided by the application has the advantages that when data is written to the source volume, whether copy-on-write is performed or not is determined based on the identification information of the corresponding bit of the bitmap corresponding to the source volume and the snapshot failure times, so that when faults frequently occur and the system performance is affected, the snapshot can be stopped in time, the waiting time of the host is reduced, the host is responded quickly, the IO performance of the system during data processing is ensured to be kept optimal, the maximization of the system read-write data performance is ensured, the user can obtain relevant warning information in time, decision basis is provided for the user, and the stability of the whole system is improved.
In addition, the embodiment of the application also provides a corresponding implementation device, electronic equipment and a readable storage medium for the snapshot method of the storage system, so that the method is more practical, and the device, the electronic equipment and the readable storage medium have corresponding advantages.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions of the related art, the drawings that are required to be used in the embodiments or the description of the related art will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort to those of ordinary skill in the art.
FIG. 1 is a flowchart illustrating a snapshot method of a storage system according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a copy-on-write snapshot provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of data copying according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another snapshot method of a storage system according to an embodiment of the present application;
FIG. 5 is a block diagram of a snapshot device of a storage system according to an embodiment of the present application.
Detailed Description
In order to better understand the aspects of the present application, the present application will be described in further detail with reference to the accompanying drawings and detailed description. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second, third, fourth and the like in the description and in the claims and in the above drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed.
Having described the technical solutions of embodiments of the present application, various non-limiting embodiments of the present application are described in detail below.
Referring first to fig. 1, fig. 1 is a flowchart of a snapshot method of a storage system according to an embodiment of the present application, where the embodiment of the present application may include the following:
s101: when a copy-on-write snapshot is detected to be created, the source volume is automatically assigned a corresponding bitmap.
In this embodiment, as shown in fig. 2, after the COW snapshot is created, the storage system allocates 1 bitmap to the source volume, where 1 bit in the bitmap corresponds to 1 data block in the source volume, that is, the bit of the bitmap corresponds to the data block of the source volume one by one, and the bit can be used to mark whether the data block has been subjected to COW, that is, the bit is used to mark whether the corresponding data block is subjected to copy-on-write operation. The data volumes of the source volume and the snapshot volume are in one-to-one correspondence, and data in the source volume can be backed up to the same storage position of the snapshot volume.
S102: when a data writing request is received, judging whether copy-on-write operation is needed according to the mark information of the bitmap and the data backup failure record information, if yes, executing S103, and if not, executing S104.
In this embodiment, the flag information of the bitmap is whether the copy-on-write operation is performed on the corresponding data block. The data write request refers to a user writing data to a source volume of the storage system, and a flag bit of the bitmap is used to identify whether a copy-on-write operation has occurred for a data block of the corresponding source volume. If the data block has undergone a COW snapshot operation, then there is no need to perform a copy-on-write operation. If the data block has not been subjected to a COW snapshot operation, copy-on-write operation is required. It can be understood that when writing data into the snapshot volume through the COW snapshot, the data writing failure may be caused by some reasons such as a media error, that is, the snapshot volume fails, the snapshot needs to be retried until the writing is successful, and once each time the snapshot fails, the failure is recorded, so as to form the data backup failure record information, that is, the total number of COW snapshot failures is recorded in the data backup failure record. Alternatively, an error count mechanism may be added to the snapshot to record a failure if writing data to the snapshot volume fails. If the writing fails, a retry is initiated, and the number of writing failures is counted. Optionally, a snapshot state thread for monitoring the snapshot running state of the storage system and recording the snapshot failure times can be created in advance; after receiving the data writing request, a snapshot state thread can be started, and the snapshot state thread is utilized to record the snapshot failure times and form a data backup failure record. If the total number of COW snapshot failures recorded in the data backup failure record is greater than a specific number, the failure of the storage system frequently occurs, the performance of the storage system may be affected, and the response waiting time of the host may be long, so that the host can respond in time, and at this time, the copy-on-write operation is not performed any more. In order to reduce the response waiting time of the host, the priority of the data backup failure record information of the embodiment is greater than the mark bit of the bitmap, that is, the copy-on-write is not needed as long as the copy-on-write is judged to be no longer performed based on the data backup failure record information; and if the copy-on-write is judged to be possible based on the data backup failure record information, the copy-on-write is performed when the flag bit identifies that the copy-on-write operation is not performed.
S103: copying the data in the source volume to the snapshot volume, updating the bitmap, and writing the data to be written corresponding to the data writing request into the source volume.
When writing data to the source volume, if copy-on-write is required, the data in the source volume is copied to the snapshot volume, the bitmap is updated, and then new data is written to the source volume, as shown in fig. 3.
S104: and directly writing the data to be written into the source volume.
If the copy-on-write operation is not needed, the snapshot is actively stopped, and the next data is not needed to be written into the COW, and only new data is needed to be directly written into the data block of the source volume, so that the operation of the host service is preferentially ensured, and the host is quickly responded.
In the technical scheme provided by the embodiment of the application, when writing data to the source volume, whether copy-on-write is performed is determined based on the identification information of the corresponding bit of the bitmap corresponding to the source volume and the snapshot failure times, so that when faults frequently occur and the system performance is affected, the snapshot can be stopped in time, the waiting time of the host is reduced, the host is responded quickly, the IO performance of the system during data processing is ensured to be kept optimal, the maximization of the system read-write data performance is ensured, the user can obtain relevant warning information in time, decision basis is provided for the user, and the stability of the whole system is improved.
It should be noted that, in the present application, there is no strict sequence of execution among the steps, so long as the sequence accords with the logic sequence, the steps may be executed simultaneously, or may be executed according to a certain preset sequence, and fig. 1 is only a schematic manner, and is not meant to represent only such execution sequence.
In the above embodiment, the implementation of step S102 is not limited, and an optional determination manner of whether the copy-on-write operation is to be performed in this embodiment may include the following steps:
determining a target data block corresponding to the data writing request and to be written into the source volume, so as to determine a target bit corresponding to the bitmap according to the target data block;
if the mark information of the target bit is that the copy-on-write operation has occurred, judging that the copy-on-write operation is not needed;
if the mark information of the target bit is not the copy-on-write operation, judging whether the snapshot volume failure times in the data backup failure record information are larger than a preset time threshold value or not;
if the snapshot volume failure times in the data backup failure record information are greater than or equal to a preset time threshold, judging that copy-on-write operation is not needed; if the snapshot volume failure times of the data backup failure record information are smaller than the preset times threshold, the copy-on-write operation is judged to be needed.
In this embodiment, the preset number of times threshold may be flexibly selected according to the actual scenario, which does not affect the implementation of the present application.
When the data backup is performed on the COW snapshot, the snapshot is automatically stopped when the number of times of errors exceeds a set threshold value, and the service of the host is preferentially ensured, so that the host can respond in time, and the waiting time of the host is reduced.
In order to improve flexibility and practicability of the data snapshot and improve user experience, based on the above embodiment, the present application further provides a custom form and a default form for setting a preset frequency threshold, which may include:
displaying a visual user page, wherein the visual user page comprises a snapshot failure frequency recording function starting selection item and a frequency threshold generation mode selection item; the frequency threshold generation mode selection items comprise default options and custom options; the number threshold is the maximum allowable value of the snapshot failure number;
responding to a snapshot failure times recording function starting instruction of a user, and automatically starting a snapshot failure times recording function;
when a default option selection instruction is detected, setting a frequency threshold as a default value;
when a digital input instruction is detected, the frequency threshold is set to a numerical value carried in the digital input instruction.
In this embodiment, a user may input an instruction through a man-machine interaction module, such as a keyboard, a mouse, or a triggerable display screen, the default value is a fixed value stored in the system in advance, and the numerical value carried in the numerical input instruction is a number threshold customized by the user according to the current application scenario.
In order to further improve user experience and improve user operation convenience, based on the above embodiment, the method may further include:
an instruction monitoring thread for monitoring target shortcut instruction input is pre-established;
starting an instruction monitoring thread;
judging whether a target shortcut instruction exists or not;
if the target shortcut instruction exists, setting the frequency threshold as a numerical value carried in the target shortcut instruction; if the target shortcut instruction does not exist, the frequency threshold is set to be a default value.
In this embodiment, the target shortcut command may be input through a shortcut key, where the shortcut key may be any combination key designated by the user in advance, for example, ctrl+shift+alt+number, and the number is a threshold number of times that the user wants to set.
In order to improve the fault location efficiency and improve the stability and reliability of the whole storage system, based on the above embodiment, the method may further include:
packaging the obtained log information into a data packet with a preset format;
and sending the data packet with the preset format to the target path, and simultaneously sending snapshot stopping warning information.
The data packet with the preset format meets the data format supported by the end where the target path is located, and maintenance personnel can locate the fault and repair the fault in time according to the received log information. When the data is backed up to the snapshot volume, if the failure times reach a set threshold value, the snapshot is actively stopped, and a report alarm is sent to prompt a user, so that the user can obtain relevant alarm information in time, and a decision basis is provided for the user.
The embodiment of the application also provides a corresponding device for the snapshot method of the storage system, so that the method has more practicability. Wherein the device may be described separately from the functional module and the hardware. The following describes a snapshot device of a storage system according to an embodiment of the present application, where the snapshot device of the storage system described below and the snapshot method of the storage system described above may be referred to correspondingly.
Based on the angle of the functional modules, referring to fig. 4, fig. 4 is a block diagram of a snapshot device of a storage system according to an embodiment of the present application, where the device may include:
a bitmap allocation module 401, configured to automatically allocate a corresponding bitmap to the source volume when the copy snapshot is created when the write is detected; bits of the bitmap are in one-to-one correspondence with the data blocks of the source volume, and the bits are used for marking whether the corresponding data blocks are subjected to copy-on-write operation.
The copy-on-write operation determining module 402 is configured to determine whether a copy-on-write operation is required according to the bitmap flag information and the data backup failure record information when the data write request is received.
The copy-on-write operation execution module 403 is configured to copy the data in the source volume to the snapshot volume and update the bitmap if the copy-on-write operation is required, and then write the data to be written corresponding to the data write request into the source volume.
The data writing module 404 is configured to directly write the data to be written to the source volume if the copy-on-write operation is not required.
Optionally, in some implementations of this embodiment, the copy-on-write operation determining module 402 may be further configured to:
judging whether copy-on-write operation is needed according to the mark information of the bitmap and the data backup failure record information, wherein the method comprises the following steps:
determining a target data block corresponding to the data writing request and to be written into the source volume, so as to determine a target bit corresponding to the bitmap according to the target data block;
if the mark information of the target bit is that the copy-on-write operation has occurred, judging that the copy-on-write operation is not needed;
if the mark information of the target bit is not the copy-on-write operation, judging whether the snapshot volume failure times in the data backup failure record information are larger than a preset time threshold value or not;
if the snapshot volume failure times in the data backup failure record information are greater than or equal to a preset time threshold, judging that copy-on-write operation is not needed; if the snapshot volume failure times of the data backup failure record information are smaller than the preset times threshold, the copy-on-write operation is judged to be needed.
Optionally, as another optional implementation manner of this embodiment, the apparatus may further include a thread creation module, configured to create a snapshot state thread in advance, where the snapshot state thread is used to monitor a snapshot running state of the storage system and record a number of snapshot failures; the method is also used for creating an instruction monitoring thread for monitoring the input of the target shortcut instruction in advance; correspondingly, the device can further comprise:
and the first thread starting module is used for starting the snapshot state thread.
The second thread starting module is used for starting the instruction monitoring thread;
the judging module is used for judging whether the target shortcut instruction exists or not;
the execution module is used for setting the frequency threshold as a numerical value carried in the target shortcut instruction if the target shortcut instruction exists; if the target shortcut instruction does not exist, the frequency threshold is set to be a default value.
Optionally, as another optional implementation manner of this embodiment, the apparatus may further include a threshold setting module, configured to display a visual user page, where the visual user page includes a snapshot failure number recording function start selection item and a number threshold generation mode selection item; the frequency threshold generation mode selection items comprise default options and custom options; the number threshold is the maximum allowable value of the snapshot failure number; responding to a snapshot failure times recording function starting instruction of a user, and automatically starting a snapshot failure times recording function; when a default option selection instruction is detected, setting a frequency threshold as a default value; when a digital input instruction is detected, the frequency threshold is set to a numerical value carried in the digital input instruction.
Optionally, in some other implementations of the present embodiment, the apparatus may further include an alert module, for example, configured to package the obtained log information into a data packet with a preset format; and sending the data packet with the preset format to the target path, and simultaneously sending snapshot stopping warning information.
The functions of each functional module of the snapshot device of the storage system according to the embodiment of the present application may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description of the embodiment of the method, which is not repeated herein.
Therefore, the embodiment of the application can realize data backup by copying the snapshot mode when writing on the basis of not influencing the host business.
The snapshot device of the storage system is described from the perspective of a functional module, and further, the application also provides an electronic device, which is described from the perspective of hardware. Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic device comprises a memory 50 for storing a computer program; a processor 51 for implementing the steps of the snapshot method of the storage system as mentioned in any of the embodiments above when executing a computer program.
Processor 51 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and processor 51 may also be a controller, microcontroller, microprocessor, or other data processing chip, among others. The processor 51 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 51 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 51 may be integrated with a GPU (Graphics Processing Unit, image processor) for taking care of rendering and drawing of the content that the display screen is required to display. In some embodiments, the processor 51 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 50 may include one or more computer-readable storage media, which may be non-transitory. Memory 50 may also include high-speed random access memory as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. The memory 50 may in some embodiments be an internal storage unit of the electronic device, such as a hard disk of a server. The memory 50 may in other embodiments also be an external storage device of the electronic device, such as a plug-in hard disk provided on a server, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like. Further, the memory 50 may also include both internal storage units and external storage devices of the electronic device. The memory 50 may be used to store not only application software installed in an electronic device, but also various types of data, such as: code of a program that executes the vulnerability processing method, or the like, may also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 50 is at least used for storing a computer program 501, which, when loaded and executed by the processor 51, is capable of implementing the relevant steps of the snapshot method of the storage system disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 50 may also include an operating system 502, data 503, and the like, where the storage mode may be transient storage or permanent storage. Operating system 502 may include Windows, unix, linux, among other things. The data 503 may include, but is not limited to, data corresponding to snapshot results of the storage system, and the like.
In some embodiments, the electronic device may further include a display 52, an input/output interface 53, a communication interface 54, or network interface, a power supply 55, and a communication bus 56. Among other things, the display 52, input output interface 53 such as a Keyboard (Keyboard) pertain to a user interface, which may optionally also include standard wired interfaces, wireless interfaces, etc. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface. Communication interface 54 may optionally include a wired interface and/or a wireless interface, such as a WI-FI interface, a bluetooth interface, etc., typically used to establish a communication connection between an electronic device and other electronic devices. The communication bus 56 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 5, but not only one bus or one type of bus.
Those skilled in the art will appreciate that the configuration shown in fig. 5 is not limiting of the electronic device and may include more or fewer components than shown, for example, may also include sensors 57 to perform various functions.
The functions of each functional module of the electronic device according to the embodiment of the present application may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description of the embodiment of the method, which is not repeated herein.
Therefore, the embodiment of the application can realize data backup by copying the snapshot mode when writing on the basis of not influencing the host business.
It will be appreciated that the snapshot methods of the storage system in the above embodiments, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in part or in whole or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrically erasable programmable ROM, registers, a hard disk, a multimedia card, a card-type Memory (e.g., SD or DX Memory, etc.), a magnetic Memory, a removable disk, a CD-ROM, a magnetic disk, or an optical disk, etc., that can store program code.
Based on this, an embodiment of the present application further provides a readable storage medium storing a computer program, where the computer program when executed by a processor performs the steps of the snapshot method of the storage system according to any one of the embodiments above.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the hardware including the device and the electronic equipment disclosed in the embodiments, the description is relatively simple because the hardware includes the device and the electronic equipment corresponding to the method disclosed in the embodiments, and relevant places refer to the description of the method.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The snapshot method, the device, the electronic equipment and the readable storage medium of the storage system provided by the application are described in detail. The principles and embodiments of the present application have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present application and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the application can be made without departing from the principles of the application and these modifications and adaptations are intended to be within the scope of the application as defined in the following claims.

Claims (8)

1. A method of snapshot of a storage system, comprising:
when the copy-on-write snapshot is detected to be created, a corresponding bitmap is automatically allocated for the source volume; bits of the bitmap are in one-to-one correspondence with the data blocks of the source volume; the bit is used for marking whether the corresponding data block is subjected to copy-on-write operation or not;
when a data writing request is received, judging whether copy-on-write operation is needed according to the mark information of the bitmap and the data backup failure record information;
if the copy-on-write operation is needed, firstly copying the data in the source volume to a snapshot volume, updating the bitmap, and then writing the data to be written corresponding to the data writing request into the source volume; if the copy-on-write operation is not needed, the data to be written is directly written into the source volume;
wherein, the determining whether copy-on-write operation is needed according to the marking information of the bitmap and the data backup failure record information includes:
determining a target data block of the data to be written corresponding to the data writing request, which is written into the source volume, so as to determine a target bit corresponding to the bitmap according to the target data block;
if the marking information of the target bit is that the copy-on-write operation has occurred, judging that the copy-on-write operation is not needed;
if the marking information of the target bit is not copy-on-write operation, judging whether the snapshot volume failure times in the data backup failure record information are larger than a preset time threshold value or not;
if the snapshot volume failure times in the data backup failure record information are greater than or equal to a preset time threshold, judging that copy-on-write operation is not needed; and if the snapshot volume failure times of the data backup failure record information are smaller than a preset time threshold, judging that copy-on-write operation is needed.
2. The method of snapshot of a storage system of claim 1, wherein after the copy-on-write snapshot is created when a write is detected, further comprising:
creating a snapshot state thread in advance, wherein the snapshot state thread is used for monitoring the snapshot running state of the storage system and recording the snapshot failure times;
and starting the snapshot state thread.
3. The snapshot method of a storage system according to claim 1 or 2, wherein before determining whether a copy-on-write operation is required according to the bitmap flag information and the data backup failure record information, the method further comprises:
displaying a visual user page, wherein the visual user page comprises a snapshot failure frequency recording function starting selection item and a preset frequency threshold generation mode selection item; the preset times threshold generation mode selection items comprise default options and custom options; the preset frequency threshold is the maximum allowable value of the snapshot failure frequency;
responding to a snapshot failure times recording function starting instruction of a user, and automatically starting the snapshot failure times recording function;
when a default option selection instruction is detected, setting the preset times threshold as a default value;
and when the digital input instruction is detected, setting the preset time threshold as a numerical value carried in the digital input instruction.
4. The snapshot method of a storage system according to claim 1 or 2, wherein before determining whether a copy-on-write operation is required according to the bitmap flag information and the data backup failure record information, the method further comprises:
an instruction monitoring thread for monitoring target shortcut instruction input is pre-established;
starting the instruction monitoring thread;
judging whether the target shortcut instruction exists or not;
if the target shortcut instruction exists, setting the preset frequency threshold as a numerical value carried in the target shortcut instruction; and if the target shortcut instruction does not exist, setting the preset times threshold as a default value.
5. The method according to claim 4, wherein after the data to be written is directly written to the source volume if the copy-on-write operation is not required, further comprising:
packaging the obtained log information into a data packet with a preset format;
and sending the data packet with the preset format to a target path, and sending snapshot stopping warning information at the same time.
6. A snapshot apparatus of a storage system, comprising:
the bitmap allocation module is used for automatically allocating a corresponding bitmap to the source volume when the copy snapshot is created when the write is detected; bits of the bitmap are in one-to-one correspondence with the data blocks of the source volume; the bit is used for marking whether the corresponding data block is subjected to copy-on-write operation or not;
the copy-on-write operation judging module is used for judging whether copy-on-write operation is needed or not according to the marking information of the bitmap and the data backup failure record information when a data writing request is received;
the copy-on-write operation execution module is used for copying the data in the source volume to the snapshot volume and updating the bitmap if the copy-on-write operation is needed, and then writing the data to be written corresponding to the data writing request into the source volume;
the data writing module is used for directly writing the data to be written into the source volume if the copy-on-write operation is not needed;
wherein the copy-on-write operation determination module is further configured to:
determining a target data block of the data to be written corresponding to the data writing request, which is written into the source volume, so as to determine a target bit corresponding to the bitmap according to the target data block;
if the marking information of the target bit is that the copy-on-write operation has occurred, judging that the copy-on-write operation is not needed;
if the marking information of the target bit is not copy-on-write operation, judging whether the snapshot volume failure times in the data backup failure record information are larger than a preset time threshold value or not;
if the snapshot volume failure times in the data backup failure record information are greater than or equal to a preset time threshold, judging that copy-on-write operation is not needed; and if the snapshot volume failure times of the data backup failure record information are smaller than a preset time threshold, judging that copy-on-write operation is needed.
7. An electronic device comprising a processor and a memory, the processor being configured to implement the steps of the snapshot method of the storage system of any of claims 1 to 5 when executing a computer program stored in the memory.
8. A readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the snapshot method of the storage system according to any of claims 1 to 5.
CN202111124044.1A 2021-09-24 2021-09-24 Snapshot method and device of storage system, electronic equipment and readable storage medium Active CN113868023B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111124044.1A CN113868023B (en) 2021-09-24 2021-09-24 Snapshot method and device of storage system, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111124044.1A CN113868023B (en) 2021-09-24 2021-09-24 Snapshot method and device of storage system, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113868023A CN113868023A (en) 2021-12-31
CN113868023B true CN113868023B (en) 2023-11-14

Family

ID=78993970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111124044.1A Active CN113868023B (en) 2021-09-24 2021-09-24 Snapshot method and device of storage system, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113868023B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658168A (en) * 2004-02-19 2005-08-24 华为技术有限公司 Method for writing data on source film in pistolgraph process
CN1704903A (en) * 2004-06-03 2005-12-07 华为技术有限公司 Snapshot backup method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7047380B2 (en) * 2003-07-22 2006-05-16 Acronis Inc. System and method for using file system snapshots for online data backup

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658168A (en) * 2004-02-19 2005-08-24 华为技术有限公司 Method for writing data on source film in pistolgraph process
CN1704903A (en) * 2004-06-03 2005-12-07 华为技术有限公司 Snapshot backup method

Also Published As

Publication number Publication date
CN113868023A (en) 2021-12-31

Similar Documents

Publication Publication Date Title
CN103842968B (en) A kind of moving method of internal storage data, computing machine and device
US10067692B2 (en) Method and apparatus for backing up and restoring cross-virtual machine application
CN103827834B (en) A kind of moving method of internal storage data, computing machine and device
CN109683970A (en) A kind of amending method of server FRU information, modification system and relevant apparatus
CN112015447B (en) System updating method and device of electronic equipment, electronic equipment and storage medium
WO2021004256A1 (en) Node switching method in node failure and related device
US10095616B2 (en) Garbage collection for virtual environments
WO2017162049A1 (en) Method and device for monitoring memory data of drive module
CN112395050B (en) Virtual machine backup method and device, electronic equipment and readable storage medium
CN113687779A (en) Data migration method and device, electronic equipment and readable storage medium
CN113821302A (en) Method and device for deploying virtual machine on virtualization cloud platform, electronic equipment and medium
CN113868023B (en) Snapshot method and device of storage system, electronic equipment and readable storage medium
US9459676B2 (en) Data storage device control with power hazard mode
CN108845772B (en) Hard disk fault processing method, system, equipment and computer storage medium
CN114884836A (en) High-availability method, device and medium for virtual machine
US20230088318A1 (en) Remotely healing crashed processes
CN115562593A (en) Abnormal RAID member disk processing method, device and medium
CN114218001A (en) Fault repairing method and device, electronic equipment and readable storage medium
CN110795155B (en) System starting method and device, electronic equipment and storage medium
CN108038035A (en) A kind of detection method and relevant apparatus of flash reading and writing state
CN113849230A (en) Server starting method and device, electronic equipment and readable storage medium
US20190294360A1 (en) Information processing apparatus and computer-readable recording medium
CN106599046B (en) Writing method and device of distributed file system
CN110476153A (en) The method and electronic equipment of access instruction SRAM
CN115359834B (en) Disk arbitration region detection method, device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant