Target object processing method and device, storage medium and electronic equipment
By creating an object name list in the memory cache of the distributed storage system and reading the metadata of the target object from the disk when needed, the problem of low memory cache performance in the distributed storage system is solved, and the effect of reducing data reading and memory usage is achieved.
Patent Information
- Application Number
- CN202412000536.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The performance of memory cache in distributed storage systems is low, mainly because when you need to access files in directories, you need to read all the metadata of all files from disk space and transfer them to the memory cache, resulting in an increase in data reading scale and excessive memory storage space.
Create a list in the memory cache of a distributed storage system to describe the data processing logic for sequences of strings that do not distinguish between object names by character attributes. In response to the target business request, find out whether the object name of the target object exists in the memory cache. If not found and the object metadata is not fully loaded, the metadata of the target object is read from the target disk and loaded in the memory cache.
By only reading the metadata of the target object that needs to be accessed from the target disk and loading it in the memory cache, the data scale and read frequency of reads from the target disk are reduced, saving the space of the memory cache and improving the memory cache performance of the distributed storage system.
Smart Images

Figure CN120045472A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computers, and more specifically, to a method and apparatus for processing a target object, a storage medium, and an electronic device. Background Art
[0002] In a distributed storage system, in order to simplify file management, a case-insensitive queue corresponding to a directory is usually created based on a processing logic that does not distinguish between the uppercase and lowercase of file names (a file can also be understood as a storage object) in each directory, and in the memory cache, the case-insensitive queue is bound to the metadata of each file in the corresponding directory.
[0003] Due to the binding relationship created between the above-mentioned case-insensitive queue and the metadata of each file in the directory, when accessing a file in the directory, it is necessary to read the metadata of all files in the directory from disk space and transfer the metadata of all files to the memory cache, which increases the data reading scale of disk space and at the same time increases the data storage space occupied in the memory cache, thus causing the technical problem of low performance of the memory cache in the distributed storage system.
[0004] Regarding the problem of low performance of the memory cache in the distributed storage system in the related art, no effective solution has been proposed yet. Summary of the Invention
[0005] Embodiments of the present application provide a method and apparatus for processing a target object, a storage medium, and an electronic device, so as to at least solve the problem of low performance of the memory cache in the distributed storage system.
[0006] According to an embodiment of the present application, a method for processing a target object is provided, including: in response to a target service request, creating a first list in a memory cache of a distributed storage system, where the first list is created based on the object names of N objects in a first directory in the distributed storage system, the first list is used to describe a data processing logic for a string sequence corresponding to an object name without distinguishing according to character attributes, and N is a positive integer greater than or equal to 1; in the case where the value of the first configuration item identified by the first directory is a first target value, searching the memory cache based on the first directory identifier and the target object name; in the case where the target object name is not found in the memory cache and the metadata of the N objects has not been fully loaded, reading the target metadata of the target object from the target disk; transmitting the target metadata to the memory cache and loading the target metadata of the target object in the memory cache.
[0007] In an exemplary embodiment, creating a first list in the in-memory cache of the distributed storage system in response to a target service request includes: determining the data type and storage structure of a string in response to the target service request; determining the operation logic for a string sequence, where the operation logic includes the order in which each string in the string sequence is written into the first list and the order in which each string is deleted from the first list; determining the data processing logic for not changing the arrangement position of each string in the first list according to the character attributes when the character attributes of each string change; generating the first list based on the operation logic, the data processing logic, and each string.
[0008] In an exemplary embodiment, when it is queried that the value of the first configuration item of the first directory identifier is the first target value, searching the in-memory cache based on the first directory identifier and the target object name includes: when it is queried that the value of the first configuration item is the first target value, searching the current list in the in-memory cache based on the first directory identifier and the target object name to obtain a first search result; when the first search result indicates that there is a candidate object name matching the target object name in the current list, comparing the candidate string of the candidate object name with the target string of the target object name; when the candidate string is the same as the target string, returning the candidate string to the first list.
[0009] In an exemplary embodiment, when it is queried that the value of the first configuration item of the first directory identifier is the first target value, searching the in-memory cache based on the first directory identifier and the target object name further includes: searching the current list in the in-memory cache based on the first directory identifier and the target object name to obtain a second search result; when the second search result indicates that there is no candidate object name matching the target object name in the current list, obtaining the loading status of the first directory; when the loading status of the first directory indicates that N objects under the first directory are not fully loaded, searching whether there is a target object in the in-memory cache to obtain a third search result; loading the target metadata of the target object in the in-memory cache based on the third search result.
[0010] In an exemplary embodiment, loading the target metadata of the target object in the in-memory cache based on the third search result includes: when the third search result indicates that there is a target object in the in-memory cache, adding the target string corresponding to the target object name to the first list; loading the target metadata of the target object in the in-memory cache based on the target string; or when the third search result indicates that there is no target object in the in-memory cache, reading the target metadata of the target object from the target disk based on the target string and transmitting the target metadata to the in-memory cache; loading the target metadata of the target object in the in-memory cache.
[0011] In an exemplary embodiment, after transmitting the target metadata to the memory cache and loading the target metadata of the target object in the memory cache, the above method further includes: when the value of the second configuration item of the first directory identifier is the second target value, based on the object data in the memory cache, perform the following operations: when the memory space occupied by the object data in the memory cache is greater than the first preset threshold, perform a clearing operation on the metadata of some of the N objects; or when the number of directory identifiers in the memory cache is greater than the second preset threshold, clear the first directory corresponding to the first directory identifier; or when the number of object names under each list in the memory cache is greater than the third preset threshold, perform a clearing operation on the object names of some of the N objects in the first list; or when the value of the third configuration item of the first directory identifier is the third target value and the time interval between the access time to the first list and the current time is greater than the fourth preset threshold, clear the first list corresponding to the first directory identifier and modify the value of the first configuration item of the first directory identifier from the first target value to the fourth target value; or when the memory space occupied by the object data in the memory cache is greater than the first preset threshold, perform a clearing operation on the metadata of some of the N objects and the object names of some of the N objects in the first list simultaneously.
[0012] In an exemplary embodiment, the above method further includes: when performing a clearing operation on the metadata of some of the N objects in the memory cache, update the partial strings of the partial object names corresponding to the some objects in the first list; when performing a clearing operation on the object names of some of the N objects in the first list, allow the metadata of some objects in the memory cache to remain unchanged.
[0013] According to another embodiment of the embodiments of the present application, there is also provided a processing device for a target object, including: a creation unit, configured to create a first list in a memory cache of a distributed storage system in response to a target service request, where the first list is created based on the object names of N objects under a first directory in the distributed storage system, and the first list is used to describe the data processing logic of a string sequence corresponding to object names without distinguishing according to character attributes, and N is a positive integer greater than or equal to 1; a search unit, configured to search the memory cache based on the first directory identifier and the target object name when it is queried that the value of the first configuration item of the first directory identifier is the first target value; a reading unit, configured to read the target metadata of the target object from a target disk when the target object name is not found in the memory cache and the metadata of the N objects has not been fully loaded; a loading unit, configured to transmit the target metadata to the memory cache and load the target metadata of the target object in the memory cache.
[0014] According to another embodiment of the present application, there is also provided a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0015] According to another embodiment of the present application, there is also provided an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0016] According to another embodiment of the present application, there is also provided a computer program product, where the computer program product includes a computer program, and the steps in any one of the above method embodiments are implemented when the computer program is executed by a processor.
[0017] Through the above embodiments provided by the present application, in response to a target service request, a first list is created in the memory cache of the distributed storage system, and when it is queried that the value of the first configuration item of the first directory identifier is the first target value, the object name of the target object is searched in the memory cache according to the first target identifier and the target object name. When the object name of the target object is found and the metadata of the N objects under the first directory has not been fully loaded, the target metadata of the target object is read from the target disk and the target metadata is loaded into the memory cache. In other words, by creating a list composed of object names according to business requirements, when the target object name is included in the list, only the metadata of the target object that needs to be accessed currently is read from the target disk and the metadata of the target object is loaded into the memory cache, reducing the data scale and read frequency read from the target disk, saving the space of the memory cache, and achieving the technical effect of improving the performance of the memory cache of the distributed storage system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:
[0019] Figure 1 is a hardware structure block diagram of a server device for a method of processing a target object according to an embodiment of the present application;
[0020] Figure 2 is a flowchart of an optional method for processing a target object according to an embodiment of the present application;
[0021] Figure 3 is an overall schematic diagram of an optional method for processing a target object according to an embodiment of the present application;
[0022] Figure 4 It is the overall flowchart of an optional case-insensitive queue lookup method based on single - item loading according to an embodiment of the present application;
[0023] Figure 5 It is a schematic diagram of an optional directory sharding according to an embodiment of the present application;
[0024] Figure 6 It is the flowchart of an optional trim operation on a case - insensitive queue according to an embodiment of the present application;
[0025] Figure 7 It is the structural block diagram of a processing device for a target object according to an embodiment of the present application;
[0026] Figure 8 It is the schematic structural diagram of an optional electronic device according to an embodiment of the present application. Detailed implementation manners
[0027] In the following, embodiments of the present application will be described in detail with reference to the accompanying drawings and in combination with embodiments.
[0028] It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above - mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.
[0029] The embodiment of the processing method for the target object provided in the embodiment of the present application can be executed in a server device or a similar computing device. Taking the operation on a server device as an example, Figure 1 It is the hardware structural block diagram of a server device for a processing method of a target object according to an embodiment of the present application. As Figure 1 shown, the server device may include one or more ( Figure 1 only one is shown in Figure 1 the processor 102 (the processor 102 may include, but is not limited to, a processing device such as a micro - processor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above - mentioned server device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown in Figure 1 is only schematic, and it does not limit the structure of the above - mentioned server device. For example, the server device may further include more or fewer components than
[0030] The memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the processing method of the target object in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above-mentioned method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the server device through a network. Examples of the above network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
[0031] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the server device. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] To better understand the above-mentioned processing method of the target object, the basic concepts of professional terms used in the embodiments of the present application are briefly introduced below.
[0033] MDS: Abbreviation of Metadata Server, which is the abbreviation of metadata service in a distributed file system;
[0034] Metadata: Data that records the attributes of a file or directory, and is data that describes data;
[0035] Inode: A part of metadata, which records metadata information such as inode number.
[0036] Case-insensitive queue: When the case-insensitive service is enabled for a directory in a distributed storage system, the case-insensitive list (for example, the first list) of the directory will be saved. For example, there are files abc, Abc, and def under directory A. Then the case-insensitive list corresponding to A includes (1) ABC-abc, Abc; and (2) DEF-def, a total of two members.
[0037] To solve the above problems existing in the related art, in this embodiment, a processing method of a target object is provided, and its execution subject includes but is not limited to a distributed storage system, such asFigure 2 As shown in the figure, the process includes the following steps S202 - S208:
[0038] Step S202: In response to a target service request, create a first list in the memory cache of the distributed storage system. The first list is created based on the object names of N objects under the first directory in the distributed storage system. The first list is used to describe the data processing logic of the string sequence corresponding to the object names without distinguishing by character attributes, where N is a positive integer greater than or equal to 1.
[0039] Step S204: When it is queried that the value of the first configuration item identified by the first directory is the first target value, search the memory cache based on the first directory identifier and the target object name.
[0040] Step S206: When the target object name is not found in the memory cache and the metadata of the N objects has not been fully loaded, read the target metadata of the target object from the target disk.
[0041] Step S208: Transmit the target metadata to the memory cache and load the target metadata of the target object in the memory cache.
[0042] In the distributed storage system, the above - mentioned first list can also be understood as a case - insensitive queue. A case - insensitive queue can be, but is not limited to, understood as not requiring case - sensitivity when processing file names or paths. This design allows users to input file names in any case form when processing files in the system, and the system can still correctly identify and process these files.
[0043] For example, in the Linux system, file names are case - sensitive, while in the Windows system, file names are usually not case - sensitive. In the distributed storage system, to maintain cross - platform compatibility and simplify the user experience, a case - insensitive file name processing mechanism may be implemented. This means that no matter how the user inputs the file name (such as File.txt, file.txt, or FILE.TXT), the system will regard them as the same file.
[0044] In addition, the case - insensitive queue may also be related to the cache mechanism of the distributed system. In this case, when elements in the queue (such as file names or paths) are added or retrieved, case differences do not affect the operation of the queue. This mechanism helps to improve the flexibility and fault tolerance of the system, especially when processing file requests from different operating systems or applications.
[0045] In the related art, the above-mentioned first list (or case-insensitive queue) is bound to the metadata in each directory. This makes it necessary to read the metadata of all files in the directory from disk space and transfer the metadata of all files to the memory cache when accessing a file in the directory, increasing the scale of data reading from disk space.
[0046] In view of the above problems, an object processing method is proposed in the embodiments of the present application. The overall processing flow is as Figure 3 shown.
[0047] (1) The samba client sends a specific service request to the lib library;
[0048] Among them, in a distributed storage system, lib can be understood, but not limited to, as a library file for supporting specific functions of the distributed storage system. For example, data caching, task queue management, etc. These library files may contain a series of functions and tools for managing and optimizing the operations of the distributed storage system.
[0049] The above-mentioned specific service request can be understood, but not limited to, as a request to enable the case-insensitive service. Specifically, the above service request is sent through the Icfs_lookup_realname instruction.
[0050] (2) Through the lib library, send a lookup instruction for the target object name to the MDS cache;
[0051] For example, through the ICFS_MDS_OP_LOOKUPREALNAME instruction, check whether the object name (which can also be understood as the file name) of the target object (which can also be understood as the target file) to be accessed exists in the case-insensitive list in the MDS cache.
[0052] (3) Perform a lookup operation in the case-insensitive queue;
[0053] Specifically, use the handle_client_lookup_realname command to check whether the object name of the target object exists in the current case-insensitive queue.
[0054] It should be noted that in the embodiments of the present application, the object and the file have the same meaning, and the object name and the file name have the same meaning.
[0055] (4) Obtain the lookup result in the MDS cache;
[0056] (5) Through the lib library, send the lookup result to the samba client.
[0057] In the embodiments of the present application, there is no binding relationship between the case-insensitive queue and the metadata under the directory. Based on this technology, by setting the first configuration item of the directory identifier, when it is necessary to respond to a specific service request, the case-insensitive queue function of a directory can be enabled by setting the value of the first configuration item to true.
[0058] The above first configuration item can be but is not limited to adding a member is_ignore field to the directory inode (directory identifier), and the value of this field includes true and false.
[0059] When the value of the first configuration item is the first target value (true), it is determined to enable the case-insensitive queue service of the first directory, and the MDS cache (which can also be understood as a memory cache) is searched according to the first directory identifier (inode) and the object name of the target object to be accessed.
[0060] When the search result indicates that the target object name is not found in the MDS cache, due to the case-insensitive queue function being enabled, it is also necessary to further determine whether the first directory is in the complete state, that is, it is necessary to determine whether the metadata of the N objects under the first directory is in the fully loaded state.
[0061] If the metadata of the N objects under the first directory is not in the fully loaded state, the target metadata of the target object is read from the target disk and transmitted to the MDS cache to load the target metadata of the target object in the MDS cache.
[0062] It is easy to understand that in a distributed storage system, MDS is mainly responsible for managing the metadata of the file system. For example, it includes inode information of files, directory structures, access permissions, etc. When a client needs to access a file, it will first send a request to MDS to obtain the metadata of the file. MDS will retrieve the required information from the metadata cluster it manages and then send this information to the client.
[0063] To improve the performance of MDS, metadata is usually cached in memory. When MDS restarts or recovers from a failure, it will reload the metadata into the cache by reading the log.
[0064] That is to say, in order to improve the performance of the MDS, usually only the metadata of a small number of files is cached in the MDS. In the embodiments of the present application, by using the settings of the above first configuration item and releasing the binding file between the case-insensitive queue and the metadata of N files in the directory, a case-insensitive queue is created in the MDS according to business requirements, and according to the file name to be accessed, the metadata of the target file is loaded one by one in the MDS. This avoids reading the metadata of all files in the entire directory from the disk, reduces the amount of data read, and saves resources.
[0065] It should be noted that the prerequisite for realizing single-item loading in the MDS is to independently update the case-insensitive queue. The specific update management process is as follows:
[0066] 1) Add an independent map queue in the MDS, where the key is the directory inode number and the value is the case-insensitive queue corresponding to the directory;
[0067] 2) When a file is created or loaded from the disk, add the corresponding file name to the case-insensitive queue;
[0068] 3) When a file is deleted, delete the file name from the queue;
[0069] 4) This queue is not written to disk. When the MDS restarts, it is directly cleared and rebuilt in the cache according to business needs later, preventing disk space occupation and avoiding a large number of access requests between the MDS and the OSD.
[0070] By adopting the above method, in response to a target business request, a first list is created in the memory cache of the distributed storage system. When it is queried that the value of the first configuration item of the first directory identifier is the first target value, it is determined whether the object name of the target object exists in the memory cache according to the first target identifier and the target object name. When the object name of the target object is found and the metadata of N objects in the first directory has not been fully loaded, the target metadata of the target object is read from the target disk and the target metadata is loaded in the memory cache. In other words, by creating a list composed of object names according to business requirements, when the list contains the target object name, only the metadata of the target object that needs to be accessed currently is read from the target disk and the metadata of the target object is loaded in the memory cache, reducing the data scale and read frequency read from the target disk, saving the space of the memory cache, and achieving the technical effect of improving the performance of the memory cache of the distributed storage system.
[0071] In an exemplary embodiment, the above-mentioned creating a first list in the memory cache of the distributed storage system in response to a target business request includes:
[0072] In response to a target service request, determine the data type and storage structure of a string;
[0073] Determine the operation logic for a string sequence, where the operation logic includes the order in which each string in the string sequence is written into a first list and the order in which each string is deleted from the first list;
[0074] In the case where the character attributes of each string change, determine the data processing logic for not changing the arrangement position of each string in the first list according to the character attributes;
[0075] Generate a first list based on the operation logic, data processing logic, and each string.
[0076] When implementing memory caching, there may be a need to create an insensitive queue. Here, the "insensitive queue" includes but is not limited to a specially designed queue that is insensitive to certain operations or data changes, that is, these operations or changes do not affect the state or content of the queue. For example, when processing a large amount of data, in order to ensure the stability and response speed of the system, a queue may be designed that can remain stable and not be affected by these changes when the data is updated or the cache becomes invalid.
[0077] The steps for creating an insensitive queue include but are not limited to:
[0078] S11, Define the queue structure: Determine the data type and structure stored in the queue;
[0079] S12, Implement the queue logic: Write code to implement the basic operations of the queue, such as enqueueing and dequeueing;
[0080] S13, Design the insensitive mechanism: Determine which operations or data changes will not affect the queue and implement these mechanisms in the queue logic;
[0081] S14, Test the queue: Test the stability and performance of the queue in a distributed environment.
[0082] Through the above mechanism for reconstructing a case-insensitive queue in the MDS cache, it is allowed to quickly restore the consistency of the case-insensitive queue when the MDS restarts, without the need for complex recovery operations. This mechanism can quickly resume services after the server terminal, and is particularly suitable for scenarios with high availability requirements, such as cloud storage services, ensuring service continuity and timely access to user data.
[0083] In an exemplary embodiment, the above-mentioned searching of the memory cache based on the first directory identifier and the target object name in the case where the value of the first configuration item of the first directory identifier is the first target value includes:
[0084] When it is queried that the value of the first configuration item is the first target value, based on the first directory identifier and the target object name, search the current list in the memory cache to obtain a first search result;
[0085] When the first search result indicates that there is a candidate object name in the current list that matches the target object name, compare the candidate string of the candidate object name with the target string of the target object name;
[0086] When the candidate string is the same as the target string, return the candidate string to the first list.
[0087] When it is queried that the value of the above first configuration item is true, based on the first directory identifier and the target object name, search the MDS cache to obtain a first search result, and then determine the next operation according to whether there is a corresponding record indicated by the first search result.
[0088] Specifically, when the first search result indicates that there is a candidate object name in the current case-insensitive list (which can also be understood as the current list) in the MDS cache that matches the object name (file name) of the target object (target file) to be accessed, further determine whether the case of the string corresponding to the candidate object name is exactly the same as the case of the string of the object name of the target object.
[0089] If they are exactly the same, return the file name; if the case of the string of the candidate object name in the MDS is not exactly the same as the case of the string of the object name of the actual target object, return the first file name in the file name list corresponding to the file name in the case-insensitive queue corresponding to the directory.
[0090] It can be seen that the above search method, in the case of enabling the case-insensitive service, realizes a file processing request for single-item loading and searching according to the marking function of the first configuration item, significantly improving the efficiency of file searching. Especially in scenarios where file name case is not distinguished, such as multi-user environments or cross-platform file sharing, etc., it can effectively avoid search failures or performance degradation caused by case sensitivity.
[0091] In an exemplary embodiment, when it is queried that the value of the first configuration item of the first directory identifier is the first target value, based on the first directory identifier and the target object name, searching the memory cache further includes:
[0092] Based on the first directory identifier and the target object name, search the current list in the memory cache to obtain a second search result;
[0093] When the second search result indicates that there is no candidate object name matching the target object name in the current list, obtain the loading status of the first directory;
[0094] When the loading status of the first directory indicates that N objects under the first directory are not fully loaded, check whether the target object exists in the memory cache to obtain a third search result;
[0095] Based on the third search result, load the target metadata of the target object in the memory cache.
[0096] As described in the above embodiments, when it is queried that the value of the first configuration item identified by the first directory is true, search the current list in the MDS cache, and when it is determined that no candidate object name matching the target object name is found in the current list (the current case-insensitive list), further determine or check whether the first directory is in a fully loaded state.
[0097] If it is determined that N objects (N files) under the first directory are not fully loaded, first check whether the target file to be accessed exists in the MDS cache, and then according to the search result, load the target metadata of the target file in the MDS cache.
[0098] It can be seen that by creating and maintaining an independent case-insensitive queue related to the directory inode number, setting a flag in the inode to indicate whether the case-insensitive queue of the directory is enabled, and performing single-item search and single-item loading of files to be processed according to the flag, when there is a specific service request, a case-insensitive queue is created on demand, reducing the storage space of the MDS cache.
[0099] In addition, by adopting the method of single-item search and single-item loading according to the flag, the efficiency of file search can be significantly improved. Especially when a file needs to be accessed multiple times, adopting the method of single-item loading greatly reduces the reading time of file metadata and improves the memory performance of the MDS cache.
[0100] In an exemplary embodiment, the above-mentioned loading of the target metadata of the target object in the memory cache based on the third search result includes:
[0101] When the third search result indicates that the target object exists in the memory cache, add the target string corresponding to the target object name to the first list;
[0102] Based on the target string, load the target metadata of the target object in the memory cache; or
[0103] In the case where the target object does not exist in the third search result representation memory cache, based on the target string, read the target metadata of the target object from the target disk and transfer the target metadata to the memory cache;
[0104] Load the target metadata of the target object in the memory cache.
[0105] In the case where the N objects in the first directory are not fully loaded, first check whether the file (the target file or target object to be accessed) exists in the MDS cache. If it exists, add the found file name to the first list, and then further determine whether the case of the found file name is exactly the same as the actual file name of the target file.
[0106] If the cases are exactly the same, return the found file name to the first list.
[0107] Conversely, in the case where the N objects in the first directory are not fully loaded and it is checked that the file (the target file or target object to be accessed) does not exist in the MDS cache, further check whether the system has enabled the single-item loading function (intelligently loading one file from the disk at a time, defaulting to loading one shard at a time), and determine whether the case-insensitive queue aging mechanism has been enabled.
[0108] If both are enabled, use the single-item loading function to load this file alone. If the loading is successful, the message is re-entered; otherwise, directly return an indication message of search failure to the upper layer; if neither is enabled, load all the shards of the directory and reconstruct the case-insensitive queue corresponding to the inode number of the directory, and the message is re-entered.
[0109] Among them, the shards of a directory refer to dispersing the files or contents in the directory to multiple nodes to improve the performance and scalability of the storage system. This method is usually used to process large file systems or object storage, where a single directory may contain a large number of files or objects.
[0110] For example, as Figure 5 shown, assume that the storage space occupied by the files in a directory is 100,000 terabytes. Then, the directory can be divided into 10 shards, where the storage required for the files under one shard is 1MB.
[0111] Adopting the directory sharding method allows the system to dynamically manage data distribution to adapt to different workloads and storage requirements.
[0112] To facilitate the understanding of the above case-insensitive queue search method based on single-item loading, the following combines Figure 4 the overall flowchart shown to explain it.
[0113] S402, Receive an insensitive service request sent by the samba client;
[0114] S404, Determine whether the inode value corresponding to the request is true;
[0115] Add a member is_ignore to the directory inode. This member or configuration item is used to indicate whether the case-insensitive queue has been enabled for the directory.
[0116] If so, execute step S406; otherwise, execute step S412.
[0117] It should be noted that this flag is automatically set to false when the cached inode ages and is re-added to the cache.
[0118] S406, When it is determined that the above configuration item is_ignore is true, in the current case-insensitive queue, search for corresponding records according to the directory Inode number and file name;
[0119] If there is a record, execute step S408; otherwise, execute step S414.
[0120] S408, If there is a record, further confirm whether the file names are exactly the same;
[0121] Here, confirming whether the file names are exactly the same is achieved on the premise of distinguishing case. If they are exactly the same, return the file name. Otherwise, execute step S414.
[0122] S410, Return the file name;
[0123] S412, Load the full shard data of the directory, and add the file name and directory inode to the case-insensitive queue;
[0124] That is, when is_ignore is false, load the full shard data of the directory, and at the same time add the file name information and directory inode to the case-insensitive queue, and the message is re-entered.
[0125] S414, Check whether the directory is in a fully loaded state;
[0126] If so, execute step S420; otherwise, execute step S416.
[0127] S416, If N objects in the directory are not fully loaded, check whether the file exists in the cache;
[0128] If there is, execute step S418; otherwise, execute step S422.
[0129] Among them, whether the directory is fully loaded can also be understood as whether the directory is in the complete state.
[0130] S418, when the file exists in the cache, add it to the case-insensitive queue and further confirm whether the case of the file name is exactly the same;
[0131] If the case is exactly the same, return the file name.
[0132] S420, if the directory is in the complete state, return a search failure;
[0133] S422, if the directory is not fully loaded and the file does not exist in the cache, enable the single-item loading function and enable the case-insensitive queue aging mechanism.
[0134] Among them, before enabling the single-item loading function, first check whether the single-item loading function is enabled in the system (only load one file from the disk at a time, and by default, load one shard at a time). If both are enabled, use the single-item loading function to load this file separately. If the loading is successful, the message is re-entered; otherwise, directly return a search failure to the upper layer.
[0135] If neither is enabled, load all shards of the directory and reconstruct the case-insensitive queue corresponding to the inode number of the directory, and the message is re-entered.
[0136] By the above method, adopting the single-item search and single-item loading methods according to the flag can significantly improve the file search efficiency. Especially when a file needs to be accessed multiple times, adopting the single-item loading method greatly reduces the file metadata reading time and improves the memory performance of the MDS cache.
[0137] In an exemplary embodiment, after transferring the target metadata to the memory cache and loading the target metadata of the target object in the memory cache, the above method further includes:
[0138] When the value of the second configuration item of the first directory identifier is the second target value, based on the object data in the memory cache, perform the following operations:
[0139] When the memory space occupied by the object data in the memory cache is greater than the first preset threshold, perform a clearing operation on the metadata of some of the N objects; or
[0140] When the number of directory identifiers in the memory cache is greater than the second preset threshold, clear the first directory corresponding to the first directory identifier; or
[0141] When the number of object names under each list in the memory cache is greater than the third preset threshold, perform a clearing operation on the object names of some of the N objects in the first list; or
[0142] When the value of the third configuration item of the first directory identifier is the third target value and the time interval between the access time to the first list and the current time is greater than the fourth preset threshold, clear the first list corresponding to the first directory and modify the value of the first configuration item of the first directory identifier from the first target value to the fourth target value; or
[0143] When the memory space occupied by the object data in the memory cache is greater than the first preset threshold, perform a clearing operation on the metadata of some of the N objects and the object names of some of the N objects in the first list at the same time.
[0144] By adding a second configuration item mds_ignore_trim, mark whether to enable the case-insensitive queue aging function, with the default value being true. Among them, case-insensitive queue aging means that when processing file names or paths, the system is case-insensitive, that is, a queue aging mechanism that does not distinguish between uppercase and lowercase. Aging may mean that the elements in the queue change or are updated over time, and not being case-sensitive means that when processing these elements, the difference in case does not affect the operation of the queue.
[0145] By adding a separate case-insensitive queue aging process in the tick and adopting the Figure 6 process shown below to perform the following operations:
[0146] S602, add the second configuration item mds_ignore_trim;
[0147] S604, determine whether the second configuration item is true;
[0148] If it is, then execute one of steps S606, S608, S610, and S612.
[0149] S606, synchronize the aging trim of the case-insensitive queue with the MDS cache;
[0150] (1) When Dnetry or inode ages, synchronously clear the data in the case-insensitive list;
[0151] (2) Under the condition of enabling single-item loading, allow the case-insensitive list aging mechanism to be enabled; add a switch control for the following actions separately, and retain the emergency measure interface for full-scale trim;
[0152] (3) Under the condition of enabling single - item loading, the principle of the Trim operation is that for a list of multiple file names corresponding to a key value in the case - insensitive list, not all of them can be trimmed. At least one file name must be retained.
[0153] a) When the insensitive list ages, if a key has multiple values, not all of them can be trimmed. At least the key and one file name must be retained.
[0154] b) When adding records to the insensitive list (full - volume loading, create, rename, etc.), if there is only one file - name record for the current key, it cannot be aged at this time.
[0155] c) When adding records to the insensitive queue and it is found that the number of file names corresponding to the key has exceeded 1, then during subsequent aging detection, the extra records can be directly trimmed (retaining one).
[0156] S608, Aging Trim based on the threshold;
[0157] In the separate processing flow of the tick full - volume insensitive list, the case - insensitive queue performs aging management according to its own threshold. The threshold includes but is not limited to the number of directories, the number of keys, and the number of case - insensitive queues, etc.
[0158] Among them, when the number of keys is greater than the threshold, step S614 is executed; when the number of case - insensitive queues is greater than the threshold, step S616 is executed; when the number of members in the case - sensitive queue is greater than the threshold, step S618 is executed.
[0159] When the case - insensitive queue ages, the following processing also needs to be performed:
[0160] (1) When cleaning the directory, directly clear the full - volume insensitive list corresponding to the directory;
[0161] (2) When cleaning files, it is possible to preferentially age the files that are no longer in the cache;
[0162] Specifically, this can be achieved by adding a separate switch, which is not enabled by default.
[0163] (3) Separate switch control (the mds_ignore_case_trim_threshold switch controls the aging of the separate insensitive list and is not enabled by default).
[0164] S610, Time - out Trim;
[0165] a) Add a configuration item mds_ignore_duration with a default value of 1800 (0.5h). When checking the insensitive queue at each tick, check the interval between the last access time of the insensitive queue in the directory being checked and the current time.
[0166] If the interval exceeds the threshold, clear the insensitive queue of the directory and set the case-insensitive function flag in the inode to false.
[0167] b) Update the last_time of the case-insensitive queue when an insensitive request (lookup_realname) accesses the directory.
[0168] S612, Memory overrun trim based on the overall memory threshold;
[0169] a) A separate switch controls mds_ignore_case_trim_cache, with a default value of false;
[0170] b) Add a configured memory threshold, with mds_ignore_case_trim_cache_size defaulting to 15G;
[0171] c) Add a configuration mds_ignore_case_trim_cache_dirsize with a default value of 5, which is the number of directories to clean the insensitive list at each tick;
[0172] d) Using this method for trim will trim the entire insensitive list of the directory.
[0173] The aging policy control module monitors the overall memory usage and adjusts the aging policy, including trimming the data in the insensitive queue, to avoid the memory consumption exceeding the preset threshold. In scenarios dealing with massive data, such as social media platforms or big data analysis centers, this mechanism can effectively manage memory resources, prevent the system from crashing due to resource exhaustion, and ensure the long-term stable operation of the system.
[0174] S614, Perform a trim operation on a directory corresponding to a key;
[0175] S616, Perform a trim operation on a case-insensitive queue;
[0176] S618, Perform a trim operation on at least some members of the case-insensitive queue.
[0177] Among them, in one example, all file names under a directory include abc, Abc, def, then the case-insensitive list corresponding to this directory includes (1) ABC-abc, Abc; and (2) DEF-def, a total of two members.
[0178] The above includes various trim operations, enabling efficient and stable file management services in various complex application scenarios, such as enterprise-level file servers or large-scale data storage systems. And through the third configuration item, the aging policy of the case-insensitive queue can be flexibly adjusted dynamically according to business requirements, optimizing resource utilization and enhancing the user experience.
[0179] In an exemplary embodiment, the above method further includes:
[0180] When performing a purge operation on the metadata of some of the N objects in the memory cache, update the partial strings of the partial object names corresponding to the some objects in the first list;
[0181] When performing a purge operation on the object names of some of the N objects in the first list, allow the metadata of some objects in the memory cache to remain unchanged.
[0182] The case-insensitive list is not strongly consistent with the actual cache. That is, when the actual cache ages, is deleted, or increased, the case-insensitive list needs to be updated. However, when the data in the case-insensitive list ages, the actual cache metadata may not be updated. That is, a certain file may be in the actual cache but not in the case-insensitive list.
[0183] When the case-insensitive queue creation module updates the case-insensitive queue, it adopts a non-strong consistency update strategy, improving the update performance of the queue and ensuring the consistency of the queue during critical operations. This strategy can significantly improve the system response speed in scenarios that require frequent writing and updating, such as real-time data processing systems or Internet of Things device management platforms, while ensuring data accuracy and security.
[0184] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), including several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present application.
[0185] In this embodiment, a processing device for a target object is further provided to implement the above embodiments and preferred embodiments, and the descriptions that have been made will not be repeated. As used hereinafter, the term "module" may be a combination of software and / or hardware that can implement a predetermined function. Although the modules described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0186] Figure 7 FIG. is a structural block diagram of a processing device for a target object according to an embodiment of the present application. The device includes:
[0187] A creation unit 702, configured to create a first list in the memory cache of the distributed storage system in response to a target service request. The first list is created based on the object names of N objects in the first directory of the distributed storage system. The first list is used to describe the data processing logic of the string sequence corresponding to the object names without distinguishing according to character attributes. N is a positive integer greater than or equal to 1.
[0188] A lookup unit 704, configured to perform a lookup on the memory cache based on the first directory identifier and the target object name when the value of the first configuration item of the first directory identifier is a first target value.
[0189] A reading unit 706, configured to read the target metadata of the target object from the target disk when the target object name is not found in the memory cache and the metadata of the N objects has not been fully loaded.
[0190] A loading unit 708, configured to transfer the target metadata to the memory cache and load the target metadata of the target object in the memory cache.
[0191] In an exemplary embodiment, the above creation unit 702 includes: a first processing module, configured to determine the data type and storage structure of the string in response to a target service request; a second processing module, configured to determine the operation logic of the string sequence, where the operation logic includes the order in which each string in the string sequence is written into the first list and the order in which each string is deleted from the first list; a third processing module, configured to determine the data processing logic of not changing the arrangement position of each string in the first list according to the character attribute when the character attribute of each string changes; a fourth processing module, configured to generate the first list based on the operation logic, the data processing logic, and each string.
[0192] In an exemplary embodiment, the above-mentioned search unit 704 includes: a first search module, configured to search the current list in the memory cache based on the first directory identifier and the target object name when it is queried that the value of the first configuration item is the first target value, and obtain a first search result; a comparison module, configured to compare the candidate string of the candidate object name with the target string of the target object name when the first search result indicates that there is a candidate object name matching the target object name in the current list; a return module, configured to return the candidate string to the first list when the candidate string is the same as the target string.
[0193] In an exemplary embodiment, the above-mentioned search unit 704 includes: a second search module, configured to search the current list in the memory cache based on the first directory identifier and the target object name, and obtain a second search result; an acquisition module, configured to acquire the loading state of the first directory when the second search result indicates that there is no candidate object name matching the target object name in the current list; a third search module, configured to search whether there is a target object in the memory cache when the loading state of the first directory indicates that N objects under the first directory are not fully loaded, and obtain a third search result; a loading module, configured to load the target metadata of the target object in the memory cache based on the third search result.
[0194] In an exemplary embodiment, the above-mentioned loading module includes: a first processing sub-module, configured to add the target string corresponding to the target object name to the first list when the third search result indicates that there is a target object in the memory cache; load the target metadata of the target object in the memory cache based on the target string; or when the third search result indicates that there is no target object in the memory cache, read the target metadata of the target object from the target disk based on the target string, and transmit the target metadata to the memory cache; load the target metadata of the target object in the memory cache.
[0195] In an exemplary embodiment, the above device further includes: a first processing unit, configured to, when the value of the second configuration item of the first directory identifier is the second target value, perform the following operations based on the object data in the memory cache: when the memory space occupied by the object data in the memory cache is greater than a first preset threshold, perform a clearing operation on the metadata of some of the N objects; or when the number of directory identifiers in the memory cache is greater than a second preset threshold, clear the first directory corresponding to the first directory identifier; or when the number of object names under each list in the memory cache is greater than a third preset threshold, perform a clearing operation on the object names of some of the N objects in the first list; or when the value of the third configuration item of the first directory identifier is the third target value and the time interval between the access time of the first list and the current time is greater than a fourth preset threshold, clear the first list corresponding to the first directory and modify the value of the first configuration item of the first directory identifier from the first target value to the fourth target value; or when the memory space occupied by the object data in the memory cache is greater than the first preset threshold, perform a clearing operation on the metadata of some of the N objects and the object names of some of the N objects in the first list simultaneously.
[0196] In an exemplary embodiment, the above device further includes: an updating unit, configured to update a partial string of the partial object names corresponding to some of the N objects in the first list when performing a clearing operation on the metadata of some of the N objects in the memory cache; a second processing unit, configured to allow the metadata of some of the N objects in the memory cache to remain unchanged when performing a clearing operation on the object names of some of the N objects in the first list.
[0197] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination.
[0198] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0199] Optionally, in this embodiment, the above computer program can be configured to execute the following steps through the computer program:
[0200] S1. In response to a target service request, create a first list in the memory cache of the distributed storage system, where the first list is created based on the object names of N objects in the first directory of the distributed storage system, and the first list is used to describe the data processing logic for the string sequence corresponding to the object names without distinguishing by character attributes, and N is a positive integer greater than or equal to 1;
[0201] S2. When it is queried that the value of the first configuration item of the first directory identifier is the first target value, search the memory cache based on the first directory identifier and the target object name;
[0202] S3. When the target object name is not found in the memory cache and the metadata of the N objects has not been fully loaded, read the target metadata of the target object from the target disk;
[0203] S4. Transmit the target metadata to the memory cache and load the target metadata of the target object in the memory cache.
[0204] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disk, magnetic disk, or optical disc, etc., various media that can store computer programs.
[0205] An embodiment of the present application also provides an electronic device, as Figure 8 shown, the electronic device includes a memory 802 and a processor 804. A computer program is stored in the memory 802, and the processor 804 is configured to execute the steps in any one of the above method embodiments through the computer program.
[0206] Optionally, in this embodiment, the above processor 804 may be configured to execute the following steps through the computer program:
[0207] S1. In response to a target service request, create a first list in the memory cache of the distributed storage system, where the first list is created based on the object names of N objects in the first directory of the distributed storage system, and the first list is used to describe the data processing logic for the string sequence corresponding to the object names without distinguishing by character attributes, and N is a positive integer greater than or equal to 1;
[0208] S2. When it is queried that the value of the first configuration item of the first directory identifier is the first target value, search the memory cache based on the first directory identifier and the target object name;
[0209] S3. When the target object name cannot be found in the memory cache and the metadata of the N objects has not been fully loaded, read the target metadata of the target object from the target disk;
[0210] S4. Transmit the target metadata to the memory cache and load the target metadata of the target object in the memory cache.
[0211] For the specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details are not described herein again.
[0212] Optionally, those of ordinary skill in the art can understand that Figure 8 the structure shown is only illustrative Figure 8 and does not limit the structure of the above electronic device. For example, the electronic device may further include more or fewer components (such as a network interface, etc.) than those shown Figure 8 or have a different configuration from that shown Figure 8 herein.
[0213] Among them, the memory 802 can be used to store software programs and modules, such as the program instructions / modules corresponding to the processing method of the target object and the processing device of the alarm information in the embodiments of the present application. The processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, that is, implements the above-mentioned processing method of the target object. The memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 802 may further include a memory remotely disposed relative to the processor 804, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 802 can specifically but not limitedly be used to store target service requests, first target values, target metadata, etc. As an example, as Figure 8 shown, the above memory 802 may include, but is not limited to, the creation unit 702, the search unit 704, the reading unit 706, and the loading unit 708 in the above-mentioned processing device of the target object. In addition, it may further include, but is not limited to, other module units in the above-mentioned verification device for the soft decoding function, which are not described in detail in this example.
[0214] Optionally, the above-mentioned transmission device 806 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 806 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable, so as to communicate with the Internet or a local area network. In one example, the transmission device 806 is a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0215] In addition, the above-mentioned electronic device further includes: a display 808; and a connection bus 810, which is used to connect each module component in the above-mentioned electronic device.
[0216] In other embodiments, the above-mentioned electronic device may be a node in a distributed system. Among them, the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting multiple nodes through network communication. Among them, the nodes can form a Peer To Peer (P2P) network, and any form of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the P2P network.
[0217] An embodiment of the present application further provides a computer program product. The above-mentioned computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any one of the above-mentioned method embodiments are implemented.
[0218] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any one of the above-mentioned method embodiments are implemented.
[0219] An embodiment of the present application further provides a computer program. The computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above-mentioned method embodiments.
[0220] Obviously, those skilled in the art should understand that the various modules or steps of the present application described above can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a sequence different from that here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present application is not limited to any specific combination of hardware and software.
[0221] The above are only the preferred embodiments of the present application and are not used to limit the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for processing a target object, characterized in that: include: In response to the target service request, a first list is created in a memory cache of the distributed storage system, wherein the first list is created based on object names of N objects under a first directory in the distributed storage system, the first list is used to describe data processing logic for character string sequences corresponding to the object names that are not distinguished according to character attributes, and N is a positive integer greater than or equal to 1; In the case where the value of the first configuration item identified by the first directory is found to be the first target value, searching the memory cache based on the first directory identifier and the target object name; If the target object name is not found in the memory cache and the metadata of the N objects are not completely loaded, read the target metadata of the target object from the target disk; The target metadata is transmitted to the memory cache, and the target metadata of the target object is loaded into the memory cache.
2. The method according to claim 1, characterized in that The step of creating a first list in a memory cache of the distributed storage system in response to the target service request includes: In response to the target service request, determining a data type and a storage structure of the character string; Determining an operation logic for the string sequence, wherein the operation logic includes an order in which each string in the string sequence is written into the first list and an order in which each string is deleted from the first list; In the case where the character attributes of the respective character strings are changed, determining the data processing logic that does not change the arrangement positions of the respective character strings in the first list according to the character attributes; The first list is generated based on the operation logic, the data processing logic and the respective character strings.
3. The method according to claim 1, characterized in that In the case where the value of the first configuration item of the first directory identifier is found to be the first target value, searching the memory cache based on the first directory identifier and the target object name includes two steps: In the case where the value of the first configuration item is found to be the first target value, searching the current list in the memory cache based on the first directory identifier and the target object name to obtain a first search result; in the case where the first search result indicates that there is a candidate object name matching the target object name in the current list, comparing the candidate character string of the candidate object name with the target character string of the target object name; When the candidate character string is identical to the target character string, the candidate character string is returned to the first list.
4. The method according to claim 1, characterized in that: In the case where the value of the first configuration item of the first directory identifier is found to be the first target value, searching the memory cache based on the first directory identifier and the target object name further includes: Based on the first directory identifier and the target object name, searching the current list in the memory cache to obtain a second search result; When the second search result indicates that there is no candidate object name matching the target object name in the current list, obtaining a loading status of the first directory; When the loading state of the first directory indicates that the N objects under the first directory are not completely loaded, searching whether the target object exists in the memory cache to obtain a third search result; Based on the third search result, the target metadata of the target object is loaded into the memory cache.
5. The method according to claim 4, characterized in that The step of loading the target metadata of the target object in the memory cache based on the third search result includes: When the third search result indicates that the target object exists in the memory cache, adding the target character string corresponding to the target object name to the first list; Based on the target string, loading the target metadata of the target object in the memory cache; or If the third search result indicates that the target object does not exist in the memory cache, based on the target character string, read the target metadata of the target object from the target disk, and transfer the target metadata to the memory cache; The target metadata of the target object is loaded in the memory cache.
6. The method according to any one of claims 1 to 5, characterized in that After transmitting the target metadata to the memory cache and loading the target metadata of the target object in the memory cache, the method further includes: When the value of the second configuration item identified by the first directory is the second target value, based on the object data in the memory cache, perform the following operations: When the memory space occupied by the object data in the memory cache is greater than a first preset threshold, clearing the metadata of some of the N objects; or When the number of directory identifiers in the memory cache is greater than a second preset threshold, clearing the first directory corresponding to the first directory identifier; or When the number of object names in each list in the memory cache is greater than a third preset threshold, clearing the object names of some objects in the N objects in the first list; or When the value of the third configuration item identified by the first directory is the third target value and the time interval between the access time to the first list and the current time is greater than a fourth preset threshold, clear the first list corresponding to the first directory, and modify the value of the first configuration item identified by the first directory from the first target value to a fourth target value; or When the memory space occupied by the object data in the memory cache is greater than the first preset threshold, a clearing operation is simultaneously performed on the metadata of some of the N objects and the object names of some of the N objects in the first list.
7. The method according to claim 6, characterized in that The method further comprises: In a case where a clearing operation is performed on metadata of some objects among the N objects in the memory cache, updating a partial character string of a partial object name corresponding to the partial object in the first list; In the case where a clearing operation is performed on the object names of some objects among the N objects in the first list, metadata of the some objects in the memory cache are allowed to remain unchanged.
8. A target object processing device, characterized in that: include: A creating unit, configured to create a first list in a memory cache of a distributed storage system in response to a target service request, wherein the first list is created based on object names of N objects under a first directory in the distributed storage system, the first list is used to describe data processing logic for character string sequences corresponding to the object names that are not distinguished according to character attributes, and N is a positive integer greater than or equal to 1; a search unit, configured to search the memory cache based on the first directory identifier and the target object name when it is found that the value of the first configuration item of the first directory identifier is the first target value; A reading unit, used to read the target metadata of the target object from the target disk when the target object name is not found in the memory cache and the metadata of the N objects are not completely loaded; a loading unit, used to transfer the target metadata to the memory cache and load the target metadata of the target object in the memory cache.
9. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor. When executed, the steps of the method described in any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data request processing method and device based on metadata loading
CN113821479A
Data access method and device, equipment and storage medium
CN116303267A
Reading method and device for Ceph file, server and storage medium
CN117493276A
Disk data processing method and device, storage medium and electronic equipment
CN118708504A
Table metadata cache refreshing method, medium, device, equipment and program product
CN119201940A
Cited By
Application starting method and device, terminal equipment and computer readable storage medium
CN121523759A