Target object migration method and apparatus, storage medium, and electronic device

By migrating the target object collection from the source storage space to multiple target storage spaces and responding to user requests during the migration process, the object storage migration is optimized using hash operations, which solves the problem of low migration efficiency in cloud storage platform architecture upgrades and achieves efficient object migration and a seamless user experience.

CN116244257BActive Publication Date: 2026-02-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111496569.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2026-02-27
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

During the architecture upgrade process of existing cloud storage platforms, the user-led migration method results in long migration cycles and high maintenance costs, and there is currently no effective solution.

Method used

By obtaining a set of target objects, migrating them from the same source storage space to multiple target storage spaces, and responding to user requests to perform operations during the migration process, the storage space index is determined using hash operations, and the object migration process is optimized by using double read, single write, and double delete methods.

Benefits of technology

It improves object migration efficiency, reduces the number of objects to look up, enhances user experience, makes the migration process seamless for users, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116244257B_ABST
    Figure CN116244257B_ABST
Patent Text Reader

Abstract

The application discloses a target object migration method and device, a storage medium and an electronic device, and is applied to cloud storage. The method comprises the following steps: acquiring a target object set to be migrated, wherein the objects in the target object set are stored in a same source storage space; migrating the target object set from the source storage space to a plurality of target storage spaces; and in the process of migrating the target object set from the source storage space to the plurality of target storage spaces, performing a target operation on the target object in response to an acquired target request. The application solves the technical problem of low efficiency of object migration in object storage.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, and in particular, to a target object migration method and device, a storage medium, and an electronic device. BACKGROUND

[0002] Object storage is object-oriented Internet storage, which can also be referred to as cloud object storage. A cloud storage platform provides cloud storage services for users.

[0003] When the architecture of the cloud storage platform is upgraded, the object migration method used is user-led migration. User-led migration relies on objects queried by the user, and only when the objects queried by the user cannot be found in the new architecture, objects found in the old architecture are migrated to the new architecture. This migration method relies on the user and has a long migration period. The new and old architectures need to be maintained simultaneously during the migration process, which is costly.

[0004] In view of the above problems, no effective solutions have been proposed so far. SUMMARY

[0005] Embodiments of the present application provide a target object migration method and device, a storage medium, and an electronic device to at least solve the technical problem of low efficiency of object migration in object storage.

[0006] According to an aspect of an embodiment of the present application, a target object migration method is provided, comprising: obtaining a target object set to be migrated, wherein the objects in the target object set are stored in a same source storage space; migrating the target object set from the source storage space to a plurality of target storage spaces, wherein each object in the target object set is stored in one target storage space in the plurality of target storage spaces after migration; and in the process of migrating the target object set from the source storage space to the plurality of target storage spaces, performing a target operation on a target object in response to a target request obtained, wherein the target request is used to request to perform the target operation on the target object.

[0007] Optionally, the performing, in response to the obtained target request, a target operation on the target object comprises: in a case where the target request is for requesting to download the target object, obtaining the target object in the source storage space or the plurality of target storage spaces; or in a case where the target request is for requesting to upload the target object, obtaining a target storage space index corresponding to the target object in the plurality of target storage spaces, and storing the target object in a target storage space corresponding to the target storage space index in the plurality of target storage spaces; or in a case where the target request is for requesting to delete the target object, deleting the target object in the source storage space and / or the plurality of target storage spaces.

[0008] Optionally, the obtaining, in a case where the target request is for requesting to download the target object, the target object in the source storage space or the plurality of target storage spaces comprises: determining a target storage space index of the target object according to an identifier of the target object; searching for the target object in a target storage space corresponding to the target storage space index in the plurality of target storage spaces; and obtaining the target object in the target storage space corresponding to the target storage space index in a case where the target object is found in the target storage space corresponding to the target storage space index.

[0009] Optionally, the obtaining, in a case where the target request is for requesting to download the target object, the target object in the source storage space or the plurality of target storage spaces further comprises: in a case where the target object is not found in the target storage space corresponding to the target storage space index, determining a source storage location index of the target object according to an identifier of the target storage space; and obtaining an object corresponding to the source storage location index in the source storage space, wherein the target object is the object corresponding to the source storage location index obtained in the source storage space.

[0010] Optionally, the determining the target storage space index of the target object according to the identifier of the target object comprises: performing a hash operation on the identifier of the target object to obtain a target hash value; performing a modulo operation on a target number using the target hash value, and determining a remainder obtained in the modulo operation as the target storage space index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces.

[0011] Optionally, in the case that the target request is used to request uploading the target object, the target object is stored in the target storage space corresponding to the target storage space index in the plurality of target storage spaces, including: performing a hash operation on the identifier of the target object to obtain a target hash value; performing a modulo operation on the target quantity using the target hash value, and determining the obtained remainder as the target storage space index, wherein the target quantity represents the number of target storage spaces in the plurality of target storage spaces; and storing the target object in the target storage space corresponding to the target storage space index in the plurality of target storage spaces.

[0012] Optionally, in the case that the target request is used to request deleting the target object, the target object is deleted in the source storage space and / or the plurality of target storage spaces, including: performing a hash operation on the identifier of the target object to obtain a target hash value; performing a modulo operation on the target quantity using the target hash value, and determining the obtained remainder as the first target index of the target object and the second target index, wherein the target quantity represents the number of target storage spaces in the plurality of target storage spaces; in the case that the object corresponding to the second target index exists in the source storage space, deleting the object corresponding to the second target index in the source storage space, wherein the target object includes the object corresponding to the second target index in the source storage space; and in the case that the target object exists in the target storage space corresponding to the first target index in the plurality of target storage spaces, deleting the target object in the target storage space corresponding to the first target index.

[0013] Optionally, the migration of the target object set from the source storage space to the plurality of target storage spaces includes: performing the following operations on each object in the target object set to be migrated, wherein the each object is a current object: obtaining a source storage location index of the current object in the source storage space; performing a modulo operation on the target quantity using the source storage location index of the current object, and determining the obtained remainder as a target storage space index, wherein the target quantity represents the number of target storage spaces in the plurality of target storage spaces; storing the current object in the target storage space corresponding to the target storage space index in the plurality of target storage spaces, and deleting the current object in the source storage space.

[0014] Optionally, after the storing and deleting, the method further includes: obtaining a download request, wherein the download request requests to download the current object; performing a hash operation on an identifier of the current object to obtain the current hash value; performing a modulo operation on the target number using the current hash value, and determining a remainder obtained in the modulo operation as the target storage space index; and downloading the current object from the target storage space corresponding to the target storage space index.

[0015] Optionally, before the migrating, the method further includes: backing up source storage location indexes of objects in the target object set to be migrated in the source storage space to obtain a backup index set; and after the migrating, the method further includes: verifying, according to backup indexes in the backup index set, whether objects in the target object set to be migrated are all migrated to the plurality of target storage spaces.

[0016] Optionally, the verifying, according to backup indexes in the backup index set, whether objects in the target object set to be migrated are all migrated to the plurality of target storage spaces, includes: performing the following operations on each backup index in the backup index set, the each backup index being a current backup index when the following operations are performed: performing a modulo operation on a target number using the current backup index to determine a remainder obtained in the modulo operation as a current target index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; determining, in the plurality of target storage spaces, whether a current object corresponding to the current backup index exists in a current target storage space corresponding to the current target index; and in a case where the current object corresponding to the current backup index exists in the current target storage space, determining that the current object corresponding to the current backup index in the source storage space has been migrated to the plurality of target storage spaces.

[0017] Optionally, the migrating the target object set from the source storage space to the plurality of target storage spaces includes: migrating the target object set from the source storage space to the plurality of target storage spaces in parallel through a plurality of threads.

[0018] Optionally, the migrating the target object set from the source storage space to the plurality of target storage spaces in parallel through the plurality of threads comprises: when the plurality of threads is M threads, sending a scheduling instruction to an i th thread in the M threads to instruct the i th thread to migrate a j th object in the target object set to the plurality of target storage spaces, where M is an integer greater than or equal to 2, 1≤i≤M, and j is an integer greater than or equal to 1; and during the migration of the j th object to the plurality of target storage spaces by the i th thread, sending a heartbeat instruction to the i th thread according to a preset period, and in a case where no feedback information sent by the i th thread in response to the heartbeat instruction is received within a preset time length, sending a scheduling instruction to a k th thread in the M threads to instruct the k th thread to migrate the j th object to the plurality of target storage spaces, where 1≤k≤M.

[0019] According to another aspect of the embodiments of the present application, there is also provided a device for migrating target objects, comprising: an obtaining module configured to obtain a target object set to be migrated, wherein the objects in the target object set are stored in a same source storage space; a migrating module configured to migrate the target object set from the source storage space to a plurality of target storage spaces, wherein each object in the target object set is stored in one target storage space in the plurality of target storage spaces after migration; and a responding module configured to, during the migration of the target object set from the source storage space to the plurality of target storage spaces, perform a target operation on a target object in response to a target request obtained, wherein the target request is used to request to perform the target operation on the target object.

[0020] According to still another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-mentioned method for migrating target objects when executed.

[0021] According to still another aspect of the embodiments of the present application, there is also provided a computer program product or computer program, which comprises computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the above-mentioned method for migrating target objects.

[0022] According to still another aspect of the embodiments of the present application, there is also provided an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the above-mentioned method for migrating target objects by using the computer program.

[0023] In the embodiments of the present application, the objects in the target object set are migrated in the target object set dimension. The user's dominant migration is not relied on, and thus the technical problem of low efficiency of object migration in object storage is solved. The efficiency of object migration from the old architecture to the new architecture is improved. In addition, in the embodiments of the present application, the objects in the target object set stored in the same storage space are migrated to multiple target storage spaces, which disperses the objects in the target object set to multiple storage spaces. In this way, when the objects are searched, the number of objects traversed is reduced, and the search efficiency is improved. In addition, in the process of object migration from the old architecture to the new architecture, the user can perform operations on the target objects according to the user's request, so that the user is unaware of the object migration process, and the user experience is improved. BRIEF DESCRIPTION OF DRAWINGS

[0024] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:

[0025] Figure 1 is a schematic diagram of an optional application environment of a target object migration method according to an embodiment of the present application;

[0026] Figure 2 is a flowchart of an optional target object migration method according to an embodiment of the present application;

[0027] Figure 3 is an optional cloud storage platform page schematic diagram according to an embodiment of the present application;

[0028] Figure 4 is an optional double-read flowchart schematic diagram according to an embodiment of the present application;

[0029] Figure 5 is an optional single-write flowchart schematic diagram according to an embodiment of the present application;

[0030] Figure 6 is an optional double-deletion flowchart schematic diagram according to an embodiment of the present application;

[0031] Figure 7 is an optional migration architecture schematic diagram according to an embodiment of the present application;

[0032] Figure 8 is an optional completeness verification schematic diagram according to an embodiment of the present application;

[0033] Figure 9 is an optional migration cluster structure schematic diagram according to an embodiment of the present application;

[0034] Figure 10is another optional migration cluster structure schematic diagram according to an embodiment of the present application;

[0035] Figure 11 is an optional target object migration device structure schematic diagram according to an embodiment of the present application;

[0036] Figure 12 is an optional electronic device structure schematic diagram according to an embodiment of the present application;

[0037] Figure 13 is an optional electronic device computer system structure block diagram according to an embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the personnel in the art better understand the present application scheme, the technical scheme in the embodiment of the present application will be described clearly and completely below in combination with the drawings in the embodiment of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without creative labor should belong to the scope of protection of the present application.

[0039] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0040] Cloud storage is a new concept extended and developed on the basis of the concept of cloud computing. Distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that cooperatively works together to provide data storage and business access functions by applying cluster application, grid technology and distributed storage file system, etc. to collect a large number of various types of storage devices (storage devices are also called storage nodes) in the network through application software or application interface.

[0041] At present, the storage method of the storage system is: creating a logical volume, and allocating a physical storage space to each logical volume when creating the logical volume, which can be a disk of a certain storage device or a disk group of several storage devices. The client stores data on a certain logical volume, that is, stores data on a file system, the file system divides the data into many parts, each part is an object, the object contains not only data but also additional information such as data ID (ID entity), and the file system writes each object to the physical storage space of the logical volume, and records the storage location information of each object, so that when the client requests to access data, the file system can enable the client to access the data according to the storage location information of each object.

[0042] The process of allocating the physical storage space to the logical volume by the storage system is: according to the capacity estimation of the object stored in the logical volume (the estimation often has a large margin relative to the actual capacity of the object to be stored) and the group of the redundant array of independent disk (RAID), the physical storage space is divided into a strip in advance, and a logical volume can be understood as a strip, so that the logical volume is allocated with the physical storage space.

[0043] According to an aspect of an embodiment of the present application, a target object migration method is provided. Optionally, as an optional implementation, the target object migration method can be applied in an application environment as shown in Figure 1 The application environment includes a user device 101 and a storage device 102.

[0044] Optionally, in the embodiment, the user device can be a terminal device configured with a target client, and can include but is not limited to at least one of the following: a mobile phone (such as an Android mobile phone, an iOS mobile phone, etc.), a notebook computer, a tablet computer, a palm computer, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart television, etc. The target client can be a cloud storage client, a video client, an instant messaging client, a game client, etc.

[0045] The network can include but is not limited to a wired network and a wireless network, wherein the wired network includes a local area network, a metropolitan area network and a wide area network, and the wireless network includes Bluetooth, WIFI and other wireless communication networks.

[0046] The storage device 102 can be a server, which can be a single server, a server cluster composed of multiple servers, or a cloud server. The above is only an example, and the present embodiment does not make any limitation on this.

[0047] Optionally, the following explains the key terms involved in the present application:

[0048] Bucket: the carrier of object storage, which is a "container" for storing objects, and has no upper limit on capacity.

[0049] Lavadb: an index Key-Value storage system of object storage, in which the bucket, object, and shard index are stored.

[0050] Lavadb cold backup: Lavadb periodically mirrors its stored data to offline storage for later analysis.

[0051] QPS: Query Per Second, the query rate per second.

[0052] Access: object index management module.

[0053] Merge: List interface service module.

[0054] Optionally, as an optional embodiment, as shown in Figure 2 The migration method of the target object includes:

[0055] Step S202, obtaining a target object set to be migrated, wherein the objects in the target object set are stored in a same source storage space;

[0056] The source storage space can be a slot in a storage device, and the objects in the target object set constitute a bucket. In the old architecture, all objects in the bucket are stored in the same slot in the storage device. The objects in the target object set can be files, and the types of the files can be videos, pictures, software installation packages, etc.

[0057] Step S204, migrating the target object set from the source storage space to a plurality of target storage spaces, wherein each object in the target object set is stored in one of the plurality of target storage spaces after migration;

[0058] The plurality of target storage spaces can be N slots, and the value of N can be determined according to actual conditions, such as 2, 4, 6, 32, etc. In the embodiment of the present application, 32 slots are used. In the new architecture, the plurality of objects in the bucket are scattered into 32 parts and stored in the 32 slots. The target storage space is one of the 32 slots, and each object in the bucket is stored in one of the 32 slots.

[0059] In step S206, in the process of migrating the target object set from the source storage space to the plurality of target storage spaces, a target operation is performed on the target object in response to the obtained target request, wherein the target request is used to request to perform the target operation on the target object.

[0060] The target request includes but is not limited to an upload request, a download request or a deletion request. The target object can be an object requested to be uploaded, an object requested to be downloaded, or an object requested to be deleted. The target operation includes but is not limited to uploading, downloading, and deleting.

[0061] As an optional implementation, as shown in Figure 3 As shown is a cloud storage platform page schematic diagram, object migration from an old architecture to a new architecture can be performed in the dimension of a storage bucket, in the page, a migrated park, a migrated client identifier, and a migrated storage bucket identifier can be selected. By clicking the query in the interface, the storage bucket under the corresponding park and client in the old architecture can be queried. By clicking the creation, the storage bucket under the corresponding park and client in the old architecture can be migrated to the new architecture. In the interface, the creator, the submission time, the progress update time, the progress, the operation, and other related information can also be displayed. The old architecture adopts a mode of storing objects in a storage bucket in a slot, and the new architecture adopts a mode of scattering the objects in the storage bucket into N parts and storing them in N slots, wherein N can be determined according to actual conditions, and in the embodiment of the application, N = 32. The migration progress of a single storage bucket can be queried through a visual page.

[0062] Optionally, the target operation performed on the target object in response to the obtained target request includes: in the case where the target request is used to request to download the target object, the target object is obtained in the source storage space or the plurality of target storage spaces; or in the case where the target request is used to request to upload the target object, a target storage space index corresponding to the target object in the plurality of target storage spaces is obtained, and the target object is stored in a target storage space corresponding to the target storage space index in the plurality of target storage spaces; or in the case where the target request is used to request to delete the target object, the target object is deleted in the source storage space and / or the plurality of target storage spaces.

[0063] As an optional implementation, in the process of migrating the object in the storage bucket from the new architecture to the old architecture, the user can perform data processing on the cloud object storage platform without sensing, including but not limited to uploading objects, downloading objects, and deleting objects.

[0064] As an optional implementation, for the case of requesting to download the target object, the embodiment of the application adopts a double reading mode to download the target object requested by the user in the source storage space (1 slot) of the old architecture or in the plurality of target storage spaces (32 slots) of the new architecture.

[0065] As an optional implementation, for the case of requesting to upload the target object, the embodiment of the application adopts a single writing mode to store the uploaded target object in the 32 slots of the new architecture. The above target storage location index is the index of the slot (target storage space) for storing the target object in the new architecture.

[0066] As an optional implementation, for the case of requesting to delete the target object, the embodiment of the application adopts a double deletion mode to delete the target object in the original storage space (1 slot) of the old architecture and in the plurality of target storage spaces (32 slots) of the new architecture.

[0067] Optionally, in the case of the target request being for requesting to download the target object, the target object is acquired in the source storage space or the plurality of target storage spaces, including: determining the target storage space index of the target object according to the identification of the target object; searching for the target object in the target storage space corresponding to the target storage space index in the plurality of target storage spaces; and acquiring the target object in the target storage space corresponding to the target storage space index in the case of finding the target object in the target storage space corresponding to the target storage space index.

[0068] As an optional implementation, for the case of downloading the target object, a double reading mode is adopted to first download the target object in the new architecture, and if the target object exists in the new architecture, the target object is downloaded in the new architecture.

[0069] As an optional implementation, the identification of the target object includes but is not limited to the name of the target object, for example, the identification of the target object is a. According to the identification a, the index (target storage space index) of the target object in the new architecture can be determined, the storage space corresponding to the target storage space index is searched for in the 32 slots (plurality of target storage spaces) of the new architecture, and whether the target object a exists in the storage space is searched for, the target object a is acquired in the storage space, and the acquired target object a is returned to the user.

[0070] Optionally, in the case that the target request is for requesting to download the target object, the target object is acquired from the source storage space or the plurality of target storage spaces, further comprising: in the case that the target object is not found in the target storage space corresponding to the target storage space index, determining a source storage position index of the target object according to the identifier of the target storage space; and acquiring an object corresponding to the source storage position index from the source storage space, wherein the target object is the object corresponding to the source storage position index acquired from the source storage space.

[0071] As an optional implementation, in the double reading mode, if the target object is not found in the new architecture, the index (target storage space index) of the target object in the old architecture is determined according to the identifier a of the target object. The index of the target object in the old architecture can be a value obtained by performing a hash operation on the identifier of the target object. The hash value of the target file identifier a can be calculated by using the hash algorithm in the prior art. Assuming that the hash value of a is 33, the index of the target object in the old architecture (1 slot) is 33 (source storage position index). It is queried whether the index 33 exists in the 1 slot of the old architecture. If the index 33 exists, the object corresponding to the index 33 is determined as the target object, the target object is downloaded and sent to the user. If the target object corresponding to the index 33 is not found in the 1 slot of the old architecture, the user is returned that the target object is not found.

[0072] Optionally, the target storage space index of the target object is determined according to the identifier of the target object, comprising: performing a hash operation on the identifier of the target object to obtain a target hash value; and using the target hash value to take the remainder of the target number, and determining the obtained remainder as the target storage space index, wherein the target number represents the number of target storage spaces in the plurality of target storage spaces.

[0073] As an optional implementation, the target object uses a two-level index in the new architecture, and the two-level index includes a target storage space index and a source storage position index. The target storage space index is the index of the storage space for storing the object in the new architecture, that is, the index of the 32 slots in the new architecture, for example, 0 to 31 respectively represent the index of the 32 slots. The original storage position index is the index of the target object, which is a value obtained by performing a hash operation on the identifier of the object.

[0074] The following is an example. Assuming that the identifier of the target object is a, the target hash value (assuming 33) obtained by performing a hash operation on a is the source storage position index, that is, the target hash value 33 is used to represent the target object.

[0075] The target number N is the number of slots in the new architecture (assuming 32), and the target number N is taken modulo the target hash value. The remainder obtained by taking 33 modulo 32 is 1, so 1 is the target storage space index. In the 32 slots of the new architecture, the slot corresponding to the target storage space index 1 is searched to determine whether the object corresponding to the source storage location index 33 exists. If the object exists, the object corresponding to the source storage location index 33 is determined as the target object, and the target object is sent to the user. If the object does not exist, the slot in the old architecture is searched to determine whether the object corresponding to the source storage location index 33 exists. If the object exists, the object corresponding to the source storage location index 33 is determined as the target object, and the target object is sent to the user.

[0076] As an optional implementation, as shown in a double-reading flowchart, the method comprises the following steps: Figure 4

[0077] In step S401, a target request is obtained, the target request being used to request to download a target object. The target request can carry an identifier of the target file, for example, the identifier a in the above embodiment.

[0078] In step S402, a hash operation is performed on the identifier of the target object to obtain a target hash value. The target hash value is used as a source storage location index of the target object. Assuming that the hash value obtained by performing the hash operation on the identifier a is 33, the source location index of the target object is 33.

[0079] In step S403, the target number is taken modulo the target hash value, and the remainder obtained is determined as a target storage space index. The target number is the number N of slots in the new architecture. N can be set according to actual conditions, and is assumed to be 32. The target hash value 33 is taken modulo 32, and the remainder obtained is 1, so the target storage space index is 1.

[0080] In step S404, whether the target object exists in the new architecture is determined. If yes, step S407 is executed, and if no, step S405 is continued. The target storage space index obtained can be used to search the slot corresponding to the target storage space index 1 in the 32 slots of the new architecture to determine whether the target object exists. Assuming that the target storage space index 1 corresponds to slot 1, whether the object corresponding to the source storage location index 33 exists in slot 1 is determined.

[0081] In step S405, the target hash value is used as a source storage location index. For example, the hash value obtained by performing the hash operation on the identifier a is 33, so the source location index of the target object is 33.

[0082] In step S406, whether the target object exists in the old architecture is determined. If yes, step S407 is executed, and if no, step S408 is executed. Whether the object corresponding to the source location index 33 exists in the slot of the old architecture is determined.​

[0083] Step S407, downloading the target object and sending to the user.

[0084] Step S408, returning to the user that the target object is not queried.

[0085] Optionally, in the case that the target request is used to request uploading the target object, the target storage space index corresponding to the target object in the plurality of target storage spaces is acquired, and the target object is stored in the target storage space corresponding to the target storage space index in the plurality of target storage spaces, including: performing a hash operation on the identifier of the target object to obtain a target hash value; using the target hash value to take the remainder of the target number to determine the remainder as the target storage space index, wherein the target number represents the number of target storage spaces in the plurality of target storage spaces; and storing the target object in the target storage space corresponding to the target storage space index in the plurality of target storage spaces.

[0086] As an optional implementation, for the case of requesting to upload the target object, the single-write mode is adopted to store the uploaded target object in the 32 slots in the new architecture. The above target storage location index is the index of the slot (target storage space) for storing the target object in the new architecture.

[0087] Suppose that the identifier of the target object is a, and the hash operation on a obtains a target hash value (suppose 33), which is the source storage location index, that is, the target hash value 33 is used to represent the target object.

[0088] The target number N is the number of slots in the new architecture (suppose 32), and the target hash value is taken modulo the target number N. The remainder obtained by taking the above target hash value 33 modulo 32 is 1, so 1 is the target storage space index. The target object is stored in the slot corresponding to the target storage space index 1 (suppose slot 1) in the 32 slots in the new architecture, and the target object is identified by the source storage location index 33 in the slot 1, that is, the source storage location index 33 is used as the index of the target object.

[0089] As an optional implementation, as shown in the single-write flowchart shown in Figure 5 The single-write flowchart includes the following steps:

[0090] Step S501, acquiring a target request, the target request being used to request uploading a target object, and the target request carrying an identifier of a target file, such as the identifier a in the above embodiment.

[0091] Step S502, performing a hash operation on the identifier of the target object to obtain a target hash value.

[0092] Step S503, the target object is indexed by the target hash value as the source storage location; assuming that the hash value obtained by hashing the above-mentioned identifier a is 33, the source location index of the target object is 33.

[0093] Step S504, the target quantity is taken modulo by the target hash value, and the obtained remainder is determined as the target storage space index. The target quantity is the number N of slots in the new architecture, which can be set according to actual conditions. Assuming that N is 32, the above-mentioned target hash value 33 is taken modulo by 32, and the obtained remainder is 1, then the target storage space index is 1.

[0094] Step S505, the target object is stored in the target storage space corresponding to the target storage space index. Assuming that the target storage space corresponding to the above-mentioned target storage space index 1 is slot 1 in the new architecture, the target object is stored in slot 1, and the target object is identified by the source location index 33 of the target object.

[0095] Optionally, in the case where the target request is for requesting to delete the target object, the target object is deleted in the source storage space and / or the plurality of target storage spaces, including: hashing the identifier of the target object to obtain a target hash value; taking the target quantity modulo by the target hash value, and determining the obtained remainder as a first target index of the target object, and determining the target hash value as a second target index, wherein the target quantity represents the number of target storage spaces in the plurality of target storage spaces; in the case where the object corresponding to the second target index exists in the source storage space, deleting the object corresponding to the second target index in the source storage space, wherein the target object includes the object corresponding to the second target index in the source storage space; in the case where the target object exists in the target storage space corresponding to the first target index in the plurality of target storage spaces, deleting the target object in the target storage space corresponding to the first target index.

[0096] As an optional embodiment, for the case where the target request is for requesting to delete the target object, the double deletion manner adopted in the embodiment of the application is used, that is, if the target object exists in both the new architecture and the old architecture, the target object is deleted in both the new architecture and the old architecture.

[0097] The following is an example. Assuming that the identifier of the target object is a, the target hash value obtained by hashing a (assuming that it is 33) is the second target index (the same as the source storage location index in the above-mentioned embodiment), and the target object is represented by the target hash value 33.

[0098] The target number N is the number of slots in the new architecture (assuming 32), and the target number N is taken modulo the target hash value. The remainder obtained by taking 33 modulo 32 is 1, so 1 is the first target index (the same as the target storage space index), indicating that the target object is stored in the target storage space (assuming slot 1) in the new architecture (32 slots). It is checked whether the object corresponding to the second target index 33 exists in slot 1 of the 32 slots in the new architecture. If the object corresponding to the second target index 33 exists, the object corresponding to the second target index 33 is determined as the target object, and the target object is deleted in slot 1. It is checked whether the object corresponding to the first target index 33 exists in the 1 slot in the old architecture. If the object corresponding to the first target index 33 exists, the target object is deleted in the 1 slot in the old architecture.

[0099] As an optional implementation, a double deletion process diagram is shown in FIG. 8, which includes the following steps. Figure 6

[0100] In step S601, a target request is obtained, the target request being used to request deletion of a target object. The target request can carry an identifier of a target file, for example, the identifier a in the above embodiment.

[0101] In step S602, a hash operation is performed on the identifier of the target object to obtain a target hash value. The target hash value is used as a second target index of the target object. For example, the hash value obtained by performing the hash operation on the identifier a is 33, and the second target index of the target object is 33.

[0102] In step S603, the target number is taken modulo the target hash value, and the remainder obtained is determined as a first target index. The target number is the number N of slots in the new architecture, which can be set according to actual conditions, and is assumed to be 32. The remainder obtained by taking 33 modulo 32 is 1, so the first target index is 1.

[0103] In step S604, it is checked whether the target object exists in the new architecture. If yes, step S407 is performed. The second target index obtained can be used to check whether the target object exists in the slot corresponding to the second target index 1 in the 32 slots in the new architecture. For example, the second target index 1 corresponds to slot 1, and it is checked whether the object corresponding to the second target index 33 exists in slot 1.

[0104] In step S605, the target hash value is used as the second target index. For example, the hash value obtained by performing the hash operation on the identifier a is 33, and the second target index of the target object is 33.

[0105] In step S606, it is checked whether the target object exists in the old architecture. If yes, step S607 is performed. It is checked whether the object corresponding to the second target index 33 exists in the 1 slot in the old architecture. ​

[0106] Step S607, deleting the target object.

[0107] Optionally, the migrating the set of target objects from the source storage space to the plurality of target storage spaces comprises: for each object in the set of target objects to be migrated, performing the following operations, in which the each object is a current object: obtaining a source storage location index of the current object in the source storage space; using the source storage location index of the current object to take a remainder of a target number, and determining the obtained remainder as a target storage space index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; storing the current object into a target storage space corresponding to the target storage space index in the plurality of target storage spaces, and deleting the current object in the source storage space.

[0108] As an optional implementation, the set of target objects to be migrated can be a storage bucket, and the storage bucket includes a plurality of objects. In the old architecture, the objects in the storage bucket are stored in the same storage space (1 slot). When migrating the objects in the old architecture storage bucket to the new architecture, the objects in the storage bucket are scattered and stored in the plurality of target storage spaces (32 slots) of the new architecture.

[0109] The following is described by taking a specific embodiment as an example. It is assumed that the storage bucket includes file a, file b and file c, the source storage location index of file a in the old architecture is 0, the source storage location index of file b is 1, and the source storage location index of file c is 2. The above source location index is obtained by performing a hash operation on the file identifiers a, b and c.

[0110] As Figure 7 is a schematic diagram of the migration of the objects in the storage bucket from the old architecture to the new architecture. It is assumed that the current object is file a, and the target number of slots in the new architecture is 32. Using the source storage location index 0 to take a remainder of 32, the obtained remainder is 0, and then file a is stored in the slot (slot 0) corresponding to the target storage space index 0 in the 32 slots, and file a is deleted in the 1 slot of the old architecture. It is assumed that the current object is file b, and using the source storage location index 1 to take a remainder of 32, the obtained remainder is 1, and then file b is stored in the slot (slot 1) corresponding to the target storage space index 1 in the 32 slots, and file b is deleted in the 1 slot of the old architecture. It is assumed that the current object is file c, and using the source storage location index 2 to take a remainder of 32, the obtained remainder is 2, and then file c is stored in the slot (slot 2) corresponding to the target storage space index 2 in the 32 slots, and file c is deleted in the 1 slot of the old architecture.

[0111] Optionally, after the current object is stored in the target storage space corresponding to the target storage space index in the plurality of target storage spaces and the current object in the source storage space is deleted, the method further comprises: obtaining a download request, wherein the download request requests to download the current object; performing a hash operation on the identifier of the current object to obtain the current hash value; performing a modulo operation on the target number using the current hash value, and determining the obtained remainder as the target storage space index; and downloading the current object in the target storage space corresponding to the target storage space index.

[0112] As an optional implementation, after the objects in the storage bucket of the old architecture are migrated to the new architecture, a download request of a user is received, a hash value is obtained by performing a hash operation on the identifier of the target object carried in the download request, and a modulo operation is performed on the number of slots (for example, 32) in the new architecture using the hash value, and the remainder obtained is the index (target storage space index) of the target object in the new architecture. The target object is downloaded in the slot corresponding to the target storage space index. In this embodiment, since the objects in the storage bucket are scattered and stored in 32 slots in the new architecture, when the object is queried, the object can be found in the corresponding slot according to the index. Compared with the old architecture which needs to traverse all objects in the storage bucket, the new architecture has higher query efficiency per second.

[0113] Optionally, before the target object set is migrated from the source storage space to the plurality of target storage spaces, the method further comprises: backing up the source storage location indexes of the objects in the target object set to be migrated in the source storage space to obtain a backup index set; and after the target object set is migrated from the source storage space to the plurality of target storage spaces, the method further comprises: verifying whether all objects in the target object set to be migrated are migrated to the plurality of target storage spaces according to the backup indexes in the backup index set.

[0114] As an optional implementation, after the objects in the storage bucket of the old architecture are migrated to the new architecture, the completeness of the migration is verified. Before the migration, the source storage location indexes of the objects in the storage bucket are backed up, and the source storage location indexes are hash values of file identifiers.

[0115] Taking the storage bucket including a file d, a file e and a file f as an example, the file d, the file e and the file f are taken as examples. Hash operations are performed on d, e and f, and it is assumed that the obtained hash values are 32, 33 and 34. The source storage location indexes of the file d, the file e and the file f are 32, 33 and 34. The source storage location indexes 32, 33 and 34 are backed up to obtain a backup index set 32, 33 and 34. As shown in FIG. 4, the backup index set 32, 33 and 34 is stored in the source storage space. Figure 8The backup index set shown is used to verify whether objects in the old architecture have been completely migrated to the new architecture based on backup indices 32, 33, and 34 in the backup index set.

[0116] Optionally, the step of verifying whether all objects in the target object set to be migrated have been migrated to the plurality of target storage spaces based on the backup indexes in the backup index set includes: performing the following operations on each backup index in the backup index set, wherein each backup index is the current backup index when performing the following operations: performing a modulo operation on the target quantity using the current backup index, and determining the current target index by the remainder obtained, wherein the target quantity represents the number of target storage spaces in the plurality of target storage spaces; determining whether the current object corresponding to the current backup index exists in the current target storage space corresponding to the current target index in the plurality of target storage spaces; and determining that the current object corresponding to the current backup index in the source storage space has been migrated to the plurality of target storage spaces if the current backup index exists in the current target storage space.

[0117] As an optional implementation, assume the above-mentioned current backup index Figure 8 As shown in Figure 32, the remainder of the current backup index 32 divided by the number of slots 32 in the new architecture is 0. Then, the system checks if the object corresponding to the current backup index 32 exists in the slot (slot 0) of the new architecture. If it exists, it is determined that the object corresponding to the current backup index 32 has been migrated to the new architecture. Using the above method, the current backup indices 33 and 34 in the current backup index set are further verified to ensure that the objects in the old architecture's bucket have been completely migrated to the new architecture.

[0118] Optionally, migrating the target object set from the source storage space to multiple target storage spaces includes: migrating the target object set from the source storage space to the multiple target storage spaces in parallel using multiple threads.

[0119] As an optional implementation, the number of threads can be determined according to the actual situation, for example, it can be 3 threads, 5 threads, or 10 threads. Figure 9 In the migration cluster shown, the Master retrieves objects from the storage bucket in the database (DB) and performs parallel migration using multiple threads (workers in the diagram). In this embodiment, multi-threaded parallel migration can improve migration speed.

[0120] Optionally, the migrating the target object set from the source storage space to the plurality of target storage spaces in parallel through the plurality of threads comprises: when the plurality of threads is M threads, sending a scheduling instruction to an i th thread in the M threads to instruct the i th thread to migrate a j th object in the target object set to the plurality of target storage spaces, where M is an integer greater than or equal to 2, 1≤i≤M, and j is an integer greater than or equal to 1; during the process of migrating the j th object to the plurality of target storage spaces by the i th thread, sending a heartbeat instruction to the i th thread according to a preset period, and in a case where no feedback information sent by the i th thread in response to the heartbeat instruction is received within a preset time length, sending a scheduling instruction to a k th thread in the M threads to instruct the k th thread to migrate the j th object to the plurality of target storage spaces, where 1≤k≤M.

[0121] As an optional implementation, as shown in Figure 9 The Master sends a scheduling instruction to the thread worker to instruct the thread worker to migrate a j th object in the old architecture storage bucket to the new architecture. During the migration process, the master periodically checks the heartbeat, and periodically sends a heartbeat instruction to the thread worker. If the master does not receive the feedback of the worker within a preset time length (which can be determined according to actual conditions, for example, 5 seconds, 10 seconds), the Master instructs the other thread (the k th thread) to migrate the j th object to the new architecture.

[0122] As an optional implementation, if the master and the worker are network partitioned, the master is switched, and the master completes the migration by scheduling through other masters.

[0123] As an optional implementation, if the i th thread (worker) scheduling fails and the number of failures is less than a preset value (for example, 4 times), the scheduling is re-scheduled, and the power is re-tried.

[0124] As an optional implementation, the Master is unique, clustered, and highly available to ensure efficient and controllable migration task scheduling. The global load frequency control controls the total number of tasks; the round-robin scheduling allows short jobs to be inserted into the needle, and the Shuffle uniformity ensures high throughput and avoids large tasks from occupying resources for a long time; the user-level overload protection allows for timely intervention; on this basis, through the Master total control, the gradual gray migration based on the bucket dimension is realized, and in sequence: the storage buckets of test accounts and personal accounts; the storage buckets of life cycle accounts and backup businesses, the storage buckets of self-developed businesses, and the external storage buckets according to the last digit.

[0125] As an optional implementation, as shown in the structural diagram Figure 10 As shown in the structural diagram, before migration, Migrator sets the bucket attribute to migration, and each access module of the business starts the compatible logic of the migration strategy; during migration, Migrator scans out all object indexes of the old architecture under the Bucket from Lavadb, initiates migration in the dimension of object index, confirms the correctness of the new architecture index to Lavadb after migration, deletes the index of the old architecture, and until all objects under the Bucket are migrated; after migration is completed, Migrator sets the bucket attribute to migration completion, and each access module of the business starts the high QPS (query per second) read-write logic.

[0126] The four interfaces of the object to the storage to the outside are uploading, downloading, deleting, and List. The high QPS scheme adopts object storage index scattering into 32 parts, while the old scheme does not scatter, so there is a large difference between their index routing and actual storage location. During migration, this scheme adopts a double-read, double-delete, and single-write 32-slot architecture (new architecture), and does not add a 1-slot architecture (old architecture) in stock,

[0127] Upload only writes the new architecture, and object index is written into the new architecture through the high QPS scattering strategy, which has high QPS capability; when downloading, double-read, since the newly written index only exists in the new architecture, the new architecture index is read first when downloading, and if it exists, it is returned; if the new architecture does not exist, the old architecture is read, and if both the new and old architectures do not exist, the record does not exist is returned; double-write when deleting, since uploading only writes the new architecture, during migration, an object may exist in two architectures, and both the new and old architectures are deleted to reduce the risk of data inconsistency; List is double-read and then combined, 32 routes of the new architecture and 1 route of the old architecture are combined and sorted to return the index.

[0128] The migration completeness mainly includes: storage bucket completeness, object index completeness. The storage completeness refers to migrating all the storage buckets of the cluster to the new architecture without more or less. Since there is no interface provided internally to pull all the storage buckets in real time, the present solution adopts the cold backup analysis of Lavadb to obtain all the storage list. Before starting the migration, the cluster has set all the newly added storage buckets to high QPS, so there will be no newly added storage buckets of the old architecture after analyzing the current cold backup, that is, the cold backup is the full amount of the storage buckets of the old architecture. The object index completeness refers to migrating all the objects under the storage to the new architecture without more or less. Since the completeness of the object index under the storage is relatively important, incompleteness will cause data loss after migration, therefore, the present solution ensures the index completeness in three aspects: after the Migrator completes the migration, whether there is an object that is not migrated completely is checked through the Lavadb List interface; whether there is an object that is not migrated is judged again by the Access, which can be mutually reserved with the Migrator checking strategy to avoid false judgment caused by single module bug; cold backup analysis, after the whole park completes the migration, the cold backup of all object indexes is analyzed to check whether there is an object index that is not migrated. Since the cold backup analysis is the analysis of the indexes of the whole park, the completeness of the bucket is also confirmed here.

[0129] The migration is controlled by the distributed Migrator, the Migrator module adopts the Master-Worker high availability design architecture, the Master is responsible for task scheduling, heartbeat alive, and reporting task progress, and adopts the distributed lock, lock-delay, and key state persistence strategy to realize the Master high availability and fault recovery. At the same time, multiple types of content strategies are designed to cope with the Worker, network unavailability,

[0130] It should be noted that, for each of the method embodiments described above, in order to simply describe, each is described as a series of action combinations, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0131] According to another aspect of the embodiment of the present application, a migration device of a target object for implementing the migration method of the target object is also provided. As Figure 11As shown, the apparatus comprises: an acquisition module 1102 configured to acquire a target object set to be migrated, wherein the objects in the target object set are stored in a same source storage space; a migration module 1104 configured to migrate the target object set from the source storage space to a plurality of target storage spaces, wherein each object in the target object set is stored in one target storage space in the plurality of target storage spaces after migration; and a response module 1106 configured to, in the process of migrating the target object set from the source storage space to the plurality of target storage spaces, perform a target operation on a target object in response to an acquired target request, wherein the target request is used to request to perform the target operation on the target object.

[0132] Optionally, the apparatus is further configured to, in the case where the target request is used to request to download the target object, acquire the target object in the source storage space or the plurality of target storage spaces; in the case where the target request is used to request to upload the target object, acquire a target storage space index of the target object in the plurality of target storage spaces, and store the target object in a target storage space corresponding to the target storage space index in the plurality of target storage spaces; and in the case where the target request is used to request to delete the target object, delete the target object in the source storage space and / or the plurality of target storage spaces.

[0133] Optionally, the apparatus is further configured to determine a target storage space index of the target object according to an identifier of the target object, search for the target object in a target storage space corresponding to the target storage space index in the plurality of target storage spaces, and acquire the target object in the target storage space corresponding to the target storage space index in the case where the target object is found in the target storage space corresponding to the target storage space index.

[0134] Optionally, the apparatus is further configured to, in the case where the target object is not found in the target storage space corresponding to the target storage space index, determine a source storage location index of the target object according to an identifier of the target storage space, and acquire an object corresponding to the source storage location index in the source storage space, wherein the target object is the acquired object corresponding to the source storage location index in the source storage space.

[0135] Optionally, the apparatus is further configured to perform a hash operation on the identifier of the target object to obtain a target hash value, perform a modulo operation on a target number using the target hash value, and determine a remainder obtained in the modulo operation as the target storage space index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces.

[0136] Optionally, the apparatus is further configured to perform a hash operation on the identifier of the target object to obtain a target hash value; perform a modulo operation on a target number using the target hash value, and determine a remainder obtained in the modulo operation as the target storage space index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; and store the target object in the target storage space corresponding to the target storage space index in the plurality of target storage spaces.

[0137] Optionally, the apparatus is further configured to perform a hash operation on the identifier of the target object to obtain a target hash value; perform a modulo operation on a target number using the target hash value, and determine a remainder obtained in the modulo operation as a first target index of the target object and determine the target hash value as a second target index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; in a case where an object corresponding to the second target index exists in the source storage space, delete the object corresponding to the second target index in the source storage space, wherein the target object comprises the object corresponding to the second target index in the source storage space; and in a case where the target object exists in a target storage space corresponding to the first target index in the plurality of target storage spaces, delete the target object in the target storage space corresponding to the first target index.

[0138] Optionally, the apparatus is further configured to perform the following operation on each object in the set of target objects to be migrated, and the each object is a current object when the following operation is performed: obtain a source storage location index of the current object in the source storage space; perform a modulo operation on a target number using the source storage location index of the current object, and determine a remainder obtained in the modulo operation as a target storage space index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; store the current object to a target storage space corresponding to the target storage space index in the plurality of target storage spaces, and delete the current object in the source storage space.

[0139] Optionally, the apparatus is further configured to, after the storing of the current object to the target storage space corresponding to the target storage space index in the plurality of target storage spaces and the deleting of the current object in the source storage space, obtain a download request, wherein the download request requests to download the current object; perform a hash operation on an identifier of the current object to obtain the current hash value; perform a modulo operation on the target number using the current hash value, and determine a remainder obtained in the modulo operation as the target storage space index; and download the current object from the target storage space corresponding to the target storage space index.

[0140] Optionally, the apparatus is further configured to, before migrating the target object set from the source storage space to the plurality of target storage spaces, backup source storage location indexes of objects in the target object set to be migrated in the source storage space, to obtain a backup index set; after migrating the target object set from the source storage space to the plurality of target storage spaces, according to a backup index in the backup index set, check whether all objects in the target object set to be migrated are migrated to the plurality of target storage spaces.

[0141] Optionally, the apparatus is further configured to, for each backup index in the backup index set, perform the following operations on the backup index: using the backup index to perform a modulo operation on a target number, to obtain a remainder as a current target index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; determining whether a current object corresponding to the current backup index exists in a current target storage space corresponding to the current target index in the plurality of target storage spaces; in a case where the current object corresponding to the current backup index exists in the current target storage space, determining that the current object corresponding to the current backup index in the source storage space has been migrated to the plurality of target storage spaces.

[0142] Optionally, the apparatus is further configured to migrate the target object set from the source storage space to the plurality of target storage spaces in parallel through a plurality of threads.

[0143] Optionally, when the plurality of threads are M threads, the apparatus is further configured to send a scheduling instruction to an i th thread in the M threads, to instruct the i th thread to migrate a j th object in the target object set to the plurality of target storage spaces, wherein M is an integer greater than or equal to 2, 1≤i≤M, and j is an integer greater than or equal to 1; during the process in which the i th thread migrates the j th object to the plurality of target storage spaces, a heartbeat instruction is sent to the i th thread according to a preset period, and in a case where no feedback information sent by the i th thread in response to the heartbeat instruction is received within a preset time length, a scheduling instruction is sent to a k th thread in the M threads, to instruct the k th thread to migrate the j th object to the plurality of target storage spaces, wherein 1≤k≤M.

[0144] According to still another aspect of the embodiments of the present application, an electronic device for implementing the above-mentioned target object migration method is provided, which can be a terminal device or a server as shown in the drawings. Figure 1 The present embodiment takes the electronic device as a server for example to illustrate. As shown in Figure 12As shown, the electronic device includes a memory 1202 in which a computer program is stored, and a processor 1204 configured to execute the steps in any of the method embodiments described above by the computer program.

[0145] Optionally, in this embodiment, the electronic device described above can be located in at least one of the plurality of network devices of the computer network.

[0146] Optionally, in this embodiment, the processor described above can be configured to execute the following steps by the computer program:

[0147] S1, obtaining a target object set to be migrated, wherein the objects in the target object set are stored in a same source storage space;

[0148] S2, migrating the target object set from the source storage space to a plurality of target storage spaces, wherein each object in the target object set is stored in one target storage space in the plurality of target storage spaces after migration;

[0149] S3, in the process of migrating the target object set from the source storage space to the plurality of target storage spaces, performing a target operation on a target object in response to a target request obtained, wherein the target request is used to request to perform the target operation on the target object.

[0150] Optionally, those skilled in the art can understand that, Figure 12 The structure shown is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and other terminal devices. Figure 12 It does not limit the structure of the electronic device. For example, the electronic device can include more or less components (such as network interfaces, etc.) than Figure 12 shown, or have a different configuration than Figure 12 shown.

[0151] The memory 1202 can be used to store software programs and modules, such as program instructions / modules corresponding to the target object migration method and device in the embodiments of the present application. The processor 1204 executes various functions and data processing by running the software programs and modules stored in the memory 1202, that is, implements the target object migration method described above. The memory 1202 can include a high-speed random access memory, and can further include a non-volatile memory such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 1202 can further include a memory remotely arranged with respect to the processor 1204, which can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. Specifically, the memory 1202 can be used to store, but is not limited to, sample characteristics of an item and a target virtual resource account and the like. As an example, as shown in Figure 12 The memory 1202 can include, but is not limited to, the acquisition module 1102, the acquisition module 1104, and the response module 1106 in the target object migration device described above. In addition, other module units in the target object migration device described above can also be included, but are not limited to, which will not be described in detail in this example.

[0152] Optionally, the transmission device 1206 is used to receive or send data via a network. Specific examples of the above network can include wired networks and wireless networks. In one example, the transmission device 1206 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable to communicate with the Internet or a local area network. In one example, the transmission device 1206 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner.

[0153] In addition, the electronic device further includes a display 1208 for displaying a page in the cloud storage platform, and a connection bus 1210 for connecting various module components in the electronic device.

[0154] In other embodiments, the terminal device or the server can be a node in a distributed system, where the distributed system can be a blockchain system, which can be a distributed system formed by the plurality of nodes communicating through a network. The nodes can form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, a terminal, and the like, can become a node in the blockchain system by joining the peer-to-peer network.

[0155] According to an aspect of the present application, a computer program product is provided, which includes computer programs / instructions containing program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1309, and / or installed from the detachable medium 1311. When the computer program is executed by the central processing unit 1301, various functions provided by the embodiments of the present application are executed.

[0156] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0157] Figure 13 The computer system structure block diagram of the electronic device for implementing the embodiments of the present application is schematically shown.

[0158] It should be noted that, Figure 13 The computer system 1300 of the electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0159] As Figure 13 shown, the computer system 1300 includes a central processing unit 1301 (CPU), which can perform various appropriate actions and processes according to the programs stored in the read-only memory 1302 (ROM) or the programs loaded into the random access memory 1303 (RAM) from the storage part 1308. In the random access memory 1303, various programs and data required for system operation are also stored. The central processing unit 1301, the read-only memory 1302, and the random access memory 1303 are connected to each other through a bus 1304. The input / output interface 1305 (I / O interface) is also connected to the bus 1304.

[0160] The following components are connected to the input / output interface 1305: an input part 1306 including a keyboard, a mouse, and the like; an output part 1307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage part 1308 including a hard disk, and the like; and a communication part 1309 including a network interface card such as a local area network card, a modem, and the like. The communication part 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the input / output interface 1305 as necessary. A removable media 1311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 1310 as necessary, so that a computer program read out therefrom is installed in the storage part 1308 as necessary.

[0161] In particular, according to embodiments of the present application, the processes described in the various method flowcharts can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication part 1309, and / or installed from the removable media 1311. When the computer program is executed by the central processing unit 1301, various functions defined in the system of the present application are performed.

[0162] According to an aspect of the present application, a computer readable storage medium is provided, from which a processor of a computer device reads computer instructions, and the processor executes the computer instructions, so that the computer device performs the method provided in the various optional implementation manners described above.

[0163] Optionally, in the present embodiment, the computer readable storage medium described above can be configured to store a computer program for executing the following steps:

[0164] S1, obtaining a target object set to be migrated, wherein the objects in the target object set are stored in a same source storage space;

[0165] S2, migrating the target object set from the source storage space to a plurality of target storage spaces, wherein each object in the target object set is stored in one target storage space in the plurality of target storage spaces after migration;

[0166] S3, in the process of migrating the target object set from the source storage space to the plurality of target storage spaces, performing a target operation on a target object in response to a target request, wherein the target request is used to request to perform the target operation on the target object.

[0167] Optionally, in the embodiment, all or part of the steps in the various methods of the above-mentioned embodiments can be understood by those skilled in the art that the above-mentioned steps can be completed by programs instructing the hardware related to the terminal device, and the programs can be stored in a computer readable storage medium, and the storage medium can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0168] The integrated units in the above-mentioned embodiments can be stored in the above-mentioned computer readable storage medium if they are realized in the form of software function units and sold or used as independent products. Based on such understanding, the technical solutions of the present application or all or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0169] In the above-mentioned embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0170] In several embodiments provided in the present application, it should be understood that the disclosed client can be implemented by other ways. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between units or modules, which can be electrical or other forms.

[0171] The units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0172] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0173] The above description is only the preferred embodiment of the present application, and it should be pointed out that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should also be considered as the protection scope of the present application.

Claims

1. A migration method of a target object, characterized by, The method comprises: acquiring a target object set to be migrated, wherein the objects in the target object set are stored in a same source storage space; migrating the target object set from the source storage space to a plurality of target storage spaces, wherein each object in the target object set is stored in one target storage space in the plurality of target storage spaces after migration; in the process of migrating the target object set from the source storage space to the plurality of target storage spaces, performing a target operation on a target object in response to an acquired target request, comprising: performing a hash operation on an identifier of the target object to obtain a target hash value; using the target hash value to take a remainder of a target number to determine a first target index of the target object, and determining the target hash value as a second target index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; in the case where an object corresponding to the second target index exists in the source storage space, deleting the object corresponding to the second target index in the source storage space, wherein the target object includes the object corresponding to the second target index in the source storage space; in the case where the target object exists in a target storage space corresponding to the first target index in the plurality of target storage spaces, deleting the target object in the target storage space corresponding to the first target index, wherein the target request is used to request to perform the target operation on the target object.

2. The method of claim 1, wherein, The method further comprises: in the case where the target request is used to request to download the target object, acquiring the target object in the source storage space or the plurality of target storage spaces; or in the case where the target request is used to request to upload the target object, acquiring a target storage space index of the target object in the plurality of target storage spaces, and storing the target object in a target storage space corresponding to the target storage space index in the plurality of target storage spaces.

3. The method of claim 2, wherein, The method further comprises: determining a target storage space index of the target object according to an identifier of the target object; finding the target object in a target storage space corresponding to the target storage space index in the plurality of target storage spaces; in the case where the target object is found in the target storage space corresponding to the target storage space index, acquiring the target object in the target storage space corresponding to the target storage space index.

4. The method of claim 3, wherein, The method further comprises: in the case where the target object is not found in the target storage space corresponding to the target storage space index, determining a source storage location index of the target object according to an identifier of the target storage space; acquire an object corresponding to the source storage location index in the source storage space, wherein the target object is the object corresponding to the source storage location index acquired in the source storage space.

5. The method of claim 3, wherein, The method further includes: performing a hash operation on the identifier of the target object to obtain a target hash value; performing a modulo operation on a target number using the target hash value, and determining a remainder obtained in the modulo operation as the target storage space index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces.

6. The method of claim 2, wherein, In a case where the target request is for requesting uploading the target object, the method further includes: performing a hash operation on the identifier of the target object to obtain a target hash value; performing a modulo operation on a target number using the target hash value, and determining a remainder obtained in the modulo operation as the target storage space index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; storing the target object in the target storage space corresponding to the target storage space index in the plurality of target storage spaces.

7. The method of claim 1, wherein, The method further includes: performing the following operations on each object in the target object set to be migrated, wherein the each object is a current object: acquiring a source storage location index of the current object in the source storage space; performing a modulo operation on a target number using the source storage location index of the current object, and determining a remainder obtained in the modulo operation as a target storage space index, wherein the target number represents a number of target storage spaces in the plurality of target storage spaces; storing the current object in a target storage space corresponding to the target storage space index in the plurality of target storage spaces, and deleting the current object in the source storage space.

8. The method of claim 7, wherein, After storing the current object in the target storage space corresponding to the target storage space index in the plurality of target storage spaces and deleting the current object in the source storage space, the method further includes: acquiring a download request, wherein the download request requests downloading the current object; performing a hash operation on the identifier of the current object to obtain a current hash value; performing a modulo operation on the target number using the current hash value, and determining a remainder obtained in the modulo operation as the target storage space index; downloading the current object from the target storage space corresponding to the target storage space index.

9. The method of claim 7, wherein, before migrating the target object set from the source storage space to the plurality of target storage spaces, the method further includes: backing up source storage location indexes of objects in the target object set to be migrated in the source storage space to obtain a backup index set; After the target object set is migrated from the source storage space to the plurality of target storage spaces, the method further comprises: checking whether all objects in the target object set to be migrated are migrated to the plurality of target storage spaces according to a backup index in the backup index set.

10. The method of claim 9, wherein, The checking whether all objects in the target object set to be migrated are migrated to the plurality of target storage spaces according to a backup index in the backup index set comprises: For each backup index in the backup index set, the following operations are performed on the backup index, which is a current backup index when the following operations are performed: Residuals are determined by performing a modulo operation on the target number using the current backup index, wherein the target number represents the number of target storage spaces in the plurality of target storage spaces; It is determined whether a current object corresponding to the current backup index exists in a current target storage space corresponding to the current target index in the plurality of target storage spaces; In the case that the current target storage space exists in the current backup index, it is determined that the current object corresponding to the current backup index in the source storage space has been migrated to the plurality of target storage spaces.

11. The method according to any one of claims 1 to 8, characterized in that, The migration of the target object set from the source storage space to the plurality of target storage spaces comprises: The target object set is migrated from the source storage space to the plurality of target storage spaces in parallel through a plurality of threads.

12. The method of claim 11, wherein, The migration of the target object set from the source storage space to the plurality of target storage spaces in parallel through a plurality of threads comprises: When the plurality of threads are M threads, a scheduling instruction is sent to an i th thread in the M threads to instruct the i th thread to migrate a j th object in the target object set to the plurality of target storage spaces, wherein M is an integer greater than or equal to 2, 1≤i≤M, and j is an integer greater than or equal to 1; During the migration of the j th object to the plurality of target storage spaces by the i th thread, a heartbeat instruction is sent to the i th thread at a preset period, and in the case that no feedback information sent by the i th thread in response to the heartbeat instruction is received within a preset time length, a scheduling instruction is sent to a k th thread in the M threads to instruct the k th thread to migrate the j th object to the plurality of target storage spaces, wherein 1≤k≤M.

13. A migration apparatus of a target object, characterized by, Comprise: An acquisition module is configured to acquire a target object set to be migrated, wherein objects in the target object set are stored in a same source storage space; A migration module is configured to migrate the target object set from the source storage space to a plurality of target storage spaces, wherein each object in the target object set is stored in one target storage space in the plurality of target storage spaces after migration. The response module is configured to, in response to the target request obtained in the process of migrating the target object set from the source storage space to the plurality of target storage spaces, perform a target operation on a target object, including: performing a hash operation on an identifier of the target object to obtain a target hash value; performing a modulo operation on the target hash value with respect to a target number to obtain a remainder, determining the remainder as a first target index of the target object, and determining the target hash value as a second target index, where the target number represents a number of target storage spaces in the plurality of target storage spaces; in a case where an object corresponding to the second target index exists in the source storage space, deleting the object corresponding to the second target index in the source storage space, where the target object includes the object corresponding to the second target index in the source storage space; and in a case where the target object exists in a target storage space corresponding to the first target index in the plurality of target storage spaces, deleting the target object in the target storage space corresponding to the first target index, where the target request is used to request the target operation to be performed on the target object.

14. A computer readable storage medium, characterized in that, The computer readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1-12.

15. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions, when executed by the processor, implement the steps of the method of any one of claims 1-12.

16. An electronic device comprising a memory and a processor, characterized in that The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1-12 by using the computer program. The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1-12 by using the computer program.

Citation Information

Patent Citations

  • Method and apparatus for performing simple storage service seamless migration using index objects

    US20210342086A1

  • System and method for estimating storage space needed to store data migrated from a source storage to a target storage

    US9715434B1