Data refreshing method and device, computer equipment, storage medium and program product
By determining the root volume and using the dependencies between snapshot data to feed back the cache page, the problem of low data rebrushing efficiency in traditional technology is solved, and a more efficient data rebrushing process is achieved.
Patent Information
- Application Number
- CN202411577667.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-06
AI Technical Summary
In traditional technology, non-full pages in the cache fill up the data by reading the disk, resulting in low data reflux efficiency.
By determining the root volume based on the snapshot relationship between the snapshot volume to be refilled, and feeding back the cache pages corresponding to each snapshot volume in the flashed snapshot volume based on the cache page and the snapshot relationship of the root volume, the dependence between the snapshot data is used. Relationship reduces the number of disk readings.
Improve the efficiency of data rebrushing and shorten the time for snapshot data to be rebrushed and dropped off the plate.
Smart Images

Figure CN119415037A_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 the snapshot data is written to the disk in the cache, it is flushed back, that is, each non-8K page (non-full page) is filled by reading the disk or reading the memory, and then it can be written to the disk. However, after the non-full page is filled as much as possible by reading the disk or reading the memory, some non-full pages still exist in the cache.
[0003] In traditional technology, the non-full pages in the cache will continue to be filled with data by reading the disk. However, traditional technology has the problem of 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 in the snapshot volumes to be flushed according to the 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 in the snapshot volumes to be flushed back are fed back.
[0008] In one embodiment, feeding back the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed back according to the cache pages filled up by the root volume and the snapshot relationship includes:
[0009] Based on the snapshot relationship, construct a feedback structure tree of each snapshot volume;
[0010] According to the feedback structure tree and the cache pages filled up by the root volume, the cache pages corresponding to the snapshot volumes are fed back.
[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, a subvolume corresponding to the root volume and a grandchild volume corresponding to the subvolume;
[0013] According to the cache page filled by the root volume, the cache page of the sub-volume and the cache page 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 volumes corresponding to the sub-volume according to the cache pages filled up by the root volume includes:
[0015] Feeding back the cache pages of the subvolume according to the cache pages filled up by the root volume;
[0016] When the cache page of the subvolume is full, the cache page of the grandchild volume corresponding to the subvolume is fed back according to the full cache page of the subvolume.
[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] The cache pages of the root volume are filled with data read from disk.
[0022] In a second aspect, the present application also provides a data flushing device, comprising:
[0023] A determination module, configured to determine a root volume in the snapshot volumes to be flushed according to the snapshot relationship between the snapshot volumes to be flushed;
[0024] The flushing module is used to feed back the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed according to the cache pages filled by the root volume and the snapshot relationship.
[0025] In a third aspect, the present application further provides a computer device, including 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 in the snapshot volumes to be flushed according to the 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 in the snapshot volumes to be flushed back 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 in the snapshot volumes to be flushed according to the 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 in the snapshot volumes to be flushed back are fed back.
[0031] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0032] Determining a root volume in the snapshot volumes to be flushed according to the 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 in the snapshot volumes to be flushed back 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 a memory manner, thereby reducing the number of disk reads, greatly shortening the time for snapshot data to be flushed back to disk, thereby 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 drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. 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 creative work.
[0036] FIG1 is a schematic diagram of a flow chart of a data flushing method in one embodiment;
[0037] Figure 2 A schematic diagram of the relationship between snapshot volumes in one embodiment;
[0038] FIG3 is a schematic diagram of a flow chart of a data flushing method in another embodiment;
[0039] FIG4 is a schematic diagram of a feedback structure tree constructed in one embodiment;
[0040] FIG5 is a schematic diagram of a flow chart of a data flushing method in another embodiment;
[0041] FIG6 is a schematic flow chart of a data flushing method in another embodiment;
[0042] FIG7 is a schematic diagram of a feedback relationship between snapshot volumes in one embodiment;
[0043] FIG8 is a structural block diagram of a data flushing device in one embodiment;
[0044] FIG9 is a structural block diagram of a data flushing device in another embodiment;
[0045] FIG10 is a structural block diagram of a data flushing device in another embodiment;
[0046] FIG. 11 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] In an exemplary embodiment, as shown in FIG1 , 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, determining a root volume in the snapshot volumes to be flushed back according to the snapshot relationship between the snapshot volumes to be flushed back.
[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 volumes of multiple different snapshot chains are the same, and the root volume version is low, while the snapshot volumes created layer by layer have higher versions.
[0051] Optionally, the snapshot volumes to be flushed 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 flushed may be determined according to the snapshot relationship between the snapshot volumes to be flushed.
[0052] S202: Feed back the cache pages corresponding to the snapshot volumes in the snapshot volume to be flushed according to 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 is determined based on the snapshot relationship between the snapshot volumes to be flushed back, when flushing data, the root volume can first fill up its own cache pages. Furthermore, in this embodiment, the next-layer snapshot volume corresponding to the root volume can be determined based on the snapshot relationship between the cache pages filled up by the root volume and the snapshot volumes to be flushed back, and the cache pages of the next-layer snapshot volume corresponding to the root volume can be filled up using the cache pages filled up by the root volume, and so on. Then, based on the snapshot relationship, the next-next-layer snapshot volume corresponding to the next-layer snapshot volume can be determined, and the cache pages of the next-next-layer snapshot volume can be filled up using the cache pages filled up by the root volume.
[0054] In the above data flushing method, according to the snapshot relationship between the snapshot volumes to be flushed back, the root volume in the snapshot volume to be flushed back can be quickly determined, 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 up 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 up 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.
[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 by the root volume and the snapshots is explained. In an exemplary embodiment, as shown in FIG3 , 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 the feedback structure tree of each snapshot volume can be constructed based on the determined feedback relationship between the snapshot volumes to be refreshed. Figure 2 , based on the snapshot relationship between the snapshot volumes to be flushed back, the feedback structure tree of each snapshot volume in the snapshot volumes to be flushed back may be the structure tree shown in FIG. 4 .
[0058] S302: 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.
[0059] In this embodiment, the root volume in 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 page corresponding to each snapshot volume can be fed back according to the cache page filled by the root volume. For example, after determining the feedback relationship of each snapshot volume, the cache page of the sub-volume corresponding to the root volume can be fed back according to the cache page filled by the root volume, and further, the cache page of the next-level snapshot volume of the sub-volume can be fed back according to the cache page filled by the sub-volume.
[0060] In the present embodiment, based on the snapshot relationship of each snapshot volume in the snapshot volume to be flushed back, the process of constructing the feedback structure tree of each snapshot volume is relatively simple, and the feedback structure tree of each snapshot volume can be constructed quickly, 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. When 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 thus 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 according to the cache pages filled up by the feeding back structure tree and the root volume is explained. In an exemplary embodiment, as shown in FIG5 , the above S302 includes:
[0062] S401, determining the sub-volume corresponding to the root volume and the grandchild 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 volumes corresponding to the sub-volume according to the cache pages filled up by the root volume.
[0065] Optionally, in this embodiment, the cache pages of the determined subvolume can be fed back based on the cache pages of the root volume that are filled up. Furthermore, when the cache pages of the subvolume are filled up, the cache pages of the grandchild volumes corresponding to the subvolume can be fed back based on the cache pages of the subvolume that are filled up, so that the cache pages of the grandchild volumes corresponding to the subvolume are filled up.
[0066] As another optional implementation, in this embodiment, the cache pages of the determined subvolume can be fed back based on the cache pages of the root volume that are filled up. Furthermore, when the cache pages of the subvolume are filled up, the cache pages of the grandchild volume corresponding to the subvolume 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 subvolume are filled up.
[0067] In this embodiment, according to 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 back is explained. In an exemplary embodiment, as shown in FIG. 6 , the above S301 includes:
[0069] S501, determining a feedback relationship between snapshot volumes 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, as shown in FIG7, assuming that the snapshot relationship of a snapshot chain is that 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 that 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 according to 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. Similarly, 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 among the snapshot volumes in the snapshot volume to be flushed, the feedback relationship among the snapshot volumes can be quickly determined, so that the feedback structure tree of each snapshot volume can be quickly constructed according to the feedback relationship among the snapshot volumes, thereby ensuring the timeliness and feasibility of constructing 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 also includes:
[0075] Step A: Read data from disk to fill the cache page of the root volume.
[0076] In this embodiment, when filling up 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 up 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, thereby reducing the number of disk reads during the data flushing process.
[0077] In this embodiment, data is read from the disk to fill up the cache pages of the root volume in the snapshot volume to be flushed back. While filling up 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 the whole process, only one disk read is required, which reduces the number of disk reads and greatly shortens the time for flushing snapshot data to disk.
[0078] To facilitate understanding by those skilled in the art, the data flushing method provided by the present application is described in detail below. The method may include:
[0079] S1, determining a root volume in the snapshot volumes to be flushed back according to the snapshot relationship between the snapshot volumes to be flushed back.
[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 according to the feedback relationship of each snapshot volume.
[0083] S5, determining 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: Feed back the cache pages of the sub-volume based on the cache pages filled up by the root volume.
[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 according to the full cache page of the sub-volume.
[0086] It should be noted that for the description in the above S1-S7, reference may be made to the relevant description in the above embodiment, 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 involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0088] Based on the same inventive concept, the embodiment of the present application also provides a data flushing device for implementing the data flushing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data flushing device embodiments provided below can refer to the limitations on the data flushing method above, and will not be repeated here.
[0089] In an exemplary embodiment, as shown in FIG8 , a data flushing device is provided, comprising: a determination module 10 and a flushing module 11, wherein:
[0090] The determination module 10 is used to determine the root volume in the snapshot volumes to be flushed according to the snapshot relationship between the snapshot volumes to be flushed.
[0091] The flushing module 11 is used to feed back the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed according to 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, and its implementation principle and technical effect are similar, which will not be repeated here.
[0093] In one embodiment, as shown in FIG9 , the above-mentioned re-feeding module 11 includes: a construction unit 111 and a feedback unit 112, wherein:
[0094] The construction unit 111 is used to construct a feedback structure tree of each snapshot volume based on the snapshot relationship.
[0095] The feedback unit 112 is used to feedback the cache pages corresponding to each snapshot volume 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, and its implementation principle and technical effect are similar, which will not be repeated 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 according to the feedback structure tree; and feedback the cache page of the subvolume and the cache page of the grandchild volume corresponding to the subvolume according to the cache page filled up by the root volume.
[0098] The data flushing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0099] In one embodiment, the feedback unit 112 is specifically used to feedback the cache pages of the sub-volume according to the cache pages filled up by the root volume;
[0100] When the cache page of a subvolume is full, the cache page of the grandchild volume corresponding to the subvolume is fed back according to the full cache page of the subvolume.
[0101] The data flushing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated 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, and its implementation principle and technical effect are similar, which will not be repeated here.
[0104] In one embodiment, as shown in FIG10 , 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 page of the root volume.
[0106] The data flushing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0107] Each module in the above-mentioned data flushing device can be implemented in whole or in part by 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 a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0108] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG11. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via 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 the 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 via 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 the structure shown in FIG. 11 is merely a block diagram of a partial 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 arrangement of components.
[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 according to the snapshot relationship between the snapshot volumes to be refreshed;
[0112] According to 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 fully 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 up by the root volume, the cache pages of the subvolume and the cache pages of the grandchild volumes corresponding to the subvolume are fed back.
[0119] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0120] Feed back the cache pages of the subvolumes based on the cache pages filled up by the root volume;
[0121] When the cache page of a subvolume is full, the cache page of the grandchild volume corresponding to the subvolume is fed back according to the full cache page of the subvolume.
[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, and 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 according to the snapshot relationship between the snapshot volumes to be refreshed;
[0129] According to 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 also 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 fully 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 also 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 up by the root volume, the cache pages of the subvolume and the cache pages of the grandchild volumes corresponding to the subvolume are fed back.
[0136] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0137] Feed back the cache pages of the subvolumes based on the cache pages filled up by the root volume;
[0138] When the cache page of a subvolume is full, the cache page of the grandchild volume corresponding to the subvolume is fed back according to the full cache page of the subvolume.
[0139] In one embodiment, when the computer program is executed by a processor, the following steps are also 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 also 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 according to the snapshot relationship between the snapshot volumes to be refreshed;
[0146] According to 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 also 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 fully 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 also 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 up by the root volume, the cache pages of the subvolume and the cache pages of the grandchild volumes corresponding to the subvolume are fed back.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0154] Feed back the cache pages of the subvolumes based on the cache pages filled up by the root volume;
[0155] When the cache page of a subvolume is full, the cache page of the grandchild volume corresponding to the subvolume is fed back according to the full cache page of the subvolume.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also 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 also implemented:
[0160] Read data from disk to fill the cache pages of the root volume.
[0161] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and 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. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0162] The technical features of the above embodiments may be combined arbitrarily. 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 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 the present application. 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 protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A data flushing method, characterized in that: The method comprises: Determining a root volume in the snapshot volumes to be flushed according to the snapshot relationship between the snapshot volumes to be flushed; According to the cache pages filled up by the root volume and the snapshot relationship, the cache pages corresponding to the snapshot volumes in the snapshot volumes to be flushed back are fed back.
2. The method according to claim 1, characterized in that Feeding back the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed according to the cache pages filled by the root volume and the snapshot relationship includes: Based on the snapshot relationship, construct a feedback structure tree of each snapshot volume; According to the feedback structure tree and the cache pages filled up by the root volume, the cache pages corresponding to the snapshot volumes are fed back.
3. The method according to claim 2, 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, a subvolume corresponding to the root volume and a grandchild volume corresponding to the subvolume; According to the cache page filled by the root volume, the cache page of the sub-volume and the cache page of the grandchild volume corresponding to the sub-volume are fed back.
4. The method according to claim 3, characterized in that Feeding back the cache pages of the subvolume and the cache pages of the grandchild volumes corresponding to the subvolume according to the cache pages filled up by the root volume includes: Feeding back the cache pages of the subvolume according to the cache pages filled up by the root volume; When the cache page of the subvolume is full, the cache page of the grandchild volume corresponding to the subvolume is fed back according to the full cache page of the subvolume.
5. The method according to any one of claims 2 to 4, characterized in that: The step of constructing a feedback structure tree of each snapshot volume based on the snapshot relationship includes: Based on the snapshot relationship, determining a feedback relationship between the snapshot volumes; The feedback structure tree is constructed according to the feedback relationship of each snapshot volume.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The cache pages of the root volume are filled with data read from disk.
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 according to the snapshot relationship between the snapshot volumes to be flushed; The flushing module is used to feed back the cache pages corresponding to each snapshot volume in the snapshot volume to be flushed according to the cache pages filled by the root volume and the snapshot relationship.
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
Adaptive snapshot chunk sizing for snapshots of block storage volumes
US11526286B1