Parallel read cache persistence method, device, equipment and storage medium
By dividing the cache disk into multiple partitions and performing parallel processing, the existing technology problems of low parallelization of cache space management and complex processing after node power-off are solved, achieving efficient storage performance and fast data disk placement.
Patent Information
- Application Number
- CN202311844338.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-12-27
AI Technical Summary
In the existing technology, cache space management requires locking to release space, resulting in a low degree of parallelization, affecting storage performance, and the cache needs to be reloaded after a node is powered off, making the processing process complicated.
Divide the cache disk into multiple partitions. Each partition corresponds to a cache layer vCache. Each vCache corresponds to a mechanical hard disk HDD disk and independent threads. Through parallel processing of IO data and hot spot identification, solid-state drive SSD is used for persistent storage. , simplifying cache space management and data placement process.
It improves the parallelism of reading cache, improves storage performance, simplifies cache persistence logic, ensures data is written to disk, and can quickly load cache metadata after power failure, improving the speed and efficiency of parallel reading cache persistence.
Smart Images

Figure CN117827699B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a parallel read cache persistence method, device, equipment and storage medium. Background Art
[0002] In a storage system with a hard disk drive (HDD) as the main memory, whether it is a centralized storage system or a distributed storage system, using the non-volatile memory host controller interface specification (NVME) or solid-state disk (SSD) as a read cache is an industry-recognized feature. By caching hot data in NVME or SSD, it can be ensured that the hot data is directly obtained from the high-speed disk without going to the lower-speed mechanical disk, ensuring lower input / output (IO) latency, thereby achieving higher performance.
[0003] The design of the read cache includes hotspot and elimination algorithm design, memory structure design, cache disk design, etc. The existing cache space management in the industry is often managed for the entire disk, and the application for freeing space is performed in the same allocator, which often requires locking and has a low degree of parallelization, which often affects performance. Secondly, in the implementation of the read cache, when the node loses power, the cache needs to be reloaded, which often requires a very complex processing flow. Summary of the invention
[0004] The main purpose of the present invention is to provide a parallel read cache persistence method, device, equipment and storage medium, aiming to solve the technical problems in the prior art that cache space management releases space and needs to be locked, the degree of parallelization is low, storage performance is affected, and the cache needs to be reloaded after the node loses power, and the processing process is complicated.
[0005] In a first aspect, the present invention provides a parallel read cache persistence method, the parallel read cache persistence method comprising the following steps:
[0006] Divide the cache disk into multiple partitions. Each partition corresponds to a cache layer vCache. Each vCache corresponds to a mechanical hard disk HDD disk. Each vCache corresponds to an independent thread.
[0007] Obtain a parallel processing vCache for IO data, and perform parallel processing on the data to be processed in the IO data according to the parallel processing vCache;
[0008] Hotspot identification is performed on the data to be processed to obtain hotspot data, and the hotspot data is persistently stored on the disk through a solid-state hard disk (SSD) persistence module.
[0009] Optionally, the obtaining of the parallel processing vCache of the IO data and performing parallel processing on the to-be-processed data in the IO data according to the parallel processing vCache include:
[0010] Obtain the threads corresponding to the IO data after hash processing, determine the corresponding vCaches through each thread, and use the corresponding vCaches as parallel processing vCaches;
[0011] The data to be processed in the IO data is processed in parallel according to the parallel processing vCache.
[0012] Optionally, the performing parallel processing on the to-be-processed data in the IO data according to the parallel processing vCache includes:
[0013] Obtaining an object corresponding to the data to be processed in the IO data, and receiving a data processing instruction according to an interface of the object;
[0014] When the data processing instruction is a read instruction, responding to the read instruction, performing read processing on the to-be-processed data according to the parallel processing vCache;
[0015] When the data processing instruction is a write instruction, in response to the write instruction, write processing is performed on the to-be-processed data according to the parallel processing vCache;
[0016] When the data processing instruction is a delete instruction, in response to the delete instruction, delete the to-be-processed data according to the parallel processing vCache;
[0017] When the data processing instruction is a punch instruction, in response to the punch instruction, part of the data to be eliminated in the data to be processed is deleted according to the parallel processing vCache.
[0018] Optionally, before obtaining the object corresponding to the to-be-processed data in the IO data and receiving the data processing instruction according to the interface of the object, the parallel read cache persistence method further includes:
[0019] Obtaining a mapping relationship in the cache disk between each part of an object corresponding to the data to be processed in the IO data;
[0020] Using a B+ tree to manage the metadata of the object and record the mapping relationship;
[0021] The mapping relationship is stored in the parallel processing vCache, and the remaining space of the parallel processing vCache is managed by a space management module.
[0022] Optionally, before dividing the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread, the parallel read cache persistence method also includes:
[0023] Traversing the external interfaces of all vCache objects and providing the external interfaces to the power-on module;
[0024] When the system is powered on, metadata of cached data is recovered from the solid state drive (SSD) through the power-on module and loaded into the memory.
[0025] Optionally, when the system is powered on, after the metadata of the cached data is recovered from the solid state drive SSD by the power-on module and loaded into the memory, the parallel read cache persistence method further includes:
[0026] Encapsulating the external interface through an IO module;
[0027] The mapping relationship between user data and cache memory data of the cache disk is recorded through the data structure module.
[0028] Optionally, after recording the mapping relationship between the user data and the cache memory data of the cache disk through the data structure module, the parallel cache read persistence method further includes:
[0029] The cold data in the cache disk whose statistical frequency is lower than a preset frequency threshold is eliminated through the elimination module.
[0030] In a second aspect, in order to achieve the above-mentioned object, the present invention further proposes a parallel read cache persistence device, the parallel read cache persistence device comprising:
[0031] Partition module, used to divide the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread;
[0032] A parallel processing module, used for obtaining a parallel processing vCache of IO data, and performing parallel processing on the data to be processed in the IO data according to the parallel processing vCache;
[0033] The persistence module is used to identify hot spots of the data to be processed, obtain hot spot data, and store the hot spot data persistently on the disk through the solid state drive (SSD) persistence module.
[0034] In the third aspect, to achieve the above-mentioned purpose, the present invention also proposes a parallel read cache persistence device, which includes: a memory, a processor, and a parallel read cache persistence program stored in the memory and executable on the processor, and the parallel read cache persistence program is configured to implement the steps of the parallel read cache persistence method described above.
[0035] In a fourth aspect, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a parallel read cache persistence program is stored, and when the parallel read cache persistence program is executed by a processor, the steps of the parallel read cache persistence method as described above are implemented.
[0036] The parallel read cache persistence method proposed in the present invention divides the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread; obtains the parallel processing vCache of IO data, and performs parallel processing on the to-be-processed data in the IO data according to the parallel processing vCache; identifies hot spots of the to-be-processed data to obtain hot spot data, and stores the hot spot data persistently on the disk through a solid-state drive (SSD) persistence module; can improve the parallelism of cache reading, improve storage performance, simplify the logic of cache persistence, ensure that the cached data of the read cache is stored on the disk, and can still load cache metadata information by traversal after power failure, thereby improving the speed and efficiency of parallel read cache persistence. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0038] Figure 2 This is a flow chart of the first embodiment of the parallel read cache persistence method of the present invention;
[0039] Figure 3 This is a flow chart of a second embodiment of a parallel read cache persistence method of the present invention;
[0040] Figure 4 This is a flow chart of a third embodiment of a method for parallel read cache persistence of the present invention;
[0041] Figure 5 This is a flow chart of a fourth embodiment of a method for parallel read cache persistence of the present invention;
[0042] Figure 6 This is a flow chart of a fifth embodiment of a method for parallel read cache persistence according to the present invention;
[0043] Figure 7 This is a functional module diagram of the first embodiment of the parallel read cache persistence device of the present invention.
[0044] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0046] The solution of the embodiment of the present invention is mainly: by dividing the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread; obtaining the parallel processing vCache of IO data, and performing parallel processing on the data to be processed in the IO data according to the parallel processing vCache; performing hot spot identification on the data to be processed, obtaining hot spot data, and persistently storing the hot spot data on the disk through the solid-state hard disk SSD persistence module; it can improve the parallelism of cache reading, improve storage performance, simplify the logic of cache persistence, ensure that the data cached in the read cache is written to the disk, and can still load cache metadata information by traversal after power failure, thereby improving the speed and efficiency of parallel cache persistence, and solving the technical problems in the prior art that cache space management releases space and needs to lock, the degree of parallelization is low, storage performance is affected, the cache needs to be reloaded after the node loses power, and the processing process is complicated.
[0047] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0048] like Figure 1As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (Non-Volatile Memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0049] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0050] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating device, a network communication module, a user interface module, and a parallel read cache persistence program.
[0051] The device of the present invention calls the parallel read cache persistence program stored in the memory 1005 through the processor 1001, and performs the following operations:
[0052] Divide the cache disk into multiple partitions. Each partition corresponds to a cache layer vCache. Each vCache corresponds to a mechanical hard disk HDD disk. Each vCache corresponds to an independent thread.
[0053] Obtain a parallel processing vCache for IO data, and perform parallel processing on the data to be processed in the IO data according to the parallel processing vCache;
[0054] Hotspot identification is performed on the data to be processed to obtain hotspot data, and the hotspot data is persistently stored on the disk through a solid-state hard disk (SSD) persistence module.
[0055] The device of the present invention calls the parallel read cache persistence program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0056] Obtain the threads corresponding to the IO data after hash processing, determine the corresponding vCaches through each thread, and use the corresponding vCaches as parallel processing vCaches;
[0057] The data to be processed in the IO data is processed in parallel according to the parallel processing vCache.
[0058] The device of the present invention calls the parallel read cache persistence program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0059] Obtaining an object corresponding to the data to be processed in the IO data, and receiving a data processing instruction according to an interface of the object;
[0060] When the data processing instruction is a read instruction, responding to the read instruction, performing read processing on the to-be-processed data according to the parallel processing vCache;
[0061] When the data processing instruction is a write instruction, in response to the write instruction, write processing is performed on the to-be-processed data according to the parallel processing vCache;
[0062] When the data processing instruction is a delete instruction, in response to the delete instruction, delete the to-be-processed data according to the parallel processing vCache;
[0063] When the data processing instruction is a punch instruction, in response to the punch instruction, part of the data to be eliminated in the data to be processed is deleted according to the parallel processing vCache.
[0064] The device of the present invention calls the parallel read cache persistence program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0065] Obtaining a mapping relationship in the cache disk between each part of an object corresponding to the data to be processed in the IO data;
[0066] Using a B+ tree to manage the metadata of the object and record the mapping relationship;
[0067] The mapping relationship is stored in the parallel processing vCache, and the remaining space of the parallel processing vCache is managed by a space management module.
[0068] The device of the present invention calls the parallel read cache persistence program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0069] Traversing the external interfaces of all vCache objects and providing the external interfaces to the power-on module;
[0070] When the system is powered on, metadata of cached data is recovered from the solid state drive (SSD) through the power-on module and loaded into the memory.
[0071] The device of the present invention calls the parallel read cache persistence program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0072] Encapsulating the external interface through an IO module;
[0073] The mapping relationship between user data and cache memory data of the cache disk is recorded through the data structure module.
[0074] The device of the present invention calls the parallel read cache persistence program stored in the memory 1005 through the processor 1001, and also performs the following operations:
[0075] The cold data in the cache disk whose statistical frequency is lower than a preset frequency threshold is eliminated through the elimination module.
[0076] This embodiment adopts the above scheme, by dividing the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread; obtains the parallel processing vCache of IO data, and performs parallel processing on the data to be processed in the IO data according to the parallel processing vCache; identifies hot spots of the data to be processed, obtains hot spot data, and stores the hot spot data persistently on the disk through the solid-state drive SSD persistence module; can improve the parallelism of cache reading, improve storage performance, simplify the logic of cache persistence, ensure the cache cache data is stored on the disk, and can still load cache metadata information by traversal after power failure, thereby improving the speed and efficiency of parallel cache persistence.
[0077] Based on the above hardware structure, an embodiment of the parallel read cache persistence method of the present invention is proposed.
[0078] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the parallel read cache persistence method of the present invention.
[0079] In a first embodiment, the parallel read cache persistence method includes the following steps:
[0080] Step S10: Divide the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread.
[0081] It should be noted that the cache disk is divided into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to an HDD disk, and each vCache has an independent thread.
[0082] Step S20: Obtain a parallel processing vCache for IO data, and perform parallel processing on the data to be processed in the IO data according to the parallel processing vCache.
[0083] It can be understood that after obtaining the parallel processing cache layer vCache for processing IO data, the data to be processed in the IO data can be processed in parallel according to the parallel processing vCache.
[0084] Step S30: identify hot spots of the data to be processed, obtain hot spot data, and store the hot spot data persistently on the disk through a solid state drive (SSD) persistence module.
[0085] It should be understood that after hotspot identification is performed on the data to be processed, hotspot data can be obtained, and the SSD persistence module can then store the hotspot data persistently on the disk.
[0086] This embodiment adopts the above scheme, by dividing the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread; obtains the parallel processing vCache of IO data, and performs parallel processing on the data to be processed in the IO data according to the parallel processing vCache; identifies hot spots of the data to be processed, obtains hot spot data, and stores the hot spot data persistently on the disk through the solid-state drive SSD persistence module; can improve the parallelism of cache reading, improve storage performance, simplify the logic of cache persistence, ensure the cache cache data is stored on the disk, and can still load cache metadata information by traversal after power failure, thereby improving the speed and efficiency of parallel cache persistence.
[0087] Further, Figure 3 FIG. 1 is a flow chart of a second embodiment of a method for parallel read cache persistence of the present invention. Figure 3 As shown, a second embodiment of the parallel read cache persistence method of the present invention is proposed based on the first embodiment. In this embodiment, step S20 specifically includes the following steps:
[0088] Step S21, obtaining each thread corresponding to the IO data after hash processing, determining a number of corresponding vCaches through each thread, and using the corresponding vCaches as parallel processing vCaches.
[0089] It should be noted that a piece of data is first hashed to calculate which vCache is needed for processing, so that it can be processed in parallel. After obtaining the threads corresponding to the IO data after hash processing, the corresponding vCaches can be determined through each thread and the corresponding vCaches can be used as parallel processing vCaches.
[0090] Step S22: performing parallel processing on the to-be-processed data in the IO data according to the parallel processing vCache.
[0091] It can be understood that, according to the parallel processing vCache can perform parallel processing on the pending data that needs to be processed in the IO data.
[0092] Through the above scheme, this embodiment obtains the threads corresponding to the IO data after hash processing, determines the corresponding vCaches through each thread, and uses the corresponding vCaches as parallel processing vCaches; according to the parallel processing vCache, the data to be processed in the IO data is processed in parallel, which can improve the parallelism of cache reading, improve storage performance, and simplify the logic of cache persistence.
[0093] Further, Figure 4 FIG. 1 is a flow chart of a third embodiment of a method for parallel cache read persistence according to the present invention. Figure 4 As shown, a third embodiment of the parallel read cache persistence method of the present invention is proposed based on the second embodiment. In this embodiment, step S22 specifically includes the following steps:
[0094] Step S221: Obtain an object corresponding to the data to be processed in the IO data, and receive a data processing instruction according to the interface of the object.
[0095] It should be noted that the object corresponding to the data to be processed in the IO data is obtained, and then the data processing instruction for data processing is received according to the interface of the object.
[0096] Furthermore, before step S221, the parallel read cache persistence method further includes the following steps:
[0097] Obtaining a mapping relationship in the cache disk between each part of an object corresponding to the data to be processed in the IO data;
[0098] Using a B+ tree to manage the metadata of the object and record the mapping relationship;
[0099] The mapping relationship is stored in the parallel processing vCache, and the remaining space of the parallel processing vCache is managed by a space management module.
[0100] It should be understood that the object corresponding to the data to be processed in the IO data can adopt a b+ tree as the metadata management of the object, which can record the mapping relationship between each part of the object on the cache disk; in addition, the space management module, that is, the versioned extent allocator (VEA), can be responsible for the management of the remaining space of the vCache, and can also adopt the b+ tree structure.
[0101] Step S222: When the data processing instruction is a read instruction, respond to the read instruction and perform read processing on the data to be processed according to the parallel processing vCache.
[0102] It can be understood that when the data processing instruction is a read instruction, the to-be-processed data can be read according to the parallel processing vCache in response to the read instruction.
[0103] Step S223: When the data processing instruction is a write instruction, respond to the write instruction and perform write processing on the to-be-processed data according to the parallel processing vCache.
[0104] It should be understood that when the data processing instruction is a write instruction, the to-be-processed data may be written in response to the write instruction according to the parallel processing vCache.
[0105] Step S224: When the data processing instruction is a delete instruction, in response to the delete instruction, delete the to-be-processed data according to the parallel processing vCache.
[0106] It can be understood that when the data processing instruction is a delete instruction, the to-be-processed data is deleted according to the parallel processing vCache in response to the delete instruction.
[0107] Step S225: When the data processing instruction is a punch instruction, in response to the punch instruction, delete part of the data to be eliminated in the data to be processed according to the parallel processing vCache.
[0108] It should be understood that when the data processing instruction is a punch instruction, the part of the data to be eliminated in the data to be processed may be deleted according to the parallel processing vCache in response to the punch instruction.
[0109] In the specific implementation, in each vCache, the object interface is always provided to the outside, including object reading, writing, deletion, and punch operations (that is, deleting part of the object area when eliminating it).
[0110] This embodiment adopts the above scheme, by obtaining the object corresponding to the data to be processed in the IO data, and receiving the data processing instruction according to the interface of the object; when the data processing instruction is a read instruction, responding to the read instruction to read the data to be processed according to the parallel processing vCache; when the data processing instruction is a write instruction, responding to the write instruction to write the data to be processed according to the parallel processing vCache; when the data processing instruction is a delete instruction, responding to the delete instruction to delete the data to be processed according to the parallel processing vCache; when the data processing instruction is a punch instruction, responding to the punch instruction to delete the part of the data to be processed according to the parallel processing vCache, which can improve the parallelism of cache reading, improve storage performance, and simplify the logic of cache persistence.
[0111] Further, Figure 5 FIG. 4 is a flow chart of a fourth embodiment of a method for parallel read cache persistence of the present invention. Figure 5 As shown, a fourth embodiment of the parallel read cache persistence method of the present invention is proposed based on the first embodiment. In this embodiment, before step S10, the parallel read cache persistence method further includes the following steps:
[0112] Step S01, traverse the external interfaces of all vCache objects and provide the external interfaces for the power-on module.
[0113] It should be noted that during the power-on initialization process, it is necessary to traverse the external interfaces of all vCache objects, and then provide the external interfaces for the power-on module, so as to ensure that the read cache information is still valid after power-on.
[0114] Step S02: When the system is powered on, the metadata of the cached data is recovered from the solid state drive SSD through the power-on module and loaded into the memory.
[0115] It is understandable that when the system is powered on, the metadata of the cache data cached on the SSD can be loaded into the memory.
[0116] In the specific implementation, the power-on module mainly recovers the metadata of the cached data (that is, records what data is cached in the cache disk) from the cache disk to the memory when the system is powered on, so that when the read IO arrives, it can quickly know from the memory whether the data can hit the cache disk.
[0117] This embodiment uses the above-mentioned scheme to traverse the external interfaces of all vCache objects and provide the external interface for the power-on module; when the system is powered on, the metadata of the cached data is recovered from the solid-state drive SSD and loaded into the memory through the power-on module, which can improve the parallelism of cache reading, improve storage performance, and improve the speed and efficiency of parallel cache persistence.
[0118] Further, Figure 6 FIG. 5 is a flow chart of a fifth embodiment of a method for parallel read cache persistence of the present invention. Figure 6 As shown, a fifth embodiment of the parallel read cache persistence method of the present invention is proposed based on the fourth embodiment. In this embodiment, after step S02, the parallel read cache persistence method further includes the following steps:
[0119] Step S03: encapsulate the external interface through the IO module.
[0120] It should be noted that the IO module is responsible for encapsulating external interfaces, including read cache, write cache and other interfaces.
[0121] Step S04: Record the mapping relationship between the user data and the cache memory data of the cache disk through the data structure module.
[0122] It can be understood that the data structure module is a cache memory data structure, which is actually a cache mapping table used to record the mapping relationship between user data and cache disk.
[0123] After step S04, the parallel read cache persistence method further includes the following steps:
[0124] Step S05: Eliminate cold data in the cache disk whose statistical frequency is lower than a preset frequency threshold through an elimination module.
[0125] It should be understood that the elimination module can eliminate cold data in the cache disk whose statistical frequency is lower than a preset frequency threshold. The elimination is to ensure that the cold data on the cache disk is eliminated in time so that hot data can enter the cache.
[0126] This embodiment uses the above scheme to encapsulate the external interface through the IO module; records the mapping relationship between user data and cache memory data of the cache disk through the data structure module; and eliminates cold data in the cache disk whose statistical frequency is lower than the preset frequency threshold through the elimination module, which can improve the parallelism of cache reading, improve storage performance, and improve the speed and efficiency of parallel cache persistence.
[0127] Accordingly, the present invention further provides a parallel read cache persistence device.
[0128] Reference Figure 7 , Figure 7 This is a functional module diagram of the first embodiment of the parallel read cache persistence device of the present invention.
[0129] In the first embodiment of the parallel read cache persistence device of the present invention, the parallel read cache persistence device comprises:
[0130] The partition module 10 is used to divide the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread.
[0131] The parallel processing module 20 is used to obtain a parallel processing vCache of IO data, and perform parallel processing on the data to be processed in the IO data according to the parallel processing vCache.
[0132] The persistence module 30 is used to identify hot spots of the data to be processed, obtain hot spot data, and store the hot spot data persistently on the disk through the solid state drive (SSD) persistence module.
[0133] The parallel processing module 20 is also used to obtain the threads corresponding to the IO data after hash processing, determine the corresponding vCaches through each thread, and use the corresponding vCaches as parallel processing vCaches; and perform parallel processing on the data to be processed in the IO data according to the parallel processing vCache.
[0134] The parallel processing module 20 is also used to obtain the object corresponding to the data to be processed in the IO data, and receive the data processing instructions according to the interface of the object; when the data processing instruction is a read instruction, respond to the read instruction to read the data to be processed according to the parallel processing vCache; when the data processing instruction is a write instruction, respond to the write instruction to write the data to be processed according to the parallel processing vCache; when the data processing instruction is a delete instruction, respond to the delete instruction to delete the data to be processed according to the parallel processing vCache; when the data processing instruction is a punch instruction, respond to the punch instruction to delete the part of the data to be processed that is to be eliminated according to the parallel processing vCache.
[0135] The parallel processing module 20 is also used to obtain the mapping relationship in the cache disk of each part of the object corresponding to the data to be processed in the IO data; use B+ tree to manage the metadata of the object and record the mapping relationship; store the mapping relationship in the parallel processing vCache, and manage the remaining space of the parallel processing vCache through the space management module.
[0136] The partition module 10 is also used to traverse the external interfaces of all vCache objects and provide the external interfaces for the power-on module; when the system is powered on, the metadata of the cached data is recovered from the solid state drive SSD through the power-on module and loaded into the memory.
[0137] The partition module 10 is further used to encapsulate the external interface through the IO module; and to record the mapping relationship between the user data and the cache memory data of the cache disk through the data structure module.
[0138] The partition module 10 is further used to eliminate cold data in the cache disk whose statistical frequency is lower than a preset frequency threshold through an elimination module.
[0139] Among them, the steps implemented by each functional module of the parallel read cache persistence device can refer to the various embodiments of the parallel read cache persistence method of the present invention, and will not be repeated here.
[0140] In addition, an embodiment of the present invention further provides a storage medium, on which a parallel read cache persistence program is stored. When the parallel read cache persistence program is executed by a processor, the following operations are implemented:
[0141] Divide the cache disk into multiple partitions. Each partition corresponds to a cache layer vCache. Each vCache corresponds to a mechanical hard disk HDD disk. Each vCache corresponds to an independent thread.
[0142] Obtain a parallel processing vCache for IO data, and perform parallel processing on the data to be processed in the IO data according to the parallel processing vCache;
[0143] Hotspot identification is performed on the data to be processed to obtain hotspot data, and the hotspot data is persistently stored on the disk through a solid-state hard disk (SSD) persistence module.
[0144] Furthermore, when the parallel read cache persistence program is executed by the processor, the following operations are also implemented:
[0145] Obtain the threads corresponding to the IO data after hash processing, determine the corresponding vCaches through each thread, and use the corresponding vCaches as parallel processing vCaches;
[0146] The data to be processed in the IO data is processed in parallel according to the parallel processing vCache.
[0147] Furthermore, when the parallel read cache persistence program is executed by the processor, the following operations are also implemented:
[0148] Obtaining an object corresponding to the data to be processed in the IO data, and receiving a data processing instruction according to an interface of the object;
[0149] When the data processing instruction is a read instruction, responding to the read instruction, performing read processing on the to-be-processed data according to the parallel processing vCache;
[0150] When the data processing instruction is a write instruction, in response to the write instruction, write processing is performed on the to-be-processed data according to the parallel processing vCache;
[0151] When the data processing instruction is a delete instruction, in response to the delete instruction, delete the to-be-processed data according to the parallel processing vCache;
[0152] When the data processing instruction is a punch instruction, in response to the punch instruction, part of the data to be eliminated in the data to be processed is deleted according to the parallel processing vCache.
[0153] Furthermore, when the parallel read cache persistence program is executed by the processor, the following operations are also implemented:
[0154] Obtaining a mapping relationship in the cache disk between each part of an object corresponding to the data to be processed in the IO data;
[0155] Using a B+ tree to manage the metadata of the object and record the mapping relationship;
[0156] The mapping relationship is stored in the parallel processing vCache, and the remaining space of the parallel processing vCache is managed by a space management module.
[0157] Furthermore, when the parallel read cache persistence program is executed by the processor, the following operations are also implemented:
[0158] Traversing the external interfaces of all vCache objects and providing the external interfaces to the power-on module;
[0159] When the system is powered on, metadata of cached data is recovered from the solid state drive (SSD) through the power-on module and loaded into the memory.
[0160] Furthermore, when the parallel read cache persistence program is executed by the processor, the following operations are also implemented:
[0161] Encapsulating the external interface through an IO module;
[0162] The mapping relationship between user data and cache memory data of the cache disk is recorded through the data structure module.
[0163] Furthermore, when the parallel read cache persistence program is executed by the processor, the following operations are also implemented:
[0164] The cold data in the cache disk whose statistical frequency is lower than a preset frequency threshold is eliminated through the elimination module.
[0165] Those skilled in the art will appreciate that all or part of the steps in the above-mentioned implementation method can be accomplished by instructing related hardware through a program, and the program is stored in a storage medium, including a number of instructions for enabling a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each implementation method of the present application; and the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0166] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0167] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0168] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A parallel read cache persistence method, It is characterized in that The parallel read cache persistence method includes: Divide the cache disk into multiple partitions. Each partition corresponds to a cache layer vCache. Each vCache corresponds to a mechanical hard disk HDD disk. Each vCache corresponds to an independent thread. Obtain a parallel processing vCache for IO data, and perform parallel processing on the data to be processed in the IO data according to the parallel processing vCache; Perform hot spot identification on the data to be processed, obtain hot spot data, and store the hot spot data persistently on the disk through a solid state drive (SSD) persistence module; Before dividing the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread, the parallel read cache persistence method also includes: Traversing the external interfaces of all vCache objects and providing the external interfaces to the power-on module; When the system is powered on, the metadata of the cached data is recovered from the solid state drive (SSD) through the power-on module and loaded into the memory; When the system is powered on, after the metadata of the cached data is recovered from the solid state drive SSD by the power-on module and loaded into the memory, the parallel read cache persistence method further includes: Encapsulating the external interface through an IO module; Recording the mapping relationship between user data and cache memory data of the cache disk through a data structure module; After recording the mapping relationship between the user data and the cache memory data of the cache disk by the data structure module, the parallel cache read persistence method further includes: The cold data in the cache disk whose statistical frequency is lower than a preset frequency threshold is eliminated through the elimination module.
2. The parallel read cache persistence method according to claim 1, It is characterized in that The obtaining of the parallel processing vCache of the IO data and performing parallel processing on the to-be-processed data in the IO data according to the parallel processing vCache include: Obtain the threads corresponding to the IO data after hash processing, determine the corresponding vCaches through each thread, and use the corresponding vCaches as parallel processing vCaches; The data to be processed in the IO data is processed in parallel according to the parallel processing vCache.
3. The parallel read cache persistence method as claimed in claim 2, It is characterized in that The performing parallel processing on the to-be-processed data in the IO data according to the parallel processing vCache includes: Obtaining an object corresponding to the data to be processed in the IO data, and receiving a data processing instruction according to an interface of the object; When the data processing instruction is a read instruction, responding to the read instruction, performing read processing on the to-be-processed data according to the parallel processing vCache; When the data processing instruction is a write instruction, in response to the write instruction, write processing is performed on the to-be-processed data according to the parallel processing vCache; When the data processing instruction is a delete instruction, in response to the delete instruction, delete the to-be-processed data according to the parallel processing vCache; When the data processing instruction is a punch instruction, in response to the punch instruction, part of the data to be eliminated in the data to be processed is deleted according to the parallel processing vCache.
4. The parallel read cache persistence method as claimed in claim 3, It is characterized in that Before obtaining the object corresponding to the to-be-processed data in the IO data and receiving the data processing instruction according to the interface of the object, the parallel read cache persistence method further includes: Obtaining a mapping relationship in the cache disk between each part of an object corresponding to the data to be processed in the IO data; Using a B+ tree to manage the metadata of the object and record the mapping relationship; The mapping relationship is stored in the parallel processing vCache, and the remaining space of the parallel processing vCache is managed by a space management module.
5. A parallel read cache persistence device, It is characterized in that The parallel read cache persistence device comprises: Partition module, used to divide the cache disk into multiple partitions, each partition corresponds to a cache layer vCache, each vCache corresponds to a mechanical hard disk HDD disk, and each vCache corresponds to an independent thread; A parallel processing module, used for obtaining a parallel processing vCache of IO data, and performing parallel processing on the data to be processed in the IO data according to the parallel processing vCache; A persistence module is used to identify hot spots of the data to be processed, obtain hot spot data, and store the hot spot data persistently on a disk through a solid state drive (SSD) persistence module; The partition module is also used to traverse the external interfaces of all vCache objects and provide the external interfaces for the power-on module; When the system is powered on, the metadata of the cached data is recovered from the solid state drive (SSD) through the power-on module and loaded into the memory; The partition module is further used to encapsulate the external interface through the IO module; and record the mapping relationship between the user data and the cache memory data of the cache disk through the data structure module; The partition module is further used to eliminate cold data in the cache disk whose statistical frequency is lower than a preset frequency threshold through an elimination module.
6. A parallel read cache persistence device, It is characterized in that The parallel read cache persistence device includes: a memory, a processor, and a parallel read cache persistence program stored in the memory and executable on the processor, wherein the parallel read cache persistence program is configured to implement the steps of the parallel read cache persistence method according to any one of claims 1 to 4.
7. A storage medium, It is characterized in that The storage medium stores a parallel read cache persistence program, which, when executed by a processor, implements the steps of the parallel read cache persistence method according to any one of claims 1 to 4.
