Data migration method and device, terminal equipment and storage medium

By creating copy bitmaps and difference bitmaps, the data migration process is dynamically monitored, solving the problem of inaccessible migration data in traditional data migration solutions. This enables users to access and modify data during the migration process, improving work efficiency and the reliability of data migration.

CN122018801APending Publication Date: 2026-05-12SUGON INFORMATION IND +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUGON INFORMATION IND
Filing Date
2026-01-28
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Traditional data migration solutions cannot access or modify the migrated data when the amount of data to be migrated is large, which affects the user's work efficiency.

Method used

By creating a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume, the data migration process is dynamically monitored, allowing users to issue IO services during the migration process and execute IO operations based on the bitmap results.

Benefits of technology

This allows users to access and modify migrated data during the data migration process, improving work efficiency and ensuring the reliability and consistency of data migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018801A_ABST
    Figure CN122018801A_ABST
Patent Text Reader

Abstract

The invention discloses a data migration method and device, terminal equipment and a storage medium, and belongs to the field of centralized storage, the method comprises the following steps: in response to a copy IO issued by a user, migrating data to be migrated from a source volume to a target volume, and creating a copy bitmap, a first difference bitmap of the source volume and a second difference bitmap of the target volume; and in the migration process, receiving an IO service issued by a user, performing marking judgment on a target volume based on the IO service, the copy bitmap or the second difference bitmap, and performing IO service execution on the target volume according to a judgment result. Therefore, by implementing the data migration method and device, the problem that a user cannot access migrated data in a traditional data migration scheme can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of centralized storage, and more particularly to a data migration method, apparatus, terminal equipment, and storage medium. Background Technology

[0002] Centralized storage is an architecture that centrally manages data storage resources, with all data stored on a single storage device or system. It offers efficient data management, ease of maintenance and expansion, and centralized data protection and backup capabilities. Current technologies commonly use centralized storage for data migration processes such as replication and cloning.

[0003] Traditional data migration solutions copy data from a source volume to a target volume. However, to ensure data consistency between the source and target volumes during the copy process, hosts are typically not allowed to be mounted on either volume, and hosts cannot issue I / O requests to the target volume. This prevents data from being modified during the copy process and avoids inconsistencies. Because traditional solutions prevent access to or modification of the migrated data during migration, users must wait for the migration to complete before accessing the data and commencing subsequent work, especially with large volumes of data. This impacts user efficiency. Therefore, traditional data migration solutions suffer from the problem of users being unable to access data during migration. Summary of the Invention

[0004] This invention provides a data migration method, apparatus, terminal device, and storage medium, which can solve the problem that users cannot access the data during migration in traditional data migration solutions.

[0005] The data migration method provided by this invention includes: In response to the copy I / O issued by the user, the data to be migrated is migrated from the source volume to the target volume, and a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume are created; During the migration process, the system receives IO services from the user, and determines the target volume by marking it based on the IO services, the copy bitmap, or the second difference bitmap. Based on the determination result, the system executes IO services on the target volume.

[0006] By implementing this embodiment, the following beneficial effects are achieved: This embodiment discloses a data migration method. Upon receiving a copy IO, the data to be migrated is migrated from the source volume to the target volume, and a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume are created to clarify the data migration status during the data migration process. During the data migration process, users can issue IO services to perform data operations on the target volume. Based on the first difference bitmap, the second difference bitmap, and the copy bitmap, users can clearly understand the migration status between the data stored in the source volume and the data stored in the target volume, thereby ensuring the reliability of the data migration. Therefore, compared with the prior art, which requires waiting for the data to be completely migrated before issuing IO services, this embodiment not only allows users to access the data during migration but also to modify and copy the migrated data, greatly improving the user's work efficiency during data migration.

[0007] Further, the response to the copy command, the response to the copy I / O issued by the user, migrates the data to be migrated from the source volume to the target volume, and creates a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume, including: When copy IO is a full data copy instruction, all data in the source volume is treated as the data to be migrated. The data to be migrated is written from the source volume to the target volume. During the writing process, a first difference bitmap of the source volume and a second difference bitmap of the target volume are created. Based on the storage capacity of the source volume, a copy bitmap is determined; wherein the markers of the copy bitmap include: copy markers and uncopy markers.

[0008] By implementing this embodiment, the following beneficial effects are achieved: by responding to the full data copy command, all data of the source volume is automatically migrated to the target volume, and during the migration process, a first difference bitmap of the source volume and a second difference bitmap of the target volume that record data changes are created synchronously. At the same time, a copy bitmap marking the migrated / unmigrated status is dynamically generated according to the storage capacity of the source volume, thereby realizing real-time capture and accurate tracking of incremental data during the migration process.

[0009] Furthermore, the step of responding to the user-issued copy I / O to migrate the data to be migrated from the source volume to the target volume, and creating a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume, further includes: When copy IO is an incremental data copy instruction, after the full data copy instruction is executed on the source volume and the target volume, the difference data in the source volume that is different from the target volume is taken as the data to be migrated. The data to be migrated is written from the source volume to the target volume. During the writing process, the first difference bitmap of the source volume after the full data copy instruction is executed and the second difference bitmap of the target volume are created. Based on the current first and second difference bitmaps, a copy bitmap is constructed; wherein, the markers of the copy bitmap include: copy markers and uncopy markers.

[0010] By implementing this embodiment, the following beneficial effects are achieved: After the full data migration is completed, the difference data between the source volume and the target volume is dynamically captured by responding to the incremental copy command, and only the changed parts are migrated to the target volume. At the same time, during the incremental migration process, the updated first difference bitmap of the source volume and the second difference bitmap of the target volume are created in real time, and a dynamic copy bitmap marking the migrated / uncopyed status is intelligently constructed based on the latest dual difference bitmap, thereby realizing accurate identification and efficient synchronization of incremental data.

[0011] Furthermore, the acquisition of the difference bitmap includes: For each location of data in the source volume, a write check is performed: if the current data has not been written, the bitmap is marked as not written; if the current data has been written, the bitmap is marked as written. Based on the bitmap markers at each location of the source volume, determine the first difference bitmap of the source volume; For each location of data in the target volume, a write check is performed: if the current data has not been written, the bitmap is marked as not written; if the current data has been written, the bitmap is marked as written. The second difference bitmap of the target volume is determined based on the bitmap markers at each location of the target volume.

[0012] By implementing this embodiment, the following beneficial effects are achieved: by monitoring the write status of each data location in the source volume and the target volume in real time, a first difference bitmap and a second difference bitmap marked with "not written" or "written" status are dynamically generated, realizing millisecond-level accurate capture of data change behavior, and a real-time difference view can be built without full volume scanning.

[0013] Further, the IO services include: copy IO, write IO, and copy IO; the determination to mark the target volume based on the IO services, the copy bitmap, or the second difference bitmap, and the execution of IO services on the target volume according to the determination result, includes: Make judgments on IO operations; If the IO service is write IO, then the current second difference bitmap is marked to determine the data, and the target volume is written according to the determination result. If the IO service is read IO, then the marking is determined based on the current second difference bitmap and the current copy bitmap, and the data reading operation is performed on the target volume according to the determination result; Otherwise, based on the judgment made by the current copy IO according to the current second difference bitmap, the data copy operation is performed on the target volume according to the judgment result.

[0014] Implementing this embodiment yields the following beneficial effects: By dynamically associating IO service types with bitmap states (second difference bitmap and copy bitmap), intelligent collaborative processing of write IO, read IO, and copy IO is achieved: When performing write IO, the target volume write path is determined based on the state marked by the second difference bitmap, avoiding data conflicts during migration; when processing read IO, the second difference bitmap and copy bitmap are used for dual verification, automatically routing to the latest data copy to ensure read consistency; when performing copy IO, incremental synchronization is achieved by accurately locating difference blocks based on the second difference bitmap.

[0015] Furthermore, the data write operation includes: Based on the current second difference bitmap, determine the markings at each position of the target volume; If a write flag exists, data is written to the current position according to the write content entered by the user in the write IO. If no write marker exists, the target volume is written to the current position based on the write content entered by the user in the write IO, and a write marker is added after writing to the current position to update the second difference bitmap of the target volume.

[0016] Implementing this embodiment yields the following beneficial effects: During data writing, duplicate operations are intelligently intercepted using a difference bitmap. If a write marker already exists at the target location (indicating the data is up-to-date), the system directly reads the content without overwriting, avoiding data conflicts. If no marker is found, new user data is safely written, and the marker is updated in real time. This mechanism completely eliminates redundant writes during migration, ensuring real-time accuracy of business data.

[0017] Furthermore, the data reading operation includes: Based on the current second difference bitmap and copy bitmap, determine the markings at each location of the target volume; If the difference bitmap at the current location does not have a write mark and the copy bitmap does not have a copy mark, then read the content at the current location of the source volume; Otherwise, read the data at the current location of the target volume.

[0018] Implementing this embodiment yields the following beneficial effects: When reading data, the read path is determined using a difference bitmap and a copy bitmap: if the target volume data has no write or copy markers, then the target volume data has not been modified and migration is incomplete, and the original data is read from the source volume; otherwise, the latest data from the target volume is read directly. This embodiment can completely avoid reading incomplete or expired data during migration, ensuring that business access always obtains the accurate version.

[0019] Furthermore, the data copy operation includes: Based on the current second difference bitmap, determine the markings at each position of the target volume; If a write flag exists, no data will be written to the target volume, and the data copy operation will be stopped. If no write flag exists, the target volume is written to the current position based on the copy content selected by the user in the copy IO, and a copy flag is added after writing to the current position to update the second difference bitmap of the target volume.

[0020] By implementing this embodiment, the following beneficial effects are achieved: An interception mechanism is introduced into the data copy operation: if a write marker already exists at the target location, indicating the presence of newer business data, the copy is immediately terminated to prevent overwriting; the user-specified copy content is only executed securely when no write marker is present, and the marker is automatically updated upon completion. This embodiment enables conflict-free collaborative operation between business operations and background migration.

[0021] Another embodiment of the present invention provides a data migration apparatus, including: a data response module and an IO service execution module; The data response module is used to respond to the copy I / O issued by the user, migrate the data to be migrated from the source volume to the target volume, and create a copy bitmap, a first difference bitmap of the source volume and a second difference bitmap of the target volume; The IO service execution module is used to receive IO services issued by the user during the migration process, determine the target volume based on the IO services, the copy bitmap or the second difference bitmap, and execute IO services on the target volume according to the determination result.

[0022] Another embodiment of the present invention provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the steps of the data migration method provided by the present invention.

[0023] Another embodiment of the present invention provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform steps of the data migration method provided by the present invention. Attached Figure Description

[0024] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0025] Figure 1 This is a flowchart illustrating a data migration method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a data migration device provided in an embodiment of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0028] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0029] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0030] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0031] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0032] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0033] Example 1 See Figure 1 To address the problem of users being unable to access data during migration in traditional data migration solutions, an embodiment of the present invention provides a data migration method, comprising: 101. Respond to the copy IO issued by the user, migrate the data to be migrated from the source volume to the target volume, and create a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume.

[0034] In one specific embodiment, during the migration process, a copy relationship is established between the source volume LUNA and the target volume LUNB: a data structure (copy_pair) is used to record the basic information of the source volume LUNA and the target volume LUNB. The basic attributes of LUNA and LUNB—id, type, size, copy status, bitmap information, and copy progress—are all recorded in the copy_pair. Furthermore, the type and size of the source volume LUNA and the target volume LUNB must be consistent. One copy_pair corresponds to only one copy bitmap.

[0035] In this embodiment, the step of responding to the copy I / O issued by the user to migrate the data to be migrated from the source volume to the target volume, and creating a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume, includes: When copy IO is a full data copy instruction, all data in the source volume is treated as the data to be migrated. The data to be migrated is written from the source volume to the target volume. During the writing process, a first difference bitmap of the source volume and a second difference bitmap of the target volume are created. Based on the storage capacity of the source volume, a copy bitmap is determined; wherein the markers of the copy bitmap include: copy markers and uncopy markers.

[0036] It should be noted that when responding to a full data copy command, the system simultaneously executes a dual-track difference bitmap dynamic construction mechanism while writing all data from the source volume to the target volume as the objects to be migrated. In the initial stage, a first difference bitmap (source volume) with all "unwritten marks" and a second difference bitmap (target volume) with all empty marks are immediately generated based on the storage capacity of the source volume. Real-time status tracking is implemented during the migration process. When any location on the source volume is newly written with data by the business system during the migration, the corresponding location on the first difference bitmap is immediately updated to a "written mark", accurately capturing incremental changes on the source side during the full migration process. At the same time, for each data block successfully written to the target volume, the corresponding location on the second difference bitmap is marked as a "written mark", forming a migration progress map on the target side.

[0037] In this embodiment, the step of responding to the user-issued copy I / O to migrate the data to be migrated from the source volume to the target volume, and creating a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume, further includes: When copy IO is an incremental data copy instruction, after the full data copy instruction is executed on the source volume and the target volume, the difference data in the source volume that is different from the target volume is taken as the data to be migrated. The data to be migrated is written from the source volume to the target volume. During the writing process, the first difference bitmap of the source volume after the full data copy instruction is executed and the second difference bitmap of the target volume are created. Based on the current first and second difference bitmaps, a copy bitmap is constructed; wherein, the markers of the copy bitmap include: copy markers and uncopy markers.

[0038] It should be noted that when responding to incremental data copy commands, the system uses a dual-bitmap differential engine to accurately locate the data to be migrated, based on the first difference bitmap of the source volume (recording new business writes after full migration) and the second difference bitmap of the target volume (recording the current data completeness status). The system compares the "write mark" (identifying changed blocks after full migration) of the source volume bitmap with the "unwritten mark" (identifying unupdated areas) of the target volume bitmap position by position. If and only if there is a write mark at the current position of the source volume and the corresponding position of the target volume is unwritten, differential data migration is triggered—the incremental data at that position of the source volume is written to the target volume, and the write mark is immediately updated in the second difference bitmap of the target volume after completion. If the bitmap status does not meet this condition (such as the target volume has been updated or the source volume has not been changed), the writing is automatically skipped.

[0039] In a specific embodiment, the execution of incremental data copy instructions can only occur after the execution of full data copy instructions. Example: When a full data copy instruction is executed at time T1, a full copy is performed. Between times T1 and T2, the host modifies the data on the source volume LUNA. Then, at time T2, incremental data copy instructions are executed, and the data is copied incrementally to the target volume LUNB as a difference.

[0040] Preferably, the present invention further includes: reverse copy: reverse copying starts at time T3, and reverse copying can only be performed after a full copy has been performed; after a full copy or incremental copy is completed at time T2, there is an option to copy all the data of the target volume LUNB to the source volume LUNA, and then reverse copying can be performed; during reverse copying, the target volume LUNB is equivalent to the source, and a snapshot needs to be created, and the rest is the same as forward copying (full copy and incremental copy).

[0041] In a specific embodiment, a snapshot (a. Snap-LUN) is as follows: Assuming that copying starts at time T1, the expected outcome is to copy the data on the source volume LUNA at time T1 to the target volume LUNB. Therefore, a snapshot Snap-LUNA is taken on LUNA at time T1, and then snap-LUNA is the data on the source LUNA at time T1.

[0042] In this embodiment, obtaining the difference bitmap includes: For each location of data in the source volume, a write check is performed: if the current data has not been written, the bitmap is marked as not written; if the current data has been written, the bitmap is marked as written. Based on the bitmap markers at each location of the source volume, determine the first difference bitmap of the source volume; For each location of data in the target volume, a write check is performed: if the current data has not been written, the bitmap is marked as not written; if the current data has been written, the bitmap is marked as written. The second difference bitmap of the target volume is determined based on the bitmap markers at each location of the target volume.

[0043] In one specific embodiment, the difference bitmap is created when copying begins, with one created for the source and one for the target. After copying begins at time T1, both the source LUNA and the target LUNB can read and write data. Therefore, the difference bitmap records the new difference data sent by the host to the source and target after copying begins at time T1.

[0044] It should be noted that the construction of the first difference bitmap of the source volume is as follows: For each data block (such as a logical sector) of the source volume, a millisecond-level write status scan is performed. If the data at that location has not been modified by the business or migration process (such as the original block after the initial full copy), it is marked as unwritten (such as binary "0"); if any write operation is detected (including new data writes from the business system during the migration), it is marked as written (such as "1"). This generates the first difference bitmap that reflects the real-time data activity of the source volume. The second difference bitmap of the target volume is generated synchronously. Specifically, each data block of the target volume is independently diagnosed. If the location data has not been overwritten (such as an empty block that has not been migrated), the marker is not written; if it has been written by the business or filled by the migration program, the marker is written, forming a data integrity map of the target end. The first and second difference bitmaps are generated independently but logically interlocked. During incremental synchronization, by comparing the source volume's "write mark" (changed block) with the target volume's "not written mark" (area to be updated) bit by bit, the amount of invalid data transmission can be reduced.

[0045] In one specific embodiment, the acquisition of the copied bitmap is specifically as follows: If it is a full data copy instruction, the copy bitmap will generate a bitmap based on the size of the source volume LUNA, and the copy bitmap will be generated with a granularity of 1 bit = 1M. For incremental data copy instructions: The copy bitmap is generated by merging the difference bitmaps of the source volume and the target volume. A full copy begins at time T1. At the start, both the source and target volumes create a difference bitmap, each recording the differences in write I / O issued by the host. After the full copy is completed, when incremental copy begins at time T2, these two difference bitmaps are merged into a single copy bitmap, which is then used to copy data during the incremental copy process.

[0046] It's important to note that when generating the copy bitmap, the system intelligently selects a generation strategy through an instruction type adaptive mechanism: When a full data copy instruction is detected, the copy bitmap is initialized directly based on the source volume's storage capacity (such as the total number of disk sectors or the logical block address range), with all positions preset as "uncopyable markers." During the migration process, successfully written positions are dynamically updated to "copy markers," forming a global migration progress map. When the instruction is an incremental data copy, the system analyzes the first difference bitmap of the source volume (recording data changes at the source) and the second difference bitmap of the target volume (recording the write status at the target). By comparing the markers of the two (e.g., selecting only positions with write markers on the source volume and no write markers on the target volume), the system accurately locates the difference data blocks that need to be synchronized, generating a lightweight copy bitmap that only covers incremental changes. This mechanism, by dynamically adapting to the migration scenario, completely avoids invalid data scanning and redundant transmission.

[0047] 102. During the migration process, receive IO services issued by the user, and determine the target volume based on the IO services, the copy bitmap, or the second difference bitmap, and execute IO services on the target volume according to the determination result.

[0048] In this embodiment, the IO services include: copy IO, write IO, and copy IO; the determination of marking the target volume based on the IO services, the copy bitmap, or the second difference bitmap, and the execution of IO services on the target volume according to the determination result, includes: Make judgments on IO operations; If the IO service is write IO, then the current second difference bitmap is marked to determine the data, and the target volume is written according to the determination result. If the IO service is read IO, then the marking is determined based on the current second difference bitmap and the current copy bitmap, and the data reading operation is performed on the target volume according to the determination result; Otherwise, based on the judgment made by the current copy IO according to the current second difference bitmap, the data copy operation is performed on the target volume according to the judgment result.

[0049] In this embodiment, the data writing operation includes: Based on the current second difference bitmap, determine the markings at each position of the target volume; If a write flag exists, data is written to the current position according to the write content entered by the user in the write IO. If no write marker exists, the target volume is written to the current position based on the write content entered by the user in the write IO, and a write marker is added after writing to the current position to update the second difference bitmap of the target volume.

[0050] In one specific embodiment, the second difference bitmap of the target volume LUNB is read to determine whether there has been any front-end I / O writes at the current location: 1) If the current position has already been written (a write flag exists): then simply issue a write IO to write the data. 2) The current position has not been written (no write marker exists): Issue a write IO to write the data, and then record the difference of this write in the difference bitmap.

[0051] It's important to note that when responding to write I / O requests, the system intelligently executes write operations through a dynamic difference bitmap verification mechanism: for each target location on the target volume, the system continuously monitors the marker status of the corresponding location in the second difference bitmap. If a write marker already exists at that location (indicating that data has been updated or migrated), the system directly overwrites the user's current write content onto the target volume's current location (regardless of whether the original data has been migrated), ensuring the real-time nature of business instructions. If no write marker is detected (indicating that the data at that location has not changed), the system still executes the user's write operation, but immediately adds a write marker to that location in the second difference bitmap upon completion, dynamically updating the difference status. This mechanism, by capturing and recording every business write action in real time, ensures that the difference bitmap always accurately reflects the latest data status, guaranteeing the absolute priority of business operations (migration processes do not interfere with real-time writes) and providing a reliable basis for subsequent incremental synchronization, completely eliminating the risk of data overwrite conflicts or version inconsistencies.

[0052] In this embodiment, the data reading operation includes: Based on the current second difference bitmap and copy bitmap, determine the markings at each location of the target volume; If the difference bitmap at the current location does not have a write mark and the copy bitmap does not have a copy mark, then read the content at the current location of the source volume; Otherwise, read the data at the current location of the target volume.

[0053] In one specific embodiment, the second difference bitmap of the target volume LUNB is read to determine whether there has been a front-end I / O write at the current location: 1) If the current location has already been written to (a write flag exists): then simply issue an I / O request to read the target volume from the local end. 2) The current position has not been written to (no write marker exists): Read the copy bitmap to determine if the current position has been copied: a) The current location has already been copied (a copy marker exists): Read the target volume I / O on this end; b) No copy at the current location (no copy marker): Send read I / O to the source volume to read the source volume content.

[0054] It's important to note that when responding to read I / O requests, the system dynamically determines the data source through a dual-bitmap collaborative verification mechanism: for each data location on the target volume, it synchronously detects the second difference bitmap (recording the business write status) and the copy bitmap (recording the migration completion status) in real time. If the target volume detects that there is neither a write marker (indicating that the location has not been updated by the business) nor a copy marker (indicating that the location has not been migrated from the source volume), it determines that the target volume data may be outdated or missing. In this case, the system will automatically bypass the target volume and directly read the original data at the current location from the source volume, ensuring that the business obtains the latest valid version. Conversely, if either marker exists (indicating that the data has been updated or migrated), it will directly read from the target volume locally. This mechanism completely eliminates the risk of "dirty reads" caused by data version conflicts during the migration process, while minimizing the latency caused by cross-volume access, enabling the business to always obtain accurate data in a zero-aware migration state, and improving the system's data reading efficiency.

[0055] In this embodiment, the data copying operation includes: Based on the current second difference bitmap, determine the markings at each position of the target volume; If a write flag exists, no data will be written to the target volume, and the data copy operation will be stopped. If no write flag exists, the target volume is written to the current position based on the copy content selected by the user in the copy IO, and a copy flag is added after writing to the current position to update the second difference bitmap of the target volume.

[0056] In one specific embodiment, the second difference bitmap is read to determine whether there has been a front-end I / O write at the current position: 1) The current position has already been written to (write marker exists): Abandon copy I / O; 2) The current position has not been written (no write mark exists): Based on the copy content selected by the user in the copy IO, process the copy IO and record the mark of the copy bitmap as the copy mark.

[0057] It should be noted that during the data copy operation, this embodiment will retrieve the current second difference bitmap of the target volume in real time and check its bitmap marking status bit by bit (e.g., for each logical block address LBA or data block): if it is detected that the current position of the target volume has been marked as "write mark" (usually indicating that the position has been updated by the latest write operation of the business system), this embodiment will immediately pause or terminate the data copy operation for that specific position, thereby strictly avoiding the overwriting of critical new data written by the user or business system by old data during the migration process, ensuring the real-time performance of the data and the continuity of business; conversely, if the current position of the target volume is not marked as "write mark" (indicating that the data at that position has not been updated or is still in the initial migration state), this embodiment will allow the execution of the data overwrite operation specified by the user in this copy IO instruction, writing the selected data content to the corresponding position of the target volume; after the writing is completed, this embodiment will dynamically add or update the "copy mark" to that position in the second difference bitmap to accurately record that the position has been updated by this copy operation, and at the same time provide accurate basis for subsequent possible incremental synchronization or status tracking. This mechanism introduces real-time judgment and dynamic marking updates of the difference bitmap during copy operations, intelligently executing data migration tasks while ensuring the absolute security of critical business data, significantly improving the operational efficiency and data consistency assurance capabilities of the storage system.

[0058] In a specific embodiment, to better illustrate this embodiment, the following case is provided: assuming that both the source volume LUNA and the target volume LUNB are 100g in size: ① First, create a copy_pair; ② LUNA creates a snapshot (snap_LUNA) and a difference bitmap (src_btmp); ③ LUNB creates a difference bitmap dst_btmp; ④ Perform a full copy and create a copy bitmap cpy_btmp: 1) When copying to around 10g, the host writes to the location corresponding to LUNB 50g of the target volume: a. First, it reads the difference bitmap corresponding to LUNB 50g and finds that it has not been modified; b. Then it reads the copy bitmap and finds that the location corresponding to 50g has not been copied; c. It writes directly to LUNB and records the location of LUNB dst_btmp corresponding to 50g to indicate that the target LUNB has been modified; 2) Based on the first step, read the position of LUNB 40g, assuming the copied bitmap has reached 20g: a. Read the target difference bitmap dst_btmp and find that it has not been modified; b. Read the copied bitmap cpy_btmp and find that it has not been modified; c. Then read the position data corresponding to Snap_LUNA 50g of the source LUNB; 3) Based on the first step, copy the I / O processing flow: a. When copying to the 45g location: Read the target's dst_btmp; if the location corresponding to 45g has not been modified, copy it directly to the target volume LUNB. b. When copying to position 50g: Read the target's dst_btmp and find that the position corresponding to 50g has already been written, then the copy I / O is abandoned and the next I / O is started.

[0059] Example 2 like Figure 2 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; One embodiment of the present invention provides a data migration device, including: a data response module 201 and an IO service execution module 202; The data response module is used to respond to the copy I / O issued by the user, migrate the data to be migrated from the source volume to the target volume, and create a copy bitmap, a first difference bitmap of the source volume and a second difference bitmap of the target volume; The IO service execution module is used to receive IO services issued by the user during the migration process, determine the target volume based on the IO services, the copy bitmap or the second difference bitmap, and execute IO services on the target volume according to the determination result.

[0060] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the data migration method provided by any of the above-described method embodiments of the present invention.

[0061] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0062] Based on the above-described embodiments of the data migration method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the data migration method of any embodiment of the present invention.

[0063] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.

[0064] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0065] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0066] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the data migration method described in any of the above-described method embodiments of the present invention.

[0067] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0068] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A data migration method, characterized in that, include: In response to the copy I / O issued by the user, the data to be migrated is migrated from the source volume to the target volume, and a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume are created; During the migration process, the system receives IO services from the user, and determines the target volume by marking it based on the IO services, the copy bitmap, or the second difference bitmap. Based on the determination result, the system executes IO services on the target volume.

2. The data migration method as described in claim 1, characterized in that, The response to the user-issued copy I / O migrates the data to be migrated from the source volume to the target volume, and creates a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume, including: When copy IO is a full data copy instruction, all data in the source volume is treated as the data to be migrated. The data to be migrated is written from the source volume to the target volume. During the writing process, a first difference bitmap of the source volume and a second difference bitmap of the target volume are created. Based on the storage capacity of the source volume, a copy bitmap is determined; wherein the markers of the copy bitmap include: copy markers and uncopy markers.

3. The data migration method as described in claim 1, characterized in that, The process of responding to a user-issued copy I / O to migrate the data from the source volume to the target volume, and creating a copy bitmap, a first difference bitmap of the source volume, and a second difference bitmap of the target volume, further includes: When copy IO is an incremental data copy instruction, after the full data copy instruction is executed on the source volume and the target volume, the difference data in the source volume that is different from the target volume is taken as the data to be migrated. The data to be migrated is written from the source volume to the target volume. During the writing process, the first difference bitmap of the source volume after the full data copy instruction is executed and the second difference bitmap of the target volume are created. Based on the current first and second difference bitmaps, a copy bitmap is constructed; wherein, the markers of the copy bitmap include: copy markers and uncopy markers.

4. The data migration method as described in claim 1, characterized in that, The acquisition of the difference bitmap includes: For each location of data in the source volume, a write check is performed: if the current data has not been written, the bitmap is marked as not written; if the current data has been written, the bitmap is marked as written. Based on the bitmap markers at each location of the source volume, determine the first difference bitmap of the source volume; For each location of data in the target volume, a write check is performed: if the current data has not been written, the bitmap is marked as not written; if the current data has been written, the bitmap is marked as written. The second difference bitmap of the target volume is determined based on the bitmap markers at each location of the target volume.

5. The data migration method as described in claim 4, characterized in that, The IO services include: copy IO, write IO, and copy IO; the determination of marking the target volume based on the IO services, the copy bitmap, or the second difference bitmap, and the execution of IO services on the target volume according to the determination result, includes: Make judgments on IO operations; If the IO service is write IO, then the current second difference bitmap is marked to determine the data, and the target volume is written according to the determination result. If the IO service is read IO, then the marking is determined based on the current second difference bitmap and the current copy bitmap, and the data reading operation is performed on the target volume according to the determination result; Otherwise, based on the judgment made by the current copy IO according to the current second difference bitmap, the data copy operation is performed on the target volume according to the judgment result.

6. The data migration method as described in claim 5, characterized in that, The data write operation includes: Based on the current second difference bitmap, determine the markings at each position of the target volume; If a write flag exists, data is written to the current position according to the write content entered by the user in the write IO. If no write marker exists, the target volume is written to the current position based on the write content entered by the user in the write IO, and a write marker is added after writing to the current position to update the second difference bitmap of the target volume.

7. The data migration method as described in claim 5, characterized in that, The data reading operation includes: Based on the current second difference bitmap and copy bitmap, determine the markings at each location of the target volume; If the difference bitmap at the current location does not have a write mark and the copy bitmap does not have a copy mark, then read the content at the current location of the source volume; Otherwise, read the data at the current location of the target volume.

8. The data migration method as described in claim 5, characterized in that, The data copy operation includes: Based on the current second difference bitmap, determine the markings at each position of the target volume; If a write flag exists, no data will be written to the target volume, and the data copy operation will be stopped. If no write flag exists, the target volume is written to the current position based on the copy content selected by the user in the copy IO, and a copy flag is added after writing to the current position to update the second difference bitmap of the target volume.

9. A data migration device, characterized in that, include: Data response module and IO business execution module; The data response module is used to respond to the copy I / O issued by the user, migrate the data to be migrated from the source volume to the target volume, and create a copy bitmap, a first difference bitmap of the source volume and a second difference bitmap of the target volume; The IO service execution module is used to receive IO services issued by the user during the migration process, determine the target volume based on the IO services, the copy bitmap or the second difference bitmap, and execute IO services on the target volume according to the determination result.

10. A terminal device, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the data migration method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, include: A stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the data migration method as described in any one of claims 1-8.