An object storage method, device and medium
By obtaining the storage policy of objects within the bucket, determining whether they exist across pools, and binding them to the policy of the newly created storage pool, the problem of existing buckets being unable to use the newly created storage pool is solved, enabling cross-pool read and write operations for buckets and improving the flexibility and efficiency of data storage.
Patent Information
- Application Number
- CN202210608931.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-05-31
AI Technical Summary
In existing technologies, when the disk of a newly expanded node is used as a new storage pool, a new storage bucket needs to be created before the new storage pool can be used, which makes it impossible for the old storage bucket to use the new storage pool.
By obtaining the storage policies of each object in the bucket, it is determined whether there are multiple policies. If so, it is determined that the object exists across pools, and read and write operations are performed on the corresponding storage pools for each object. If not, the operation is performed in the same storage pool, and the object is bound to the original bucket when a new storage pool is created, so that it is bound to multiple storage policies to achieve cross-pool read and write.
This allows existing storage buckets to use new storage pools without the need to create new storage buckets, improving the flexibility and efficiency of data storage.
Smart Images

Figure CN114968114B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data storage, in particular to an object storage method, device and medium. BACKGROUND
[0002] Object Storage Service (OSS) is a new mass, safe, low-cost, high-reliability storage service suitable for storing any type of files. In actual use, as the data volume grows, the number of objects increases, resulting in insufficient storage space for use, which needs to be expanded.
[0003] In the current technology, the disk of the newly expanded node is usually used as a newly created storage pool, but the customer needs to create a new storage bucket and specify the new storage pool as a storage strategy to use, and the old storage bucket cannot use the new storage pool.
[0004] Therefore, how to avoid creating a new storage bucket and enable the old storage bucket to use the new storage pool is a problem that needs to be solved by those skilled in the art. SUMMARY
[0005] The purpose of the present application is to provide an object storage method, device and medium for avoiding creating a new storage bucket when creating a new storage pool, so that the old storage bucket can use the new storage pool.
[0006] To solve the above technical problems, the present application provides an object storage method, which comprises:
[0007] Obtain the storage strategy of each object in the storage bucket; wherein the storage bucket is bound with multiple storage strategies;
[0008] Determine whether the storage strategy of each object is multiple;
[0009] If yes, it is determined that the objects in the storage bucket exist across pools, and the corresponding storage pool is determined according to each object, and read-write operation is performed on the corresponding object in the storage pool;
[0010] If not, it is determined that the objects in the storage bucket exist in the same storage pool, and read-write operation is performed on the corresponding object in the storage pool corresponding to the storage strategy.
[0011] Preferably, the storage pool comprises a first storage pool and a second storage pool; wherein the second storage pool is a newly created storage pool;
[0012] Correspondingly, the storage strategy comprises a first storage strategy and a second storage strategy;
[0013] Further, the step of determining whether the storage strategy of each object is multiple includes:
[0014] The step of determining whether there is only the first storage strategy in the storage strategy of each object;
[0015] If yes, it is determined that the objects in the storage bucket exist in the first storage pool, and read and write operations are performed on each object in the first storage pool corresponding to the first storage strategy.
[0016] If no, it is determined that the objects in the storage bucket exist cross-pool, and read and write operations are performed on the corresponding objects in the first storage pool and the second storage pool.
[0017] Preferably, after the step of determining that the objects in the storage bucket exist cross-pool, the method further comprises:
[0018] Determining the operation type of the object;
[0019] If it is a write operation, performing a write operation in the storage pool corresponding to the object;
[0020] If it is a read operation, obtaining metadata information of the object, determining a read position of the object according to the metadata information, and performing reading.
[0021] Preferably, the method further comprises:
[0022] Determining whether the storage strategy bound by the storage bucket is multiple;
[0023] If yes, entering the step of obtaining the storage strategy of each object in the storage bucket;
[0024] If no, performing read and write operations of the object in the storage pool corresponding to the storage strategy bound by the storage bucket.
[0025] Preferably, when performing the write operation of the object in the first storage pool, the method further comprises:
[0026] Sending an alarm information.
[0027] Preferably, the second storage pool is a storage pool established when the remaining capacity of the first storage pool reaches a threshold.
[0028] Preferably, the storage bucket includes a first storage bucket and a second storage bucket, the first storage bucket is bound to the first storage strategy and the second storage strategy, and the second storage bucket is bound to the second storage strategy.
[0029] To solve the above technical problems, the application also provides an object storage device, which comprises:
[0030] The acquisition module is configured to acquire storage strategies of objects in the storage bucket, wherein the storage bucket is bound with multiple storage strategies.
[0031] The processing module is configured to determine whether the storage strategies of the objects are multiple.
[0032] If yes, it is determined that the objects in the storage bucket exist across pools, the corresponding storage pools of the objects are determined, and read / write operations are performed on the corresponding objects in the storage pools.
[0033] If no, it is determined that the objects in the storage bucket exist in the same storage pool, and read / write operations are performed on the corresponding objects in the storage pool corresponding to the storage strategy.
[0034] Preferably, the method further comprises:
[0035] The determining module is configured to determine the operation type of the object.
[0036] If the operation is a write operation, the write operation is performed in the storage pool corresponding to the object.
[0037] If the operation is a read operation, the metadata information of the object is acquired, the read position of the object is determined according to the metadata information, and the read operation is performed.
[0038] Preferably, the method further comprises:
[0039] The determining module is configured to determine the operation type of the object.
[0040] If yes, the step of acquiring the storage strategies of the objects in the storage bucket is performed.
[0041] If no, the read / write operations of the objects are performed in the storage pool corresponding to the storage strategy bound by the storage bucket.
[0042] Preferably, the method further comprises:
[0043] The alarm module is configured to send alarm information when the write operation of the object is performed in the first storage pool.
[0044] To solve the above technical problems, the application further provides another object storage device, which comprises a memory for storing a computer program.
[0045] The processor is configured to implement the steps of the object storage method as described above when the computer program is executed.
[0046] To solve the above technical problems, the application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the object storage method as described above.
[0047] The object storage method provided in the application, a plurality of storage strategies are bound to a storage bucket, objects sent by a client are stored in a storage bucket of a server, the server judges whether the storage strategy of the object in the storage bucket is multiple, if yes, it indicates that the objects in the storage bucket exist across pools, and the objects need to be read and written in the respective corresponding storage pools. If the storage strategy of the object is only one, it is determined that the objects in the storage bucket exist in the same storage pool, and the corresponding objects are read and written in the storage pool corresponding to the storage strategy. Compared with the current technology, when a new storage pool is created, a new storage bucket needs to be created, and the original storage bucket cannot access the newly created storage pool. By using the technical solution, the storage strategy of the newly created storage pool is bound to the original storage bucket, so that one storage bucket has multiple storage strategies, and cross-pool reading and writing can be performed during data storage, without the need to create a new storage bucket.
[0048] In addition, the object storage device and the medium provided in the application correspond to the object storage method described above, and have the same effects. BRIEF DESCRIPTION OF DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0050] Figure 1 A flowchart of an object storage method provided for the embodiments of the present application;
[0051] Figure 2 A structural diagram of an object storage device provided for the embodiments of the present application;
[0052] Figure 3 A structural diagram of another object storage device provided for the embodiments of the present application. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0054] An object storage service (OSS) is an emerging mass, secure, low-cost, and highly reliable storage service suitable for storing any type of file. An object is a basic unit of data stored by the OSS and is also referred to as a file of the OSS. An object is composed of object metadata (Object Meta), user data (Data), and a file name (Key). An object is identified by a Key unique within a storage space. Object metadata is a key-value pair representing some attributes of the object, such as last modification time, size, and the like, and the user can also store some custom information in the metadata. According to different uploading manners, the size limit of an object is different. In actual use, as the data volume grows and the number of objects increases, the storage space is insufficient for use, and expansion needs to be handled.
[0055] The OSS provides four storage classes (Storage Class) of standard, low-frequency access, archive, and cold archive, which comprehensively cover various data storage scenarios from hot to cold. The standard storage class provides a high-persistent, high-availability, and high-performance object storage service, which can support frequent data access. The low-frequency access storage class is suitable for long-term storage of infrequently accessed data (average monthly access frequency of 1 to 2 times), and the storage unit price is lower than that of the standard class. The archive storage class is suitable for archive data that needs to be stored for a long time (recommended for more than half a year). The cold archive storage is suitable for extremely cold data that needs to be stored for a very long time. A storage space (Bucket) is a container for storing objects (Object), and all objects must belong to a certain storage space. The storage space has various configuration attributes, including region, access permission, storage class, and the like. You can create different types of storage spaces to store different data according to actual needs.
[0056] In the current technology, the disks of the newly expanded nodes are usually used as newly created storage pools, but the customer needs to create a new storage bucket and specify the new storage pool as a storage strategy to use, and the old storage bucket cannot use the new storage pool.
[0057] The core of the present application is to provide an object storage method, device, and medium for avoiding creating a new storage bucket when creating a new storage pool, so that the old storage bucket can use the new storage pool.
[0058] In order to enable personnel in the technical field to better understand the present application scheme, the present application will be further described in detail below in combination with the drawings and specific embodiments.
[0059] Figure 1 A flowchart of an object storage method provided by an embodiment of the present application is shown in Figure 1 The method comprises the following steps.
[0060] S10: Obtain the storage strategy of each object in the storage bucket; wherein the storage bucket is bound with multiple storage strategies.
[0061] S11: Determine whether the storage strategy of each object is multiple, if yes, go to step S12, if no, go to step S13.
[0062] S12: Determine that the objects in the storage bucket exist across pools, determine the corresponding storage pool of each object according to each object, and perform read-write operation on the corresponding object in the storage pool.
[0063] S13: Determine that the objects in the storage bucket exist in the same storage pool, and perform read-write operation on the corresponding object in the storage pool corresponding to the storage strategy.
[0064] The execution subject in the embodiment is usually an object storage device on a server, which stores the objects obtained from the client in the storage bucket, and stores them in the corresponding storage pool through the corresponding storage strategy. A storage bucket stores multiple objects, and each object has a corresponding storage pool. It should be noted that the storage bucket in the embodiment is bound with multiple storage strategies. When it is determined that storage expansion is needed, a new storage pool and a corresponding storage strategy are created, and the storage strategy is bound to the original storage bucket, so that multiple storage strategies are bound to one storage bucket, and the storage bucket can receive objects of multiple corresponding storage pools when receiving objects.
[0065] When the server obtains the storage strategy of each object in the storage bucket, it determines whether there are multiple storage strategies. If there are multiple storage strategies, it means that the objects exist in multiple storage pools, and read-write operation of the objects needs to be performed in multiple storage pools. If there is only one storage strategy, it means that the objects in the storage bucket all exist in the same storage pool, and read-write operation of the objects in the bucket can be realized in the corresponding storage pool according to the storage strategy.
[0066] The object storage method provided in the application binds multiple storage strategies to a storage bucket, and stores the objects sent by the client in the storage bucket of the server. The server determines whether the storage strategy of the object in the storage bucket is multiple. If yes, it means that the objects in the storage bucket exist across pools, and read-write operation of the objects needs to be performed in the corresponding storage pool. If the storage strategy of the object has only one, it is determined that the objects in the storage bucket exist in the same storage pool, and read-write operation of the corresponding object is performed in the storage pool corresponding to the storage strategy. Compared with the current technology, when a new storage pool is created, a new storage bucket needs to be created, and the original storage bucket cannot access the newly created storage pool. By using the technical solution, the storage strategy of the newly created storage pool is bound to the original storage bucket, so that one storage bucket has multiple storage strategies, and cross-pool read-write operation can be performed during data storage without the need to create a new storage bucket.
[0067] The embodiment provides a specific storage structure, in the embodiment, the storage pool comprises a first storage pool and a second storage pool; wherein the second storage pool is a newly-built storage pool;
[0068] Correspondingly, the storage strategy comprises a first storage strategy and a second storage strategy;
[0069] Further, the step of judging whether the storage strategy of each object is multiple comprises:
[0070] judging whether only the first storage strategy exists in the storage strategy of each object;
[0071] If yes, it is determined that the objects in the storage bucket exist in the first storage pool, and read-write operations are performed on each object in the first storage pool corresponding to the first storage strategy;
[0072] If no, it is determined that the objects in the storage bucket exist cross-pool, and read-write operations are performed on the corresponding objects in the first storage pool and the second storage pool.
[0073] The embodiment takes two storage pools corresponding to one storage bucket as an example, the first storage pool is an original storage pool, and the second storage pool is a newly-built storage pool during capacity expansion. During capacity expansion, the second storage pool is newly built, and the second storage strategy corresponding to the second storage pool is newly built and bound to the original storage bucket. When the objects in the bucket are stored, the storage strategy of all objects in the storage bucket is acquired, and it is judged whether the storage strategy only comprises the first storage strategy. If yes, it is indicated that the read-write of the objects in the bucket is in the original first storage pool. If the first storage strategy further comprises the second storage strategy, it is indicated that the objects in the bucket exist in the first storage pool and the second storage pool, and the read-write of the objects in the two pools is required.
[0074] The object storage method provided in the embodiment binds two storage strategies to one storage bucket, and does not need to newly build a storage bucket during storage, and one storage bucket can realize cross-storage pool operation.
[0075] In a specific implementation, because the read-write operations of the objects are different, the required information is also different.
[0076] In the embodiment, after the step of determining that the objects in the storage bucket exist cross-pool, the method further comprises:
[0077] determining the operation type of the object;
[0078] If the operation type is a write operation, the write operation is performed in the storage pool corresponding to the object;
[0079] If the operation type is a read operation, the metadata information of the object is acquired, the read position of the object is determined according to the metadata information, and the object is read.
[0080] In a specific implementation, when the object performs a write operation, the write operation can be directly performed in the corresponding cache pool, and when the object performs a read operation, the storage location of the object needs to be determined according to the metadata information to perform reading because the object is in a different cache pool.
[0081] In a specific implementation, when a storage pool is newly created, in addition to binding a new storage strategy to the original storage bucket, a storage bucket can also be newly created. It can be understood that the newly created storage pool indicates that the original storage pool is insufficient for use, and therefore the storage pool is newly created. The newly created storage bucket is bound to a storage strategy corresponding to the newly created storage pool, so that the objects in the storage bucket operate in the newly created storage pool.
[0082] Therefore, on the basis of the above embodiment, in the present embodiment, it further includes:
[0083] determining whether the storage strategy bound by the storage bucket is multiple;
[0084] If yes, the step of obtaining the storage strategy of each object in the storage bucket is entered;
[0085] If no, the read and write of the object in the storage pool corresponding to the storage strategy bound by the storage bucket is performed.
[0086] The present embodiment considers the case of newly created storage bucket, and determines whether the storage bucket in which the object is located is a newly created storage bucket when storing the object. Specifically, whether the bound storage strategy is multiple is determined. If the storage bucket only binds one storage strategy, it indicates that the storage bucket is a new bucket, and if multiple storage strategies are bound, it indicates that it is an original storage bucket. It should be noted that in a specific implementation, the newly created storage pool is one, and the object storage method provided by the present embodiment defaults that the newly created storage pool is one, and the number of storage buckets corresponds to the number of storage pools. If the newly created storage pool is multiple, the number of storage buckets does not correspond to the number of storage pools, and therefore the storage bucket cannot be determined whether it is a newly created storage bucket by determining whether the storage strategy bound by the storage bucket is multiple.
[0087] It can be understood that the newly created storage pool indicates that the remaining storage space of the original storage pool is insufficient for use, and therefore the storage pool is newly created. In a specific implementation, if the write operation is still performed in the original storage pool, the writing of the object will be affected, and the writing speed will also be affected.
[0088] Therefore, on the basis of the above embodiment, in the present embodiment, when the write operation of the object is performed in the first storage pool, it further includes:
[0089] sending an alarm information.
[0090] The embodiment sends alarm information when performing a write operation in the first storage pool, so as to prompt the technician that the current write operation is still in the original storage pool, so as to avoid that too many objects need to be written and cannot be written into the original storage pool.
[0091] In a specific implementation, the technician still wants to write the object into the original storage pool, so in the embodiment, the second storage pool is a storage pool established when the remaining capacity of the first storage pool reaches a threshold.
[0092] The second storage pool of the embodiment is created when the first storage pool still has a certain usage capacity, so that the first storage pool can still provide a certain object storage capability in subsequent use, and improve user experience.
[0093] The object storage method provided in the embodiment includes two storage buckets, including a first storage bucket and a second storage bucket, the first storage bucket binds a first storage policy and a second storage policy, and the second storage bucket binds the second storage policy.
[0094] The first storage bucket is the original storage bucket, which not only binds the original storage pool, but also binds the newly established storage pool, so that the objects in the first storage bucket can be read and written across the storage pools. The second storage bucket is a newly established storage bucket, which only binds the newly established storage policy, so that the objects in the second storage bucket are read and written in the second storage pool.
[0095] In the above embodiment, the object storage method is described in detail, and the application also provides an embodiment of an object storage device. It should be noted that the application describes the embodiments of the device part from two angles, one is based on the functional module, and the other is based on the hardware.
[0096] Figure 2 The structure diagram of an object storage device provided in the embodiment of the application is shown in Figure 2 The device includes:
[0097] The acquisition module 10 is configured to acquire the storage policy of each object in the storage bucket; wherein the storage bucket binds a plurality of storage policies;
[0098] The processing module 11 is configured to determine whether the storage policy of each object is multiple;
[0099] If yes, it is determined that the objects in the storage bucket exist across the pools, the corresponding storage pool of each object is determined according to each object, and the corresponding object is read and written in the storage pool;
[0100] If no, it is determined that the objects in the storage bucket exist in the same storage pool, and the corresponding object is read and written in the storage pool corresponding to the storage policy.
[0101] Preferred options also include:
[0102] The determination module is used to determine the operation type of the object;
[0103] If it is a write operation, the write operation is performed in the storage pool corresponding to the object;
[0104] If it is a read operation, the metadata information of the object is obtained, the read position of the object is determined based on the metadata information, and the read is performed.
[0105] Preferred options also include:
[0106] The judgment module is used to determine whether the storage bucket is bound to multiple storage policies;
[0107] If so, proceed to the step of obtaining the storage strategy for each object in the bucket;
[0108] If not, then read and write the object in the storage pool corresponding to the storage policy bound to the storage bucket.
[0109] Preferred options also include:
[0110] The alarm module is used to send alarm information when the object is written in the first storage pool.
[0111] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.
[0112] The object storage device provided in this application has multiple storage policies bound to a storage bucket. Objects sent by the client are stored in the server's storage bucket. The server determines whether there are multiple storage policies for the objects in the storage bucket. If so, it means that the objects in the storage bucket exist across pools, and read / write operations need to be performed on each object in its corresponding storage pool. If there is only one storage policy for the objects, it is determined that the objects in the storage bucket exist in the same storage pool, and read / write operations are performed on the corresponding objects in the storage pool corresponding to the storage policy. Compared to the current technology, which requires creating a new storage bucket when creating a new storage pool, and the existing storage bucket cannot access the newly created storage pool, this technical solution binds the storage policy of the newly created storage pool to the existing storage bucket, allowing a single storage bucket to have multiple storage policies. This enables cross-pool read / write operations during data storage without the need to create a new storage bucket.
[0113] Figure 3 A structural diagram of another object storage device provided in the embodiments of this application is shown below. Figure 3 As shown, the device includes: a memory 20 for storing computer programs;
[0114] The processor 21 is configured to implement the steps of the object storage method according to any one of the above embodiments when executing a computer program.
[0115] The object storage apparatus provided by the embodiment can include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like.
[0116] The processor 21 can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 can be implemented in at least one of a hardware form of a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), a Programmable Logic Array (PLA). The processor 21 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a Central Processing Unit (CPU). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 can be integrated with a Graphics Processing Unit (GPU) for rendering and drawing the content to be displayed by the display screen. In some embodiments, the processor 21 can further include an Artificial Intelligence (AI) processor for processing machine learning-related computing operations.
[0117] The memory 20 can include one or more computer-readable storage media, which can be non-transitory. The memory 20 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In the embodiment, the memory 20 is at least used to store the following computer program 201, wherein the computer program is loaded and executed by the processor 21, and can implement the related steps of the object storage method disclosed in any one of the above embodiments. In addition, the resources stored by the memory 20 can also include an operating system 202 and data 203, and the storage mode can be temporary storage or permanent storage. The operating system 202 can include Windows, Unix, Linux, and the like. The data 203 can include, but is not limited to, storage policies, alarm information, and the like.
[0118] In some embodiments, the object storage apparatus can further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0119] Those skilled in the art can understand that,Figure 3 The structure shown in the figure does not constitute a limitation on the object storage device, and can include more or fewer components than shown.
[0120] The object storage device provided by the embodiment of the present application comprises a memory and a processor. When the processor executes the program stored in the memory, the following method can be implemented: obtaining the storage strategies of each object in a storage bucket; wherein the storage bucket is bound with multiple storage strategies; determining whether the storage strategies of each object are multiple; if yes, determining that the objects in the storage bucket exist across pools, determining the storage pools corresponding to each object according to the objects, and performing read-write operations on the corresponding objects in the storage pools; if no, determining that the objects in the storage bucket exist in the same storage pool, and performing read-write operations on the corresponding objects in the storage pool corresponding to the storage strategy.
[0121] The object storage device provided by the present application is bound with multiple storage strategies. The objects sent by the client are stored in the storage bucket of the server. The server determines whether the storage strategies of the objects in the storage bucket are multiple. If yes, it indicates that the objects in the storage bucket exist across pools, and the read-write operations need to be performed on each object in the corresponding storage pool. If the storage strategy of the object has only one, it is determined that the objects in the storage bucket exist in the same storage pool, and the read-write operations are performed on the corresponding objects in the storage pool corresponding to the storage strategy. In the current technology, a new storage bucket needs to be created when a new storage pool is created, and the original storage bucket cannot access the newly created storage pool. By using the technical solution, the storage strategy of the newly created storage pool is bound to the original storage bucket, so that one storage bucket has multiple storage strategies, and cross-pool read-write can be performed during data storage without the need to create a new storage bucket.
[0122] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer program is stored on the computer-readable storage medium, and the computer program is executed by the processor to implement the steps described in the above method embodiment.
[0123] It can be understood that if the method in the above embodiment is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and executes all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0124] The computer readable storage medium provided by the present application binds a plurality of storage strategies to the storage bucket, the object sent by the client is stored in the storage bucket of the server, the server judges whether the storage strategy of the object in the storage bucket is multiple, if yes, it indicates that the objects in the storage bucket exist across the pools, and the read and write operations of each object in the corresponding storage pool are required. If the storage strategy of the object has only one, it is determined that the objects in the storage bucket exist in the same storage pool, and the read and write operations of the corresponding object in the storage pool corresponding to the storage strategy are performed. Compared with the current technology, when a new storage pool is created, a new storage bucket needs to be created, and the original storage bucket cannot access the newly created storage pool. By using the technical solution, the storage strategy of the newly created storage pool is bound to the original storage bucket, so that one storage bucket has multiple storage strategies, and cross-pool reading and writing can be performed during data storage, without the need to create a new storage bucket.
[0125] The object storage method, device and medium provided by the present application are described in detail above. The embodiments in the specification are described in a progressive manner, and each embodiment mainly describes the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part. It should be pointed out that for ordinary skilled in the art, without departing from the principle of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
[0126] It should be further noted that in the present specification, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. An object storage method, characterized by, The method comprises the following steps: acquiring storage strategies of objects in a storage bucket; wherein the storage bucket is bound with multiple storage strategies; determining whether the storage strategies of the objects are multiple; if yes, determining that the objects in the storage bucket exist across pools, determining corresponding storage pools of the objects respectively, and performing read-write operations on the corresponding objects in the storage pools; if no, determining that the objects in the storage bucket exist in the same storage pool, and performing read-write operations on the corresponding objects in the storage pool corresponding to the storage strategy; the storage pools comprise a first storage pool and a second storage pool; wherein the second storage pool is a newly created storage pool and is one, and the second storage pool is established when the remaining capacity of the first storage pool reaches a threshold; correspondingly, the storage strategies comprise a first storage strategy and a second storage strategy; the storage bucket comprises a first storage bucket and a second storage bucket, the first storage bucket is bound with the first storage strategy and the second storage strategy, the second storage bucket is bound with the second storage strategy, and the number of the second storage bucket corresponds to the number of the second storage pool; when performing the write operation of the object in the first storage pool, the method further comprises the following steps: sending alarm information; the step of determining whether the storage strategies of the objects are multiple comprises the following steps: determining whether there is only the first storage strategy in the storage strategies of the objects; if yes, determining that the objects in the storage bucket exist in the first storage pool, and performing read-write operations on the objects in the first storage pool corresponding to the first storage strategy; if no, determining that the objects in the storage bucket exist across pools, and performing read-write operations on the corresponding objects in the first storage pool and the second storage pool; the object storage method further comprises the following steps: determining whether the storage strategies bound by the storage bucket are multiple; if yes, entering the step of acquiring the storage strategies of the objects in the storage bucket; if no, performing read-write of the objects in the storage pool corresponding to the storage strategy bound by the storage bucket.
2. The object storage method according to claim 1, characterized by, after the step of determining that the objects in the storage bucket exist across pools, the method further comprises the following steps: determining the operation type of the object; if it is a write operation, performing the write operation in the storage pool corresponding to the object; if it is a read operation, acquiring metadata information of the object, determining the read position of the object according to the metadata information, and performing the read operation.
3. An object storage device, characterized by, The method comprises the following steps: an acquiring module is configured to acquire storage strategies of objects in a storage bucket; wherein the storage bucket is bound with multiple storage strategies; a processing module is configured to determine whether the storage strategies of the objects are multiple; if yes, determining that the objects in the storage bucket exist across pools, determining corresponding storage pools of the objects respectively, and performing read-write operations on the corresponding objects in the storage pools; if no, determining that the objects in the storage bucket exist in the same storage pool, and performing read-write operations on the corresponding objects in the storage pool corresponding to the storage strategy; the storage pools comprise a first storage pool and a second storage pool; wherein the second storage pool is a newly created storage pool and is one, and the second storage pool is established when the remaining capacity of the first storage pool reaches a threshold; correspondingly, the storage strategies comprise a first storage strategy and a second storage strategy; the storage bucket comprises a first storage bucket and a second storage bucket, the first storage bucket is bound with the first storage strategy and the second storage strategy, the second storage bucket is bound with the second storage strategy, and the number of the second storage bucket corresponds to the number of the second storage pool; when performing the write operation of the object in the first storage pool, the method further comprises the following steps: sending alarm information; the step of determining whether the storage strategies of the objects are multiple comprises the following steps: determining whether there is only the first storage strategy in the storage strategies of the objects; if yes, determining that the objects in the storage bucket exist in the first storage pool, and performing read-write operations on the objects in the first storage pool corresponding to the first storage strategy; if no, determining that the objects in the storage bucket exist across pools, and performing read-write operations on the corresponding objects in the first storage pool and the second storage pool; the object storage method further comprises the following steps: determining whether the storage strategies bound by the storage bucket are multiple; if yes, entering the step of acquiring the storage strategies of the objects in the storage bucket; if no, performing read-write of the objects in the storage pool corresponding to the storage strategy bound by the storage bucket. after the step of determining that the objects in the storage bucket exist across pools, the method further comprises the following steps: determining the operation type of the object; if it is a write operation, performing the write operation in the storage pool corresponding to the object; if it is a read operation, acquiring metadata information of the object, determining the read position of the object according to the metadata information, and performing the read operation. The storage pools include a first storage pool and a second storage pool; wherein the second storage pool is a newly created storage pool and is one, and the second storage pool is a storage pool established when the remaining capacity of the first storage pool reaches a threshold value; correspondingly, the storage strategies include a first storage strategy and a second storage strategy; The storage buckets include a first storage bucket and a second storage bucket, the first storage bucket is bound to the first storage strategy and the second storage strategy, and the second storage bucket is bound to the second storage strategy, and the number of the second storage buckets corresponds to the number of the second storage pools; The object storage device is specifically used for: When the write operation of the objects is performed in the first storage pool, the object storage device further includes: sending alarm information; The object storage device is specifically used for: If only the first storage strategy exists in the storage strategy of each object, it is determined that the objects in the storage bucket exist in the first storage pool, and read and write operations are performed on each object in the first storage pool corresponding to the first storage strategy; if not, it is determined that the objects in the storage bucket exist across pools, and read and write operations are performed on the corresponding objects in the first storage pool and the second storage pool. The object storage device is specifically used for: If the storage strategy bound to the storage bucket is multiple, the step of obtaining the storage strategy of each object in the storage bucket is entered; if not, read and write operations of objects are performed in the storage pool corresponding to the storage strategy bound to the storage bucket.
4. An object storage device, characterized by, The computer readable storage medium stores a computer program; The processor is used to execute the computer program to realize the steps of the object storage method in any one of claims 1 to 2.
5. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the steps of the object storage method in any one of claims 1 to 2.
Citation Information
Patent Citations
Data storage method and device based on object storage system, and electronic equipment
CN111857592A
Data writing method and device
CN114465957A