A method, apparatus, device and medium for hierarchical cache data transfer

By counting the access frequency of objects in buckets and marking high-frequency objects, combined with time folders and transfer threads, the data transfer of the cache pool is optimized, which solves the problem of the cache pool being full and affecting the front-end business, and improves access efficiency and the competitiveness of the storage system.

CN116303139BActive Publication Date: 2026-02-10JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310142402.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-17
Publication Date
2026-02-10
Estimated Expiration
2043-02-17

AI Technical Summary

Technical Problem

The existing tiered caching function cannot distinguish cached data based on the access frequency of the data, which causes the front-end business to be affected when the cache pool is full, and the data transfer is not flexible enough, affecting access efficiency.

Method used

By counting the access frequency of objects in the bucket, marking objects with high access frequency, and creating time folders in the cache pool, combined with the transfer thread, objects with low access frequency are transferred to the ordinary data pool at a specified time, thus optimizing the use of the cache pool.

Benefits of technology

It improves the access efficiency of frequently accessed objects, promptly cleans up the space occupied by infrequently accessed objects, reduces the impact of cached data transfer on front-end business, and enhances the market competitiveness of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303139B_ABST
    Figure CN116303139B_ABST
Patent Text Reader

Abstract

The application provides a hierarchical cache data transfer method, device, equipment and readable medium, the method comprises the following steps: opening the hierarchical cache in the bucket, and counting the access frequency of the object to be uploaded to the bucket, and marking the upload request of the uploaded object whose access frequency is higher than the frequency threshold; in response to receiving the request of the client uploading the object, judging whether the uploaded object in the request meets the requirement; in response to the size of the uploaded object in the request being smaller than the size threshold and the request having the mark, writing the uploaded object into the cache pool; creating a transfer thread and setting a transfer time, and transferring the data in the cache pool to the normal data pool when the transfer time is reached. By using the scheme of the application, the access efficiency of high access frequency objects can be improved, the space occupied by low access frequency objects in the cache pool can be cleaned up in time, the influence of a large amount of cache data transfer on the front-end business is reduced, and the market competitiveness of the storage system is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, and more particularly to a method, device, equipment and readable medium for hierarchical cache data transfer. BACKGROUND

[0002] The hierarchical cache function in the current distributed object storage system is designed to improve the writing speed of small objects, that is, when the bucket opens the hierarchical cache switch, the small objects written into the bucket are stored in the cache pool, and the cache pool is composed of high-speed access media, and the writing speed is much higher than that of the ordinary data pool.

[0003] The high-speed access media is expensive, so the cache pool space in a cluster is also limited, and it is impossible for all objects to be written to the cache pool, so the hierarchical cache function is designed to limit only small objects less than 512K to be written to the cache pool. Even so, it is impossible to avoid the situation that the cache pool is full, so the hierarchical cache function is designed to transfer data according to the water level of the cache pool. When the default cache pool water level reaches 30%, the data of the small objects is partially transferred to the ordinary data pool, and as the water level increases, the transfer speed will also increase. When the cache pool water level reaches 70%, the data transfer speed reaches the fastest, which will seriously affect the front-end business read and write, and the data transfer at other water levels will also affect the front-end business to varying degrees.

[0004] In addition, the current hierarchical cache function can only roughly store data according to the data size, and only data less than the threshold value can be written to the cache pool, and it will not be classified according to the access frequency of the written data, and when the water level needs to be transferred, it will be transferred to the ordinary data pool without distinction. Once the data with high access frequency is transferred to the ordinary data pool, the access efficiency will be greatly reduced. SUMMARY

[0005] Therefore, the purpose of the embodiments of the present application is to provide a hierarchical cache data transfer method, device, equipment and readable medium, which can improve the access efficiency of high access frequency objects, can clean up the space occupied by low access frequency objects in the cache pool in time, reduce the impact of a large amount of cache data transfer on the front-end business, and greatly improve the market competitiveness of the storage system.

[0006] Based on the above purpose, one aspect of an embodiment of the present application provides a hierarchical cache data transfer method, comprising the following steps:

[0007] Opening the hierarchical cache in the bucket, and counting the access frequency of the objects to be uploaded to the bucket, and marking the upload request of the uploaded objects with an access frequency higher than the frequency threshold;

[0008] In response to receiving the request of the client uploading the object, it is judged whether the uploading object in the request meets the requirement;

[0009] In response to the size of the uploading object in the request being less than the size threshold and there being a mark in the request, the uploading object is written into the cache pool;

[0010] A transfer thread is created and a transfer time is set, and when the transfer time is reached, the data in the cache pool is transferred to the normal data pool.

[0011] According to one embodiment of the present application, it further comprises:

[0012] The access frequency of the object stored in the cache pool is counted in real time, and the counted access frequency is compared with a frequency threshold;

[0013] In response to the counted access frequency being lower than the frequency threshold, the object stored in the cache pool is transferred to the normal data pool.

[0014] According to one embodiment of the present application, it further comprises:

[0015] A folder representing time is created in the bucket, and the time is the interval time after the object is written into the cache pool and is transferred to the normal data pool;

[0016] The object is stored into the corresponding folder according to the requirement.

[0017] According to one embodiment of the present application, the creation of the transfer thread and the setting of the transfer time, and the transfer of the data in the cache pool to the normal data pool when the transfer time is reached comprise:

[0018] In response to the arrival of the transfer time, the transfer thread is woken up, and all the folders under each bucket are traversed;

[0019] The time when the object needs to be transferred to the normal data pool is parsed from each folder name;

[0020] The object under the folder is obtained, the metadata of the object is read, and the mtime of the object is compared with the parsed time;

[0021] In response to the object being expired, the data of the object is transferred to the normal data pool, and the data in the cache pool is deleted;

[0022] A transferred mark is added in the metadata of the object.

[0023] Another aspect of the embodiment of the present application further provides a device for hierarchical cache data transfer, and the device comprises:

[0024] The statistics module is configured to enable tiered caching in the bucket, count the access frequency of objects to be uploaded to the bucket, and mark upload requests for objects whose access frequency is higher than the frequency threshold.

[0025] The judgment module is configured to respond to a client's request to upload an object and determine whether the uploaded object in the request meets the requirements.

[0026] The write module is configured to write the uploaded object to the cache pool in response to a request where the size of the uploaded object is less than a size threshold and the request contains a flag.

[0027] The transfer module is configured to create a transfer thread and set a transfer time, and transfer the data in the cache pool to the ordinary data pool when the transfer time is reached.

[0028] According to one embodiment of the present invention, a comparison module is further included, the comparison module being configured as follows:

[0029] Real-time statistics on the access frequency of objects stored in the cache pool are compiled and compared with a frequency threshold.

[0030] If the access frequency in the statistics is lower than the frequency threshold, the objects stored in the cache pool will be moved to the regular data pool.

[0031] According to one embodiment of the present invention, a creation module is further included, the creation module being configured as follows:

[0032] Create folders representing time in the bucket, where time is the interval between when an object is written to the cache pool and then transferred to the normal data pool;

[0033] Store objects in the appropriate folders as needed.

[0034] According to one embodiment of the present invention, the transfer module is further configured to:

[0035] In response to the arrival of the transfer time, the transfer thread is woken up and the folders under all buckets are traversed;

[0036] Parse the time required to transfer objects to the regular data pool from each folder name;

[0037] Retrieve objects from the folder, read the object's metadata, and compare the object's mtime with the parsed time;

[0038] In response to an object expiring, the object's data is moved to the regular data pool, and the data in the cache pool is deleted.

[0039] Add a moved tag to the object's metadata.

[0040] Another aspect of the embodiments of the present invention also provides a computer device, the computer device comprising:

[0041] At least one processor; and

[0042] The memory stores computer instructions that can be executed by a processor, which, when executed by the processor, implement the steps of any of the methods described above.

[0043] In another aspect, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above methods.

[0044] The present invention has the following beneficial technical effects: The hierarchical cache data transfer method provided in the embodiments of the present invention enables hierarchical caching in buckets, counts the access frequency of objects to be uploaded to the buckets, and marks the upload requests of upload objects with access frequencies higher than the frequency threshold; in response to receiving a client's request to upload an object, it determines whether the upload object in the request meets the requirements; in response to the upload object in the request being smaller than the size threshold and marked in the request, the upload object is written to the cache pool; the technical solution of creating a transfer thread and setting a transfer time, and transferring the data in the cache pool to the ordinary data pool when the transfer time is reached, can improve the access efficiency of high-frequency objects, can promptly clean up the space occupied by low-frequency objects in the cache pool, reduce the impact of large-scale cache data transfer on front-end business, and greatly improve the market competitiveness of the storage system. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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 embodiments can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a schematic flowchart illustrating a hierarchical cache data transfer method according to an embodiment of the present invention;

[0047] Figure 2 A schematic diagram of a hierarchical cache data transfer apparatus according to an embodiment of the present invention;

[0048] Figure 3 This is a schematic diagram of a computer device according to an embodiment of the present invention;

[0049] Figure 4 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.

[0051] Based on the above objectives, a first aspect of the embodiments of the present invention provides an embodiment of a hierarchical cache data transfer method. Figure 1 The diagram shown is a schematic flowchart of the method.

[0052] like Figure 1 As shown, the method may include the following steps:

[0053] S1 enables tiered caching in buckets and tracks the access frequency of objects to be uploaded to the bucket, marking upload requests for objects with access frequencies exceeding a threshold. On the client side, the tiered caching switch for the bucket is enabled. Objects uploaded to this bucket will only be stored in the cache pool if they meet certain conditions. Folders are created for the bucket, such as day1, day2, day3, with folder names indicating how many days after writing objects will they be transferred to the regular data pool. When uploading objects to a bucket, the access frequency of the uploaded objects is tracked. High-frequency objects are uploaded to their corresponding folders within the bucket, while low-frequency objects are stored in the bucket's root directory. High-frequency objects are marked when sending upload requests, for example, by adding the `--hot` field to indicate their high access frequency. High-frequency objects generally become low-frequency objects after a period of time, determined by user evaluation. Based on this time, high-frequency objects are uploaded to the folder within the bucket corresponding to their expiration time. If the access frequency is low, no marking is required when uploading the object; the access frequency and expiration time are entirely determined by the client.

[0054] S2 responds to a client's request to upload an object by determining whether the requested object meets the requirements. On the server side, upon receiving a client's request to upload an object, it needs to determine whether the size of the requested object meets the requirements and whether the request contains any flags.

[0055] S3 responds by writing the uploaded object to the cache pool if the size of the uploaded object in the request is less than the size threshold and the request contains a flag. If the size of the uploaded object is less than the threshold set by the tiered caching function and the request carries a flag (i.e., the --hot field), then the object is written to the cache pool; otherwise, the object is written to the regular data pool.

[0056] S4 creates a transfer thread and sets a transfer time. When the transfer time arrives, it transfers data from the cache pool to the regular data pool. On the server side, a transfer thread is created and woken up during a specific time period (e.g., 1:00-5:00). During this time, front-end business is less active, and transferring data during this period greatly reduces the impact on client-side business. After the set time arrives, the transfer thread is woken up and first iterates through all buckets in the storage pool to obtain a list of buckets with tiered caching enabled. For each bucket with tiered caching enabled, it lists the root directory of that bucket and obtains all folders under that directory, such as day1, day2, day3, etc. It then parses the expiration time from each folder name; for example, for day1, it parses the expiration time. Objects in the extracted folder are transferred to the regular data pool one day after upload. All objects in the folder are retrieved. Each object, after being uploaded to the server, has its current time marked as metadata in its object header. The object's metadata is read, and its mtime is compared with the time parsed from the object's filename. If the object has expired, its data is transferred to the regular data pool, the data in the cache pool is deleted, and a transfer mark is added to the object's metadata to prevent duplicate transfers. If the object has not expired, its processing is skipped, and so on.

[0057] By using the technical solution of this invention, the access efficiency of high-frequency objects can be improved, the space occupied by low-frequency objects in the cache pool can be cleared in a timely manner, the impact of large-scale cache data transfer on front-end business can be reduced, and the market competitiveness of the storage system can be greatly improved.

[0058] In a preferred embodiment of the present invention, it further includes:

[0059] Real-time statistics on the access frequency of objects stored in the cache pool are compiled and compared with a frequency threshold.

[0060] If the access frequency in the statistics falls below a frequency threshold, objects stored in the cache pool are moved to the regular data pool. The access frequency of objects changes in real time; when the access frequency of an object that was previously frequently accessed drops below the frequency threshold, that object needs to be moved to the regular data pool.

[0061] In a preferred embodiment of the present invention, it further includes:

[0062] Create folders representing time in the bucket, where time is the interval between when an object is written to the cache pool and then transferred to the normal data pool;

[0063] Store objects in the appropriate folders according to requirements. Folder names can be used to indicate time intervals, meaning the folder name can distinguish how many days after writing an object will be transferred to the data pool. Store the appropriate objects in the corresponding folders as needed.

[0064] In a preferred embodiment of the present invention, creating a transfer thread and setting a transfer time, and transferring data from the cache pool to the ordinary data pool when the transfer time is reached includes:

[0065] In response to the arrival of the transfer time, the transfer thread is woken up and the folders under all buckets are traversed;

[0066] Parse the time required to transfer objects to the regular data pool from each folder name;

[0067] Retrieve objects from the folder, read the object's metadata, and compare the object's mtime with the parsed time;

[0068] In response to an object expiring, the object's data is moved to the regular data pool, and the data in the cache pool is deleted.

[0069] Add a moved tag to the object's metadata.

[0070] By using the technical solution of this invention, the problem that the current hierarchical caching function cannot cache data according to access frequency is solved. When the front-end business is small, data that becomes low access frequency is transferred to the ordinary data pool in a timely manner, improving the access efficiency of high access frequency objects. At the same time, the space occupied by low access frequency objects in the cache pool can be cleared in a timely manner, which greatly optimizes the function of hierarchical caching, reduces the impact of large-scale cache data transfer on front-end business, brings a better user experience to customers, and greatly improves the market competitiveness of the storage system.

[0071] It should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The embodiments of the computer program described above can achieve the same or similar effects as any of the corresponding foregoing method embodiments.

[0072] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, it performs the functions defined in the method disclosed in the embodiments of the present invention.

[0073] Based on the above objectives, a second aspect of the embodiments of the present invention provides an apparatus for hierarchical cache data transfer, such as... Figure 2 As shown, the device 200 includes:

[0074] The statistics module is configured to enable tiered caching in the bucket, count the access frequency of objects to be uploaded to the bucket, and mark upload requests for objects whose access frequency is higher than the frequency threshold.

[0075] The judgment module is configured to respond to a client's request to upload an object and determine whether the uploaded object in the request meets the requirements.

[0076] The write module is configured to write the uploaded object to the cache pool in response to a request where the size of the uploaded object is less than a size threshold and the request contains a flag.

[0077] The transfer module is configured to create a transfer thread and set a transfer time, and transfer the data in the cache pool to the ordinary data pool when the transfer time is reached.

[0078] In a preferred embodiment of the present invention, a comparison module is further included, which is configured as follows:

[0079] Real-time statistics on the access frequency of objects stored in the cache pool are compiled and compared with a frequency threshold.

[0080] If the access frequency in the statistics is lower than the frequency threshold, the objects stored in the cache pool will be moved to the regular data pool.

[0081] In a preferred embodiment of the present invention, a creation module is further included, which is configured as follows:

[0082] Create folders representing time in the bucket, where time is the interval between when an object is written to the cache pool and then transferred to the normal data pool;

[0083] Store objects in the appropriate folders as needed.

[0084] In a preferred embodiment of the present invention, the transfer module is further configured as follows:

[0085] In response to the arrival of the transfer time, the transfer thread is woken up and the folders under all buckets are traversed;

[0086] Parse the time required to transfer objects to the regular data pool from each folder name;

[0087] Retrieve objects from the folder, read the object's metadata, and compare the object's mtime with the parsed time;

[0088] In response to an object expiring, the object's data is moved to the regular data pool, and the data in the cache pool is deleted.

[0089] Add a moved tag to the object's metadata.

[0090] In view of the above objectives, a third aspect of the present invention provides a computer device. Figure 3 The diagram shown is a schematic representation of an embodiment of the computer device provided by the present invention. Figure 3 As shown, embodiments of the present invention include the following apparatus: at least one processor 21; and a memory 22 storing computer instructions 23 executable on the processor, which, when executed by the processor, implement the following method:

[0091] Enable tiered caching in the bucket, count the access frequency of objects to be uploaded to the bucket, and mark upload requests for objects whose access frequency is higher than the frequency threshold.

[0092] In response to receiving a request from a client to upload an object, determine whether the uploaded object in the request meets the requirements;

[0093] If the size of the uploaded object in the request is less than the size threshold and the request contains a flag, the uploaded object is written to the cache pool.

[0094] Create a transfer thread and set a transfer time, and when the transfer time is reached, transfer the data in the cache pool to the normal data pool.

[0095] In a preferred embodiment of the present invention, it further includes:

[0096] Real-time statistics on the access frequency of objects stored in the cache pool are compiled and compared with a frequency threshold.

[0097] If the access frequency in the statistics is lower than the frequency threshold, the objects stored in the cache pool will be moved to the regular data pool.

[0098] In a preferred embodiment of the present invention, it further includes:

[0099] Create folders representing time in the bucket, where time is the interval between when an object is written to the cache pool and then transferred to the normal data pool;

[0100] Store objects in the appropriate folders as needed.

[0101] In a preferred embodiment of the present invention, creating a transfer thread and setting a transfer time, and transferring data from the cache pool to the ordinary data pool when the transfer time is reached includes:

[0102] In response to the arrival of the transfer time, the transfer thread is woken up and the folders under all buckets are traversed;

[0103] Parse the time required to transfer objects to the regular data pool from each folder name;

[0104] Retrieve objects from the folder, read the object's metadata, and compare the object's mtime with the parsed time;

[0105] In response to an object expiring, the object's data is moved to the regular data pool, and the data in the cache pool is deleted.

[0106] Add a moved tag to the object's metadata.

[0107] In view of the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium. Figure 4 The diagram shown is a schematic representation of an embodiment of the computer-readable storage medium provided by the present invention. Figure 4 As shown, computer-readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the following methods:

[0108] Enable tiered caching in the bucket, count the access frequency of objects to be uploaded to the bucket, and mark upload requests for objects whose access frequency is higher than the frequency threshold.

[0109] In response to receiving a request from a client to upload an object, determine whether the uploaded object in the request meets the requirements;

[0110] If the size of the uploaded object in the request is less than the size threshold and the request contains a flag, the uploaded object is written to the cache pool.

[0111] Create a transfer thread and set a transfer time, and when the transfer time is reached, transfer the data in the cache pool to the normal data pool.

[0112] In a preferred embodiment of the present invention, it further includes:

[0113] Real-time statistics on the access frequency of objects stored in the cache pool are compiled and compared with a frequency threshold.

[0114] If the access frequency in the statistics is lower than the frequency threshold, the objects stored in the cache pool will be moved to the regular data pool.

[0115] In a preferred embodiment of the present invention, it further includes:

[0116] Create folders representing time in the bucket, where time is the interval between when an object is written to the cache pool and then transferred to the normal data pool;

[0117] Store objects in the appropriate folders as needed.

[0118] In a preferred embodiment of the present invention, creating a transfer thread and setting a transfer time, and transferring data from the cache pool to the ordinary data pool when the transfer time is reached includes:

[0119] In response to the arrival of the transfer time, the transfer thread is woken up and the folders under all buckets are traversed;

[0120] Parse the time required to transfer objects to the regular data pool from each folder name;

[0121] Retrieve objects from the folder, read the object's metadata, and compare the object's mtime with the parsed time;

[0122] In response to an object expiring, the object's data is moved to the regular data pool, and the data in the cache pool is deleted.

[0123] Add a moved tag to the object's metadata.

[0124] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. When the computer program is executed by the processor, it performs the functions defined in the method disclosed in the embodiments of the present invention.

[0125] Furthermore, the above-described method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to perform the functions of the above-described steps or units.

[0126] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.

[0127] In one or more exemplary designs, functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, functionality may be stored as one or more instructions or code on or transmitted via a computer-readable medium. Computer-readable media include computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one location to another. Storage media may be any available medium accessible to a general-purpose or special-purpose computer. By way of example, and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, or any other medium that may be used to carry or store the required program code in the form of instructions or data structures and is accessible to a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. Furthermore, any connection may be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the aforementioned coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. As used herein, disks and optical discs include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0128] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.

[0129] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.

[0130] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0131] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0132] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.

Claims

1. A method for hierarchical cache data transfer, characterized in that, Includes the following steps: Enable tiered caching in the bucket, count the access frequency of objects to be uploaded to the bucket, and mark upload requests for objects whose access frequency is higher than the frequency threshold. In response to receiving a request from a client to upload an object, determine whether the uploaded object in the request meets the requirements; If the size of the uploaded object in the request is less than the size threshold and the request contains a flag, the uploaded object is written to the cache pool. Create a transfer thread and set a transfer time, and when the transfer time is reached, transfer the data in the cache pool to the normal data pool.

2. The method according to claim 1, characterized in that, Also includes: Real-time statistics on the access frequency of objects stored in the cache pool are compiled and compared with a frequency threshold. If the access frequency in the statistics is lower than the frequency threshold, the objects stored in the cache pool will be moved to the regular data pool.

3. The method according to claim 1, characterized in that, Also includes: Create folders representing times in the bucket, where the time is the interval between when an object is written to the cache pool and then transferred to the normal data pool; Store objects in the appropriate folders as needed.

4. The method according to claim 1, characterized in that, Creating a transfer thread and setting a transfer time, and transferring data from the cache pool to the regular data pool when the transfer time is reached, includes: In response to the arrival of the transfer time, the transfer thread is woken up and the folders under all buckets are traversed; Parse the time required to transfer objects to the regular data pool from each folder name; Retrieve objects from the folder, read the object's metadata, and compare the object's mtime with the parsed time; In response to an object expiring, the object's data is moved to the regular data pool, and the data in the cache pool is deleted. Add a moved tag to the object's metadata.

5. A device for hierarchical cache data transfer, characterized in that, The device includes: The statistics module is configured to enable hierarchical caching in the bucket, count the access frequency of objects to be uploaded to the bucket, and mark the upload requests of objects whose access frequency is higher than the frequency threshold. The judgment module is configured to, in response to receiving a request from a client to upload an object, determine whether the uploaded object in the request meets the requirements. The writing module is configured to write the uploaded object to the cache pool in response to a request where the size of the uploaded object is less than a size threshold and the request contains a marker. The transfer module is configured to create a transfer thread and set a transfer time, and transfer the data in the cache pool to the ordinary data pool when the transfer time is reached.

6. The apparatus according to claim 5, characterized in that, It also includes a comparison module, which is configured as follows: Real-time statistics on the access frequency of objects stored in the cache pool are compiled and compared with a frequency threshold. If the access frequency in the statistics is lower than the frequency threshold, the objects stored in the cache pool will be moved to the regular data pool.

7. The apparatus according to claim 5, characterized in that, It also includes a creation module, which is configured as follows: Create folders representing times in the bucket, where the time is the interval between when an object is written to the cache pool and then transferred to the normal data pool; Store objects in the appropriate folders as needed.

8. The apparatus according to claim 5, characterized in that, The transfer module is also configured to: In response to the arrival of the transfer time, the transfer thread is woken up and the folders under all buckets are traversed; Parse the time required to transfer objects to the regular data pool from each folder name; Retrieve objects from the folder, read the object's metadata, and compare the object's mtime with the parsed time; In response to an object expiring, the object's data is moved to the regular data pool, and the data in the cache pool is deleted. Add a moved tag to the object's metadata.

9. A computer device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-4.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Cache-based processing method and device

    CN110598138A

  • Cache space release method, device and storage medium

    CN111090389A