Heterogeneous object storage cluster access method, device, equipment and storage medium
By receiving the object routing query request from the business system and using the built-in general object storage second-party library to determine the write routing strategy and object storage cluster ID, it solves the problem of complex access to heterogeneous object storage clusters in the existing technology and realizes efficient file Upload and download operations.
Patent Information
- Application Number
- CN202010900020.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-31
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-08-31
AI Technical Summary
Existing heterogeneous object storage cluster software has high thresholds and cumbersome processes for accessing the cluster, and lacks efficient interface support, making application development complex.
Provides a heterogeneous object storage cluster access method. By receiving the object routing query request from the business system, it determines the write routing strategy and object storage cluster ID, uses the built-in general object storage second-party library to implement file upload and download, and stores it in the database. Routing information, object properties and access records.
It achieves flexible and efficient access to heterogeneous object storage clusters, lowers the threshold for application development, and simplifies the access process.
Smart Images

Figure CN112052222B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data, and in particular to a method, device, equipment and storage medium for accessing a heterogeneous object storage cluster. Background Art
[0002] With the advent of the Internet era, all walks of life are generating all kinds of data every moment. In order to manage this data, some large Internet companies or other companies that generate a large amount of data have established public or private data centers. Heterogeneous object storage has gradually replaced the file system with its good horizontal scalability and access efficiency to become the mainstream of static massive data storage.
[0003] Currently, almost all heterogeneous object storage cluster software vendors provide interfaces for accessing the cluster. The object storage services and open source object storage systems of mainstream cloud vendors on the market only support the basic function of unidirectional synchronization of object data between heterogeneous object storage clusters. In order to access the cluster more efficiently, secondary development based on these interfaces is necessary to access the cluster, which invisibly raises the threshold for application and the implementation process is cumbersome and not simple enough. Summary of the invention
[0004] The main purpose of the present invention is to solve the technical problem of how to efficiently access a heterogeneous object storage cluster.
[0005] A first aspect of the present invention provides a method for accessing a heterogeneous object storage cluster, the method comprising:
[0006] Receive object routing query requests initiated by the business system;
[0007] If the query request is a file upload routing query, determining a write routing strategy that matches the request parameters according to the request parameters carried by the query request;
[0008] According to the write routing strategy, determine the object storage cluster ID corresponding to the file to be uploaded and return it to the business system;
[0009] Receiving a cluster information query request initiated by the business system based on the object storage cluster ID;
[0010] According to the object storage cluster ID, the corresponding cluster information is determined and returned to the business system, so that the business system can upload the file to the corresponding object storage cluster through the built-in universal object storage second-party library;
[0011] The routing information, object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully uploaded are received and stored in the corresponding database.
[0012] Optionally, in a first implementation of the first aspect of the present invention, after receiving the object routing query request initiated by the business system, the method further includes:
[0013] If the query request is a file download routing query, then according to the request parameters carried by the query request, the object storage cluster ID corresponding to the file to be downloaded is determined and returned to the business system;
[0014] Receiving a cluster information query request initiated by the business system based on the object storage cluster ID;
[0015] According to the object storage cluster ID, the corresponding cluster information is determined and returned to the business system, so that the business system can download files from the corresponding object storage cluster through the built-in universal object storage second-party library;
[0016] The object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully downloaded are received and stored in the corresponding database.
[0017] Optionally, in a second implementation of the first aspect of the present invention, before receiving the object routing query request initiated by the business system, the method further includes:
[0018] Create tenant account information and configure policy data corresponding to the tenant, wherein the policy data includes one or more of a write routing policy, a data annotation policy, and a data migration policy.
[0019] Optionally, in a third implementation of the first aspect of the present invention, the write routing strategy includes multiple file matching rules and an object storage cluster ID corresponding to each file matching rule; the data labeling strategy includes specified object storage cluster information and object range, multiple tags and tag matching rules corresponding to each tag; the data migration strategy includes source object storage cluster information and object range, target object storage cluster information, and migration matching rules.
[0020] Optionally, in a fourth implementation of the first aspect of the present invention, the heterogeneous object storage cluster access method further includes:
[0021] Start the object labeling task thread, and obtain the object list of the specified range according to the object storage cluster information and object range specified in the data labeling strategy;
[0022] Traversing the object list, querying the object attributes and / or access records of each object to determine whether the object attributes and / or access records of the traversed objects match the label matching rules in the data labeling strategy;
[0023] If there is a match, a label corresponding to the label matching rule is added to the traversed object, an object label is generated and stored in the corresponding database.
[0024] Optionally, in a fifth implementation of the first aspect of the present invention, the heterogeneous object storage cluster access method further includes:
[0025] Start the object migration task thread, and obtain the object list of the specified range according to the source object storage cluster information and object range in the data migration strategy;
[0026] Traversing the object list, querying the object attributes and / or custom tags of each object to determine whether the object attributes and / or custom tags of the traversed objects match the migration matching rules in the data migration policy;
[0027] If there is a match, the traversed object is determined to be the target object to be migrated;
[0028] Read the object data of the target object from the source object storage cluster and write it into the target object storage cluster, and update the routing information of the target object;
[0029] Delete the object data of the target object stored in the source object storage cluster.
[0030] Optionally, in a sixth implementation manner of the first aspect of the present invention, the routing information includes: a key value of the file and an ID of an object storage cluster to which the file is uploaded this time.
[0031] A second aspect of the present invention provides a heterogeneous object storage cluster access device, the heterogeneous object storage cluster access device comprising:
[0032] A first receiving module, used to receive an object routing query request initiated by a business system;
[0033] A first determination module is used to determine a write routing strategy matching the request parameters according to the request parameters carried by the query request if the query request is a file upload routing query;
[0034] A second determination module is used to determine the object storage cluster ID corresponding to the file to be uploaded according to the write routing policy and return it to the business system;
[0035] A second receiving module, configured to receive a cluster information query request initiated by the business system based on the object storage cluster ID;
[0036] A third determination module is used to determine the corresponding cluster information according to the object storage cluster ID and return it to the business system, so that the business system can upload the file to the corresponding object storage cluster through the built-in universal object storage second-party library;
[0037] The third receiving module is used to receive the routing information, object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully uploaded, and store them in the corresponding database.
[0038] Optionally, in a first implementation of the second aspect of the present invention, the heterogeneous object storage cluster access device further includes:
[0039] A fourth determination module, configured to determine, if the query request is a file download routing query, the object storage cluster ID corresponding to the file to be downloaded according to the request parameters carried by the query request and return it to the business system;
[0040] A fourth receiving module, configured to receive a cluster information query request initiated by the business system based on the object storage cluster ID;
[0041] A fifth determination module, configured to determine corresponding cluster information according to the object storage cluster ID and return the information to the business system, so that the business system can download files from the corresponding object storage cluster through a built-in universal object storage second-party library;
[0042] The fifth receiving module is used to receive the object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully downloaded, and store them in the corresponding database.
[0043] Optionally, in a second implementation of the second aspect of the present invention, the heterogeneous object storage cluster access device further includes:
[0044] A configuration module is created to create account information for a tenant and configure policy data corresponding to the tenant, wherein the policy data includes one or more of a write routing policy, a data annotation policy, and a data migration policy.
[0045] Optionally, in a third implementation method of the second aspect of the present invention, the write routing strategy includes multiple file matching rules and an object storage cluster ID corresponding to each file matching rule; the data labeling strategy includes specified object storage cluster information and object range, multiple tags and tag matching rules corresponding to each tag; the data migration strategy includes source object storage cluster information and object range, target object storage cluster information, and migration matching rules.
[0046] Optionally, in a fourth implementation of the second aspect of the present invention, the heterogeneous object storage cluster access device further includes:
[0047] The object labeling module is used to start the object labeling task thread, and obtain the object list of the specified range according to the object storage cluster information and object range specified in the data labeling strategy; traverse the object list, query the object attributes and / or access records of each object to determine whether the object attributes and / or access records of the traversed object match the label matching rules in the data labeling strategy; if matched, add the label corresponding to the label matching rule to the traversed object, generate the object label and store it in the corresponding database.
[0048] Optionally, in a fifth implementation of the second aspect of the present invention, the heterogeneous object storage cluster access device further includes:
[0049] The object migration module is used to start the object migration task thread, and obtain the object list of the specified range according to the source object storage cluster information and the object range in the data migration strategy; traverse the object list, query the object attributes and / or custom tags of each object to determine whether the object attributes and / or custom tags of the traversed object match the migration matching rules in the data migration strategy; if they match, determine that the traversed object is the target object to be migrated; read the object data of the target object from the source object storage cluster and write it into the target object storage cluster, and update the routing information of the target object; delete the object data of the target object stored in the source object storage cluster.
[0050] Optionally, in a sixth implementation manner of the second aspect of the present invention, the routing information includes: a key value of the file and an ID of an object storage cluster to which the file is uploaded this time.
[0051] A third aspect of the present invention provides a heterogeneous object storage cluster access device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the heterogeneous object storage cluster access device executes the above-mentioned heterogeneous object storage cluster access method.
[0052] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned heterogeneous object storage cluster access method.
[0053] In the technical solution provided by the present invention, the routing strategy for each tenant to access the object storage cluster is pre-configured. When a file upload request of the object storage cluster is received, the object storage cluster ID corresponding to the file to be uploaded is determined according to the write routing strategy, and the corresponding cluster information is determined according to the object storage cluster ID. According to the cluster information, the business system uploads the file to the corresponding object storage cluster through the built-in universal object storage second-party library and further reports the routing information, object attributes, custom tags and access records corresponding to the file. In the present invention, the tenant needs to integrate the universal object storage second-party library in the business system and configure the tenant's object storage cluster routing strategy in the routing service system, so as to realize flexible and efficient access to heterogeneous object storage clusters. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is a schematic diagram of a first embodiment of a method for accessing a heterogeneous object storage cluster according to an embodiment of the present invention;
[0055] Figure 2 This is a schematic diagram of a second embodiment of a method for accessing a heterogeneous object storage cluster according to an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of a third embodiment of a method for accessing a heterogeneous object storage cluster according to an embodiment of the present invention;
[0057] Figure 4 It is a schematic diagram of a fourth embodiment of a method for accessing a heterogeneous object storage cluster according to an embodiment of the present invention;
[0058] Figure 5 This is a schematic diagram of a first embodiment of a heterogeneous object storage cluster access device according to an embodiment of the present invention;
[0059] Figure 6 This is a schematic diagram of a second embodiment of a heterogeneous object storage cluster access device according to an embodiment of the present invention;
[0060] Figure 7 The figure is a schematic diagram of an embodiment of a heterogeneous object storage cluster access device in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] Embodiments of the present invention provide a heterogeneous object storage cluster access method, apparatus, device and storage medium. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0062] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , a first embodiment of a method for accessing a heterogeneous object storage cluster in an embodiment of the present invention includes:
[0063] 101. Receive an object routing query request initiated by a business system;
[0064] It is understandable that the execution subject of the present invention may be a heterogeneous object storage cluster access device, or a terminal or a server, which is not limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0065] In this embodiment, a general object storage second-party library (equivalent to the tenant client of the heterogeneous object storage cluster access device of the present invention) is integrated in the business system. The general object storage second-party library contains interfaces that can directly access various object storage clusters. That is, tenants can access various object storage clusters through the business system integrated with the general object storage second-party library.
[0066] The heterogeneous object storage cluster access device of the present invention provides a routing service for tenant clients to access the heterogeneous object storage cluster. The following specifically describes the server where the heterogeneous object storage cluster access device is located by way of example.
[0067] In this embodiment, before the server executes the routing query, the tenant or administrator needs to add the cluster information of the object storage cluster in the server in advance and store the cluster information in the database, as shown in Table 1.
[0068] Table 1
[0069] Cluster ID Cluster Type Cluster address 1 TFS tfs.domain.com 2 CephRGW rgw.domain.com
[0070] At the same time, the tenant also needs to create a tenant account in the server, set the policy data corresponding to the tenant account and store it in a database, such as MySQL. This embodiment does not limit the policy type included in the policy data, for example, the policy data includes a write routing policy for uploading files, a migration policy for migrating objects, etc. As shown in Table 2.
[0071] Table 2
[0072]
[0073] In Table 2, the write routing policy: "$type == \"pdf\"":1, means that if the file to be uploaded is in PDF format, the file is uploaded to the object storage cluster with cluster ID 1.
[0074] This embodiment does not limit the type of the routing query request, which may be a routing query request for file upload, or a routing query request for file download or file migration.
[0075] 102. If the query request is a file upload route query, determine a write routing strategy that matches the request parameter according to the request parameter carried by the query request;
[0076] In this embodiment, the server parses the query request after receiving it, and determines the type of the routing query request based on the type of interface called in the query request. For example, if the tenant client calls the file upload interface in the object storage second-party library, the current routing query request is determined to be a file upload routing query, and the server further determines the write routing strategy that matches the request parameters based on the request parameters obtained by the analysis. Among them, the request parameters preferably include the tenant ID and the type of the file to be uploaded.
[0077] 103. According to the write routing policy, determine the object storage cluster ID corresponding to the file to be uploaded and return it to the business system;
[0078] In this embodiment, the server further determines the object storage cluster ID corresponding to the file to be uploaded according to the determined write routing strategy and returns it to the business system (universal object storage second-party library).
[0079] For example, a user uses tenant ID X to call the file upload interface of the general object storage second-party library to upload a pdf file, and specifies the file format in the request parameter: "type=pdf": In the file upload interface, the policy data of tenant X stored in the server is first queried, and the specific policy data in the write routing policy of tenant X is matched according to the request parameter "type=pdf", and then cluster ID 1 is selected as the object storage cluster for uploading pdf files, and the above results are returned to the general object storage second-party library (that is, the business system).
[0080] 104. Receive a cluster information query request initiated by the business system based on the object storage cluster ID;
[0081] 105. Determine corresponding cluster information according to the object storage cluster ID and return it to the business system, so that the business system can upload the file to the corresponding object storage cluster through the built-in universal object storage second-party library;
[0082] In this embodiment, after the business system obtains the object storage cluster ID corresponding to the file to be uploaded from the server, it further initiates a cluster information query request to the server. The server retrieves the locally stored cluster information based on the received object storage cluster ID, determines the cluster information matching the object storage cluster ID, and returns it to the business system. The cluster information preferably includes the address information of the object storage cluster.
[0083] After the business system obtains the cluster information, it can upload the file to the object storage cluster corresponding to the cluster information through the built-in general object storage second-party library.
[0084] It should be noted that after the business system queries the corresponding cluster information based on the object storage cluster ID for the first time, it can choose to cache the cluster ID and the corresponding cluster information locally for subsequent queries.
[0085] 106. Receive routing information, object attributes, custom tags, and access records corresponding to the file reported by the business system after the file is successfully uploaded, and store them in a corresponding database.
[0086] In this embodiment, after completing the access to the heterogeneous object storage cluster, that is, uploading the file to the corresponding object storage cluster, the business system further uploads the routing information, object attributes, custom tags and access records corresponding to the file, which are then stored in the corresponding database by the server, thereby facilitating the subsequent download or migration of the file.
[0087] The following uses Tables 1 and 2 as examples to illustrate the file upload object storage cluster of this embodiment. For example, a user uses tenant ID X to call the file upload interface of the general object storage second-party library to upload a pdf format file, and specifies the file format in the request parameter: "type=pdf": In the file upload interface, first query the policy data of tenant X stored in the server, and match the specific policy data in the write routing policy of tenant X according to the request parameter "type=pdf", and then select cluster ID 1 as the object storage cluster for uploading pdf format files, and return the above results to the general object storage second-party library (that is, the business system). The general object storage second-party library queries the information of object storage cluster 1 in the server, including cluster type TFS and cluster address tfs.domain.com; then call the write file interface of the client of the corresponding cluster TFS to upload the file to the cluster TFS, and at the same time, the business system further generates the routing information, object attributes, custom tags and access records corresponding to the file and reports them to the server.
[0088] In this embodiment, the routing information preferably consists of the file key and the object storage cluster ID where the file is located, for example, T1rRET35KT1RCvBVdK:1, which means that the file T1rRET35KT1RCvBVdK is stored in the object storage cluster ID 1. The file key is generated by the business system according to the set algorithm and is globally unique in the server. Object attributes include file size, creation time, etc.; custom tags are used to label objects, and file type, expiration time, business type, etc. can be selected as tags; access records include tenant ID, file content description, access time, access count, etc.
[0089] In this embodiment, the routing information of the file is stored in a distributed key-value system (such as Tair) in a key-value format through the server's routing service; the attributes, tags, and access record information of the file are stored in a big data system (such as Hive / HBase) through the server's attribute tag service.
[0090] This embodiment pre-configures the routing strategy for each tenant to access the object storage cluster. When receiving a file upload request from the object storage cluster, the object storage cluster ID corresponding to the file to be uploaded is determined according to the write routing strategy, and the corresponding cluster information is determined according to the object storage cluster ID. The business system uploads the file to the corresponding object storage cluster through the built-in universal object storage second-party library based on the cluster information, and further reports the routing information, object attributes, custom tags and access records corresponding to the file. In the present invention, the tenant needs to integrate the universal object storage second-party library in the business system and configure the tenant's object storage cluster routing strategy in the routing service system, so as to achieve flexible and efficient access to heterogeneous object storage clusters.
[0091] See also Figure 2 , a second embodiment of the heterogeneous object storage cluster access method in the embodiment of the present invention includes:
[0092] 201. Receive an object routing query request initiated by a business system;
[0093] 202. If the query request is a file download routing query, determine the object storage cluster ID corresponding to the file to be downloaded according to the request parameters carried in the query request and return it to the business system;
[0094] In this embodiment, the server parses the query request after receiving it, and determines the type of the routing query request according to the type of interface called in the query request. For example, if the tenant client calls the file download interface in the object storage second-party library, the current routing query request is determined to be a file download routing query. The server further performs a file download routing query based on the request parameters obtained by the analysis, determines the object storage cluster ID corresponding to the file to be downloaded, and returns it to the business system.
[0095] As can be seen from the previous embodiment, after a file is uploaded to the object storage cluster, the business system will generate routing information corresponding to the file and store it in the corresponding database. For example, the routing information is stored in a distributed key-value system (Tair) in a key-value format. Therefore, the server only needs to query the distributed key-value system to determine the object storage cluster ID where the file to be downloaded is located.
[0096] Optionally, if the routing information consists of a file key and an ID of an object storage cluster where the file is located, the request parameter carried by the preferred file download routing query request is the file key.
[0097] For example, a user uses tenant ID X to call the file download interface of the universal object storage second-party library to download file T1rRET35KT1RCvBVdK. The file download interface first calls the object routing query interface of the server to query the key value system Tair through the routing service, obtains the object storage cluster ID "1" where the file T1rRET35KT1RCvBVdK is located, and returns it to the universal object storage second-party library (that is, the business system).
[0098] 203. Receive a cluster information query request initiated by the business system based on the object storage cluster ID;
[0099] 204. Determine corresponding cluster information according to the object storage cluster ID and return it to the business system, so that the business system can download files from the corresponding object storage cluster through the built-in universal object storage second-party library;
[0100] In this embodiment, after the business system obtains the object storage cluster ID corresponding to the file to be uploaded from the server, it further initiates a cluster information query request to the server. The server retrieves the locally stored cluster information based on the received object storage cluster ID, determines the cluster information matching the object storage cluster ID, and returns it to the business system. The cluster information preferably includes the address information of the object storage cluster.
[0101] After the business system obtains the cluster information, it can download the corresponding files from the object storage cluster corresponding to the cluster information through the built-in general object storage second-party library.
[0102] 205. Receive the object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully downloaded, and store them in a corresponding database.
[0103] In this embodiment, after completing the access to the heterogeneous object storage cluster, that is, after downloading the corresponding file from the object storage cluster, the business system further uploads the object attributes, custom tags and access records corresponding to the file, which are then stored in the corresponding database by the server.
[0104] The following uses Tables 1 and 2 as examples to illustrate downloading files from an object storage cluster in this embodiment. For example, a user uses tenant ID X to call the file download interface of the general object storage second-party library to download the file T1rRET35KT1RCvBVdK. The file download interface first calls the object routing query interface of the server to query the key value system through the routing service, obtains the object storage cluster ID "1" where the file is located, and returns it to the general object storage second-party library (that is, the business system). The universal object storage second-party library queries or obtains the cluster information of the object storage cluster 1 from the local cache, including the cluster type TFS and the cluster address tfs.domain.com, and then calls the corresponding TFS client's file acquisition interface to read the object (that is, the file T1rRET35KT1RCvBVdK) from the TFS object storage cluster; finally, the universal object storage second-party library calls the server's interface to report the object properties, custom tags, and access records of the downloaded file, such as the file access time and number of accesses; the server adds the file's object properties, custom tags, and access record information through the attribute tag service and stores them in the big data system (such as Hive / HBase).
[0105] This embodiment pre-configures the routing strategy for each tenant to access the object storage cluster. When receiving a file download request from the object storage cluster, the routing information of the object storage cluster is queried to determine the object storage cluster ID corresponding to the file to be downloaded. According to the object storage cluster ID, the corresponding cluster information is determined. According to the cluster information, the business system downloads the file from the corresponding object storage cluster through the built-in universal object storage second-party library, and reports the object attributes, custom tags and access records of the file to the server. In the present invention, the tenant needs to integrate the universal object storage second-party library in the business system and configure the tenant's object storage cluster routing strategy in the routing service system, so as to achieve flexible and efficient access to heterogeneous object storage clusters.
[0106] See also Figure 3 , a third embodiment of the heterogeneous object storage cluster access method in the embodiment of the present invention includes:
[0107] 301. Create account information for a tenant and configure policy data corresponding to the tenant, where the policy data includes one or more of a write routing policy, a data annotation policy, and a data migration policy;
[0108] In this embodiment, if the business system uses the routing query function provided by the server, it is necessary to create the tenant's account information in the server in advance and configure the policy data corresponding to the tenant.
[0109] In this embodiment, the server provides routing services, object migration services, and object labeling services. To achieve flexible access to heterogeneous object storage clusters, users can configure corresponding policy data based on tenant accounts, including one or more of the following policies:
[0110] (1) Write routing strategy
[0111] In this embodiment, the write routing policy includes multiple file matching rules and the object storage cluster ID corresponding to each file matching rule.
[0112] For example, the write routing policy configured for tenant ID X is: "$type==\"pdf\"":1,"$type==\"mp4\"":2,"$size>33554432":2. This write routing policy contains three file matching rules, and different matching rules correspond to an object storage cluster ID. When the format of the uploaded file is pdf, the object storage cluster ID to which the file needs to be uploaded is 1. When the format of the uploaded file is mp4, the object storage cluster ID to which the file needs to be uploaded is 2. When the file size of the uploaded file is "33554432" bytes, the object storage cluster ID to which the file needs to be uploaded is 2.
[0113] (2) Data labeling strategy
[0114] In this embodiment, the data labeling strategy includes the specified object storage cluster information and object range, multiple tags, and tag matching rules corresponding to each tag.
[0115] For example, the data annotation strategy for tenant ID X is: cluster ID is 1, cluster type is TFS, cluster address is tfs.domain.com, the annotation object range is OSS ID 1, OSS ID 2, OSS ID 3, and the labels used are label A, label B, label C, and the matching rules of label A, label B, and label C. Among them, the label matching rules are specifically set based on the object attributes and access records of the object. Labels can use user-defined labels, such as file type, expiration time, business type, etc. as labeling labels.
[0116] For example, the matching rule for the tag "large" is "$size>33554432", the matching rule for the tag "video" is "$type==\"mp4\", and the matching rule for the tag "hot" is "$access_count>1". The user-configured data annotation strategy can contain one or more tag matching rules.
[0117] (3) Data Migration Strategy
[0118] In this embodiment, the data migration strategy includes source object storage cluster information and object range, target object storage cluster information, and migration matching rules.
[0119] For example, the data migration policy for tenant ID X is: the cluster ID of the source object storage cluster is 2, the cluster type is CephRGW, the cluster address is rgw.domain.com, the annotated object range is OSS ID 1, OSS ID 2, OSS ID 3, the cluster ID of the target object storage cluster is 1, the cluster type is TFS, the cluster address is tfs.domain.com, migration matching rule A, migration matching rule B, etc. The migration matching rules are specifically set based on the object attributes and custom tags of the object.
[0120] For example, the preset migration matching rule is: "$size>33554432", "$video==true", if the file size and custom label of the traversed object match the above migration matching rule, then the object is the target object of this migration.
[0121] 302. Start an object labeling task thread, and obtain a list of objects in a specified range according to the object storage cluster information and object range specified in the data labeling strategy;
[0122] In this embodiment, data labeling is automatically completed by the server. After the user configures the data labeling strategy, the server automatically starts the object labeling task thread, and then obtains the object list of the specified range as the target of this data labeling based on the object storage cluster information and object range specified in the data labeling strategy.
[0123] For example, the data annotation strategy for tenant ID X is: cluster ID is 1, cluster type is TFS, cluster address is tfs.domain.com, and the annotation object range is OSS ID 1, OSS ID 2, and OSS ID 3. According to the above data annotation strategy, the server obtains the objects in OSS ID 1, OSS ID 2, and OSS ID 3 under cluster ID 1 and adds them to the object list for labeling.
[0124] 303. Traverse the object list, query the object attributes and / or access records of each object, to determine whether the object attributes and / or access records of the traversed object match the label matching rules in the data labeling strategy;
[0125] In this embodiment, before marking the objects in the list, the labels corresponding to each object must be determined first, specifically by querying the object attributes and / or access records of each object to determine whether the object attributes and / or access records of the traversed objects match the label matching rules in the data labeling strategy set by the user. Object attributes include file size, creation time, etc., and access records include tenant ID, file content description, access time, access count, etc.
[0126] According to the object attributes and access records of the traversed object, the label to be used for the traversed object is determined. It should be noted that the label can be user-defined or set by the server by default.
[0127] 304. If there is a match, a label corresponding to the label matching rule is added to the traversed object, an object label is generated and stored in the corresponding database.
[0128] In this embodiment, if a tag that meets the matching rules is matched, the tag can be used to mark the traversed object, generate a corresponding object tag and store it in the corresponding database, such as storing the object tag in a big data system (such as Hive / HBase).
[0129] In this embodiment, the server further provides data labeling services to expand data attribute and feature labeling functions for mainstream object storage services or systems. Users can configure data labeling strategies on the server, and then the server automatically labels the data based on the data attributes and feature labeling strategies, thereby facilitating subsequent users to split or migrate data based on data labels.
[0130] See also Figure 4 , a fourth embodiment of the heterogeneous object storage cluster access method in the embodiment of the present invention includes:
[0131] 401. Create account information for a tenant and configure policy data corresponding to the tenant, where the policy data includes one or more of a write routing policy, a data annotation policy, and a data migration policy;
[0132] 402. Start an object migration task thread, and obtain a list of objects in a specified range according to the source object storage cluster information and the object range in the data migration strategy;
[0133] In this embodiment, data migration is automatically completed by the server. After the user configures the data migration strategy, the server automatically starts the object migration task thread, and then obtains the object list of the specified range as the target of this data migration based on the source object storage cluster information and object range specified in the data migration strategy.
[0134] For example, the data migration policy of tenant ID X is: the cluster ID of the source object storage cluster is 2, the cluster type is CephRGW, the cluster address is rgw.domain.com, the annotated object range is OSS ID 1, OSS ID 2, OSS ID 3, the cluster ID of the target object storage cluster is 1, the cluster type is TFS, and the cluster address is tfs.domain.com, then the objects in OSS ID 1, OSS ID 2, and OSS ID 3 in cluster ID 2 are used as the migration target objects.
[0135] 403. Traverse the object list, query the object attributes and / or custom tags of each object, to determine whether the object attributes and / or custom tags of the traversed objects match the migration matching rules in the data migration policy;
[0136] 404. If there is a match, the traversed object is determined to be a target object to be migrated;
[0137] In this embodiment, before migrating the objects in the list, the target objects to be migrated must be determined first, specifically by querying the object attributes and / or custom tags of each object to determine whether the object attributes and / or custom tags of the traversed objects match the tag matching rules in the data migration policy set by the user. Object attributes include file size, creation time, etc., and custom tags are defined by the user, such as file type, expiration time, business type, etc.
[0138] If the current traversal object matches a migration matching rule, the current traversal object is determined to be a template object to be migrated.
[0139] 405. Read the object data of the target object from the source object storage cluster and write it into the target object storage cluster, and update the routing information of the target object;
[0140] 406. Delete the object data of the target object stored in the source object storage cluster.
[0141] In this embodiment, migration is performed on objects that match a migration matching rule. The migration process first obtains object data from the source object storage cluster, then writes the object data to the target storage cluster, updates the routing information of the object, and finally deletes the successfully migrated object data from the source object storage cluster to complete the data migration.
[0142] This embodiment customizes the migration strategy, further strengthening the native data migration function of the object storage system. Based on the routing service and data labeling service of the above embodiment of the present invention, data can be smoothly migrated between heterogeneous object storage clusters, and the migration process is imperceptible to users, thereby improving the flexibility and convenience of data migration.
[0143] The above describes the heterogeneous object storage cluster access method in the embodiment of the present invention. The following describes the heterogeneous object storage cluster access device in the embodiment of the present invention. Figure 5 , a first embodiment of a heterogeneous object storage cluster access device in an embodiment of the present invention includes:
[0144] The first receiving module 501 is used to receive an object routing query request initiated by a business system;
[0145] A first determination module 502 is configured to determine a write routing strategy matching the request parameters according to the request parameters carried by the query request if the query request is a file upload routing query;
[0146] A second determination module 503 is used to determine the object storage cluster ID corresponding to the file to be uploaded according to the write routing policy and return it to the business system;
[0147] A second receiving module 504 is used to receive a cluster information query request initiated by the business system based on the object storage cluster ID;
[0148] The third determination module 505 is used to determine the corresponding cluster information according to the object storage cluster ID and return it to the business system, so that the business system can upload the file to the corresponding object storage cluster through the built-in universal object storage second-party library;
[0149] The third receiving module 506 is used to receive the routing information, object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully uploaded, and store them in the corresponding database.
[0150] Optionally, in one embodiment, the routing information includes: a key value of the file and an ID of an object storage cluster to which the file is uploaded this time.
[0151] This embodiment pre-configures the routing strategy for each tenant to access the object storage cluster. When receiving a file upload request from the object storage cluster, the object storage cluster ID corresponding to the file to be uploaded is determined according to the write routing strategy, and the corresponding cluster information is determined according to the object storage cluster ID. The business system uploads the file to the corresponding object storage cluster through the built-in universal object storage second-party library based on the cluster information, and further reports the routing information, object attributes, custom tags and access records corresponding to the file. In the present invention, the tenant needs to integrate the universal object storage second-party library in the business system and configure the tenant's object storage cluster routing strategy in the routing service system, so as to achieve flexible and efficient access to heterogeneous object storage clusters.
[0152] See also Figure 6 , a second embodiment of the heterogeneous object storage cluster access device in the embodiment of the present invention includes:
[0153] The first receiving module 501 is used to receive an object routing query request initiated by a business system;
[0154] A first determination module 502 is configured to determine a write routing strategy matching the request parameters according to the request parameters carried by the query request if the query request is a file upload routing query;
[0155] A second determination module 503 is used to determine the object storage cluster ID corresponding to the file to be uploaded according to the write routing policy and return it to the business system;
[0156] A second receiving module 504 is used to receive a cluster information query request initiated by the business system based on the object storage cluster ID;
[0157] The third determination module 505 is used to determine the corresponding cluster information according to the object storage cluster ID and return it to the business system, so that the business system can upload the file to the corresponding object storage cluster through the built-in universal object storage second-party library;
[0158] The third receiving module 506 is used to receive the routing information, object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully uploaded, and store them in the corresponding database;
[0159] The fourth determination module 507 is used to determine the object storage cluster ID corresponding to the file to be downloaded according to the request parameters carried by the query request if the query request is a file download routing query and return it to the business system;
[0160] A fourth receiving module 508 is configured to receive a cluster information query request initiated by the business system based on the object storage cluster ID;
[0161] A fifth determination module 509 is used to determine corresponding cluster information according to the object storage cluster ID and return it to the business system, so that the business system can download files from the corresponding object storage cluster through the built-in universal object storage second-party library;
[0162] The fifth receiving module 510 is used to receive the object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully downloaded, and store them in the corresponding database.
[0163] This embodiment pre-configures the routing strategy for each tenant to access the object storage cluster. When receiving a file download request from the object storage cluster, the routing information of the object storage cluster is queried to determine the object storage cluster ID corresponding to the file to be downloaded. According to the object storage cluster ID, the corresponding cluster information is determined. According to the cluster information, the business system downloads the file from the corresponding object storage cluster through the built-in universal object storage second-party library, and reports the object attributes, custom tags and access records of the file to the server. In the present invention, the tenant needs to integrate the universal object storage second-party library in the business system and configure the tenant's object storage cluster routing strategy in the routing service system, so as to achieve flexible and efficient access to heterogeneous object storage clusters.
[0164] Optionally, in one embodiment, the heterogeneous object storage cluster access device further includes:
[0165] A configuration module is created to create account information for a tenant and configure policy data corresponding to the tenant, wherein the policy data includes one or more of a write routing policy, a data annotation policy, and a data migration policy.
[0166] Optionally, in one embodiment, the write routing strategy includes multiple file matching rules and the object storage cluster ID corresponding to each file matching rule; the data labeling strategy includes specified object storage cluster information and object range, multiple tags and tag matching rules corresponding to each tag; the data migration strategy includes source object storage cluster information and object range, target object storage cluster information, and migration matching rules.
[0167] Optionally, in one embodiment, the heterogeneous object storage cluster access device further includes:
[0168] The object labeling module is used to start the object labeling task thread, and obtain the object list of the specified range according to the object storage cluster information and object range specified in the data labeling strategy; traverse the object list, query the object attributes and / or access records of each object to determine whether the object attributes and / or access records of the traversed object match the label matching rules in the data labeling strategy; if matched, add the label corresponding to the label matching rule to the traversed object, generate the object label and store it in the corresponding database.
[0169] This embodiment customizes the migration strategy, further strengthening the native data migration function of the object storage system. Based on the routing service and data labeling service of the above embodiment of the present invention, data can be smoothly migrated between heterogeneous object storage clusters, and the migration process is imperceptible to users, thereby improving the flexibility and convenience of data migration.
[0170] Optionally, in one embodiment, the heterogeneous object storage cluster access device further includes:
[0171] The object migration module is used to start the object migration task thread, and obtain the object list of the specified range according to the source object storage cluster information and the object range in the data migration strategy; traverse the object list, query the object attributes and / or custom tags of each object to determine whether the object attributes and / or custom tags of the traversed object match the migration matching rules in the data migration strategy; if they match, determine that the traversed object is the target object to be migrated; read the object data of the target object from the source object storage cluster and write it into the target object storage cluster, and update the routing information of the target object; delete the object data of the target object stored in the source object storage cluster.
[0172] In this embodiment, the server further provides data labeling services to expand data attribute and feature labeling functions for mainstream object storage services or systems. Users can configure data labeling strategies on the server, and then the server automatically labels the data based on the data attributes and feature labeling strategies, thereby facilitating subsequent users to split or migrate data based on data labels.
[0173] above Figure 5 and Figure 6 The heterogeneous object storage cluster access device in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The heterogeneous object storage cluster access device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0174] Figure 71 is a schematic diagram of the structure of a heterogeneous object storage cluster access device provided by an embodiment of the present invention. The heterogeneous object storage cluster access device 700 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 710 (for example, one or more processors) and a memory 720, and one or more storage media 730 (for example, one or more mass storage devices) storing application programs 733 or data 732. Among them, the memory 720 and the storage medium 730 may be temporary storage or permanent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the heterogeneous object storage cluster access device 700. Furthermore, the processor 710 may be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the heterogeneous object storage cluster access device 700.
[0175] The heterogeneous object storage cluster access device 700 may also include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input and output interfaces 760, and / or one or more operating systems 731, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that Figure 7 The illustrated heterogeneous object storage cluster access device structure does not constitute a limitation on the heterogeneous object storage cluster access device, and may include more or less components than illustrated, or combine certain components, or arrange components differently.
[0176] The present invention also provides a heterogeneous object storage cluster access device, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the steps of the heterogeneous object storage cluster access method in the above-mentioned embodiments.
[0177] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the heterogeneous object storage cluster access method.
[0178] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0179] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0180] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for accessing a heterogeneous object storage cluster, characterized in that: The heterogeneous object storage cluster access method includes: Receive routing query requests initiated by the business system; If the routing query request is a file upload routing query, determining a write routing strategy that matches the request parameter according to the request parameter carried by the routing query request; According to the write routing strategy, determine the object storage cluster ID corresponding to the file to be uploaded and return it to the business system; Receiving a cluster information query request initiated by the business system based on the object storage cluster ID; According to the object storage cluster ID, the corresponding cluster information is determined and returned to the business system, so that the business system can upload the file to the corresponding object storage cluster through the built-in universal object storage second-party library, and the universal object storage second-party library contains an interface that can directly access various object storage clusters; The routing information, object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully uploaded are received and stored in the corresponding database.
2. The method for accessing a heterogeneous object storage cluster according to claim 1, characterized in that: After receiving the route query request initiated by the service system, the method further includes: If the routing query request is a file download routing query, then according to the request parameters carried by the routing query request, the object storage cluster ID corresponding to the file to be downloaded is determined and returned to the business system; Receiving a cluster information query request initiated by the business system based on the object storage cluster ID; According to the object storage cluster ID, the corresponding cluster information is determined and returned to the business system, so that the business system can download files from the corresponding object storage cluster through the built-in universal object storage second-party library; The object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully downloaded are received and stored in the corresponding database.
3. The method for accessing a heterogeneous object storage cluster according to claim 1 or 2, characterized in that: Before receiving the route query request initiated by the service system, the method further includes: Create tenant account information and configure policy data corresponding to the tenant, wherein the policy data includes one or more of a write routing policy, a data annotation policy, and a data migration policy.
4. The method for accessing a heterogeneous object storage cluster according to claim 3, characterized in that: The write routing strategy includes multiple file matching rules and the object storage cluster ID corresponding to each file matching rule; the data labeling strategy includes the specified object storage cluster information and object range, multiple tags and the tag matching rules corresponding to each tag; the data migration strategy includes the source object storage cluster information and object range, the target object storage cluster information, and the migration matching rules.
5. The method for accessing a heterogeneous object storage cluster according to claim 4, characterized in that: The heterogeneous object storage cluster access method further includes: Start the object labeling task thread, and obtain the object list of the specified range according to the object storage cluster information and object range specified in the data labeling strategy; Traversing the object list, querying the object attributes and / or access records of each object to determine whether the object attributes and / or access records of the traversed objects match the label matching rules in the data labeling strategy; If there is a match, a label corresponding to the label matching rule is added to the traversed object, an object label is generated and stored in the corresponding database.
6. The method for accessing a heterogeneous object storage cluster according to claim 4, characterized in that: The heterogeneous object storage cluster access method further includes: Start the object migration task thread, and obtain the object list of the specified range according to the source object storage cluster information and object range in the data migration strategy; Traversing the object list, querying the object attributes and / or custom tags of each object to determine whether the object attributes and / or custom tags of the traversed objects match the migration matching rules in the data migration policy; If there is a match, the traversed object is determined to be the target object to be migrated; Read the object data of the target object from the source object storage cluster and write it into the target object storage cluster, and update the routing information of the target object; Delete the object data of the target object stored in the source object storage cluster.
7. The method for accessing a heterogeneous object storage cluster according to claim 1, characterized in that: The routing information includes: the key value of the file and the object storage cluster ID to which the file is uploaded this time.
8. A heterogeneous object storage cluster access device, characterized in that: The heterogeneous object storage cluster access device comprises: A first receiving module, used to receive a routing query request initiated by a business system; A first determination module, configured to determine, if the routing query request is a file upload routing query, a write routing strategy matching the request parameter according to the request parameter carried by the routing query request; A second determination module is used to determine the object storage cluster ID corresponding to the file to be uploaded according to the write routing policy and return it to the business system; A second receiving module, configured to receive a cluster information query request initiated by the business system based on the object storage cluster ID; A third determination module is used to determine the corresponding cluster information according to the object storage cluster ID and return it to the business system, so that the business system can upload the file to the corresponding object storage cluster through a built-in universal object storage second-party library, wherein the universal object storage second-party library contains an interface that can directly access various object storage clusters; The third receiving module is used to receive the routing information, object attributes, custom tags and access records corresponding to the file reported by the business system after the file is successfully uploaded, and store them in the corresponding database.
9. A heterogeneous object storage cluster access device, characterized in that: The heterogeneous object storage cluster access device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instruction in the memory to enable the heterogeneous object storage cluster access device to execute the heterogeneous object storage cluster access method according to any one of claims 1 to 7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the heterogeneous object storage cluster access method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Task scheduling management system, method, device and storable medium thereof
CN111143044A
Flow management method and device for micro-service request, server and storage medium
CN111600930A
File transfer method and apparatus
CN1968099A
