CN116010036A - Data migration method, device and medium thereof - Google Patents

Data migration method, device and medium thereof Download PDF

Info

Publication number
CN116010036A
CN116010036A CN202310091509.0A CN202310091509A CN116010036A CN 116010036 A CN116010036 A CN 116010036A CN 202310091509 A CN202310091509 A CN 202310091509A CN 116010036 A CN116010036 A CN 116010036A
Authority
CN
China
Prior art keywords
data
hole
address
migration
searching operation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310091509.0A
Other languages
Chinese (zh)
Inventor
周胜利
王亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202310091509.0A priority Critical patent/CN116010036A/en
Publication of CN116010036A publication Critical patent/CN116010036A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data migration method, a device and a medium thereof, which relate to the technical field of data migration and are used for realizing data migration of a virtual machine.

Description

Data migration method, device and medium thereof
Technical Field
The present invention relates to the field of data migration technologies, and in particular, to a data migration method, apparatus, and medium thereof.
Background
In today's virtual machine applications, there is a need for virtual machine data migration. In the current virtual machine data migration process, a virtual operating system simulator (QEMU) needs to search the positions of valid data (data) and holes (hole) on a disk first, and then performs data transmission. In the process of searching the data position, the file system loads corresponding metadata from the hard disk into the memory according to the data offset. If the hole position is very back, the seek hole (an instruction for judging whether the hole exists or not and for finding the position of the hole in the file) reads the file metadata from the disk, so that the cache memory in the memory is continuously lost (miss), and further, the seek (seek) is very slow.
In addition, in the implementation scheme of the existing product, when different systems such as QEMU perform data migration, the seek needs to be performed once every time a certain amount of data is transmitted (for example, QEMU is usually 1M data), so that the seek is frequently invoked, and when the seek speed under the application scenario is too slow, the whole data migration process is greatly prolonged, and even in part of the application scenario, the virtual machine is blocked.
Therefore, a data migration method is needed by those skilled in the art, so as to solve the problem that the data migration process is too slow and even the virtual machine is halted when the hole is very late in the process of performing virtual machine data migration.
Disclosure of Invention
The application aims to provide a data migration method, a data migration device and a data migration medium, so as to solve the problem that the data migration process is too slow and even the virtual machine is halted when the hole position is very back in the process of virtual machine data migration at present.
In order to solve the above technical problems, the present application provides a data migration method, including:
executing hole searching operation and data searching operation, and recording hole addresses and data offset addresses;
judging whether the current data offset address is smaller than the hole address or not;
if yes, carrying out data transmission according to the hole address;
if not, the hole searching operation is re-executed, the hole address is updated, and data transmission is carried out according to the updated hole address.
Preferably, the data transmission according to the hole address includes:
and transmitting all data between the hole address and the current data offset address to the hole.
Preferably, determining whether the current data offset address is smaller than the hole address includes:
before each data transmission, judging whether the current data offset address is smaller than the hole address;
correspondingly, if yes, carrying out data transmission according to the hole address comprises the following steps:
completing the data transmission according to the hole address, and updating the data offset address;
if not, re-executing the hole searching operation, updating the hole address, and carrying out data transmission according to the updated hole address comprises the following steps:
and re-executing the hole searching operation, updating the hole address, completing the data transmission according to the updated hole address, and updating the data offset address.
Preferably, the method further comprises:
if the hole punching operation is detected to be executed in the data area, discarding the current hole address and the data offset address, returning to the steps of executing the hole searching operation and the data searching operation before the next data transmission, and recording the hole address and the data offset address.
Preferably, the method further comprises:
if the operation of searching for the hole and the operation of searching for the data only find the hole and not find the data, the operation of searching for the hole is executed each time the data transmission is carried out.
Preferably, the method further comprises:
and if the hole searching operation and the data searching operation are executed and the holes and the data are not found, returning first error information.
Preferably, the method further comprises:
and counting the continuous working time of the migration cooperative distance, stopping the migration cooperative distance if the continuous working time exceeds a preset threshold value, and returning second error information.
In order to solve the above technical problem, the present application further provides a data migration apparatus, including:
the pre-searching module is used for executing hole searching operation and data searching operation and recording hole addresses and data offset addresses;
the migration judgment module is used for judging whether the current data offset address is smaller than the hole address, if yes, triggering the first transmission module, and if not, triggering the second transmission module;
the first transmission module is used for carrying out data transmission according to the hole address;
and the second transmission module is used for re-executing the hole searching operation, updating the hole address and carrying out data transmission according to the updated hole address.
Preferably, the data migration apparatus further includes:
and the first processing module is used for discarding the current hole address and the data offset address if the punching operation is detected to be executed in the data area, and re-triggering the pre-searching module before the next data transmission.
And the second processing module is used for executing the hole searching operation and executing the hole searching operation every time the data transmission is carried out when the hole searching operation is executed and the data searching operation is executed only to find holes but not to find data.
And the first alarm module is used for returning first error information if the hole searching operation and the data searching operation are executed and the hole and the data are not found.
And the second alarm module is used for counting the continuous working time of the migration cooperative distance, stopping the migration cooperative distance if the continuous working time exceeds a preset threshold value, and returning second error information.
In order to solve the above technical problem, the present application further provides a data migration apparatus, including:
a memory for storing a computer program;
and a processor for implementing the steps of the data migration method as described above when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program implements the steps of the data migration method described above when executed by a processor.
According to the data migration method, the hole position and the offset position of the data to be migrated are determined by searching the hole (seek hole) and searching the data (seek data) once, and the determined information is stored, so that in the subsequent data transmission process, if the current data offset address is smaller than the hole position in each data transmission process, the searching (seek) operation is not needed again, the data transmission is directly performed through the hole position stored previously until the data between the data offset position and the hole address are completely transmitted, the times of calling the searching operation in the data migration process are greatly reduced, the time of the migration process for realizing the data migration for occupying global resources and locking resources of the virtual machine is shortened, and the probability of the occurrence of a dead halt condition of the virtual machine is greatly reduced.
The data migration device and the computer readable storage medium provided by the application correspond to the method and have the same effects.
Drawings
For a clearer description of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a data migration method provided by the invention;
FIG. 2 is a schematic diagram of a conventional data migration process;
FIG. 3 is a schematic diagram of a data migration process according to the present invention;
FIG. 4 is a schematic diagram of a data migration process when a data area is perforated according to the present invention;
FIG. 5 is a schematic diagram of a data migration flow when the found area is a hole;
FIG. 6 is a block diagram of a data migration apparatus according to the present invention;
fig. 7 is a block diagram of another data migration apparatus according to the present invention.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments herein without making any inventive effort are intended to fall within the scope of the present application.
The core of the application is to provide a data migration method, a data migration device and a medium thereof.
In order to provide a better understanding of the present application, those skilled in the art will now make further details of the present application with reference to the drawings and detailed description.
In existing implementations of virtual machine data migration, once every 1M of data is transferred, a lookup operation needs to be performed, resulting in a lookup being frequently invoked. And each time the seek operation is executed, the file system needs to load metadata corresponding to the data offset or the hole from the hard disk into the memory, if the disk space of the virtual machine is larger and the hole position of the file is more back, the seek process can be time-consuming. And most of the time in the whole migration process is used for searching the data offset position or the hole address, namely, the metadata is read from the disk and loaded into the memory, and the real time proportion for data transmission is inverse and very low.
Taking the OCFS2 file system as an example, metadata is managed by an extent block (extent block). An extension block has 252 records (records), each record corresponding to a file. If the fragmentation of the file is serious, the file is a 1M file, and 3 extensions can only cover file metadata with the size of 756M corresponding to one record in the extensions.
In addition, the current storage migration is realized in the QEMU main thread through a coroutine, if the migration coroutine takes longer time and does not actively execute yield, the QEMU main thread always occupies lock resources and does not release the lock resources, so that a virtual processor (VCPU) exits to the QEMU to always wait for the lock resources when processing Input and Output (IO), further, the VCPU is affected to execute virtual machine instructions, and the specific expression is that the virtual machine internal operation is blocked or even directly blocked.
yield: when there is a yield in a function, the function is a generator. When this function is called, the code written in the function body is not executed, but only one generator object is returned, and then the code will be executed each time this generator is used.
In order to solve the above problem, the present application provides a data migration method, as shown in fig. 1, including:
s11: and executing the hole searching operation and the data searching operation, and recording the hole address and the data offset address.
S12: and judging whether the current data offset address is smaller than the hole address, if so, turning to the step S13, and if not, turning to the step S14.
S13: and carrying out data transmission according to the hole address.
S14: and re-executing the hole searching operation, updating the hole address, and carrying out data transmission according to the updated hole address.
As can be seen from the above embodiments, each time the file system transmits a certain amount of data (for example, each time 1M of data is transmitted, the following description also illustrates 1M as an example), a seek needs to be performed, which is determined by the characteristics of the file system itself, each time data transmission is performed in units of 1M, and a data migration process (all data are migrated) includes multiple data transmission processes (1M of data are transmitted).
Therefore, when the data migration method according to the above embodiment performs data migration, the determining step of step S12 should be performed once every time 1M data transmission is performed, so as to determine whether to skip the seek operation to directly perform data transmission through the previously recorded hole address or to re-perform the seek hole operation to determine a new hole address. For determining the offset address of the data, since the step S11 has already performed the data searching operation, the offset address of the data is determined, and the size of the data transmitted by the file system is fixed each time, when the data transmission is performed subsequently, only the migrated data amount is added on the basis of the previously searched offset address of the data, and the searching operation is not required to be repeated.
The existing data migration process is as shown in fig. 2, and before each data transmission (1M data), a seek operation (including at least one seek hole operation) is required, so that the current data block (i.e. the 1M data to be transmitted) is transmitted to the hole. Assuming that nM data exists before the hole, and accordingly, migration of this nM data requires at least n lookup operations (1 st seek、2 nd seek、3 rd seek……)
When the virtual machine data is migrated by the data migration method provided in this embodiment, the data migration process is shown in fig. 3, after the first searching operation (searching for the hole and searching for the data once), the searching operation is not needed again when the data before the hole is transmitted, and only 1 searching operation (1) st seek), compared with the existing data migration flow, the number of times of searching operation is greatly reduced, so that the time of occupying global lock resources by migration protocol is reduced, the time required by executing data migration tasks is shortened, and the influence on VCPU resource scheduling is reduced.
It should be noted that, in fig. 2 and 3, although the hole is also represented by a rectangle, it does not represent that it occupies only 1M space as the previous data, and in fact, the size of the data block of fig. 2 and 3, where the start address and the end address are not marked, is not limited. Similarly, for a plurality of data blocks (1M data) transferred to the hole, the storage order of the data blocks transferred to the hole should be identical to the order before the transfer.
According to the data migration method, when the data position and the hole position are searched for the first time in the migration process of the virtual machine, the offset address and the hole address of the data are recorded. Before the next searching is executed, whether the offset address of the current data is smaller than the hole address recorded last time is judged, if so, the hole position searching is not carried out any more, all data between the data offset address and the hole address are directly transmitted, and then the next migration data and the hole searching are carried out. After the optimization is performed by the method, the searching times of the virtual machine in the data migration process can be obviously reduced, the time of the migration protocol occupying the global lock resource can be obviously shortened, the file system can migrate data under the condition of no speed limit, the execution time of migration tasks is shortened, the scheduling of VCPU is not influenced, and the normal operation and performance of the virtual machine are ensured.
It should be further noted that, since the hole searching operation and the data searching operation performed in step S11 are both known, and accordingly, the next searching operation is not required until all the data between the current data offset address and the hole address is migrated. As already explained in the above embodiment, the file system is configured to divide data into a plurality of data blocks with a size of 1M for transmission when performing data migration, so when performing migration of all data between the current data offset address and the hole address, data transmission according to the current data offset address and the hole address is repeated continuously, and step S12 is configured to determine whether the current data offset address is smaller than the hole address, that is, determine whether migration of all data between the found data offset address and the hole address is completed.
Based on the foregoing, further, this embodiment provides a preferred embodiment, wherein the data transmission according to the hole address in the foregoing steps is specifically:
and transmitting all data between the hole address and the current data offset address to the hole.
In this embodiment, the number of data transmission times required for transferring all data between the data offset address and the hole address may be determined according to the size of the data size of the actual file system for single transmission and the size of the data size between the data offset address and the hole address, so that the judgment in step S12 is not required before the data transmission of the required number is completed, and the data migration process is further simplified, so as to improve the data migration efficiency and reduce the influence on the performance of the virtual machine.
In addition, this example also provides another preferred embodiment, where step S12 is:
s12: before each data transmission, judging whether the current data offset address is smaller than the hole address, if yes, going to step S13, otherwise, going to step S14.
Correspondingly, step S13 and step S14 are again:
s13: and finishing the data transmission according to the hole address, and updating the data offset address.
S14: and re-executing the hole searching operation, updating the hole address, completing the data transmission according to the updated hole address, and updating the data offset address.
It will be readily appreciated that the updating of the data offset address is determined by the previous data offset address and the amount of data that was transferred this time.
The preferred scheme provided by the embodiment is that before each data transmission, whether the current data offset address is smaller than the previously recorded hole address is judged; if the data is smaller than the current offset address, the corresponding data is transmitted to the hole without searching; if the data is greater than or equal to the hole address, the data between the initially searched data offset address and the hole address is completely migrated, and the next data searching and hole searching are performed. In addition, the embodiment updates the data offset address after completing data transmission each time, so that data searching is not needed again when data migration is performed, the call to searching operation is further reduced, virtual machine resources are released, and the possibility of occurrence of problems such as blocking and even dead halt of the virtual machine is reduced.
In the actual virtual machine data migration process, it may happen that the data to be migrated is released or deleted for some reason, that is, the original data area has a hole, which is also called the current data area is perforated.
In the data area where the data searching operation has been performed to determine, if a hole is punched, on the one hand, the data changes, and on the other hand, a new hole is formed, and at this time, an error is prone to occur in data transmission according to the originally recorded data offset address and the hole address, so the present embodiment further provides a preferred implementation manner based on the above embodiment, and the method further includes:
s15: if the hole punching operation is detected to be executed in the data area, discarding the current hole address and the data offset address, returning to the steps of executing the hole searching operation and the data searching operation before the next data transmission, and recording the hole address and the data offset address.
As shown in fig. 4, when a hole is made in the data area to be migrated, which is previously determined through the data searching operation, it means that the previously determined data area is changed and a new hole is made, so that neither the previously recorded data offset address nor the hole position is applicable. The hole searching operation and the data searching operation need to be performed again before the next data transmission starts, so as to update the data offset address and the hole address, that is, step S11 is performed again, the subsequent procedure is still the same as the above embodiment, and the branch entering step S13 or step S14 is determined by the judgment of step S12, so as to complete the migration task of the newly determined data area.
According to the preferred scheme provided by the embodiment, a corresponding solution is provided for an application scene possibly occurring in an actual data migration process, when a data area to be migrated determined through a data searching operation is drilled, whether the data area to be migrated or a hole is migrated is changed, and the data offset address and the hole position recorded previously are not suitable for a new scene, so that the data searching operation and the hole searching operation are re-executed through the preferred scheme provided by the embodiment, the new data offset address and the hole address are recorded to adapt to the application scene of the data area after the drilling condition occurs, so that the searching operation can still be skipped through the data offset address and the hole address recorded previously in the subsequent data transmission process, the influence on the performance and normal operation of a virtual machine is reduced, and the subsequent data migration process is ensured to be completed accurately and efficiently.
In the same way as in the above embodiment, when the first hole searching operation and the data searching operation are performed, if a large part of the front of the disk is a hole and the data is located relatively far back, a situation may occur in which only the hole is searched and the data is not searched, that is, the searched area is a hole. At this time, the present example also provides a preferred embodiment, the above method further comprising:
s16: if the operation of searching for the hole and the operation of searching for the data only find the hole and not find the data, the operation of searching for the hole is executed each time the data transmission is carried out.
According to the method, when the hole searching operation and the data searching operation are executed to find only the hole but not the data, the data is stored in the virtual machine disc at a position relatively later, the position of the disc at the front is a large-block hole, and in the initial hole searching operation, the metadata of the hole is loaded into the memory, and then the metadata is not required to be repeatedly loaded when the holes are searched again, so that the speed of searching operation is greatly improved. Therefore, when the data transmission is carried out subsequently, the current hole position and the data offset address searched next time are not required to be reserved, as shown in fig. 5, the traditional scheme of searching the hole operation once every 1M data transmission is used, so that the accurate migration of the data is ensured, and as the metadata of most holes in front of the virtual machine disk are loaded into the memory in the initial hole searching process, the subsequent repeated calling search is carried out to search the hole position, excessive virtual machine resources are not occupied, the time consumption is very small, and the influence on the performance of the virtual machine is almost negligible.
The embodiment provides a preferred scheme aiming at another application scene possibly occurring in the process of actually carrying out virtual machine data migration, and on the basis of the embodiment, if only a hole is found when hole searching operation and data searching operation are carried out for the first time, the fact that the position of data stored in a virtual machine disk is likely to be relatively back is indicated that most of the front of the virtual machine disk is the hole. At this time, since the first hole searching operation has already loaded most of the metadata of the previous holes into the memory, the subsequent hole searching operation does not need to repeatedly load the metadata into the memory, the time consumption of the searching operation is greatly reduced, the influence on the performance of the virtual machine is negligible, so that the subsequent data migration process can use the traditional scheme of carrying out hole searching once per data transmission, so that the smooth migration of the data is ensured, the performance of the virtual machine is not greatly influenced, the normal operation of the virtual machine can be ensured, and the problems of blocking, dead halt and the like of the virtual machine are prevented.
In addition, if the hole searching operation and the data searching operation do not obtain results, only holes or data in the disk of the virtual machine are searched under normal conditions when the searching operation is performed, so that the situation that the virtual machine is abnormal is shown.
For another special application scenario in the data migration process, the embodiment also provides a preferred implementation manner, and the method further includes:
s17: and if the hole searching operation and the data searching operation are executed and the holes and the data are not found, returning first error information.
It should be noted that, the present embodiment is not limited to the expression form of the first error message, and should be determined according to practical situations. For example, the means for displaying the first error information is a display screen, and the first error information may be displayed in the form of text, images, tables, and the like; the first error information can also be acousto-optic information displayed by the light emitting diode and the buzzer; or, the first error information may also be a prompt message pushed to a mobile terminal held by a related person in a form of a short message, a push, a mail, etc., which is not limited in this embodiment, and the purpose of returning the first error information is to prompt the related person that the virtual machine application may be abnormal, so that the data migration process cannot continue to be performed normally, and the abnormal problem needs to be checked and solved in time, so as to ensure smooth implementation of the data migration process.
In the above embodiment, it has been clearly explained that in the conventional virtual machine data migration scheme at present, the migration protocol for implementing data migration needs to load the corresponding metadata into the VCPU memory for each lookup operation due to frequent call of the lookup operation, so that the migration protocol occupies the global lock resource for a long time, and affects the performance of the virtual machine and even causes a crash. The present example therefore also provides a preferred embodiment on the basis of the above example, the above method further comprising:
s18: and counting the continuous working time of the migration cooperative distance, stopping the migration cooperative distance if the continuous working time exceeds a preset threshold value, and returning second error information.
It is to be understood that the second error information mentioned in this embodiment is different from the first error information in the above embodiment, so that the first and second error information are distinguished, but this embodiment is not limited to the difference in the representation and the content of the first error information and the second error information, and in general, in order to enable the related personnel to distinguish the virtual machine fault situation, the content of the first error information and the second error information should be different. As for the expression form of the second error information, as with the expression form of the first error information in the above-described embodiment, one or more forms which are more suitable for the actual situation may be selected from the several implementation forms provided in the above-described embodiment, and this embodiment is not limited thereto.
It should be noted that, there is no sequence limitation between steps S15, S16, S17, S18 and the previous steps S11 to S13, each step has a corresponding trigger condition, and the actual execution sequence is determined according to the trigger condition, and at the same time, in the actual data migration process, the same step may be repeatedly invoked.
According to the preferred scheme provided by the embodiment, the continuous working time of the migration cooperative distance for realizing the data migration of the virtual machine is counted and compared with the preset threshold value, whether the normal operation of the virtual machine is influenced by the overtime of the current data migration process is judged, and if the overtime is reached, the migration cooperative distance is stopped, so that the normal use of the virtual machine is ensured. Because the embodiment is based on the above embodiment, the data migration method provided by the above embodiment can effectively reduce the number of times of the call of the search operation, and in general, the problem of normal operation of the application virtual machine will not occur, and if the continuous working time of the migration protocol exceeds the preset threshold on the basis of the above embodiment, it is indicated that an abnormality may occur in the current virtual machine data migration process, so that the current migration protocol is stopped and related personnel are timely prompted to perform the troubleshooting and solving of the fault problem.
In the foregoing embodiments, a detailed description is provided for a data migration method, and the application further provides a corresponding embodiment of a data migration apparatus. It should be noted that the present application describes an embodiment of the device portion from two angles, one based on the angle of the functional module and the other based on the angle of the hardware.
Based on the angle of the functional modules, as shown in fig. 6, this embodiment provides a data migration apparatus, including:
a pre-searching module 21, configured to perform a hole searching operation and a data searching operation, and record a hole address and a data offset address;
the migration determining module 22 is configured to determine whether the current data offset address is smaller than the hole address, if yes, trigger the first transmission module, and if no, trigger the second transmission module;
a first transmission module 23, configured to perform data transmission according to the hole address;
and the second transmission module 24 is configured to re-perform the hole searching operation, update the hole address, and perform data transmission according to the updated hole address.
Preferably, the data migration apparatus further includes:
and the first processing module is used for discarding the current hole address and the data offset address if the punching operation is detected to be executed in the data area, and re-triggering the pre-searching module before the next data transmission.
And the second processing module is used for executing the hole searching operation and executing the hole searching operation every time the data transmission is carried out when the hole searching operation is executed and the data searching operation is executed only to find holes but not to find data.
And the first alarm module is used for returning first error information if the hole searching operation and the data searching operation are executed and the hole and the data are not found.
And the second alarm module is used for counting the continuous working time of the migration cooperative distance, stopping the migration cooperative distance if the continuous working time exceeds a preset threshold value, and returning second error information.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
According to the data migration device provided by the embodiment, when the pre-search module searches the data position and the hole position for the first time in the migration process of the virtual machine, the offset address and the hole address of the data are recorded. Before the next searching is executed, judging whether the offset address of the current data is smaller than the hole address recorded last time or not through the migration judging module, if so, triggering the first transmission module, not searching the hole position, directly transmitting all data between the data offset address and the hole address, and if not, triggering the second transmission module, and carrying out the next migration data and the hole searching to realize data transmission. In the data migration process of the virtual machine realized by the device, the searching times can be obviously reduced, the time of the migration protocol occupying the global lock resource can be obviously shortened, so that the file system can migrate data under the condition of no speed limit, the execution time of a migration task is shortened, the scheduling of the VCPU is not influenced, and the normal operation and performance of the virtual machine are ensured.
Fig. 7 is a block diagram of a data migration apparatus according to another embodiment of the present application, and as shown in fig. 7, a data migration apparatus includes: a memory 30 for storing a computer program;
a processor 31 for implementing the steps of a data migration method according to the above embodiment when executing a computer program.
The data migration device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 31 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 31 may be implemented in hardware in at least one of a digital signal processor (Digital Signal Processor, DSP), a Field programmable gate array (Field-Programmable Gate Array, FPGA), a programmable logic array (Programmable Logic Array, PLA). The processor 31 may also comprise a main processor, which is a processor for processing data in an awake state, also called central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 31 may be integrated with an image processor (Graphics Processing Unit, GPU) for taking care of rendering and rendering of the content that the display screen is required to display. In some embodiments, the processor 31 may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
Memory 30 may include one or more computer-readable storage media, which may be non-transitory. Memory 30 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 30 is at least used for storing a computer program 301, which, when loaded and executed by the processor 31, is capable of implementing the relevant steps of a data migration method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 30 may further include an operating system 302, data 303, and the like, where the storage manner may be transient storage or permanent storage. The operating system 302 may include Windows, unix, linux, among other things. The data 303 may include, but is not limited to, a data migration method, and the like.
In some embodiments, a data migration apparatus may further include a display 32, an input/output interface 33, a communication interface 34, a power supply 35, and a communication bus 36.
Those skilled in the art will appreciate that the configuration shown in fig. 7 is not limiting of a data migration apparatus and may include more or fewer components than shown.
The data migration device provided by the embodiment of the application comprises a memory and a processor, wherein the processor can realize the following method when executing a program stored in the memory: a data migration method.
According to the data migration device provided by the embodiment, the processor executes the computer program stored in the memory, so that when the data position and the hole position are searched for the first time in the migration process of the virtual machine, the offset address and the hole address of the data are recorded. Before the next searching is executed, judging whether the offset address of the current data is smaller than the hole address recorded last time, if so, not carrying out hole position searching, directly transmitting all data between the data offset address and the hole address, otherwise, carrying out next migration data and hole searching to realize data transmission. In the data migration process of the virtual machine realized by the device, the searching times can be obviously reduced, the time of the migration protocol occupying the global lock resource can be obviously shortened, so that the file system can migrate data under the condition of no speed limit, the execution time of a migration task is shortened, the scheduling of the VCPU is not influenced, and the normal operation and performance of the virtual machine are ensured.
Finally, the present application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps as described in the method embodiments above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. With such understanding, the technical solution of the present application, or a part contributing to the prior art or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, performing all or part of the steps of the method described in the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The computer readable storage medium provided in this embodiment, when a computer program stored therein is executed, can record an offset address and a hole address of data when searching for a data location and a hole location in a virtual machine migration process for the first time. Before the next searching is executed, judging whether the offset address of the current data is smaller than the hole address recorded last time, if so, not carrying out hole position searching, directly transmitting all data between the data offset address and the hole address, otherwise, carrying out next migration data and hole searching to realize data transmission. In the data migration process of the virtual machine realized by the device, the searching times can be obviously reduced, the time of the migration protocol occupying the global lock resource can be obviously shortened, so that the file system can migrate data under the condition of no speed limit, the execution time of a migration task is shortened, the scheduling of the VCPU is not influenced, and the normal operation and performance of the virtual machine are ensured.
The above describes in detail a data migration method, device and medium provided in the present application. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A method of data migration, comprising:
executing hole searching operation and data searching operation, and recording hole addresses and data offset addresses;
judging whether the current data offset address is smaller than the hole address or not;
if yes, carrying out data transmission according to the hole address;
if not, re-executing the hole searching operation, updating the hole address, and carrying out data transmission according to the updated hole address.
2. The data migration method of claim 1, wherein transmitting data according to the hole address comprises:
and transmitting all data between the hole address and the current data offset address to the hole.
3. The method of claim 1, wherein determining whether the current data offset address is smaller than the hole address comprises:
before each data transmission, judging whether the current data offset address is smaller than the hole address;
correspondingly, if so, performing data transmission according to the hole address includes:
completing the data transmission according to the hole address, and updating the data offset address;
if not, re-executing the hole searching operation, updating the hole address, and carrying out data transmission according to the updated hole address, wherein the step of carrying out data transmission comprises the following steps:
and re-executing the hole searching operation, updating the hole address, completing the data transmission according to the updated hole address, and updating the data offset address.
4. The data migration method of claim 1, further comprising:
and if the hole punching operation is detected to be executed in the data area, discarding the current hole address and the data offset address, returning to the step of executing the hole searching operation and the data searching operation again before the next data transmission, and recording the hole address and the data offset address.
5. The data migration method of claim 1, further comprising:
and if the hole searching operation and the data searching operation are executed and only find holes but not find data, executing the hole searching operation each time data transmission is carried out.
6. The data migration method of claim 5, further comprising:
and if the hole searching operation and the data searching operation are executed, returning first error information.
7. The data migration method according to any one of claims 1 to 6, further comprising:
and counting the continuous working time of the migration cooperative program, stopping the migration cooperative program if the continuous working time exceeds a preset threshold value, and returning second error information.
8. A data migration apparatus, comprising:
the pre-searching module is used for executing hole searching operation and data searching operation and recording hole addresses and data offset addresses;
the migration judgment module is used for judging whether the current data offset address is smaller than the hole address, if yes, triggering the first transmission module, and if not, triggering the second transmission module;
the first transmission module is used for carrying out data transmission according to the hole address;
and the second transmission module is used for re-executing the hole searching operation, updating the hole address and carrying out data transmission according to the updated hole address.
9. A data migration apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the data migration method according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the data migration method according to any one of claims 1 to 7.
CN202310091509.0A 2023-02-03 2023-02-03 Data migration method, device and medium thereof Pending CN116010036A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310091509.0A CN116010036A (en) 2023-02-03 2023-02-03 Data migration method, device and medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310091509.0A CN116010036A (en) 2023-02-03 2023-02-03 Data migration method, device and medium thereof

Publications (1)

Publication Number Publication Date
CN116010036A true CN116010036A (en) 2023-04-25

Family

ID=86023150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310091509.0A Pending CN116010036A (en) 2023-02-03 2023-02-03 Data migration method, device and medium thereof

Country Status (1)

Country Link
CN (1) CN116010036A (en)

Similar Documents

Publication Publication Date Title
US11397648B2 (en) Virtual machine recovery method and virtual machine management device
US9274798B2 (en) Multi-threaded logging
US20160055095A1 (en) Storing data from cache lines to main memory based on memory addresses
US10609141B2 (en) Methods and apparatuses for cluster switching
EP3860043A2 (en) Method and apparatus for implementing smart contract based on blockchain
CN109359092B (en) File management method, desktop display method, device, terminal and medium
CN108829498B (en) Service data access method and device
CN112597151A (en) Data processing method, device, equipment and storage medium
CN112433669A (en) Method, system, equipment and medium for online migration of distributed storage volume
CN112328602A (en) Method, device and equipment for writing data into Kafka
CN116010036A (en) Data migration method, device and medium thereof
CN116450966A (en) Cache access method and device, equipment and storage medium
CN108062224B (en) Data reading and writing method and device based on file handle and computing equipment
CN114721876A (en) Data backup method, device and medium
CN110716923B (en) Data processing method, data processing device, node equipment and storage medium
CN110543349B (en) Application starting acceleration method and device and computer readable storage medium
CN111881212A (en) Method, device, equipment and storage medium for executing check point operation
CN112231290A (en) Method, device and equipment for processing local log and storage medium
CN114301927B (en) Main node selection method, device and medium in distributed system
CN115328878B (en) Log data storage system, method, device and medium
CN114546289B (en) Method, system, equipment and medium for reading data
CN110955546B (en) Memory address monitoring method and device and electronic equipment
EP2975516A1 (en) Intelligent application back stack management
CN107678838B (en) Method and device for tracking operation of virtual machine and virtual machine management platform
CN115048457A (en) Processing method and device for state data based on block chain and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination