A data migration method, device, storage medium and chip system
By generating differential bitmaps and reading multiple data blocks according to the continuity of bitmaps for packaging and transmission, the problems of low efficiency and high resource occupation caused by discontinuity of differential data blocks in temperature migration technology are solved, and efficient data migration is achieved.
Patent Information
- Application Number
- CN202310301510.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2043-03-17
AI Technical Summary
The existing temperature migration technology is not efficient during data migration and occupies a lot of equipment resources, mainly due to the random read and write and packaging problems caused by discontinuity of different data blocks.
By generating a differential bitmap, multiple data blocks are read according to the continuity of the bitmap data and packaged together to the destination, avoiding random reading and resource consumption by packing one by one.
It effectively saves the equipment resources of storage devices, reduces the search time during data migration, and improves the efficiency of data migration.
Smart Images

Figure CN116450605B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a data migration method, device, storage medium and chip system. Background Art
[0002] As cloud technology becomes more and more sophisticated, the demand for cross-cloud data migration is increasing. Warm migration, as an important data migration method, has also received widespread attention. Warm migration uses snapshot technology to take a snapshot of the disk to be migrated and transfer the snapshot to the destination (this process does not require downtime). The source disk continues to work and generate new data, and then takes another snapshot. The difference between the second snapshot and the first snapshot is used to determine the difference data between the two snapshots. The difference data is transferred to the destination to achieve overall migration, and the downtime is only the time for transferring the difference data. Warm migration can effectively shorten the downtime during data migration.
[0003] However, since the difference data between two snapshots is not distributed continuously, random reading and writing will consume more device resources and too many data packaging resources. Therefore, the efficiency of data migration using warm migration technology is not high and it will occupy more device resources. Summary of the invention
[0004] The present application provides a data migration method, device, storage medium and chip system to improve the efficiency of data migration and save the consumption of device resources during data migration.
[0005] In a first aspect, the present application proposes a data migration method, which is applied to a first storage device, and the method includes: receiving a migration request; the migration request is used to migrate the data to be migrated in the first storage device to a second storage device; sending a snapshot generated at a first snapshot moment based on multiple data blocks belonging to the data to be migrated in the first storage device to the second storage device; obtaining a difference bitmap; the difference bitmap includes bitmap data corresponding to multiple storage addresses in the first storage device, respectively, and the multiple storage addresses are continuous in the first storage device; when the bitmap data takes a first value, it indicates that the storage address corresponding to the bitmap data is different from the data block stored at the first snapshot moment and the second snapshot moment; when the bitmap data takes a second value, it indicates that the storage address corresponding to the bitmap data is different from the data block stored at the first snapshot moment and the second snapshot moment. and the data block stored at the second snapshot moment; continuously read at least two bitmap data from the difference bitmap in the order of the multiple storage addresses; according to the at least two bitmap data, read at least two data blocks from the first storage space of the first storage device in a sequential reading manner, and send the at least two data blocks to the second storage device; wherein the at least two bitmap data include first bitmap data and second bitmap data, the first bitmap data is the first bitmap data of the at least two bitmap data whose value is the first value, and the second bitmap data is the last bitmap data of the at least two bitmap data whose value is the first value; the starting address of the first storage space is the storage address corresponding to the first bitmap data, and the ending address of the second storage space is the storage address corresponding to the second bitmap data.
[0006] In some embodiments, the difference bitmap is generated according to the difference between the data to be migrated in the first storage device at the first snapshot time and the second snapshot time.
[0007] Based on the above scheme, the present application proposes not to read the difference data blocks between two snapshot moments one by one, but to read at least two data blocks with consecutive storage addresses from the hard disk according to the difference bitmap, and to package the at least two data blocks together and send them to the destination. Compared with the device resources consumed by random reading and packaging one by one in the traditional technology, the continuous reading of multiple data blocks and packaging and transmitting them together in the present application can effectively save the device resources of the storage device and reduce the seek time during the data migration process.
[0008] In some embodiments, the second bitmap data is the last bitmap data of the at least two bitmap data.
[0009] In some embodiments, the amount of bitmap data included in the first bitmap data to the second bitmap data reaches a first threshold.
[0010] Based on the above scheme, when the value of the last bitmap data read is the first value, and the number of bitmap data included in the first bitmap data to the second bitmap data that have been read reaches the first threshold, the data blocks corresponding to at least two bitmap data can be sent to the destination storage device together. The first threshold can be determined based on the network connection between the two storage devices and the transmission bandwidth and other information, so that the data blocks whose number meets the first threshold can adapt to the specific transmission situation between the devices.
[0011] In some embodiments, the at least two bitmap data further include third bitmap data, the third bitmap data is the last bitmap data of the at least two bitmap data, and the value of the third bitmap data is the second value.
[0012] In some embodiments, the number of bitmap data whose values are the second value in the at least two bitmap data reaches a second threshold.
[0013] Based on the above scheme, when the value of the last bitmap data in the bitmap data that has been read is the second value, and the number of bitmap data with the second value that has been read continuously reaches the second threshold, the data blocks corresponding to the bitmap data with the second value that has been read continuously may not be sent, but the data blocks corresponding to the first bitmap data with the first value to the last bitmap data with the first value are sent to the destination storage device together. This avoids the situation where the resources consumed by continuously reading the data blocks corresponding to multiple bitmap data with the second value are greater than the resources consumed by random reading of the device.
[0014] In some embodiments, the method further includes: based on fourth bitmap data and fifth bitmap data read from the difference bitmap, sending a data block read from a storage address corresponding to the fourth bitmap data to the second storage device; the value of the fourth bitmap data is the first value, the value of the fifth bitmap data is the second value, and the number of bitmap data from the fourth bitmap data to the fifth bitmap data whose value is the second value reaches a second threshold.
[0015] In some embodiments, the difference bitmap is stored in a control node of a cloud platform to which the first storage device belongs, and the difference bitmap includes multiple sub-difference bitmaps, and the storage addresses of the multiple sub-difference bitmaps in the control node are continuous; obtaining the difference bitmap includes: loading the multiple sub-difference bitmaps from the control node to the memory of the first storage device in the order of the storage addresses of the multiple sub-difference bitmaps; wherein at least one sub-difference bitmap of the multiple sub-difference bitmaps is loaded each time; continuously reading at least two bitmap data from the difference bitmap in the order of the multiple storage addresses includes: continuously reading at least two bitmap data from the sub-difference bitmap stored in the memory in the order of the multiple storage addresses.
[0016] In some embodiments, after sending the at least two data blocks to the second storage device, the method further includes: deleting the at least two bitmap data read.
[0017] In some embodiments, the method further includes: when all bitmap data contained in the first sub-difference bitmap in the memory are deleted, deleting the first sub-difference bitmap from the memory, the first sub-difference bitmap being any sub-difference bitmap among multiple sub-difference bitmaps.
[0018] Since the difference bitmap occupies a large storage space, the present application proposes that a part of the difference bitmap can be loaded from the control node for analysis, and after analyzing the loaded part of the difference bitmap, the part of the difference bitmap can be deleted from the memory and the other part of the difference bitmap can be loaded from the control node again, thereby saving the memory resources of the first storage device.
[0019] In some embodiments, the method further includes: when sending the at least two data blocks fails, determining a first sub-difference bitmap to which the first bitmap data belongs to the second bitmap data; if the first sub-difference bitmap is not stored in the memory, loading the first sub-difference bitmap from the control node.
[0020] In the second aspect, the present application proposes a data migration device, which can be a first storage device, or the device can be applied to the first storage device, for example, it can be a processing chip or processor in the first storage device. The device includes a communication unit and a processing unit, wherein the communication unit is used to receive a migration request; the migration request is used to migrate the data to be migrated in the first storage device to the second storage device; the communication unit is also used to send a snapshot generated at a first snapshot moment based on multiple data blocks belonging to the data to be migrated in the first storage device to the second storage device; the processing unit is used to obtain a difference bitmap; the difference bitmap includes bitmap data corresponding to multiple storage addresses in the first storage device, and the multiple storage addresses are continuous in the first storage device; when the bitmap data takes a first value, it indicates that the data blocks stored at the storage address corresponding to the bitmap data at the first snapshot moment and the second snapshot moment are different; when the bitmap data takes a second value, it indicates that the data blocks stored at the storage address corresponding to the bitmap data at the first snapshot moment and the second snapshot moment are different. The same; the processing unit is also used to continuously read at least two bitmap data from the difference bitmap in the order of the multiple storage addresses; the processing unit is also used to read at least two data blocks from the first storage space of the first storage device in a sequential reading manner according to the at least two bitmap data, and send the at least two data blocks to the second storage device through the communication unit; wherein the at least two bitmap data include first bitmap data and second bitmap data, the first bitmap data is the first bitmap data of the at least two bitmap data whose value is the first value, and the second bitmap data is the last bitmap data of the at least two bitmap data whose value is the first value; the starting address of the first storage space is the storage address corresponding to the first bitmap data, and the ending address of the second storage space is the storage address corresponding to the second bitmap data.
[0021] In some embodiments, the second bitmap data is the last bitmap data of the at least two bitmap data.
[0022] In some embodiments, the number of bitmap data included in the first bitmap data to the second bitmap data reaches a first threshold, that is, the number of the first bitmap data, the second bitmap data, and the bitmap data between the first bitmap data and the second bitmap data reaches a first threshold.
[0023] In some embodiments, the at least two bitmap data further include third bitmap data, the third bitmap data is the last bitmap data of the at least two bitmap data, and the value of the third bitmap data is the second value.
[0024] In some embodiments, the amount of bitmap data between the second bitmap data and the third bitmap data reaches a second threshold.
[0025] In some embodiments, the processing unit is further configured to:
[0026] According to the fourth bitmap data and the fifth bitmap data read from the difference bitmap, a data block read from the storage address corresponding to the fourth bitmap data is sent to the second storage device through the communication unit; the value of the fourth bitmap data is the first value, the value of the fifth bitmap data is the second value, and the number of bitmap data from the fourth bitmap data to the fifth bitmap data whose value is the second value reaches a second threshold.
[0027] In some embodiments, the difference bitmap is stored in a control node of a cloud platform to which the first storage device belongs, the difference bitmap includes a plurality of sub-difference bitmaps, and the storage addresses of the plurality of sub-difference bitmaps in the control node are continuous; the processing unit is further used to:
[0028] Loading the plurality of sub-difference bitmaps from the control node to the memory of the first storage device in the order of the storage addresses of the plurality of sub-difference bitmaps; wherein at least one sub-difference bitmap of the plurality of sub-difference bitmaps is loaded each time;
[0029] The processing unit is specifically used for:
[0030] At least two bitmap data are continuously read from the sub-difference bitmap stored in the memory in the order of the multiple storage addresses.
[0031] In some embodiments, after sending the at least two data blocks to the second storage device through the communication unit, the processing unit is further configured to:
[0032] The at least two bitmap data read are deleted.
[0033] In some embodiments, the processing unit is further configured to:
[0034] When all bitmap data included in a first sub-difference bitmap in the memory are deleted, the first sub-difference bitmap is deleted from the memory, wherein the first sub-difference bitmap is any sub-difference bitmap among the plurality of sub-difference bitmaps.
[0035] In some embodiments, the processing unit is further configured to:
[0036] When sending the at least two data blocks fails, determining a first sub-difference bitmap to which the first bitmap data and the second bitmap data belong;
[0037] If the first sub-difference bitmap is not stored in the memory, the first sub-difference bitmap is loaded from the control node.
[0038] In the third aspect, the present application proposes another data migration device, including a processor and a memory; the memory is used to store programs; the processor is used to execute the programs stored in the memory, so that the device implements the method described in any possible design of the first aspect above.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program code. When the program code runs on the computer, the computer executes the method described in any possible design of the first aspect above.
[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in any possible design of the first aspect.
[0041] In a sixth aspect, an embodiment of the present application provides a chip system, which includes a processor coupled to a memory and used to call a computer program or computer instructions stored in the memory so that the processor executes the method described in any possible design of the first aspect above.
[0042] In a seventh aspect, an embodiment of the present application provides a processor for calling a computer program or computer instructions stored in a memory so that the processor executes the method described in any possible design of the first aspect above.
[0043] Based on the implementations provided in the above aspects, the embodiments of the present application can be further combined to provide more implementations.
[0044] The technical effects that can be achieved by any possible design in any of the second to seventh aspects mentioned above can be correspondingly described with reference to the technical effects that can be achieved by any possible design in the first aspect mentioned above, and the repetitions will not be discussed here. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of a process of generating a difference bitmap;
[0046] Figure 2A A schematic diagram of the architecture of a data migration scenario provided in an embodiment of the present application;
[0047] Figure 2B A schematic diagram of another data migration scenario provided in an embodiment of the present application;
[0048] Figure 3A schematic diagram of the structure of a first storage device provided in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of a process of sending a difference data block according to a difference bitmap;
[0050] Figure 5 A schematic diagram of a data migration method provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of the structure of another first storage device provided in an embodiment of the present application;
[0052] Figure 7 A schematic diagram of a data retransmission method provided in an embodiment of the present application;
[0053] Figure 8 A schematic diagram of another data migration method provided in an embodiment of the present application;
[0054] Fig. 9 A diagram showing the effect of efficient data migration provided by an embodiment of the present application;
[0055] Fig.10 A schematic diagram of the structure of a data migration device provided in an embodiment of the present application;
[0056] Fig.11 A schematic diagram of the structure of another data migration device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to facilitate understanding of the solutions of the present application, the concepts and terms involved in the embodiments of the present application are first briefly explained.
[0058] (1) Snapshot: A fully usable copy of a specified data set, which includes an image of the corresponding data at a certain point in time (the time when the copy starts). A snapshot can be a copy of the data it represents or a replica of the data.
[0059] (2) Difference bitmap: It is essentially a bitmap, which includes multiple bitmap data, and the value of each bitmap data is 0 and 1. The difference bitmap is used to describe the differences between multiple data blocks stored on two disks, or to describe the differences between multiple data blocks stored on the same disk at two snapshot times. For example, in the case of two snapshots, if the data stored at the same storage address at the two snapshot times is the same, the corresponding bit in the difference bitmap takes the value of 0; conversely, if the data stored at the same storage address at the two snapshot times is different, the corresponding bit in the difference bitmap takes the value of 1. The size of the difference bitmap can be set according to the scenario of the cloud storage platform. For example, the process of generating a difference bitmap based on two snapshots can be seen in Figure 1 . Figure 1 (a) shows the data blocks stored on the disk at the time of the first snapshot. Figure 1 (b) shows the data blocks stored on the disk at the second snapshot time. Figure 1 (c) in FIG. 1 is a difference bitmap generated based on two snapshots.
[0060] (3) Warm migration: A method for migrating data between two storage devices using snapshot technology. The specific process is as follows: first, take a snapshot of the disk to be migrated, and send the first snapshot to the destination end (this process does not require downtime, and the first snapshot is used by the destination end to write the data stored in the disk to be migrated at the time of the first snapshot to the disk of the destination end). After the first snapshot, the disk to be migrated continues to work and generate new data, and then take a second snapshot, use the first snapshot and the second snapshot to generate a difference bitmap, and send the data blocks in the disk to be migrated corresponding to the bitmap data with a value of 1 in the difference bitmap to the destination end. It can be seen that the downtime of warm migration is only the time for transmitting the data blocks that have differences between the two snapshots, thereby shortening the downtime during the data migration process.
[0061] (4) Least recently used (LRU) cache algorithm: During the device computing process, all file operations need to be performed in memory. However, due to the limited memory size of the device, not all files can be loaded into the memory. Therefore, it is proposed to use the LRU algorithm to load the data that is frequently accessed in the recent period into the memory, and determine the data that is not frequently accessed in the memory and delete it from the memory.
[0062] The solution of this application is applied to data migration scenarios, including data migration across cloud platforms and data migration between two storage nodes in a cloud platform. Figure 2A , is a schematic diagram of the architecture of a cross-cloud platform data migration scenario. Figure 2B , which is an architectural diagram of a data migration scenario within a cloud platform. Figure 2A The system includes a first storage device and a control node of a cloud platform to which the first storage device belongs, and a second storage device and a control node of the cloud platform to which the second storage device belongs. Figure 2B It includes a first storage device, a second storage device, and a control node of the cloud platform to which the first storage device and the second storage device belong, wherein the first storage device is a storage device for storing data to be migrated, and the second storage device is a destination storage device for the data to be migrated, that is, data migration is to migrate the data to be migrated stored in the first storage device to the second storage device. Figure 2A The control node of the cloud platform to which the first storage device shown in Figure 2B The functions of the control node of the cloud platform shown in the figure are: taking snapshots of the data to be migrated in the disk of the first storage device (including the first snapshot and the second snapshot), generating a difference bitmap based on the snapshots, storing the generated difference bitmap, and providing the stored difference bitmap to the first storage device. Among them, providing the difference bitmap to the first storage device is used for the first storage device to transmit the data to be migrated according to the difference bitmap. Exemplarily, the functions of the control node of the cloud platform can be implemented by a server, a server cluster, or any electronic device or virtual machine with computing functions and storage space.
[0063] The first storage device and the second storage device are devices that have both computing and storage capabilities, such as servers, desktop computers, etc. The following takes the first storage device as an example to introduce the hardware structure of the first storage device. It should be noted that the structure of the second storage device can refer to the structure of the first storage device described below. Figure 3 As shown, the first storage device may include a processor 31, a memory 32, a network card 33 and a hard disk 34. The processor 31, the memory 32, the network card 33 and the hard disk 34 are connected via a bus. Among them, the processor 31 and the memory 32 are used to provide computing resources. Specifically, the processor 31 is a central processing unit (CPU) for processing data access requests from outside the first storage device, or requests generated inside the first storage device. Exemplarily, when the processor 31 receives a write data request sent by a user, the data in these write data requests will be temporarily saved in the memory 32. When the total amount of data in the memory 32 reaches a certain threshold, the processor 31 sends the data stored in the memory 32 to the hard disk 34 for persistent storage. In addition, the processor 31 is also used for data calculation or processing, such as metadata management, deduplication, data compression, data verification, virtualized storage space, and address conversion. Figure 3Only one CPU is shown in the figure. In actual applications, there are often multiple CPUs, wherein one CPU has one or more CPU cores. This embodiment does not limit the number of CPUs and the number of CPU cores.
[0064] The memory 32 refers to an internal memory that directly exchanges data with the processor. It can read and write data at any time, and the speed is very fast. It serves as a temporary data storage for the operating system or other running programs. The memory includes at least two types of memories. For example, the memory can be either a random access memory or a read-only memory (ROM). For example, the random access memory is a dynamic random access memory (DRAM) or a storage class memory (SCM). DRAM is a semiconductor memory, and like most random access memories (RAM), it is a volatile memory device. SCM is a composite storage technology that combines the characteristics of traditional storage devices and memory. Storage class memory can provide faster read and write speeds than hard disks, but the access speed is slower than DRAM, and the cost is cheaper than DRAM. However, DRAM and SCM are only exemplary descriptions in this embodiment, and the memory can also include other random access memories, such as static random access memories (SRAM). As for the read-only memory, for example, it can be a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), etc. In addition, the memory 32 can also be a dual in-line memory module or a dual-line memory module (DIMM), that is, a module composed of a dynamic random access memory (DRAM), or a solid state disk (SSD). In actual applications, multiple memories 32 and different types of memories 32 can be configured in the first storage device. This embodiment does not limit the number and type of memory 32. In addition, the memory 32 can be configured to have a power-saving function. The power-saving function means that when the system loses power and then powers on again, the data stored in the memory 32 will not be lost. The memory with a power-saving function is called a non-volatile memory.
[0065] The hard disk 34 is used to provide storage resources, such as storing data. It can be a disk or other types of storage media, such as a solid state hard disk or a shingled magnetic recording hard disk. The network card 33 is used to communicate with other application first storage devices.
[0066] Since warm migration can shorten the downtime during the data migration process, it is currently widely used in various data migration scenarios. So how to use the difference bitmap for efficient data migration in warm migration technology is a question worth thinking about. In traditional technology, when migrating data through a difference bitmap, after the first storage device obtains the difference bitmap from the control node of the cloud platform, it reads the data blocks that have differences between the first snapshot moment and the second snapshot moment one by one in the storage order according to the instructions of the difference bitmap, and sends the read data blocks to the second storage device one by one. For the sake of ease of description, the different data blocks stored at the same storage address at the first snapshot moment and the second snapshot moment are referred to as difference data blocks, and the same data blocks stored at the same storage address at the first snapshot moment and the second snapshot moment are referred to as non-difference data blocks. For example, see Figure 4 , which is a schematic diagram of a process of sending difference data blocks according to a difference bitmap. Figure 4 (a) is a difference bitmap generated according to the data blocks stored in the first storage device at the first snapshot time and the second snapshot time, Figure 4 (b) in the figure is the data block stored in the first storage device at the second snapshot time, including difference data blocks and non-difference data blocks. Figure 4 (c) in the figure is the difference data block read one by one.
[0067] according to Figure 4 It can be seen from the process shown that in the traditional technology, a random reading method is adopted when reading the difference data blocks, that is, the difference data blocks are sought, read one by one, and packaged and sent one by one. It is known that the most time-consuming and resource-consuming step in the reading and writing process of the hard disk is the seek. Therefore, according to the traditional technology, if there are 10 difference data blocks, and the seek time of each difference data block is 10ms, then a seek time of 100ms is required, which will cause the process of migrating the difference data blocks to be time-consuming and inefficient. At the same time, each difference data block is packaged once, which will also consume too many data packaging resources. Based on this, the present application proposes a data migration method, which proposes that when migrating the difference data blocks according to the difference bitmap, the difference data blocks are no longer read one by one, but the device resources required for random reading of the difference data blocks and the device resources required for sequential reading of the non-difference data blocks are comprehensively considered to determine the optimal transmission strategy.
[0068] The following combination Figure 2A and Figure 2B The scenario architecture diagram shown introduces the data migration solution proposed in this application. Figure 5, is a schematic diagram of a data migration method provided in an embodiment of the present application. Exemplarily, the method flow is executed by the starting end of the data migration, for example, Figure 2A or Figure 2B The first storage device in the scenario shown is executed. Optionally, Figure 5 The execution subject of the method flow shown may also be a unit, module or chip inside the first storage device, for example, Figure 3 A processor 31 of the first storage device is shown. Figure 5 The method flow specifically includes:
[0069] 501, receiving the migration request.
[0070] The migration request is used to migrate the data to be migrated in the first storage device to the second storage device.
[0071] Exemplarily, the data to be migrated may be all the data in the hard disk of the first storage device, or may be part of the data in the hard disk of the first storage device, and the amount of the data to be migrated may be indicated by the migration request.
[0072] 502 : Sending to the second storage device a snapshot generated at a first snapshot time according to a plurality of data blocks belonging to the data to be migrated in the first storage device.
[0073] Exemplarily, the first storage device can send a first snapshot generated at the first snapshot time based on the data to be migrated stored in its own hard disk to the second storage device. The first snapshot is used by the second storage device to write the data to be migrated at the first snapshot time into the hard disk of the second storage device.
[0074] 503, obtain the difference bitmap.
[0075] The difference bitmap is used to describe the difference between the data to be migrated stored in the first storage device at the first snapshot time and the second snapshot time. The difference bitmap includes bitmap data corresponding to multiple storage addresses in the first storage device, and the multiple storage addresses are continuous in the first storage device. In other words, each storage address in the multiple storage addresses storing the data to be migrated corresponds to a bitmap data in the difference bitmap, and the value of any bitmap data represents whether the data block stored in the corresponding storage address is the same at the first snapshot time and the second snapshot time.
[0076] In the difference bitmap, when a certain bitmap data takes a first value, it indicates that the data block stored at the storage address corresponding to the bitmap data at the first snapshot moment and the second snapshot moment is different, that is, the data block corresponding to the bitmap data taking the first value is a difference data block. When a certain bitmap data in the difference bitmap takes a second value, it indicates that the data block stored at the storage address corresponding to the bitmap data at the first snapshot moment and the second snapshot moment is the same, that is, the data block corresponding to the bitmap data taking the second value is a non-difference data block.
[0077] Exemplarily, the difference bitmap may be generated by the control node of the cloud platform to which the first storage device belongs based on the first snapshot and the second snapshot, wherein the first snapshot is generated by taking a snapshot of the data to be migrated in the first storage device at the first snapshot time, and the second snapshot is generated by taking a snapshot of the data to be migrated in the first storage device at the second snapshot time. The control node may take snapshots of the data to be migrated in the first storage device at the two snapshot times, respectively, to obtain the first snapshot and the second snapshot, and generate a difference bitmap based on the difference between the first snapshot and the second snapshot. Thus, the first storage device may obtain the difference bitmap from the control node.
[0078] 504 , read at least two data blocks from the first storage space of the first storage device in a sequential reading manner according to the at least two bitmap data, and send the at least two data blocks to the second storage device.
[0079] The at least two bitmap data include first bitmap data and second bitmap data, the first bitmap data is the first bitmap data of the at least two bitmap data read, and the second bitmap data is the last bitmap data of the at least two bitmap data read, and the first storage space starts with a storage address corresponding to the first bitmap data, and the first storage space ends with a storage address corresponding to the second bitmap data.
[0080] Exemplarily, the first storage device may determine that it needs to read a data block stored in a storage address corresponding to the first bitmap data to a storage address corresponding to the second bitmap data based on at least two bitmap data, read the data block from the hard disk and send it to the second storage device.
[0081] Based on the above scheme, the present application proposes not to read the difference data blocks between two snapshot moments one by one, but to read at least two data blocks with consecutive storage addresses from the hard disk according to the difference bitmap, and to package the at least two data blocks together and send them to the destination. Compared with the device resources consumed by random reading and packaging one by one in the traditional technology, the present application continuously reads multiple data blocks and packages them together for transmission, which can effectively save the device resources of the storage device.
[0082] In some embodiments, when determining the data block to be transmitted based on at least two bitmap data read, the first bitmap data of the at least two bitmap data whose value is the first value is the first bitmap data, and the last bitmap data of the at least two bitmap data may have different values. For example, in one possible case, the value of the last bitmap data of the at least two bitmap data read is the first value, that is, the second bitmap data introduced in the above embodiment is the last bitmap data of the at least two bitmap data read. In this case, when reading the second bitmap data and determining that the value of the second bitmap data is the first value, the first storage device can determine whether the number of bitmap data included in the first bitmap data to the second bitmap data that have been read reaches the first threshold value. If the first threshold value has been reached, the data block stored in the storage address corresponding to the first bitmap data to the storage address corresponding to the second bitmap data can be sent to the second storage device; if the first threshold value has not been reached, the bitmap data can continue to be read from the difference bitmap.
[0083] In another possible case, the value of the last bitmap data among the at least two bitmap data read is the second value, for example, the last bitmap data is called the third bitmap data. In this case, when the first storage device reads the third bitmap data and determines that the value of the third bitmap data is the second value, it can determine whether the number of bitmap data with the second value read continuously before the third bitmap data reaches the second threshold, that is, it determines whether the number of bitmap data between the second bitmap data and the third bitmap data reaches the second threshold. If the second threshold has been reached, the data block stored from the storage address corresponding to the first bitmap data to the storage address corresponding to the second bitmap data can be sent to the second storage device. If the second threshold has not been reached, the bitmap data can continue to be read from the difference bitmap.
[0084] Exemplarily, the first threshold and the second threshold in the above two cases can be pre-set according to the device resources consumed by operations such as reading data blocks, transmitting data blocks, and packaging data blocks. On the one hand, when setting the first threshold, the upper limit of the length of a single data packet transmitted can be determined according to information such as the network quality and transmission bandwidth between the first storage device and the second storage device, and the number of data blocks included in the single data packet transmitted can be determined according to the upper limit of the length. Thus, the number of data blocks determined is used as the first threshold. On the other hand, when setting the second threshold, the device resources required for the first storage device to randomly read a difference data block (for the convenience of description, the device resources are referred to as additional consumption) and the device resources required for the first storage device to continuously read and transmit multiple non-difference data blocks (for the convenience of description, the device resources are referred to as necessary consumption) can be compared, so as to determine the number of multiple non-difference data blocks as the second threshold. For example, if the additional consumption of the first storage device is 10*A, and the necessary consumption required for a non-difference data block is A, the second threshold can be set to 10. Alternatively, the necessary consumption can also be set to be less than the additional consumption, for example, the second threshold can be set to 9.
[0085] In order to further understand the solution proposed by the present application for determining the multiple data blocks to be transmitted based on the at least two bitmap data read, the transmission strategies in the above two cases are introduced in combination with specific embodiments. For details, please refer to steps 1 to 5 below:
[0086] Step 1: The first storage device sequentially reads the bitmap data A in the difference bitmap. When the value of the bitmap data A is the first value, step 2 is continued to be executed; when the value of the bitmap data A is the second value, step 4 is continued to be executed.
[0087] Step 2: Determine whether the number of bitmap data from the first bitmap data with the first value (hereinafter referred to as bitmap data B) to bitmap data A reaches a first threshold. If the first threshold is reached, continue to execute step 3; if the first threshold is not reached, return to execute step 1.
[0088] Step three: Pack the multiple data blocks stored in the storage address corresponding to the bitmap data B to the storage address corresponding to the bitmap data A and send them to the second storage device.
[0089] Step 4: Determine the last bitmap data (hereinafter referred to as bitmap data C) of the plurality of bitmap data that have been read and take the first value, and determine whether the number of bitmap data between bitmap data C and bitmap data A reaches a second threshold. If the second threshold is reached, continue to execute step 5; if the second threshold is not reached, return to execute step 1.
[0090] Step 5: Pack the multiple data blocks stored in the storage address corresponding to the bitmap data B to the storage address corresponding to the bitmap data C and send them to the second storage device.
[0091] The above introduces a scenario of sending multiple data blocks to the second storage device according to the difference bitmap. In another possible scenario, the first storage device can also read the fourth bitmap data and the fifth bitmap data from the difference bitmap, wherein the value of the fourth bitmap data is the first value, the value of the fifth bitmap data is the second value, and the number of bitmap data with the second value from the fourth bitmap data to the fifth bitmap data reaches the second threshold. In other words, after reading a bitmap data with the first value (i.e., the fourth bitmap data), the first storage device continuously reads a second threshold number of bitmap data with the second value. In this scenario, the first storage device can package the data blocks stored in the storage address corresponding to the fourth bitmap data and send them to the second storage device.
[0092] In some embodiments, the first storage device executes the above Figure 5 In step 503, when obtaining the difference bitmap from the control node, since the storage space occupied by the difference bitmap is large, in order to save the storage resources of the first storage device, the present application also proposes that part of the difference bitmap can be loaded from the control node for analysis. After analyzing the part of the difference bitmap that has been loaded, the part of the difference bitmap can be deleted from the memory and the difference bitmap of the other part can be loaded from the control node again. Exemplarily, the difference bitmap stored in the control node may include multiple sub-difference bitmaps stored continuously, each sub-difference bitmap corresponds to a mark, and the mark is used to describe the storage address of the sub-difference bitmap in the control node. Thus, the first storage device can load the sub-difference bitmap from the control node into the memory, wherein the number of sub-difference bitmaps loaded each time can be set according to the size of the memory space and the rate at which the processor reads the sub-difference bitmap. As an optional way, when loading the sub-difference bitmap, the first storage device can load it in the order of the storage addresses of multiple sub-difference bitmaps in the control node. For example, the first storage device can send the mark of the sub-difference bitmap to be loaded to the control node, and the control node can send the sub-difference bitmap in the storage address indicated by the mark to the first storage device. The first storage device may store the sub-difference bitmap sent by the control node in a memory.
[0093] Furthermore, the first storage device executes the above Figure 5 In step 504, when reading the difference bitmap, the sub-difference bitmap stored in the memory may be obtained for reading, and the data block may be transmitted to the second storage device according to the read bitmap data. In some embodiments, after the first storage device transmits part of the data block to the second storage device, the bitmap data corresponding to the part of the data block may be deleted. Figure 5For example, after the first storage device sends multiple data blocks to the second storage device according to at least two bitmap data, the first storage device may delete at least two bitmap data. Further, when the first storage device determines that all bitmap data included in any sub-difference bitmap in the memory are deleted, the first storage device may delete any sub-difference bitmap in the memory.
[0094] Based on the above embodiments, the present application also proposes another architecture diagram of an application scenario. Figure 6 , the application scenario includes a first storage device and a control node. The first storage device includes a difference bitmap analysis module and a difference bitmap management module. The difference bitmap management module includes a difference bitmap acquisition module, a sub-difference bitmap management module and a memory module.
[0095] The difference bitmap acquisition module is used to load the sub-difference bitmap from the control node in the order of the storage addresses of the multiple sub-difference bitmaps in the control node, and store the loaded sub-difference bitmap in the memory module. Exemplarily, the difference bitmap acquisition module can use the LRU algorithm to manage the sub-difference bitmaps in the memory module. Optionally, the difference bitmap acquisition module can also be called a difference bitmap source driver module, and the memory module can also be called a difference bitmap slice module.
[0096] The sub-difference bitmap management module is used to manage the sub-difference bitmaps stored in the memory module, such as deleting the sub-difference bitmap whose bitmap data is deleted, and notifying the difference bitmap acquisition module to load the sub-difference bitmap from the control node. Exemplarily, the sub-difference bitmap management module can also be called a sub-difference bitmap dictionary (chunk dict).
[0097] The difference bitmap analysis module is used to obtain the sub-difference bitmap through the sub-difference bitmap management module, and read the obtained sub-difference bitmap to determine the data block to be transmitted.
[0098] In some embodiments, when the first storage device fails to send at least two data blocks to the second storage device, the at least two data blocks can be re-read and sent according to the difference bitmap. For example, when the second storage device successfully receives at least two data blocks, it can return response information to the first storage device to indicate that the at least two data blocks are sent successfully. Therefore, if the first storage device does not receive a response message from the second storage device after sending at least two data blocks, it can be determined that the at least two data blocks have failed to be sent. The first storage device can thereby determine the first sub-difference bitmap to which the bitmap data corresponding to the storage addresses of the at least two data blocks belongs, and determine whether the first sub-difference bitmap is stored in the memory. If the first sub-difference bitmap is stored in the memory, the first storage device can directly re-read the at least two data blocks according to the first sub-difference bitmap in the memory and send them to the second storage device. Conversely, if the first sub-difference bitmap is not stored in the memory, the first storage device can load the first sub-difference bitmap from the control node into the memory according to the mark of the first sub-difference bitmap. The following is combined with Figure 6 The scenario shown provides a detailed introduction to the solution.
[0099] See also Figure 7, is a flow chart of a method for data retransmission provided by an embodiment of the present application. First, the difference bitmap analysis module executes step 701: requesting the first sub-difference bitmap from the sub-difference bitmap management module. Exemplarily, the difference bitmap analysis module can determine that at least two data blocks fail to be sent when the second storage device does not return response information, and then determine the first sub-difference bitmap to which the bitmap data corresponding to the at least two data blocks belongs. Optionally, the difference bitmap analysis module can send a request message carrying a mark of the first sub-difference bitmap to the sub-difference bitmap management module. After receiving the request from the difference bitmap analysis module, the sub-difference bitmap management module can execute step 702: determine whether the first sub-difference bitmap is stored in the memory module. Optionally, the sub-difference bitmap management module can compare the mark of the sub-difference bitmap stored in the memory module according to the mark of the first sub-difference bitmap to determine whether there is a hit sub-difference bitmap. Exemplarily, if it is a hit, the sub-difference bitmap management module executes step 703: obtains the first sub-difference bitmap from the memory module, and executes step 704: sends the first sub-difference bitmap to the difference bitmap analysis module. On the contrary, if there is no hit, the sub-difference bitmap management module executes step 705: sends an acquisition instruction to the difference bitmap acquisition module. The acquisition instruction carries a mark of the first sub-difference bitmap, which is used to instruct the difference bitmap acquisition module to acquire the first sub-difference bitmap from the control node. After receiving the acquisition instruction, the difference bitmap acquisition module can execute step 706: acquire the first sub-difference bitmap from the control node, and execute step 707: store the first sub-difference bitmap in the memory module. Exemplarily, after executing step 707, the difference bitmap acquisition module can also delete the least recently used sub-difference bitmap stored in the memory module. Therefore, the sub-difference bitmap management module can execute steps 703 and 704 to send the first sub-difference bitmap to the difference bitmap analysis module. Furthermore, the difference bitmap analysis module can re-read at least two data blocks from the hard disk according to the first sub-difference bitmap and send at least two data blocks to the second storage device.
[0100] In order to further understand the solution of the present application, the data migration method proposed in the present application is introduced below in combination with specific embodiments. Figure 8 , is a flow chart of a data migration method provided in an embodiment of the present application. For example, Figure 8 The method flow shown can be executed by the first storage device, or by a module or processing chip in the first storage device, for example Figure 8 The method flow shown can be Figure 3 The processor 31 shown in the figure may also be executed by Figure 7 The difference bitmap analysis module shown is used to perform the analysis. Figure 8 The method flow shown specifically includes:
[0101] 801. Obtain a first sub-difference bitmap.
[0102] Exemplarily, the first sub-difference bitmap may be obtained from the control node according to the mark of the first sub-difference bitmap.
[0103] 802 , read the first bitmap data item in the first sub-difference bitmap.
[0104] 803, determine whether the value of the first bitmap data is the first value.
[0105] If the value of the first bitmap data is the first value, then continue to execute step 804 .
[0106] If the value of the first bitmap data is not the first value, the read bitmap data is deleted and the process returns to step 802 .
[0107] 804, record the first bitmap data as the starting bitmap data.
[0108] 805 , read the bitmap data A according to the order of the bitmap data in the first sub-difference bitmap.
[0109] The bitmap data A is any bitmap data after the first bitmap data.
[0110] 806 , determining whether the value of the bitmap data A is the first value.
[0111] If the value of the bitmap data A is the first value, then continue to execute step 807 .
[0112] If the value of the bitmap data A is not the first value, then continue to execute step 809 .
[0113] 807 , determining whether the amount of the bitmap data that has been read reaches a first threshold.
[0114] If reached, continue to execute step 808.
[0115] If not reached, the process returns to step 805 .
[0116] 808 , read the data block stored in the storage address corresponding to the starting bitmap data to the storage address corresponding to the bitmap data A from the hard disk, and send the read data block to the second storage device.
[0117] 809 , determining whether the amount of bitmap data between the cutoff bitmap data and the bitmap data A reaches a second threshold.
[0118] The cut-off bitmap data is the last bitmap data whose value is the first value among the bitmap data that have been read.
[0119] If reached, continue to execute step 810.
[0120] If not reached, the process returns to step 805 .
[0121] 810 , read a data block stored in a storage address corresponding to the start bitmap data to a storage address corresponding to the end bitmap data from the hard disk, and send the read data block to a second storage device.
[0122] The present application proposes to determine the optimal transmission strategy by sequentially reading the difference bitmap, comprehensively considering the device resources required for sequentially reading the non-difference data blocks and randomly reading the difference data blocks, so as to achieve efficient and low resource occupancy data migration. For example, see Fig. 9 , exemplarily showing the time consumed and the actual amount of data transferred for data migration using the traditional solution and the solution of the present application, Fig. 9 The percentage shown is the actual amount of data transferred. Fig. 9 It can be seen that although the amount of data transmitted by the solution of the present application is increased compared with the traditional solution, the time consumed for migration is reduced.
[0123] The following describes the data migration device for implementing the above method in the embodiment of the present application in conjunction with the accompanying drawings. Therefore, the above contents can be used in the subsequent embodiments, and the repeated contents will not be repeated.
[0124] Fig.10 A schematic block diagram of a data migration device 1000 provided in an embodiment of the present application, the device 1000 can correspondingly implement the functions or steps implemented by the first storage device in each of the above-mentioned method embodiments. The data migration device 1000 may include a communication unit 1001 and a processing unit 1002. Optionally, it may also include a storage unit, which can be used to store instructions (codes or programs) and / or data. The communication unit 1001 and the processing unit 1002 can be coupled to the storage unit, for example, the processing unit 1002 can read the instructions (codes or programs) and / or data in the storage unit to implement the corresponding method. The above-mentioned units can be set independently, or they can be partially or fully integrated.
[0125] In a possible implementation, the data migration device 1000 can implement the steps in the above-mentioned method embodiments. For example, the data migration device 1000 can be a first storage device, or can also be a component in the first storage device, such as a chip system or circuit in the first storage device. Among them, the communication unit 1001 is used to perform all the sending and receiving operations performed by the first storage device in the above-mentioned embodiments. For example, the communication unit 1001 can be used to implement the above-mentioned Figure 5 In the embodiment shown, the operation of receiving a migration request or sending a snapshot to the second storage device is performed. The processing unit 1002 can be used to perform the above Figure 5In the illustrated embodiment, all operations except the transceiver operations are performed by the first storage device, and / or other processes for supporting the technology described herein.
[0126] For example, the processing unit 1002 can be used to obtain a difference bitmap, and continuously read at least two bitmap data from the difference bitmap in the order of the multiple storage addresses; and also used to read at least two data blocks from the first storage space of the first storage device in a sequential reading manner according to the at least two bitmap data, and send the at least two data blocks to the second storage device through the communication unit 1001. The difference bitmap includes bitmap data corresponding to multiple storage addresses in the first storage device, and the multiple storage addresses are continuous in the first storage device; when the bitmap data takes a first value, it indicates that the data blocks stored at the storage address corresponding to the bitmap data at the first snapshot time and the second snapshot time are different; when the bitmap data takes a second value, it indicates that the data blocks stored at the storage address corresponding to the bitmap data at the first snapshot time and the second snapshot time are the same. The at least two bitmap data include first bitmap data and second bitmap data, the first bitmap data is the first bitmap data among the at least two bitmap data whose value is the first value, and the second bitmap data is the last bitmap data among the at least two bitmap data whose value is the first value; the starting address of the first storage space is the storage address corresponding to the first bitmap data, and the ending address of the second storage space is the storage address corresponding to the second bitmap data.
[0127] For other operations performed by the communication unit 1001 and the processing unit 1002, reference may be made to the relevant description of the aforementioned method embodiment.
[0128] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. Each functional unit in the embodiments of the present application may be integrated in a processing unit 1002, or each unit may exist physically separately, or two or more units may be integrated in one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0129] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0130] It should be understood that the processing unit 1002 in the embodiment of the present application can be implemented by a processor or a processor-related circuit component, and the communication unit 1001 can be implemented by a transceiver or a transceiver-related circuit component or a communication interface. Fig.11 As shown in the form. Fig.11 The device 1100 shown includes at least one processor 1110 , a memory 1120 , and optionally, a communication interface 1130 .
[0131] The specific connection medium between the processor 1110 and the memory 1120 is not limited in the embodiment of the present application.
[0132] In such Fig.11 The device also includes a communication interface 1130. When the processor 1110 communicates with other devices (such as a second storage device), data can be transmitted through the communication interface 1130. For example, the communication interface 1130 can be used to transmit at least two read data blocks to the second storage device under the instruction of the processor 1110.
[0133] When the data migration device uses Fig.11 When the form shown is Fig.11 The processor 1110 in the apparatus 1100 can call the computer-executable instructions stored in the memory 1120 so that the apparatus 1100 can execute the method executed by the data migration apparatus in any of the above method embodiments.
[0134] An embodiment of the present application also provides a chip system, which includes a processor for calling a computer program or computer instruction stored in a memory so that the processor executes the method of any of the above embodiments.
[0135] In a possible implementation manner, the processor is coupled to the memory through an interface.
[0136] In a possible implementation, the chip system also includes a memory, in which a computer program or computer instructions are stored.
[0137] An embodiment of the present application also relates to a processor, which is used to call a computer program or computer instruction stored in a memory so that the processor executes the method described in any of the above embodiments.
[0138] It should be understood that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0141] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data migration method, characterized in that: The method is applied to a first storage device, and the method includes: Receiving a migration request; the migration request is used to migrate the data to be migrated in the first storage device to the second storage device; Sending to the second storage device a snapshot generated at a first snapshot time based on a plurality of data blocks belonging to the data to be migrated in the first storage device; Obtain a difference bitmap; the difference bitmap includes bitmap data corresponding to a plurality of storage addresses in the first storage device, respectively, and the plurality of storage addresses are continuous in the first storage device; when the bitmap data takes a first value, it indicates that the data blocks stored at the storage address corresponding to the bitmap data at the first snapshot moment and the second snapshot moment are different; when the bitmap data takes a second value, it indicates that the data blocks stored at the storage address corresponding to the bitmap data at the first snapshot moment and the second snapshot moment are the same; continuously reading at least two bitmap data from the difference bitmap in the order of the plurality of storage addresses; Reading at least two data blocks from the first storage space of the first storage device in a sequential reading manner according to the at least two bitmap data, and sending the at least two data blocks to the second storage device; Among them, the at least two bitmap data include first bitmap data and second bitmap data, the first bitmap data is the first bitmap data among the at least two bitmap data whose value is the first value, and the second bitmap data is the last bitmap data among the at least two bitmap data whose value is the first value; the starting address of the first storage space is the storage address corresponding to the first bitmap data, and the ending address of the second storage space is the storage address corresponding to the second bitmap data.
2. The method according to claim 1, characterized in that The second bitmap data is the last bitmap data of the at least two bitmap data.
3. The method according to claim 2, characterized in that The amount of bitmap data included in the first bitmap data to the second bitmap data reaches a first threshold.
4. The method according to claim 1, characterized in that: The at least two bitmap data further include third bitmap data, the third bitmap data is the last bitmap data of the at least two bitmap data, and the value of the third bitmap data is the second value.
5. The method according to claim 4, characterized in that The amount of bitmap data between the second bitmap data and the third bitmap data reaches a second threshold.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: According to the fourth bitmap data and the fifth bitmap data read from the difference bitmap, a data block read from the storage address corresponding to the fourth bitmap data is sent to the second storage device; the value of the fourth bitmap data is the first value, the value of the fifth bitmap data is the second value, and the number of bitmap data from the fourth bitmap data to the fifth bitmap data whose value is the second value reaches a second threshold.
7. The method according to any one of claims 1 to 5, characterized in that: The difference bitmap is stored in a control node of a cloud platform to which the first storage device belongs, the difference bitmap includes a plurality of sub-difference bitmaps, and the storage addresses of the plurality of sub-difference bitmaps in the control node are continuous; the obtaining of the difference bitmap includes: Loading the plurality of sub-difference bitmaps from the control node to the memory of the first storage device in the order of the storage addresses of the plurality of sub-difference bitmaps; wherein at least one sub-difference bitmap of the plurality of sub-difference bitmaps is loaded each time; The continuously reading at least two bitmap data from the difference bitmap in the order of the plurality of storage addresses comprises: At least two bitmap data are continuously read from the sub-difference bitmap stored in the memory in the order of the multiple storage addresses.
8. The method according to claim 7, characterized in that After sending the at least two data blocks to the second storage device, the method further includes: The at least two bitmap data read are deleted.
9. The method according to claim 8, characterized in that The method further comprises: When all bitmap data included in a first sub-difference bitmap in the memory are deleted, the first sub-difference bitmap is deleted from the memory, wherein the first sub-difference bitmap is any sub-difference bitmap among the plurality of sub-difference bitmaps.
10. The method according to claim 7, characterized in that The method further comprises: When sending the at least two data blocks fails, determining a first sub-difference bitmap to which the first bitmap data and the second bitmap data belong; If the first sub-difference bitmap is not stored in the memory, the first sub-difference bitmap is loaded from the control node.
11. A data migration device, characterized in that: The apparatus is applied to a first storage device, or the apparatus is the first storage device, and the apparatus includes: A communication unit, configured to receive a migration request; the migration request is used to migrate the data to be migrated in the first storage device to the second storage device; The communication unit is further configured to send to the second storage device a snapshot generated at a first snapshot time based on a plurality of data blocks belonging to the data to be migrated in the first storage device; a processing unit, configured to obtain a difference bitmap; the difference bitmap includes bitmap data corresponding to a plurality of storage addresses in the first storage device, the plurality of storage addresses being continuous in the first storage device; when the bitmap data takes a first value, it indicates that the data blocks stored at the storage address corresponding to the bitmap data at the first snapshot moment and the second snapshot moment are different; when the bitmap data takes a second value, it indicates that the data blocks stored at the storage address corresponding to the bitmap data at the first snapshot moment and the second snapshot moment are the same; The processing unit is further configured to continuously read at least two bitmap data from the difference bitmap in the order of the plurality of storage addresses; The processing unit is further configured to read at least two data blocks from the first storage space of the first storage device in a sequential reading manner according to the at least two bitmap data, and send the at least two data blocks to the second storage device through the communication unit; Among them, the at least two bitmap data include first bitmap data and second bitmap data, the first bitmap data is the first bitmap data among the at least two bitmap data whose value is the first value, and the second bitmap data is the last bitmap data among the at least two bitmap data whose value is the first value; the starting address of the first storage space is the storage address corresponding to the first bitmap data, and the ending address of the second storage space is the storage address corresponding to the second bitmap data.
12. The device according to claim 11, characterized in that The second bitmap data is the last bitmap data of the at least two bitmap data.
13. The device according to claim 12, characterized in that The amount of bitmap data included in the first bitmap data to the second bitmap data reaches a first threshold.
14. The device according to claim 11, characterized in that The at least two bitmap data further include third bitmap data, the third bitmap data is the last bitmap data of the at least two bitmap data, and the value of the third bitmap data is the second value.
15. The device according to claim 14, characterized in that The amount of bitmap data between the second bitmap data and the third bitmap data reaches a second threshold.
16. The device according to any one of claims 11 to 15, characterized in that: The processing unit is further used for: According to the fourth bitmap data and the fifth bitmap data read from the difference bitmap, a data block read from the storage address corresponding to the fourth bitmap data is sent to the second storage device through the communication unit; the value of the fourth bitmap data is the first value, the value of the fifth bitmap data is the second value, and the number of bitmap data from the fourth bitmap data to the fifth bitmap data whose value is the second value reaches a second threshold.
17. The device according to any one of claims 11 to 15, characterized in that: The difference bitmap is stored in a control node of a cloud platform to which the first storage device belongs, the difference bitmap includes a plurality of sub-difference bitmaps, and the storage addresses of the plurality of sub-difference bitmaps in the control node are continuous; the processing unit is further used to: Loading the plurality of sub-difference bitmaps from the control node to the memory of the first storage device in the order of the storage addresses of the plurality of sub-difference bitmaps; wherein at least one sub-difference bitmap of the plurality of sub-difference bitmaps is loaded each time; The processing unit is specifically used for: At least two bitmap data are continuously read from the sub-difference bitmap stored in the memory in the order of the multiple storage addresses.
18. The device according to claim 17, characterized in that After sending the at least two data blocks to the second storage device through the communication unit, the processing unit is further configured to: The at least two bitmap data read are deleted.
19. The device according to claim 18, characterized in that The processing unit is further used for: When all bitmap data included in a first sub-difference bitmap in the memory are deleted, the first sub-difference bitmap is deleted from the memory, wherein the first sub-difference bitmap is any sub-difference bitmap among the plurality of sub-difference bitmaps.
20. The device according to claim 17, characterized in that The processing unit is further used for: When sending the at least two data blocks fails, determining a first sub-difference bitmap to which the first bitmap data and the second bitmap data belong; If the first sub-difference bitmap is not stored in the memory, the first sub-difference bitmap is loaded from the control node.
21. A data migration device, characterized in that: include: Processor and memory; The memory is used to store programs; The processor is used to execute the program stored in the memory so that the device implements the method as described in any one of claims 1-10.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called by an electronic device, the electronic device executes the method according to any one of claims 1 to 10.
23. A chip system, characterized in that: Including communication interface and processor: The communication interface is used to input and / or output signaling or data; The processor is used to execute a computer executable program so that a device equipped with the chip system executes the method according to any one of claims 1 to 10.
24. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Management method and device for metadata in storage system
CN112783698A
Systems and methods of data migration in snapshot operations
US20040260900A1