Method, system and server for managing storage
Patent Information
- Application Number
- CN202210891254.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-27
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-07-27
AI Technical Summary
但在性能方面,分布式存储相较于传统的存储并无优势,存储容量较大,但存储性能差,存储性能包括每秒能处理的读写操作
[0036]本申请提供了一种存储的管理方法、系统及服务器,应用于存储领域,将数据按照访问频次依次存储至缓存中对应的区域,存储访问频次最低的数据的区域与存储器连接。在读写请求发生时,以访问频次由高至低的顺序从缓存的区域中查找读写请求访问的数据;在缓存中无读写请求访问的数据时,从存储器中查找读写请求的数据。将数据按照访问频次存放,同时访问顺序以访问频次由高至低的顺序,使得在读写请求进行的过程中,缩短读写请求的时间。
Smart Images

Figure CN115167778B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage, and in particular to a storage management method, system, and server. Background Technology
[0002] Distributed storage is a storage technology that uses a network to manage multiple storage nodes and provides all the storage from these nodes to clients through software running on a server. Distributed storage is a relatively mature technology, widely used in many commercial systems due to its strong scalability and high reliability. However, in terms of performance, distributed storage does not offer an advantage over traditional storage; it offers larger storage capacity but lower performance, including the number of read and write operations processed per second. Summary of the Invention
[0003] The purpose of this invention is to provide a storage management method, system, and server that stores data according to access frequency and arranges access in descending order of access frequency, thereby shortening the time for read and write requests.
[0004] To address the aforementioned technical problems, this invention provides a storage management method, comprising:
[0005] Data is stored sequentially in the cache according to access frequency, and the area storing the least frequently accessed data is connected to the memory.
[0006] When a read / write request occurs, the data accessed by the read / write request is retrieved from the cached area in descending order of access frequency;
[0007] If the data requested for the read / write request is not in the cache, the data requested for the read / write request is retrieved from the memory.
[0008] Preferably, data is stored sequentially in the cache according to access frequency. Before the area storing the least frequently accessed data is connected to the memory, the method further includes:
[0009] The server's cache is divided into a data region to be evicted and several accessed data regions. The data region to be evicted is connected to the memory and stores the data with the lowest access frequency.
[0010] Preferably, after searching for the data accessed by the read / write request in the cached area in descending order of access frequency when a read / write request occurs, the method further includes:
[0011] When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within a preset time reaches a preset number, the data is pulled to the head of the area of the next higher level of access frequency.
[0012] When the data accessed by the read / write request is in the data to be eliminated area, and the number of times the data is accessed within a preset time reaches a preset number, the data is pulled into the head of the accessed data area with the lowest access frequency.
[0013] When the data requested for read / write access is in the memory, the data is pulled into the data to be discarded area.
[0014] Preferably, after searching for the data accessed by the read / write request in the cached area in descending order of access frequency when a read / write request occurs, the method further includes:
[0015] When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within a preset time period has not reached a preset number, the data is adjusted to the beginning of the area.
[0016] If the data accessed by the read / write request is in the data to be phased out area, and the number of accesses to the data within a preset time period has not reached a preset number, the position of the data will not be changed.
[0017] Preferably, the data for each level is stored sequentially in the corresponding area of the cache, including:
[0018] The data is stored in the corresponding area of the cache in the form of a doubly linked list;
[0019] Establish a hash table to store the correspondence between the hash values of the data and the locations of the data;
[0020] Locating the data accessed by the read / write request from the cached area includes:
[0021] Obtain the hash value of the data, and search for the data accessed by the read / write request in the cache area according to the correspondence between the hash value of the data and the location of the data.
[0022] Preferred options also include:
[0023] When the cache utilization rate reaches a first threshold, the data at the end of each region in the cache is flushed down to the next level of access frequency region; the region storing the least accessed data is not flushed down.
[0024] When the usage rate of the cache falls below a first threshold, the data flushing process is stopped.
[0025] Preferred options also include:
[0026] When the cache usage rate reaches a second threshold, delete the last data in the region storing the least frequently accessed data, where the second threshold is greater than the first threshold.
[0027] When the usage rate of the cache falls below a second threshold, the deletion of the data is stopped.
[0028] Preferably, deleting the tail data of the region storing the least frequently accessed data includes:
[0029] When the data has been written, the data is saved to the memory and then deleted.
[0030] To address the aforementioned technical problems, the present invention also provides a storage management system, comprising:
[0031] A storage unit is used to store data sequentially into the corresponding areas of the cache according to the access frequency, and the area storing the data with the lowest access frequency is connected to the memory;
[0032] The lookup unit is configured to, when a read / write request occurs, search for the data accessed by the read / write request in the cache area in descending order of access frequency; and if the data accessed by the read / write request is not in the cache, search for the data accessed by the read / write request in the memory.
[0033] To address the aforementioned technical problems, the present invention also provides a server, comprising:
[0034] Memory, used to store computer programs;
[0035] A processor, used to implement the above-described storage management method when executing the computer program.
[0036] This application provides a storage management method, system, and server applied in the storage field. Data is stored sequentially in corresponding areas of a cache according to its access frequency, with the area storing the least frequently accessed data connected to the main memory. When a read / write request occurs, the data to be accessed is searched from the cache areas in descending order of access frequency; if the data is not in the cache, it is searched from the main memory. By storing data according to access frequency and in descending order of access frequency, the time required for read / write requests is shortened. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 A flowchart of a storage management method provided by the present invention;
[0039] Figure 2 A schematic diagram of a cache and memory structure provided by the present invention;
[0040] Figure 3 A schematic diagram illustrating a data transfer method provided by the present invention;
[0041] Figure 4 A schematic diagram illustrating another data transfer method provided by the present invention;
[0042] Figure 5 A schematic diagram illustrating another data transfer method provided by the present invention;
[0043] Figure 6 A schematic diagram illustrating another data transfer method provided by the present invention;
[0044] Figure 7 A schematic diagram of data storage provided by the present invention;
[0045] Figure 8 A schematic diagram of the structure of a storage management system provided by the present invention;
[0046] Figure 9 This is a schematic diagram of the structure of a server provided by the present invention. Detailed Implementation
[0047] The core of this invention is to provide a storage management method, system, and server that stores data according to access frequency and arranges access in descending order of access frequency, thereby shortening the time for read and write requests.
[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] Figure 1A flowchart of a storage management method provided by the present invention, the storage management method comprising:
[0050] S11: Store the data in the corresponding areas of the cache according to the access frequency, and connect the area storing the data with the lowest access frequency to the memory;
[0051] Distributed storage is a storage technology that uses a network to manage multiple storage nodes and provides all the storage from these nodes to clients through software running on a server. Distributed storage is a relatively mature technology, widely used in many commercial systems due to its strong scalability and high reliability. However, in terms of performance, distributed storage does not offer an advantage over traditional storage; it offers larger storage capacity but lower performance, including the number of read and write operations processed per second.
[0052] To improve storage performance, a cache is added to each distributed storage node. Data is stored in the cache according to the frequency of access. Since the read and write performance of the cache is stronger than that of the storage, the read and write speed is improved, resulting in better performance of the distributed storage.
[0053] Specifically, one or more SSDs (Solid State Drives) or NVME (Non-Volatile Memory Express) are added to each distributed storage node as a cache.
[0054] S12: When a read / write request occurs, retrieve the data accessed by the read / write request from the cached area in descending order of access frequency;
[0055] S13: If there is no data in the cache that is requested for reading or writing, retrieve the data requested for reading or writing from memory.
[0056] When a read / write request occurs, the location of the data to be accessed is uncertain, requiring a search within the distributed storage node. Data is stored in the cache according to its access frequency, specifically, arranged from highest to lowest. The area storing the least frequently accessed data is connected to the main memory. Therefore, when searching for data, the search begins in the area with the highest access frequency. If the data required by the read / write request is not found in the cache, the data is searched from the main memory.
[0057] In summary, this application provides a storage management method applied in the storage field. Data is stored sequentially in corresponding areas of a cache according to its access frequency, with the area storing the least frequently accessed data connected to the main memory. When a read / write request occurs, the data to be accessed is searched from the cache areas in descending order of access frequency; if the data is not in the cache, it is searched from the main memory. By storing data according to access frequency and in descending order of access frequency, the time required for read / write requests is shortened.
[0058] Based on the above embodiments:
[0059] Figure 2 A schematic diagram of a cache and memory structure provided by the present invention;
[0060] As a preferred embodiment, data is stored sequentially in the corresponding areas of the cache according to access frequency. Before the area storing the least frequently accessed data is connected to the memory, the method further includes:
[0061] The server's cache is divided into a data area to be evicted and several accessed data areas. The data area to be evicted is connected to the memory and stores the data with the lowest access frequency.
[0062] The cache is divided into regions from top to bottom based on access frequency from high to low. Specifically, the cache is divided into three regions: the hot data region with the highest access frequency, the warm-up data region with a relatively high access frequency, and the data region to be evicted with the lowest access frequency. The data region to be evicted is connected to the memory.
[0063] It should be noted that data can be transferred between adjacent areas. Data in the hot data area can be transferred to the preheating data area, data in the preheating data area can be transferred to the hot data area and the data to be phased out area, data in the data to be phased out area can be transferred to the preset data area and the memory, and data in the memory can be transferred to the data to be phased out area.
[0064] Furthermore, the division can include, but is not limited to, three regions. It is sufficient to connect the region containing the least frequently accessed data to the memory. This application does not impose any further limitations here.
[0065] By dividing data into multiple levels according to access frequency and storing them in the cache, data can be found more quickly when read and write requests access the data.
[0066] As a preferred embodiment, after searching for the data accessed by the read / write request in the cached area in descending order of access frequency when a read / write request occurs, the method further includes:
[0067] When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within a preset time reaches a preset number, the data will be pulled into the head of the area of the next higher level of access frequency.
[0068] When the data accessed by the read / write request is in the data area to be eliminated, and the number of accesses to the data within a preset time reaches a preset number, the data will be pulled into the head of the data area with the lowest access frequency.
[0069] When the data requested for read / write access is in memory, the data is pulled into the data to be evicted area.
[0070] Please refer to Figure 3 , Figure 3 This is a schematic diagram of data transfer provided by the present invention; the data stored in the data to be discarded area are A, B and C, the data stored in the preheating data area are D, E and F, and the data stored in the hot data area are H, I and J.
[0071] If the data X accessed by the read / write request is not in the cache but in the memory, then the data X is pulled from the memory into the data to be evicted area and saved to the beginning of the data to be evicted area.
[0072] Please refer to Figure 4 , Figure 4 This is a schematic diagram of another data transfer method provided by the present invention; the data stored in the data to be discarded area are X, A, B and C, the data stored in the preheating data area are D, E and F, and the data stored in the hot data area are H, I and J.
[0073] If data X requested for read / write is in the data to be discarded area and has been accessed K times within a preset time, then data X will be moved to the head of the preset data area.
[0074] Please refer to Figure 5 , Figure 5 This is a schematic diagram of another data transfer method provided by the present invention; the data stored in the data to be discarded area are A, B and C, the data stored in the preheating data area are X, D, E and F, and the data stored in the hot data area are H, I and J.
[0075] If the data X accessed by the read / write request is in the warm-up data area and has been accessed K times within a preset time, then data X will be pulled into the head of the hot data area.
[0076] It should be noted that the preset time and the specific value of K can be set according to actual needs, and this application does not impose any restrictions here.
[0077] Once the data has been accessed a preset number of times within a preset time period, the data can be moved to a more frequently accessed area. By continuously adjusting the data's location, subsequent access to the data can be facilitated, thereby improving the speed of data access.
[0078] As a preferred embodiment, after searching for the data accessed by the read / write request in the cached area in descending order of access frequency when a read / write request occurs, the method further includes:
[0079] When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within the preset time has not reached the preset number, the data will be moved to the beginning of the area.
[0080] If the data accessed by the read / write request is in the data area to be phased out, and the number of accesses to the data within the preset time period has not reached the preset number, the location of the data will not be changed.
[0081] Please refer to Figure 6 , Figure 6 This is a schematic diagram of another data transfer method provided by the present invention; the data stored in the data to be discarded area are A, B and C, the data stored in the preheating data area are D, E and F, and the data stored in the hot data area are H, I and J.
[0082] If the data F accessed by the read / write request is in the warm-up data area and has not been accessed K times within a preset time, then the data F will be moved to the head of the hot data area.
[0083] It should be noted that the data to be discarded is in a FIFO (First Input First Output) queue, while the warm-up data area and the hot data area are in an LRU (Least Recently Used) queue. Therefore, if data in the data to be discarded is accessed and the preset number of accesses within a preset time is not reached, its position will not be adjusted. If data in the warm-up data area and the hot data area is accessed and the preset number of accesses within a preset time is not reached, it will be moved to the head of the area.
[0084] By setting queues for data to be discarded, preset data, and hot data, the location of data becomes easier to improve reading speed.
[0085] As a preferred embodiment, data for each level is stored sequentially in the corresponding area of the cache, including:
[0086] The data is stored in the corresponding area of the cache in the form of a doubly linked list;
[0087] Establish a hash table to store the correspondence between the hash values of data and the location of the data;
[0088] Retrieve the data accessed by the read / write request from the cached area, including:
[0089] Obtain the hash value of the data, and search for the data accessed by the read / write request in the cached area based on the correspondence between the hash value and the data's location.
[0090] Considering that the data is stored in the cache in the form of a doubly linked list, but the data in the doubly linked list can only be searched from the head to the tail or from the tail to the head, a lot of time will be wasted during the search process.
[0091] Please refer to Figure 7 , Figure 7 This invention provides a schematic diagram of data storage; the hash table stores the hash values and pointers of the data.
[0092] The hash value of data 1 is key2, the hash value of data 2 is key3, and the hash value of data 3 is key1. When searching, if data 2 is accessed, its hash value is calculated to obtain key3. Based on the pointer corresponding to key3, data 2 can then be found.
[0093] Hash tables and doubly linked lists make data indexing more convenient and faster, and data processing is faster.
[0094] As a preferred embodiment, it also includes:
[0095] When the cache utilization rate reaches the first threshold, the data at the end of each region in the cache is flushed down to the next level of access frequency regions; the region storing the least accessed data is not flushed down.
[0096] Stop flushing data when the cache usage rate falls below the first threshold.
[0097] Considering that the data processing speed will be affected when the cache capacity reaches the first threshold, it is necessary to flush the data.
[0098] Specifically, the hot data region flushes the last data to the beginning of the preheating data region, the preheating data region flushes the last data to the pending data region, and the pending data region does not flush data. Data flushing continues until the cache utilization rate falls below a first threshold.
[0099] It should be noted that the first threshold is 50%. At this threshold, the cache can continue to function normally without data eviction; only the hot data area and the data in the adjacent hot data area need to be reduced. The specific value of the first threshold is not specified in this application.
[0100] As a preferred embodiment, it also includes:
[0101] When the cache utilization rate reaches the second threshold, delete the last data in the region where the least frequently accessed data is stored. The second threshold is greater than the first threshold.
[0102] Stop deleting data when the cache usage rate falls below the second threshold.
[0103] Considering that the cache capacity will be full when it reaches the second threshold, which may cause data not in the cache to take too long to access, resulting in a decrease in storage performance, data needs to be deleted when the cache capacity reaches the second threshold.
[0104] Specifically, the last data in the data to be phased out is deleted until the cache capacity falls below the second threshold.
[0105] It should be noted that the second threshold is 80%. The specific value of the second threshold is not specified in this application.
[0106] As a preferred embodiment, deleting the tail data of the region storing the least frequently accessed data includes:
[0107] If the data has been written to, save the data to memory and then delete it.
[0108] Since write operations are only performed in the cache, some data in the data to be evicted may have been written to. In order to ensure that the data is not lost, it is necessary to save the data to the memory before deleting it.
[0109] Saving data that has been written to memory before deleting it ensures that data is not lost and guarantees data consistency.
[0110] Figure 8 A schematic diagram of a storage management system provided by the present invention, the storage management system comprising:
[0111] Storage unit 81 is used to store data sequentially into the corresponding area in the cache according to the access frequency, and the area storing the data with the lowest access frequency is connected to the memory;
[0112] The lookup unit 82 is used to search for the data accessed by the read / write request in the cache area in descending order of access frequency when a read / write request occurs; and to search for the data accessed by the read / write request in the memory when there is no data accessed by the read / write request in the cache.
[0113] Distributed storage is a storage technology that uses a network to manage multiple storage nodes and provides all the storage from these nodes to clients through software running on a server. Distributed storage is a relatively mature technology, widely used in many commercial systems due to its strong scalability and high reliability. However, in terms of performance, distributed storage does not offer an advantage over traditional storage; it offers larger storage capacity but lower performance, including the number of read and write operations processed per second.
[0114] To improve storage performance, a cache is added to each distributed storage node. Data is stored in the cache according to the frequency of access. Since the read and write performance of the cache is stronger than that of the storage, the read and write speed is improved, resulting in better performance of the distributed storage.
[0115] Specifically, one or more SSDs (Solid State Drives) or NVME (Non-Volatile Memory Express) are added to each distributed storage node as a cache.
[0116] When a read / write request occurs, the location of the data to be accessed is uncertain, requiring a search within the distributed storage node. Data is stored in the cache according to its access frequency, specifically, arranged from highest to lowest. The area storing the least frequently accessed data is connected to the main memory. Therefore, when searching for data, the search begins in the area with the highest access frequency. If the data required by the read / write request is not found in the cache, the data is searched from the main memory.
[0117] The storage management system provided in this application also includes:
[0118] The partitioning unit is used to divide the server's cache into a data area to be evicted and several accessed data areas. The data area to be evicted is connected to the memory and stores the data with the lowest access frequency.
[0119] The data transfer unit is used to pull the data into the head of the area of the next higher level of access frequency when the data accessed by the read / write request is in the access data area and the number of accesses of the data within a preset time reaches a preset number.
[0120] When the data accessed by the read / write request is in the data area to be eliminated, and the number of accesses to the data within a preset time reaches a preset number, the data will be pulled into the head of the data area with the lowest access frequency.
[0121] When the data requested for read / write is in memory, the data is pulled into the data to be evicted area;
[0122] When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within the preset time has not reached the preset number, the data will be moved to the beginning of the area.
[0123] When the data accessed by the read / write request is in the data to be evicted area, and the number of accesses to the data within the preset time period has not reached the preset number, the position of the data will not be changed;
[0124] Storage units are used to store data in the corresponding areas of the cache in the form of a doubly linked list;
[0125] Establish a hash table to store the correspondence between the hash values of data and the location of the data;
[0126] Retrieve the data accessed by the read / write request from the cached area, including:
[0127] Obtain the hash value of the data, and search for the data accessed by the read / write request in the cached area based on the correspondence between the hash value and the data's location;
[0128] The data flushing unit is used to flush the data at the end of each region in the cache to the next level of access frequency region when the cache utilization rate reaches the first threshold; the region storing the least accessed data is not flushed.
[0129] Stop flushing data when the cache usage rate falls below the first threshold;
[0130] The data deletion unit is used to delete the tail data of the area where the least frequently accessed data is stored when the cache utilization rate reaches a second threshold, where the second threshold is greater than the first threshold.
[0131] Stop deleting data when the cache usage rate falls below the second threshold;
[0132] If the data has been written to, save the data to memory and then delete it.
[0133] In summary, this application provides a storage management system applied in the storage field. Data is stored sequentially in corresponding areas of a cache according to its access frequency, with the area storing the least frequently accessed data connected to the main memory. When a read / write request occurs, the data to be accessed is searched from the cache areas in descending order of access frequency; if the data is not in the cache, it is searched from the main memory. By storing data according to access frequency and in descending order of access frequency, the time required for read / write requests is shortened.
[0134] The description of the storage management system provided in this application is based on the above embodiments and will not be repeated here.
[0135] Figure 9 This invention provides a schematic diagram of the structure of a server, which includes:
[0136] Memory 91 is used to store computer programs;
[0137] The processor 92 is used to implement the above-described storage management method when executing a computer program.
[0138] Specifically, the steps executed by the processor are as follows:
[0139] Data is stored sequentially in the cache according to access frequency, and the area storing the least frequently accessed data is connected to the memory.
[0140] When a read / write request occurs, the data accessed by the read / write request is retrieved from the cached area in descending order of access frequency;
[0141] If the data requested for the read / write request is not in the cache, the data requested for the read / write request is retrieved from the memory.
[0142] Data is stored sequentially in the cache according to its access frequency. Before the area storing the least frequently accessed data is connected to the memory, the process further includes:
[0143] The server's cache is divided into a data region to be evicted and several accessed data regions. The data region to be evicted is connected to the memory and stores the data with the lowest access frequency.
[0144] When a read / write request occurs, after searching for the data accessed by the read / write request in the cached area in descending order of access frequency, the process further includes:
[0145] When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within a preset time reaches a preset number, the data is pulled to the head of the area of the next higher level of access frequency.
[0146] When the data accessed by the read / write request is in the data to be eliminated area, and the number of times the data is accessed within a preset time reaches a preset number, the data is pulled into the head of the accessed data area with the lowest access frequency.
[0147] When the data requested for read / write access is in the memory, the data is pulled into the data to be discarded area.
[0148] When a read / write request occurs, after searching for the data accessed by the read / write request in the cached area in descending order of access frequency, the process further includes:
[0149] When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within a preset time period has not reached a preset number, the data is adjusted to the beginning of the area.
[0150] If the data accessed by the read / write request is in the data to be phased out area, and the number of accesses to the data within a preset time period has not reached a preset number, the position of the data will not be changed.
[0151] The data for each level is stored sequentially in the corresponding area of the cache, including:
[0152] The data is stored in the corresponding area of the cache in the form of a doubly linked list;
[0153] Establish a hash table to store the correspondence between the hash values of the data and the locations of the data;
[0154] Locating the data accessed by the read / write request from the cached area includes:
[0155] Obtain the hash value of the data, and search for the data accessed by the read / write request in the cache area according to the correspondence between the hash value of the data and the location of the data.
[0156] Also includes:
[0157] When the cache utilization rate reaches a first threshold, the data at the end of each region in the cache is flushed down to the next level of access frequency region; the region storing the least accessed data is not flushed down.
[0158] When the usage rate of the cache falls below a first threshold, the data flushing process is stopped.
[0159] Also includes:
[0160] When the cache usage rate reaches a second threshold, delete the last data in the region storing the least frequently accessed data, where the second threshold is greater than the first threshold.
[0161] When the usage rate of the cache falls below a second threshold, the deletion of the data is stopped.
[0162] Delete the last data in the region storing the least frequently accessed data, including:
[0163] When the data has been written, the data is saved to the memory and then deleted.
[0164] The description of the server provided in this application is based on the above embodiments and will not be repeated here.
[0165] This application provides a server for storage applications. Data is stored sequentially in a cache according to its access frequency, with the area storing the least frequently accessed data connected to the main memory. When a read / write request occurs, the server searches for the requested data in the cache in descending order of access frequency. If the requested data is not in the cache, it is searched for in the main memory. By storing data according to access frequency and in descending order of access frequency, the server shortens the time required for read / write requests.
[0166] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0167] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0168] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A storage management method, characterized in that, include: Data is stored sequentially in the cache according to access frequency, and the area storing the least frequently accessed data is connected to the memory. When a read / write request occurs, the data accessed by the read / write request is retrieved from the cached area in descending order of access frequency; If the data requested by the read / write request is not in the cache, the data requested by the read / write request is retrieved from the memory. Data is stored sequentially in the cache according to its access frequency. Before the area storing the least frequently accessed data is connected to the memory, the process further includes: The server's cache is divided into a data area to be evicted and several accessed data areas. The data area to be evicted is connected to the memory and stores the data with the lowest access frequency. Also includes: When the cache utilization rate reaches a first threshold, the data at the end of each region in the cache is flushed down to the next level of access frequency region; the region storing the least accessed data is not flushed down. When the usage rate of the cache falls below a first threshold, the data flushing process is stopped. When the cache usage rate reaches a second threshold, delete the last data in the region storing the least frequently accessed data, where the second threshold is greater than the first threshold. When the usage rate of the cache falls below a second threshold, the deletion of the data is stopped. Delete the last data in the region storing the least frequently accessed data, including: If the data has been written, the data is saved to the memory and then deleted. When a read / write request occurs, after searching for the data accessed by the read / write request in the cached area in descending order of access frequency, the process further includes: When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within a preset time period has not reached a preset number, the data is adjusted to the beginning of the area. If the data accessed by the read / write request is in the data to be phased out area, and the number of accesses to the data within a preset time period has not reached a preset number, the position of the data will not be changed.
2. The storage management method as described in claim 1, characterized in that, When a read / write request occurs, after searching for the data accessed by the read / write request in the cached area in descending order of access frequency, the process further includes: When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within a preset time reaches a preset number, the data is pulled to the head of the area of the next higher level of access frequency. When the data accessed by the read / write request is in the data to be eliminated area, and the number of times the data is accessed within a preset time reaches a preset number, the data is pulled into the head of the accessed data area with the lowest access frequency. When the data requested for read / write access is in the memory, the data is pulled into the data to be discarded area.
3. The storage management method as described in claim 1, characterized in that, The data for each level is stored sequentially in the corresponding area of the cache, including: The data is stored in the corresponding area of the cache in the form of a doubly linked list; Establish a hash table to store the correspondence between the hash values of the data and the locations of the data; Locating the data accessed by the read / write request from the cached area includes: Obtain the hash value of the data, and search for the data accessed by the read / write request in the cache area according to the correspondence between the hash value of the data and the location of the data.
4. A storage management system, characterized in that, include: A storage unit is used to store data sequentially into the corresponding areas of the cache according to the access frequency, and the area storing the data with the lowest access frequency is connected to the memory; The lookup unit is used to search for the data accessed by the read / write request in the cached area in descending order of access frequency when a read / write request occurs. If the data requested by the read / write request is not in the cache, the data requested by the read / write request is retrieved from the memory. Also includes: The data refresh unit is used for: When the cache utilization rate reaches a first threshold, the data at the end of each region in the cache is flushed down to the next level of access frequency region; the region storing the least accessed data is not flushed down. When the usage rate of the cache falls below a first threshold, the data flushing process is stopped. A partitioning unit is used to divide the server's cache into a data region to be evicted and several accessed data regions. The data region to be evicted is connected to the memory and stores the data with the lowest access frequency. Data deletion unit, used for: When the cache usage rate reaches a second threshold, delete the last data in the region storing the least frequently accessed data, where the second threshold is greater than the first threshold. When the usage rate of the cache falls below a second threshold, the deletion of the data is stopped. If the data has been written, the data is saved to the memory and then deleted. Data transfer unit, used for: When the data accessed by the read / write request is in the access data area, and the number of accesses to the data within a preset time period has not reached a preset number, the data is adjusted to the beginning of the area. If the data accessed by the read / write request is in the data to be phased out area, and the number of accesses to the data within a preset time period has not reached a preset number, the position of the data will not be changed.
5. A server, characterized in that, include: Memory, used to store computer programs; A processor for implementing the steps of the storage management method as described in any one of claims 1 to 3 when executing the computer program.
Citation Information
Patent Citations
Cache data management method and system, terminal and storage medium
CN111737170A
Cache elimination method and device, electronic device and storage medium
CN114138690A