Object storage metadata management method based on SQL (Structured Query Language)
By structuring and storing the metadata of the object storage system in a relational database, combining SQL queries and request forwarding of the object storage gateway, the consistency, efficiency and complexity of metadata management in traditional object storage systems are solved, and efficient metadata management and complex query capabilities are achieved.
Patent Information
- Application Number
- CN202411593771.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-25
AI Technical Summary
When traditional object storage systems process unstructured data, metadata management has data consistency problems, low query efficiency and high operation and maintenance complexity, making it difficult to meet the needs of complex queries and system scalability.
By structuring the metadata of the object storage system into a relational database table and synchronously storing it in a relational database, SQL statements are used to perform complex queries, and combining the object storage gateway for request forwarding and metadata operations.
It improves the data consistency and management efficiency of object storage systems, enhances the performance and query efficiency of complex queries, and reduces operation and maintenance complexity.
Smart Images

Figure CN119513091A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and in particular relates to an object storage metadata management method based on SQL. Background Art
[0002] In modern information systems, data shows a diversified trend and is mainly divided into two categories: structured data and unstructured data. Structured data is usually well-formatted data that can be stored in a relational database with a fixed table structure to facilitate complex queries and transaction management. This type of data includes typical data sets such as user information and transaction records. Unstructured data such as pictures, videos, documents, log files, etc. are usually stored in object storage systems because of their different formats and irregular contents. Object storage systems are designed for large-scale distributed storage and can store massive data in an efficient and low-cost manner, and access them through unique identifiers (such as object IDs).
[0003] With the rapid development of emerging technologies such as cloud computing, the Internet of Things, and artificial intelligence, information systems are facing the challenge of large-scale growth of unstructured data. In this context, how to efficiently manage and retrieve these unstructured data has become a key issue. Especially in object storage systems, metadata management has a crucial impact on performance, scalability, and query efficiency. Metadata contains key information about each object (such as creation time, file size, access rights, etc.), and the quality of metadata management directly affects the operating efficiency and user experience of the object storage system. Traditional object storage systems mostly rely on NoSQL databases or distributed hash tables (DHT) to manage metadata. These solutions can meet basic needs in the early days, but with the rapid growth of data scale, especially in processing complex queries, ensuring data consistency, and system scalability, traditional solutions have exposed many shortcomings.
[0004] For example, structured data is usually stored in a relational database, while unstructured data is stored in an object storage system. When a user deletes an object in an object storage system and then updates the metadata after the deletion, the metadata may not be removed from the relational database in time, resulting in invalid records still being retained in the database. Conversely, when the metadata is updated in the relational database, it may not be synchronized to the object storage system, resulting in information inconsistency. Moreover, managing the object storage system and the relational database as two independent systems will greatly increase the complexity of operation and maintenance, resulting in low management efficiency. Moreover, as the amount of data increases, especially when it comes to complex metadata queries, NoSQL cannot efficiently support such complex query operations. In contrast, relational databases provide a powerful SQL query language that supports complex query operations such as multi-table association, aggregation, sorting, and filtering. Therefore, a metadata management method that can combine an object storage system with a relational database is needed to solve the deficiencies mentioned in the above content. The present invention solves this technical problem. Summary of the invention
[0005] The present invention provides an object storage metadata management method based on SQL, which improves the data consistency and management efficiency of the object storage system by combining the object storage system with a relational database, improves the performance of performing complex queries, and improves the query efficiency.
[0006] A SQL-based object storage metadata management method includes the following steps:
[0007] S1. Structuring the metadata of the object storage system to conform to the form of a relational database table to form a metadata table;
[0008] S2. Synchronously store the metadata of the object storage system in a relational database to facilitate complex queries on the metadata through SQL statements;
[0009] S3, the client interacts with the object storage system and relational database through the object storage gateway. The object storage gateway has a metadata operation interface, which facilitates users to query metadata;
[0010] S4. After the user initiates a request through the client, the object storage gateway will forward the request to the object storage system or relational database based on the client's request type. After completing the request, it will feedback to the client through the object storage gateway.
[0011] Preferably, the metadata structured manner of the object storage system in step S1 is specifically as follows:
[0012] The metadata of the object storage system is structured according to certain mapping rules to conform to the form of a relational database table. The various metadata sub-attributes of each object and storage bucket correspond to specific columns in the relational database. The value of the various metadata of each object and storage bucket is a row of records in the relational database, which is stored in the metadata table.
[0013] Preferably, the request type in step S4 is as follows:
[0014] S41. When a user needs to create a new object, the object storage system will store the object data, and the relational database will record the corresponding metadata information;
[0015] S42: When a user requests to delete an object, the object storage system deletes the object data, and the relational database deletes the corresponding metadata information;
[0016] S43. When a user requests to modify an object, the object storage system updates the object data, and the relational database updates the corresponding metadata information;
[0017] S44. When a user requests to query an object, the object storage gateway dynamically selects to route the request to the object storage system or relational database based on the query content, and then performs the query;
[0018] S45. When a user requests to query metadata, the metadata operation interface of the object storage gateway is used to query the metadata information of the object through SQL statements.
[0019] Preferably, the specific process of step S41 is as follows:
[0020] S411, the user initiates an object creation request through the client, and transmits relevant information of the object to the object storage gateway;
[0021] S412: The object storage gateway determines that the request is an object data request and routes the request to the object storage system;
[0022] S413. After receiving the object creation request, the object storage system stores the actual data of the object and, after the metadata of the object is determined, submits an SQL statement to the relational database to request the creation of a new record.
[0023] S414. After receiving the SQL request from the object storage system, the relational database inserts a new record into the metadata table to record the metadata information of the object;
[0024] S415: After the object is successfully created, the object storage system returns the unique identifier of the object and confirmation information to the client.
[0025] Preferably, the specific process of step S42 is as follows:
[0026] S421. After the user initiates an object deletion request through the client, the object-related information including the unique identifier is transmitted to the object storage gateway;
[0027] S422: The object storage gateway identifies the request as an object deletion operation and routes the request to the object storage system to delete the object data.
[0028] S423. After receiving the deletion request, the object storage system will search for and delete the specified object data. After deleting the data, the system records the deletion operation and submits an SQL deletion request to the relational database:
[0029] S424. After receiving the SQL delete request from the object storage service, the relational database deletes the records related to the object in the metadata table to ensure that the metadata is consistent with the stored data.
[0030] S425. After the object is successfully deleted, the object storage system returns a confirmation message to the client, notifying that the data and metadata of the object have been successfully deleted.
[0031] Preferably, the specific process of step S43 is as follows:
[0032] S431. The user initiates an object modification request through the client, and transmits the unique identifier of the object and the modified information to the object storage gateway;
[0033] S432: The object storage gateway identifies the request as an object modification operation. When the request involves actual data modification, the object storage gateway routes the request to the object storage system. When the request involves only metadata modification, the object storage gateway routes the request to the relational database.
[0034] S433, when it comes to object data modification, after receiving the modification request, the object storage system will update the data of the specified object, and after the update is completed, submit SQL to the relational database based on the new metadata information to update the metadata record;
[0035] S434: After receiving the SQL update request from the object storage service or the object storage gateway, the relational database modifies the information of the corresponding record in the metadata table accordingly;
[0036] S435. After the object and metadata are successfully modified, the object storage system returns a confirmation message to the client, informing that the object modification operation has been completed.
[0037] Preferably, the specific process of step S44 is as follows:
[0038] S441. The user initiates an object query request through the client and transmits the query information of the object to the object storage gateway;
[0039] S442. The object storage gateway determines whether the request is for querying the data or metadata of the object according to the query content. If the request is for querying the data of the object, the object storage gateway routes the request to the object storage system. If the request is for querying the metadata of the object, the object storage gateway routes the request to the relational database.
[0040] S443. When the request is to query the data of an object, after receiving the request, the object storage system will search according to the identifier of the object and return the query result;
[0041] S444. When the request is to query the metadata of the object, the relational database retrieves the records in the table according to the SQL statement submitted by the object storage gateway and returns the query result;
[0042] S445. The object storage system returns the request result to the object storage gateway, and the object storage gateway integrates the query results and returns them to the client.
[0043] Preferably, the specific process of step S45 is as follows:
[0044] S451. The user submits an SQL query request through the client and transmits it to the object storage gateway;
[0045] S452, after receiving the SQL statement, the object storage gateway submits the SQL statement to the relational database;
[0046] S453. The relational database retrieves records in the table according to the SQL statement submitted by the object storage gateway and returns the query results.
[0047] Preferably, in step S45, the object storage gateway will regularly analyze the query log. When some fields are not indexed but are frequently queried in a short period of time, an index suggestion will be generated to create a new index. After the index is created, the object storage gateway will sort the index according to the number of times the index is used within a certain period of time, and delete the index with a lower number of uses.
[0048] Preferably, the relational database introduces a cache system to accelerate SQL queries. For a cache system that supports custom expiration times, data expiration times are hierarchically divided according to the number of index usages at the application layer.
[0049] The technical effects of the present invention are as follows:
[0050] (1) This solution structures the metadata of the object storage system into a relational database table so that the metadata in the object storage system can be stored in the relational database through the metadata table, so that the relational database can store the corresponding metadata, thereby realizing the combination of the object storage system and the relational database, and facilitating subsequent operations such as querying and modifying the metadata of the object storage system through the relational database;
[0051] (2) Since relational databases are highly flexible and can flexibly combine query conditions through SQL statements, this solution can utilize the ability of relational databases to support complex queries, allowing users to efficiently manage and retrieve metadata through SQL operations. This can not only prevent data inconsistencies, but also reduce management complexity and improve query efficiency compared to traditional methods, thereby improving the practicality of this solution.
[0052] (3) The object storage gateway in this solution can forward the request to the object storage system or relational database according to the client's request type, so that it can perform corresponding work. The object storage gateway also provides a metadata operation interface, so that users can directly perform SQL query operations on the records in the metadata table, making the query work more efficient.
[0053] (4) The object storage gateway can generate index suggestions based on the query situation and create indexes to improve query efficiency. Moreover, the relational database can accelerate SQL queries through the cache system, thereby preferably improving query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0055] Figure 1 It is a flowchart of the workflow of the present invention.
[0056] Figure 2 It is a schematic diagram of the various parts of the present invention.
[0057] Figure 3 It is a schematic diagram of the metadata operation interface in the present invention.
[0058] Figure 4 This is a schematic diagram of dividing the index in the present invention. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.
[0061] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features limited to "first" and "second" may explicitly or implicitly include at least one of the features. In addition, if "and / or" or "and / or" appears in the full text, its meaning includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or solutions that satisfy both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0062] See also Figure 1-Figure 4 , a SQL-based object storage metadata management method, comprising the following steps:
[0063] S1. Structuring the metadata of the object storage system to conform to the form of a relational database table to form a metadata table;
[0064] S2. Synchronously store the metadata of the object storage system in a relational database to facilitate complex queries on the metadata through SQL statements;
[0065] S3, the client interacts with the object storage system and relational database through the object storage gateway. The object storage gateway has a metadata operation interface, which facilitates users to query metadata;
[0066] S4. After the user initiates a request through the client, the object storage gateway will forward the request to the object storage system or relational database based on the client's request type. After completing the request, it will feedback to the client through the object storage gateway.
[0067] This solution structures the metadata of the object storage system into the form of a relational database table, so that the metadata in the object storage system can be stored in the relational database through the metadata table, so that the relational database can store the corresponding metadata, and realizes the combination of the object storage system and the relational database. Since the metadata is usually stored in a proprietary NoSQL database or distributed hash table in the prior art, although it can meet simple query requirements, it is difficult to handle complex query operations, and the relational database has a high degree of flexibility and can flexibly combine query conditions through SQL statements. Therefore, this solution can facilitate the subsequent query, modification and other operations on the metadata of the object storage system through the relational database through the above method;
[0068] Preferably, the metadata structure of the object storage system in step S1 is specifically as follows:
[0069] The metadata of the object storage system is structured according to certain mapping rules to conform to the form of a relational database table, where the various metadata sub-attributes of each object and bucket correspond to specific columns in the relational database, and the value of each object and bucket is a row of records in the relational database, stored in the metadata table. In this way, complex query costs can be implemented using SQL statements natively supported by relational databases, reducing the usage threshold for developers and users.
[0070] Specifically, the mapping rules between the metadata of the object in this embodiment and the tables and fields in the relational database are as follows:
[0071] (1) There must be a field corresponding to a column in the table, which must not be empty;
[0072] (2) The optional field corresponds to a column in the table, but can be empty;
[0073] (3) Attributes such as variable-length fields and nested fields correspond to a column in the table after serialization.
[0074] Preferably, the metadata synchronization process in step S2 is as follows:
[0075] (1) After the metadata of the object storage system is changed, the metadata change log is first recorded, and its status is recorded as "unfinished". Then, data is written to the relational database. After the write is successful, the object storage system modifies the log to "completed";
[0076] (2) The metadata synchronization request initiated to the database is an asynchronous process, which prioritizes the availability of the object storage system. The relational database ensures the consistency of the internal metadata with the metadata of the object storage system.
[0077] (3) When synchronizing metadata, the object storage system will submit unsynchronized metadata modification requests to the relational database in batches in order. To avoid modification conflicts, only one modification is performed on a metadata record in the same batch of metadata modification requests, and the modifications are submitted to the relational database in batches.
[0078] (4) After the network failure is restored or the failure is resolved, the object storage system will continue to synchronize metadata with the relational database based on the unfinished logs.
[0079] Preferably, the object storage gateway of step S3 is designed as follows:
[0080] (1) Routing requests to the object storage system or relational database based on the request type. For query requests that only require metadata, the relational database is queried first. For modification requests, they are routed to the object storage system;
[0081] (2) converting the metadata query request of the specified object into an SQL query statement suitable for the relational database and sending it to the relational database;
[0082] (3) Monitor the index hits of relational databases and dynamically generate index creation and deletion suggestions based on index usage;
[0083] (4) Provide metadata table structure and SQL query interface. After requesting the metadata table structure, users can write SQL query statements according to their needs. The object storage gateway directly forwards the user-defined SQL query statements to the relational database;
[0084] (5) Use a user with read-only permissions to log in to the relational database and perform metadata queries.
[0085] Preferably, the request type in step S4 is as follows:
[0086] S41. When a user needs to create a new object, the object storage system will store the object data, and the relational database will record the corresponding metadata information;
[0087] S42: When a user requests to delete an object, the object storage system deletes the object data, and the relational database deletes the corresponding metadata information;
[0088] S43. When a user requests to modify an object, the object storage system updates the object data, and the relational database updates the corresponding metadata information;
[0089] S44. When a user requests to query an object, the object storage gateway dynamically selects to route the request to the object storage system or relational database based on the query content, and then performs the query;
[0090] S45. When a user requests to query metadata, the metadata operation interface of the object storage gateway is used to query the metadata information of the object through SQL statements.
[0091] The operation process in this solution realizes the efficient processing of basic operations such as creation, deletion, modification and query of objects in the object storage system through the collaborative work of the object storage gateway, object storage system and relational database. Each operation will automatically update the metadata table in the relational database to ensure the consistency and queryability of the object metadata in the system.
[0092] Preferably, the relational database in this embodiment is responsible for synchronously storing the metadata in the object storage system. The relational database provides two types of users: read-only users and writable users. After the object storage system completes the storage of object data and metadata, it uses the writable user to write the changed metadata records into the relational database. After the object storage gateway routes the metadata request from the client to the relational database, it uses the read-only user to execute the SQL query statement to ensure that the client's metadata request and complex SQL query request do not affect the security of the metadata stored in the relational database.
[0093] Preferably, the specific process of step S41 is as follows:
[0094] S411. The user initiates an object creation request through the client, and transmits relevant information of the object to the object storage gateway; the relevant information of the object may be the object name, type, storage path, etc.;
[0095] S412: The object storage gateway determines that the request is an object data request and routes the request to the object storage system;
[0096] S413. After receiving the object creation request, the object storage system will store the actual data of the object, and after the metadata of the object is determined, submit an SQL statement to the relational database to request the creation of a new record; specifically, when all records such as the verification code and creation time are completed, the metadata of the object is deemed to have been determined;
[0097] S414. After receiving the SQL request from the object storage system, the relational database inserts a new record into the metadata table to record the metadata information of the object;
[0098] S415: After the object is created successfully, the object storage system returns the unique identifier (object_id) of the object and confirmation information to the client.
[0099] Preferably, the specific process of step S42 is as follows:
[0100] S421. After the user initiates an object deletion request through the client, the object-related information including the unique identifier is transmitted to the object storage gateway;
[0101] S422: The object storage gateway identifies the request as an object deletion operation and routes the request to the object storage system to delete the object data.
[0102] S423. After receiving the deletion request, the object storage system will search for and delete the specified object data. After deleting the data, the system records the deletion operation and submits an SQL deletion request to the relational database:
[0103] S424. After receiving the SQL delete request from the object storage service, the relational database deletes the records related to the object in the metadata table to ensure that the metadata is consistent with the stored data.
[0104] S425. After the object is successfully deleted, the object storage system returns a confirmation message to the client, notifying that the data and metadata of the object have been successfully deleted.
[0105] Preferably, the specific process of step S43 is as follows:
[0106] S431. The user initiates an object modification request through the client, and transmits the unique identifier of the object and the actual data or metadata information after modification to the object storage gateway; wherein the metadata information may include the object name, type, permissions, etc.;
[0107] S432: The object storage gateway identifies the request as an object modification operation. When the request involves actual data modification, the object storage gateway routes the request to the object storage system. When the request involves only metadata modification, the object storage gateway routes the request to the relational database.
[0108] S433, when it comes to object data modification, after receiving the modification request, the object storage system will update the data of the specified object, and after the update is completed, submit SQL to the relational database based on the new metadata information to update the metadata record;
[0109] S434: After receiving the SQL update request from the object storage service or the object storage gateway, the relational database modifies the information of the corresponding record in the metadata table accordingly;
[0110] S435. After the object and metadata are successfully modified, the object storage system returns a confirmation message to the client, informing that the object modification operation has been completed.
[0111] The object storage gateway is responsible for protocol conversion between different storage systems. When the client uses a standard object storage API (such as the S3 API) to process object data, the object storage gateway forwards the request to the object storage system for processing. When the client requests metadata operations, the object storage gateway converts the metadata operations into query statements suitable for relational databases.
[0112] Preferably, the specific process of step S44 is as follows:
[0113] S441. The user initiates an object query request through the client and transmits the query information of the object to the object storage gateway; wherein the query information may include the unique identifier (object_id) of the object or the object type, creation time, etc.;
[0114] S442. The object storage gateway determines whether the request is for querying the data or metadata of the object according to the query content. If the request is for querying the data of the object, the object storage gateway routes the request to the object storage system. If the request is for querying the metadata of the object, the object storage gateway routes the request to the relational database.
[0115] S443. When the request is to query the data of an object, after receiving the request, the object storage system will search according to the identifier of the object and return the query result;
[0116] S444. When the request is to query the metadata of the object, the relational database retrieves the records in the table according to the SQL statement submitted by the object storage gateway and returns the query result;
[0117] S445. The object storage system returns the request result to the object storage gateway, and the object storage gateway integrates the query results and returns them to the client.
[0118] See also Figure 3 ,The table lists the specific interfaces and their corresponding functions. Specifically, for the metadata request interface of a specified object, the object storage gateway extracts name as the key field required by the object storage service according to the object storage service used. The first level of name is usually the bucket name, and the subsequent level is considered to be the name (name) or key (key) of the object storage;
[0119] When the client initiates a query request for the object metadata table, the object storage gateway queries the relational database for basic information such as the column name, type, and whether it is nullable, and processes it into JSON format to return the request result.
[0120] For the POST interface, the client can pass in SQL statements to perform complex queries on the object's metadata information.
[0121] Preferably, the specific process of step S45 is as follows:
[0122] S451. The user submits an SQL query request through the client and transmits it to the object storage gateway;
[0123] S452, after receiving the SQL statement, the object storage gateway submits the SQL statement to the relational database;
[0124] S453. The relational database retrieves records in the table according to the SQL statement submitted by the object storage gateway and returns the query results.
[0125] Better yet, to prevent users from maliciously submitting or mistakenly passing in modifying SQL statements, which would cause the metadata information stored in the relational database to be inconsistent with the corresponding actual data in the object storage service, the object storage gateway will use a user with read-only permissions when submitting SQL statements to the relational database, and use the permission restrictions provided by the relational database service to ensure the read-only nature of the SQL query, thereby improving security.
[0126] Preferably, in step S45, the object storage gateway monitors the execution of each SQL query, collects information such as the SQL statement content, query execution time, involved tables and columns, and regularly analyzes query logs, sorts the logs according to execution time, the number of times a column is specified for query, etc. When some fields are not indexed but are frequently queried in a short period of time, index suggestions will be generated. When the system load is low, the object storage gateway will create a new index based on the index suggestion. After the index is created, the object storage gateway will sort the index according to the number of times the index is used within a certain period of time, and delete the index with a lower number of uses to achieve dynamic index optimization.
[0127] Specifically, in this embodiment, a three-level hierarchical mechanism of "hot, warm, and cold" is used to manage the life cycle of the index. When the index is used within three months, the index is sorted according to the number of times it is used. The indexes with the top 60% of the number of times used are considered "hot" indexes, and the indexes with the bottom 40% of the number of times used are considered "warm" indexes.
[0128] When an index has not been used for three consecutive months, it is considered a "cold" index. The object storage gateway will generate index deletion recommendations. When the system load is low, the index will be deleted according to the index deletion recommendations.
[0129] Preferably, the relational database can introduce an existing cache system to accelerate SQL queries. Specifically, although the relational database can introduce a cache system under the existing technology to accelerate queries, there are differences in the cache management method:
[0130] For cache systems that do not support custom expiration times, the index is dynamically adjusted based on index recommendations only;
[0131] For cache systems that support custom expiration times, data expiration times are divided into layers at the application layer based on the number of times the index is used. The "hot" index data cache expiration time is the longest, while the "warm" index, "cold" index, and "none" index data cache expiration times are shortened in turn, thereby improving the query performance of this solution through dynamic index optimization and caching technology.
[0132] From the above embodiments, it can be seen that the present application realizes the combination of the object storage system by synchronously storing the metadata of the object storage system to the relational database, thereby realizing the support of complex SQL query statements on the basis of the original object storage. Developers and administrators can use SQL syntax to query, analyze and summarize the metadata, thereby simplifying the management process and use of the system, improving the real-time performance of data operations, and improving query performance. The query performance is further improved through dynamic index optimization and caching technology, thereby effectively solving the problems of data inconsistency, high system management complexity and low query performance in the prior art.
[0133] The above description is only an exemplary embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the technical concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A SQL-based object storage metadata management method, characterized in that: The following steps are involved: S1. Structuring the metadata of the object storage system to conform to the form of a relational database table to form a metadata table; S2. Synchronously store the metadata of the object storage system in a relational database to facilitate complex queries on the metadata through SQL statements; S3, the client interacts with the object storage system and relational database through the object storage gateway. The object storage gateway has a metadata operation interface, which facilitates users to query metadata; S4. After the user initiates a request through the client, the object storage gateway will forward the request to the object storage system or relational database based on the client's request type. After completing the request, it will feedback to the client through the object storage gateway.
2. The SQL-based object storage metadata management method according to claim 1, characterized in that: The metadata structure of the object storage system in step S1 is specifically as follows: The metadata of the object storage system is structured according to certain mapping rules to conform to the form of a relational database table. The various metadata sub-attributes of each object and storage bucket correspond to specific columns in the relational database. The value of the various metadata of each object and storage bucket is a row of records in the relational database, which is stored in the metadata table.
3. The SQL-based object storage metadata management method according to claim 1, characterized in that: The request types in step S4 are as follows: S41. When a user needs to create a new object, the object storage system will store the object data, and the relational database will record the corresponding metadata information; S42: When a user requests to delete an object, the object storage system deletes the object data, and the relational database deletes the corresponding metadata information; S43. When a user requests to modify an object, the object storage system updates the object data, and the relational database updates the corresponding metadata information; S44. When a user requests to query an object, the object storage gateway dynamically selects to route the request to the object storage system or relational database based on the query content, and then performs the query; S45. When a user requests to query metadata, the metadata operation interface of the object storage gateway is used to query the metadata information of the object through SQL statements.
4. The SQL-based object storage metadata management method according to claim 3, characterized in that: The specific process of step S41 is as follows: S411, the user initiates an object creation request through the client, and transmits relevant information of the object to the object storage gateway; S412: The object storage gateway determines that the request is an object data request and routes the request to the object storage system; S413. After receiving the object creation request, the object storage system stores the actual data of the object and, after the metadata of the object is determined, submits an SQL statement to the relational database to request the creation of a new record. S414. After receiving the SQL request from the object storage system, the relational database inserts a new record into the metadata table to record the metadata information of the object; S415: After the object is successfully created, the object storage system returns the unique identifier of the object and confirmation information to the client.
5. The SQL-based object storage metadata management method according to claim 3, characterized in that: The specific process of step S42 is as follows: S421. After the user initiates an object deletion request through the client, the object-related information including the unique identifier is transmitted to the object storage gateway; S422: The object storage gateway identifies the request as an object deletion operation and routes the request to the object storage system to delete the object data. S423. After receiving the deletion request, the object storage system will search for and delete the specified object data. After deleting the data, the system records the deletion operation and submits an SQL deletion request to the relational database: S424. After receiving the SQL delete request from the object storage service, the relational database deletes the records related to the object in the metadata table to ensure that the metadata is consistent with the stored data. S425. After the object is successfully deleted, the object storage system returns a confirmation message to the client, notifying that the data and metadata of the object have been successfully deleted.
6. The SQL-based object storage metadata management method according to claim 3, characterized in that: The specific process of step S43 is as follows: S431. The user initiates an object modification request through the client, and transmits the unique identifier of the object and the modified information to the object storage gateway; S432: The object storage gateway identifies the request as an object modification operation. When the request involves actual data modification, the object storage gateway routes the request to the object storage system. When the request involves only metadata modification, the object storage gateway routes the request to the relational database. S433, when it comes to object data modification, after receiving the modification request, the object storage system will update the data of the specified object, and after the update is completed, submit SQL to the relational database based on the new metadata information to update the metadata record; S434: After receiving the SQL update request from the object storage service or the object storage gateway, the relational database modifies the information of the corresponding record in the metadata table accordingly; S435. After the object and metadata are successfully modified, the object storage system returns a confirmation message to the client, informing that the object modification operation has been completed.
7. The SQL-based object storage metadata management method according to claim 3, characterized in that: The specific process of step S44 is as follows: S441. The user initiates an object query request through the client and transmits the query information of the object to the object storage gateway; S442. The object storage gateway determines whether the request is for querying the data or metadata of the object according to the query content. If the request is for querying the data of the object, the object storage gateway routes the request to the object storage system. If the request is for querying the metadata of the object, the object storage gateway routes the request to the relational database. S443. When the request is to query the data of an object, after receiving the request, the object storage system will search according to the identifier of the object and return the query result; S444. When the request is to query the metadata of the object, the relational database retrieves the records in the table according to the SQL statement submitted by the object storage gateway and returns the query result; S445. The object storage system returns the request result to the object storage gateway, and the object storage gateway integrates the query results and returns them to the client.
8. The SQL-based object storage metadata management method according to claim 3, characterized in that: The specific process of step S45 is as follows: S451. The user submits an SQL query request through the client and transmits it to the object storage gateway; S452, after receiving the SQL statement, the object storage gateway submits the SQL statement to the relational database; S453. The relational database retrieves records in the table according to the SQL statement submitted by the object storage gateway and returns the query results.
9. The SQL-based object storage metadata management method according to claim 3, characterized in that: In step S45, the object storage gateway will regularly analyze the query log. When some fields are not indexed but are frequently queried in a short period of time, an index suggestion will be generated to create a new index. After the index is created, the object storage gateway will sort the index according to the number of times the index is used within a certain period of time, and delete the index with a lower number of uses.
10. The SQL-based object storage metadata management method according to claim 9, characterized in that: Relational databases introduce cache systems to speed up SQL queries. For cache systems that support custom expiration times, data expiration times are layered and divided according to the number of index usages at the application layer.