Object storage method, device, equipment and storage medium

By storing metadata information and operation log information in the object storage service to bucket index shards and bucket index log shards respectively, the problem of slow data synchronization speed in the bucket is solved, synchronization efficiency is improved, and off-site disaster recovery is optimized. performance in the scenario.

CN113625952BActive Publication Date: 2024-08-23JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110741523.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2024-08-23
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

In the object storage service, as the number of objects in the bucket increases, the synchronization speed of metadata information and operation log information gradually slows down, resulting in low data synchronization efficiency.

Method used

The object's metadata information and operation log information are stored in the corresponding bucket index shards and bucket index log shards respectively, instead of being written to the same bucket index shard. In this way, data synchronization can be achieved when needed.

Benefits of technology

It effectively reduces the size of bucket index shards, improves the speed of data synchronization, optimizes performance in off-site disaster recovery scenarios, and avoids useless occupation of operation log information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113625952B
    Figure CN113625952B
Patent Text Reader

Abstract

The present invention discloses an object storage method, device, equipment and storage medium, the method comprising: determining that the storage bucket to which the object currently needs to be written in the object storage service is the current bucket, and the object to be written in the current bucket is the current object; writing the current object into the current bucket, writing the metadata information of the current object into the bucket index shard of the current bucket, and writing the operation log information written to the current object into the bucket index log shard corresponding to the bucket index shard into which the metadata information of the current object is written, so as to synchronize the current object based on the corresponding metadata information and operation log information; the bucket index shard and the bucket index log shard are one-to-one corresponding. It can be seen that the present application no longer writes the operation log information of the object into the bucket index shard corresponding to the object, but into a separate bucket index log shard, thereby making the bucket index shard smaller in this way, effectively improving the speed of data synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of object storage technology, and more specifically, to an object storage method, device, equipment and storage medium. Background Art

[0002] In the era of big data, Object Storage Service (OSS) is an emerging cloud storage service that is massive, secure, low-cost, and highly reliable. It is suitable for storing unstructured data, such as videos, pictures, documents, etc. In a disaster recovery scenario, data synchronization between different sites is often based on the operation log information of the object. Therefore, when writing an object to a bucket in the object storage service, not only will the metadata information of the object be recorded on the bucket index shard (bucket_index) corresponding to the bucket, but the operation log information (bucket_index_log) of the object will also be recorded on the bucket index shard to facilitate data synchronization. Since both metadata information and operation log information need to be stored in the bucket index shard, as the number of objects in the bucket increases to hundreds of millions, the metadata information and operation log information recorded on the bucket index shard of each bucket will increase, which will lead to a slower synchronization speed when synchronization is implemented. Summary of the invention

[0003] The object of the present invention is to provide an object storage method, device, equipment and storage medium, which can effectively improve the speed of data synchronization.

[0004] In order to achieve the above object, the present invention provides the following technical solutions:

[0005] An object storage method, comprising:

[0006] If an object needs to be written to any bucket of the object storage service, the bucket to which the object needs to be written is determined to be the current bucket, and the object to be written to the current bucket is determined to be the current object;

[0007] Write the current object into the current bucket, write the metadata information of the current object into the bucket index shard of the current bucket, and write the operation log information for writing the current object into the bucket index log shard corresponding to the bucket index shard where the metadata information of the current object is written, so as to synchronize the current object based on the corresponding metadata information and the operation log information; wherein the bucket index shard corresponds to the bucket index log shard one by one.

[0008] Preferably, it also includes:

[0009] If the current object in the current bucket needs to be modified or deleted, the metadata information of the current object contained in the corresponding bucket index shard is modified or deleted accordingly, and the operation log information of the modification or deletion of the current object is written to the bucket index log shard containing the operation log information of writing the current object.

[0010] Preferably, it also includes:

[0011] Determine whether the object storage service is a multi-site scenario. If so, execute the step of writing the operation log information of the current object into the corresponding bucket index log shard. If not, determine that there is no need to write the operation log information of the current object into the corresponding bucket index log shard.

[0012] Preferably, after synchronizing the current object based on the corresponding metadata information and the operation log information, the method further includes:

[0013] Delete the operation log information of the current object from the corresponding bucket index log shard.

[0014] An object storage device, comprising:

[0015] A determination module is used to: if an object needs to be written to any storage bucket of the object storage service, determine that the storage bucket where the object is currently to be written is the current bucket, and the object to be written to the current bucket is the current object;

[0016] A writing module is used to: write the current object into the current bucket, write the metadata information of the current object into the bucket index shard of the current bucket, and write the operation log information for writing the current object into the bucket index log shard corresponding to the bucket index shard for writing the metadata information of the current object, so as to synchronize the current object based on the corresponding metadata information and the operation log information; wherein the bucket index shard corresponds to the bucket index log shard one by one.

[0017] Preferably, it also includes:

[0018] The update module is used to: if the current object in the current bucket needs to be modified or deleted, the metadata information of the current object contained in the corresponding bucket index shard will be modified or deleted accordingly, and the operation log information of the modification or deletion of the current object will be written into the bucket index log shard containing the operation log information of writing the current object.

[0019] Preferably, it also includes:

[0020] The judgment module is used to: judge whether the object storage service is a multi-site scenario; if so, instruct the write module or the update module to execute the step of writing the operation log information of the current object into the corresponding bucket index log shard; if not, determine that there is no need to write the operation log information of the current object into the corresponding bucket index log shard.

[0021] Preferably, it also includes:

[0022] The deletion module is used to: after synchronizing the current object based on the corresponding metadata information and the operation log information, delete the operation log information of the current object from the corresponding bucket index log fragment.

[0023] An object storage device, comprising:

[0024] Memory for storing computer programs;

[0025] A processor is used to implement the steps of the object storage method as described in any one of the above items when executing the computer program.

[0026] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above object storage methods are implemented.

[0027] The present invention provides an object storage method, device, equipment and storage medium, the method comprising: if an object needs to be written to any storage bucket of an object storage service, determining that the storage bucket into which the object is currently to be written is the current bucket, and the object to be written to the current bucket is the current object; writing the current object to the current bucket, writing the metadata information of the current object to the bucket index shard of the current bucket, and writing the operation log information for writing the current object to the bucket index log shard corresponding to the bucket index shard into which the metadata information of the current object is written, so as to achieve synchronization of the current object based on the corresponding metadata information and the operation log information; the bucket index shard and the bucket index log shard are one-to-one corresponding. After the present application sets mutually corresponding bucket index shards and bucket index log shards for the storage bucket of the object storage service, when writing an object to the storage bucket, the metadata information and operation log information of the object will be stored in the mutually corresponding bucket index shards and bucket index log shards of the storage bucket, respectively, so as to be synchronized when needed. It can be seen that the present application no longer writes the operation log information of the object into the bucket index shard corresponding to the object, but writes it into a new object separately, namely the bucket index log shard. In this way, the bucket index shard becomes smaller, and the speed of data synchronization is effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0029] Figure 1 A flowchart of an object storage method provided by an embodiment of the present invention;

[0030] Figure 2 A flowchart of writing an object in an object storage method provided by an embodiment of the present invention;

[0031] Figure 3 A schematic diagram of the structure of an object storage device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] 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.

[0033] See also Figure 1 , which shows a flow chart of an object storage method provided by an embodiment of the present invention, which may specifically include:

[0034] S11: If an object needs to be written to any storage bucket of the object storage service, the storage bucket into which the object is currently to be written is determined to be the current bucket, and the object to be written to the current bucket is determined to be the current object.

[0035] Wherein, a bucket is a storage unit in an object storage service. If an object needs to be written to any bucket, the object currently to be written to the bucket and the bucket to which the object needs to be written can be determined to be the current object and the current bucket, respectively, and then the corresponding object write operation is implemented for the current bucket and the current object. It should be noted that each bucket in the object storage service can usually be provided with multiple bucket index shards for implementing the storage of corresponding information, and in the embodiment of the present application, when creating a bucket, it is necessary to create a bucket index shard corresponding to the bucket, and a corresponding amount of bucket index log shards (such as bucket_index.0, bucket_index.1…bucket_index.127) corresponding to the bucket index shards (such as bucket_index.log.0, bucket_index.log.1…bucket_index.log.127), that is, the bucket index log shards correspond to the bucket index shards one-to-one, and the objects corresponding to the information (including metadata information and operation log information) contained in the bucket index log shards and the bucket index shards should be consistent. In addition, bucket index shards and bucket index log shards can both be omap structures.

[0036] S12: Write the current object into the current bucket, write the metadata information of the current object into the bucket index shard of the current bucket, and write the operation log information for writing the current object into the bucket index log shard corresponding to the bucket index shard where the metadata information of the current object is written, so as to synchronize the current object based on the corresponding metadata information and operation log information; wherein the bucket index shard and the bucket index log shard are in one-to-one correspondence.

[0037] After determining the current object and the current bucket, the embodiment of the present application can write the current object into the current bucket, and correspondingly, the metadata information and operation log information of the current object need to be written into the bucket index shard and bucket index log shard of the current bucket and which correspond to each other, so that the metadata information of the object is written on the bucket index shard, and the operation log information of the object is written on the corresponding bucket index log shard. When synchronization is required, the metadata information of the object is first obtained according to the bucket index shard, and then the operation log information of the object is obtained according to the corresponding bucket index log shard, and then data synchronization is achieved based on the obtained metadata information and operation log information. In addition, capacity expansion and other operations can be achieved based on the information in the bucket index shard and the corresponding bucket index log shard (including metadata information and operation log information). The capacity expansion (including data reconstruction) based on the above information is consistent with the implementation principle of the corresponding technical solution in the prior art, and will not be repeated here. Among them, metadata information is data that describes data; operation log information is data that describes the operations performed (such as writing, deleting, etc.); and in the embodiment of the present application, the metadata information and operation log information are respectively written to the corresponding bucket index shards and bucket index log shards. Specifically, the metadata information and operation log information can be stored in the corresponding shards (shards include bucket index shards and bucket index log shards) through hash calculation.

[0038] After the application sets up corresponding bucket index shards and bucket index log shards for the storage bucket of the object storage service, when writing an object to the storage bucket, the metadata information and operation log information of the object will be stored in the bucket index shards and bucket index log shards corresponding to the storage bucket, respectively, for synchronization when needed. It can be seen that the application no longer writes the operation log information of the object into the bucket index shard corresponding to the object, but writes it separately into a new object, namely the bucket index log shard, so that the bucket index shard becomes smaller in this way, effectively improving the speed of data synchronization.

[0039] An object storage method provided by an embodiment of the present invention may further include:

[0040] If the current object in the current bucket needs to be modified or deleted, the metadata information of the current object contained in the corresponding bucket index shard is modified or deleted accordingly, and the operation log information of the modification or deletion of the current object is written to the bucket index log shard containing the operation log information of writing the current object.

[0041] In an embodiment of the present application, after the current object, the metadata information of the current object, and the operation log information are written into the current bucket, if the current object in the current bucket needs to be modified or deleted, then while modifying or deleting the current object in the current bucket, it is also necessary to modify the metadata information of the current object corresponding to the modification of the current object, or delete the metadata information of the current object corresponding to the deletion of the current object, and it is also necessary to write the operation log information of the modification or deletion of the current object into the corresponding bucket index log shard, so that the metadata information and operation log information of the current object are consistent with the situation of the current object, thereby ensuring the effectiveness and accuracy of operations such as synchronization based on the metadata information and operation log information of the current object.

[0042] An object storage method provided by an embodiment of the present invention may further include:

[0043] Determine whether the object storage service is a multi-site scenario. If so, execute the step of writing the operation log information of the current object to the corresponding bucket index log shard. If not, determine that there is no need to write the operation log information of the current object to the corresponding bucket index log shard.

[0044] If you are currently in a multi-site scenario (i.e., a remote disaster recovery scenario), you need to synchronize objects between different sites. Therefore, you need to write the operation log information of the current object to the corresponding bucket index log shard to ensure that subsequent operations such as object synchronization are effectively implemented based on the operation log information. Otherwise, there is no need to write the operation log information of the current object to the corresponding bucket index log shard to avoid useless occupation of the bucket index log shard.

[0045] An object storage method provided by an embodiment of the present invention may further include: after synchronizing the current object based on the corresponding metadata information and operation log information:

[0046] Delete the operation log information of the current object from the corresponding bucket index log shard.

[0047] For objects that have been synchronized, their operation log information is no longer needed. Therefore, you can directly compare the bucket index log shards to trim the operation log information that is no longer needed. In other words, you can delete the operation log that is no longer needed from the bucket index log shard where it is located, thereby reducing the length of the saved omap to the greatest extent.

[0048] In a specific implementation, an object storage method provided by an embodiment of the present invention may specifically include:

[0049] When creating a bucket, create bucket index log shards (bucket_index.log.0, bucket_index.log.1…bucket_index.log.127) corresponding to the bucket index shards (bucket_index.0, bucket_index.1…bucket_index.127);

[0050] When an object is written or deleted, the corresponding record in the bucket index shard (bucket_index.x) will be changed; at the same time, the relevant operation log information will be written to the corresponding bucket index log shard (bucket_index.log.x) for later synchronization;

[0051] When synchronizing an object, find the metadata information of the object through the bucket index shard (bucket_index.x), then obtain the operation log information of the object from the corresponding bucket index log shard (bucket_index.log.x), and then synchronize;

[0052] For objects that have been synchronized, their operation log information is useless. You can directly compare the bucket index log shards (bucket_index.log.x) between different sites and then trim the operation log information of useless objects to reduce the length of the saved omap to the greatest extent.

[0053] The writing process of bucket index log shard (bucket_index.log.x) and bucket index shard (bucket_index.x) can be as follows: Figure 2 As shown, the object information is the metadata information of the object, and the object operation information is the operation log information of the object. The specific writing process may include: determining whether it is a multi-site scenario (remote disaster recovery). If not, the bucket index log shard is not written. Otherwise, after recording the metadata information of the object on the bucket index shard (bucket_index.x), the operation log information of the object is recorded on the bucket index log shard (bucket_index.log.x).

[0054] It can be seen that in the off-site disaster recovery scenario, the present application writes the metadata information of the object on the bucket index shard, and writes the operation log information of the object on the bucket index log shard corresponding to the bucket index shard. Thus, through the object operation log information redistribution method, the object operation log information is no longer written to the bucket index shard corresponding to the object, but is written separately to a new object, which makes the bucket index shard smaller, improves the speed of data reconstruction and data synchronization, and does not affect the original object reading and writing performance, which is beneficial to performance optimization in fault recovery and multi-site scenarios; in addition, the operation log information is stripped from the bucket index shard, the omap size in the bucket index shard is reduced, and it is beneficial to the trimming of the operation log information.

[0055] The embodiment of the present invention also provides an object storage device, such as Figure 3 As shown, it may include:

[0056] The determination module 11 is used to: if an object needs to be written into any storage bucket of the object storage service, determine that the storage bucket where the object is currently to be written is the current bucket, and the object to be written into the current bucket is the current object;

[0057] The writing module 12 is used to: write the current object into the current bucket, write the metadata information of the current object into the bucket index shard of the current bucket, and write the operation log information for writing the current object into the bucket index log shard corresponding to the bucket index shard for writing the metadata information of the current object, so as to synchronize the current object based on the corresponding metadata information and operation log information; wherein the bucket index shard and the bucket index log shard are in one-to-one correspondence.

[0058] An object storage device provided by an embodiment of the present invention may further include:

[0059] The update module is used to: if the current object in the current bucket needs to be modified or deleted, the metadata information of the current object contained in the corresponding bucket index shard will be modified or deleted accordingly, and the operation log information of the modification or deletion of the current object will be written into the bucket index log shard containing the operation log information of writing the current object.

[0060] An object storage device provided by an embodiment of the present invention may further include:

[0061] The judgment module is used to: judge whether the object storage service is a multi-site scenario. If so, instruct the write module or the update module to execute the step of writing the operation log information of the current object into the corresponding bucket index log shard. If not, it is determined that there is no need to write the operation log information of the current object into the corresponding bucket index log shard.

[0062] An object storage device provided by an embodiment of the present invention may further include:

[0063] The deletion module is used to: after synchronizing the current object based on the corresponding metadata information and operation log information, delete the operation log information of the current object from the corresponding bucket index log fragment.

[0064] The embodiment of the present invention further provides an object storage device, which may include:

[0065] Memory for storing computer programs;

[0066] A processor is used to implement the steps of any of the above object storage methods when executing a computer program.

[0067] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above object storage methods are implemented.

[0068] It should be noted that the description of the relevant parts of an object storage device, equipment and storage medium provided in the embodiment of the present invention can refer to the detailed description of the corresponding parts in an object storage method provided in the embodiment of the present invention, which will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiment of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.

[0069] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for storing objects, It is characterized in that include: If an object needs to be written to any bucket of the object storage service, the bucket to which the object needs to be written is determined to be the current bucket, and the object to be written to the current bucket is determined to be the current object; Write the current object into the current bucket, write the metadata information of the current object into the bucket index shard of the current bucket, and write the operation log information of writing the current object into the bucket index log shard corresponding to the bucket index shard where the metadata information of the current object is written, so as to synchronize the current object based on the corresponding metadata information and the operation log information; wherein the bucket index shard and the bucket index log shard are in one-to-one correspondence; The metadata information of the object is obtained according to the bucket index shard, and the operation log information of the object is obtained according to the corresponding bucket index log shard, and then the object is synchronized based on the obtained metadata information and operation log information; for the objects that have been synchronized, the bucket index log shards between different sites are compared, and the operation logs that are no longer needed are deleted from the bucket index log shards where they are located; If the current object in the current bucket needs to be modified or deleted, the metadata information of the current object contained in the corresponding bucket index shard is modified or deleted accordingly, and the operation log information of the modification or deletion of the current object is written to the bucket index log shard containing the operation log information of writing the current object.

2. The method according to claim 1, It is characterized in that Also includes: Determine whether the object storage service is a multi-site scenario. If so, execute the step of writing the operation log information of the current object into the corresponding bucket index log shard. If not, determine that there is no need to write the operation log information of the current object into the corresponding bucket index log shard.

3. The method according to claim 2, It is characterized in that After synchronization of the current object is achieved based on the corresponding metadata information and the operation log information, the method further includes: Delete the operation log information of the current object from the corresponding bucket index log shard.

4. An object storage device, It is characterized in that include: A determination module is used to: if an object needs to be written into any storage bucket of the object storage service, determine that the storage bucket where the object is currently to be written is the current bucket, and the object to be written into the current bucket is the current object; A writing module, used to: write the current object into the current bucket, write the metadata information of the current object into the bucket index shard of the current bucket, and write the operation log information of writing the current object into the bucket index log shard corresponding to the bucket index shard into which the metadata information of the current object is written, so as to synchronize the current object based on the corresponding metadata information and the operation log information; wherein the bucket index shard and the bucket index log shard are in one-to-one correspondence; The metadata information of the object is obtained according to the bucket index shard, and the operation log information of the object is obtained according to the corresponding bucket index log shard, and then the object is synchronized based on the obtained metadata information and operation log information; for the objects that have been synchronized, the bucket index log shards between different sites are compared, and the operation logs that are no longer needed are deleted from the bucket index log shards where they are located; The update module is used to: if the current object in the current bucket needs to be modified or deleted, the metadata information of the current object contained in the corresponding bucket index shard will be modified or deleted accordingly, and the operation log information of the modification or deletion of the current object will be written into the bucket index log shard containing the operation log information of writing the current object.

5. The device according to claim 4, It is characterized in that Also includes: The judgment module is used to: judge whether the object storage service is a multi-site scenario; if so, instruct the write module or the update module to execute the step of writing the operation log information of the current object into the corresponding bucket index log shard; if not, determine that there is no need to write the operation log information of the current object into the corresponding bucket index log shard.

6. The device according to claim 5, It is characterized in that Also includes: The deletion module is used to: after synchronizing the current object based on the corresponding metadata information and the operation log information, delete the operation log information of the current object from the corresponding bucket index log fragment.

7. An object storage device, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the object storage method according to any one of claims 1 to 3 when executing the computer program.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the object storage method according to any one of claims 1 to 3 are implemented.