Directory renaming method and device based on object storage, equipment and medium

By writing temporary objects and updating directory attribute information in the object store, using the target queue and multiple execution threads to perform directory renaming, the problem of directory renaming in the object store is solved, and a fast and efficient directory renaming operation is achieved.

CN119645938APending Publication Date: 2025-03-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411790476.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the process of enterprises migrating application data to object storage, the directory renaming operation is often delayed, especially the directory renaming containing a large number of sub-files, which may take more than tens of minutes, resulting in application request timeout and long-term business blockage, seriously affecting customer use.

Method used

Provide a directory renaming method based on object storage. By writing object storage into temporary objects and updating directory attribute information, recording renaming file information to the target queue, and performing multiple thread renaming conversion based on the renaming information in the target queue, finally deleting the renaming file information in the target queue, and detecting the queue to determine whether directory renaming is completed.

Benefits of technology

Quickly complete the directory renaming operation containing a large number of files, avoid long-term business blockage, and improve user convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645938A_ABST
    Figure CN119645938A_ABST
Patent Text Reader

Abstract

The invention relates to a directory renaming method and device based on object storage, equipment and a medium. The method comprises the steps that in response to a directory renaming request, object storage is written into a temporary object, and source directory attribute information of the directory renaming request is updated into the temporary object; recording the renamed file information to a target queue; performing multi-execution-thread renaming conversion based on the renaming information in the target queue, and deleting the renaming file information in the target queue after the renaming conversion is completed; and detecting the target queue to determine whether directory renaming is completed or not. At least the directory renaming operation containing a large number of files can be rapidly completed, long-time service blocking is avoided, and the use convenience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of distributed object storage, and in particular to a directory renaming method, device, equipment and medium based on object storage. Background Art

[0002] With the rapid development of cloud computing and big data technology, object storage has gradually become the mainstream form of data storage. For some newer enterprise application data on the cloud, you can directly access object storage through the RESTful API protocol or SDK protocol to upload, download, and traverse objects. For some relatively old enterprise applications, data can usually only be saved in the form of files in the specified directory of the local file system. At this time, you need to use the file gateway to map the object storage to the local file system. The application uses the object storage just like accessing the local file system. For example, the open source software S3FS meets this requirement.

[0003] However, when enterprises migrate application data to object storage, they will inevitably encounter directory renaming scenarios, and S3FS often has a high latency for directory renaming operations. The fundamental reason is that when the directory renaming of the file system semantics is converted into object renaming, all sub-files and objects corresponding to the sub-directories under the directory are renamed, and the renaming request processing process for each object is divided into two steps: first copy the old object data to a new object, and then delete the old object. For directory renaming operations with a large number of sub-files, the entire response process may take more than tens of minutes, causing application request timeouts and long-term business blocking, seriously affecting customer use. For example: If the directory contains 10,000 sub-files, 10,000 object renaming requests will be generated, which will be decomposed into at least 1 directory traversal request, 10,000 COPY requests, and 10,000 DELETE requests. Summary of the invention

[0004] Based on this, it is necessary to provide a directory renaming method, device, equipment and medium based on object storage to address the above technical problems, which can at least quickly complete the directory renaming operation containing a large number of files, avoid long-term business congestion, and improve user convenience.

[0005] In a first aspect, the present application provides a directory renaming method based on object storage, comprising: in response to a directory renaming request, writing object storage in a temporary object, and updating source directory attribute information of the directory renaming request into the temporary object;

[0006] Record renamed file information to the target queue;

[0007] Perform multi-thread renaming conversion based on the renaming information in the target queue, and delete the renamed file information in the target queue after completing the renaming conversion;

[0008] The target queue is checked to determine whether the directory renaming is completed.

[0009] In one embodiment, the method further comprises:

[0010] In response to a read directory request, traverse the target queue and compare the directory path to be read with the absolute path field and the target path field of the target data structure;

[0011] If the directory path to be read is the same as the absolute path field or the target path field of the target data structure, then the directory list is read from both the absolute path field and the target path field of the target data structure and returned to the client;

[0012] If the directory path to be read is different from the absolute path field and the target path field of the target data structure, the directory list is read from the directory path to be read and returned to the client.

[0013] In one embodiment, the method further comprises:

[0014] In response to a delete directory request, traverse the target queue and compare the directory path to be read with the absolute path field and the target path field of the target data structure;

[0015] If the directory path to be read is the same as the absolute path field or the target path field of the target data structure, the directory renaming operation is interrupted and the directory deletion operation is performed;

[0016] If the directory path to be read is different from both the absolute path field and the target path field of the target data structure, the directory deletion operation is performed.

[0017] In one embodiment, the renamed file information is recorded to the target queue by the following steps:

[0018] When the file gateway is started, an empty queue is created to store the metadata information of the directory to be renamed;

[0019] Create a detection thread and multiple execution threads, and initiate a GET request to the object storage to verify whether the rename root directory exists;

[0020] If it does not exist, create a directory object as the rename root directory;

[0021] If it exists, traverse the rename root directory sub-object, fill the target data structure with the metadata information of the directory to be renamed and insert it into the queue.

[0022] In one embodiment, the renaming conversion is performed by the following steps:

[0023] In response to a user renaming operation on a target directory in a file gateway shared directory;

[0024] Obtain metadata information of the renamed target directory, fill in a target data structure and insert the target data structure into a target queue;

[0025] Send a PUT request for a new object and activate the detection thread to determine whether the directory rename is completed

[0026] In one embodiment, the detection thread performs the following steps:

[0027] Loop through the queue;

[0028] If the queue is empty, the thread goes into sleep mode;

[0029] If the queue is not empty, obtain a target data structure of the directory to be renamed;

[0030] Traverse the directory to be renamed;

[0031] If the child node is a file or an empty directory, activate the execution thread;

[0032] If the child node is a non-empty directory, the detection thread recursively traverses until the child node is a file or an empty directory, activating multiple execution threads;

[0033] After multiple execution threads concurrently complete the renaming operation of the file or empty directory object, the object to be renamed is deleted;

[0034] Delete the target data structure from the queue.

[0035] In the second aspect, the present application also provides a directory renaming device based on object storage, including a directory renaming response module, a target queue recording module, a renaming conversion module and a renaming detection module, the directory renaming response module is used to respond to a directory renaming request, write the object storage in a temporary object, and update the source directory attribute information of the directory renaming request to the temporary object; the target queue recording module is used to record the renaming file information to the target queue; the renaming conversion module is used to perform multi-execution thread renaming conversion based on the renaming information in the target queue, and delete the renaming file information in the target queue after completing the renaming conversion; the renaming detection module is used to detect the target queue to determine whether the directory renaming is completed.

[0036] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0037] In response to a directory rename request, writing the object storage in a temporary object and updating the source directory attribute information of the directory rename request into the temporary object;

[0038] Record renamed file information to the target queue;

[0039] Perform multi-thread renaming conversion based on the renaming information in the target queue, and delete the renamed file information in the target queue after completing the renaming conversion;

[0040] The target queue is checked to determine whether the directory renaming is completed.

[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0042] In response to a directory rename request, writing the object storage in a temporary object and updating the source directory attribute information of the directory rename request into the temporary object;

[0043] Record renamed file information to the target queue;

[0044] Perform multi-thread renaming conversion based on the renaming information in the target queue, and delete the renamed file information in the target queue after completing the renaming conversion;

[0045] The target queue is checked to determine whether the directory renaming is completed.

[0046] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0047] In response to a directory rename request, writing the object storage in a temporary object and updating the source directory attribute information of the directory rename request into the temporary object;

[0048] Record renamed file information to the target queue;

[0049] Perform multi-thread renaming conversion based on the renaming information in the target queue, and delete the renamed file information in the target queue after completing the renaming conversion;

[0050] The target queue is checked to determine whether the directory renaming is completed. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0052] Figure 1 A schematic diagram of a process of a directory renaming method based on object storage in one embodiment;

[0053] Figure 2 A schematic diagram for comparing the processes of a directory renaming method based on object storage in one embodiment;

[0054] Figure 3 A schematic diagram of the initialization process in a directory renaming method based on object storage in one embodiment;

[0055] Figure 4 A schematic diagram of a process of renaming conversion in a directory renaming method based on object storage in one embodiment;

[0056] Figure 5 A schematic diagram of a flow chart of a detection thread in a directory renaming method based on object storage in one embodiment;

[0057] Figure 6 A schematic diagram of a flow chart of an execution thread in a directory renaming method based on object storage in one embodiment;

[0058] Figure 7 A schematic diagram of a process of reading a directory in one embodiment;

[0059] Figure 8 A schematic diagram of a process of deleting a directory in one embodiment;

[0060] Fig. 9 It is a structural block diagram of a directory renaming device based on object storage in one embodiment;

[0061] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment.

[0062] Reference numerals and descriptions:

[0063] 10. Directory rename response module; 20. Target queue record module; 30. Rename conversion module; 40. Rename detection module. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] The object storage-based directory renaming method provided in the embodiment of the present application can be applied to various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc.

[0066] Please refer to Figure 1 In an exemplary embodiment, a directory renaming method based on object storage is provided, including the following steps S101 to S104. Among them:

[0067] Step S101, in response to a directory rename request, writing object storage into a temporary object, and updating source directory attribute information of the directory rename request into the temporary object.

[0068] Step S102, recording the renamed file information to the target queue.

[0069] S103, performing multi-thread renaming conversion based on the renaming information in the target queue, and deleting the renamed file information in the target queue after completing the renaming conversion.

[0070] S104: Check the target queue to determine whether directory renaming is completed.

[0071] For details, please refer to Figure 2 In an exemplary embodiment, a process comparison diagram of a directory renaming method based on object storage is provided.

[0072] like Figure 2 As shown in , in the renaming process of the present application and the prior art, steps S201, S203 and S204 are the same or similar to the steps in the prior art and are not repeated here.

[0073] As an example, in step S202, through multiple modules in the file storage gateway, in response to a request for directory renaming, the renaming request for multiple sub-objects can be converted into a request for creating a new object. There is no need to adopt the prior art of converting the directory renaming request into a renaming request for multiple sub-objects. It can be seen that the present application can quickly complete the directory renaming operation containing a large number of files, avoid long-term business congestion, and improve user convenience.

[0074] Specifically, the initialization module mainly performs the following steps: when the file gateway starts, it creates an empty queue to save the metadata information of the directory to be renamed; creates a detection thread and multiple execution threads, and initiates a GET request to the object storage to verify whether the rename root directory exists; if it does not exist, creates a directory object as the rename root directory; if it exists, it traverses the rename root directory sub-objects to obtain the object (directory to be renamed) metadata information; fills the renameEntry data structure and inserts it into the queue.

[0075] Specifically, the rename conversion module mainly performs the following steps: responding to the user entering the file gateway shared directory and renaming one of the directories; the file gateway receives the directory rename request, obtains the renamed directory metadata information, fills in the renameEntry data structure and inserts it into the queue; the file gateway sends a PUT request for a new object; activates the detection thread module; after processing is completed, returns a response to the client.

[0076] The object name is: / rename root directory / srcpath. The object metadata (x-amz-meta-uid, x-amz-meta-gid, x-amz-meta-mode, x-amz-meta-atime, x-amz-meta-mtime, x-amz-meta-rename-to) correspond to the relevant fields of the renameEntry data structure.

[0077] Specifically, the background thread module mainly performs the following steps: the detection thread loops through the queue. If the queue is empty, the thread enters a dormant state; if the queue is not empty, a renameEntry structure of the directory to be renamed is obtained; the detection thread traverses the directory to be renamed, and if the child node is a file or an empty directory, the execution thread is activated. If the child node is a non-empty directory, the detection thread recursively traverses until the child node is a file or an empty directory, and the execution thread is activated; multiple execution threads concurrently complete the renaming operation of the file or empty directory object; after all execution threads complete the operation, the detection thread deletes the object to be renamed, and the data object name is: / rename root directory / srcpath; the detection thread deletes the renameEntry structure in the queue; after the processing is completed, a response is returned to the client.

[0078] Specifically, when the operation processing module receives a request to read a directory (readdir), it processes as follows: When the file gateway receives a request to read a directory, it traverses the queue and compares the path of the directory to be read with the srcpath field and the destpath field of the renameEntry structure; if path is the same as srcpath or destpath, the file gateway reads the directory list from both srcpath and destpath and returns it to the client; otherwise, if it is different from both srcpath and destpath, the file gateway reads the directory list from path and returns it to the client.

[0079] Specifically, when the operation processing module receives a request to delete a directory (rmdir), it processes as follows: When the file gateway receives a request to delete a directory, it traverses the queue and compares the path of the directory to be deleted with the srcpath field and the destpath field of the renameEntry structure; if the path is the same as the srcpath or destpath, the file gateway interrupts the operation of renaming the directory, executes the directory deletion operation and returns it to the client; otherwise, if it is different from both the srcpath and the destpath, the file gateway directly executes the directory deletion operation and returns it to the client.

[0080] Specifically, when the operation processing module receives requests to obtain attributes (getattr), read files (read), write files (write), and delete files (unlink), it processes as follows: when the gateway receives a request to operate a file (get attributes, read files, write files), if the file is being renamed, it waits for the renaming to be completed before performing the corresponding operation; when the gateway receives a request to delete a file, if the file is being renamed, it interrupts the renaming operation and performs the deletion operation; after the processing is completed, it returns to the client.

[0081] Specifically, the renamed file information is recorded to the target queue through the following steps: when the file gateway is started, an empty queue is created to save the metadata information of the directory to be renamed; a detection thread and multiple execution threads are created, and a GET request is initiated to the object storage to verify whether the renamed root directory exists.

[0082] For example, see Figure 3 In an exemplary embodiment, a schematic diagram of the initialization process in a directory renaming method based on object storage is provided, including steps S301 to S305.

[0083] After the gateway is started, that is, after the file gateway is started.

[0084] Execute step S301, including: 1. Create an empty queue; 2. Create a detection thread; 3. Create multiple execution threads.

[0085] Step S302, determining the attributes of the acquired rename root directory.

[0086] As an example, the properties of the rename root directory can be obtained through the following steps: Initiate a GET request to the object storage to verify whether the rename root directory exists.

[0087] If the rename root directory exists, execute step S303, including: 1. traverse the rename root directory; 2. obtain child object attributes.

[0088] Step S304 includes: 1. Filling the renameEntry structure; 2. Inserting into the queue.

[0089] Among them, the renameEntry structure is one of the target data structures.

[0090] Among them, the renamed root directory and sub-object attributes constitute metadata information. For example, the metadata information may be “x-amz-meta-uid, x-amz-meta-gid, x-amz-meta-mode, x-amz-meta-uid-atime, x-amz-meta-mtime, x-amz-meta-rename-to”.

[0091] Specifically, you can perform the renaming conversion by following the steps below:

[0092] In response to a user's renaming operation on a target directory in a file gateway shared directory; obtaining metadata information of the renamed target directory, filling a target data structure and inserting the target data structure into a target queue; sending a PUT request for a new object, and activating a detection thread to determine whether the directory renaming is completed.

[0093] For example, see Figure 4 In an exemplary embodiment, a flowchart of renaming conversion in a directory renaming method based on object storage is provided.

[0094] like Figure 4 As shown in , the steps of renaming conversion in the directory renaming method based on object storage include:

[0095] Step S401 includes: 1. The gateway obtains a rename request; 2. Obtains directory metadata information; 3. Fills in a renameEntry structure; 4. Inserts into a queue.

[0096] Step S402, create a new object, object name: / rename directory / srcpath.

[0097] Among them, srcpath is an absolute path.

[0098] Step S403: Update object metadata, specific fields such as Figure 4 As shown in , I will not repeat them here.

[0099] Step S404, activating the detection thread.

[0100] Specifically, the detection thread performs the following steps: looping through the queue; if the queue is empty, the thread enters a dormant state; if the queue is not empty, obtaining a target data structure of a directory to be renamed; traversing the directory to be renamed; if the child node is a file or an empty directory, activating the execution thread; if the child node is a non-empty directory, the detection thread recursively traverses until the child node is a file or an empty directory, activating multiple execution threads; after multiple execution threads concurrently complete the renaming operation of the file or empty directory object, deleting the object to be renamed; deleting the target data structure in the queue.

[0101] For details, please refer to Figure 5 In an exemplary embodiment, a flowchart of a detection thread in a directory renaming method based on object storage is provided.

[0102] like Figure 5 As shown, the steps of detecting threads in the directory renaming method based on object storage include:

[0103] Step S501, start the detection thread.

[0104] Step S502, loop through the queue and determine whether it is empty.

[0105] If the queue is empty, execute step S509 and sleep.

[0106] If the queue is not empty, step S503 is executed to obtain the head element of the queue, read the metadata of the directory to be renamed, and read and traverse the directory to be renamed.

[0107] Step S504, determining whether the traversal of the directory to be renamed is completed.

[0108] If the traversal of the directory to be renamed is completed, step S508 is executed to wait for all execution threads to complete execution.

[0109] Step S509, deleting the queue of directory objects to be renamed and removing them to release memory.

[0110] If the traversal of the directory to be renamed is not completed, step S505 is executed to determine whether the child node is a non-empty directory.

[0111] If the child node is a non-empty directory, step S506 is executed to read and traverse the subdirectories.

[0112] If the child node is not a non-empty directory, step S510 is executed to activate the execution thread.

[0113] For details, please refer to Figure 6 , Figure 6 FIG. 1 is a flow chart of an execution thread in a directory renaming method based on object storage in one embodiment. Figure 6 As shown in , the execution threads in the directory renaming method based on object storage include:

[0114] Step S601: the execution thread is activated.

[0115] Step S602: multiple execution threads execute renaming conversion in parallel.

[0116] Step S603, rename the sub-file and rename the empty directory.

[0117] Step S604, executing thread hibernation.

[0118] Optionally, the method further includes: in response to a request to read a directory, traversing the target queue, and comparing the directory path to be read with the absolute path field and the target path field of the target data structure; if the directory path to be read is the same as the absolute path field or the target path field of the target data structure, then reading the directory list from the absolute path field and the target path field of the target data structure at the same time and returning it to the client; if the directory path to be read is different from both the absolute path field and the target path field of the target data structure, then reading the directory list from the directory path to be read and returning it to the client.

[0119] For example, see Figure 7 , Figure 7 FIG. 1 is a flow chart of reading a directory in an embodiment. Figure 7 As shown in , the process of reading a directory includes:

[0120] Step S701, responding to a request to read a directory.

[0121] Step S702 includes: 1. traversing the queue; 2. comparing whether the path of the directory to be read is the same as the srcpath or despath of the renamed directory to be read.

[0122] Here, srcpath is the absolute path and despath is the target path.

[0123] If not, execute step S706 to read the path directory list.

[0124] If yes, execute step S704, including: 1. Read the srcpath directory list; 2. Read the despath directory list.

[0125] Step S705: Merge the read lists.

[0126] Optionally, the method further includes: in response to a request to delete a directory, traversing the target queue, and comparing the directory path to be read with the absolute path field and the target path field of the target data structure; if the directory path to be read is the same as the absolute path field or the target path field of the target data structure, interrupting the operation of renaming the directory and executing the operation of deleting the directory; if the directory path to be read is different from both the absolute path field and the target path field of the target data structure, executing the operation of deleting the directory.

[0127] Please refer to Figure 8 , Figure 8 FIG. 1 is a flow chart of deleting a directory in one embodiment. Figure 8 As shown in the figure, the process of deleting a directory includes:

[0128] Step S801, responding to a directory deletion request.

[0129] Step S802 includes 1. traversing the queue; 2. comparing whether the path of the directory to be read is the same as the srcpath or despath of the renamed directory to be read.

[0130] If the path of the directory to be read is the same as the srcpath or despath of the renamed directory to be read, step S805 is executed to perform a directory deletion operation.

[0131] If the path of the directory to be read is not the same as the srcpath or despath of the directory to be read and renamed, step S803 is executed to interrupt the renaming operation of all execution threads and remove the directory to be deleted from the queue.

[0132] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0133] Based on the same inventive concept, the embodiment of the present application also provides an object storage-based directory renaming device of an object storage-based directory renaming method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more object storage-based directory renaming device embodiments provided below can refer to the limitations of the object storage-based directory renaming method above, and will not be repeated here.

[0134] Please refer to Fig. 9 In an exemplary embodiment, a directory renaming device based on object storage is provided, including: a directory renaming response module 10, a target queue recording module 20, a renaming conversion module 30 and a renaming detection module 40, the directory renaming response module is used to respond to a directory renaming request, write the object storage in a temporary object, and update the source directory attribute information of the directory renaming request to the temporary object; the target queue recording module is used to record the renaming file information to the target queue; the renaming conversion module is used to perform multi-threaded renaming conversion based on the renaming information in the target queue, and delete the renaming file information in the target queue after completing the renaming conversion; the renaming detection module is used to detect the target queue to determine whether the directory renaming is completed.

[0135] Each module in the above-mentioned directory renaming device based on object storage can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0136] In an exemplary embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a multimodal information generation method based on a visual regression model is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0137] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0138] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0139] In response to a directory rename request, writing the object storage in a temporary object and updating the source directory attribute information of the directory rename request into the temporary object;

[0140] Record renamed file information to the target queue;

[0141] Perform multi-thread renaming conversion based on the renaming information in the target queue, and delete the renamed file information in the target queue after completing the renaming conversion;

[0142] The target queue is checked to determine whether the directory renaming is completed.

[0143] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0144] In response to a directory rename request, writing the object storage in a temporary object and updating the source directory attribute information of the directory rename request into the temporary object;

[0145] Record renamed file information to the target queue;

[0146] Perform multi-thread renaming conversion based on the renaming information in the target queue, and delete the renamed file information in the target queue after completing the renaming conversion;

[0147] The target queue is checked to determine whether the directory renaming is completed.

[0148] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0149] In response to a directory rename request, writing the object storage in a temporary object and updating the source directory attribute information of the directory rename request into the temporary object;

[0150] Record renamed file information to the target queue;

[0151] Perform multi-thread renaming conversion based on the renaming information in the target queue, and delete the renamed file information in the target queue after completing the renaming conversion;

[0152] The target queue is checked to determine whether the directory renaming is completed.

[0153] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0154] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0155] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A directory renaming method based on object storage, characterized in that: The method comprises: In response to a directory rename request, writing the object storage in a temporary object and updating the source directory attribute information of the directory rename request into the temporary object; Record renamed file information to the target queue; Perform multi-thread renaming conversion based on the renaming information in the target queue, and delete the renamed file information in the target queue after completing the renaming conversion; The target queue is checked to determine whether the directory renaming is completed.

2. The directory renaming method according to claim 1, characterized in that: The method further comprises: In response to a read directory request, traverse the target queue and compare the directory path to be read with the absolute path field and the target path field of the target data structure; If the directory path to be read is the same as the absolute path field or the target path field of the target data structure, then the directory list is read from both the absolute path field and the target path field of the target data structure and returned to the client; If the directory path to be read is different from the absolute path field and the target path field of the target data structure, the directory list is read from the directory path to be read and returned to the client.

3. The directory renaming method according to claim 1, characterized in that: The method further comprises: In response to a delete directory request, traverse the target queue and compare the directory path to be read with the absolute path field and the target path field of the target data structure; If the directory path to be read is the same as the absolute path field or the target path field of the target data structure, the directory renaming operation is interrupted and the directory deletion operation is performed; If the directory path to be read is different from both the absolute path field and the target path field of the target data structure, the directory deletion operation is performed.

4. The directory renaming method according to claim 1, characterized in that: Record the renamed file information to the target queue by following the steps below: When the file gateway is started, an empty queue is created to store the metadata information of the directory to be renamed; Create a detection thread and multiple execution threads, and initiate a GET request to the object storage to verify whether the rename root directory exists; If it does not exist, create a directory object as the rename root directory; If it exists, traverse the rename root directory sub-object, fill the target data structure with the metadata information of the directory to be renamed and insert it into the queue.

5. The directory renaming method according to claim 1, characterized in that: Perform the renaming conversion by following these steps: In response to a user renaming operation on a target directory in a file gateway shared directory; Obtain metadata information of the renamed target directory, fill in a target data structure and insert the target data structure into a target queue; Send a PUT request for the new object and activate the detection thread to determine whether the directory rename is complete.

6. The directory renaming method according to claim 5, characterized in that: The detection thread performs the following steps: Loop through the queue; If the queue is empty, the thread goes into sleep mode; If the queue is not empty, obtain a target data structure of the directory to be renamed; Traverse the directory to be renamed; If the child node is a file or an empty directory, activate the execution thread; If the child node is a non-empty directory, the detection thread recursively traverses until the child node is a file or an empty directory, activating multiple execution threads; After multiple execution threads concurrently complete the renaming operation of the file or empty directory object, the object to be renamed is deleted; Delete the target data structure from the queue.

7. A directory renaming device based on object storage, characterized in that: The device comprises: A directory rename response module, configured to respond to a directory rename request, write an object storage in a temporary object, and update the source directory attribute information of the directory rename request into the temporary object; The target queue recording module is used to record the renamed file information to the target queue; A renaming conversion module, used for performing multi-threaded renaming conversion based on the renaming information in the target queue, and deleting the renaming file information in the target queue after completing the renaming conversion; The rename detection module is used to detect the target queue to determine whether the directory rename is completed.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.