Directory popularity query method, system, device, equipment, medium and program product
By storing popularity data in a directory hierarchy in the metadata database, the system can quickly respond to directory popularity query requests, solving the problem of low query efficiency caused by the increase in directory hierarchy depth and achieving efficient directory popularity query.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, as the number of subfiles and subdirectories in a storage system increases, the directory hierarchy depth increases, resulting in excessively long directory hot search times and low search efficiency.
By storing popularity data information in a directory hierarchy in the metadata database, it can directly retrieve and sort the data in response to query requests, avoiding traversing files at each level of the directory. It also utilizes multiple consecutive time windows to store popularity data and flexibly determines the target time window to achieve fast querying.
It improves the efficiency of directory popularity queries, saves query time, avoids system resource consumption, and ensures the accuracy and completeness of query results.
Smart Images

Figure CN121658698A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of document management technology, and in particular to a method, system, apparatus, device, medium, and program product for catalog popularity query. Background Technology
[0002] In storage systems, directory popularity refers to the quantitative information on the frequency of access to files or subdirectories within a directory. The popularity information of each directory is an important basis for data tier management in storage systems.
[0003] In related technologies, when calculating the popularity information of a directory, the process typically involves traversing the directory hierarchy downwards within a query period until the lowest-level subdirectories are reached, and then summarizing the popularity information of all subdirectories at all levels to obtain the directory's popularity statistics. However, as the number of subfiles and subdirectories in the storage system increases, the directory hierarchy becomes deeper, and the query time for directory popularity in related technologies becomes longer, resulting in low query efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide a directory popularity query method, system, device, equipment, medium, and program product to address the above-mentioned technical problems and improve the efficiency of directory popularity query.
[0005] Firstly, this application provides a directory popularity query method, applied to a client corresponding to a storage system, the method comprising:
[0006] In response to a directory popularity query request triggered by the system management terminal of the storage system, obtain the directory's identification information and the time period to be queried;
[0007] Based on the directory's identification information, the popularity data information of the directory within the time period to be queried is determined from the metadata database of the storage system; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory.
[0008] Sort the popularity data of the directory within the time period to be queried, and send the sorting results to the system management terminal.
[0009] The directory popularity query method provided in this application embodiment responds to a directory popularity query request triggered by the system management terminal of the storage system by obtaining the directory's identification information and the query time period; based on the directory's identification information, it determines the directory's popularity data information within the query time period from the storage system's metadata database; it sorts the directory's popularity data information within the query time period and sends the sorting result to the system management terminal. The metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory. In this method, since the metadata database pre-stores the popularity data information of all levels corresponding to each directory, in actual directory popularity query scenarios, the client can directly query the directory's popularity data information within the query time period from the metadata database, without traversing all levels of files under the directory, saving popularity query time. Furthermore, it quickly sorts the queried information and uses the sorting result as the target popularity query response, rapidly responding to the target's popularity query request and improving the efficiency of directory popularity queries.
[0010] In one embodiment, the metadata database stores directory popularity data information within multiple consecutive time windows; determining directory popularity data information for the query time period from the metadata database of the storage system includes:
[0011] Determine the target time window from multiple consecutive time windows based on the time period to be queried;
[0012] Based on the popularity data within the target time window, determine the popularity data of the directory within the time period to be queried.
[0013] The directory popularity query method provided in this application embodiment, based on the metadata database storing directory popularity data information within multiple consecutive time windows, can support flexibly determining the target time window from multiple consecutive time windows according to the time period to be queried, without traversing the entire historical data. This facilitates quickly determining the directory popularity data information within the time period to be queried based on the popularity data information within the target time window, thereby improving the efficiency of popularity data information query while avoiding the system resource consumption caused by global data query.
[0014] In one embodiment, a target time window is determined from multiple consecutive time windows based on the time period to be queried, including:
[0015] If the time period to be queried is shorter than the time period of a single time window, the single time window that matches the time period to be queried will be determined as the target time window.
[0016] If the time period to be queried is longer than the time period of a single time window, multiple time windows that match the time period to be queried will be determined as the target time window.
[0017] In the directory popularity query method provided in this application embodiment, the duration of the time period to be queried is compared with the duration of a single time window. If the time period to be queried is shorter than the duration of a single time window, the single time window that matches the time period to be queried is determined as the target time window to ensure the accuracy of single-window matching in short-term scenarios. If the time period to be queried is longer than the duration of a single time window, multiple time windows that match the time period to be queried are determined as the target time window to ensure the completeness of multi-window matching in long-term scenarios.
[0018] In one embodiment, based on the popularity data information within the target time window, the directory popularity data information for the time period to be queried is determined, including:
[0019] Get the percentage of the time period to be queried within the target time window;
[0020] Based on the time ratio, the popularity data information within the target time window is divided to obtain the directory popularity data information within the time period to be queried.
[0021] The directory popularity query method provided in this application embodiment splits and quantifies the popularity data information within the target time window based on the time proportion of the time period to be queried within the target time window. It is applicable to scenarios where the time period to be queried and the target time window do not completely overlap, such as scenarios where a single window partially covers the area, and accurately calculates the popularity data information of the time period to be queried.
[0022] In one embodiment, the method further includes:
[0023] In response to a file access request, access the file and simultaneously recursively update the access popularity of the file's parent directory.
[0024] At preset time intervals, the access popularity of the parent directory is sent to the metadata manager. This instructs the manager to record the access popularity of the parent directory in the real-time statistical time window if the time interval between the current time and the previous update time is within a single statistical time window. If the time interval exceeds a single statistical time window, the access popularity information of the parent directory in the real-time statistical time window is moved to the historical statistical time window adjacent to the real-time statistical time window, and the access popularity of the parent directory is recorded in the real-time statistical time window.
[0025] The directory popularity query method provided in this application realizes the real-time transmission of file access popularity to parent directories at all levels through a real-time recursive update mechanism triggered by file access requests, ensuring dynamic synchronization between directory popularity and actual file access behavior. At the same time, directory access popularity is reported in batches at preset time intervals, and the metadata manager intelligently executes real-time window recording or historical window migration and real-time window recording based on the matching relationship between the reporting time interval and a single statistical time window. This avoids the system overhead caused by frequent data reporting in high-frequency access scenarios and ensures the continuity and integrity of popularity data within multiple statistical time windows.
[0026] In one embodiment, the method further includes, prior to responding to a file access request:
[0027] In response to the popularity configuration information triggered by the system management terminal, obtain the set of files in the storage system with popularity statistics enabled;
[0028] Correspondingly, the access frequency of the parent directory of the file is updated synchronously and recursively upwards, including:
[0029] If a file is in a file set, determine the parent directory corresponding to the file and synchronously recursively update the access popularity of the parent directory of the file upwards.
[0030] In the directory popularity query method provided in this application embodiment, in response to the popularity configuration information triggered on the system management terminal, the set of files with popularity statistics enabled in the storage system is obtained. If the file is in the file set, the parent directory corresponding to the file is determined, and the access popularity of the parent directory of the file is updated recursively upwards. This realizes automatic transmission and real-time synchronization of file popularity to directory popularity at all levels, and also avoids invalid calculations for files and directories without popularity statistics enabled, thereby reducing redundant consumption of system resources.
[0031] Secondly, this application also provides a directory popularity query method, applied to the system management terminal of a storage system, the method comprising:
[0032] A directory popularity query request is sent to the client corresponding to the storage system to instruct the client to determine the directory's popularity data information within the query time period from the storage system's metadata database based on the directory's identification information, and to sort the directory's popularity data information within the query time period; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory.
[0033] Receive the sorting results sent by the client.
[0034] The directory popularity query method provided in this application sends a directory popularity query request to the client corresponding to the storage system. This instructs the client to determine the directory's popularity data information within the query time period from the storage system's metadata database based on the directory's identifier information, and to sort the directory's popularity data information within the query time period. The method then receives the sorting result sent by the client. The metadata database stores the popularity data information of all levels corresponding to each directory according to its hierarchical structure. Because the metadata database pre-stores the popularity data information of all levels corresponding to each directory, in actual directory popularity query scenarios, the client can directly query the directory's popularity data information within the query time period from the metadata database, without traversing all levels of files under the directory, saving query time. Furthermore, the method quickly sorts the queried information and uses the sorting result as the target popularity query response, rapidly responding to the target's popularity query request and improving the efficiency of directory popularity queries.
[0035] In one embodiment, the method further includes:
[0036] Obtain the storage system's popularity configuration information; the popularity configuration information includes file popularity statistics identifier, number of statistical time windows, and statistical time window period;
[0037] Broadcasts the popularity configuration information to clients and the metadata database manager.
[0038] The directory popularity query method provided in this application broadcasts popularity configuration information to the client and the metadata database manager, achieving global standardization and consistent synchronization of popularity statistics rules in the storage system. Specifically, the file popularity statistics identifier clarifies the statistical scope, avoiding resource waste caused by irrelevant files participating in the statistics. The number and period of the statistical time window provide the metadata database manager with a unified specification for the granularity and dimension of popularity data storage.
[0039] Thirdly, this application also provides a directory popularity query system, which includes a server and a client, with a system management terminal and a metadata database deployed on the server;
[0040] A client, configured to implement the steps of the method in any of the embodiments of the first aspect described above;
[0041] A server for implementing the steps of the method in any of the embodiments of the second aspect described above.
[0042] Fourthly, this application also provides a catalog popularity query device, including:
[0043] The query response module is used to respond to directory popularity query requests triggered by the system management terminal of the storage system, and to obtain the directory's identification information and the time period to be queried;
[0044] The popularity acquisition module is used to determine the popularity data information of a directory within the time period to be queried from the metadata database of the storage system based on the directory's identification information; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory.
[0045] The popularity sorting module is used to sort the popularity data of the directory within the time period to be queried, and send the sorting results to the system management terminal.
[0046] Fifthly, this application also provides a catalog popularity query device, including:
[0047] The request sending module is used to send a directory popularity query request to the client corresponding to the storage system, instructing the client to determine the directory's popularity data information within the query time period from the storage system's metadata database based on the directory's identification information, and to sort the directory's popularity data information within the query time period; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory.
[0048] The sorting result receiving module is used to receive the sorting results sent by the client.
[0049] In a sixth aspect, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method in any of the embodiments of the first or second aspect described above.
[0050] In a seventh aspect, this application also provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method in any of the embodiments of the first or second aspect described above.
[0051] Eighthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method in any of the embodiments of the first or second aspect described above.
[0052] The aforementioned directory popularity query method, system, device, equipment, medium, and program product, in response to a directory popularity query request triggered at the system management end of the storage system, obtains the directory's identification information and the time period to be queried; based on the directory's identification information, it determines the directory's popularity data information within the time period from the storage system's metadata database; it sorts the directory's popularity data information within the time period and sends the sorting result to the system management end. The metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory. In this method, because the metadata database pre-stores the popularity data information of all levels corresponding to each directory, in actual directory popularity query scenarios, the client can directly query the directory's popularity data information within the time period from the metadata database, given a defined target and time period, without traversing all levels of files under the directory, saving popularity query time. Furthermore, it quickly sorts the queried information and uses the sorting result as the target popularity query response, rapidly responding to the target's popularity query request and improving the efficiency of directory popularity queries. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a diagram illustrating the application environment of the directory popularity query method in one embodiment;
[0055] Figure 2 This is a flowchart illustrating a directory popularity query method in one embodiment;
[0056] Figure 3 This is a flowchart illustrating the steps for querying popularity data information in one embodiment;
[0057] Figure 4 This is a schematic diagram of the structure of directory metadata information in one embodiment;
[0058] Figure 5 This is a flowchart illustrating the steps for determining the target time window in one embodiment;
[0059] Figure 6 This is a flowchart illustrating the heat data information query steps in another embodiment;
[0060] Figure 7 This is a flowchart illustrating the directory popularity query method in another embodiment;
[0061] Figure 8 This is a schematic diagram of the structure of directory metadata information in another embodiment;
[0062] Figure 9 This is a schematic diagram of the structure of directory metadata information in another embodiment;
[0063] Figure 10 This is a schematic diagram of the structure of directory metadata information in another embodiment;
[0064] Figure 11 This is a flowchart illustrating the steps of broadcasting popularity configuration information in one embodiment;
[0065] Figure 12 This is a flowchart illustrating the file access, popularity statistics, and popularity query methods in one embodiment;
[0066] Figure 13 This is a flowchart illustrating the interaction of the directory popularity query method in another embodiment;
[0067] Figure 14 This is a structural block diagram of a directory popularity query device in one embodiment;
[0068] Figure 15 This is a structural block diagram of the directory popularity query device in another embodiment;
[0069] Figure 16 This is an internal structural diagram of a computer device in one embodiment;
[0070] Figure 17 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation
[0071] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0072] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0073] In storage systems, directory popularity refers to the quantitative information on the frequency of access to files or subdirectories within a directory. The popularity information of each directory is an important basis for data tier management in storage systems.
[0074] In related technologies, when performing popularity statistics on file read / write access, it refers to recording the number of read / write accesses to a file within a certain period. When querying directory popularity statistics, it's necessary to traverse and collect the popularity information of all subfiles and subdirectories within the directory during the query period to obtain the directory popularity statistics. Thus, each directory popularity statistics query requires traversing a large number of subfiles and subdirectories, and also traversing the popularity statistics for each file within the query period. This method is inefficient and time-consuming; the more subdirectories / subfiles there are, and the greater the subdirectory depth, the longer the query takes, resulting in low efficiency for querying directory popularity statistics.
[0075] Based on this, embodiments of this application provide a directory popularity query method, system, apparatus, device, medium, and program product. In response to a directory popularity query request triggered at the system management terminal of a storage system, the method obtains the directory's identification information and the time period to be queried; based on the directory's identification information, it determines the directory's popularity data information within the time period to be queried from the storage system's metadata database; it sorts the directory's popularity data information within the time period to be queried and sends the sorting result to the system management terminal. The metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory. This allows the client to directly query the directory's popularity data information within the time period to be queried from the metadata database, given a specific target and time period, without traversing all levels of files under the directory, saving query time and improving directory popularity query efficiency.
[0076] The directory popularity query method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, client 102 communicates with server 104 via a network. A metadata database can store data that server 104 needs to process. The metadata database can be integrated onto server 104 or located on the cloud or other network servers. Client 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0077] In one exemplary embodiment, such as Figure 2 As shown, a directory popularity query method is provided, which is applied to the client of the storage system, and includes the following steps:
[0078] S201, in response to a directory popularity query request triggered by the system management terminal of the storage system, obtains the directory's identification information and the time period to be queried.
[0079] A storage system can include multiple directories, and each directory can contain multiple levels of subdirectories and files. Directory popularity refers to the quantitative information on the frequency of access to files or subdirectories within a directory, such as the sum of the number of times all files in the directory are accessed within a certain period.
[0080] The client acts as a bridge connecting user operations and backend storage resources. In this embodiment, users can access files in the storage system through the client; the client also communicates with the system management terminal to receive user instructions received on the system management terminal and then convert these instructions into requests that the storage system can recognize.
[0081] The system management terminal refers to the platform through which users manage data within the storage system. In this embodiment, users can configure metadata for stored data in the storage system through the system management terminal, and users can also query the popularity information of various directories in the storage system through the system management terminal.
[0082] In practical applications, based on the command operation sequence, the communication interaction between the client and the system management terminal can be divided into the following three stages: ① Popularity Configuration Stage. The system management terminal receives the configuration request triggered by the user and broadcasts it to the client to indicate whether the file data in the storage system needs to be statistically analyzed for popularity. ② File Access Stage. The client receives the user's file access request, performs popularity statistics on the files based on the configuration information in stage ①, and records the data in the metadata database in real time or periodically. ③ Directory Popularity Access Stage. The system management terminal receives the directory popularity query request triggered by the user and sends it to the client. The client retrieves the directory popularity query results from the metadata database in stage ② and returns them to the user through the system management terminal.
[0083] The directory popularity query request carries the identification information of the directory to be queried and the time period to be queried. The identification information is used to uniquely identify the directory's identity in the storage system and can be a directory ID. Based on this, when the client receives a directory popularity query request, it directly reads the request to obtain the time period to be queried and the identification information of the directory to be queried.
[0084] S202, Based on the directory's identification information, determine the directory's popularity data information within the query time period from the storage system's metadata database.
[0085] Metadatabase stores the popularity data of all levels corresponding to each directory according to the hierarchical structure of each directory.
[0086] If the metadata database stores the hierarchical structure of each directory, and according to this hierarchical structure, it stores the popularity data information of each directory's hierarchy, then the client can query the popularity data information matching the target's identifier from the metadata database. For example, the client sends the identifier information and the time period to be queried to the metadata database manager, instructing the metadata database manager to return the popularity data information of the directory within the time period to the client.
[0087] Optionally, the metadata database stores popularity data for directory a, directory a1, and directory a2, and also stores hierarchical information for directory a, including directories a1 and a2. Then, the client can directly send the identifier information of directory a and the query time period to the manager in the metadata database, instructing the manager to return the popularity data for directory a, directory a1, and directory a2 within the query time period to the client.
[0088] In another scenario, the metadata database independently stores the popularity data of directories at each level. In this case, the client stores the directory hierarchy. Continuing with the example of the metadata database storing popularity data for directory a, directory a1, and directory a2, the client, based on the identifier of directory a, traverses the subdirectories under directory a, determining that directory a includes directories a1 and a2. Then, the client sequentially sends the identifier of directory a and the query time period, the identifier of directory a1 and the query time period, and the identifier of directory a2 and the query time period to the metadata database manager. The client then receives the popularity data for directory a, directory a1, and directory a2 within the query time period from the metadata database, respectively.
[0089] S203 sorts the popularity data of the directory within the time period to be queried and sends the sorting results to the system management terminal.
[0090] It should be noted that the popularity data of a directory within the query period includes the popularity data of the directory itself, as well as the popularity data of its subdirectories at each level. Based on this, the popularity data of the directory and its subdirectories within the query period can be sorted in descending or ascending order to obtain a directory list, which serves as the sorting result (the directory popularity query response) and is returned to the system management terminal.
[0091] In this embodiment, in response to a directory popularity query request triggered by the system management terminal of the storage system, the system obtains the directory's identification information and the query time period. Based on the directory's identification information, it determines the directory's popularity data information within the query time period from the storage system's metadata database. The system then sorts the directory's popularity data information within the query time period and sends the sorting result to the system management terminal. The metadata database stores the popularity data information for all levels corresponding to each directory according to its hierarchical structure. Because the metadata database pre-stores the popularity data information for all levels corresponding to each directory, in actual directory popularity query scenarios, the client can directly query the directory's popularity data information within the query time period from the metadata database, without traversing all levels of files under the directory, saving query time. Furthermore, it quickly sorts the queried information and uses the sorting result as the target popularity query response, rapidly responding to the target's popularity query request and improving the efficiency of directory popularity queries.
[0092] It should be noted that regardless of whether the popularity data is stored in a directory hierarchy in the metadata database, the popularity data for each directory is stored in a structure of multiple time windows. Next, we will explain one possible method for obtaining popularity data by taking a client querying the popularity data of a single directory as an example.
[0093] In one exemplary embodiment, such as Figure 3 As shown, the metadata database stores directory popularity data information within multiple consecutive time windows; the directory popularity data information for the query time period is determined from the metadata database of the storage system, including:
[0094] S301, determine the target time window from multiple consecutive time windows based on the time period to be queried.
[0095] In the metadata database, the metadata structure of each directory includes multiple consecutive time windows, and each time window corresponds to a popularity data point. Please see [link / reference]. Figure 4 , Figure 4 This is a schematic diagram of the metadata structure of a single directory in a metadata database. Figure 4 The data includes eight time windows, from window 1 to window 8, corresponding to eight popularity data points, from count1 to count8. Furthermore, Figure 4 Each time window in the timeframe corresponds to a time period, and adjacent time windows are consecutive.
[0096] The time period to be queried includes the query start time and the query end time. The query start time and the query end time are matched with the time periods of each time window to determine the time window in which the query start time is located (start time window) and the time window in which the query end time is located (end time window). Then, the continuous time window between the start time window and the end time window is determined as the target time window.
[0097] S302, Based on the popularity data information within the target time window, determine the directory popularity data information within the time period to be queried.
[0098] The popularity data within the target time window is summarized to obtain the directory popularity data within the time period to be queried.
[0099] In this embodiment, based on the popularity data information of the directory stored in the metadata database within multiple consecutive time windows, it can support the flexible determination of the target time window from multiple consecutive time windows according to the time period to be queried, without having to traverse the entire historical data. This allows for the rapid determination of the directory popularity data information within the time period to be queried based on the popularity data information within the target time window, thereby improving the efficiency of popularity data information query while avoiding the system resource consumption caused by global data query.
[0100] In practical applications, the time period to be queried can be customized based on user needs. In this case, the time period to be queried can be exactly the duration of a single time window, or it can be a period longer or shorter than a single time window. Based on this, the following example illustrates the steps for determining the target time window when the time period to be queried does not match the duration of a single time window.
[0101] In one exemplary embodiment, such as Figure 5 As shown, the target time window is determined from multiple consecutive time windows based on the time period to be queried, including:
[0102] S501, if the time period to be queried is shorter than the time period of a single time window, the single time window that matches the time period to be queried is determined as the target time window.
[0103] Optionally, if the time period to be queried is less than the time period of a single time window, the query start time and query end time of the time period to be queried may fall within the same time window. In this case, the time window that includes the query start time and query end time of the time period to be queried is determined as the target time window.
[0104] Optionally, if the query start time and query end time of the query period correspond to two adjacent time windows, then the time window corresponding to the query start time and the time window corresponding to the query end time are determined as the target time window.
[0105] S502, if the time period to be queried is longer than the time period of a single time window, all time windows that match the time period to be queried will be determined as the target time window.
[0106] If the time period to be queried is longer than a single time window, it means that the query start time and query end time of the time period to be queried are in two different time windows. In this case, the multiple time windows between the time window corresponding to the query start time and the time window corresponding to the query end time are determined as the target time window.
[0107] In this embodiment, the duration of the time period to be queried is compared with that of a single time window. If the time period to be queried is shorter than the duration of a single time window, the single time window that matches the time period to be queried is determined as the target time window to ensure the accuracy of single-window matching in short-term scenarios. If the time period to be queried is longer than the duration of a single time window, multiple time windows that match the time period to be queried are determined as the target time windows to ensure the completeness of multi-window matching in long-term scenarios.
[0108] In one exemplary embodiment, such as Figure 6 As shown, based on the popularity data information within the target time window, the popularity data information of the directory within the time period to be queried is determined, including:
[0109] S601, obtain the proportion of the time period to be queried within the target time window.
[0110] When the query period falls within a single target time window, the ratio between the duration of the query period and the duration of the target time window is calculated to determine the time proportion. For example, if the target time window is 1-10 seconds, the time proportion within the target time window is 50% if the query period is 5-10 seconds, and 60% if the query period is 6-10 seconds.
[0111] S602, divide the popularity data information within the target time window based on the time ratio to obtain the directory popularity data information within the time period to be queried.
[0112] The popularity data within the target time window is multiplied by the time ratio to obtain the directory popularity data within the time period to be queried.
[0113] Using popularity data as the number of visits, the popularity data for the target time window is 50 visits. If the time period to be queried is 60% of the time in the target time window, then the directory popularity data for the directory in the time period to be queried is 30 visits (50 × 60%).
[0114] In this embodiment, the popularity data information within the target time window is split and quantified based on the time proportion of the time period to be queried within the target time window. This is applicable to scenarios where the time period to be queried and the target time window do not completely overlap, such as scenarios where a single window partially covers the target time window, and accurately calculates the popularity data information of the time period to be queried.
[0115] The foregoing embodiments have described the steps for the client to query directory popularity information. Next, the method by which the client records directory popularity information will be described.
[0116] In one exemplary embodiment, such as Figure 7 As shown, the method also includes:
[0117] S701 responds to a file access request, accesses the file, and simultaneously recursively updates the access popularity of the file's parent directory.
[0118] It should be noted that the storage unit in the storage system is a file, and each file belongs to a different directory. For example, directory 'a' includes two parallel levels: directory a1 and directory a2; directory a1 includes file 1 and file 2; directory a2 includes file 3 and file 4. For a single file, a file access request can be a file read request or a file write request.
[0119] In response to an access request (read request or write request) for a file, the file is accessed (read or write), and the directories at each level to which the file belongs are determined, and the access frequency of the file's parent directories is updated recursively upwards.
[0120] Continuing with the example of directory a containing two parallel levels: directory a1 and directory a2; directory a1 containing file 1 and file 2; and directory a2 containing file 3 and file 4, in response to an access request for file 1, file 1 is accessed. Since file 1 is a file in directory a1, and directory a1 is a subdirectory of directory a, directory a1 and directory a are parent directories corresponding to different levels of file 1. Therefore, the access popularity of directory a1 and the access popularity of directory a need to be increased by 1.
[0121] In practical applications, while synchronously and recursively updating the access popularity of the file's parent directory, the file access results are returned to the user.
[0122] S702, according to a preset time interval, the access popularity of the parent directory is sent to the metadata database manager, so as to instruct the manager to record the access popularity of the parent directory in the real-time statistical time window if the time interval between the current time and the previous update time is within a single statistical time window, and if the time interval exceeds a single statistical time window, the popularity information of the real-time statistical time window corresponding to the parent directory is moved to the historical statistical time window adjacent to the real-time statistical time window, and the access popularity of the parent directory is recorded in the real-time statistical time window.
[0123] The client sends the access popularity of the parent directory to the metadata database manager at preset time intervals to instruct the metadata database manager to update the access popularity of the parent directory, thus ensuring the timeliness of the access popularity data information in the metadata database.
[0124] For any parent directory, the metadata manager obtains the time interval between the current time and the previous update time, and compares it with the duration of a single statistical time window in the multiple statistical time windows corresponding to the parent directory. If the time interval is less than a single statistical time window, the access popularity of the parent directory is added to the real-time statistical time window corresponding to the parent directory. If the time interval is greater than a single statistical time window, the popularity information of the real-time statistical time window of the parent directory is moved to the historical statistical time window adjacent to the real-time statistical time window, and the popularity data of the historical statistical time window is moved to the adjacent historical statistical time window in sequence. The popularity data of the earliest historical time window is discarded, and the popularity data within the most recent period range is retained.
[0125] Please see Figure 8 , Figure 8 This is a diagram illustrating the data structure of a directory's popularity metrics. Figure 8 The granularity of the eight time windows is one day each, with window 1 being the real-time statistical time window and windows 2-8 being the historical statistical time windows. Taking this example, from right to left, the time periods corresponding to the eight windows are day 1, day 2, day 3, day 4, day 5, day 6, day 7, and day 8; the corresponding popularity data are 100, 90, 80, 70, 60, 50, 40, and 30 respectively. For instance, if the time interval is less than one day, it means the access count of the parent directory can be attributed to window 1. Therefore, the access count of the parent directory is superimposed with the popularity data corresponding to window 1 to obtain the updated popularity data for window 1. Figure 9 This is a schematic diagram of the updated directory popularity data structure; if the time interval exceeds one day, the popularity data of window 8 is discarded, and the popularity data of windows 1-7 are moved sequentially to the adjacent historical statistics time windows. The access count of the parent directory is recorded in window 1. Figure 10 This is a schematic diagram of the updated directory's popularity data structure.
[0126] In this embodiment, a real-time recursive update mechanism triggered by file access requests enables the instant transmission of file access popularity to parent directories at all levels, ensuring dynamic synchronization between directory popularity and actual file access behavior. Simultaneously, directory access popularity is reported in batches at preset time intervals, and the metadata manager intelligently executes real-time window recording or historical window migration based on the matching relationship between the reporting time interval and a single statistical time window. This avoids the system overhead caused by frequent data reporting in high-frequency access scenarios and ensures the continuity and integrity of popularity data within multiple statistical time windows.
[0127] Considering the large number of files in a storage system during real-world applications, to reduce the resources required for directory popularity statistics, popularity statistics permissions can be selectively granted to certain files in the storage system. In an exemplary embodiment, before responding to a file access request, the method further includes:
[0128] In response to the popularity configuration information triggered on the system management terminal, obtain the set of files in the storage system with popularity statistics enabled.
[0129] Correspondingly, the access frequency of the parent directory of the file is updated synchronously and recursively upwards, including:
[0130] If a file is in a file set, determine the parent directory corresponding to the file and synchronously recursively update the access popularity of the parent directory of the file upwards.
[0131] The popularity configuration information includes file popularity statistics identifiers and popularity data structure information. The file popularity statistics identifiers are used to characterize the files in the storage system that need to be popularized, and the popularity data structure information is used to indicate the number of time windows and the granularity of a single time window for each directory in the metadata database.
[0132] The client retrieves the files in the storage system that require popularity statistics based on the popularity configuration information sent by the system management terminal, and summarizes the identifiers of these files to obtain a file set. Thus, when the client responds to a file access request, it can determine whether the file needs popularity statistics based on the matching result between the file's identifier information and the identifier information in the file set: if the file's identifier information is not in the file set, it is determined that the file does not need popularity statistics; if the file's identifier information is in the file set, it is determined that the file needs popularity statistics, and the client executes the step of synchronously and recursively updating the access popularity of the file's parent directory.
[0133] In this embodiment, in response to the popularity configuration information triggered on the system management terminal, the set of files with popularity statistics enabled in the storage system is obtained. If the file is in the set of files, the parent directory corresponding to the file is determined, and the access popularity of the parent directory of the file is updated recursively upwards. This realizes automatic transmission and real-time synchronization of file popularity to directory popularity at all levels, while also avoiding invalid calculations for files and directories without popularity statistics enabled, thus reducing redundant consumption of system resources.
[0134] The above describes embodiments with the client as the execution subject. Based on this, this application also provides embodiments corresponding to the above process with the system management end as the execution subject. Since all the implementation principles, detailed processes, and achievable technical effects of the embodiments with the system management end as the execution subject are the same as those of the embodiments with the client as the execution subject, for the sake of brevity and clarity, the following embodiments will not be described in detail. The implementation process and effects of each embodiment can be found in the descriptions of the foregoing embodiments.
[0135] In one exemplary embodiment, such as Figure 11 As shown, a directory popularity query method is provided, which is applied to the system management terminal of a storage system, including the following steps:
[0136] S1101, a directory popularity query request is sent to the client corresponding to the storage system to instruct the client to determine the directory popularity data information within the query time period from the metadata database of the storage system based on the directory's identification information, and to sort the directory popularity data information within the query time period.
[0137] Metadatabase stores the popularity data of all levels corresponding to each directory according to the hierarchical structure of each directory.
[0138] In response to a user-triggered directory popularity query request, the system management terminal forwards the request to the client. The client is instructed to determine the directory's identifier and the time period to be queried, and then retrieve the directory's popularity statistics for that time period from the metadata database. Furthermore, if the directory to be queried comprises multiple levels of subdirectories, the client is instructed to sort the popularity data of the directory and its subdirectories as the query response result.
[0139] S1102, Receive the sorting result sent by the client.
[0140] The sorting result refers to the list of directories obtained by the client based on the popularity data of the directory and its subdirectories at each level, sorted in descending or ascending order.
[0141] Furthermore, the system client can determine the most frequently accessed subdirectories under the current directory within the query period based on the received sorting results, and designate them as hot directories to facilitate subsequent management of the storage location and storage space of the hot directories.
[0142] In this embodiment, a directory popularity query request is sent to the client corresponding to the storage system. This instructs the client to determine the directory's popularity data within the query time period from the storage system's metadata database based on the directory's identifier information, and to sort the popularity data within the query time period. The sorting result is then received from the client. The metadata database stores the popularity data of all levels corresponding to each directory according to its hierarchical structure. Because the metadata database pre-stores the popularity data of all levels corresponding to each directory, in actual directory popularity query scenarios, the client can directly query the directory's popularity data within the query time period from the metadata database, without traversing all levels of files under the directory, saving query time. Furthermore, the queried information is quickly sorted, and the sorting result is used as the target popularity query response, rapidly responding to the target's popularity query request and improving directory popularity query efficiency.
[0143] In one exemplary embodiment, the method further includes:
[0144] Obtain the storage system's popularity configuration information; the popularity configuration information includes file popularity statistics identifier, number of statistical time windows, and statistical time window period; broadcast the popularity configuration information to the client and the metadata database manager.
[0145] The file popularity statistics identifier represents the file in the storage system that needs to be statistically analyzed. It can be a file ID, used to instruct the client and the metadata database manager to perform popularity statistics on the file corresponding to the identifier.
[0146] The number of statistical time windows indicates the number of time windows that the metadata manager counts for the directory corresponding to the file, such as 8. The statistical time window period indicates the granularity of a single time window recorded by the metadata manager for the directory corresponding to the file, which can be 1 day, 30 days, etc.
[0147] In this embodiment, the popularity configuration information is broadcast to the client and the metadata database manager, achieving global standardization and consistent synchronization of the storage system's popularity statistics rules. Specifically, the file popularity statistics identifier clearly defines the statistical scope, avoiding resource waste caused by irrelevant files being included in the statistics. The number and period of the statistical time window provide the metadata database manager with a unified specification for the granularity and dimension of popularity data storage.
[0148] In one exemplary embodiment, a method for file access and directory popularity query is provided, such as... Figure 12 As shown, Figure 12The system includes a client and a storage system. The storage system includes a directory 1, which includes a subdirectory n. Subdirectory n contains multiple files, such as file 1, file n, etc. Figure 12 In this process, the client responds to a read / write access request for file 1, performs read / write access on file 1 in the storage system, and synchronously recursively accesses the parent directory of file 1, recording the number of file accesses, incrementing the access count of directory n by 1, and incrementing the access count of directory 1 by 1. Furthermore, when the client queries the popularity of directory n, it can query the popularity data of directory n based on the identification information of directory n; when the client queries the popularity of directory 1, it can scan the subdirectories under directory 1, determine the popularity of directory 1 and directory n based on the identification information of target 1 and directory n, and sort the popularity of the two directories in descending order to obtain a directory list.
[0149] In this embodiment, a method for quickly checking directory popularity is implemented by updating the file access count to its recursive parent directory. When a file is accessed (read or write), the client updates the access count of the file's parent directory in memory (recursively updating each level of parent directory), and then periodically refreshes the parent directory access count information to the metadata database. When querying the popularity information of a specific directory or its subdirectories, the client can directly query the directory's metadata information from the metadata database to obtain the access count of all files within that directory. This method avoids the need to recursively traverse the access counts of all subdirectories within a directory for each directory popularity query, enabling rapid directory popularity retrieval.
[0150] In one exemplary embodiment, a method for file access and directory popularity query is provided, such as... Figure 13 As shown, Figure 13 A multi-terminal interaction diagram illustrating file access and directory popularity query methods, including the following steps:
[0151] S1301, the user sends the set (or modified) heat configuration information to the system management terminal.
[0152] The popularity configuration information includes the file identifier that needs to be included in the popularity statistics, the number of windows (1 to 8), and the window granularity (1 to 30 days).
[0153] S1302, System management terminal for solidifying thermal configuration information.
[0154] S1303, The system client returns a response (or a modification response) regarding the popularity configuration information.
[0155] S1304, the system client broadcasts the heat configuration information to the client.
[0156] S1305, the system client broadcasts the heat configuration information to the metadata database.
[0157] The above S1301-S1305 are the configuration stages for popularity configuration information.
[0158] S1306, The user sends a file access request to the client.
[0159] S1307, Client reads and writes files.
[0160] S1308, the client recursively updates the parent directory of the file, increasing the number of parent directory accesses.
[0161] S1309, the client returns a file access response.
[0162] S1310, the client periodically refreshes the parent directory access count.
[0163] S1311, the metadata manager records the number of visits to the parent directory.
[0164] If the update time spans multiple windows, then update the historical time window data corresponding to the parent directory.
[0165] S1312, the metadata manager returns a refresh response to the client showing the number of parent directory accesses.
[0166] S1313, the user sends a directory popularity query request to the system management terminal.
[0167] S1314, The system management terminal sends a directory popularity query request to the client.
[0168] S1315, the client scans the list of subdirectories under the directory and queries the metadata database for the popularity information of each subdirectory in turn.
[0169] S1316, the metadata database management terminal queries the popularity information of the directory and its subdirectories from the specified window according to the time period to be queried.
[0170] S1317, the metadata management end returns the popularity information of the directory and each subdirectory to the client.
[0171] S1318, the client sorts the popularity information of directories and subdirectories.
[0172] S1319, the client sends a sorted list of directories to the system management terminal.
[0173] S1320, the system management terminal sends a sorted directory list to the user.
[0174] In this embodiment, a method for quickly checking directory popularity is implemented by updating the file access count to its recursive parent directory. When a file is accessed (read or write), the client updates the access count of the file's parent directory in memory (recursively updating each level of parent directory), and then periodically refreshes the parent directory access count information to the metadata database. When querying the popularity information of a specific directory or its subdirectories, the client can directly query the directory's metadata information from the metadata database to obtain the access count of all files within that directory. This method avoids the need to recursively traverse the access counts of all subdirectories within a directory for each directory popularity query, enabling rapid directory popularity retrieval.
[0175] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0176] Based on the same inventive concept, this application also provides a directory popularity query system for implementing the directory popularity query method described above. The system includes a server and a client. The server is equipped with a system management terminal and a metadata database. The client is used to implement the steps of the method in any of the embodiments described above where the client is the execution subject. The server is used to implement the steps of the method in any of the embodiments described above where the system management terminal is the execution subject.
[0177] Based on the same inventive concept, this application also provides a directory popularity query device for implementing the directory popularity query method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more directory popularity query device embodiments provided below can be found in the limitations of the directory popularity query method above, and will not be repeated here.
[0178] In one exemplary embodiment, such as Figure 14As shown, a directory popularity query device is provided, including: a query response module 1401, a popularity acquisition module 1402, and a popularity sorting module 1403, wherein:
[0179] The query response module 1401 is used to respond to the directory popularity query request triggered by the system management terminal of the storage system, and obtain the directory identification information and the time period to be queried;
[0180] The popularity acquisition module 1402 is used to determine the popularity data information of a directory within the time period to be queried from the metadata database of the storage system based on the directory's identification information; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory.
[0181] The popularity sorting module 1403 is used to sort the popularity data of the directory within the time period to be queried, and send the sorting results to the system management terminal.
[0182] In an exemplary embodiment, the metadata database stores the popularity data information of a directory within multiple consecutive time windows; the popularity acquisition module 1402 includes: a time window determination unit and a data information determination unit, wherein:
[0183] The time window determination unit is used to determine the target time window from multiple consecutive time windows based on the time period to be queried;
[0184] The data information determination unit is used to determine the directory popularity data information of the directory within the time period to be queried, based on the popularity data information within the target time window.
[0185] In an exemplary embodiment, the time window determination unit is further configured to: determine a single time window that matches the time period to be queried as a target time window when the time period to be queried is shorter than the time period of a single time window; and determine multiple time windows that match the time period to be queried as target time windows when the time period to be queried is longer than the time period of a single time window.
[0186] In an exemplary embodiment, the data information determination unit is further configured to obtain the time proportion of the time period to be queried within the target time window; and to divide the popularity data information within the target time window based on the time proportion to obtain the directory popularity data information of the directory within the time period to be queried.
[0187] In an exemplary embodiment, the directory popularity query device further includes: a popularity acquisition module and a popularity statistics module, wherein:
[0188] The popularity acquisition module is used to respond to file access requests, access the file, and synchronously recursively update the access popularity of the file's parent directory.
[0189] The popularity statistics module is used to send the access popularity of the parent directory to the metadata database manager at preset time intervals. This instructs the manager to record the access popularity of the parent directory in the real-time statistics time window if the time interval between the current time and the previous update time is within a single statistical time window. If the time interval exceeds a single statistical time window, the popularity information of the parent directory in the real-time statistics time window is moved to the historical statistics time window adjacent to the real-time statistics time window, and the access popularity of the parent directory is recorded in the real-time statistics time window.
[0190] In an exemplary embodiment, the directory popularity query device further includes: a popularity configuration module, wherein the popularity configuration module is used to obtain the set of files in the storage system with popularity statistics enabled in response to popularity configuration information triggered at the system management terminal;
[0191] The popularity acquisition module is also used to determine the parent directory of a file when the file is in a file set, and to synchronously and recursively update the access popularity of the parent directory of the file.
[0192] In one exemplary embodiment, such as Figure 15 As shown, a directory popularity query device is provided, including: a request sending module 1501 and a sorting result receiving module 1502, wherein:
[0193] The request sending module 1501 is used to send a directory popularity query request to the client corresponding to the storage system, so as to instruct the client to determine the popularity data information of the directory in the query time period from the metadata database of the storage system based on the directory's identification information, and to sort the popularity data information of the directory in the query time period; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory.
[0194] The sorting result receiving module 1502 is used to receive the sorting results sent by the client.
[0195] In an exemplary embodiment, the directory popularity query device includes: a configuration information acquisition module and a configuration information broadcasting module, wherein:
[0196] The configuration information acquisition module is used to acquire the popularity configuration information of the storage system; the popularity configuration information includes file popularity statistics identifier, number of statistical time windows, and statistical time window period;
[0197] The configuration information broadcasting module is used to broadcast popularity configuration information to clients and the metadata database manager.
[0198] Each module in the aforementioned directory popularity query device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0199] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 16 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores directory popularity query data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a directory popularity query method.
[0200] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 17As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a directory heatmap search method. The display unit is used to create a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0201] Those skilled in the art will understand that Figure 16 and Figure 17 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0202] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0203] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0204] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0205] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0206] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0207] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0208] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for querying directory popularity, characterized in that, The method, applied to a client corresponding to a storage system, includes: In response to a directory popularity query request triggered by the system management terminal of the storage system, the identification information of the directory and the time period to be queried are obtained; Based on the identification information of the directory, the popularity data information of the directory within the time period to be queried is determined from the metadata database of the storage system; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory. The popularity data of the directory within the time period to be queried is sorted, and the sorting results are sent to the system management terminal.
2. The method according to claim 1, characterized in that, The metadata database stores the popularity data information of the directory within multiple consecutive time windows; Determining the directory popularity data information of the directory within the query time period from the metadata database of the storage system includes: Based on the time period to be queried, determine the target time window from the multiple consecutive time windows; Based on the popularity data information within the target time window, the popularity data information of the directory within the time period to be queried is determined.
3. The method according to claim 2, characterized in that, The step of determining the target time window from the plurality of consecutive time windows based on the time period to be queried includes: If the time period to be queried is less than the time period of a single time window, the single time window that matches the time period to be queried is determined as the target time window. If the time period to be queried is longer than the time period of a single time window, multiple time windows that match the time period to be queried will be determined as the target time window.
4. The method according to claim 2, characterized in that, The step of determining the directory's popularity data information within the target time window based on the popularity data information within the target time window includes: Obtain the proportion of the time period to be queried within the target time window; Based on the time ratio, the popularity data information within the target time window is divided to obtain the directory popularity data information within the time period to be queried.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: In response to a file access request, the file is accessed, and the access popularity of the file's parent directory is updated recursively upwards. At preset time intervals, the access popularity of the parent directory is sent to the manager of the metadata database. This instructs the manager to record the access popularity of the parent directory in the real-time statistical time window if the time interval between the current time and the previous update time is within a single statistical time window. If the time interval exceeds a single statistical time window, the access popularity information of the parent directory in the real-time statistical time window is moved to the historical statistical time window adjacent to the real-time statistical time window, and the access popularity of the parent directory is recorded in the real-time statistical time window.
6. The method according to claim 5, characterized in that, Prior to responding to a file access request, the method further includes: In response to the popularity configuration information triggered by the system management terminal, obtain the set of files in the storage system with popularity statistics enabled; Accordingly, the synchronous recursive update of the access popularity of the parent directory of the file includes: If the file is in the file set, determine the parent directory corresponding to the file, and synchronously recursively update the access popularity of the parent directory of the file upwards.
7. A method for querying directory popularity, characterized in that, The method, applied to the system management terminal of a storage system, includes: A directory popularity query request is sent to the client corresponding to the storage system to instruct the client to determine the popularity data information of the directory within the query time period from the metadata database of the storage system based on the directory's identification information, and to sort the popularity data information of the directory within the query time period; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory. Receive the sorting result sent by the client.
8. The method according to claim 7, characterized in that, The method further includes: Obtain the popularity configuration information of the storage system; the popularity configuration information includes file popularity statistics identifier, number of statistical time windows, and statistical time window period; The popularity configuration information is broadcast to the client and the metadata database manager.
9. A directory popularity query system, characterized in that, The directory popularity query system includes a server and a client, and the server is deployed with a system management terminal and a metadata database. The client is used to implement the steps of the method according to any one of claims 1 to 6; The server is used to implement the steps of the method according to any one of claims 7 to 8.
10. A directory popularity query device, characterized in that, The device includes: The query response module is used to respond to a directory popularity query request triggered by the system management terminal of the storage system, and to obtain the identification information of the directory and the time period to be queried; The popularity acquisition module is used to determine the popularity data information of the directory within the time period to be queried from the metadata database of the storage system based on the identification information of the directory; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory. The popularity sorting module is used to sort the popularity data of the directory within the time period to be queried, and send the sorting results to the system management terminal.
11. A directory popularity query device, characterized in that, The device includes: The request sending module is used to send a directory popularity query request to the client corresponding to the storage system, so as to instruct the client to determine the popularity data information of the directory in the query time period from the metadata database of the storage system based on the identification information of the directory, and sort the popularity data information of the directory in the query time period; the metadata database stores the popularity data information of all levels corresponding to each directory according to the hierarchical structure of each directory. The sorting result receiving module is used to receive the sorting result sent by the client.
12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
13. A computer-readable storage medium having a computer program stored thereon, 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 to 8.
14. A computer program product, comprising 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 to 8.