Disk file migration method and device, computer device and storage medium

CN117555647BActive Publication Date: 2026-10-27JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311297408.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-08
Publication Date
2026-10-27
Estimated Expiration
2043-10-08

AI Technical Summary

Technical Problem

[0005]有鉴于此,本申请提供了一种磁盘文件迁移方法、装置、计算机设备及存储介质,以解决缩短磁盘文件的迁移时间,以加速虚拟机的迁移的问题

Benefits of technology

在本地磁盘中,对加密文件按照预设解密算法进行解密;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117555647B_ABST
    Figure CN117555647B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of virtual machine migration, and discloses a disk file migration method and device, computer equipment and a storage medium. According to a time weight determined by a period difference value and a statistical access time length, the total evaluation access time length of each disk file is determined. The total evaluation access time length of each disk file in different time periods is affected by different period difference values, so that the total evaluation access time length of the disk file can reflect the recent access situation of the disk file to a large extent. Therefore, according to the sorting order determined by the total evaluation access time length which can reflect the recent access situation of the disk file, the recently frequently used disk file is preferentially migrated, the hit probability of the destination virtual machine to the recently frequently used disk file is increased, the access time of the disk file of the source end equipment is saved, the migration speed of the virtual machine is increased, the response time of the destination virtual machine is shortened, and the resource occupation time is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of virtual machine migration technology, specifically to disk file migration methods, apparatus, computer equipment, and storage media. Background Technology

[0002] Virtual machine storage migration (VM migration) refers to the process of moving a virtual machine from a source host or storage location (hereinafter referred to as the source end) to a destination host or storage location (hereinafter referred to as the destination end). Since most of the virtual machine's data is stored on its local disk, migrating the disk files is of paramount importance in VM migration.

[0003] Currently, common methods for migrating disk files involve briefly stopping the services of both virtual machines when an input or output (I / O) request is received from the destination virtual machine requesting old disk files from the source device. This process is repeated until all disk files on the source device have been migrated. Alternatively, multiple brief pauses can be made to synchronize all disk files from the source device to the destination device's local disk. However, both methods require significant time for a full scan or frequent access to the source device's disk files, resulting in lengthy migration times and consequently, extended virtual machine migration times.

[0004] Therefore, how to shorten the migration time of disk files in order to accelerate the migration of virtual machines has become an urgent technical problem to be solved. Summary of the Invention

[0005] In view of this, this application provides a disk file migration method, apparatus, computer device, and storage medium to solve the problem of shortening disk file migration time and accelerating virtual machine migration.

[0006] In a first aspect, this application provides a disk file migration method, the method being executed by a destination device, the method comprising: Get the period difference between the current time period and the last time period within a preset time period; Within the current time period, calculate the access duration for each disk file in multiple disk files; The period difference is processed to determine the time weight of each disk file within the current time period. The total estimated access time of the first disk file is determined based on the time weight and access duration of the first disk file in each time period, wherein the first disk file is any one of multiple disk files; Based on the total estimated access time for each disk file in the multiple disk files, the migration order of the multiple disk files is sorted to generate a sorting order; Based on the sorting order, each disk file is migrated from the target disk where the disk files are stored to the local disk of the destination device in turn.

[0007] In the above technical solution, the period difference between the current time period and the last time period is processed to determine the time weight of each disk file within the current time period. This allows each disk file to have a different time weight in different time periods. Consequently, the total estimated access time of each disk file in different time periods is affected by the different period differences. This ensures that the total estimated access time of a disk file can largely reflect its recent access history. Therefore, based on the sorting order determined by the total estimated access time reflecting recent access history, the recent access history of each disk file in the target disk can be accurately reflected. This avoids the situation where frequently accessed disk files, but not recently accessed, have excessively high estimated access times when directly calculating the total access time of disk files within a preset time period. Then, based on this sorting order, frequently used disk files can be migrated first, increasing the probability of the target virtual machine hitting frequently used disk files on the local disk of the destination device. This significantly reduces the probability of remotely scanning disk files on the source device, thus saving access time to disk files on the source device and accelerating virtual machine migration. This also speeds up the response time of the destination virtual machine and reduces resource usage time.

[0008] In some optional embodiments, the period difference is processed to determine the time weight corresponding to each disk file in the current time period, including: Using a preset value as the base and the period difference as the exponent, the time weight corresponding to the disk file is determined. The preset value is greater than 1, and the period difference is less than or equal to 0.

[0009] In the above technical solution, the larger the absolute value of the period difference, the smaller the time weight corresponding to the disk file. In other words, the further the current time period is from the last time period, the smaller the time weight corresponding to the disk file. This means that the further the current time period is from the last time period, the smaller the impact of the disk file access time within the current time period on the subsequently determined total evaluation access time, accurately reflecting the recent access status of each disk file in the target disk. This avoids the problem of frequently accessed disk files in the past, but not recently accessed, yet having excessively high total access time values.

[0010] In some optional embodiments, the total evaluated access time of the first disk file is determined based on the time weight and access duration corresponding to the first disk file in each time period, including: The evaluation access duration within the first time period is determined based on the time weight and access duration of the first disk file in the first time period. The first time period is any time period within a preset time period. The total evaluation access time is determined based on the evaluation access time corresponding to each time period within the preset time period.

[0011] In the above technical solution, the estimated access time of a disk file within a corresponding time period is determined by time weighting and access duration. Then, the total estimated access time is determined based on the estimated access times for each time period. The impact of the time span between each time period and the last time period on the total estimated access time is considered. This accurately reflects the recent access status of disk files, thus ensuring that frequently used disk files can be migrated first.

[0012] In some optional embodiments, after migrating each disk file from the target disk storing the disk files to the local disk of the destination device in order of sorting, the method further includes: In the local disk of the destination device, retrieve the first disk file to be accessed, which can be any one of multiple disk files; When the first disk file to be accessed is found on the local disk, it is determined that the first disk file to be accessed has been successfully migrated from the target disk to the local disk.

[0013] In the above technical solution, the migration of the first disk file to be accessed is determined by whether the first disk file to be accessed is found in the local disk, thereby ensuring that the disk file is actually migrated to the local disk and improving the reliability of the disk file migration result.

[0014] In some optional embodiments, when the migration operation for multiple disk files has not been completed according to the sorting order, the method further includes: When an input request or output request is received, determine the second disk file to be accessed corresponding to the input request or output request; If the second disk file to be accessed is not found on the local disk, the migration operation for the unmigrated disk file is paused, and the second disk file to be accessed is searched for on the target disk. When a second disk file to be accessed is found, the second disk file to be accessed will be migrated from the target disk to the local disk first. After the migration of the second disk file to be accessed is completed, the migration operation continues for the disk files that have not been migrated.

[0015] In the above technical solution, when searching for the second disk file to be accessed on the target disk, the destination device will first migrate the second disk file to be accessed from the target disk to the local disk. After the migration of the second disk file is completed, it will continue to migrate the disk files that have not been migrated. This ensures that the destination virtual machine can access the second disk file normally after a period of waiting, so that the destination virtual machine can run normally during the disk file migration process, minimizing the impact on the operation of the virtual machine.

[0016] In some optional embodiments, each disk file is migrated sequentially from the target disk storing the disk files to the local disk of the destination device according to the sorting order, including: Determine the data fingerprint of each disk file to be migrated; The data fingerprint of each disk file to be migrated is compared with the data fingerprint of the disk files already stored on the local disk; When it is determined that the data fingerprint of at least one disk file to be migrated does not match the data fingerprint of a disk file already stored on the local disk, compression operations are performed on at least one disk file to be migrated respectively. The first disk file to be migrated is encrypted after compression to obtain an encrypted file. The first disk file to be migrated is any one of the disk files to be migrated. Migrate the encrypted files from the target disk to the local disk; On the local disk, the encrypted file is decrypted according to the preset decryption algorithm; If decryption fails, roll back the migration operation on the encrypted file and return an indication message indicating an error in the migration of the first disk file to be migrated. or, When decryption is successful, decompress and save the first compressed disk file to be migrated.

[0017] In the above technical solution, subsequent operations on the disk file to be migrated are only performed when the data fingerprint of at least one disk file to be migrated does not match the data fingerprint of a disk file already stored on the local disk. This avoids the situation of duplicate migrations when some disk files already exist on the local disk and do not need to be migrated. Migrating the first disk file to be migrated only after the first disk file to be migrated improves the migration speed of the first disk file. Furthermore, the first disk file to be migrated is a compressed and encrypted file. The compressed first disk file to be migrated is only decompressed and saved after the encryption file is successfully decrypted, ensuring the security of the first disk file to be migrated and thus improving the reliability of disk file migration. When decryption fails, the migration operation on the encrypted file is rolled back, restoring the state before the migration of the first disk file to be migrated and returning an error indication message for the migration of the first disk file to be migrated, further improving the reliability of disk file migration.

[0018] In some optional embodiments, the destination device includes multiple migration threads, and the method further includes: According to the sorting order, each migration thread selects disk files from the disk files to be migrated and performs parallel migration.

[0019] In the above technical solution, the destination device will use each migration thread to select multiple disk files from the disk files to be migrated in the order of sorting and migrate them in parallel to speed up the migration of disk files and thus realize the rapid migration of virtual machines.

[0020] Secondly, this application provides a disk file migration apparatus, which is executed by a destination device, and the apparatus includes: The acquisition module is used to obtain the period difference between the current time period and the last time period within a preset time period; The statistics module is used to calculate the access time for each disk file in multiple disk files within the current time period. The first determining module is used to process the period difference data and determine the time weight corresponding to each disk file in the current time period. The second determining module is used to determine the total evaluated access time of the first disk file based on the time weight and access time of the first disk file in each time period, wherein the first disk file is any one of multiple disk files; The sorting module is used to sort the migration order of multiple disk files based on the total estimated access time corresponding to each disk file, and generate a sorting order. The migration module is used to migrate each disk file from the target disk where the disk files are stored to the local disk of the destination device in the order of sorting.

[0021] Thirdly, this application provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the above-mentioned disk file migration method.

[0022] Fourthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the aforementioned disk file migration method. Attached Figure Description

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

[0024] Figure 1 This is a schematic diagram of the structure of a disk file migration system according to an embodiment of this application; Figure 2 This is a schematic flowchart of a disk file migration method according to an embodiment of this application; Figure 3 This is a schematic diagram illustrating the migration of disk files, as shown in one example of this application; Figure 4 This is a flowchart illustrating yet another disk file migration method implemented according to this application; Figure 5 This is a flowchart illustrating another disk file migration method implemented according to this application; Figure 6 This is a flowchart of a disk file migration method in one application scenario of this application; Figure 7 This is a structural block diagram of a disk file migration device according to an embodiment of this application; Figure 8 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation

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

[0026] It should be understood that the term "instruction" mentioned in the embodiments of this application can be a direct instruction, an indirect instruction, or an indication of a relationship. For example, A instructing B can mean that A directly instructs B, such as B being able to obtain information through A; it can also mean that A indirectly instructs B, such as A instructing C, so B can obtain information through C; or it can mean that there is a relationship between A and B.

[0027] In the description of the embodiments of this application, the term "correspondence" may indicate that there is a direct or indirect correspondence between two things, or that there is an association between two things, or that there is a relationship of instruction and being instructed, configuration and being configured, etc.

[0028] In the embodiments of this application, "predefined" can be achieved by pre-storing corresponding codes, tables or other means that can be used to indicate relevant information in the device (e.g., including terminal devices and network devices). This application does not limit the specific implementation method.

[0029] First, let me introduce the terminology used in this application.

[0030] On-demand paging: A disk file migration method. This method migrates the virtual machine's memory state data from the source device to the destination device. After the migration is complete, the virtual machine rebuilds its memory state and resumes operation. The destination virtual machine then reads the required disk files directly from the local disk of the destination device or remotely from the source device, based on the current service needs. Initially, the disk files on the source device can be referred to as old files, which exist only on the source device. In this migration method, if the destination virtual machine I / O requests an old file, the destination virtual machine remotely accesses the disk of the source device, and the old file becomes a new file and is copied to the local disk of the destination device.

[0031] Active push: Based on the on-demand page retrieval migration method, the disk files are migrated from the source device to the destination device in the order they were successfully created. Regardless of whether the destination virtual machine has I / O requests, the disk files are migrated synchronously from the source device to the destination device.

[0032] Half-life: refers to the time required for half of the atomic nuclei of a radioactive element to decay. It can be used to infer the relationship between the mass of the decaying substance, the mass of the decayed substance, and the mass of the remaining undecayed substance after a certain number of half-lives. The formula is m = M(1 / 2)^(t / T), where M is the mass of the atomic nuclei before the reaction, m is the mass of the atomic nuclei after the reaction, t is the reaction time, and T is the half-life.

[0033] Currently, virtual machine migration (also known as virtual machine storage migration or virtual machine storage migration) methods are divided into offline migration and online migration.

[0034] Offline migration requires shutting down or suspending the virtual machine. If shared storage is used, only the virtual machine's memory state needs to be migrated to the destination device, then the virtual machine's state is rebuilt and normal operation is restored. If local storage is used, both the virtual machine's memory state and disk files need to be migrated to the destination device. This is the most common and conventional migration method, but its disadvantage is also obvious: it requires stopping the virtual machine, making it unusable during the migration process, and the downtime is proportional to the size of the virtual machine to be migrated.

[0035] The online migration process is similar to offline migration, but online migration minimizes the impact on virtual machine operation, resulting in only a very brief service interruption. Typically, migrating disk files from the source device takes a considerable amount of time because the amount of data stored on the source device's disk is often much larger than the amount of data in memory. Currently, the mainstream online migration method for virtual machines combines on-demand paging and proactive pushing to quickly complete the disk file migration, thereby expediting the virtual machine migration.

[0036] However, because the proactive push migration rule follows the order in which disk files were created, an earlier-created disk file does not necessarily mean it is frequently used. When the destination virtual machine reads the required disk file from the local disk file of the destination device according to the current service needs, it often finds that the disk file to be read has not yet been migrated from the source device to the destination device's local disk. Therefore, it needs to remotely read the required disk file from the source device. This leads to frequent remote scanning of disk files on the source device when there are many disk files created later but used frequently, resulting in the migration of the currently needed disk file from the source device to the destination device. This not only increases the disk file migration time but also increases the response time and resource consumption time of the destination virtual machine.

[0037] Therefore, when migrating disk files, you can first migrate the disk files that will be used soon. This increases the probability of the destination virtual machine hitting frequently used disk files on the local disk of the destination device, greatly reducing the probability of remotely scanning disk files on the source device. This saves access time to disk files on the source device and speeds up the virtual machine migration. At the same time, it also speeds up the response time of the destination virtual machine and reduces resource consumption time.

[0038] Figure 1 This is a schematic diagram of a disk file migration system according to an embodiment of this application. The disk file migration system 100 includes a source device 110 and a destination device 120. The source device 110 runs a source virtual machine and includes a target disk 111, which stores disk files that support the operation of the source virtual machine. The destination device 120 includes a local disk 121, which is used to store the disk files in the target disk 111 during the migration of the source virtual machine.

[0039] The source device 110 and the destination device 120 can be any electronic device with data processing, virtual machine operation and migration capabilities, such as a host or server.

[0040] The source device 110 records the duration of each access to disk files in the target disk 111 in the log file.

[0041] The destination device 120 remotely accesses the log files of the source device 110 within the current time period of a preset time period to find the duration of each access to each disk file in the target disk 111 within the current time period. The access durations of each disk file are then summed to obtain the access duration of each disk file within the current time period. The period difference between the current time period and the last time period within the preset time period is obtained; the period difference is processed to determine the time weight corresponding to each disk file within the current time period; based on the time weight and access duration of the first disk file in each time period, the total estimated access duration of the first disk file is determined, where the first disk file is any one of multiple disk files; based on the total estimated access duration of each disk file, the migration order of the multiple disk files is sorted to generate a sorting order; according to the sorting order, each disk file is migrated sequentially from the target disk storing the disk file to the local disk of the destination device.

[0042] Optionally, the destination device 120 can also perform encryption operations on the disk files in the target disk 111, such as determining the hash value of the disk files in the target disk 111. It can also perform compression and decompression operations on the disk files in the target disk 111. Furthermore, it can calculate the Message-Digest Algorithm 5 (MD5) value of the disk files in the target disk 111.

[0043] Optionally, the destination device 120 may also include multiple migration threads to accelerate the transfer speed of disk files through multi-threading.

[0044] Figure 2 This is a flowchart illustrating a disk file migration method according to an embodiment of this application. The method is executed by a destination device, which may be... Figure 1 The destination device 120 is shown. (As shown) Figure 2 As shown, this disk file migration method includes the following steps: Step 201: Obtain the period difference between the current time period and the last time period within the preset time period.

[0045] The preset time period and its specific duration can be set independently. For example, the preset time period could be 12 months with a 1-month period, or the preset time period could be 3 months with a 7-day period. This embodiment does not impose specific limitations. The destination device determines which time period within the preset time period it belongs to, based on the chronological order of the times, thus obtaining the number of periods corresponding to the current time period and the total number of time periods within the preset time period. The difference between this number of periods and the total number is then defined as the period difference between the current time period and the last time period. For example... Figure 3 As shown, taking a preset time period from January to April, with a time cycle of 1 month as an example, the time cycle number for January is 1, and so on, with the time cycle number for April being 4. The cycle differences between January to April and the last time cycle are 1-4=-3, 2-4=-2, 3-4=-1, and 4-4=0, respectively.

[0046] Step 202: Within the current time period, calculate the access duration for each disk file in the multiple disk files.

[0047] In this process, multiple disk files are stored on the target disk of the source device. The source device, where the target disk resides, records the duration of each access to a disk file on the target disk within a specific time period in its log file. The destination device remotely accesses this log file within the current time period of a preset time interval to find the duration of each access to a disk file on the target disk within that time period. The access durations of each disk file are then summed to obtain the total access duration for each disk file within the current time period. This allows for the individual calculation of the access duration for each disk file across multiple disk files. For example, if disk file x on the target disk is accessed 3 times within the current time period, with access durations of 5 minutes, 10 minutes, and 25 minutes respectively, then the total access duration for disk file x within the current time period is 5 + 10 + 25 = 40 minutes.

[0048] Step 203: Process the period difference data to determine the time weight corresponding to each disk file in the current time period.

[0049] The destination device can use the result of the exponential operation in the half-life calculation formula as the time weight of each file in the current time period, except that the result of the exponential operation is a negative number of the period difference.

[0050] Step 204: Determine the total estimated access time of the first disk file based on the time weight and access duration corresponding to the first disk file in each time period.

[0051] The first disk file can be any one of multiple disk files. Within each time period, the destination device multiplies the time weight of each disk file by its corresponding access duration. Then, it sums the results from all time periods, and the summation value is used to determine the total estimated access duration of the first disk file. Figure 3 Disk file 1 had an access duration of 20 minutes in January, 0 minutes in February and March, and 40 minutes in April. The time weight for disk file 1 in January is 0.125, and the time weight in April is 1. Therefore, the total estimated access duration for disk file 1 is... minute.

[0052] Step 205: Sort the migration order of the multiple disk files according to the total estimated access time corresponding to each disk file in the multiple disk files, and generate a sorting order.

[0053] The destination device sorts the total estimated access time of multiple disk files in descending order, thereby completing the sorting operation of the migration order of multiple disk files and obtaining the sorting order.

[0054] Step 206: According to the sorting order, each disk file is migrated from the target disk where the disk files are stored to the local disk of the destination device.

[0055] The destination device will migrate the disk files in the sorted order from the target disk to the local disk of the destination device.

[0056] In this embodiment, the period difference between the current time period and the last time period is processed to determine the time weight of each disk file within the current time period. This allows for different time weights for each disk file in different time periods. Consequently, the total estimated access time of each disk file in different time periods is affected by the different period differences. This ensures that the total estimated access time of a disk file largely reflects its recent access history. Therefore, based on the sorting order determined by the total estimated access time reflecting recent disk file access, the recent access history of each disk file in the target disk can be accurately reflected. This avoids the situation where frequently accessed disk files, but not recently accessed, have excessively high estimated access times when directly calculating the total access time of disk files within a preset time period. Then, based on this sorting order, frequently used disk files can be migrated first, increasing the probability of the target virtual machine hitting frequently used disk files on the local disk of the destination device. This significantly reduces the probability of remotely scanning disk files on the source device, thereby saving access time to disk files on the source device and accelerating virtual machine migration. This also speeds up the response time of the destination virtual machine and reduces resource usage time.

[0057] According to the formula for calculating half-life, the longer the decay time, the smaller the remaining mass of the atomic nucleus. Applying this to the migration process of disk files, the further away the access time of a disk file is from the last time period within a preset time frame, the smaller its impact on the final total estimated access time should be. In other words, the time weight corresponding to the disk file in time periods further away from the last time period should be smaller. To reflect this change... Figure 4 Yes, this is a flowchart illustrating another disk file migration method according to an embodiment of this application. The method is executed by a destination device, which can be... Figure 1 The destination device 120 is shown. (As shown) Figure 4 As shown, this disk file migration method includes the following steps: Step 401: Obtain the period difference between the current time period and the last time period within the preset time period.

[0058] Please see details Figure 2 Step 201 of the illustrated embodiment will not be repeated here.

[0059] Step 402: Within the current time period, calculate the access duration for each disk file in the multiple disk files.

[0060] Please see details Figure 2 Step 202 of the illustrated embodiment will not be repeated here.

[0061] Step 403: Process the period difference data to determine the time weight corresponding to each disk file in the current time period.

[0062] Please see details Figure 2 Step 203 of the illustrated embodiment will not be described again here.

[0063] Optionally, step 403 may include: determining the time weight corresponding to the disk file using a preset value as the base and the period difference as the exponent.

[0064] The preset value is greater than 1, with a preferred preset value of 2, and the period difference is less than or equal to 0. The destination device can substitute the period difference into the formula within the current time period. In this process, the time weight corresponding to each disk file is determined, where, This represents the period difference, where 'a' is the a-th disk file among multiple disk files, 'y' is the y-th time period within a preset time period, and 'Y' is the total number of time periods within the preset time period. This represents the time weight of the a-th disk file within the current time period.

[0065] The larger the absolute value of the period difference, the smaller the time weight corresponding to the disk file. In other words, the further the current time period is from the last time period, the smaller the time weight of the disk file. This means that the further the current time period is from the last time period, the smaller the impact of the disk file access time within the current time period on the subsequently determined total access time, accurately reflecting the recent access status of each disk file on the target disk. This avoids the problem of frequently accessed disk files in the past, but not recently accessed, yet having excessively high total access time values.

[0066] Step 404: Determine the total estimated access time of the first disk file based on the time weight and access duration corresponding to the first disk file in each time period.

[0067] Please see details Figure 2 Step 204 of the illustrated embodiment will not be repeated here.

[0068] Optionally, step 404 includes the following steps 4041 to 4042: Step 4041: Determine the evaluation access duration within the first time period based on the time weight and access duration corresponding to the first disk file in the first time period.

[0069] Step 4042: Determine the total evaluation access duration based on the evaluation access duration corresponding to each time period within the preset time period.

[0070] The first time period is any time period within a preset time period. The destination device multiplies the time weight corresponding to the first disk file in the first time period by its corresponding access duration to obtain the estimated access duration of the first disk file in the first time period. This process is repeated to determine the estimated access duration of the first disk file in other time periods. The estimated access durations corresponding to the first disk file in all time periods are then added together to obtain the total estimated access duration of the first disk file within the preset time period. The destination device can repeat this process to obtain the total estimated access duration for each disk file. Steps 4041 to 4042 can be expressed using the formula... It means that, among them, This represents the total estimated access time for the a-th disk file within the preset time period. This represents the access duration of disk file a within time period y. It can be understood that when there is only one time period within the preset time period, the time weight of each disk file is 1, and the total evaluated access duration of each disk file within the preset time period is its own access duration.

[0071] The estimated access duration of a disk file within a corresponding time period is determined by weighting it with time and the access duration itself. Then, the total estimated access duration is determined based on the estimated access durations for each time period. The impact of the time span between each time period and the last time period on the total estimated access duration is considered. This accurately reflects the recent access status of disk files, thus ensuring that frequently used disk files can be migrated first.

[0072] Step 405: Sort the migration order of the multiple disk files according to the total estimated access time corresponding to each disk file in the multiple disk files, and generate a sorting order.

[0073] Please see details Figure 2 Step 205 of the illustrated embodiment will not be repeated here.

[0074] In one example, continue combining Figure 3 Within the target disk, disk file 2 is created first, and disk file 3 is created last. The time weights of the multiple disk files from January to April are 0.125, 0.25, 0.5, and 1, respectively. The access durations of disk file 2 from January to April are 30 minutes, 25 minutes, 0 minutes, and 10 minutes, respectively. The access durations of disk file 3 from January to April are 0 minutes, 5 minutes, 5 minutes, and 39 minutes, respectively.

[0075] If a disk file migration is to be performed in May, analysis shows that disk file 3 has been accessed for a longer period recently and should be migrated first. The total estimated access time for disk file 1 is 42.5 minutes, for disk file 2 it is 20 minutes, and for disk file 3 it is 42.75 minutes. The final order of the three disk files is disk file 3 -> disk file 1 -> disk file 2, which aligns with the previous analysis that disk file 3 should be migrated to the local disk first. Figure 3 The data 1 to 3 in the table represent the migration order of disk files 1 to 3. The order of disk files from top to bottom on the local disk is the same as the saving order of disk files 1 to 3. The order of disk files from top to bottom on the target disk is the same as the creation order of the disk files on the target disk.

[0076] Step 406: According to the sorting order, each disk file is migrated from the target disk where the disk files are stored to the local disk of the destination device.

[0077] Please see details Figure 2 Step 206 of the illustrated embodiment will not be described again here.

[0078] Optionally, to further accelerate the migration of disk files, the destination device may include multiple migration threads, and the disk file migration method may also include: According to the sorting order, each migration thread selects disk files from the disk files to be migrated and performs parallel migration.

[0079] The destination device will use each migration thread to select multiple disk files from the disk files to be migrated in the order of sorting and migrate them in parallel to speed up the migration of disk files and thus achieve rapid migration of virtual machines.

[0080] Optionally, the destination device also monitors the size of the selected disk files when selecting disk files from the disk files to be migrated. When no disk file is larger than or equal to a first preset threshold, the selected disk files are migrated in parallel using each migration thread. When at least one disk file is larger than or equal to the first preset threshold, disk files smaller than the first preset threshold are migrated in parallel first, according to the sorting order, using each migration thread; then, disk files larger than or equal to the first preset threshold are divided into multiple file segments according to the sorting order, and each migration thread migrates one file segment in parallel, thereby achieving fast migration of large disk files.

[0081] Step 407: Retrieve the first disk file to be accessed from the local disk of the destination device.

[0082] The first disk file to be accessed can be any one of multiple disk files. After migrating the disk file, the destination device will also check whether the file in the target disk has been successfully migrated to the local disk. The destination device will then search for the first disk file to be accessed on the local disk.

[0083] Step 408: When the first disk file to be accessed is found in the local disk, it is determined that the first disk file to be accessed has been successfully migrated from the target disk to the local disk.

[0084] If the file is found, it is determined that the first disk file to be accessed has been successfully migrated from the target disk to the local disk. If it is not found, the first disk file to be accessed is migrated from the target disk to the local disk.

[0085] The migration of the first disk file to be accessed is determined by whether it is found on the local disk, thus ensuring that the disk file is actually migrated to the local disk and improving the reliability of the disk file migration results.

[0086] Optionally, to further ensure the reliability of the disk file migration results, after step 408, the method may further include: obtaining a list of local disk files in the local disk and a list of target disk files in the target disk; determining whether there are any unmigrated disk files based on the local disk list and the target disk list; and when there are any unmigrated disk files, migrating them to the local disk according to the sorting order.

[0087] The destination device can remotely access the source device where the target disk resides to obtain a list of target disk files containing all disk files that need to be migrated. It can also monitor all successfully migrated disk files on the local disk to obtain a local disk file list. The destination device compares the target disk file list with the local disk file list. If the target disk file list contains at least one disk file that is not in the local disk file list, it determines that at least one disk file is an unmigrated disk file. The unmigrated disk files can then be migrated to the local disk according to their sorting order. If the disk files in the target disk file list match those in the local disk list, it is determined that there are no unmigrated disk files, and the disk file migration on the target disk is complete.

[0088] In this embodiment, the larger the absolute value of the period difference, the smaller the time weight corresponding to the disk file. That is, the further the current time period is from the last time period, the smaller the time weight corresponding to the disk file. This means that the further the current time period is from the last time period, the smaller the impact of the disk file access time within the current time period on the subsequently determined total evaluation access time. This accurately reflects the recent access status of each disk file in the target disk, thus ensuring that frequently used disk files can be migrated first. Each migration thread selects multiple disk files from the disk files to be migrated in parallel according to the sorting order, accelerating the disk file migration speed and thus achieving rapid virtual machine migration. After migration, the success of the migration can be determined by checking whether the first disk file to be accessed is found on the local disk, ensuring that the disk file is truly migrated to the local disk and improving the reliability of the disk file migration results. This, in turn, improves the speed and reliability of virtual machine migration.

[0089] To ensure that disk file migration does not significantly impact the operation of the virtual machine. Figure 5 This is a flowchart illustrating another disk file migration method according to an embodiment of this application. The method is executed by a destination device, which may be... Figure 1 The destination device 120 is shown. (As shown) Figure 5 As shown, this disk file migration method includes the following steps: Step 501: Obtain the period difference between the current time period and the last time period within the preset time period.

[0090] Please see details Figure 4 Step 401 of the illustrated embodiment will not be repeated here.

[0091] Step 502: Within the current time period, calculate the access duration for each disk file in the multiple disk files.

[0092] Please see details Figure 4 Step 402 of the illustrated embodiment will not be described again here.

[0093] Step 503: Process the period difference data to determine the time weight corresponding to each disk file in the current time period.

[0094] Please see details Figure 4 Step 403 of the illustrated embodiment will not be described again here.

[0095] Step 504: Determine the total estimated access time of the first disk file based on the time weight and access duration corresponding to the first disk file in each time period.

[0096] Please see details Figure 5 Step 404 of the illustrated embodiment will not be described again here.

[0097] Step 505: Sort the migration order of the multiple disk files according to the total estimated access time corresponding to each disk file in the multiple disk files, and generate a sorting order.

[0098] Please see details Figure 4 Step 405 of the illustrated embodiment will not be described again here.

[0099] Step 506: According to the sorting order, each disk file is migrated from the target disk where the disk files are stored to the local disk of the destination device.

[0100] Please see details Figure 4 Step 406 of the illustrated embodiment will not be described again here.

[0101] Optionally, step 506 may include the following steps A1 to A7: Step A1: Determine the data fingerprint of each disk file to be migrated.

[0102] The destination device will use a hash algorithm to calculate the hash value of each file on the disk to be migrated, and determine the hash value of each file on the disk to be migrated as the data fingerprint of each file.

[0103] Step A2: Compare the data fingerprint of each disk file to be migrated with the data fingerprint of the disk files already stored on the local disk.

[0104] The destination device will obtain the data fingerprint of the disk files already stored in the local disk through the same operation as in step A1, and then compare the data fingerprint of each disk file to be migrated with the data fingerprint of the disk files already stored in the local disk.

[0105] Step A3: When it is determined that the data fingerprint of at least one disk file to be migrated does not match the data fingerprint of the disk file already stored in the local disk, compression operations are performed on at least one disk file to be migrated.

[0106] When at least one disk file to be migrated has a data fingerprint that does not match the data fingerprint of a disk file already stored on the local disk, at least one disk file to be migrated is compressed.

[0107] Step A4, and perform an encryption operation on the compressed first disk file to be migrated to obtain the encrypted file.

[0108] The first disk file to be migrated is any one of at least one disk file to be migrated. The destination device uses Message-Digest Algorithm 5 (MD5) to determine the MD5 value of each compressed first disk file to be migrated, and uses the MD5 value of the compressed first disk file to be migrated and the compressed first disk file to be migrated together as an encrypted file.

[0109] Optionally, when determining the MD5 value of the first disk file to be migrated, the destination device monitors whether the size of the compressed first disk file to be migrated exceeds a second preset threshold. When the size of the compressed first disk file to be migrated exceeds the second preset threshold, only the MD5 value of the header or footer of the compressed first disk file to be migrated is calculated.

[0110] Step A5: Migrate the encrypted files from the target disk to the local disk.

[0111] The destination device will migrate the encrypted files from the target disk to the local disk. Optionally, the destination device can use multiple migration threads to migrate the encrypted files in parallel.

[0112] Step A6: On the local disk, decrypt the encrypted file using the preset decryption algorithm.

[0113] When an encrypted file is migrated to the local disk, the destination device will again use the MD5 algorithm to calculate the MD5 value of the compressed first disk file to be migrated from the encrypted file. It will then compare the newly calculated MD5 value with the MD5 value in the encrypted file. If the newly calculated MD5 value matches the MD5 value in the encrypted file, decryption is successful; if the newly calculated MD5 value does not match the MD5 value in the encrypted file, decryption fails.

[0114] Step A7: If decryption fails, roll back the migration operation of the encrypted file and return an indication message indicating an error in the migration of the first disk file to be migrated. or, When decryption is successful, decompress and save the first compressed disk file to be migrated.

[0115] When the destination device determines that decryption has failed, it will roll back the migration operation of the encrypted file and return an indication message indicating an error in the migration of the first disk file to be migrated. When decryption is successful, it will decompress and save the compressed first disk file to be migrated.

[0116] Subsequent operations on the disk file to be migrated are only performed when the data fingerprint of at least one disk file to be migrated does not match the data fingerprint of a disk file already stored on the local disk. This avoids duplicate migrations that would occur if some disk files already exist on the local disk and do not need to be migrated. Migrating the first disk file to be migrated only after the first file to be migrated improves the migration speed. Furthermore, the first disk file to be migrated is compressed and encrypted. The compressed first disk file to be migrated is only decompressed and saved after successful decryption of the encrypted file, ensuring its security and thus improving the reliability of the disk file migration. If decryption fails, the migration operation on the encrypted file is rolled back, restoring the state before the migration of the first disk file to be migrated and returning an error message indicating a migration failure, further enhancing the reliability of the disk file migration.

[0117] Step 507: When the migration operation of multiple disk files has not been completed according to the sorting order, when an input request or output request is obtained, determine the second disk file to be accessed corresponding to the input request or output request.

[0118] During the process of migrating disk files sequentially according to the sorting order, if the virtual machine at the destination needs to read a disk file based on the current service, it will generate an I / O request. At this time, the destination device will obtain the I / O request (input request or output request) and determine the second disk file to be accessed corresponding to the I / O request.

[0119] Step 508: When the second disk file to be accessed is not found in the local disk, pause the migration operation of the unmigrated disk file and search for the second disk file to be accessed in the target disk.

[0120] The destination device then searches for the second disk file to be accessed on its local disk. If the second disk file is found, it accesses it and confirms that the second disk file has been successfully migrated from the target disk to the local disk. If the second disk file is not found, the migration operation for the unmigrated disk file is paused, and the device searches for the second disk file to be accessed on the target disk.

[0121] Step 509: When the second disk file to be accessed is found, the second disk file to be accessed is migrated from the target disk to the local disk first; and after the migration of the second disk file to be accessed is completed, the migration operation is continued for the disk files that have not been migrated.

[0122] When searching for the second disk file to be accessed on the target disk, the destination device will first migrate the second disk file from the target disk to the local disk. After the migration of the second disk file is completed, it will continue to migrate the disk files that have not yet been migrated. This ensures that the destination virtual machine can access the second disk file normally after a period of waiting, so that the destination virtual machine can continue to run normally during the disk file migration process, minimizing the impact on the operation of the virtual machine.

[0123] Optionally, to further accelerate the migration of disk files, the destination device can also mark the second disk file to be accessed in the sort order as migrated when migrating the second disk file to be accessed. This allows the unmigrated disk files to be migrated in parallel according to the sort order. However, when migrating to the second disk file according to the sort order, the migration of the second disk file to be accessed will be skipped because the second disk file to be accessed is marked as migrated, and the migration of the next disk file will continue.

[0124] Step 5010: Retrieve the first disk file to be accessed from the local disk of the destination device.

[0125] Please see details Figure 4 Step 407 of the illustrated embodiment will not be described again here. Step 5011: When the first disk file to be accessed is found in the local disk, it is determined that the first disk file to be accessed has been successfully migrated from the target disk to the local disk.

[0126] Please see details Figure 4 Step 408 of the illustrated embodiment will not be described again here. In one application scenario, such as Figure 6As shown, the destination device obtains I / O requests from the destination virtual machine. If no I / O request is obtained, steps 501 to 506 are executed. That is, if there is no I / O request, disk files with long usage times are filtered, and then the corresponding disk files in the frequently used list are retrieved based on the length of time they have been accessed, and the disk files are migrated. The success of the disk file migration is determined by searching for the migrated files on the local disk, and finally the storage migration of the virtual machine is completed.

[0127] When an I / O request is received, the system searches for the corresponding target disk file on the destination device's local disk (i.e., the destination disk) and then accesses that target disk file. If the target disk file is not found on the local disk, the system remotely searches for the corresponding target disk file on the source device's target disk (i.e., the source disk), migrates the found disk file, and then accesses that target disk file. In other words, if an I / O request is received, the system searches for the corresponding target disk file on the destination disk; if it is not found, it remotely accesses the target disk file on the source disk. The system again determines whether the disk file migration was successful by searching for the migrated file on the local disk, ultimately completing the virtual machine's storage migration.

[0128] In this embodiment, subsequent operations on the disk file to be migrated are only performed when the data fingerprint of at least one disk file to be migrated does not match the data fingerprint of a disk file already stored on the local disk. This avoids the situation of duplicate migration when some disk files already exist on the local disk and do not need to be migrated. Migrating the first disk file to be migrated only after the first disk file to be migrated improves the migration speed. Furthermore, the first disk file to be migrated is compressed and encrypted. The compressed first disk file to be migrated is only decompressed and saved after successful decryption of the encrypted file, ensuring its security and improving the reliability of the disk file migration. When decryption fails, the migration operation on the encrypted file is rolled back, restoring the state before the migration of the first disk file to be migrated and returning an error indication message to further improve the reliability of the disk file migration. When searching for a second disk file to be accessed on the target disk, the destination device prioritizes migrating the second disk file to be accessed from the target disk to the local disk. After the migration of the second disk file to be accessed is completed, the migration operation on the unmigrated disk files continues. This ensures that the destination virtual machine can access the second disk file after a period of waiting, so that the destination virtual machine can run normally during the disk file migration process, minimizing the impact on the operation of the virtual machine.

[0129] This embodiment also provides a disk file migration device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0130] This embodiment provides a disk file migration device, such as... Figure 7 As shown, it includes: The acquisition module 710 is used to acquire the period difference between the current time period and the last time period in a preset time period. The statistics module 720 is used to count the access time of each disk file in multiple disk files within the current time period. The first determining module 730 is used to process the period difference data and determine the time weight corresponding to each disk file in the current time period. The second determining module 740 is used to determine the total evaluated access time of the first disk file based on the time weight and access time of the first disk file in each time period, wherein the first disk file is any one of multiple disk files. The sorting module 750 is used to sort the migration order of multiple disk files according to the total estimated access time corresponding to each disk file in the multiple disk files, and generate a sorting order. The migration module 760 is used to migrate each disk file from the target disk where the disk files are stored to the local disk of the destination device in sequence according to the sorting order.

[0131] In some optional embodiments, the first determining module includes: The first determining unit is used to determine the time weight corresponding to the disk file with a preset value as the base and the period difference as the exponent. The preset value is greater than 1 and the period difference is less than or equal to 0.

[0132] In some optional embodiments, the second determining module includes: The second determining unit is used to determine the evaluation access duration within the first time period based on the time weight and access duration corresponding to the first disk file in the first time period. The first time period is any time period within a preset time period. The third determining unit is used to determine the total evaluation access time based on the evaluation access time corresponding to each time period within the preset time period.

[0133] In some optional embodiments, the disk file migration apparatus further includes: The retrieval module is used to retrieve a first disk file to be accessed from the local disk of the destination device. The first disk file to be accessed is any one of multiple disk files. The third determining module is used to determine that the first disk file to be accessed has been successfully migrated from the target disk to the local disk when the first disk file to be accessed is found in the local disk.

[0134] In some optional embodiments, when the migration operation for multiple disk files has not been completed according to the sorting order, the disk file migration apparatus further includes: The fourth determination module is used to determine the second disk file to be accessed corresponding to the input request or output request when an input request or output request is received. The pause module is used to pause the migration operation of the unmigrated disk file when the second disk file to be accessed is not found in the local disk, and to search for the second disk file to be accessed from the target disk. The migration module is also used to migrate the second disk file to be accessed from the target disk to the local disk when a second disk file to be accessed is found. The migration module is also used to continue migrating unmigrated disk files after the second disk file to be accessed has been migrated.

[0135] In some optional embodiments, the migration module includes: The fourth determining unit is used to determine the data fingerprint of each disk file to be migrated; The comparison unit is used to compare the data fingerprint of each disk file to be migrated with the data fingerprint of the disk files already stored in the local disk; The compression unit is used to perform compression operations on at least one disk file to be migrated when it is determined that the data fingerprint of at least one disk file to be migrated does not match the data fingerprint of a disk file already stored in the local disk. An encryption unit is used to perform an encryption operation on the compressed first disk file to be migrated to obtain an encrypted file, wherein the first disk file to be migrated is any one of at least one disk file to be migrated; Migration units are used to migrate encrypted files from the target disk to the local disk; The decryption unit is used to decrypt encrypted files on the local disk according to a preset decryption algorithm. The rollback unit is used to roll back the migration operation of the encrypted file when decryption fails, and return an indication message that the migration of the first disk file to be migrated has failed. or, When decryption is successful, decompress and save the first compressed disk file to be migrated.

[0136] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0137] In this embodiment, the disk file migration device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0138] This application also provides a computer device having the above-described features. Figure 7 The disk file migration device shown.

[0139] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of this application, such as... Figure 8 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take a processor 10 as an example.

[0140] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0141] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0142] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0143] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0144] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0145] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.

[0146] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for migrating disk files, characterized in that, The method is executed by the destination device, and the method includes: Get the period difference between the current time period and the last time period within a preset time period; Within the current time period, the access duration for each disk file in the multiple disk files is counted. The period difference is processed to determine the time weight corresponding to each disk file in the current time period; The total estimated access time of the first disk file is determined based on the time weight and access duration corresponding to the first disk file in each time period, wherein the first disk file is any one of the plurality of disk files; Based on the total evaluated access time corresponding to each of the multiple disk files, the migration order of the multiple disk files is sorted to generate a sorting order; According to the sorting order, each disk file is sequentially migrated from the target disk storing the disk file to the local disk of the destination device; Based on the time weight and access duration corresponding to the first disk file in each time period, the total evaluated access duration of the first disk file is determined, including: Based on the time weight and access duration corresponding to the first disk file in the first time period, the evaluation access duration in the first time period is determined, where the first time period is any time period within the preset time period; the access duration of each disk file is added together to obtain the access duration of each disk file in the current time period. The total evaluation access duration is determined based on the evaluation access duration corresponding to each time period within the preset time period.

2. The method according to claim 1, characterized in that, The step of processing the period difference to determine the time weight corresponding to each disk file within the current time period includes: Using a preset value as the base and the period difference as the exponent, the time weight corresponding to the disk file is determined, and the period difference is less than or equal to 0.

3. The method according to any one of claims 1-2, characterized in that, After migrating each disk file from the target disk storing the disk files to the local disk of the destination device according to the sorting order, the method further includes: In the local disk of the destination device, a first disk file to be accessed is retrieved, which is any one of a plurality of disk files; When the first disk file to be accessed is found in the local disk, it is determined that the first disk file to be accessed has been successfully migrated from the target disk to the local disk.

4. The method according to claim 3, characterized in that, When the migration operation for multiple disk files has not been completed according to the sorting order, the method further includes: When an input request or an output request is received, determine the second disk file to be accessed corresponding to the input request or the output request; If the second disk file to be accessed is not found in the local disk, the migration operation of the unmigrated disk file is paused, and the second disk file to be accessed is searched for from the target disk. When the second disk file to be accessed is found, the second disk file to be accessed will be migrated from the target disk to the local disk first. After the migration of the second disk file to be accessed is completed, the migration operation continues for the unmigrated disk files.

5. The method according to any one of claims 1-2, characterized in that, The step of migrating each disk file from the target disk storing the disk file to the local disk of the destination device in sequence according to the sorting order includes: Determine the data fingerprint of each disk file to be migrated; The data fingerprint of each disk file to be migrated is compared with the data fingerprint of the disk files already stored in the local disk; When it is determined that the data fingerprint of at least one of the disk files to be migrated does not match the data fingerprint of the disk files already stored in the local disk, a compression operation is performed on at least one of the disk files to be migrated. The first disk file to be migrated is encrypted to obtain an encrypted file, wherein the first disk file to be migrated is any one of the disk files to be migrated. The encrypted file is moved from the target disk to the local disk; On the local disk, the encrypted file is decrypted according to a preset decryption algorithm; If decryption fails, roll back the migration operation of the encrypted file and return an indication message indicating an error in the migration of the first disk file to be migrated; or, When decryption is successful, the compressed first disk file to be migrated is decompressed and saved.

6. The method according to any one of claims 1-2, characterized in that, The destination device includes multiple migration threads, and the method further includes: According to the sorting order, each migration thread selects disk files from the disk files to be migrated and performs parallel migration.

7. A disk file migration device, characterized in that, The device is executed by the destination device, and the device includes: The acquisition module is used to obtain the period difference between the current time period and the last time period within a preset time period; The statistics module is used to count the access time of each disk file in multiple disk files within the current time period. The first determining module is used to process the period difference and determine the time weight corresponding to each disk file in the current time period. The second determining module is used to determine the total evaluated access time of the first disk file based on the time weight corresponding to the first disk file in each time period and the access time, wherein the first disk file is any one of the plurality of disk files; The sorting module is used to sort the migration order of the multiple disk files according to the total evaluated access time corresponding to each of the multiple disk files, and generate a sorting order; The migration module is used to migrate each of the disk files from the target disk storing the disk files to the local disk of the destination device in sequence according to the sorting order. The second determining module includes: The second determining unit is used to determine the evaluation access duration within the first time period based on the time weight and access duration corresponding to the first disk file in the first time period. The first time period is any time period within a preset time period. The access duration of each disk file is added together to obtain the access duration of each disk file in the current time period. The third determining unit is used to determine the total evaluation access time based on the evaluation access time corresponding to each time period within the preset time period.

8. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the disk file migration method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the disk file migration method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device of data migration trigger

    CN102521138A

  • Method and system for virtual machine online migration

    CN103577249A