CN-122018801-A - Data migration method, device, terminal equipment and storage medium
Abstract
Responding to 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 the IO service issued by the user, judging the target volume based on the IO service, the copy bitmap or the second difference bitmap, and executing the IO service on the target volume according to a judging result. Therefore, by implementing the method and the device, the problem that the user cannot access the data in the migration in the traditional data migration scheme can be solved.
Inventors
- WU HANG
- WANG JIANZHONG
- GUO MINGYANG
- GUO ZHAOBIN
- HE ZHEN
Assignees
- 曙光信息产业股份有限公司
- 曙光信息产业(北京)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260128
Claims (11)
- 1. A method of data migration, comprising: Responding 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 the IO service issued by the user, judging the target volume based on the IO service, the copy bitmap or the second difference bitmap, and executing the IO service on the target volume according to a judging result.
- 2. The data migration method of claim 1, wherein the migrating the data to be migrated from the source volume to the target volume in response to the user issued copy IO and creating the copy bitmap, the first differential bitmap of the source volume, and the second differential bitmap of the target volume comprises: Under the condition that the copy IO is a data full copy instruction, taking all data of a source volume as data to be migrated, writing the data to be migrated into a target volume from the source volume, and creating a first difference bitmap of the source volume and a second difference bitmap of the target volume in the writing process; a copy bitmap is determined based on the storage capacity of the source volume, wherein the marks of the copy bitmap include copy marks and uncopyed marks.
- 3. The data migration method of claim 1, wherein the migrating data to be migrated from the source volume to the target volume in response to the user issued copy IO and creating the copy bitmap, the first differential bitmap of the source volume, and the second differential bitmap of the target volume further comprises: Under the condition that the copy IO is a data increment copy instruction, after the source volume and the target volume execute the data full copy instruction, taking difference data which is different from the target volume in the source volume as data to be migrated, writing the data to be migrated into the target volume from the source volume, and creating a first difference bitmap of the source volume after executing the data full copy instruction and a second difference bitmap of the target volume in the writing process; And constructing a copy bitmap based on the current first difference bitmap and the second difference bitmap, wherein the marks of the copy bitmap comprise copy marks and uncopyed marks.
- 4. The data migration method of claim 1, wherein the obtaining of the differential bitmap comprises: The method comprises the steps of performing writing judgment on data of each position in a source volume, wherein if current data is unwritten, a bitmap mark is unwritten, and if the current data is written, the bitmap mark is written; Determining a first difference bitmap of the source volume according to the bitmap mark of each position of the source volume; The method comprises the steps of performing writing judgment on data of each position in a target volume, wherein if the current data is unwritten, a bitmap mark is unwritten, and if the current data is written, the bitmap mark is written; and determining a second differential bitmap of the target volume according to the bitmap marks of each position of the target volume.
- 5. The data migration method of claim 4, wherein the IO service includes copy IO, write IO and copy IO, wherein the marking the target volume based on the IO service, the copy bitmap or the second differential bitmap includes: Judging IO service; If the IO service is write IO, marking the current second difference bitmap, and performing data writing operation on the target volume according to a judgment result; If the IO service is read IO, judging the marking according to the current second difference bitmap and the current copy bitmap, and performing data reading operation on the target volume according to a judging result; otherwise, the marking judgment is carried out based on the current copy IO according to the current second difference bitmap, and the data copy operation is carried out on the target volume according to the judgment result.
- 6. The data migration method of claim 5, wherein the data write operation comprises: judging the mark of each position of the target volume according to the current second difference bitmap; if the writing mark exists, writing data into the current position according to the writing content input by the user in the writing IO; If the writing mark does not exist, writing the current position of the target volume according to the writing content input by the user in the writing IO, and adding the writing mark after writing the current position so as to update the second difference bitmap of the target volume.
- 7. The data migration method of claim 5, wherein the data read operation comprises: Judging the mark of each position of the target volume according to the current second difference bitmap and the copy bitmap; If the difference bitmap of the current position does not have the written mark and the copy bitmap does not have the copy mark, reading the content of the current position of the source volume; otherwise, the data of the current position of the target volume is read.
- 8. The data migration method of claim 5, wherein the data copy operation comprises: judging the mark of each position of the target volume according to the current second difference bitmap; if the write mark exists, the data writing is not carried out on the target volume, and the data copying operation is stopped; if the writing mark does not exist, writing the current position of the target volume according to the copy content selected by the user in the copy IO, and adding the copy mark after writing the current position so as to update the second differential bitmap of the target volume.
- 9. The data migration device is characterized by comprising a data response module and an IO service execution module; The data response module is used for responding to the copy IO issued by the user, migrating 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; the IO service execution module is used for receiving IO service issued by a user in the migration process, judging a target volume based on the IO service, the copy bitmap or the second difference bitmap, and executing IO service on the target volume according to a judging result.
- 10. A terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the data migration method according to any one of claims 1-8 when the computer program is executed by the processor.
- 11. A computer readable storage medium comprising a stored computer program, wherein the computer program, when run, controls a device on which the computer readable storage medium resides to perform the data migration method according to any one of claims 1-8.
Description
Data migration method, device, terminal equipment and storage medium Technical Field The present invention relates to the field of centralized storage, and in particular, to a data migration method, apparatus, terminal device, and storage medium. Background Centralized storage is an architecture that centrally manages data storage resources, all of which are stored in a single storage device or storage system. The method has the advantages of high-efficiency management, easy maintenance and expansion of data, centralized data protection and backup functions, and the prior art commonly uses centralized storage to perform data migration such as copying, cloning and the like. In the conventional data migration scheme, data can be copied from a source volume to a target volume, but in the copying process, in order to ensure that the data migrated by the source volume and the target volume can keep consistency, a host is generally not allowed to mount on the source volume and the target volume, and the host cannot issue io services to the target volume, so that the data migrated by the source volume and the target volume are prevented from being modified in the copying process, and the problem of inconsistent data is avoided. Because the traditional data migration scheme cannot access or modify the migrated data during data migration, when the data migration volume is large, a user needs to wait for the data to be completely migrated and then can access the data, further follow-up work is carried out, and the work efficiency of the user can be influenced by the data migration mode. Therefore, the conventional data migration scheme has a problem that a user cannot access data under migration. Disclosure of Invention The invention provides a data migration method, a data migration device, terminal equipment and a storage medium, which can solve the problem that a user cannot access data in migration in a traditional data migration scheme. The data migration method provided by the invention comprises the following steps: Responding 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 the IO service issued by the user, judging the target volume based on the IO service, the copy bitmap or the second difference bitmap, and executing the IO service on the target volume according to a judging result. By implementing the embodiment, the data migration method has the advantages that after the copy IO is received, 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 so as to clear the data migration condition in the data migration process. In the data migration process, the user can be allowed to issue IO business to perform data operation on the target volume, and according to the first difference bitmap, the second difference bitmap and the copy bitmap, the user can clearly determine the migration condition between the data stored in the source volume and the data stored in the target volume, so that the reliability of data migration is ensured. Therefore, compared with the prior art that the IO service can be issued after the data is completely and successfully migrated, the embodiment not only can enable the user to access the migrated data, but also can modify and copy the migrated data, and therefore the working efficiency of the user in data migration is greatly improved. Further, the responding to the copy instruction, responding to the copy IO 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 differential bitmap of the source volume, and a second differential bitmap of the target volume, including: Under the condition that the copy IO is a data full copy instruction, taking all data of a source volume as data to be migrated, writing the data to be migrated into a target volume from the source volume, and creating a first difference bitmap of the source volume and a second difference bitmap of the target volume in the writing process; a copy bitmap is determined based on the storage capacity of the source volume, wherein the marks of the copy bitmap include copy marks and uncopyed marks. By implementing the embodiment, the method has the advantages that all data of the source volume are automatically migrated to the target volume through responding to the data full copy instruction, a first difference bitmap of the source volume and a second difference bitmap of the target volume for recording data changes are synchronously created in the migration process, and meanwhile, a copy bitmap for marking migrated/non-migrated states is dynamically generated according to the st