Cache management method and device based on file attributes
Optimizing the cache management of the UFS memory area by obtaining file attributes and clustering solves the problems of low cache resource utilization and low hit rate in the existing technology, improves the read performance and user experience of the UFS device, and adapts to a variety of workloads.
Patent Information
- Application Number
- CN202110521854.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-13
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-05-13
AI Technical Summary
In the existing technology, the buffer memory addition algorithm of the universal flash storage (UFS) driver layer is too simple, resulting in low cache resource utilization and low cache hit rate, and frequent data elimination causes performance degradation.
By obtaining file attributes, extracting a subset of attributes related to the predetermined analysis target, determining the UFS memory area to be cached, using clustering and prefetch commands to optimize cache management, and improve cache hit rate and resource utilization.
Without modifying the application or Linux kernel, it improves the read performance and user experience of UFS devices, implements dynamic file access modes and automatic UFS memory area management, and adapts to various workloads.
Smart Images

Figure CN113268201B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage, and more specifically, to a cache management method and device based on file attributes. Background Art
[0002] In the prior art, a universal flash storage host performance enhancement (UFS HPB) buffer memory is usually added to the universal flash storage (UFS) driver layer. The UFS driver layer can improve the read performance of the UFS device through some simple addition and elimination algorithms. Here, the addition algorithm can be such as entering the cache each time or reaching a certain access threshold, and the elimination algorithm can be such as least recently used (LRU), least frequently used (LFU), etc.
[0003] The hit rate of the cache memory depends on the combination of the addition and elimination algorithms. However, in the prior art, the addition algorithm added to the cache memory as described above is too simple, the added cache data is inappropriate, and it will lead to frequent elimination, resulting in low utilization of cache resources and a reduction in cache hit rate. Summary of the invention
[0004] According to an exemplary embodiment of the present invention, a cache management method based on file attributes is provided, comprising: obtaining attributes of at least one file currently opened; extracting a first attribute subset related to a predetermined analysis target from the attributes of the at least one file; determining a region number of a corresponding universal flash storage (UFS) device memory region to be cached based on the first attribute subset; caching data of the corresponding UFS device memory region to be cached into a buffer memory based on the region number. Therefore, automatic recognition of dynamic file access patterns and automatic UFS device memory region management under variable loads can be achieved.
[0005] The attributes of a file may include the file's own attributes and / or the file event attributes. Therefore, by considering the above two file attributes, the elimination algorithm can be made more accurate and more in line with the current file status of the system.
[0006] The step of determining the area number of the corresponding UFS device memory area to be cached may include: determining a second attribute subset of the corresponding UFS device memory area based on the first attribute subset; clustering the corresponding UFS device memory area into at least one category based on the second attribute subset; and determining the area number of the UFS device memory area in a predetermined number of categories with high cluster center values as the area number of the corresponding UFS device memory area to be cached.
[0007] The predetermined analysis target may be file read heat. Therefore, the cache memory area number cached in the cache memory is eliminated in consideration of the file read heat, which improves the utilization rate of cache resources and the cache hit rate compared to the existing elimination algorithm.
[0008] The second subset of attributes may include the number of files in the UFS device memory area, the number of read input output (IO) times of files in the UFS device memory area, and a cache probability estimate of an average file size in the UFS device memory area.
[0009] The buffer memory may be a Universal Flash Storage Host Performance Enhancement (UFS HPB) buffer memory.
[0010] The step of caching the data of the corresponding UFS device memory area to be cached into the buffer memory may include: generating a region prefetch command based on the region number of the corresponding UFS device memory area to be cached and sending the region prefetch command to the UFS device; sending the data to the UFS driver layer based on the region prefetch command; storing the data in the UFS HPB buffer memory. Therefore, the UFS device memory area prefetch work for various workloads can be automatically managed without modifying the application or even the Linux kernel (when using the UFS driver layer including the HPB feature, no modification is required); in addition, when the LBA address interval of the subsequent request happens to fall into the prefetched UFS device memory area, the HPB cache hits, and the user data is directly accessed through the physical address (PPN) in the UFS device memory area information, which greatly shortens the time overhead of obtaining the physical address, thereby improving the read performance and user experience of the UFS device.
[0011] The step of caching the data in the cache memory may include: in a predetermined situation, using the data to eliminate the data cached in the UFS HPB cache memory based on a predetermined elimination algorithm.
[0012] The properties of at least one currently opened file may be periodically obtained.
[0013] According to another exemplary embodiment of the present invention, there is provided a cache management device based on file attributes, comprising: a file monitoring unit, for obtaining attributes of at least one file currently opened; a file attribute analysis unit, for extracting a first attribute subset related to a predetermined analysis target from the attributes of the at least one file; an area determination unit, for determining an area number of a corresponding universal flash storage (UFS) device memory area to be cached based on the first attribute subset; and a cache unit, for storing data of the corresponding UFS device memory area to be cached in a buffer memory based on the area number.
[0014] The attributes of a file may include file attributes and / or file event attributes.
[0015] The area determination unit can also perform the following operations: determine a second attribute subset of the corresponding UFS device memory area based on the first attribute subset; cluster the corresponding UFS device memory area into at least one category based on the second attribute subset; determine the area number of the UFS device memory area in a predetermined number of categories with high cluster center values as the area number of the corresponding UFS device memory area to be cached.
[0016] The predetermined analysis target may be file reading heat.
[0017] The second subset of attributes may include the number of files in the UFS device memory area, the number of read input output (IO) times of files in the UFS device memory area, and a cache probability estimate of an average file size in the UFS device memory area.
[0018] The buffer memory may be a Universal Flash Storage Host Performance Enhancement (UFS HPB) buffer memory.
[0019] The cache unit can also perform the following operations: generate an area prefetch command in the UFS HPB buffer memory based on the area number of the corresponding UFS device memory area to be cached and send the area prefetch command to the UFS device; send the data to the UFS driver layer based on the area prefetch command; and store the data in the UFS HPB buffer memory.
[0020] The cache unit may further perform the following operation: in a predetermined situation, use the data to eliminate the data cached in the UFS HPB buffer memory based on a predetermined elimination algorithm.
[0021] The file monitoring unit may periodically obtain the properties of at least one file currently opened.
[0022] According to another exemplary embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein computer executable instructions are stored in the memory, and when the instructions are executed by the processor, the above method is executed.
[0023] According to another exemplary embodiment of the present invention, a computer-readable medium is provided, on which computer-executable instructions are stored. When the instructions are executed, the above method is performed.
[0024] Additional aspects and / or advantages of the present general inventive concept will be set forth in part in the following description and in part will be obvious from the description, or may be learned through practice of the present general inventive concept. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and other objects and features of the present invention will become more apparent from the following detailed description in conjunction with the accompanying drawings, in which:
[0026] Figure 1 is a flow chart illustrating a cache management method based on file attributes according to an exemplary embodiment of the present invention;
[0027] Figure 2 is a schematic diagram illustrating an access mode according to an exemplary embodiment of the present invention;
[0028] Figure 3 is a schematic diagram illustrating clustering according to an exemplary embodiment of the present invention;
[0029] Figure 4 is a schematic diagram showing a long short-term memory (LSTM) network according to an exemplary embodiment of the present invention;
[0030] Figure 5 is a schematic diagram showing a correspondence relationship between a UFS device memory area and a file according to an exemplary embodiment of the present invention;
[0031] Figure 6 is a block diagram illustrating a cache management device based on file attributes according to an exemplary embodiment of the present invention;
[0032] Figure 7 is a schematic diagram illustrating a cache management device and a buffer memory based on file attributes according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0033] Reference will now be made in detail to embodiments of the present invention, examples of which are shown in the accompanying drawings, wherein like reference numerals refer to like parts throughout. The embodiments will be described below with reference to the drawings in order to explain the present invention.
[0034] In the system composed of the UFS device and the operating system (such as the Linux kernel, etc.) of the prior art, the operating system may include applications, virtual file systems (VFS), raw block I / O, file systems, block layers, and UFS driver layers, etc., wherein the application can access the UFS device in the form of raw data blocks through raw block I / O or can access the UFS device in the form of files through the file system to perform various operations on the files in the UFS device; VFS is an abstract unified interface for managing files for different file systems, and the index node (inode) of the file in the UFS device can be queried through VFS; the block layer is a common module for general devices, which can be used to perform common operations on the UFS device; the UFS driver layer manages the UFS HPB buffer memory through various algorithms. The present invention focuses on improving the algorithm for caching data to the UFS HPB buffer memory, that is, dynamically generating an algorithm strategy for entering the UFS HPB buffer memory by mining data features, which is described in detail below.
[0035] Figure 1 is a flow chart illustrating a cache management method based on file attributes according to an exemplary embodiment of the present invention.
[0036] Reference Figure 1 In step S110, the attributes of at least one currently opened file may be obtained. Here, the attributes of the file may include at least one of the file's own attributes and the file event attributes, and a file attribute table including at least one of the file's own attributes and the file event attributes may be created, and the attributes of at least one currently opened file may be recorded in the file attribute table. In addition, the at least one currently opened file may be monitored and the attributes in the file attribute table may be updated.
[0037] More specifically, each file may correspond to an index node (inode), which stores information related to the file's own attributes, such as the number of bytes of the file, the user ID of the file owner, the group ID of the file, the read, write, and execute permissions of the file, the timestamp of the file (such as ctime, which can indicate the time when the inode was last changed; mtime, which can indicate the time when the file content was last changed; atime, which can indicate the time when the file was last opened), the location of the file data block, etc., but the present invention is not limited to this. The inode of the file in the UFS device can be queried through the VFS in the operating system. In addition, as an example only and not a limitation, the file event attributes may include the following events:
[0038] IN_ACCESS / *The file is accessed* /
[0039] IN_MODIFY / *The file is modified* /
[0040] IN_ATTRIB / *Metadata changes* /
[0041] IN_CLOSE_WRITE / *The writable file is closed* /
[0042] IN_CLOSE_NOWRITE / *Non-writable file is closed* /
[0043] IN_OPEN / *The file is opened* /
[0044] IN_MOVED_FROM / *File moved from...* /
[0045] IN_MOVED_TO / *The file was moved to* /
[0046] IN_CREATE / *Sub-file is created* /
[0047] IN_DELETE / *The sub-file is deleted* /
[0048] IN_DELETE_SELF / *Itself is deleted* /
[0049] IN_MOVE_SELF / *Self is moved* /
[0050] In addition, since the inode number corresponds to the file one by one, the inode number can be used as the ID in the above-mentioned file attribute table. Table 1 shows a file attribute table according to an exemplary embodiment of the present invention. It should be noted that although the file attribute table shown in Table 1 below only includes file event attributes, the present invention is not limited to this.
[0051] [Table 1]
[0052]
[0053]
[0054] In step S120, a first attribute subset related to a predetermined analysis target may be extracted from the attributes of the at least one file. As an example only and not a limitation, the predetermined analysis target may be file read heat, file modification heat, etc., and the first attribute subset may be a subset of the attributes of the at least one file, including attributes such as open, access, modify, close, delete, etc. (as an example only and not a limitation, it may be obtained from the inode using tools provided by the Linux kernel or other methods). Figure 2 is a schematic diagram showing an access mode according to an exemplary embodiment of the present invention, where the first attribute subset may reflect the file access mode, such as Figure 2 shown.
[0055] In step S130 , the region number of the corresponding UFS device memory memory region to be cached may be determined based on the first attribute subset.
[0056] More specifically, the step of determining the area number of the corresponding UFS device memory area to be cached may further include: determining a second attribute subset of the corresponding UFS device memory area based on the first attribute subset, clustering the corresponding UFS device memory area into at least one category based on the second attribute subset, and determining the area number of the UFS device memory area in a predetermined number of categories with high cluster center values as the area number of the corresponding UFS device memory area to be cached. Here, as an example only and not a limitation, the predetermined analysis target may be file read heat, and the clustering step may be performed by using a K-means algorithm. In addition, unlike the first attribute subset for file attributes, the second attribute subset is an attribute for the UFS device memory area, and the above-mentioned step of determining the second attribute subset based on the first attribute subset is actually to convert the file attributes into the attributes of the UFS device memory area storing the file (i.e., the attributes of the files stored in each area of the UFS device memory), and the second attribute subset may include the number of files in the UFS device memory area, the number of read input and output (IO) times of the files in the UFS device memory area, and the cache probability estimate of the average file size in the UFS device memory area. (–avg_file_size) It should be understood that the above examples of the second attribute subset are not limiting, and those skilled in the art may adopt other UFS device memory area attributes, such as opening, accessing, modifying, closing, deleting, etc. of any file in the UFS device memory area, or because for files with the same access frequency, it is more inclined to cache small files, so a cache probability estimation based on the file size in the UFS device memory area may be constructed. (–file_size) etc.
[0057] Figure 3 Schematic diagram showing clustering according to an exemplary embodiment of the present invention. Figure 3 An example of clustering described above is given. Assume that the second attribute subset includes the attributes as described above, namely, the number of files in the UFS device memory area, the number of read input and output (IO) times of files in the UFS device memory area, and the cache probability estimate of the average file size in the UFS device memory area. Thus, the UFS device memory area may have the three attributes as described above. Subsequently, the UFS device memory area is clustered based on these attributes of the UFS device memory area. Assume that Figure 3As shown, four categories are obtained, namely, category 1, category 2, category 3 and category 4 (here, each category may have different limitations on the above three attributes, such as, category 1 may include UFS device memory areas where the number of files in the UFS device memory area is greater than a first predetermined value, the number of read input and output (IO) times of files in the UFS device memory area is greater than a second predetermined value, and the cache probability estimate of the average file size in the UFS device memory area is greater than a third predetermined value). If the cluster center values of a predetermined number of categories (such as category 1 and category 2) are high, the area numbers of the UFS device memory areas in category 1 and category 2 (as shown in the box) may be determined as the area numbers of the corresponding UFS device memory areas to be cached. It should be noted that the number of attributes in the second attribute subset, the predetermined number of categories, etc., as described above are all examples, and those skilled in the art may change them according to actual needs.
[0058] On the other hand, it should be understood that in addition to clustering, various methods may be used to determine the region number of the UFS device memory region with high file read popularity, such as using a prediction method. Figure 4 is a schematic diagram showing an LSTM network according to an exemplary embodiment of the present invention. Figure 4 As shown, the input is a sequence of UFS device memory areas accessed at time T, and the output is a sequence of K UFS device memory areas after time S, that is, the access sequence of the UFS device memory area within a predetermined time window in the past (the element value in the sequence is a three-dimensional vector, such as the number of files in the UFS device memory area, the number of read input and output (IO) times of the files in the UFS device memory area, and the cache probability estimation e of the average file size in the UFS device memory area) is converted into a sequence of K UFS device memory areas after time S. (–avg_file_size) ) is input to the LSTM network according to an exemplary embodiment of the present invention to output a sequence of UFS device memory areas to be accessed within a future predetermined time window, and the area number of the UFS device memory area is used as the area number of the UFS device memory area with high file reading popularity. Therefore, the access sequence of the UFS device memory area in the future time window can be predicted based on the access situation of the historical UFS device memory area.
[0059] return Figure 1 In step S140, the data of the corresponding UFS device memory area to be cached can be cached in a buffer memory based on the area number. Here, the data of the corresponding UFS device memory area to be cached based on the area number can be understood as address information of the UFS device memory area corresponding to the area number. For example, a mapping table of physical addresses and logical addresses of UFS device memory areas.
[0060] More specifically, by way of example only and not limitation, the buffer memory may be a universal flash storage host performance enhancement (UFS HPB) buffer memory. In addition, the step of caching the data of the corresponding UFS device memory area to be cached in the buffer memory may further include: the UFS driver layer generates a region prefetch command in the UFS HPB buffer memory based on the region number of the corresponding UFS device memory area to be cached and sends the region prefetch command to the UFS device; after receiving the prefetch command, the UFS device may send the data to the UFS driver layer based on the region prefetch command; the UFS driver layer may store the data in the UFS HPB buffer memory. In addition, in a predetermined situation (such as when the buffer memory is full or the number of UFS device memory areas cached in the buffer memory reaches an upper limit), the region number of the corresponding UFS device memory area to be cached (which may be in the form of a region list) may be sent to the UFS driver layer, and the UFS driver layer uses the data to eliminate the cached data in the UFS HPB buffer memory based on a predetermined elimination algorithm. Here, by way of example only and not limitation, the predetermined elimination algorithm may be at least one of the least recently used (LRU) and the least frequently used (LFU). In addition, by way of example only and not limitation, the operations performed by the UFS driver layer may be performed by the HPB driver in the UFS driver layer.
[0061] In addition, in the above steps, for example only and not limitation, the area number of the UFS device memory area corresponding to the file can be obtained in the following manner: Table 2 below is a statistical table showing file size distribution such as in the Android system.
[0062] [Table 2]
[0063] File size [0,4k] (4k,32k] (32k,256k] (256k,4M] (4M,32M] (32M,256M] Total quantity 10642 4456 2473 1286 120 27
[0064] As shown in Table 2 above, statistical analysis of file sizes on systems such as Android shows that 99% of file sizes are less than 4M. In addition, the size of the UFS device memory area can store 16M of UFS physical page number (PPN) information, so the UFS device memory area and files are in a many-to-one relationship. Therefore, a correspondence between the file logical block address (LBA) and the UFS device memory area can be established for each open file, and can be maintained periodically. Figure 5 2 is a schematic diagram showing the correspondence between the UFS device memory area and the file according to an exemplary embodiment of the present invention. Figure 5 As shown, for example, the LBA interval corresponding to the UFS device memory region region0 includes two files file1 and file2.
[0065] In addition, since the opened files may change with the use of the user and time, the opened files may be monitored, and the properties of at least one currently opened file may be periodically obtained, or steps S110 to S120 may be repeatedly executed at predetermined intervals.
[0066] Figure 6 is a block diagram illustrating a cache management apparatus based on file attributes according to an exemplary embodiment of the present invention. Figure 7 is a schematic diagram illustrating a cache management device and a buffer memory based on file attributes according to an exemplary embodiment of the present invention.
[0067] Reference Figure 6 , the cache management device based on file attributes according to an exemplary embodiment of the present invention may include a file monitoring unit 610, a file attribute analyzing unit 620, an area determining unit 630, and a cache unit 640.
[0068] The file monitoring unit 610 may obtain the attributes of at least one file currently opened. Here, the file monitoring unit 610 may create the file attribute table as described above and record the information of the opened file in the file attribute table. The file monitoring unit may periodically obtain the attributes of at least one file currently opened.
[0069] The file attribute analysis unit 620 may extract a first attribute subset related to a predetermined analysis target from the attributes of the at least one file. Here, the file attribute analysis unit 620 may maintain the file attribute table as described above.
[0070] The region determination unit 630 may determine the region number of the corresponding UFS device memory region to be cached based on the first attribute subset. More specifically, the region determination unit 630 may further perform the following operations: determine a second attribute subset of the corresponding UFS device memory region based on the first attribute subset, cluster the corresponding UFS device memory region into at least one category based on the second attribute subset, and determine the region number of the UFS device memory region in a predetermined number of categories with high cluster center values as the region number of the corresponding UFS device memory region to be cached.
[0071] The cache unit 640 can cache the data of the corresponding UFS device memory area to be cached into the buffer memory based on the area number. More specifically, the cache unit 640 can perform the following operations: generate an area prefetch command based on the area number of the corresponding UFS device memory area to be cached and send the area prefetch command to the UFS device; send the data to the UFS driver layer based on the area prefetch command; store the data in the UFS HPB buffer memory. In addition, under predetermined circumstances, the cache unit 640 can also use the data to eliminate the cached data in the UFS HPB buffer memory based on a predetermined elimination algorithm. It should be noted that the cache unit 640 can be an optional unit of the cache management device based on file attributes according to an exemplary embodiment of the present invention. As Figure 7 As shown, in the case of a UFS HPB buffer memory, the corresponding functions may be implemented by the UFS driver layer.
[0072] In addition, the cache management device based on file attributes according to the exemplary embodiment of the present invention may further include other units to respectively implement functions corresponding to other steps of the cache management method based on file attributes according to the exemplary embodiment of the present invention. Figure 7 As shown, the file attribute-based cache management device according to an exemplary embodiment of the present invention may also include an LBA-region mapping unit for establishing a correspondence between LBA and a UFS device memory area, a clustering unit for performing clustering, a region distribution unit for sending a UFS device memory area list to a UFS driver layer, etc. The UFS driver layer may generate a region prefetch command in a UFS HPB buffer memory and send the region prefetch command to the UFS device. After receiving the prefetch command, the UFS device may send the required region information to the UFS driver layer, and the UFS driver layer may store the required region information in the UFS HPB buffer memory, which will not be repeated here.
[0073] In addition, according to an exemplary embodiment of the present invention, an electronic device may be provided, including a memory and a processor, wherein a computer executable instruction is stored on the memory, and when the instruction is executed by the processor, the aforementioned method is executed. According to an exemplary embodiment of the present invention, a computer readable medium may be provided, wherein a computer executable instruction is stored on the medium, and when the instruction is executed, the aforementioned method is executed.
[0074] According to an exemplary embodiment of the present invention, when the LBA address interval of a subsequent request happens to fall into the pre-fetched UFS device memory area, the HPB cache hits, and the user data is directly accessed through the physical address (PPN) in the UFS device memory area information, which greatly shortens the time overhead of obtaining the physical address, thereby improving the read performance and user experience of the UFS device; without modifying the application or even the Linux kernel (when using the UFS driver layer including the HPB feature, no changes are required), the pre-fetching of the UFS device memory area for various workloads is automatically managed; automatic recognition of dynamic file access modes and automatic UFS device memory area management under variable loads can be achieved; the access sequence of the UFS device memory area in the future time window can be predicted based on the historical access situation of the UFS device memory area; and it has good adaptability to a variety of workloads.
[0075] While the invention has been shown and described with reference to the particular exemplary embodiments, it will be understood by those skilled in the art that various changes in form and details may be made without departing from the spirit and scope of the invention as defined by the claims and their equivalents.
Claims
1. A cache management method based on file attributes, include: Get the properties of at least one file currently opened; extracting a first subset of attributes related to a predetermined analysis target from the attributes of the at least one file; Determine the region number of the corresponding universal flash storage (UFS) device memory region to be cached based on the first attribute subset; caching the data of the corresponding to-be-cached UFS device memory area into a buffer memory based on the area number, The step of determining the area number of the corresponding UFS device memory area to be cached includes: determining a second subset of attributes for a corresponding UFS device memory region based on the first subset of attributes; clustering the corresponding UFS device memory regions into at least one category based on a second subset of attributes; The area numbers of the UFS device memory areas in a predetermined number of categories with high cluster center values are determined as the area numbers of the corresponding UFS device memory areas to be cached.
2. The cache management method based on file attributes as claimed in claim 1, in, The attributes of a file include the file's own attributes and / or file event attributes.
3. The cache management method based on file attributes as claimed in claim 1, in, The predetermined analysis target is file reading heat.
4. The cache management method based on file attributes according to claim 1, in, The second attribute subset includes the number of files in the UFS device memory area, the number of read input and output (IO) times of files in the UFS device memory area, and a cache probability estimate of an average file size in the UFS device memory area.
5. The cache management method based on file attributes as claimed in claim 1, in, The buffer memory is a Universal Flash Storage Host Performance Enhancement UFSHPB buffer memory.
6. The cache management method based on file attributes as claimed in claim 5, in, The step of caching the data of the corresponding UFS device memory area to be cached into the buffer memory comprises: generating a region prefetch command based on the region number of the corresponding UFS device memory region to be cached and sending the region prefetch command to the UFS device; Sending the data to the UFS driver layer based on the region prefetch command; The data is stored in the UFS HPB buffer memory.
7. The cache management method based on file attributes as claimed in claim 6, in, The step of caching the data in the buffer memory includes: in a predetermined situation, using the data to eliminate the data cached in the UFSHPB buffer memory based on a predetermined elimination algorithm.
8. The cache management method based on file attributes according to claim 1, in, Periodically gets the properties of at least one currently opened file.
9. A cache management device based on file attributes, include: A file monitoring unit, used to obtain the properties of at least one file currently opened; A file attribute analysis unit, configured to extract a first attribute subset related to a predetermined analysis target from the attributes of the at least one file; A region determining unit, configured to determine a region number of a corresponding universal flash storage UFS device memory region to be cached based on the first attribute subset; a cache unit, which caches the data of the corresponding UFS device memory area to be cached into a buffer memory based on the area number, The region determination unit further performs the following operations: determining a second subset of attributes for a corresponding UFS device memory region based on the first subset of attributes; clustering the corresponding UFS device memory regions into at least one category based on a second subset of attributes; The area numbers of the UFS device memory areas in a predetermined number of categories with high cluster center values are determined as the area numbers of the corresponding UFS device memory areas to be cached.
10. The cache management device based on file attributes according to claim 9, in, The attributes of a file include the file's own attributes and / or file event attributes.
11. The cache management device based on file attributes according to claim 9, in, The predetermined analysis target is file reading heat.
12. The cache management device based on file attributes according to claim 9, in, The second attribute subset includes the number of files in the UFS device memory area, the number of read input and output (IO) times of files in the UFS device memory area, and a cache probability estimate of an average file size in the UFS device memory area.
13. The cache management device based on file attributes according to claim 9, in, The buffer memory is a Universal Flash Storage Host Performance Enhancement UFSHPB buffer memory.
14. The cache management device based on file attributes according to claim 13, in, The cache unit also performs the following operations: generating a region prefetch command based on the region number of the corresponding UFS device memory region to be cached and sending the region prefetch command to the UFS device; Sending the data to the UFS driver layer based on the region prefetch command; The data is stored in the UFS HPB buffer memory.
15. The cache management method based on file attributes according to claim 14, in, The cache unit also performs the following operations: In predetermined situations, the data is used to eliminate data cached in the UFSHPB buffer memory based on a predetermined elimination algorithm.
16. The cache management device based on file attributes according to claim 9, in, The file monitoring unit periodically obtains the attributes of at least one file currently opened.
17. An electronic device comprising a memory and a processor, wherein the memory stores computer executable instructions, and when the instructions are executed by the processor, the method according to any one of claims 1 to 8 is executed.
18. A computer-readable medium having computer-executable instructions stored thereon, wherein when the instructions are executed, the method according to any one of claims 1 to 8 is executed.
