Renaming processing method, server, client and computer readable storage medium

By establishing a mapping relationship for object indexes in Hadoop and directly modifying the mapping key, the backup and deletion processes are avoided, renaming efficiency is improved, the problem of low renaming efficiency in existing technologies is solved, asynchronous deletion and asynchronous renaming are realized, and the efficiency of system input/output operations is improved.

CN116126248BActive Publication Date: 2026-02-24HANGZHOU HIKVISION SYST TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310130056.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-03
Publication Date
2026-02-24
Estimated Expiration
2043-02-03

AI Technical Summary

Technical Problem

In existing technologies, the renaming methods of the S3 protocol and Hadoop in object storage systems are inefficient, requiring backup and deletion processes, resulting in excessive number of system input/output operations, and posing risks of low deletion efficiency and loss of large amounts of data.

Method used

By establishing a mapping relationship for object indexes, only the mapping key value in the mapping relationship table of the target object name is modified, and replaced with the target object name in the mapping relationship table of the object name. This avoids the backup and deletion process, directly modifies the mapping key, and improves the renaming efficiency.

Benefits of technology

This invention improves the efficiency of renaming in Hadoop, solves the problem of low renaming efficiency in existing technologies, and addresses the technical issues that existing technologies have failed to effectively resolve. It also enables asynchronous deletion and asynchronous renaming, thereby improving the efficiency of system input/output operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116126248B_ABST
    Figure CN116126248B_ABST
Patent Text Reader

Abstract

The application discloses a renaming processing method, a server, a client and a computer readable storage medium. The method comprises the following steps: receiving a data request sent by a client, wherein the data request comprises at least one of a data write request, a data read request, a renaming request, a directory deletion request and a file deletion request; when it is detected that the data request is the renaming request, determining a first name and a second name carried in the data request; obtaining a target object name matched with the first name from a mapping relationship table, wherein the mapping relationship table comprises a corresponding relationship among the target object name, a mapping key and a mapping value, the mapping key comprises the target object name and a mapping value corresponding to an upper level object name of the target object name, and the mapping value comprises a UUID of the target object, wherein the UUID is used to indicate metadata and a data storage address of the target object; replacing the target object name in the mapping key with the second name, and sending feedback information of the renaming success to the client. The application improves the renaming efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer distributed storage, and in particular to a renaming processing method, a server, a client, and a computer-readable storage medium. Background Technology

[0002] Currently, the S3 protocol primarily uses backup and deletion processes for renaming targets. However, these processes can lead to excessive system input / output operations and low renaming efficiency. When Hadoop uses the S3 protocol to interface with an object storage system, the renaming method employed is the same as that in the S3 protocol, also suffering from low renaming efficiency. Summary of the Invention

[0003] The main purpose of this application is to provide a renaming processing method, server, client, and computer-readable storage medium, aiming to solve the technical problem of how to improve renaming efficiency.

[0004] To achieve the above objectives, this application provides a renaming processing method, which is applied to a server and includes:

[0005] Receive data requests sent by clients, the data requests including at least one of data write requests, data read requests, rename requests, directory deletion requests, and file deletion requests;

[0006] If a data request is detected to be a rename request, determine the first name and the second name carried in the data request;

[0007] Obtain the target object name that matches the first name from the mapping relationship table. The mapping relationship table includes the correspondence between the target object name, the mapping key and the mapping value. The mapping key includes the mapping value corresponding to the parent object name of the target object name and the target object name. The mapping value includes the universally unique identifier (UUID) of the target object. The UUID of the target object is used to indicate the metadata and data storage address of the target object.

[0008] Replace the target object name in the mapping table with the second name, and send a success message to the client.

[0009] This application also provides a renaming processing method, which is applied to a client and includes:

[0010] Generate a data request based on the user's input requirements and send the data request to the server;

[0011] If the data request is a rename request, receive feedback information from the server indicating that the rename was successful.

[0012] This application also provides a renaming processing apparatus, which is applied to a renaming processing device, and the renaming processing apparatus includes:

[0013] The receiving module is used to receive data requests sent by the client, the data requests including at least one of data write request, data read request, rename request, delete directory and delete file;

[0014] The determination module is used to determine the first name and the second name carried in the data request when the data request is detected to be a rename request;

[0015] The acquisition module is used to acquire the target object name that matches the first name from the mapping relationship table. The mapping relationship table includes the correspondence between the target object name, the mapping key and the mapping value. The mapping key includes the mapping value corresponding to the parent object name of the target object name and the target object name. The mapping value includes the universally unique identifier (UUID) of the target object. The UUID of the target object is used to indicate the metadata and data storage address of the target object.

[0016] The replacement module is used to replace the target object name in the mapping table with the second name and send a success message to the client.

[0017] This application also provides a renaming processing apparatus, which is applied to a renaming processing device, and the renaming processing apparatus includes:

[0018] The sending module is used to generate a data request based on the user's input requirements and send the data request to the server.

[0019] The feedback receiving module is used to receive feedback information indicating successful renaming sent by the server when the data request is a renaming request.

[0020] This application also provides a server, which is a physical device. The server includes a memory, a processor, and a program for the renaming processing method stored in the memory and executable on the processor. When the program for the renaming processing method is executed by the processor, it can implement the steps of the renaming processing method as described above.

[0021] This application also provides a client, which is a physical device. The client includes a memory, a processor, and a program of the renaming processing method stored in the memory and executable on the processor. When the program of the renaming processing method is executed by the processor, it can implement the steps of the renaming processing method as described above.

[0022] This application also provides a computer-readable storage medium storing a program implementing a renaming processing method, wherein when the program is executed by a processor, it implements the steps of the renaming processing method as described above.

[0023] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the renaming processing method described above.

[0024] This application provides a renaming processing method, a server, a client, and a computer-readable storage medium. First, upon detecting that the received data request is a renaming request, the method determines the first name and the second name carried in the data request. Then, it retrieves the target object name matching the first name from a mapping table, replaces the target object name with the second name, and sends a renaming success feedback message to the client. This avoids the shortcomings of existing technologies where backup and deletion processes are required during renaming, leading to low renaming efficiency. Only the target object name in the mapping key needs to be modified, thus improving renaming efficiency. Attached Figure Description

[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart illustrating the first embodiment of the renaming processing method of this application;

[0028] Figure 2 This is a flowchart illustrating the second embodiment of the renaming processing method in this application;

[0029] Figure 3 This is a flowchart illustrating the fifth embodiment of the renaming processing method in this application;

[0030] Figure 4This is a schematic diagram of the device structure of the hardware operating environment involved in the renaming processing method in the embodiments of this application.

[0031] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0032] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] Example 1

[0034] Because the S3 protocol renames directories by creating a new directory with a different name than the original directory; copying the metadata and data of all objects in the original directory to the new directory (also known as a deep copy of the metadata and data of all objects in the original directory); and deleting the original directory and all its objects. This involves both a backup and a deletion process. The S3 protocol also renames files similarly, including backup and deletion processes. While these processes can achieve the goal of renaming directories or files, they can lead to excessive system input / output operations and low renaming efficiency.

[0035] When Hadoop interfaces with the S3 protocol, the renaming method includes both backup and deletion processes. This results in excessive system input / output operations and low renaming efficiency. Furthermore, when Hadoop interfaces with S3 object storage, deleting a directory involves traversing all objects within that directory one by one, leading to low deletion efficiency and delayed interface responses. Moreover, Hadoop typically uses a chunked upload method when uploading large files using the S3 protocol to object storage systems, posing a risk of losing large amounts of data.

[0036] Therefore, in this embodiment, a mapping relationship is established for the object index to improve the efficiency of renaming directories / files in Hadoop, avoiding the large amount of data input / output generated by deep copying during renaming; enabling the deletion of directories to be executed asynchronously with a time complexity of O(1); for directories / files with the same name, repeated creation will not affect the use of the new directory / file with the same name if the asynchronous deletion is not completed. The file / directory's attr can follow the metadata storage of the object storage object, supporting custom metadata extensions. The Hadoop committer does not need to frequently access the mapping relationship during the write process, improving write performance; it does not need to frequently access the mapping relationship during the read process, improving data read performance. The append method is used to write data to the object storage, replacing the original object fragment upload method. There is no need to cache a large amount of fragment data on the client's local disk before uploading, reducing one disk I / O and improving data security.

[0037] This application provides a renaming processing method. In the first embodiment of the renaming processing method of this application, refer to... Figure 1 The renaming processing method is applied to the server side and includes:

[0038] Step S10: Receive a data request sent by the client. The data request includes at least one of the following: data write request, data read request, rename request, delete directory, and delete file.

[0039] Step S20: If the data request is detected to be a rename request, determine the first name and the second name carried in the data request;

[0040] Step S30: Obtain the target object name that matches the first name from the mapping relationship table. The mapping relationship table includes the correspondence between the target object name, the mapping key and the mapping value. The mapping key includes the mapping value corresponding to the parent object name of the target object name and the target object name. The mapping value includes the universal unique identifier (UUID) of the target object. The UUID of the target object is used to indicate the metadata and data storage address of the target object.

[0041] Step S40: Replace the target object name in the mapping table with the second name, and send a success message to the client.

[0042] This application's embodiments can be applied to the server side, where the server can be a physical machine, a virtual machine, or any device providing object storage services. An object can be a file or a directory. The directory is used to implement the directory hierarchy and permission management of the object storage system. The S3 protocol is an object storage protocol that abandons the directory tree structure and adopts a two-level data model of bucket-object (which can be understood as directory-object) to store data, simplifying read and write semantics, making it suitable for storing massive amounts of unstructured, read-heavy data. However, the current S3 protocol lacks direct object renaming functionality; object renaming can only be indirectly accomplished through a series of operations such as creating new objects, copying old objects to new objects, and deleting old objects. Furthermore, the current S3 protocol also lacks direct multi-level directory management functionality; multi-level directories are usually simulated using special separators in object names. This directory renaming is more complex and less efficient than object renaming.

[0043] Therefore, at least one object is stored on the server, and each object has its own corresponding object name. The client communicates with the server to display the object it needs. A mapping relationship is recorded for the object index using an object storage-based index mapping method, improving the efficiency of renaming directories / files on the client or in Hadoop. The server uses the object_key (a dynamic variable of the object) as the UUID (unique identifier) ​​of the directory / file. This mapping relationship is recorded as the mapping between directory / file name and object key. When renaming a directory, it is no longer necessary to back up and delete all objects under the directory; only the mapping key of the corresponding directory needs to be modified. When deleting a directory, it is not necessary to synchronously delete all files under the directory to return a successful deletion; only the directory needs to be deleted first, and then the files can be deleted asynchronously. When creating directories / files with the same name repeatedly, the generated obj-uuid changes, so that the use of new directories / files with the same name will not be affected if asynchronous deletion is not completed. The file / directory's attr (extended field information of the file system) is stored in the metadata of the object storage object, and it supports custom metadata extensions. Implement a Hadoop committer that generates an `obj-uuid` when creating a file / directory during data writing and returns it to the client Hadoop committer. This mapping is then removed during subsequent write operations, improving write performance. Conversely, when reading data, the `obj-uuid` corresponding to the file is returned when a file is opened and stored in the client Hadoop committer's cache. This mapping is then removed during subsequent read operations, improving read performance. Furthermore, the `append` method replaces the object-sharded upload method as the primary method for Hadoop data writing.

[0044] For step S10, a data request sent by the client is received, the data request including at least one of data write request, data read request, rename request, delete directory and delete file;

[0045] In this embodiment, the client first sends a data request to the server. After receiving the data request from the client, the server sends a response indicating successful receipt of the data request and determines the request type. In this embodiment, since the data request types include data write requests, data read requests, rename requests, and directory / file deletion requests, the server needs to determine the request type before performing different operations accordingly.

[0046] For step S20, if the data request is detected to be a rename request, the first name and the second name carried in the data request are determined;

[0047] In this embodiment, if the data request type is detected as a rename request, it is necessary to extract the first name and the second name carried in the data request. Furthermore, from the server's perspective, the object can be a file or a directory.

[0048] If the object is a file, its object name includes the directory name and file name of the directory to which the file belongs; if the object is a parent directory, its object name is the parent directory name; if the object is a subdirectory of a parent directory, its object name includes both the parent directory name and the subdirectory name. When a client device displays a directory at a certain level relative to the server, it displays the directory name of that level; similarly, when a client device displays a file, it displays the file name. Therefore, the user sees either the directory name of the current directory or the file name of the current file.

[0049] The first name can be the original object name of a certain object. The second name can be the new object name of the object, or it can be a part of the first name.

[0050] For step S30, the target object name that matches the first name is obtained from the mapping relationship table. The mapping relationship table includes the correspondence between the target object name, the mapping key and the mapping value. The mapping key includes the mapping value corresponding to the parent object name of the target object name and the target object name. The mapping value includes the universal unique identifier (UUID) of the target object. The UUID of the target object is used to indicate the metadata and data storage address of the target object.

[0051] In this embodiment, the filenames of files belonging to the same directory are all different; that is, each filename within the same directory is unique. Because the filenames within the same directory are unique, the object names stored on the server are also different. When the mapping table is presented in tabular format, the object name can be used as the primary key, and the object names can be arranged in ascending or descending lexicographical order, with an index created for this data column. Since the object name is merely the name of an object, the object names in the mapping table can be changed at any time. Because the characteristics of an object include its UUID, and the object's UUID is used to indicate the object's metadata and data storage address, and the object's metadata and data storage address remain unchanged, the UUID of the object corresponding to a given object name in the mapping table should remain constant. Specifically, in the mapping table, the mapping key for a first-level target can include a preset fixed UUID and the object name; for targets after the first-level directory, it can be the mapping value corresponding to the previous level directory and the name of the current level directory.

[0052] In this embodiment, the object storage bucket is used as the first-level directory, and the mapping relationship is recorded as: {fixed UUID + bucket name: first-level directory object_UUID}; the mapping relationship of the second-level directories under this bucket is recorded as: {first-level directory object_UUID + directory name: second-level directory object_UUID}; and so on, the mapping relationship of the third-level directories under this bucket is: {second-level directory object_UUID + directory name: third-level directory object_UUID}; the file mapping relationship under any first-level directory is: {directory object_UUID + file name: file object_UUID}. The mapping relationship table can be shown in Table 1 below:

[0053] directory / filename Mapping key Mapping value / bucket1 Fixed UUID + bucket name obj-uuid-1 / bucket1 / dir-1 obj-uuid-1+dir-1 obj-uuid-2 bucket1 / dir-2 obj-uuid-1+dir-2 obj-uuid-3 / bucket1 / dir-2 / file-1 obj-uuid-3+file-1 obj-uuid-4 / bucket1 / dir-2 / file-2 obj-uuid-3+file-2 obj-uuid-5

[0054] Table 1

[0055] For step S40, the target object name in the mapping table is replaced with the second name, and a success message for renaming is sent to the client.

[0056] In this embodiment, after determining the target object name corresponding to the first name from the mapping table, it is not necessary to perform backup and deletion processes on all objects under the target. Only the mapping key of the corresponding object name (such as a directory) needs to be modified. For example, if it is necessary to rename / bucket1 / dir-2 to / bucket1 / new-dir-2, no modifications are needed to file-1 and file-2. Only the mapping key of dir-2 needs to be modified to obj-uuid-1+new-dir-2, with a time complexity of O(1).

[0057] Therefore, the mapping key can be directly modified by replacing the target object name in the mapping key with the second name, while leaving the other parts of the mapping key unchanged. After the replacement is completed, a success notification message can be generated and sent to the client.

[0058] In this embodiment, when a received data request is detected to be a renaming request, the first name and the second name carried in the data request are determined, and the target object name matching the first name is obtained from the mapping table. The target object name is replaced with the second name, and a renaming success feedback message is sent to the client. This avoids the shortcomings of the prior art, which requires a backup and deletion process when renaming, resulting in low renaming efficiency. Only the target object name in the mapping key needs to be modified, thus improving the renaming efficiency.

[0059] Example 2

[0060] Furthermore, based on the first embodiment of this application, in another embodiment of this application, the same or similar content as in Embodiment 1 can be referred to the above description, and will not be repeated hereafter. Based on this, refer to... Figure 2 After step S10, which involves receiving a data request from the client, the process includes:

[0061] Step a: If the data request is detected to be for deleting a directory or deleting a file, determine the third name carried in the data request;

[0062] In this embodiment, upon receiving a data request and detecting that the request is for deleting a directory or file, the directory in the mapping table can be deleted. Therefore, it is necessary to first determine the object name (i.e., the third-party name) carried in the data request in order to determine which directory in the mapping table needs to be deleted.

[0063] Step b: Delete the matching object name that matches the third name in the mapping table, and back up the matching object name to the recycling module. The recycling module is used to asynchronously delete the file corresponding to the matching object name.

[0064] After determining the third name carried in the data request, this third name can be matched against all object names in the mapping table. The object name that matches the third name is taken as the matching object name. The matching object name can be a subdirectory, a parent directory, or a filename. Once the matching object name is determined, it can be deleted from the mapping table and backed up to a recycle bin-like module. Then, the recycle bin asynchronously deletes all files corresponding to the matching object name. In other words, when deleting a directory, it's not necessary to synchronously delete all files in the directory to return a successful deletion; the directory itself only needs to be deleted first, followed by asynchronous file deletion. For example, referring to Table 1 above, deleting / bucket1 / dir-2 does not require deleting files file-1 and file-2 sequentially. Instead, / bucket1 / dir-2 is first removed from the mapping table and backed up to a recycle bin-like module, and then the files in the / bucket1 / dir-2 directory are asynchronously deleted through the recycle bin.

[0065] In this embodiment, when the data request is to delete a directory or delete a file, only the matching object name that matches the third name in the mapping table is deleted, and then the file corresponding to the matching object name is deleted asynchronously by the recycling module. This achieves the goal that when deleting a directory, it is not necessary to synchronously delete all files in the directory in batches to return a successful deletion.

[0066] Example 3

[0067] Furthermore, based on the first and second embodiments of this application, in another embodiment of this application, the same or similar content as in the first embodiment can be referred to the above description, and will not be repeated hereafter.

[0068] Based on this, after step S10, which involves receiving a data request sent by the client, the following steps are included:

[0069] Step c: If the data request is detected to be a data write request, create an object name corresponding to the data request, generate a mapping value based on the UUID corresponding to the object name, store the generated mapping value and the object name in a mapping table, and feed the generated mapping value back to the client.

[0070] In this embodiment, upon receiving a data request and detecting that it is a data write request, it is necessary to determine whether the directory or filename corresponding to the data to be written is a first-time occurrence or a subsequent occurrence. If it is a subsequent occurrence, the directory or filename corresponding to the data request is found, and its corresponding mapping value is fed back to the client. If the data to be written is a first-time occurrence, an object name (such as a directory or filename) corresponding to the data request can be created. When creating the object name, a corresponding UUID is assigned, and a mapping value and mapping key are generated based on the UUID. For example, the object storage bucket is recorded as a first-level directory, with the mapping relationship recorded as: {fixed UUID + bucket name: first-level directory object_UUID}. The second-level directory under this bucket has the mapping relationship recorded as: {first-level directory object_UUID + directory name: second-level directory object_UUID}. Similarly, the third-level directory under this bucket has the mapping relationship as: {second-level directory object_UUID + directory name: third-level directory object_UUID}. In other words, when writing data, the obj-uuid is generated when creating the file / directory and returned to the client's Hadoop committer. This mapping relationship does not need to be accessed again during subsequent writing processes, thus improving writing performance.

[0071] After generating all the mapping values, they can be stored in a mapping table along with the object name, and the mapping values ​​corresponding to the generated object names can be fed back to the client. It should also be noted that in this embodiment, the filename or directory's attr (extended field information of the file system) is stored in the metadata of the object storage, and custom metadata extensions are supported.

[0072] Further, step c, the step of generating a mapping value based on the UUID corresponding to the object name, includes:

[0073] Step c1: If a duplicate object name with the same name as the object name is detected in the mapping table, determine the first mapping value corresponding to the duplicate object name;

[0074] Step c2: Generate a mapping value that is inconsistent with the first mapping value based on the UUID corresponding to the object name.

[0075] In this embodiment, when multiple object names corresponding to a data request are detected to be duplicated, different mapping values ​​can be generated for them during creation. That is, for directories or filenames with the same name, the generated obj-uuid changes when they are created repeatedly. This ensures that the use of new directories / files with the same name will not be affected if asynchronous deletion is not completed, because the obj-uuids in the mapping relationship are different. This effectively solves the problem of blocking when creating a directory / file with the same name immediately after deletion in a Hadoop scenario.

[0076] In this embodiment, if a directory or filename with the same name as an object is detected in the mapping table, it can be treated as a duplicate object name, and a mapping value corresponding to the duplicate object name, i.e., the first mapping value, can be determined. When generating a mapping value based on the UUID corresponding to the object name, it needs to be different from the first mapping value. Then, a corresponding mapping key is generated based on the UUID or the mapping value.

[0077] In this embodiment, when a data request is a data write request, a mapping value is generated when the object name is created and stored in the mapping table. Furthermore, when generating the mapping value, different mapping values ​​are generated for the same object name. This ensures that the use of a new directory / file with the same name will not be affected when asynchronous deletion is not completed.

[0078] Example 4

[0079] Furthermore, based on the first, second, and third embodiments of this application, in another embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description and will not be repeated hereafter. Based on this, after step S10, the step of receiving the data request sent by the client, the following is included:

[0080] Step d: If the data request is detected to be a data read request, determine the file corresponding to the data read request;

[0081] Step e: When the file is detected to be open, determine the mapping value corresponding to the file and send the mapping value back to the client.

[0082] In this embodiment, upon receiving a data request and detecting that it is a data read request, the filename or directory corresponding to the data read request needs to be determined. The corresponding file is then located in the mapping table. When the file is detected as open, the mapping value corresponding to that file in the mapping table is returned to the client. Furthermore, during data reading, when the file is opened, the corresponding mapping value, i.e., obj_uuid, is returned and recorded in the client's Hadoop committer cache. This mapping relationship is not accessed again during subsequent reads, improving data read performance.

[0083] In this embodiment, when a data request is detected as a data read request, the mapping value corresponding to the file is fed back to the client when the file corresponding to the data request is detected to be open. This eliminates the need to access the mapping relationship again during subsequent reading processes, thereby improving data reading performance.

[0084] Example 5

[0085] Furthermore, based on the first and second embodiments of this application, in another embodiment of this application, the same or similar content as in Embodiment 1 can be referred to the above description, and will not be repeated hereafter. This embodiment also provides a renaming processing method, applied to the client of the above embodiments, referring to... Figure 3 ,include:

[0086] Step S100: Generate a data request based on the user's input requirements and send the data request to the server.

[0087] In this embodiment, the renaming processing method is applied to the client, and the client is connected to the server in any of the embodiments one to five described above. Therefore, in the client, when the user's input request is detected to be a data request (e.g.), the request type of the data request can be determined first, including but not limited to: data write request, data read request, rename request, directory deletion, and file deletion at least one of these. Furthermore, if the data request is at least one of these, the data request will be sent to the server so that the server can process it accordingly.

[0088] Step S200: If the data request is a rename request, receive feedback information from the server indicating that the rename was successful.

[0089] In this embodiment, when a rename request is detected, feedback information sent by the server is received, including whether the rename was successful or failed. Similarly, when a request type such as delete directory, delete file, write data, or read data is detected, feedback information from the server is also received to determine whether the server successfully executed the data request.

[0090] In this embodiment, a data request is generated based on the user's input requirements and sent to the server. If the data request is determined to be a renaming request, its feedback information is received. This avoids the shortcomings of the prior art, which requires backup and deletion processes during renaming, resulting in low renaming efficiency. Only the target object name in the mapping key needs to be modified, thus improving renaming efficiency.

[0091] Example 6

[0092] Furthermore, based on the fifth embodiment of this application, in another embodiment of this application, the same or similar content as the fifth embodiment described above can be referred to the above description and will not be repeated hereafter. Based on this, after step S100, the step of receiving the data request sent by the client, the following is included:

[0093] Step x: If the data request is a data write request, receive the mapping value fed back by the server and store the mapping value in the Hadoop committer;

[0094] In this embodiment, if the detected data request is a data write request, after sending the data request to the server and receiving the mapping value from the server, the mapping value can be stored in the Hadoop committer's cache. Hadoop can then write the data to the server storage using an append method based on a custom protocol.

[0095] Step y: Divide the data to be written into data blocks according to the preset configuration values, and store the data blocks into a queue;

[0096] Step z involves retrieving data blocks from the queue using a task thread and sending the retrieved data blocks to the server for storage based on the mapping value in the Hadoop submitter.

[0097] Furthermore, in the write segment of data writing, the fragmented upload method is abandoned, and the append operation implementing the private protocol is used to write data.

[0098] Furthermore, when writing data to a file on the client side, the data is divided into several write requests. The size of the data block in each request can be configured (e.g., 64KB). When the data written by the user reaches the configured data block size, this data is placed into a queue as a single data block and processed by another task thread. The task thread continuously retrieves data blocks from the queue and then sends the retrieved data blocks to the server-side data storage via the network. After the current request is completed, the client receives a response message status code from the server-side data storage. If the status is a failure, all data blocks in the queue are resent; if the status is a success, the queue is cleared, and a new round of data writing operations continues. This is how client-side data is written to server-side object storage. The preset configuration value can be a user-defined value, such as 64KB.

[0099] In this embodiment, when the data request is a data write request, the mapping value returned by the server is stored in the Hadoop committer, and subsequent storage work is performed based on the mapping value in the Hadoop committer, thereby ensuring the effective storage of data.

[0100] Example 6

[0101] This application embodiment also provides a renaming processing apparatus, which is applied to a renaming processing device, and the renaming processing apparatus includes:

[0102] The receiving module is used to receive data requests sent by the client, the data requests including at least one of data write request, data read request, rename request, delete directory and delete file;

[0103] The determination module is used to determine the first name and the second name carried in the data request when the data request is detected to be a rename request;

[0104] The acquisition module is used to acquire the target object name that matches the first name from the mapping relationship table. The mapping relationship table includes the correspondence between the target object name, the mapping key and the mapping value. The mapping key includes the mapping value corresponding to the parent object name of the target object name and the target object name. The mapping value includes the universally unique identifier (UUID) of the target object. The UUID of the target object is used to indicate the metadata and data storage address of the target object.

[0105] The replacement module is used to replace the target object name in the mapping table with the second name and send a success message to the client.

[0106] This application embodiment also provides a renaming processing apparatus, which is applied to a renaming processing device, and the renaming processing apparatus includes:

[0107] The sending module is used to generate a data request based on the user's input requirements and send the data request to the server.

[0108] The feedback receiving module is used to receive feedback information indicating successful renaming sent by the server when the data request is a renaming request.

[0109] This application also provides a server, which is a physical device. The server includes a memory, a processor, and a program for the renaming processing method stored in the memory and executable on the processor. When the program for the renaming processing method is executed by the processor, it can implement the steps of the renaming processing method as described above.

[0110] The renaming processing apparatus provided by this invention employs the renaming processing method in the above embodiments, solving the technical problem of how to improve renaming efficiency. Compared with the prior art, the beneficial effects of the renaming processing apparatus provided by this invention are the same as those of the renaming processing method provided in the above embodiments, and other technical features in this renaming processing apparatus are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0111] Example 7

[0112] This application also provides a server, which is a physical device. The server includes a memory, a processor, and a program for the renaming processing method stored in the memory and executable on the processor. When the program for the renaming processing method is executed by the processor, it can implement the steps of the renaming processing method as described above.

[0113] This application also provides a client, which is a physical device. The client includes a memory, a processor, and a program of the renaming processing method stored in the memory and executable on the processor. When the program of the renaming processing method is executed by the processor, it can implement the steps of the renaming processing method as described above.

[0114] The server and client provided in this application can be electronic devices. See below for reference. Figure 4 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0115] like Figure 4 As shown, an electronic device may include a processing unit (such as a central processing unit, graphics processing unit, etc.) that can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) or a program loaded from a storage device into random access memory (RAM). The RAM also stores various programs and data required for the operation of the electronic device. The processing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0116] Typically, the following systems can be connected to the I / O interface: input devices including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices including, for example, magnetic tapes, hard disks, etc.; and communication devices. Communication devices allow electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although electronic devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.

[0117] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, it performs the functions defined above in the methods of embodiments of this disclosure.

[0118] The server and client provided by this invention employ the renaming processing method in the above embodiments, solving the technical problem of how to improve renaming efficiency. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiments of this invention are the same as those of the renaming processing method provided in Embodiment 1 above, and other technical features in this electronic device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0119] It should be understood that various parts of this disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.

[0120] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

[0121] Example 8

[0122] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, which are used to execute the renaming process method in Embodiment 1 above.

[0123] The computer-readable storage medium provided in this embodiment of the invention may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared systems or devices, or any combination thereof. More specific examples of the computer-readable storage medium may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0124] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.

[0125] The aforementioned computer-readable storage medium carries one or more programs.

[0126] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0127] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0128] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0129] The computer-readable storage medium provided by this invention stores computer-readable program instructions for executing the above-described renaming processing method, thus solving the technical problem of how to improve renaming efficiency. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiments of this invention are the same as the beneficial effects of the renaming processing method provided in the above-described embodiments, and will not be repeated here.

[0130] Example 9

[0131] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the renaming processing method described above.

[0132] The computer program product provided in this application solves the technical problem of how to improve renaming efficiency. Compared with the prior art, the beneficial effects of the computer program product provided in the embodiments of this invention are the same as the beneficial effects of the renaming processing method provided in the above embodiments, and will not be repeated here.

[0133] The above are merely preferred embodiments of this application and do not limit the scope of protection of this application. Any equivalent structural or procedural transformations made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of protection of this application.

Claims

1. A renaming processing method, characterized in that, Applied to the server side, including: Receive data requests sent by clients, the data requests including at least one of data write requests, data read requests, rename requests, directory deletion requests, and file deletion requests; If a data request is detected to be a rename request, determine the first name and the second name carried in the data request; Obtain the target object name that matches the first name from the mapping relationship table. The mapping relationship table includes the correspondence between the target object name, the mapping key and the mapping value. The mapping key includes the mapping value corresponding to the parent object name of the target object name and the target object name. The mapping value includes the universally unique identifier (UUID) of the target object. The UUID of the target object is used to indicate the metadata and data storage address of the target object. Replace the target object name in the mapping key of the mapping table with the second name, and send a successful renaming feedback message to the client; If the data request is detected to be for deleting a directory or deleting a file, determine the third name carried in the data request; Delete the matching object name that matches the third name in the mapping table, and back up the matching object name to the recycling module. The recycling module is used to asynchronously delete the file corresponding to the matching object name.

2. The renaming processing method as described in claim 1, characterized in that, After the step of receiving the data request sent by the client, the following steps are included: If the data request is detected to be a data write request, an object name corresponding to the data request is created, and a mapping value is generated based on the UUID corresponding to the object name. The generated mapping value and the object name are stored in a mapping table, and the generated mapping value is fed back to the client.

3. The renaming processing method as described in claim 2, characterized in that, The step of generating a mapping value based on the UUID corresponding to the object name includes: If a duplicate object name with the same name as the object name is detected in the mapping table, a first mapping value corresponding to the duplicate object name is determined; Generate a mapping value that is inconsistent with the first mapping value based on the UUID corresponding to the object name.

4. The renaming processing method as described in claim 1, characterized in that, After the step of receiving the data request sent by the client, the following steps are included: If the data request is detected to be a data read request, the file corresponding to the data read request is determined; When the file is detected to be open, the mapping value corresponding to the file is determined and the mapping value is fed back to the client.

5. A renaming processing method, characterized in that, Applied to the client as described in claim 1, comprising: Generate a data request based on the user's input requirements and send the data request to the server; If the data request is a rename request, receive feedback information from the server indicating that the rename was successful; The server is used to receive data requests sent by the client, and the data requests include at least one of the following: data write request, data read request, rename request, delete directory, and delete file; If a data request is detected to be a rename request, determine the first name and the second name carried in the data request; Obtain the target object name that matches the first name from the mapping relationship table. The mapping relationship table includes the correspondence between the target object name, the mapping key and the mapping value. The mapping key includes the mapping value corresponding to the parent object name of the target object name and the target object name. The mapping value includes the universally unique identifier (UUID) of the target object. The UUID of the target object is used to indicate the metadata and data storage address of the target object. Replace the target object name in the mapping key of the mapping table with the second name, and send a successful renaming feedback message to the client; If the data request is detected to be for deleting a directory or deleting a file, determine the third name carried in the data request; Delete the matching object name that matches the third name in the mapping table, and back up the matching object name to the recycling module. The recycling module is used to asynchronously delete the file corresponding to the matching object name.

6. The renaming processing method as described in claim 5, characterized in that, The client is configured with a Hadoop committer. After the step of sending the data request to the server, the following steps are included: In the case that the data request is a data write request, the mapping value fed back by the server is received and the mapping value is stored in the Hadoop committer; The data to be written is divided into data blocks according to the preset configuration values, and the data blocks are stored in a queue. The task thread extracts data blocks from the queue and sends the extracted data blocks to the server for storage according to the mapping value in the Hadoop submitter.

7. A server-side component, characterized in that, The server includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the steps of the renaming processing method according to any one of claims 1 to 6.

8. A client application, characterized in that, The client includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the steps of the renaming processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that implements the renaming processing method, the program being executed by a processor to implement the steps of the renaming processing method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Renaming method, access method and device

    CN106484820A