Object metadata storage method and device, electronic equipment and storage medium

By dividing the storage space into multiple storage partitions and matching the object range of the storage partition according to the object name of the object metadata, the problem of limited storage amount of object metadata in a single bucket is solved, and cross-storage medium storage and load balancing of object metadata is achieved.

CN119597216AActive Publication Date: 2025-03-11MACROSAN TECH

Patent Information

Application Number
CN202411686787.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-11
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

In the prior art, the amount of object metadata storage in a single storage bucket is limited by the capacity of a single storage medium, making it difficult to effectively manage and store a large amount of unstructured data.

Method used

By dividing the storage space into N storage partitions, each storage partition corresponds to an object range, and determining the reference storage partition according to the object name of the object metadata matches the object range of the storage partition. If the reference storage partition is in the first state, the partition is used directly; if it is in the second state, the target storage partition is found according to the load balancing principle and the object metadata is stored in the target storage partition.

Benefits of technology

The cross-storage media storage of object metadata is realized, avoiding the capacity limitation of a single storage medium, increasing the amount of object metadata storage in a single storage bucket, and ensuring the balanced distribution and load balancing of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597216A_ABST
    Figure CN119597216A_ABST
Patent Text Reader

Abstract

The invention provides an object metadata storage method and device, electronic equipment and a storage medium. At least two storage buckets in the object storage system correspond to the same storage space, the storage space is divided into N storage partitions, and each storage partition corresponds to at least one storage medium. Through the method provided by the invention, a plurality of object metadata to be stored in one storage bucket can be uniformly stored in the storage space (namely the storage medium) corresponding to each storage partition, so that the object metadata in the same storage bucket can be stored across the storage medium and is not limited by the storage capacity of a single storage medium any more, and the storage efficiency is improved. Therefore, the object metadata storage capacity of the single bucket is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage technology, and in particular to an object metadata storage method, device, electronic device and storage medium. Background Art

[0002] With the explosive growth of unstructured data, object storage came into being. Object is the basic unit of object storage. An object is a collection of file data (i.e. object data) and its related attribute information (i.e. object metadata). Bucket is the basic entity in object storage and is a container for storing objects and object metadata.

[0003] In order to facilitate object management, object data and object metadata are usually stored separately. Currently, the object metadata of a single bucket is usually stored in a single storage medium (such as a disk). Due to the capacity of a single storage medium, the storage capacity of the object metadata of a single bucket is also limited. Summary of the invention

[0004] In view of this, the present application provides an object metadata storage method, device, electronic device and storage medium to increase the object metadata storage capacity of a single bucket.

[0005] The embodiment of the present application provides an object metadata storage method, wherein a storage space is divided into N storage partitions, each storage partition having a corresponding object range; the method comprises:

[0006] Determine a reference storage partition for the target object metadata to be stored in the target bucket; the target object is within an object range corresponding to the reference storage partition;

[0007] If it is determined that the reference storage partition is in the first state, the reference storage partition is determined as the target storage partition; any storage partition being in the first state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition has not been migrated to the storage space corresponding to other storage partitions;

[0008] If it is determined that the reference storage partition is in the second state, the target storage partition is found from each reference storage partition according to the load balancing principle; any storage partition being in the second state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition is migrated to the storage space corresponding to other storage partitions;

[0009] Store the target object metadata in the storage space corresponding to the target storage partition.

[0010] The embodiment of the present application also provides an object metadata storage device, which is applied to an object storage system, in which at least two storage buckets correspond to the same storage space, and the storage space is divided into N storage partitions, each storage partition having a corresponding object range; the device includes:

[0011] A first determination module is used to determine a reference storage partition for target object metadata to be stored in a target bucket; the target object is within an object range corresponding to the reference storage partition;

[0012] A second determination module is used to determine the reference storage partition as the target storage partition if it is determined that the reference storage partition is in the first state; any storage partition being in the first state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition has not been migrated to the storage space corresponding to other storage partitions;

[0013] A search module is used to search for a target storage partition from each reference storage partition according to a load balancing principle if it is determined that the reference storage partition is in the second state; any storage partition being in the second state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition is migrated to the storage space corresponding to other storage partitions;

[0014] The storage module is used to store the target object metadata in the storage space corresponding to the target storage partition.

[0015] An embodiment of the present application also provides an electronic device, comprising: a processor and a computer-readable storage medium for storing computer program instructions, wherein the computer program instructions, when executed by the computer-readable storage medium, enable the processor to execute the steps of the above method.

[0016] An embodiment of the present application also provides a machine-readable storage medium, which stores computer program instructions. When the computer program instructions are executed, the steps of the above method can be implemented.

[0017] It can be seen from the above technical solutions that in this embodiment, at least two storage buckets in the object storage system correspond to the same storage space, and the storage space is divided into N storage partitions, and each storage partition corresponds to at least one storage medium. After obtaining the target object metadata to be stored in the target bucket, first match the object name of the object to which the target object metadata belongs with the object range configured in each storage partition to obtain a reference storage partition. After that, if it is determined that the reference storage partition is in the first state, the reference storage partition is determined as the target storage partition. If it is determined that the reference storage partition is in the second state, the target storage partition is found from each reference storage partition according to the load balancing principle, and the target object metadata is stored in the storage space corresponding to the target storage partition. In this way, multiple object metadata to be stored in a storage bucket can be evenly stored in the storage space (that is, storage medium) corresponding to each storage partition, which realizes that the object metadata in the same storage bucket can be stored across storage media, no longer limited by the storage capacity of a single storage medium, thereby increasing the object metadata storage capacity of a single bucket. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A flowchart of the object metadata storage method provided in the embodiment of the present application;

[0019] Figure 2 A schematic diagram of a segmentation mark provided in an embodiment of the present application;

[0020] Figure 3 A schematic diagram of a process for finding a target storage partition provided in an embodiment of the present application;

[0021] Figure 4 A schematic diagram of changing a segmentation mark provided in an embodiment of the present application;

[0022] Figure 5 A schematic diagram of segmentation identification and storage partitions provided in an embodiment of the present application;

[0023] Figure 6 A schematic diagram of the structure of the device provided in the embodiment of the present application;

[0024] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0026] In order to implement the solution provided by the embodiment of the present application, it is necessary to improve the object storage system. Here, at least two storage buckets in the object storage system correspond to the same storage space, which is divided into N storage partitions, and the storage space corresponding to each storage partition can be a storage medium (such as a storage disk), or K storage media set according to the copy backup principle (for example, according to the 3-copy principle, one storage partition corresponds to 3 storage disks), which makes each storage bucket correspond to more than one storage medium. On this basis, a corresponding object range is configured for each storage partition, and then the method provided by this embodiment is implemented, so that the metadata of multiple objects to be stored in a storage bucket can be evenly stored in the storage space corresponding to each storage partition, that is, the metadata of multiple objects to be stored in a storage bucket is evenly stored in the storage medium (such as a storage disk) corresponding to each storage partition. This realizes that the object metadata in the same storage bucket can be stored across storage media, no longer limited by the storage capacity of a single storage medium, and therefore, the storage capacity of the object metadata of a single bucket can be increased.

[0027] The following is a detailed description of the object metadata storage method provided by the embodiment of the present application:

[0028] See also Figure 1 , Figure 1 A flowchart of an object metadata storage method provided in an embodiment of the present application.

[0029] like Figure 1 As shown, the process may include the following steps:

[0030] S101, determining a reference storage partition for target object metadata to be stored in a target bucket; the target object is within an object range corresponding to the reference storage partition.

[0031] In this embodiment, each storage partition is configured with a corresponding object range. As an embodiment, the object range configured for each partition is divided by a segmentation identifier, that is, the object range of N storage partitions is divided by N-1 segmentation identifiers. By setting the segmentation identifier in this way, the storage space of the entire target bucket is logically divided into multiple continuous storage partitions. When the object metadata is to be stored, the object metadata will be mapped to the storage partition of the corresponding range according to the object name.

[0032] As an embodiment, the format of the segmentation identifier is the same as the format of the object name of the object to which the object metadata belongs. The format mentioned here may be a coded format. For example, the object name to which the metadata belongs is composed of characters from a specified dictionary (such as an ASCII dictionary), then the N-1 segmentation identifiers are the N-1 characters in the specified dictionary.

[0033] For example, if Figure 2As shown, the four storage partitions of the target bucket are divided by the specified characters F, K, and Q. If the name of the object to which the target object metadata to be stored in the target bucket belongs is S, and according to the sorting size in the established dictionary order corresponding to the specified dictionary, S is greater than Q, then storage partition 4 is determined to be the reference storage partition. If the name of the object to which the target object metadata to be stored in the target bucket belongs is H, and H is between F and Q, then storage partition 2 is determined to be the reference storage partition.

[0034] It should be noted that when setting N-1 segmentation identifiers, it is necessary to try to make the object metadata to be stored in each storage partition meet the load balancing principle. In addition, the specified dictionary is not limited to the above dictionary, but can also be other dictionaries, which can be set according to the actual operation situation, and the embodiment of this application does not specifically limit it.

[0035] S102: If it is determined that the reference storage partition is in the first state, determine the reference storage partition as the target storage partition.

[0036] In this embodiment, any storage partition being in the first state means that, under the current object scope, object metadata stored in the storage space corresponding to the storage partition has not been migrated to storage spaces corresponding to other storage partitions.

[0037] S103: If it is determined that the reference storage partition is in the second state, searching for the target storage partition from the reference storage partitions according to the load balancing principle.

[0038] In this embodiment, any storage partition being in the second state means that, under the current object scope, object metadata stored in the storage space corresponding to the storage partition is migrated to storage spaces corresponding to other storage partitions.

[0039] It should be noted that after configuring the object range for each storage partition, the initial state of each storage partition is the first state. As for when to switch to the second state, it will be explained in the following embodiments and will not be repeated here.

[0040] In this embodiment, the storage partition can be distinguished by the indication tag whether it is in the first state or the second state. For example, after configuring the object range for each storage partition, each storage partition carries a first indication tag. When it is determined to change to the second state, the first indication tag is changed to a second indication tag. Exemplarily, the first indication tag is 0 and the second indication tag is 1.

[0041] In this embodiment, the above step S103 of searching for the target storage partition from the reference storage partitions according to the load balancing principle will be described later and will not be repeated here.

[0042] S104: Store the target object metadata into the storage space corresponding to the target storage partition.

[0043] In this embodiment, optionally, as an embodiment, a storage partition corresponds to a storage medium, such as a storage disk, and after the target storage partition is determined, the target object metadata is stored in the storage disk corresponding to the target storage partition.

[0044] So far, completed Figure 1 The process shown.

[0045] pass Figure 1 The process shown, in this embodiment, at least two storage buckets in the object storage system correspond to the same storage space, the storage space is divided into N storage partitions, and each storage partition corresponds to at least one storage medium. After obtaining the target object metadata to be stored in the target bucket, first match the object name of the object to which the target object metadata belongs with the object range configured in each storage partition to obtain a reference storage partition. After that, if it is determined that the reference storage partition is in the first state, the reference storage partition is determined as the target storage partition. If it is determined that the reference storage partition is in the second state, the target storage partition is found from each reference storage partition according to the load balancing principle, and the target object metadata is stored in the storage space corresponding to the target storage partition. In this way, multiple object metadata to be stored in a storage bucket can be evenly stored in the storage space (that is, storage medium) corresponding to each storage partition, which realizes that the object metadata in the same storage bucket can be stored across storage media, no longer limited by the storage capacity of a single storage medium, thereby increasing the object metadata storage capacity of a single bucket.

[0046] The following is a detailed description of the above-mentioned process of finding the target storage partition from each reference storage partition based on the load balancing principle:

[0047] See also Figure 3 , Figure 3 A schematic diagram of a process for finding a target storage partition provided in an embodiment of the present application.

[0048] like Figure 3 As shown, the process may include the following steps:

[0049] S301, setting the number of virtual nodes for each storage partition based on a hash consistency algorithm.

[0050] In this embodiment, a virtual layer is established between the storage bucket and each partition, and the virtual layer is composed of a number of virtual nodes. The target storage partition can be found by determining the virtual node of the target object metadata. Therefore, it is necessary to set the number of virtual nodes for each storage partition based on the hash consistency algorithm.

[0051] As an embodiment, by balancing the relationship between the number of virtual nodes and uniformity, the total number of virtual nodes in the virtual layer is 0 to 2. ^16 , that is, 65536 virtual nodes. If there are 8 storage partitions, the number of virtual nodes in each storage partition should be 8192, which is 65536 divided by 8.

[0052] The distribution of virtual nodes in each storage partition is as follows:

[0053] Storage partition 1 - (0 to 8191 virtual nodes)

[0054] Storage partition 2 - (8192 to 16383 virtual nodes)

[0055] Storage partition 3 - (16384 to 24575 virtual nodes)

[0056] And so on, until storage partition 8.

[0057] S302, performing a hash operation on the object name of the target object to which the target object metadata belongs, the bucket name of the storage bucket corresponding to the target object, and the version number of the target object to obtain a corresponding hash value.

[0058] In this embodiment, the hash value can be expressed by the following formula:

[0059] H=hash(BucketName+ObjectName+VersionId)

[0060] Among them, BucketName represents the bucket name; ObjectName represents the object name; hash represents the hash operation; VersionId represents the version number; and H represents the hash value.

[0061] It should be noted that if the bucket does not have multiple versions enabled, the default VersionId is null.

[0062] S303, taking the modulus of the obtained hash value and the total number of virtual nodes of all storage partitions, and determining the target storage partition to which the target object metadata belongs based on the obtained modulus result and the number of virtual nodes set for each storage partition.

[0063] Specifically, it can be expressed as:

[0064] V=H%K

[0065] Where K represents the total number of virtual nodes; V is the remainder result.

[0066] For example, if the region result is 2, the reference partition 2 is determined to be the target storage partition.

[0067] By means of the above method, when it is determined that the reference storage partition is in the second state, the object metadata to be stored can be distributed and stored in each partition as evenly as possible to ensure load balancing of the object storage system.

[0068] The above is a detailed description of how to find a target storage partition from various storage partitions based on the load balancing principle.

[0069] The switching between the first state and the second state is described in detail below:

[0070] It is known that after each storage partition is configured with an object range, each storage partition is in the first state. Figure 2 If the target bucket stores a large amount of object metadata whose object names begin with A, the object metadata stored in storage partition 1 will be much larger than that in other partitions. In this case, the object metadata in storage partition 1 needs to be migrated to achieve load balancing.

[0071] As an embodiment, when the set migration period arrives, for each storage partition in the first state, the occupancy rate of the storage space corresponding to the storage partition is obtained. If the occupancy rate of the storage space corresponding to the storage partition is greater than the set occupancy rate threshold, at least part of the object metadata stored in the storage space corresponding to the storage partition is migrated to a destination storage partition different from the current storage partition, and the state of the storage partition is changed from the first state to the second state.

[0072] As an embodiment, the migration of the object metadata stored in the storage space corresponding to any storage partition is implemented in the following manner:

[0073] Traverse each stored object metadata in the storage space corresponding to the storage partition, and use the traversed stored object metadata as the current object metadata. Perform a hash operation on the object name of the object to which the current object metadata belongs, the bucket name of the storage bucket corresponding to the object, and the version number of the object to obtain the corresponding hash value. Take the modulus of the obtained hash value and the total number of virtual nodes in all storage partitions, and determine the reference migration storage partition corresponding to the current object metadata based on the obtained modulus result and the number of virtual nodes set for each storage partition (the specific implementation method is the same as above). Figure 3 The implementation method is similar to that of , which will not be repeated here). If the reference migration storage partition is different from the current storage partition, the reference migration storage partition is determined as the destination storage partition. If the reference migration storage partition is the same as the current storage partition, no migration is performed.

[0074] Based on the above description, it can be known that for the storage partition in the second state, a hash operation needs to be performed again when storing object metadata, but the hash operation still takes time. In order to optimize the system operation performance, when the state of the object storage system is the set idle state, the object range corresponding to at least one storage partition can be changed according to the load balancing principle. At this time, the state of each storage partition is changed from the second state to the first state, so that the object metadata stored subsequently only needs to match the object name with the object range configured for each storage partition, without having to perform a hash operation again, so that the performance of the subsequent object storage system is optimized when performing storage. In addition, when changing the object range, it is in accordance with the load balancing principle, which makes the storage space corresponding to each storage partition also meet the load balancing in the subsequent storage.

[0075] There are many ways to implement changing the object range corresponding to at least one storage partition. For example, as an embodiment, Figure 4 As shown, the partition identifier between two adjacent storage partitions is changed. The specific change principle must follow the load balancing principle.

[0076] It should be noted that after the object range corresponding to each storage partition is changed, the object metadata stored in each storage partition needs to be re-migrated. The re-migration can be implemented in the following specific ways:

[0077] For each storage partition, traverse each stored object metadata in the storage space corresponding to the storage partition, and use the traversed stored object metadata as the current object metadata. Compare the object name of the object to which the current object metadata belongs and the new object range corresponding to each partition, and determine the reference migration storage partition corresponding to the current object metadata (the specific implementation method is similar to the implementation method of the above step 101, which will not be repeated here). If the reference migration storage partition is different from the current storage partition, the reference migration storage partition is determined as the destination storage partition. If the reference migration storage partition is the same as the current storage partition, no further migration is performed.

[0078] After the above re-migration is completed, the state of the storage partition currently in the second state is changed from the second state to the first state.

[0079] The switching between the first state and the second state is described in detail above.

[0080] In order to explain the method provided by the present application in more detail, the scheme provided by the present application is described in more detail below in the form of specific embodiments.

[0081] In this embodiment, the pre-configuration stage includes the following steps:

[0082] 1. Please refer to Figure 5As shown, if there are four nodes (0001, 0002, 0003, 0004), each node has two disks (A, B) for storing object metadata, and each disk of each node forms a storage partition, that is, 0001A, 0002A, 0003A, 0004A, 0001B, 0002B, 0003B, 0004B correspond to the eight storage partitions 1 to 8. The partition identifiers of the eight storage partitions are D, G, J, M, P, S, and U.

[0083] 2. The initial indication label of each storage partition is 0. When the disk occupancy rate of a storage partition is greater than the set occupancy rate threshold, the indication label is changed to 1.

[0084] 3. Based on the hash consistency algorithm, virtual nodes are allocated to the eight storage partitions, storage partition 1 to storage partition 8.

[0085] Specifically, storage partition 1-(0 to 8191 virtual nodes)

[0086] Storage partition 2 - (8192 to 16383 virtual nodes)

[0087] Storage partition 3 - (16384 to 24575 virtual nodes)

[0088] And so on, until storage partition 8.

[0089] Subsequent object metadata storage includes the following steps:

[0090] 1. When it is determined that the target object metadata is to be written, the reference storage partition corresponding to the target object metadata is determined by comparing the object name of the target object metadata with each segmentation identifier.

[0091] 2. If the identifier of the reference storage partition is 0, the reference storage partition is determined as the target storage partition.

[0092] 3. If the reference storage partition is identified as 1, use the following formula:

[0093] H=hash(BucketName+ObjectName+VersionId) performs hash operation to obtain the hash value, and uses the following formula:

[0094] V=H%K is modulo to obtain a modulo result, and the target storage partition is determined according to the modulo result. For example, if the modulo result is 2, the storage partition 2 is determined as the target storage partition.

[0095] 4. Store the target object metadata in the storage space corresponding to the target storage partition.

[0096] At this point, the description of the method provided in this embodiment is completed. The following describes the device provided in this embodiment of the application:

[0097] See also Figure 6 , Figure 6 A schematic diagram of the structure of the device provided in the embodiment of the present application. The device is applied to an object storage system, in which at least two storage buckets correspond to the same storage space, and the storage space is divided into N storage partitions, each storage partition having a corresponding object range. The device 600 includes: a first determination module 601, a second determination module 602, a search module 603 and a storage module 604.

[0098] The first determination module 601 is used to determine a reference storage partition for the target object metadata to be stored in the target bucket; the target object is in the object range corresponding to the reference storage partition;

[0099] The second determination module 602 is used to determine the reference storage partition as the target storage partition if it is determined that the reference storage partition is in the first state; any storage partition being in the first state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition has not been migrated to the storage space corresponding to other storage partitions;

[0100] Search module 603, used for searching the target storage partition from each reference storage partition according to the load balancing principle if it is determined that the reference storage partition is in the second state; any storage partition being in the second state means that under the current object range, the object metadata stored in the storage space corresponding to the storage partition is migrated to the storage space corresponding to other storage partitions;

[0101] The storage module 604 is used to store the target object metadata into the storage space corresponding to the target storage partition.

[0102] As an embodiment, there is a split identifier between two adjacent storage partitions, and the split identifier limits the object ranges corresponding to the two adjacent storage partitions respectively; wherein the format of the split identifier is the same as the format of the object name of the object to which the object metadata belongs.

[0103] As an embodiment, searching for a target storage partition from each reference storage partition according to a load balancing principle includes:

[0104] Set the number of virtual nodes for each storage partition based on the hash consistency algorithm;

[0105] Perform a hash operation on the object name of the target object to which the target object metadata belongs, the bucket name of the storage bucket corresponding to the target object, and the version number of the target object to obtain a corresponding hash value;

[0106] The obtained hash value is modulo the total number of virtual nodes in all storage partitions, and the number of virtual nodes set for each storage partition is determined based on the modulo result obtained and the number of virtual nodes set for each storage partition to determine the target storage partition to which the target object metadata belongs.

[0107] As an embodiment, when the set migration cycle arrives, for each storage partition in the first state, the occupancy rate of the storage space corresponding to the storage partition is obtained; wherein the initial state of any storage partition under the current object scope is the first state;

[0108] If the occupancy rate of the storage space corresponding to the storage partition is greater than the set occupancy rate threshold, at least part of the object metadata stored in the storage space corresponding to the storage partition is migrated to a destination storage partition different from the current storage partition, and the state of the storage partition is changed from the first state to the second state.

[0109] As an embodiment, the destination storage partition is determined by the following steps:

[0110] For each current object metadata stored in the storage space corresponding to the storage partition, a hash operation is performed on the object name of the object to which the current object metadata belongs, the bucket name of the storage bucket corresponding to the object, and the version number of the object to obtain a corresponding hash value;

[0111] The obtained hash value is modulo the total number of virtual nodes of all storage partitions, and the reference migration storage partition corresponding to the current object metadata is determined based on the obtained modulo result and the number of virtual nodes set for each storage partition;

[0112] If the reference migration storage partition is different from the current storage partition, the reference migration storage partition is determined as the destination storage partition.

[0113] As an embodiment, the device further includes:

[0114] The update module is used to change the object range corresponding to at least one storage partition according to the load balancing principle when the state of the object storage system is a set idle state, so that the storage space corresponding to each storage partition complies with the load balancing in subsequent storage; and change the state of each storage partition currently in the second state from the second state to the first state.

[0115] So far, completed Figure 6 Structural description of the device shown.

[0116] See also Figure 7 , Figure 7 This is a structural diagram of an electronic device provided in an embodiment of the present application. Figure 7As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.

[0117] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.

[0118] Exemplarily, the above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.

[0119] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for storing object metadata, characterized in that: The method is applied to an object storage system, in which at least two storage buckets correspond to the same storage space, and the storage space is divided into N storage partitions, each storage partition having a corresponding object range; the method comprises: Determine a reference storage partition for target object metadata to be stored in a target bucket; the target object is within an object range corresponding to the reference storage partition; If it is determined that the reference storage partition is in the first state, the reference storage partition is determined as the target storage partition; any storage partition being in the first state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition has not been migrated to the storage space corresponding to other storage partitions; If it is determined that the reference storage partition is in the second state, the target storage partition is found from each reference storage partition according to the load balancing principle; any storage partition being in the second state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition is migrated to the storage space corresponding to other storage partitions; The target object metadata is stored in the storage space corresponding to the target storage partition.

2. The method according to claim 1, characterized in that: There is a split identifier between two adjacent storage partitions, and the split identifier limits the object ranges corresponding to the two adjacent storage partitions respectively; wherein the format of the split identifier is the same as the format of the object name of the object to which the object metadata belongs.

3. The method according to claim 1, characterized in that The step of finding the target storage partition from each reference storage partition according to the load balancing principle includes: Set the number of virtual nodes for each storage partition based on the hash consistency algorithm; Perform a hash operation on the object name of the target object to which the target object metadata belongs, the bucket name of the storage bucket corresponding to the target object, and the version number of the target object to obtain a corresponding hash value; The obtained hash value is modulo the total number of virtual nodes of all storage partitions, and the target storage partition to which the target object metadata belongs is determined based on the obtained modulo result and the number of virtual nodes set for each storage partition.

4. The method according to claim 1, characterized in that: The method further comprises: When the set migration cycle arrives, for each storage partition in the first state, the occupancy rate of the storage space corresponding to the storage partition is obtained; wherein the initial state of any storage partition under the current object scope is the first state; If the occupancy rate of the storage space corresponding to the storage partition is greater than the set occupancy rate threshold, at least part of the object metadata stored in the storage space corresponding to the storage partition is migrated to a destination storage partition different from the current storage partition, and the state of the storage partition is changed from the first state to the second state.

5. The method according to claim 4, characterized in that The destination storage partition is determined by the following steps: For each current object metadata stored in the storage space corresponding to the storage partition, a hash operation is performed on the object name of the object to which the current object metadata belongs, the bucket name of the storage bucket corresponding to the object, and the version number of the object to obtain a corresponding hash value; Taking the modulus of the obtained hash value and the total number of virtual nodes of all storage partitions, and determining the reference migration storage partition to which the current object metadata belongs based on the obtained modulus result and the number of virtual nodes set for each storage partition; If the reference migration storage partition is different from the current storage partition, the reference migration storage partition is determined as the destination storage partition.

6. The method according to claim 1, characterized in that The method further comprises: When the state of the object storage system is a set idle state, the object range corresponding to at least one storage partition is changed according to the load balancing principle so that the storage space corresponding to each storage partition complies with load balancing in subsequent storage; and the state of each storage partition currently in the second state is changed from the second state to the first state.

7. An object metadata storage device, characterized in that: The device is applied to an object storage system, in which at least two storage buckets correspond to the same storage space, and the storage space is divided into N storage partitions, each storage partition having a corresponding object range; the device comprises: A first determination module is used to determine a reference storage partition for metadata of a target object to be stored in a target bucket; the target object is within an object range corresponding to the reference storage partition; A second determination module is used to determine the reference storage partition as the target storage partition if it is determined that the reference storage partition is in the first state; any storage partition being in the first state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition has not been migrated to the storage space corresponding to other storage partitions; A search module, for searching for a target storage partition from each reference storage partition according to a load balancing principle if it is determined that the reference storage partition is in the second state; any storage partition being in the second state means that under the current object scope, the object metadata stored in the storage space corresponding to the storage partition is migrated to the storage space corresponding to other storage partitions; The storage module is used to store the target object metadata in the storage space corresponding to the target storage partition.

8. The device according to claim 7, characterized in that There is a split identifier between two adjacent storage partitions, and the split identifier limits the object ranges corresponding to the two adjacent storage partitions; wherein the format of the split identifier is the same as the format of the object name of the object to which the object metadata belongs; And / or, searching for the target storage partition from each reference storage partition according to the load balancing principle includes: Set the number of virtual nodes for each storage partition based on the hash consistency algorithm; Perform a hash operation on the object name of the target object to which the target object metadata belongs, the bucket name of the storage bucket corresponding to the target object, and the version number of the target object to obtain a corresponding hash value; Taking the modulus of the obtained hash value and the total number of virtual nodes of all storage partitions, and determining the target storage partition to which the target object metadata belongs based on the obtained modulus result and the number of virtual nodes set for each storage partition; and / or, When the set migration cycle arrives, for each storage partition in the first state, the occupancy rate of the storage space corresponding to the storage partition is obtained; wherein the initial state of any storage partition under the current object scope is the first state; If the occupancy rate of the storage space corresponding to the storage partition is greater than the set occupancy rate threshold, at least part of the object metadata stored in the storage space corresponding to the storage partition is migrated to a destination storage partition different from the current storage partition, and the state of the storage partition is changed from the first state to the second state; and / or, The destination storage partition is determined by the following steps: For each current object metadata stored in the storage space corresponding to the storage partition, a hash operation is performed on the object name of the object to which the current object metadata belongs, the bucket name of the storage bucket corresponding to the object, and the version number of the object to obtain a corresponding hash value; Taking the modulus of the obtained hash value and the total number of virtual nodes of all storage partitions, and determining the reference migration storage partition to which the current object metadata belongs based on the obtained modulus result and the number of virtual nodes set for each storage partition; If the reference migration storage partition is different from the current storage partition, determining the reference migration storage partition as the destination storage partition; And / or, the device further comprises: An update module is used to change the object range corresponding to at least one storage partition according to the load balancing principle when the state of the object storage system is a set idle state, so that the storage space corresponding to each storage partition complies with load balancing in subsequent storage; and change the state of each storage partition currently in the second state from the second state to the first state.

9. An electronic device, characterized in that: The electronic device includes: Processor; and A computer-readable storage medium, wherein computer program instructions are stored in the computer-readable storage medium, and when the computer program instructions are executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, enable the processor to perform the steps of any one of the methods of claims 1 to 6.

Citation Information

Patent Citations

  • Object metadata storage method and device

    CN114328420A

  • Object metadata storage method and device

    CN114428766A

  • Object storage method and system

    CN117591031A

  • Object Storage System with Priority Metadata Processing

    US20200104181A1

  • Multilevel partitioning of objects

    US20220207014A1

Cited By

  • Metadata object column storage method and system based on slot management

    CN121029764A

  • Data storage method and device, equipment, medium and program product

    CN121166022A