A data migration method and device, electronic equipment and storage medium
By acquiring a set of data objects through electronic devices and using hash mapping and preset algorithms, the data is accurately migrated from the first data pool to the second data pool, solving the problem of errors caused by manual operation during the data migration process and achieving efficient and seamless data migration.
Patent Information
- Application Number
- CN202311436436.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-10-31
AI Technical Summary
During data migration, the large volume of data and the heavy workload of manual operations may lead to errors, affecting accuracy and effectiveness.
The system acquires a set of data objects through electronic devices, identifies the target storage node, and uses hash mapping and preset algorithms to accurately migrate the data from the first data pool to the second data pool. Simultaneously, it deletes the first data pool after the migration is complete, ensuring that the data migration is seamless.
It improves the accuracy and efficiency of data migration, enhances the user experience, and ensures a seamless data migration process.
Smart Images

Figure CN117492644B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data migration method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, during the data migration process, relevant personnel need to copy the data from the old data pool to the new data pool and restart the server to complete the data migration.
[0003] However, in the above methods, due to the large amount of data during the data migration process, the workload of relevant personnel in manually performing the data migration is large, which may lead to data migration errors and affect the accuracy and effectiveness of the data migration. Summary of the Invention
[0004] This application provides a data migration method, apparatus, electronic device, and storage medium, which solves the technical problem that due to the large amount of data during the data migration process, the workload of relevant personnel in the manual data migration process is large, which may lead to data migration errors and affect the accuracy and effectiveness of data migration.
[0005] In a first aspect, this application provides a data migration method, comprising: acquiring multiple data, the multiple data being data included in a first storage node, the first storage node being a storage node included in a first data pool; determining a second storage node, the second storage node being a storage node included in a second data pool; and storing the multiple data in the second storage node, so that the multiple data are migrated from the first data pool to the second data pool.
[0006] Optionally, determining the second storage node includes: determining a first identifier and a second identifier, wherein the first identifier is the identifier of the first storage node and the second identifier is the identifier of the second data pool; performing a preset algorithm operation on the second identifier and a third identifier to obtain a target identifier, wherein the third identifier is obtained by performing a hash mapping operation on the first identifier; and determining the storage node corresponding to the target identifier as the second storage node.
[0007] In this application, the electronic device can determine the first identifier and the second identifier, perform a hash mapping operation on the first identifier to obtain the third identifier, and then perform a preset algorithm operation on the second identifier and the third identifier to obtain the target identifier accurately and conveniently.
[0008] Optionally, the above data migration method may further include: if the multiple data are successfully stored in the second storage node, deleting the first storage node from the first data pool.
[0009] In this application, when multiple data are successfully stored to the second storage node, it means that the multiple data have been successfully migrated from the first data pool to the second data pool. At this time, the electronic device can effectively delete the first storage node from the first data pool, so as to accurately and effectively delete the successfully migrated data from the first data pool.
[0010] Optionally, the above data migration method may further include: receiving a data read request from a target user, the data read request being used to request reading target data from the first storage node, the target data being one of the plurality of data; determining whether the first storage node exists in the first data pool; if the first storage node does not exist in the first data pool, determining whether the second storage node exists in the second data pool; if the second storage node exists in the second data pool, sending the target data to the target user based on the plurality of data included in the second storage node.
[0011] In this application, after the migrated data is deleted from the first data pool, in order not to affect the relevant operations of the user, the target user's request will continue to be sent to the first data pool. After the electronic device receives the target user's data read request, it first determines whether the first storage node exists in the first data pool. If the first storage node does not exist in the first data pool, it means that the first storage node may have been successfully migrated to the second data pool. At this time, the electronic device can determine whether the second storage node exists in the second data pool. If the second storage node exists in the second data pool, it means that the data in the first storage node has been successfully stored in the second storage node. At this time, the electronic device can accurately and effectively send the target data to the target user based on the multiple data included in the second storage node, thereby realizing data migration without the target user's awareness and improving the user experience.
[0012] Optionally, the above data migration method may further include: when all the storage nodes included in the first data pool are stored in the second data pool, the second data pool is determined as the target data pool, which is the data pool for the target user to perform preset operations, including data reading and data storage.
[0013] In this application, when multiple storage nodes included in the first data pool are all stored in the second data pool, it indicates that all the data included in the first data pool has been migrated to the second data pool. At this time, the electronic device can accurately and effectively identify the second data pool as the target data pool, thereby enabling accurate and effective data migration without the user's awareness.
[0014] Secondly, this application provides a data migration apparatus, comprising: an acquisition module, a determination module, and a storage module; the acquisition module is used to acquire multiple data, the multiple data being data included in a first storage node, the first storage node being a storage node included in a first data pool; the determination module is used to determine a second storage node, the second storage node being a storage node included in a second data pool; the storage module is used to store the multiple data in the second storage node, so that the multiple data are migrated from the first data pool to the second data pool.
[0015] Optionally, the data migration device further includes a processing module; the determining module is further configured to determine a first identifier and a second identifier, the first identifier being the identifier of the first storage node and the second identifier being the identifier of the second data pool; the operation module is configured to perform a preset algorithm operation on the second identifier and the third identifier to obtain a target identifier, the third identifier being obtained by performing a hash mapping operation on the first identifier; the determining module is further configured to determine the storage node corresponding to the target identifier as the second storage node.
[0016] Optionally, the data migration apparatus further includes a processing module; the processing module is used to delete the first storage node from the first data pool when the multiple data are successfully stored to the second storage node.
[0017] Optionally, the data migration device further includes a receiving module and a sending module; the receiving module is used to receive a data reading request from a target user, the data reading request being used to request reading target data from the first storage node, the target data being one of the plurality of data; the determining module is further used to determine whether the first storage node exists in the first data pool; the determining module is further used to determine whether the second storage node exists in the second data pool if the first storage node does not exist in the first data pool; the sending module is used to send the target data to the target user based on the plurality of data included in the second storage node if the second storage node exists in the second data pool.
[0018] Optionally, the determining module is further configured to determine the second data pool as the target data pool when all the storage nodes included in the first data pool are stored in the second data pool. The target data pool is the data pool for the target user to perform preset operations, including data reading and data storage.
[0019] Thirdly, this application provides an electronic device, including: a processor and a memory configured to store processor-executable instructions; wherein the processor is configured to execute the instructions to implement any of the optional data migration methods in the first aspect described above.
[0020] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed by an electronic device, enable the electronic device to perform any of the optional data migration methods described in the first aspect.
[0021] The data migration method, apparatus, electronic device, and storage medium provided in this application involve an electronic device first acquiring multiple data items from a first storage structure in a first data pool that require data migration. Then, the electronic device determines a second storage structure in a second data pool and stores these multiple data items in the second storage node, thereby migrating the data items from the first data pool to the second data pool. In this application, the electronic device can first effectively determine the multiple data items requiring migration based on a set of data objects, then acquire these multiple data items from the first storage node in the first data pool, then determine the second storage node in the second data pool and store the multiple data items in the second storage node. This effectively and accurately migrates the multiple data items from the first data pool to the second data pool, improving the accuracy and efficiency of data migration. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0023] Figure 1 A flowchart illustrating a data migration method provided in an embodiment of this application;
[0024] Figure 2 A flowchart illustrating another data migration method provided in an embodiment of this application;
[0025] Figure 3 This is a schematic diagram illustrating the process of constructing the target cache structure provided in an embodiment of this application;
[0026] Figure 4 A schematic diagram illustrating the data migration process for the target cache structure provided in this application embodiment;
[0027] Figure 5 A schematic diagram illustrating the specific process of data migration from a first data pool to a second data pool, provided as an embodiment of this application.
[0028] Figure 6 A flowchart illustrating another data migration method provided in an embodiment of this application;
[0029] Figure 7 A schematic diagram illustrating the process of deleting a first storage node from a first data pool, provided in an embodiment of this application;
[0030] Figure 8 A flowchart illustrating another data migration method provided in an embodiment of this application;
[0031] Figure 9 This is a schematic diagram illustrating the process of processing a data reading request from a target user, as provided in an embodiment of this application.
[0032] Figure 10 This is a schematic diagram illustrating the process of processing a data write request to a target user, as provided in an embodiment of this application.
[0033] Figure 11 A flowchart illustrating another data migration method provided in an embodiment of this application;
[0034] Figure 12 This is a schematic diagram illustrating the process of migrating a data pool as provided in an embodiment of this application.
[0035] Figure 13 This is a schematic diagram of the structure of a data migration device provided in an embodiment of this application;
[0036] Figure 14 This is a schematic diagram of another data migration device provided in an embodiment of this application. Detailed Implementation
[0037] The data migration method, apparatus, electronic device, and storage medium provided in the embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0038] The terms "first" and "second," etc., in the specification and drawings of this application are used to distinguish different objects, rather than to describe a specific order of objects. For example, "first storage node" and "second storage node," etc., are used to distinguish different storage nodes, rather than to describe a specific order of storage nodes.
[0039] Furthermore, the terms “comprising” and “having”, and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0040] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0041] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0042] The following explains some concepts involved in a data migration method, apparatus, electronic device, and storage medium provided in the embodiments of this application.
[0043] Ceph is a distributed storage system that provides users with distributed object, file, and block storage services for big data and cloud computing.
[0044] Cephfs: Ceph provides a higher-level application for distributed file systems. User file data is stored in data pools, and a file system can have multiple data pools.
[0045] MDS: A service in Cephfs used to manage file system metadata.
[0046] As described in the background art, due to the large amount of data involved in data migration processes in related technologies, the workload for relevant personnel during manual data migration is substantial, which may lead to errors in data migration and affect its accuracy and effectiveness. Therefore, this application provides a data migration method, apparatus, electronic device, and storage medium. The electronic device can first effectively determine multiple data items requiring migration based on a set of data objects, then retrieve these multiple data items from a first storage node in a first data pool, then determine a second storage node in a second data pool, and store the multiple data items in the second storage node. This effectively and accurately migrates the multiple data items from the first data pool to the second data pool, improving the accuracy and efficiency of data migration.
[0047] For example, the electronic device can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device. This application does not impose special limitations on the specific form of the electronic device. It can interact with the user through one or more methods such as a keyboard, touchpad, touchscreen, remote control, voice interaction, or handwriting device.
[0048] Optionally, the electronic device can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network (CDN) acceleration services, as well as big data and artificial intelligence platforms.
[0049] like Figure 1 As shown, the data migration method provided in this application embodiment may include S101-S103.
[0050] S101, The electronic device acquires multiple data.
[0051] The multiple data are data included in the first storage node, which is a storage node included in the first data pool.
[0052] In one implementation of this application, during the cluster service process, there are often old servers that need to be decommissioned for maintenance. When a storage node where a data pool is located needs to be decommissioned, the data in the data pool needs to be migrated to another data pool.
[0053] Based on the above embodiments, it can be understood that the first data pool is an old data pool (i.e., a data pool in which data needs to be migrated to another data pool).
[0054] Optionally, the electronic device can determine a placement group (PG), which is a collection of data objects that need to be migrated. The electronic device can determine multiple data fragments corresponding to the object list included in the PG, and then the electronic device performs a data fragment search based on the PG to obtain the data included in the multiple data fragments.
[0055] Optionally, the electronic device can retrieve the multiple data according to the retrieval method corresponding to the storage engine storing the multiple data.
[0056] For example, the storage engine can be a filestore storage engine, which corresponds to a file in the local file system xfs. Therefore, the content obtained by the electronic device is the data read from the xfs file.
[0057] S102, The electronic device determines the second storage node.
[0058] The second storage node is a storage node included in the second data pool.
[0059] It is understood that the second storage node is a storage node in the second data pool used to store the data included in the first storage node.
[0060] Based on the above embodiments, it can be understood that the second data pool is a new data pool, and the data in the old data pool needs to be migrated to the new data pool, that is, the data in the storage nodes included in the first data pool needs to be migrated to the second data pool.
[0061] In some embodiments, combined with Figure 1 ,like Figure 2 As shown, the determination of the second storage node can specifically include S1021-S1023.
[0062] S1021, The electronic device determines the first identifier and the second identifier.
[0063] Wherein, the first identifier is the identifier of the first storage node, and the second identifier is the identifier of the second data pool.
[0064] In one implementation of this application, the electronic device can determine the identifier of the first storage node that needs to be migrated in the first data pool, and the identifier of the second data pool.
[0065] S1022, The electronic device performs a preset algorithm operation on the second identifier and the third identifier to obtain the target identifier.
[0066] The third identifier is obtained by performing a hash mapping operation on the first identifier.
[0067] It is understandable that the electronic device first performs a hash mapping operation on the first identifier to obtain the third identifier, and then performs a preset algorithm operation on the second identifier and the third identifier to obtain the target identifier.
[0068] For example, the preset algorithm operation can be the crush algorithm.
[0069] S1023. The electronic device determines the storage node corresponding to the target identifier as the second storage node.
[0070] In one implementation of this application, the electronic device can determine the second storage node and at least one replica node of the second storage node based on the target identifier. When the second storage node is abnormal, the at least one replica node can be used to replace the second storage node.
[0071] In this embodiment of the application, the electronic device can determine the first identifier and the second identifier, perform a hash mapping operation on the first identifier to obtain the third identifier, and then perform a preset algorithm operation on the second identifier and the third identifier to obtain the target identifier accurately and conveniently.
[0072] S103, The electronic device stores multiple data to a second storage node so that multiple data are migrated from the first data pool to the second data pool.
[0073] Based on the above embodiments, it can be understood that the electronic device can store the multiple data in the second storage node and at least one replica node of the second storage node to avoid data loss when the second storage node is abnormal.
[0074] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As shown in S101-S103, the electronic device first obtains multiple data included in the first storage structure that needs to be migrated in the first data pool, and then determines the second storage structure in the second data pool. At this time, the electronic device stores the multiple data into the second storage node, so that the multiple data are migrated from the first data pool to the second data pool. In this embodiment, the electronic device can first effectively determine the multiple data that need to be migrated based on the data object set, then obtain the multiple data from the first storage node in the first data pool, then determine the second storage node in the second data pool, and store the multiple data into the second storage node, thereby effectively and accurately realizing the migration of the multiple data from the first data pool to the second data pool, improving the accuracy and efficiency of data migration.
[0075] In one implementation of this application, the electronic device can construct the first data pool and the second data pool into a target cache structure, where the first data pool is the cache layer and the second data pool is the base layer. Within the cache structure, multiple storage nodes in the first data pool copy data from the first data pool to the second data pool by means of a brush.
[0076] Specifically, the electronic device can send a cache structure construction instruction to the master monitor node included in the monitor cluster. The cache structure construction instruction includes the first data pool and the second data pool. At this time, the master monitor and the slave monitor included in the monitor cluster will send the cache structure construction instruction to multiple storage nodes included in the first data pool and multiple storage nodes included in the second data pool, so that the first data pool and the second data pool are constructed as the target cache structure, and the target cache structure migrates data from the first data pool to the second data pool.
[0077] The following example illustrates the process of constructing the target cache structure in an embodiment of this application.
[0078] For example, such as Figure 3As shown, firstly, a cache structure construction instruction is sent to the monitoring cluster. Then, the master monitor synchronizes the cache structure construction instruction to the slave monitors. The monitoring cluster then sends the cache structure construction instruction to multiple storage nodes included in the first data pool and multiple storage nodes included in the second data pool, thereby enabling the first data pool and the second data pool to be constructed as target cache structures, so that the first data pool can be aware of the second data pool and migrate data from the first data pool to the second data pool.
[0079] The following example illustrates the data migration process of the target cache structure in this application embodiment.
[0080] For example, such as Figure 4 As shown, within the target cache structure, data is copied from the first data pool to the second data pool via a refresh. Simultaneously, the business service can continue to read and write the / data subtree data distributed in the first data pool without being aware of it. If the data requested in a read / write request is no longer in the first data pool, the read / write request can be proxied (or forwarded) to the second data pool for processing.
[0081] In one implementation of this application, file data in Cephfs is fragmented in 4MB units and distributed across multiple storage nodes included in the first data pool.
[0082] The following example illustrates the specific process of data migration from the first data pool to the second data pool in an embodiment of this application.
[0083] For example, such as Figure 5 As shown, firstly, the data fragments to be acquired (i.e., fragment 1 and fragment 4) are determined based on the PG set and the data lookup module. File data in Cephfs is fragmented in 4MB units and distributed across multiple storage nodes in the first data pool. Fragment 1 and fragment 4 are both located in the first storage node of the first data pool. After acquiring the data in fragment 1 and fragment 4, the data positioning module locates the second storage node (including one primary storage node and two secondary storage nodes) in the second data pool. Then, the acquired data is stored in the primary storage structure, and a replica is synchronized to the secondary storage structure through the primary storage structure.
[0084] Combination Figure 1 ,like Figure 6 As shown, the data migration method in this application embodiment may further include S104.
[0085] S104. If multiple data are successfully stored to the second storage node, the electronic device deletes the first storage node from the first data pool.
[0086] It should be understood that if multiple data are successfully stored in the second storage node, it means that the multiple data have been successfully migrated from the first data pool to the second data pool. At this time, the electronic device can effectively delete the first storage node from the first data pool, so as to accurately and effectively delete the successfully migrated data from the first data pool.
[0087] The following example illustrates the process of deleting the first storage node from the first data pool in an embodiment of this application.
[0088] For example, such as Figure 7 As shown, when the data in shard 1 is successfully stored to the primary storage node and secondary storage node of the second data pool through a write request, the second data pool sends a storage completion response to the first data pool. After receiving the storage completion response, the first data pool performs an eviction callback (i.e. deletion), that is, deletes shard 1 from the first data pool to complete the data eviction. In this way, after the data shards are migrated, the first data pool is cleaned up.
[0089] Combination Figure 1 ,like Figure 8 As shown, the data migration method in this application embodiment may further include S105-S108.
[0090] S105. The electronic device receives a data reading request from the target user.
[0091] The data read request is used to request the reading of target data from the first storage node, where the target data is one of the multiple data sets.
[0092] Understandably, after the migrated data is deleted from the first data pool, in order not to affect the relevant operations on the user's end, the target user's request will continue to be sent to the first data pool.
[0093] S106. The electronic device determines whether a first storage node exists in the first data pool.
[0094] In one implementation of this application, during the data migration process, the target user sends a data read request. At this time, the electronic device can first determine whether the storage node (i.e., the first storage node) required by the target user's request exists in the first data pool.
[0095] S107. If the first storage node does not exist in the first data pool, the electronic device determines whether the second storage node exists in the second data pool.
[0096] It should be understood that if the first storage node is not present in the first data pool, it means that the first storage node may have been successfully migrated to the second data pool. In this case, the electronic device can determine whether the second storage node exists in the second data pool.
[0097] It is understandable that the data stored in the second storage node is data migrated from the first storage node, that is, the second storage node is the same as the first storage node.
[0098] S108. If a second storage node exists in the second data pool, the electronic device sends target data to the target user based on the multiple data included in the second storage node.
[0099] It should be understood that if the second storage node exists in the second data pool, it means that the data in the first storage node has been successfully stored in the second storage node. At this time, the electronic device can send target data to the target user based on the multiple data included in the second storage node.
[0100] In this embodiment, after the migrated data is deleted from the first data pool, in order not to affect the user's related operations, the target user's request will continue to be sent to the first data pool. After receiving the target user's data read request, the electronic device first determines whether the first storage node exists in the first data pool. If the first storage node does not exist in the first data pool, it means that the first storage node may have been successfully migrated to the second data pool. At this time, the electronic device can determine whether the second storage node exists in the second data pool. If the second storage node exists in the second data pool, it means that the data in the first storage node has been successfully stored in the second storage node. At this time, the electronic device can accurately and effectively send the target data to the target user based on the multiple data included in the second storage node, thereby realizing data migration without the target user's awareness and improving the user experience.
[0101] The following example illustrates the process of handling the data reading request of the target user in an embodiment of this application.
[0102] For example, such as Figure 9 As shown, when the user read request 1 is received, the system searches for the corresponding shard 2 in the first data pool and returns the data in shard 2 to the user. When the user read request 2 is received, the system searches for the corresponding shard 4 in the first data pool. At this time, it is found that shard 4 has been evicted from the first data pool. The system then forwards the user read request 2 to the second data pool, searches for shard 4 in the second data pool, and returns the data in shard 4 to the user.
[0103] In one implementation of this application embodiment, when the request sent by the target user is a data write request (i.e., a data storage request), in order not to affect the relevant operations of the user terminal, the target user's request will continue to be sent to the first data pool. After the electronic device receives the target user's data write request, it first determines whether there is a first storage node in the first data pool. If there is no first storage node in the first data pool, it means that the first storage node may have been successfully migrated to the second data pool. At this time, the electronic device can determine whether there is a second storage node in the second data pool. If there is a second storage node in the second data pool, it means that the data in the first storage node has been successfully stored in the second storage node. At this time, the electronic device can modify the data included in the second storage node based on the target user's data write request. If the first storage node has not been deleted, it means that the data migration of the first storage node has not yet been performed. At this time, the data in the first storage node is modified based on the target user's data write request, and then the modified data is flushed and stored in the second data pool, and the modified data included in the first data pool is evicted.
[0104] The following example illustrates the process of handling data write requests to the target user in an embodiment of this application.
[0105] For example, such as Figure 10 As shown, when user write request 1 is received, the system searches for the shard 2 corresponding to user read request 1 in the first data pool, modifies the data in shard 2 according to user write request 1, and then migrates the modified shard 2 to the second data pool. The modified shard 2 in the first data pool is then evicted. When user write request 2 is received, the system searches for the shard 4 corresponding to user read request 2 in the first data pool. It finds that shard 4 has been evicted from the first data pool, so user write request 2 is forwarded to the second data pool. The system then searches for shard 4 in the second data pool and modifies the data in shard 4 according to user write request 2.
[0106] Combination Figure 1 ,like Figure 11 As shown, the data migration method in this application embodiment may further include S109.
[0107] S109. If all storage nodes included in the first data pool are stored in the second data pool, the electronic device determines the second data pool as the target data pool.
[0108] The target data pool is a data pool for the target user to perform preset operations, including data reading and data storage.
[0109] It is understandable that this target data pool is the data pool from which users send requests after the data migration.
[0110] It should be understood that when multiple storage nodes included in the first data pool are all stored in the second data pool, it means that all the data included in the first data pool has been migrated to the second data pool. At this time, the electronic device can accurately and effectively identify the second data pool as the target data pool, thereby enabling accurate and effective data migration without the user's awareness.
[0111] In one implementation of this application, after all the data in the first data pool has been flushed and evicted, that is, the first data pool has been cleared, it is necessary to switch the pool distribution of the directory subtree, that is, change the first data pool to the second data pool. This is achieved by updating the topology of the storage nodes and synchronizing the metadata.
[0112] The following example illustrates the process of migrating a data pool in an embodiment of this application.
[0113] For example, such as Figure 12 As shown, when the first data pool has been cleared, the data pool migration is carried out. First, the storage nodes are updated based on the monitor cluster. Then, the pool distribution of the directory subtree is switched, that is, the second data pool is determined as the target data pool. At this time, the second data pool will replace the first data pool. Then, the index nodes are updated to the user terminal so that the user terminal switches its read and write requests from the first data pool to the second data pool, thereby completing the data pool migration.
[0114] This application embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0115] When dividing each function into modules according to its corresponding function. Figure 13 A possible structural schematic diagram of the data migration apparatus involved in the above embodiments is shown, such as... Figure 13 As shown, the data migration device 10 may include: an acquisition module 101, a determination module 102, and a storage module 103.
[0116] The acquisition module 101 is used to acquire multiple data, which are data included in the first storage node, and the first storage node is a storage node included in the first data pool.
[0117] The determination module 102 is used to determine the second storage node, which is a storage node included in the second data pool.
[0118] Storage module 103 is used to store the multiple data to the second storage node so that the multiple data are migrated from the first data pool to the second data pool.
[0119] Optionally, the data migration device 10 further includes a processing module 104.
[0120] The determination module 102 is also used to determine a first identifier and a second identifier, wherein the first identifier is the identifier of the first storage node and the second identifier is the identifier of the second data pool.
[0121] The processing module 104 is used to perform a preset algorithm operation on the second identifier and the third identifier to obtain a target identifier, wherein the third identifier is obtained by performing a hash mapping operation on the first identifier.
[0122] The determination module 102 is also used to determine the storage node corresponding to the target identifier as the second storage node.
[0123] Optionally, the data migration device 10 further includes a processing module 104.
[0124] The processing module 104 is used to delete the first storage node from the first data pool when the multiple data are successfully stored to the second storage node.
[0125] Optionally, the data migration device 10 further includes a receiving module 105 and a sending module 106.
[0126] The receiving module 105 is used to receive a data read request from a target user. The data read request is used to request to read target data from the first storage node. The target data is one of the multiple data.
[0127] The determination module 102 is also used to determine whether the first storage node exists in the first data pool.
[0128] The determining module 102 is further configured to determine whether the second storage node exists in the second data pool if the first storage node does not exist in the first data pool.
[0129] The sending module 106 is used to send the target data to the target user based on the plurality of data included in the second storage node when the second storage node exists in the second data pool.
[0130] Optionally, the determining module 102 is further configured to determine the second data pool as the target data pool when all the storage nodes included in the first data pool are stored in the second data pool. The target data pool is the data pool for the target user to perform preset operations, including data reading and data storage.
[0131] When using integrated units, Figure 14 A possible structural diagram of the data migration apparatus involved in the above embodiments is shown. For example... Figure 14 As shown, the data migration device 20 may include a processing module 201 and a communication module 202. The processing module 201 can be used to control and manage the operation of the data migration device 20. The communication module 202 can be used to support communication between the data migration device 20 and other entities. Optionally, as... Figure 14 As shown, the data migration device 20 may also include a storage module 203 for storing the program code and data of the data migration device 20.
[0132] The processing module 201 can be a processor or a controller. The communication module 202 can be a transceiver, transceiver circuit, or communication interface, etc. The storage module 203 can be a memory.
[0133] In this configuration, when the processing module 201 is a processor, the communication module 202 is a transceiver, and the storage module 203 is a memory, the processor, transceiver, and memory can be connected via a bus. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc.
[0134] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0135] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0136] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0138] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0139] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data migration method, characterized in that, The method includes: Acquire multiple data, wherein the multiple data are data included in the first storage node, and the first storage node is a storage node included in the first data pool; The first data pool and the second data pool are constructed into a target cache structure, with the first data pool as the cache layer and the second data pool as the base layer; a second storage node is determined, which is the storage node included in the second data pool; Storing the plurality of data to the second storage node so that the plurality of data are migrated from the first data pool to the second data pool includes: migrating data from the plurality of storage nodes in the first data pool to the second data pool in the target cache structure by means of flushing down; The determination of the second storage node includes: A first identifier and a second identifier are determined, wherein the first identifier is the identifier of the first storage node, and the second identifier is the identifier of the second data pool; The second identifier and the third identifier are subjected to a preset algorithm operation to obtain the target identifier, wherein the third identifier is obtained by performing a hash mapping operation on the first identifier; The storage node corresponding to the target identifier is determined as the second storage node.
2. The data migration method according to claim 1, characterized in that, The method further includes: If the multiple data are successfully stored to the second storage node, the first storage node is deleted from the first data pool.
3. The data migration method according to claim 1, characterized in that, The method further includes: Receive a data read request from a target user, the data read request being used to request the reading of target data from the first storage node, the target data being one of the plurality of data; Determine whether the first storage node exists in the first data pool; If the first storage node is not present in the first data pool, determine whether the second storage node exists in the second data pool; If the second storage node exists in the second data pool, the target data is sent to the target user based on the plurality of data included in the second storage node.
4. The data migration method according to any one of claims 1-3, characterized in that, The method further includes: When multiple storage nodes included in the first data pool are all stored in the second data pool, the second data pool is determined as the target data pool. The target data pool is the data pool for the target user to perform preset operations, including data reading and data storage.
5. A data migration device, characterized in that, include: Acquisition module, determination module, and storage module; The acquisition module is used to acquire multiple data, which are data included in the first storage node, and the first storage node is a storage node included in the first data pool; The determining module is used to construct a target cache structure from the first data pool and the second data pool, wherein the first data pool is the cache layer and the second data pool is the base layer. Determine the second storage node, which is a storage node included in the second data pool; The storage module is used to store the plurality of data to the second storage node so that the plurality of data are migrated from the first data pool to the second data pool, including: migrating data from the plurality of storage nodes in the first data pool to the second data pool in the target cache structure by means of flushing down; The data migration device also includes a processing module; The determining module is further configured to determine a first identifier and a second identifier, wherein the first identifier is the identifier of the first storage node and the second identifier is the identifier of the second data pool; The processing module is used to perform a preset algorithm operation on the second identifier and the third identifier to obtain a target identifier, wherein the third identifier is obtained by performing a hash mapping operation on the first identifier; The determining module is further configured to determine the storage node corresponding to the target identifier as the second storage node.
6. The data migration apparatus according to claim 5, characterized in that, The data migration device also includes a processing module; The processing module is configured to delete the first storage node from the first data pool when the plurality of data are successfully stored to the second storage node.
7. The data migration apparatus according to claim 5, characterized in that, The data migration device further includes a receiving module and a sending module; The receiving module is used to receive a data reading request from a target user. The data reading request is used to request the reading of target data from the first storage node. The target data is one of the plurality of data. The determining module is further configured to determine whether the first storage node exists in the first data pool; The determining module is further configured to determine whether the second storage node exists in the second data pool if the first storage node does not exist in the first data pool. The sending module is used to send the target data to the target user based on the plurality of data included in the second storage node when the second storage node exists in the second data pool.
8. The data migration apparatus according to any one of claims 5-7, characterized in that... The determining module is further configured to determine the second data pool as the target data pool when multiple storage nodes included in the first data pool are all stored in the second data pool. The target data pool is the data pool in which the target user performs preset operations, including data reading and data storage.
9. An electronic device, characterized in that, The electronic device includes: processor; A memory configured to store processor-executable instructions; The processor is configured to execute the instructions to implement the data migration method as described in any one of claims 1-4.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is able to perform the data migration method as described in any one of claims 1-4.
Citation Information
Patent Citations
Data migration method and unified coordination system
CN115460230A
Data migration method and device, storage medium and electronic equipment
CN116719482A
