Data refreshing method and device, computer device, storage medium and program product
By determining the root volume and constructing a feedback structure tree, and using memory to read data to fill the cache pages, the inefficiency caused by non-full pages in the cache is solved, and fast data flushing is achieved.
Patent Information
- Application Number
- CN202411577667.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-11-06
AI Technical Summary
In traditional technologies, non-full pages in the cache need to be filled by reading data from disk, resulting in low data flushing efficiency.
By identifying the root volume among the snapshot volumes to be flushed, a feedback structure tree is constructed using snapshot relationships, and cache pages of the root volume are read from memory to fill the cache pages of the snapshot volume to be flushed, reducing the number of disk reads.
Improves the efficiency of data flushing and shortens the time it takes to flush snapshot data to disk.
Smart Images

Figure CN119415037B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data flushing method, apparatus, computer equipment, storage medium, and program product. Background Art
[0002] When snapshot data is written to disk in the cache, it is flushed back. Specifically, each non-8KB page (partially full page) is read from disk or memory to fill the remaining page before it can be written to disk. However, even after reading from disk or memory to fill the remaining page as much as possible, some non-full pages may still exist in the cache.
[0003] In traditional technologies, partially full pages in the cache are continuously read from disk to fill up with data. However, traditional technologies suffer from low data flushing efficiency. Summary of the Invention
[0004] Based on this, it is necessary to provide a data flushing method, device, computer equipment, storage medium and program product that can improve data flushing efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a data flushing method, comprising:
[0006] determining a root volume among the snapshot volumes to be flushed according to a snapshot relationship between the snapshot volumes to be flushed;
[0007] According to the cache pages filled up by the root volume and the snapshot relationship, the cache pages corresponding to the snapshot volumes to be flushed are fed back.
[0008] In one embodiment, feeding back the cache pages corresponding to the snapshot volumes in the to-be-flushed snapshot volumes based on the cache pages filled up by the root volume and the snapshot relationship includes:
[0009] Based on the snapshot relationship, constructing a feedback structure tree of each snapshot volume;
[0010] The cache pages corresponding to the snapshot volumes are fed back according to the feed-back structure tree and the cache pages filled up by the root volume.
[0011] In one embodiment, feeding back the cache pages corresponding to the snapshot volumes according to the feeding back structure tree and the cache pages filled up by the root volume includes:
[0012] Determine, according to the feedback structure tree, the sub-volume corresponding to the root volume and the grandchild volume corresponding to the sub-volume;
[0013] According to the cache pages filled up by the root volume, the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume are fed back.
[0014] In one embodiment, feeding back the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume based on the cache pages filled up by the root volume includes:
[0015] Feeding back the cache pages of the subvolume based on the cache pages filled up by the root volume;
[0016] When the cache page of the sub-volume is full, the cache page of the grandchild volume corresponding to the sub-volume is fed back based on the full cache page of the sub-volume.
[0017] In one embodiment, constructing a feedback structure tree of each snapshot volume based on the snapshot relationship includes:
[0018] Based on the snapshot relationship, determining a feedback relationship between the snapshot volumes;
[0019] The feedback structure tree is constructed according to the feedback relationship of each snapshot volume.
[0020] In one embodiment, the method further comprises:
[0021] Read data from disk to fill the cache pages of the root volume.
[0022] In a second aspect, the present application further provides a data flushing device, comprising:
[0023] a determination module, configured to determine a root volume in the snapshot volumes to be flushed based on a snapshot relationship between the snapshot volumes to be flushed;
[0024] The flushing module is configured to feed back the cache pages corresponding to the snapshot volumes to be flushed back according to the cache pages filled up by the root volume and the snapshot relationship.
[0025] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0026] determining a root volume among the snapshot volumes to be flushed according to a snapshot relationship between the snapshot volumes to be flushed;
[0027] According to the cache pages filled up by the root volume and the snapshot relationship, the cache pages corresponding to the snapshot volumes to be flushed are fed back.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0029] determining a root volume among the snapshot volumes to be flushed according to a snapshot relationship between the snapshot volumes to be flushed;
[0030] According to the cache pages filled up by the root volume and the snapshot relationship, the cache pages corresponding to the snapshot volumes to be flushed are fed back.
[0031] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:
[0032] determining a root volume among the snapshot volumes to be flushed according to a snapshot relationship between the snapshot volumes to be flushed;
[0033] According to the cache pages filled up by the root volume and the snapshot relationship, the cache pages corresponding to the snapshot volumes to be flushed are fed back.
[0034] The above-mentioned data flushing method, device, computer equipment, storage medium and program product can quickly determine the root volume in the snapshot volume to be flushed back according to the snapshot relationship between the snapshot volumes to be flushed back, so that the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed back can be fed back according to the cache pages filled by the root volume and the snapshot relationship. Since the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed back are filled by utilizing the dependency relationship between the snapshot data, the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed back are read by reading the cache pages filled by the root volume in the memory manner, thereby reducing the number of disk reads, greatly shortening the time for flushing snapshot data to disk, and thus improving the efficiency of data flushing. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0036] Figure 1 A schematic flow chart of a data flushing method according to an embodiment;
[0037] Figure 2 A schematic diagram of the relationship between snapshot volumes in one embodiment;
[0038] Figure 3 A flowchart of a data flushing method according to another embodiment;
[0039] Figure 4 A schematic diagram of a feedback structure tree constructed in one embodiment;
[0040] Figure 5 A flowchart of a data flushing method according to another embodiment;
[0041] Figure 6A flowchart of a data flushing method according to another embodiment;
[0042] Figure 7 A schematic diagram of the feedback relationship between snapshot volumes in one embodiment;
[0043] Figure 8 A structural block diagram of a data flushing device in one embodiment;
[0044] Figure 9 It is a structural block diagram of a data flushing device in another embodiment;
[0045] Figure 10 It is a structural block diagram of a data flushing device in another embodiment;
[0046] Figure 11 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0048] In an exemplary embodiment, Figure 1 As shown, a data flushing method is provided. This embodiment uses the method applied to a computer device as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a computer device and a server, and is implemented through the interaction between the computer device and the server. In this embodiment, the method includes the following steps:
[0049] S201 : Determine a root volume in the snapshot volumes to be flushed based on a snapshot relationship between the snapshot volumes to be flushed.
[0050] First of all, it should be noted that Figure 2 As shown in the figure, a root volume (snapshot volume of version 1) can create multiple snapshot volumes with increasing versions. Multiple snapshot volumes can form multiple different snapshot chains. The root volume of multiple different snapshot chains is the same, and the root volume version is lower, and the snapshot volumes created layer by layer have higher versions.
[0051] Optionally, the snapshot volumes to be reflushed in this embodiment may be multiple different snapshot volumes created from the same root volume. Therefore, in this embodiment, the root volume in the snapshot volumes to be reflushed may be determined based on the snapshot relationship between the snapshot volumes to be reflushed.
[0052] S202: Feed back the cache pages corresponding to the snapshot volumes to be flushed based on the relationship between the cache pages filled up by the root volume and the snapshots.
[0053] In this embodiment, after the root volume in the snapshot volumes to be flushed back is determined based on the snapshot relationship between the snapshot volumes to be flushed back, the root volume can first fill its own cache pages when flushing data. Furthermore, in this embodiment, the next-level snapshot volume corresponding to the root volume can be determined based on the snapshot relationship between the cache pages filled by the root volume and the snapshot volumes to be flushed back, and the cache pages of the next-level snapshot volume corresponding to the root volume can be filled using the cache pages filled by the root volume. And so on, and then the next-level snapshot volume corresponding to the next-level snapshot volume can be determined based on the snapshot relationship, and the cache pages of the next-level snapshot volume can be filled using the cache pages filled by the root volume.
[0054] In the above data flushing method, the root volume in the snapshot volume to be flushed can be quickly determined based on the snapshot relationship between the snapshot volumes to be flushed back, so that the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed back can be fed back based on the cache pages filled in the root volume and the snapshot relationship. Since the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed back are filled by utilizing the dependency relationship between the snapshot data, the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed back are read by reading the cache pages filled in the root volume in the memory manner, thereby reducing the number of disk reads, greatly shortening the time for flushing snapshot data to disk, and thus improving the efficiency of data flushing.
[0055] In this embodiment, the detailed process of feeding back the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed based on the relationship between the cache pages filled in the root volume and the snapshot will be explained. Figure 3 As shown, the above S202 includes:
[0056] S301: Construct a feedback structure tree of each snapshot volume based on the snapshot relationship.
[0057] In this embodiment, the feedback relationship between the snapshot volumes to be refreshed can be determined based on the snapshot relationship between the snapshot volumes to be refreshed, and based on the determined feedback relationship between the snapshot volumes to be refreshed, a feedback structure tree of each snapshot volume can be constructed. For example, assuming that the snapshot volume to be refreshed is Figure 2 The snapshot volumes shown in , based on the snapshot relationship between the snapshot volumes to be flushed, the feedback structure tree of each snapshot volume in the snapshot volumes to be flushed can be constructed as Figure 4 The example structure tree.
[0058] S302: Feed back the cache pages corresponding to each snapshot volume according to the feed-back structure tree and the cache pages filled up by the root volume.
[0059] In this embodiment, the root volume of the snapshot volume to be flushed and the feedback relationship between the root volume and each snapshot volume can be determined based on the feedback structure tree, so that the cache pages corresponding to each snapshot volume can be fed back based on the cache pages filled by the root volume. For example, after determining the feedback relationship of each snapshot volume, the cache pages of the sub-volume corresponding to the root volume can be fed back based on the cache pages filled by the root volume. Further, the cache pages of the snapshot volume at the next level of the sub-volume can be fed back based on the cache pages filled by the sub-volume.
[0060] In this embodiment, the process of constructing a feedback structure tree of each snapshot volume based on the snapshot relationship of each snapshot volume in the snapshot volume to be flushed back is relatively simple, and the feedback structure tree of each snapshot volume can be quickly constructed, so that the cache pages corresponding to each snapshot volume can be fed back according to the feedback structure tree of each snapshot volume and the cache pages filled up by the root volume. Since the cache pages corresponding to each snapshot volume are fed back according to the cache pages filled up by the root volume, the data is read from the memory, and the number of disk reads can be reduced, thereby shortening the time for flushing snapshot data to disk and improving the efficiency of data flushing.
[0061] In this embodiment, the detailed process of feeding back the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed back will be explained based on the cache pages filled up by the feeding back structure tree and the root volume. Figure 5 As shown, the above S302 includes:
[0062] S401: Determine the sub-volume corresponding to the root volume and the grand-child volume corresponding to the sub-volume according to the feedback structure tree.
[0063] In this embodiment, the node where the root volume is located can be determined from the feedback structure tree, and then the next node of the node where the root volume is located can be determined from the feedback structure tree, and the snapshot volume corresponding to the next node of the node where the root volume is located can be determined as the subvolume corresponding to the root volume. Furthermore, the next node corresponding to the next node of the node where the root volume is located can be determined from the feedback structure tree, and the snapshot volume corresponding to the next node of the next node of the node where the root volume is located can be determined as the grandchild volume corresponding to the subvolume.
[0064] S402: Feed back the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume based on the cache pages filled up by the root volume.
[0065] Optionally, in this embodiment, the cache pages of the determined sub-volume can be fed back based on the cache pages of the root volume that are filled up. Furthermore, when the cache pages of the sub-volume are filled up, the cache pages of the grandchild volume corresponding to the sub-volume can be fed back based on the cache pages of the sub-volume that are filled up, so that the cache pages of the grandchild volume corresponding to the sub-volume are filled up.
[0066] As another optional implementation, in this embodiment, the cache pages of the determined sub-volume can be fed back based on the cache pages of the root volume that are filled up. Furthermore, when the cache pages of the sub-volume are filled up, the cache pages of the grandchild volume corresponding to the sub-volume can be fed back based on the cache pages of the root volume that are filled up, so that the cache pages of the grandchild volume corresponding to the sub-volume are filled up.
[0067] In this embodiment, based on the feedback structure tree of each snapshot volume in the snapshot volume to be flushed back, the subvolume corresponding to the root volume and the grandchild volume corresponding to the subvolume in the snapshot volume to be flushed back can be quickly determined, so that the cache page of the subvolume and the cache page of the grandchild volume corresponding to the subvolume can be fed back according to the cache page filled up by the root volume, thereby reducing the number of disk reads when filling up the cache pages of the subvolume of the root volume and the cache pages of the grandchild volume of the subvolume, shortening the time for flushing snapshot data to disk, and improving the efficiency of data flushing.
[0068] In this embodiment, the specific construction process of constructing the feedback structure tree of each snapshot volume in the snapshot volume to be flushed will be explained. In an exemplary embodiment, Figure 6 As shown, the above S301 includes:
[0069] S501: Determine the feedback relationship of each snapshot volume based on the snapshot relationship.
[0070] In this embodiment, since the root volume data version is low and the newly created snapshot volume version is high, there is a dependency relationship between the high-version snapshot volume and the low-version snapshot volume. Therefore, the feedback relationship of each snapshot volume in the snapshot volume to be flushed can be determined based on the snapshot relationship of the snapshot volume to be flushed. For example, Figure 7 As shown, assuming that the snapshot relationship of a snapshot chain is snapshot volume 4 depends on snapshot volume 3, snapshot volume 3 depends on snapshot volume 2, and snapshot volume 2 depends on snapshot volume 1, it can be determined that the feedback relationship of each snapshot volume in the snapshot chain is snapshot volume 1 feeds back snapshot volume 2, snapshot volume 2 feeds back snapshot volume 3, and snapshot volume 3 feeds back snapshot volume 4.
[0071] S502: Construct a feedback structure tree based on the feedback relationship of each snapshot volume.
[0072] In this embodiment, based on the determined feedback relationship of each snapshot volume, the root volume in each snapshot volume can be used as the vertex of the feedback structure tree, and the snapshot volume fed back by the root volume can be used as the child node of the vertex. And so on, according to the feedback relationship of each snapshot volume in the snapshot volume to be refreshed, the above-mentioned feedback structure tree is constructed.
[0073] In this embodiment, based on the snapshot relationship of each snapshot volume in the snapshot volume to be flushed back, the feedback relationship of each snapshot volume can be quickly determined, so that the feedback structure tree of each snapshot volume can be quickly constructed according to the feedback relationship of each snapshot volume, ensuring the timeliness and feasibility of the construction of the feedback structure tree.
[0074] Based on the above embodiment, this embodiment will explain the implementation method of filling up the cache page of the root volume. In an exemplary embodiment, the above method further includes:
[0075] Step A: Read data from disk to fill the cache pages of the root volume.
[0076] In this embodiment, when filling the cache page of the root volume in the snapshot volume to be flushed back, data needs to be read from the disk to fill the cache page of the root volume. Only then can the cache page of the root volume be used to feed back other snapshot volumes in the snapshot volume to be flushed back, reducing the number of disk reads during the data flushing process.
[0077] In this embodiment, data is read from the disk to fill the cache pages of the root volume in the snapshot volume to be flushed back. While filling the cache pages of the root volume, it is ensured that the cache pages of the root volume can be used to feed back other snapshot volumes in the snapshot volume to be flushed back. In addition, only one disk read is required in the entire process, which reduces the number of disk reads and greatly shortens the time it takes to flush snapshot data to disk.
[0078] To facilitate understanding by those skilled in the art, the data flushing method provided by this application is described in detail below. The method may include:
[0079] S1: Determine a root volume in the snapshot volumes to be flushed based on a snapshot relationship between the snapshot volumes to be flushed.
[0080] S2 reads data from the disk to fill the cache pages of the root volume.
[0081] S3: Based on the snapshot relationship, determine the feedback relationship between the snapshot volumes.
[0082] S4: Construct a feedback structure tree based on the feedback relationship of each snapshot volume.
[0083] S5: Determine the sub-volume corresponding to the root volume and the grandchild volume corresponding to the sub-volume according to the feedback structure tree.
[0084] S6: Based on the cache pages filled up by the root volume, the cache pages of the sub-volume are fed back.
[0085] S7, when the cache page of the sub-volume is full, the cache page of the grandchild volume corresponding to the sub-volume is fed back based on the full cache page of the sub-volume.
[0086] It should be noted that for the descriptions in S1-S7 above, reference can be made to the relevant descriptions in the above embodiments, and the effects are similar, so this embodiment will not be repeated here.
[0087] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0088] Based on the same inventive concept, the present application also provides a data rewind device for implementing the aforementioned data rewind method. The implementation solution provided by the device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations of one or more data rewind device embodiments provided below can be found in the above-mentioned limitations of the data rewind method and will not be repeated here.
[0089] In an exemplary embodiment, Figure 8 As shown, a data flushing device is provided, comprising: a determination module 10 and a flushing module 11, wherein:
[0090] The determination module 10 is configured to determine a root volume in the snapshot volumes to be flushed based on the snapshot relationship between the snapshot volumes to be flushed.
[0091] The flushing module 11 is configured to feed back the cache pages corresponding to the snapshot volumes to be flushed based on the relationship between the cache pages filled up by the root volume and the snapshots.
[0092] The data flushing device provided in this embodiment can execute the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0093] In one embodiment, Figure 9 As shown, the above-mentioned brushing module 11 includes: a construction unit 111 and a feedback unit 112, wherein:
[0094] The construction unit 111 is configured to construct a feedback structure tree of each snapshot volume based on the snapshot relationship.
[0095] The feedback unit 112 is configured to feedback the cache pages corresponding to the snapshot volumes according to the feedback structure tree and the cache pages filled up by the root volume.
[0096] The data flushing device provided in this embodiment can execute the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0097] In one embodiment, the feedback unit 112 is specifically used to determine the subvolume corresponding to the root volume and the grandchild volume corresponding to the subvolume based on the feedback structure tree; and feedback the cache page of the subvolume and the cache page of the grandchild volume corresponding to the subvolume based on the cache page filled up by the root volume.
[0098] The data flushing device provided in this embodiment can execute the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0099] In one embodiment, the feedback unit 112 is specifically configured to feedback the cache pages of the sub-volume based on the cache pages filled up by the root volume;
[0100] When the cache pages of a sub-volume are full, the cache pages of the grandchild volume corresponding to the sub-volume are fed back based on the full cache pages of the sub-volume.
[0101] The data flushing device provided in this embodiment can execute the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0102] In one embodiment, the construction unit 111 is specifically configured to determine the feedback relationship of each snapshot volume based on the snapshot relationship; and construct a feedback structure tree according to the feedback relationship of each snapshot volume.
[0103] The data flushing device provided in this embodiment can execute the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0104] In one embodiment, Figure 10 As shown, the above device further includes: a reading module 12, wherein:
[0105] The reading module 12 is used to read data from the disk to fill the cache pages of the root volume.
[0106] The data flushing device provided in this embodiment can execute the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail here.
[0107] Each module in the data flushing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0108] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 11As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store snapshot relationships between snapshot volumes to be flushed back. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data flushing method is implemented.
[0109] Those skilled in the art will understand that Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0110] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0111] Determine the root volume in the snapshot volumes to be refreshed based on the snapshot relationship between the snapshot volumes to be refreshed;
[0112] Based on the relationship between the cache pages filled in the root volume and the snapshots, the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed are fed back.
[0113] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0114] Based on the snapshot relationship, a feedback structure tree of each snapshot volume is constructed;
[0115] Based on the cache pages that are replenished in the feedback structure tree and the root volume, the cache pages corresponding to each snapshot volume are fed back.
[0116] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0117] According to the feedback structure tree, determine the sub-volume corresponding to the root volume and the grandchild volume corresponding to the sub-volume;
[0118] Based on the cache pages filled in the root volume, the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume are fed back.
[0119] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0120] Based on the cache pages filled up by the root volume, the cache pages of the sub-volume are fed back;
[0121] When the cache pages of a sub-volume are full, the cache pages of the grandchild volume corresponding to the sub-volume are fed back based on the full cache pages of the sub-volume.
[0122] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0123] Based on the snapshot relationship, determine the feedback relationship between each snapshot volume;
[0124] A feedback structure tree is constructed based on the feedback relationship between snapshot volumes.
[0125] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0126] Read data from disk to fill the cache pages of the root volume.
[0127] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0128] Determine the root volume in the snapshot volumes to be refreshed based on the snapshot relationship between the snapshot volumes to be refreshed;
[0129] Based on the relationship between the cache pages filled in the root volume and the snapshots, the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed are fed back.
[0130] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0131] Based on the snapshot relationship, a feedback structure tree of each snapshot volume is constructed;
[0132] Based on the cache pages that are replenished in the feedback structure tree and the root volume, the cache pages corresponding to each snapshot volume are fed back.
[0133] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0134] According to the feedback structure tree, determine the sub-volume corresponding to the root volume and the grandchild volume corresponding to the sub-volume;
[0135] Based on the cache pages filled in the root volume, the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume are fed back.
[0136] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0137] Based on the cache pages filled up by the root volume, the cache pages of the sub-volume are fed back;
[0138] When the cache pages of a sub-volume are full, the cache pages of the grandchild volume corresponding to the sub-volume are fed back based on the full cache pages of the sub-volume.
[0139] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0140] Based on the snapshot relationship, determine the feedback relationship between each snapshot volume;
[0141] A feedback structure tree is constructed based on the feedback relationship between snapshot volumes.
[0142] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0143] Read data from disk to fill the cache pages of the root volume.
[0144] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0145] Determine the root volume in the snapshot volumes to be refreshed based on the snapshot relationship between the snapshot volumes to be refreshed;
[0146] Based on the relationship between the cache pages filled in the root volume and the snapshots, the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed are fed back.
[0147] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0148] Based on the snapshot relationship, a feedback structure tree of each snapshot volume is constructed;
[0149] Based on the cache pages that are replenished in the feedback structure tree and the root volume, the cache pages corresponding to each snapshot volume are fed back.
[0150] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0151] According to the feedback structure tree, determine the sub-volume corresponding to the root volume and the grandchild volume corresponding to the sub-volume;
[0152] Based on the cache pages filled in the root volume, the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume are fed back.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0154] Based on the cache pages filled up by the root volume, the cache pages of the sub-volume are fed back;
[0155] When the cache pages of a sub-volume are full, the cache pages of the grandchild volume corresponding to the sub-volume are fed back based on the full cache pages of the sub-volume.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0157] Based on the snapshot relationship, determine the feedback relationship between each snapshot volume;
[0158] A feedback structure tree is constructed based on the feedback relationship between snapshot volumes.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0160] Read data from disk to fill the cache pages of the root volume.
[0161] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0162] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0163] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A data flushing method, characterized in that: The method comprises: determining a root volume among the snapshot volumes to be flushed according to a snapshot relationship between the snapshot volumes to be flushed; Based on the snapshot relationship, the feedback relationship of each snapshot volume in the snapshot volume to be flushed is determined, and according to the feedback relationship of each snapshot volume, a feedback structure tree of each snapshot volume is constructed. According to the feedback structure tree and the cache page filled up by the root volume, the cache page corresponding to each snapshot volume is fed back.
2. The method according to claim 1, characterized in that Feeding back the cache pages corresponding to the snapshot volumes according to the feedback structure tree and the cache pages filled up by the root volume includes: Determine, according to the feedback structure tree, the sub-volume corresponding to the root volume and the grandchild volume corresponding to the sub-volume; According to the cache pages filled up by the root volume, the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume are fed back.
3. The method according to claim 2, characterized in that Feeding back the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume based on the cache pages filled up by the root volume includes: Feeding back the cache pages of the subvolume based on the cache pages filled up by the root volume; When the cache page of the sub-volume is full, the cache page of the grandchild volume corresponding to the sub-volume is fed back based on the full cache page of the sub-volume.
4. The method according to claim 2, characterized in that Feeding back the cache pages of the sub-volume and the cache pages of the grandchild volume corresponding to the sub-volume based on the cache pages filled up by the root volume includes: Feeding back the cache pages of the subvolume based on the cache pages filled up by the root volume; When the cache page of the sub-volume is full, the cache page of the grandchild volume corresponding to the sub-volume is fed back based on the full cache page of the root volume.
5. The method according to claim 1, wherein The step of constructing a feedback structure tree of each snapshot volume according to the feedback relationship of each snapshot volume includes: Based on the feedback relationship of each snapshot volume, the root volume of each snapshot volume is used as the vertex of the feedback structure tree, and the snapshot volume fed back by the root volume is used as the child node of the vertex, and so on to construct the feedback structure tree.
6. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Read data from disk to fill the cache pages of the root volume.
7. A data flushing device, characterized in that: The device comprises: a determination module, configured to determine a root volume in the snapshot volumes to be flushed based on a snapshot relationship between the snapshot volumes to be flushed; A flushing module is used to determine the feedback relationship of each snapshot volume in the snapshot volume to be flushed based on the snapshot relationship, construct a feedback structure tree of each snapshot volume according to the feedback relationship of each snapshot volume, and feed back the cache pages corresponding to each snapshot volume according to the feedback structure tree and the cache pages filled up by the root volume.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Data logic position mapping method
CN111338568A
External storage equipment reading method and device, electronic equipment and storage medium
CN116048398A