Ssd cache flush processing method, system, device and storage medium
Patent Information
- Application Number
- CN202311692597.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-12-11
AI Technical Summary
[0006]上述的缓存方法,虽可以在一定程度上进行数据回刷,但是在实际使用时却发现其方法中还存在有若干缺点,因未能达到最佳的使用效果,而其缺点可归纳如下:
[0051]本公开实施例中的SSD缓存回刷处理方法,通过对SSD缓存资源和SSD缓存卷的空闲时间两个方面进行监测,主动地触发SSD缓存的回刷任务,改变以往SSD缓存被动回刷的缺陷,及时地释放了SSD缓存空间,提高了SSD缓存的命中率,提升存储系统的整体性能。通过利用LRU算法的特性,在SSD缓存元数据的LRU链表末尾插入缓存回刷的参照节点,用于快速查找回刷的缓存元数据。通过本发明设计的高效SSD缓存回刷方法,能够快速且主动地将SSD缓存中过时的数据回刷到HDD磁盘中,高效地利用SSD缓存的空间,缩短了存储系统的整体响应时间。
Smart Images

Figure CN117742593B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an SSD cache flushing processing method, system, device, and storage medium. Background Technology
[0002] In recent years, with the continuous development of emerging technologies such as big data, cloud computing, and AI, the demand for data has grown exponentially, placing higher demands on the capacity and performance of storage devices. The most commonly used storage medium in traditional storage devices is the mechanical hard drive (HDD). Although the storage capacity of HDDs has been continuously increasing in recent years, because they use magnetic principles to store data, the seek time for the read / write head and platters is long, especially when reading and writing fragmented small files, resulting in higher access latency, which cannot meet the needs of low-latency, high-performance applications. Solid-state drives (SSDs) use flash memory chips to store data. They have no internal mechanical parts and achieve read / write access through electrical signals. They have advantages such as fast read / write speeds, low power consumption, and portability. With technological advancements, the capacity bottleneck of SSDs has been overcome, and more and more storage manufacturers are beginning to use SSDs as the primary storage medium in their storage systems.
[0003] However, SSDs are relatively expensive, costing nearly 2 to 3 times more than HDDs of the same capacity, with the price difference increasing with larger capacities. For cost reasons, many storage vendors use SSDs as caches, viewing them as a large-capacity secondary cache located between RAM and HDDs for read / write acceleration. SSD caching is suitable for applications with frequently accessed data. By storing frequently accessed data on SSDs, access to this data can be directly retrieved from the SSD, eliminating the need to access the less efficient HDDs. This effectively improves the overall performance of the storage system and meets today's demands for low latency and high responsiveness without significantly increasing costs.
[0004] SSD caching technology in storage systems utilizes SSDs as a cache between RAM and HDDs. During access, new frequently accessed data needs to be stored in the SSD cache. However, the storage capacity of SSDs is usually smaller than that of the HDDs being cached for acceleration. Therefore, it is necessary to promptly flush outdated data cached in the SSDs back to the HDDs to ensure that the most frequently accessed data is cached in the SSDs. This maximizes the probability of accessed data hitting the SSD cache and makes the most efficient use of SSD space, thereby improving the overall access performance of the storage system most effectively.
[0005] The typical method of SSD caching technology is to passively flush out outdated data from the SSD cache to the HDD disk when new write data is detected and the SSD cache space is full.
[0006] While the aforementioned caching methods can perform data flushing to some extent, several drawbacks have been found in practical use, preventing them from achieving optimal performance. These drawbacks can be summarized as follows:
[0007] 1) This passive SSD cache flushing method only triggers the SSD cache flushing operation when the SSD cache space is full, which will inevitably result in a large amount of outdated data remaining in the SSD cache. This outdated data will greatly reduce the SSD cache hit rate and greatly affect the access performance of the storage system.
[0008] 2) When the SSD cache space is full, outdated cached data needs to be removed from the SSD disk to make room for newly written data before the new data can be written to the SSD cache. This will also significantly slow down the response time of the storage system.
[0009] Therefore, it is clear that the existing caching methods described above still have inconveniences and shortcomings in use, and urgently need further improvement. Creating a new SSD cache flushing method has become a pressing goal for the industry. Summary of the Invention
[0010] In view of this, the present disclosure provides an SSD cache flushing method, which at least partially solves the problems existing in the prior art.
[0011] In a first aspect, this disclosure provides an SSD cache flushing method, the method comprising the following steps:
[0012] Monitor SSD cache resources and the idle time of SSD cache volumes;
[0013] Determine whether to trigger a refresh task based on the detection results; if a refresh task is triggered, initiate the refresh task.
[0014] The system determines whether dirty data exists in the SSD cache block by checking if any sub-block location within the metadata range corresponding to the SSD cache data is marked as dirty data; if no dirty data exists, no flushing is required; and...
[0015] When dirty data exists, the LBA address is used to determine whether the SSD cache data is currently in the memory cache. If it is not in the memory cache, the SSD cache data is read from the SSD cache, written to the memory cache, and then written to the corresponding location on the HDD disk. If the cache data is in the memory cache, the cache data is directly flushed back to the corresponding location on the HDD disk. The corresponding cache metadata record is cleared, and the flush operation is finally completed.
[0016] According to a specific implementation of this disclosure, the step of finding whether the SSD cache data is currently in the memory cache based on the LBA address further includes:
[0017] Traverse the cached metadata;
[0018] Determine if the traversal has ended; where, when the traversal has ended, the refresh task is completed; and,
[0019] While the traversal is not yet finished, calculate the address and length of the cache and construct the flush object;
[0020] Determine if the cache is already in memory; if the cache is already in memory, clear the cache metadata and write the cache to the corresponding location on the HDD disk; if the cache is not in memory, read the SSD cache data into the memory cache, clear the cache metadata, and write the cache to the corresponding location on the HDD disk.
[0021] Once the refresh is complete, the callback will be invoked to begin the next refresh.
[0022] According to a specific implementation of an embodiment of this disclosure, the step of determining whether to trigger a refresh task based on the detection result includes:
[0023] When the number of used cache blocks in the SSD cache pool exceeds a preset threshold, an SSD flushing task is triggered; and,
[0024] When SSD cache resources are corrupted, a flush task is triggered; the corruption of SSD cache resources includes: disabling SSD cache volumes, deleting HDD volumes accelerated by SSDs, and deleting the pool to which the SSD belongs.
[0025] According to a specific implementation of an embodiment of this disclosure, the method further includes:
[0026] When system idle time is detected, the SSD flashback task is actively triggered.
[0027] According to a specific implementation of an embodiment of this disclosure, the system idle time includes:
[0028] Each cache volume uses two fields, ticks and touch_tm, to monitor the automatic SSD cache flushing task. When an SSD cache volume is created, a timer is set and started, which is triggered once every 30 seconds. The number of times the timer is triggered is recorded through the ticks field of the SSD cache volume.
[0029] When the SSD cache volume receives read or write data, the current SSD cache volume's ticks value is assigned to the touch_tm field, indicating that the volume is no longer in an idle state;
[0030] Within the timer, the continuous idle time of the SSD cache volume is calculated based on the difference between the ticks and touch_tm values of the SSD cache volume. When the continuous idle time of the SSD cache volume exceeds the set threshold, an SSD cache flushing task is actively initiated.
[0031] According to a specific implementation of an embodiment of this disclosure, the refresh task includes:
[0032] Insert a reference node at the end of the LRU list of the corresponding metadata of the SSD cache volume to mark the start position of the cache flush;
[0033] Starting from the beginning of the marked cache flushing, the system traverses backwards, returning the first metadata whose SSD cache data is dirty for cache flushing operation. When the LRU list of cache metadata is reached, the flushing task is completed.
[0034] Secondly, embodiments of this disclosure provide an SSD cache flushing processing system, the system comprising:
[0035] The rollback task monitoring module is configured to monitor the idle time of SSD cache resources and SSD cache volumes;
[0036] The judgment module is configured to determine whether to trigger a refresh task based on the detection result; wherein, when a refresh task is triggered, the refresh task is initiated; and,
[0037] The system determines whether dirty data exists in the SSD cache block by checking if any sub-block location within the metadata range corresponding to the SSD cache data is marked as dirty data; if no dirty data exists, no flushing is required; and...
[0038] The cache flushing module is configured to determine whether the SSD cache data is currently in the memory cache based on the LBA address when dirty data exists. If it is not in the memory cache, the SSD cache data is read from the SSD cache, written to the memory cache, and then written to the corresponding location on the HDD disk. If the cache data is in the memory cache, the cache data is directly flushed back to the corresponding location on the HDD disk. The corresponding cache metadata record is then cleared, and the flushing operation is finally completed.
[0039] According to a specific implementation of an embodiment of this disclosure, the system further includes:
[0040] The flush module is configured to iterate through cached metadata.
[0041] Determine if the traversal has ended; where, when the traversal has ended, the refresh task is completed; and,
[0042] While the traversal is not yet finished, calculate the address and length of the cache and construct the flush object;
[0043] Determine if the cache is already in memory; if the cache is already in memory, clear the cache metadata and write the cache to the corresponding location on the HDD disk; if the cache is not in memory, read the SSD cache data into the memory cache, clear the cache metadata, and write the cache to the corresponding location on the HDD disk.
[0044] Once the refresh is complete, the callback will be invoked to begin the next refresh.
[0045] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0046] At least one processor; and,
[0047] A memory communicatively connected to the at least one processor; wherein,
[0048] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, cause the at least one processor to perform the SSD cache flushing process method described in any of the first aspects or any implementations thereof.
[0049] Fourthly, embodiments of this disclosure also provide a non-transitory computer-readable storage medium storing computer instructions that, when executed by at least one processor, cause the at least one processor to perform the SSD cache flushing method in the first aspect or any implementation thereof.
[0050] Fifthly, embodiments of this disclosure also provide a computer program product, the computer program product including a computing program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the SSD cache flushing processing method in the first aspect or any implementation thereof.
[0051] The SSD cache flushing method in this embodiment actively triggers SSD cache flushing tasks by monitoring both SSD cache resources and the idle time of the SSD cache volume. This overcomes the shortcomings of previous passive SSD cache flushing methods, promptly releasing SSD cache space, improving SSD cache hit rate, and enhancing the overall performance of the storage system. By utilizing the characteristics of the LRU algorithm, a reference node for cache flushing is inserted at the end of the LRU linked list of SSD cache metadata for quick lookup of cache metadata to be flushed. The efficient SSD cache flushing method designed in this invention can quickly and proactively flush outdated data from the SSD cache to the HDD disk, efficiently utilizing SSD cache space and shortening the overall response time of the storage system. Attached Figure Description
[0052] The above is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] Figure 1 This is a schematic flowchart of an SSD cache flushing method provided in an embodiment of the present disclosure;
[0054] Figure 2 A flowchart of an SSD cache flushing method provided in this disclosure embodiment;
[0055] Figure 3 This is a schematic diagram of a re-fetching process provided in an embodiment of the present disclosure;
[0056] Figure 4 A schematic diagram of an SSD cache flushing processing system provided in this disclosure embodiment; and
[0057] Figure 5 A schematic diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0058] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0059] The following specific examples illustrate the implementation of this disclosure. Those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0060] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0061] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.
[0062] This invention improves upon existing solutions by proposing a proactive SSD cache data flushing method. By monitoring SSD cache resources and the idle time of the SSD cache volume, it proactively initiates SSD cache data flushing tasks based on two dimensions: SSD cache capacity and cache volume idle time. Once the SSD cache capacity reaches a certain threshold, a proactive SSD cache flushing task is initiated, ensuring newly written data can promptly access cache space, thus improving storage system performance. Monitoring the cache volume's idle time, when it exceeds a set time, a proactive SSD cache flushing operation is triggered, flushing outdated, non-hotspot data back to the HDD disk, releasing the SSD cache space occupied by this outdated data, maximizing SSD cache space utilization, and shortening storage system access latency. This invention aims to utilize SSD disks as SSD caches under limited SSD disk capacity, maximizing SSD disk capacity utilization, improving SSD cache hit rate, and enhancing overall storage system performance.
[0063] Figure 1 This is a schematic diagram of the SSD cache flushing process provided in the embodiments of this disclosure.
[0064] Figure 2 To and Figure 1 The corresponding SSD cache flashback processing flowchart includes a flashback task monitoring module, a flashback cache lookup module, a cache judgment module, and a flashback module.
[0065] like Figure 1 As shown, in step S110, the idle time of SSD cache resources and SSD cache volume is monitored.
[0066] In this embodiment of the invention, more specifically, we proceed to step S120.
[0067] In step S120, it is determined whether a re-fetch task is triggered based on the detection result; wherein, when a re-fetch task is triggered, the re-fetch task is initiated.
[0068] In this embodiment of the invention, determining whether to trigger a refresh task based on the detection result includes:
[0069] When the number of used cache blocks in the SSD cache pool exceeds a preset threshold, an SSD refresh task is triggered; and when the SSD cache resources are corrupted, a refresh task is triggered; the corruption of SSD cache resources includes: disabling SSD cache volumes, deleting HDD volumes accelerated by SSDs, and deleting the pool to which the SSD belongs.
[0070] In this embodiment of the invention, the method further includes: actively triggering an SSD flashback task when system idle time is detected.
[0071] In this embodiment of the invention, the system idle time includes: monitoring the SSD cache automatic flushing task using two fields, ticks and touch_tm, within each cache volume; when an SSD cache volume is created, a timer is set and started, triggering once every 30 seconds, and the number of timer triggers is recorded through the ticks field of the SSD cache volume; when the SSD cache volume receives read or write data, the current SSD cache volume's tick value is assigned to the touch_tm field, indicating that the volume is no longer in an idle state; within the timer, the continuous idle time of the SSD cache volume is calculated based on the difference between the ticks and touch_tm values of the SSD cache volume; when the continuous idle time of the SSD cache volume exceeds a set threshold, an SSD cache flushing task is actively initiated.
[0072] Next, proceed to step S130.
[0073] In step S130, it is determined whether there is dirty data in the SSD cache block based on whether any sub-block position within the range of the metadata corresponding to the SSD cache data is marked as dirty data; if there is no dirty data, then no flushing is required.
[0074] Next, proceed to step S140.
[0075] In step S140, when dirty data exists, the system checks whether the SSD cache data is currently in the memory cache based on the LBA address. If it is not in the memory cache, the system reads the SSD cache data from the SSD cache into the memory cache and writes it to the corresponding location on the HDD disk to complete the flush operation.
[0076] In this embodiment of the invention, the step of finding whether the SSD cache data is currently in the memory cache based on the LBA address further includes: traversing the cache metadata; determining whether the traversal is complete; wherein, when the traversal is complete, the flush task is completed; and, when the traversal is not complete, calculating the address and length corresponding to the cache and constructing a flush object; determining whether the cache is already in memory; wherein, when the cache is already in memory, clearing the cache metadata and writing the cache to the corresponding location on the HDD disk; when the cache is not in memory, reading the SSD cache data into the memory cache, clearing the cache metadata, and writing the cache to the corresponding location on the HDD disk; after the flush is completed, calling the callback to start the next flush.
[0077] In this embodiment of the invention, the flushing task includes: inserting a reference node at the tail of the LRU list of the corresponding metadata of the SSD cache volume to mark the start position of the cache flushing; traversing backward from the marked start position of the cache flushing to return the first metadata of the SSD cache that is dirty and performing the cache flushing operation; when the head of the LRU list of the cache metadata is reached, the flushing task is completed.
[0078] More specifically, the proactive SSD cache flushing method proposed in this invention includes a flushing task monitoring module, a flushing cache lookup module, a cache judgment module, and a flushing module. These modules are interconnected and have distinct functions, including:
[0079] I. Refresh Task Monitoring Module:
[0080] This includes monitoring SSD cache resources and the idle time of SSD cache volumes.
[0081] SSD cache resource monitoring:
[0082] (1) When SSD cache resources are damaged, such as disabling SSD cache volumes, deleting HDD volumes accelerated by SSDs, or deleting the pool to which the SSD belongs, a flush task will be triggered to ensure data integrity.
[0083] (2) When the number of used cache blocks in the SSD cache pool exceeds a certain threshold, the SSD flushing task will be actively triggered.
[0084] SSD cache volume idle time monitoring:
[0085] When system idle time is detected, an SSD cache flushing task is proactively triggered. Each cache volume uses two fields, `ticks` and `touch_tm`, to monitor the SSD cache automatic flushing task. When an SSD cache volume is created, a timer is set and started, triggering every 30 seconds. The number of timer triggers is recorded in the SSD cache volume's `ticks` field. When the SSD cache volume receives read or write data, the current SSD cache volume's `ticks` value is assigned to the `touch_tm` field, indicating that the volume is no longer idle. Within the timer, the sustained idle time of the SSD cache volume can be calculated based on the difference between the SSD cache volume's `ticks` and `touch_tm` values. When the sustained idle time of the SSD cache volume exceeds a set threshold, an SSD cache flushing task is proactively initiated.
[0086] II. Refresh Cache Lookup Module:
[0087] Because SSD caching technology uses the Least Recently Used (LRU) algorithm, which evicts outdated data based on historical access records, when new data is written, the allocated SSD cache block metadata is added to the head of the LRU list. Based on this characteristic, when initiating a flush task, a reference node is inserted at the tail of the LRU list corresponding to the SSD cache volume's metadata to mark the start position of the cache flush. During the cache flush task, the LRU list of the SSD metadata cache is traversed from the reference node representing the flush, returning the first piece of metadata with dirty SSD cache data for the flush operation. When the head of the LRU list of cache metadata is reached, the flush task is considered complete.
[0088] III. Cache Flush Detection Module:
[0089] The SSD cache is divided into several equal-sized cache blocks, each with its own metadata that records cache block information. When data is written, a cache block is allocated based on the LBA address of the data on the volume, and the cache within that data range is marked in the corresponding metadata. If the data is newly written by a front-end application, it is considered dirty data; if the data is being filled into the SSD cache from an HDD, it is considered non-dirty. Therefore, the presence of dirty data in the SSD cache block is determined by checking whether any sub-block within the metadata range corresponding to the SSD cache data is marked as dirty. If no dirty data is found, no flushing is required.
[0090] IV. Refresh Module:
[0091] like Figure 3 As shown, in the refresh module, based on the cache metadata returned by the cache refresh lookup module, the LBA address and length of the SSD cache data are calculated. Then, based on the LBA address, it is found whether the cache data is currently in the memory cache. If it is not in the memory cache, the data is read from the SSD cache and stored in the memory cache. Finally, the data is written to the corresponding location on the HDD disk to complete the refresh operation.
[0092] Figure 4 The present invention illustrates an SSD cache flushing system 400, which includes a flushing task monitoring module 410, a judgment module 420, and a cache flushing module 430.
[0093] The rollback task monitoring module 410 is used to monitor the idle time of SSD cache resources and SSD cache volumes;
[0094] The judgment module 420 is used to determine whether to trigger a refresh task based on the detection result; wherein, when a refresh task is triggered, the refresh task is initiated; and,
[0095] The system determines whether dirty data exists in the SSD cache block by checking if any sub-block location within the metadata range corresponding to the SSD cache data is marked as dirty data; if no dirty data exists, no flushing is required; and...
[0096] The cache flushing module 430 is used to determine whether the SSD cache data is currently in the memory cache based on the LBA address when dirty data exists. If it is not in the memory cache, the SSD cache data is read from the SSD cache, written to the memory cache, and then written to the corresponding location on the HDD disk. If the cache data is in the memory cache, the cache data is directly flushed back to the corresponding location on the HDD disk. The corresponding cache metadata record is cleared, and the flushing operation is finally completed.
[0097] In this embodiment of the invention, the system further includes:
[0098] The flush module is configured to iterate through cached metadata.
[0099] Determine if the traversal has ended; where, when the traversal has ended, the refresh task is completed; and,
[0100] While the traversal is not yet finished, calculate the address and length of the cache and construct the flush object;
[0101] Determine if the cache is already in memory; if the cache is already in memory, clear the cache metadata and write the cache to the corresponding location on the HDD disk; if the cache is not in memory, read the SSD cache data into the memory cache, clear the cache metadata, and write the cache to the corresponding location on the HDD disk.
[0102] Once the refresh is complete, the callback will be invoked to begin the next refresh.
[0103] See Figure 5 This disclosure also provides an electronic device 50, which includes:
[0104] At least one processor; and,
[0105] The memory is communicatively connected to the at least one processor; wherein,
[0106] The memory stores instructions that can be executed by the at least one processor, which enables the at least one processor to perform the SSD cache flushing method in the foregoing method embodiments.
[0107] This disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the SSD cache flushing method in the foregoing method embodiments.
[0108] This disclosure also provides a computer program product, which includes a computing program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the SSD cache flushing processing method in the foregoing method embodiments.
[0109] The following is for reference. Figure 5The diagram illustrates a structural schematic of an electronic device 50 suitable for implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0110] like Figure 5 As shown, the electronic device 50 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 50. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0111] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 50 to communicate wirelessly or wiredly with other devices to exchange data. Although an electronic device 50 with various devices is shown in the figure, it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0112] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0113] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0114] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0115] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire at least two Internet Protocol (IP) addresses; send a node evaluation request including the at least two IP addresses to a node evaluation device, wherein the node evaluation device selects an IP address from the at least two IP addresses and returns it; and receive the IP address returned by the node evaluation device; wherein the acquired IP address indicates an edge node in a content delivery network.
[0116] Alternatively, the aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receive a node evaluation request including at least two Internet Protocol (IP) addresses; select an IP address from the at least two IP addresses; and return the selected IP address; wherein the received IP address indicates an edge node in the content delivery network.
[0117] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0119] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0120] It should be understood that the various parts of this disclosure can be implemented in hardware, software, firmware, or a combination thereof.
[0121] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A method for SSD cache flushing, characterized in that, The method includes the following steps: Monitor SSD cache resources and the idle time of SSD cache volumes; Determine whether to trigger a refresh task based on the detection results; if a refresh task is triggered, initiate the refresh task. The system determines whether dirty data exists in the SSD cache block by checking if any sub-block location within the metadata range corresponding to the SSD cache data is marked as dirty data; if no dirty data exists, no flushing is required; and... When dirty data exists, the LBA address is used to determine whether the SSD cache data is currently in the memory cache. If it is not in the memory cache, the SSD cache data is read from the SSD cache, written to the memory cache, and then written to the corresponding location on the HDD disk. If the cache data is in the memory cache, the cache data is directly flushed back to the corresponding location on the HDD disk. The corresponding cache metadata record is cleared, and the flush operation is finally completed. When system idle time is detected, the SSD flashback task is actively triggered; The system idle time includes: Each cache volume uses two fields, ticks and touch_tm, to monitor the automatic SSD cache flushing task. When an SSD cache volume is created, a timer is set and started, which is triggered once every 30 seconds. The number of times the timer is triggered is recorded through the ticks field of the SSD cache volume. When the SSD cache volume receives read or write data, the current SSD cache volume's ticks value is assigned to the touch_tm field, indicating that the volume is no longer in an idle state; Within the timer, the continuous idle time of the SSD cache volume is calculated based on the difference between the ticks and touch_tm values of the SSD cache volume. When the continuous idle time of the SSD cache volume exceeds the set threshold, an SSD cache flushing task is actively initiated.
2. The SSD cache flushing method according to claim 1, characterized in that, The step of determining whether SSD cache data is currently in the memory cache based on the LBA address also includes: Traverse the cached metadata; Determine if the traversal has ended; where, when the traversal has ended, the refresh task is completed; and, While the traversal is not yet finished, calculate the address and length of the cache and construct the flush object; Determine if the cache is already in memory; if the cache is already in memory, clear the cache metadata and write the cache to the corresponding location on the HDD disk; if the cache is not in memory, read the SSD cache data into the memory cache, clear the cache metadata, and write the cache to the corresponding location on the HDD disk. Once the refresh is complete, the callback will be invoked to begin the next refresh.
3. The SSD cache flushing method according to claim 1, characterized in that, The step of determining whether to trigger a refresh task based on the detection results includes: When the number of used cache blocks in the SSD cache pool exceeds a preset threshold, an SSD flushing task is triggered; and, When SSD cache resources are corrupted, a flush task is triggered; the corruption of SSD cache resources includes: disabling SSD cache volumes, deleting HDD volumes accelerated by SSDs, and deleting the pool to which the SSD belongs.
4. The SSD cache flushing method according to claim 1, characterized in that, The refresh task includes: Insert a reference node at the end of the LRU list of the corresponding metadata of the SSD cache volume to mark the start position of the cache flush; Starting from the beginning of the marked cache flushing, the system traverses backwards, returning the first metadata whose SSD cache data is dirty for cache flushing operation. When the LRU list of cache metadata is reached, the flushing task is completed.
5. An SSD cache flushing processing system, characterized in that, The system includes: The rollback task monitoring module is configured to monitor the idle time of SSD cache resources and SSD cache volumes; The judgment module is configured to determine whether to trigger a refresh task based on the detection result; wherein, when a refresh task is triggered, the refresh task is initiated; and, The system determines whether dirty data exists in the SSD cache block by checking if any sub-block location within the metadata range corresponding to the SSD cache data is marked as dirty data; if no dirty data exists, no flushing is required; and... The cache flushing module is configured to determine whether the SSD cache data is currently in the memory cache based on the LBA address when dirty data exists. If it is not in the memory cache, the SSD cache data is read from the SSD cache, written to the memory cache, and then written to the corresponding location on the HDD disk. If the cache data is in the memory cache, the cache data is directly flushed back to the corresponding location on the HDD disk. The corresponding cache metadata record is cleared, and the flushing operation is finally completed. The idle flash module is configured to actively trigger an SSD flash task when system idle time is detected. The system idle time includes: Each cache volume uses two fields, ticks and touch_tm, to monitor the automatic SSD cache flushing task. When an SSD cache volume is created, a timer is set and started, which is triggered once every 30 seconds. The number of times the timer is triggered is recorded through the ticks field of the SSD cache volume. When the SSD cache volume receives read or write data, the current SSD cache volume's ticks value is assigned to the touch_tm field, indicating that the volume is no longer in an idle state; Within the timer, the continuous idle time of the SSD cache volume is calculated based on the difference between the ticks and touch_tm values of the SSD cache volume. When the continuous idle time of the SSD cache volume exceeds the set threshold, an SSD cache flushing task is actively initiated.
6. The SSD cache flushing processing system according to claim 5, characterized in that, The system also includes: The flush module is configured to iterate through cached metadata. Determine if the traversal has ended; where, when the traversal has ended, the refresh task is completed; and, While the traversal is not yet finished, calculate the address and length of the cache and construct the flush object; Determine if the cache is already in memory; if the cache is already in memory, clear the cache metadata and write the cache to the corresponding location on the HDD disk; if the cache is not in memory, read the SSD cache data into the memory cache, clear the cache metadata, and write the cache to the corresponding location on the HDD disk. Once the refresh is complete, the callback will be invoked to begin the next refresh.
7. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, cause the at least one processor to perform the SSD cache flushing process method as described in any one of claims 1 to 4.
8. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions that, when executed by at least one processor, cause the at least one processor to perform the SSD cache flushing process method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Control method of data caching area in solid state disc
CN102779017A
Storage controlling apparatus, computer-readable recording medium having storage controlling program stored therein, and storage controlling method
US20170068618A1