Snapshot data processing method and device and electronic equipment

By filling the unloaded data locations during the delayed loading of block devices, the problem of missing snapshot data during the delayed loading of block devices is solved, the availability of snapshots is improved, and the creation and use of second-level snapshots when data is incomplete is solved. IA snapshots are not available.

CN119248172AActive Publication Date: 2025-01-03HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202310767515.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2025-01-03
Estimated Expiration
2043-06-26

AI Technical Summary

Technical Problem

In the prior art, the lack of snapshot data of block devices during delayed loading causes IA snapshots to be unusable, affecting the availability and user experience of snapshots.

Method used

By filling in the data where unloaded data appears during the block device during the delayed loading period, create an instant snapshot to ensure that second-level snapshots can still be used normally when the snapshot data is incomplete, reducing the available vacuum period of function.

Benefits of technology

It effectively solves the problem of missing snapshot data during delayed loading of block devices, improves the availability of snapshots, reduces the available vacuum period of second-level snapshots, and ensures timely availability of snapshots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248172A_ABST
    Figure CN119248172A_ABST
Patent Text Reader

Abstract

The invention relates to a snapshot data processing method and device and electronic equipment. The method comprises the following steps: creating a block device by using a source snapshot, and carrying out delayed loading of data on the source snapshot based on the block device; when the block device is in the delay loading period, snapshotting the block device to obtain a snapshot of the block device; and if the logic block address in the snapshot has the position where the data is not loaded, performing data filling on the position where the data is not loaded. Through the method and the device, the technical problem that the snapshot cannot be used due to the fact that the snapshot data of the block device is missing in the delayed loading period in the related technology is solved, and the technical effects that the missing snapshot data of the block device in the delayed loading period can be filled in time, and the availability of the snapshot is improved are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, a processing device and an electronic device for processing snapshot data. Background Art

[0002] Today's Internet applications have increasingly higher requirements for key indicators such as the IO read and write performance, stability, and availability of virtual machine block devices. In response to market demand, Instant Availability (IA) snapshots have greatly broadened the use scenarios of snapshots. However, IA snapshots rely on the completeness of the block device's own data. Due to the lack of snapshot data during delayed loading of block devices, IA snapshots cannot be used. For example, in background operations that users are not aware of, such as post-copy migration / initial snapshot creation / initial rollback, IA snapshots are unavailable. Moreover, the vacuum period of missing snapshot data may last for hours, resulting in an extremely poor user experience and affecting the promotion of IA snapshots.

[0003] To address the above-mentioned problems, no effective solutions have been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a method, a processing device and an electronic device for processing snapshot data, so as to at least solve the technical problem in the related art that the snapshot data is missing during delayed loading of the block device, resulting in the unusable snapshot.

[0005] According to one aspect of an embodiment of the present application, a method for processing snapshot data is provided, comprising: creating a block device using a source snapshot, and delaying the loading of data for the source snapshot based on the block device; taking a snapshot of the block device during the delayed loading of the block device to obtain a snapshot of the block device; if a location where data is not loaded appears in a logical block address in the snapshot, filling the location where data is not loaded with data with data.

[0006] According to another aspect of an embodiment of the present application, a snapshot data processing device is provided, comprising: a first processing module, configured to create a block device using a source snapshot, and to perform delayed loading of data on the source snapshot based on the block device; a second processing module, configured to take a snapshot of the block device during the delayed loading period of the block device to obtain a snapshot of the block device; and a third processing module, configured to fill data in a location where no data is loaded if a location where no data is loaded appears in a logical block address in the snapshot.

[0007] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor, and a memory storing a program, wherein the program comprises instructions, and when the instructions are executed by the processor, the processor executes the method described above.

[0008] According to another aspect of an embodiment of the present application, a non-transitory machine-readable medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method described above.

[0009] In an embodiment of the present application, a block device is created by using a source snapshot, and data is delayed loaded for the source snapshot based on the block device; when the block device is in the delayed loading period, a snapshot is taken of the block device to obtain a snapshot of the block device; if a location where data is not loaded appears in the logical block address in the snapshot, data is filled in the location where data is not loaded. That is to say, in an embodiment of the present application, during the period when the block device is in the delayed loading period, data is filled in the location where data is not loaded in the logical block address in the snapshot to obtain an immediately available snapshot, that is, in the case of incomplete snapshot data, a second-level snapshot can still be created and used normally, reducing the vacuum period of the function availability of the second-level snapshot, thereby solving the technical problem in the related art that the snapshot cannot be used due to the missing snapshot data of the block device during the delayed loading period, and achieving the technical effect of being able to timely fill in the missing snapshot data of the block device during the delayed loading period and improving the availability of the snapshot. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can be obtained based on these drawings without creative work.

[0011] Figure 1 A schematic diagram of a log structure block device structure provided for an optional embodiment of the present application;

[0012] Figure 2 A schematic diagram of data missing in a snapshot during delayed loading provided by an optional embodiment of the present application;

[0013] Figure 3 A schematic diagram of an illegal local snapshot caused by missing identification parameters provided in an optional embodiment of the present application;

[0014] Figure 4 A flowchart of a method for processing snapshot data provided in an embodiment of the present application;

[0015] Figure 5A schematic diagram of a snapshot during delayed loading provided by an optional embodiment of the present application being used to create a new block device;

[0016] Figure 6 A schematic diagram of the timing of filling the identification parameters of a block device provided by an optional embodiment of the present application;

[0017] Figure 7 A schematic diagram of filling identification parameters of a block device during delayed loading provided by an optional embodiment of the present application;

[0018] Figure 8 A schematic diagram of filling in identification parameters during delayed loading caused by a post-copy migration scenario provided by an optional embodiment of the present application;

[0019] Fig. 9 A schematic diagram of performing correction after filling in identification parameters provided in an optional embodiment of the present application;

[0020] Fig.10 A hardware structure block diagram of an electronic device is shown. DETAILED DESCRIPTION

[0021] Embodiments of the present embodiment will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present embodiment are shown in the accompanying drawings, it should be understood that the present embodiment can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein, which are instead provided for a more thorough and complete understanding of the present embodiment. It should be understood that the drawings and embodiments of the present embodiment are only for exemplary purposes and are not intended to limit the scope of protection of the present embodiment.

[0022] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0023] Virtual machine disk: virtual machine block device (Device), referred to as block device in this application.

[0024] Log Structured Block Device (LSBD): A block device built based on a log method.

[0025] Disk snapshot: A snapshot of a virtual machine disk block device.

[0026] Disk backup: Copy the virtual machine disk to another block device storage cluster (ElasticBlock Sevice, EBS) for long-term storage.

[0027] Disk image: used to create a snapshot of a virtual machine disk in lazy loading mode.

[0028] Lazy loading: also known as lazy loading, that is, when the virtual machine starts, the disk data is slowly loaded from a disk snapshot, and the virtual machine can run without the loading being completed.

[0029] Block: The disk block in the disk snapshot.

[0030] The log structure block device (LSBD) uses the flat log file of the underlying distributed storage to save data. The flat log file can only be appended and cannot be overwritten. Figure 1 A schematic diagram of the log structure block device structure provided by an optional embodiment of the present application, such as Figure 1 As shown in the figure, the virtual machine block device (LSBD device) of the log structure block device is divided into multiple segments according to the logical address space to improve the concurrent processing capability. The index file is used to store the metadata of the segment data modification, and the data file is used to store the data of the segment data modification. Both the index file and the data file are flat log files. After a file is written, it is sealed, and then the next new file is created for writing.

[0031] A snapshot is a frozen storage of the instantaneous data state of a block device at a certain point in time, and a replica of the index map (IndexMap) of the block device. Logically, the snapshot and the block device are completely independent. A successfully created snapshot can independently replicate the data state of the block device, including the locations of the unloaded data (Not-Loaded). The direct impact of this is that the local snapshot at this time cannot provide data services. Figure 2 A schematic diagram of data missing in a snapshot during delayed loading provided by an optional embodiment of the present application, such as Figure 2 As shown, at the logical block address (Logical Block Address, LBA) 2 position in the snapshot, there is no real data pointing in the index file at this time.

[0032] Figure 3 A schematic diagram of an optional embodiment of the present application providing a missing identification parameter that ultimately leads to an illegal local snapshot, such as Figure 3As shown in the figure, no data is written during the delay recording period. Due to the missing data, the identification parameter of the block device is recorded as invalid. As time goes by, invalid is updated to dirty after the data is imported. At the same time, the block device is also snapshotted. The identification parameter of the final saved snapshot contains dirty data. Therefore, the missing identification parameter in the block device will cause the local snapshot to eventually become an illegal snapshot. It should be noted that dirty data is data that has been modified but has not been written back to the disk or other permanent storage media.

[0033] In order to overcome the above shortcomings, the present invention provides a method for processing snapshot data. Figure 4 A flowchart of a method for processing snapshot data provided in an embodiment of the present application, such as Figure 4 As shown, the method comprises the following steps:

[0034] Step S402, creating a block device using the source snapshot, and performing delayed loading of data on the source snapshot based on the block device;

[0035] The source snapshot is used as a disk creation source and has complete data. The source snapshot can be used to create a block device. The block device is also called a virtual machine disk or a virtual machine block device.

[0036] Optionally, an intermediate snapshot may be provided between the source snapshot and the block device, and the intermediate snapshot may store part or all of the data of the source snapshot for reading or loading by the block device. It should be noted that the delayed loading of data from the source snapshot based on the block device may be performed from the source snapshot, the intermediate snapshot, and other data sources. Here, other data sources should store part or all of the data of the source snapshot required by the block device.

[0037] Step S404, taking a snapshot of the block device during the delayed loading period to obtain a snapshot of the block device;

[0038] The above-mentioned snapshot refers to taking a picture and saving data at a certain point in time so as to restore it when needed.

[0039] For block devices, snapshots can usually be achieved through the following steps: create a read-only snapshot that shares the same data blocks as the block device data; when the block device data is modified, copy the modified data blocks to the snapshot to preserve the state corresponding to the block device data; when the block device data needs to be restored, the snapshot can be used to restore the block device data to the state at a certain point in time.

[0040] Optionally, when the block device is in delayed loading, the logical block address in the block device may have a location where no data is loaded. At this time, if a snapshot is taken of the block device, the corresponding logical block address in the snapshot of the block device will also have a location where no data is loaded.

[0041] Step S406: if a location where no data is loaded appears in the logical block address in the snapshot, data is filled in the location where no data is loaded.

[0042] The logical block address is a unique identifier for each data block in a disk or other block device. The logical block address is usually an integer used to identify the location of the data block in the device.

[0043] In a disk or other block device, data is usually organized into data blocks, each of which has a unique logical block address. Logical block addresses can be used to read or write data blocks, as well as to perform operations such as disk partitioning, formatting, and file system creation. In addition, logical block addresses are usually managed by operating systems or file systems, which map logical block addresses to physical block addresses in order to read or write data in disks or other block devices. In some advanced file systems, logical block addresses can also be used to implement functions such as data compression, encryption, and snapshots.

[0044] By filling the data in the locations where no data is loaded, the snapshot does not have data missing, which can effectively ensure that the snapshot has the characteristic of being immediately available. In other words, by filling the data in the locations where no data is loaded, an immediately available snapshot is obtained.

[0045] In an embodiment of the present application, when a block device is in delayed loading, data is filled at the location where unloaded data appears in the logical block address in the snapshot to obtain an immediately available snapshot, that is, when the snapshot data is incomplete, the second-level snapshot can still be created and used normally, thereby reducing the vacuum period of functional availability of the second-level snapshot, thereby solving the technical problem in the related art that the snapshot cannot be used due to the missing snapshot data of the block device during the delayed loading period, and achieving the technical effect of being able to timely fill the missing snapshot data of the block device during the delayed loading period and improving the availability of the snapshot.

[0046] As an optional embodiment, filling data at the location where no data is loaded includes the following steps:

[0047] Step 11, when the block device has not imported the data to be filled, the data to be filled is obtained through a lazy load fetcher, and the data to be filled is filled into the position where the data has not been loaded;

[0048] Optionally, when the block device has not imported the data to be filled, the data to be filled is obtained through a lazy loading extractor, and the data to be filled is filled into the position where the data has not been loaded. This can usually be achieved through the following steps: create a lazy loading extractor to obtain the data to be filled; when the data needs to be filled, obtain the data to be filled from the lazy loading extractor; and fill the data to be filled into the position where the data has not been loaded.

[0049] It should be noted that snapshots can read data directly, and the read capability of snapshots can be directly implemented through lazy loading extractors.

[0050] Step 12: When the block device has imported the data to be filled, fill the imported data to be filled into the position where no data is loaded.

[0051] Optionally, when the block device has imported the data to be filled, the imported data to be filled is filled into the position where the data has not been loaded. This can usually be achieved through the following steps: importing the data to be filled into the block device; when data needs to be filled, obtaining data from the imported data to be filled; filling the data to be filled into the position where the data has not been loaded.

[0052] In an embodiment of the present application, for a snapshot direct data read scenario, data can be dynamically filled when needed by delaying the loading of an extractor or importing data to be filled, so as to reduce snapshot data loss during delayed loading of a block device, thereby effectively improving the availability of the snapshot.

[0053] As an optional embodiment, after obtaining the snapshot of the block device, the method further includes the following steps:

[0054] Step 21, creating a new block device using the snapshot, and hard linking the created new snapshot to the snapshot, wherein the new snapshot inherits the location of the unloaded data corresponding to the logical block address in the snapshot;

[0055] Step 22, lazily loading the data to be filled in the source snapshot based on the new block device, and filling the acquired data to be filled in the position of the unloaded data in the new snapshot;

[0056] Step 23: Import all data in the new snapshot into the new block device.

[0057] In an embodiment of the present application, for a scenario in which a new block device is created using a snapshot, if the block device has not imported the data to be filled, the new snapshot's own data is filled by delaying the loading of the data to be filled from the source snapshot, and all the data in the new snapshot is imported into the new block device. The previous block devices do not participate in the entire process, that is, there is no data interaction between the new block device and the previous block device, so that the vacuum period of snapshot unavailability during delayed loading is reduced from the original hours to seconds.

[0058] Figure 5 A schematic diagram of a snapshot during delayed loading provided in an optional embodiment of the present application being used to create a new block device, such as Figure 5 As shown in the figure, the use of snapshot (IA-snapshot2) requires hard linking (hardlink) a new snapshot (e-snapshot2). This new snapshot also inherits the unloaded data (not-loaded) on the snapshot. At this time, the new snapshot can be lazily loaded from the remote source snapshot (e-snapshot1) again to complete the filling of its own data, and there is no data interaction with the block device (dev1).

[0059] It should be noted that: ①: a snapshot is taken of the block device (dev1) during the delayed loading period; ②: a new block device is created in the cluster using the snapshot (IA-snapshot2), which needs to be converted into a new snapshot (e-snapshot2) and exists in the form of a delayed loading task; ③: the new block device issues a delayed load to the new snapshot (e-snapshot2); ④: the new snapshot (e-snapshot2) continuously performs delayed loading from the source snapshot (e-snapshot1); ⑤: after the delayed loading is completed, it becomes a complete new snapshot (e-snapshot2), and then data import is executed.

[0060] As an optional embodiment, after filling the position where no data is loaded with data, the above method further includes the following steps:

[0061] Step 31, create a new block device using the snapshot, and hard link the created new snapshot to the snapshot;

[0062] Step 32: Import all data in the new snapshot into the new block device.

[0063] In an embodiment of the present application, for a scenario in which a new block device is created using a snapshot, if the block device has imported the data to be filled, the data on the snapshot has been completed, and the data of the new snapshot is also complete, and all the data of the new snapshot can be directly imported into the new block device.

[0064] As an optional embodiment, before obtaining the snapshot of the block device, the method further includes the following steps:

[0065] Step 41: construct identification parameters of the block device based on the source snapshot, and set the identification parameters of the block device to the block device.

[0066] Figure 6 A schematic diagram of the timing of filling the identification parameters of the block device provided by the optional embodiment of the present application, such as Figure 6As shown in the figure. Since the identification parameters of the block device can be inherited by the snapshot, the sooner the correct value is filled after the block device is successfully created, the better. In terms of management logic, the action of filling the identification parameters can be performed asynchronously after the block device is successfully created. Before the identification parameters of the block device are fully filled, the snapshot cannot be created.

[0067] In an embodiment of the present application, by constructing identification parameters of a block device based on a source snapshot and setting the identification parameters of the block device to the block device, the correctness of the block device identification parameters is ensured, so that the vacuum period during which the snapshot is unavailable during delayed loading is reduced from the original hours to seconds.

[0068] As an optional embodiment, constructing identification parameters of a block device based on a source snapshot includes the following steps:

[0069] Step 4101, lazily loading data from a source snapshot based on a block device, and filling the acquired data into the block device;

[0070] Step 4102, parse out the position of the loaded data corresponding to the logical block address in the block device, set the identification parameter corresponding to the position of the loaded data to a preset value, and obtain the identification parameter of the block device.

[0071] For the scenario of creating a block device from a snapshot, you only need to parse the existing downloaded snapshot metadata to find out which locations have data, and set the corresponding identification parameters of these locations to the preset values. In this way, the identification parameters of the complete block device are constructed and set to the block device.

[0072] Figure 7 A schematic diagram of filling in identification parameters of a block device during delayed loading provided by an optional embodiment of the present application, such as Figure 7 From top to bottom, they are: the identification parameters of the source snapshot, the identification parameters corresponding to the snapshot of the block device, the identification parameters corresponding to the snapshot of the block device after the block device updates the identification parameters, and the identification parameters corresponding to the first snapshot of the block device.

[0073] Figure 8 A schematic diagram of filling in identification parameters during delayed loading caused by a post-copy migration scenario provided by an optional embodiment of the present application, such as Figure 8 For post-copy migration scenarios, you can directly obtain the identification parameters on the source snapshot for setting. That is, through the source snapshot (migration / clone), parse and construct the correct identification parameters of the block device, and set them to the block device immediately to ensure the correctness of the block device identification parameters.

[0074] As an optional embodiment, the above method further includes the following steps:

[0075] Step 51, obtaining identification parameters of the snapshot, wherein the identification parameters of the snapshot correspond one-to-one to the identification parameters of the block device;

[0076] Step 52: When the block device has imported the data to be filled, update the identification parameters of the snapshot.

[0077] Since the block device has imported the data to be filled, the identification parameters of the block device have changed. If the block device has imported the data to be filled, the identification parameters of the snapshot will also change accordingly. In the embodiment of the present application, the identification parameters of the acquired snapshot are updated by the block device having imported the data to be filled.

[0078] Fig. 9 A schematic diagram of correcting after filling in the identification parameters provided in an optional embodiment of the present application, such as Fig. 9 As shown. The identification parameters of the block device can be filled once. If data is imported, the identification parameters will not be changed. When taking a snapshot of the block device, the snapshot after data import is finally saved as its own identification parameters.

[0079] As an optional embodiment, the method further includes: after the delayed loading of the block device ends, backing up the snapshot.

[0080] In the embodiments of the present application, for the snapshot upload scenario, since snapshot upload is a means of snapshot backup and there is no clear service level agreement (SLA), a delayed upload method can be used to wait for the delayed loading of the block device to end before uploading.

[0081] It should be noted that delayed upload, as a snapshot backup strategy, can avoid performance issues caused by uploading data during snapshot delayed loading. Optionally, delayed upload can use a scheduled task or event trigger to trigger the upload operation, or use asynchronous upload to avoid blocking the main thread.

[0082] The present invention provides a snapshot data processing device, which includes:

[0083] A first processing module is used to create a block device using the source snapshot, and to perform delayed loading of data on the source snapshot based on the block device;

[0084] The second processing module is used to take a snapshot of the block device during the delayed loading period of the block device to obtain a snapshot of the block device;

[0085] The third processing module is configured to fill the position without data loaded with data if the logical block address in the snapshot has a position without data loaded with data.

[0086] In an embodiment of the present application, the device can obtain an immediately available snapshot by filling data at the location where unloaded data appears in the logical block address in the snapshot during the period when the block device is in delayed loading. That is, when the snapshot data is incomplete, the second-level snapshot can still be created and used normally, reducing the functional availability vacuum period of the second-level snapshot, thereby solving the technical problem in the related art that the snapshot cannot be used due to the missing snapshot data of the block device during the delayed loading period, and achieving the technical effect of being able to timely fill the missing snapshot data of the block device during the delayed loading period and improving the availability of the snapshot.

[0087] It should be noted that the first processing module, the second processing module and the third processing module correspond to steps S402 to S406 in the method embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the method embodiment. It should be noted that the modules as part of the device can be run in the electronic device provided in the embodiment of the present application.

[0088] As an optional embodiment, the third processing module includes: a first filling unit, which is used to obtain the data to be filled through a delayed loading extractor when the block device has not imported the data to be filled, and fill the data to be filled into the position of the unloaded data.

[0089] As an optional embodiment, the third processing module includes: a first filling unit, which is used to fill the imported data to be filled into the position where the data is not loaded when the block device has imported the data to be filled.

[0090] As an optional embodiment, the above-mentioned device also includes: a fourth processing module, which is used to create a new block device using the snapshot after obtaining the snapshot of the block device, and hard link the created new snapshot to the snapshot, wherein the new snapshot inherits the position of the unloaded data corresponding to the logical block address in the snapshot; a fifth processing module, which is used to delay the loading of the data to be filled in the source snapshot based on the new block device, and fill the obtained data to be filled into the position of the unloaded data in the new snapshot; and a sixth processing module, which is used to import all the data in the new snapshot into the new block device.

[0091] As an optional embodiment, the above-mentioned device also includes: a seventh processing module, which is used to create a new block device using the snapshot after filling data in the location where no data is loaded, and hard link the created new snapshot to the snapshot; an eighth processing module, which is used to import all data in the new snapshot into the new block device.

[0092] As an optional embodiment, the apparatus further includes: a ninth processing module, configured to construct identification parameters of the block device based on the source snapshot before obtaining the snapshot of the block device, and set the identification parameters of the block device to the block device.

[0093] As an optional embodiment, the ninth processing module includes: a first processing unit, used to perform delayed loading of data from a source snapshot based on a block device, and fill the acquired data into the block device; a second processing unit, used to parse out the position of the loaded data corresponding to the logical block address in the block device, set the identification parameter corresponding to the position of the loaded data to a preset value, and obtain the identification parameter of the block device.

[0094] As an optional embodiment, the above-mentioned device also includes: a tenth processing module, used to obtain the identification parameters of the snapshot, wherein the identification parameters of the snapshot correspond one-to-one to the identification parameters of the block device; an eleventh processing module, used to update the identification parameters of the snapshot when the block device has imported the data to be filled.

[0095] As an optional embodiment, the apparatus further includes: a twelfth processing module, configured to back up the snapshot after the delayed loading of the block device is completed.

[0096] The embodiment of the present application also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program executable by the at least one processor, and the computer program is used to enable the electronic device to perform the method of the embodiment of the present application when executed by the at least one processor.

[0097] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network. The electronic device includes but is not limited to a computer device.

[0098] Optionally, in this embodiment, the computer device may include: a memory and a processor, the memory storing a computer program; the processor, configured to execute the computer program stored in the memory, wherein when the computer program is executed, the processor executes any one of the above method steps.

[0099] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the snapshot data processing method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned snapshot data processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0100] Optionally, the processor may call the information and application stored in the memory through the transmission device to perform the following steps: create a block device using the source snapshot, and perform delayed loading of data on the source snapshot based on the block device; take a snapshot of the block device during the delayed loading of the block device to obtain a snapshot of the block device; if a location where data is not loaded appears in the logical block address in the snapshot, fill the location where data is not loaded with data with data.

[0101] Optionally, in this embodiment, the processor may also execute the following program code: fill the location where data is not loaded, including: when the block device does not import the data to be filled, obtaining the data to be filled through the delayed loading extractor, and filling the data to be filled into the location where data is not loaded.

[0102] Optionally, in this embodiment, the processor may also execute the following program code: fill the location where data is not loaded, including: when the block device has imported the data to be filled, fill the imported data to be filled into the location where data is not loaded.

[0103] Optionally, in this embodiment, the processor may further execute program code of the following steps: after obtaining a snapshot of the block device, the method further includes: creating a new block device using the snapshot, hard linking the created new snapshot to the snapshot, wherein the new snapshot inherits the position of unloaded data corresponding to the logical block address in the snapshot; performing delayed loading of the data to be filled in the source snapshot based on the new block device, and filling the acquired data to be filled into the position of unloaded data in the new snapshot; and importing all data in the new snapshot into the new block device.

[0104] Optionally, in this embodiment, the processor may also execute program code of the following steps: after filling data in the location where no data is loaded, the method further includes: creating a new block device using the snapshot, hard linking the created new snapshot to the snapshot; and importing all data in the new snapshot into the new block device.

[0105] Optionally, in this embodiment, the processor may further execute program code of the following steps: before obtaining a snapshot of the block device, the method further includes: constructing identification parameters of the block device based on the source snapshot, and setting the identification parameters of the block device to the block device.

[0106] Optionally, in this embodiment, the processor may also execute the program code of the following steps: constructing identification parameters of a block device based on the source snapshot, including: performing delayed loading of data from the source snapshot based on the block device, and filling the acquired data into the block device; parsing the position of the loaded data corresponding to the logical block address in the block device, setting the identification parameter corresponding to the position of the loaded data to a preset value, and obtaining the identification parameter of the block device.

[0107] Optionally, in this embodiment, the processor may also execute program code of the following steps: the method further includes: obtaining identification parameters of the snapshot, wherein the identification parameters of the snapshot correspond one-to-one to the identification parameters of the block device; and updating the identification parameters of the snapshot when the block device has imported the data to be filled.

[0108] Optionally, in this embodiment, the processor may further execute program code of the following steps: The method further includes: after the delayed loading of the block device ends, backing up the snapshot.

[0109] The embodiment of the present application further provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method of the embodiment of the present application. The non-transitory machine-readable medium includes a storage medium.

[0110] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0111] Optionally, in this embodiment, the storage medium may be used to store program codes corresponding to the snapshot data processing method provided in the above embodiment, and control the processor to execute the snapshot data processing method when the program codes are executed by the processor.

[0112] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: creating a block device using a source snapshot, and delaying the loading of data for the source snapshot based on the block device; taking a snapshot of the block device during the delayed loading of the block device to obtain a snapshot of the block device; if a location where data is not loaded appears in a logical block address in the snapshot, filling the location where data is not loaded with data with data.

[0113] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: filling data at a location where data has not been loaded, including: when a block device has not imported the data to be filled, obtaining the data to be filled through a delayed loading extractor, and filling the data to be filled into the location where data has not been loaded.

[0114] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: filling data at locations where data is not loaded, including: when the block device has imported data to be filled, filling the imported data to be filled into the locations where data is not loaded.

[0115] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: after obtaining a snapshot of the block device, the method further includes: creating a new block device using the snapshot, hard linking the created new snapshot to the snapshot, wherein the new snapshot inherits the position of the unloaded data corresponding to the logical block address in the snapshot; performing delayed loading of the data to be filled in the source snapshot based on the new block device, and filling the acquired data to be filled into the position of the unloaded data in the new snapshot; and importing all data in the new snapshot into the new block device.

[0116] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: after filling data in locations where no data is loaded, the method further includes: creating a new block device using the snapshot, hard linking the created new snapshot to the snapshot; and importing all data in the new snapshot into the new block device.

[0117] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: before obtaining a snapshot of the block device, the method further includes: constructing identification parameters of the block device based on the source snapshot, and setting the identification parameters of the block device to the block device.

[0118] Optionally, in this embodiment, the storage medium is configured to store a program code for executing the following steps: constructing an identification parameter of a block device based on the source snapshot, including: performing delayed loading of data from the source snapshot based on the block device, and filling the acquired data into the block device; parsing the position of the loaded data corresponding to the logical block address in the block device, setting the identification parameter corresponding to the position of the loaded data to a preset value, and obtaining the identification parameter of the block device.

[0119] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: the method further includes: obtaining identification parameters of the snapshot, wherein the identification parameters of the snapshot correspond one-to-one to the identification parameters of the block device; and updating the identification parameters of the snapshot when the block device has imported the data to be filled.

[0120] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: The method further includes: after the delayed loading of the block device ends, backing up the snapshot.

[0121] The embodiment of the present application also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method of the embodiment of the present application.

[0122] refer to Fig.10 , the structural block diagram of the electronic device that can be used as the server or client of the embodiment of the present application will now be described, which is an example of the hardware device that can be applied to various aspects of the present application. The electronic device is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples, and are not intended to limit the implementation of the present application described and / or required herein.

[0123] like Fig.10 As shown, the electronic device includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0124] Multiple components in the electronic device are connected to the I / O interface 1005, including: an input unit 1006, an output unit 1007, a storage unit 1008, and a communication unit 1009. The input unit 1006 can be any type of device that can input information to the electronic device, and the input unit 1006 can receive input digital or character information, and generate key signal input related to user settings and / or function control of the electronic device. The output unit 1007 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1008 can include but is not limited to a disk, an optical disk. The communication unit 1009 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0125] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a CPU, a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present application may be implemented as a computer program, which is tangibly contained in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM 1002 and / or communication unit 1009. In some embodiments, the computing unit 1001 may be configured to perform the above method in any other appropriate manner (e.g., by means of firmware).

[0126] The computer program for implementing the method of the embodiment of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0127] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable signal medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0128] It should be noted that the term "including" and its variations used in the embodiments of the present application are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present application are illustrative and not restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0129] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0130] The various steps described in the method implementation methods provided in the embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method implementation methods may include additional steps and / or omit the steps shown. The scope of protection of the present application is not limited in this respect.

[0131] The term "embodiment" in this specification refers to specific features, structures or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments refer to each other. In particular, for the device, equipment, and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment.

[0132] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A method for processing snapshot data, comprising: Creating a block device using the source snapshot, and performing delayed loading of data on the source snapshot based on the block device; During the period when the block device is in delayed loading, taking a snapshot of the block device to obtain a snapshot of the block device; If a location where no data is loaded appears in the logical block address in the snapshot, data is filled in the location where no data is loaded.

2. The method according to claim 1, wherein: Filling the location where no data is loaded with data includes: In the case that the block device has not imported the data to be filled, the data to be filled is obtained through a delayed loading extractor, and the data to be filled is filled into the position of the unloaded data.

3. The method according to claim 1, wherein: Filling the location where no data is loaded with data includes: In the case that the block device has imported the data to be filled, the imported data to be filled is filled into the position of the unloaded data.

4. The method according to claim 1, wherein: After obtaining the snapshot of the block device, the method further includes: Creating a new block device using the snapshot, and hard linking the created new snapshot to the snapshot, wherein the new snapshot inherits the position of the unloaded data corresponding to the logical block address in the snapshot; Performing delayed loading of data to be filled on the source snapshot based on the new block device, and filling the acquired data to be filled into the position of the unloaded data in the new snapshot; Import all data in the new snapshot into the new block device.

5. The method according to claim 1, wherein: After filling the position where no data is loaded with data, the method further includes: Creating a new block device using the snapshot, and hard linking the created new snapshot to the snapshot; Import all data in the new snapshot into the new block device.

6. The method according to claim 1, wherein: Before obtaining the snapshot of the block device, the method further includes: An identification parameter of the block device is constructed based on the source snapshot, and the identification parameter of the block device is set to the block device.

7. The method according to claim 6, wherein: Constructing identification parameters of the block device based on the source snapshot includes: Lazy loading of data from the source snapshot based on the block device, filling the acquired data into the block device; The position of the loaded data corresponding to the logical block address in the block device is parsed, and the identification parameter corresponding to the position of the loaded data is set to a preset value to obtain the identification parameter of the block device.

8. The method according to claim 1, wherein: The method further comprises: Acquire identification parameters of the snapshot, wherein the identification parameters of the snapshot correspond one-to-one to the identification parameters of the block device; When the block device has imported the data to be filled, the identification parameter of the snapshot is updated.

9. The method according to any one of claims 1 to 8, wherein: The method further comprises: After the delayed loading of the block device ends, the snapshot is backed up.

10. A snapshot data processing device, comprising: A first processing module, configured to create a block device using a source snapshot, and perform delayed loading of data on the source snapshot based on the block device; A second processing module is used to take a snapshot of the block device during the period when the block device is in delayed loading, so as to obtain a snapshot of the block device; The third processing module is configured to fill data in a location where no data is loaded if a location where no data is loaded appears in the logical block address in the snapshot.

11. An electronic device, comprising: A processor, and a memory storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 9.

12. A non-transitory machine-readable medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and apparatus for fast context cloning in data processing system

    CN110892381A

  • Snapshot cache creation method and device, electronic equipment and computer storage medium

    CN111522621A

  • Managing data dependentives in a transmission pipe

    CN114586018A

  • Storage volume snapshot object management

    US11397645B1

  • Method to write data ahead to snapshot area to avoid copy-on-write

    US20200142971A1