A file migration method, device, apparatus and storage medium
By using computer equipment and file migration devices, the number and time interval of file migration instances are adjusted according to the write concurrency value and upper limit value of the target device, thus solving the device stability problem during file migration and achieving stable and efficient file migration.
Patent Information
- Application Number
- CN202211646707.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-12-21
AI Technical Summary
Existing file migration solutions fail to effectively consider the operational stability of the source or target devices, leading to stress risks during the migration process.
By obtaining the write concurrency value and write concurrency limit of the target device, the number of file migration instances and the time interval are calculated, the file migration speed is adjusted to ensure the stability of device operation, and file migration is carried out using file migration devices and computer equipment.
It achieves stable device operation during file migration, improves the flexibility and adaptability of the migration scheme, and ensures the normal operation of both the source and target devices.
Smart Images

Figure CN115878562B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present document relates to the technical field of computer, and particularly relates to a file migration method, device, equipment and storage medium. BACKGROUND
[0002] File migration is a very common phenomenon. With the continuous upgrading of systems and the continuous innovation of technology, the original file storage device may no longer be suitable for current file access requirements. When the hardware performance of the original file storage device does not meet the requirements or the processor is no longer suitable for the new system version, the files in the original file storage device need to be migrated to a destination device with higher performance.
[0003] File services are usually underlying services of business services. When facing file migration, the migration target usually suffers great pressure and there is a risk of pressure. Existing migration schemes mostly focus on migration efficiency, file integrity and the like, and do not consider the running stability of the file source device or the migration target device.
[0004] There is an urgent need for a file migration method to solve the problem that existing file migration schemes do not consider the running stability of the file source device or the migration target device in the file migration process. SUMMARY
[0005] To solve the problems in the prior art, the embodiments of the present document provide a file migration method, device, equipment and storage medium, which realizes adjustment of file migration speed according to the running condition of the migration target device and ensures the running stability of the file source device or the migration target device in the file migration process.
[0006] To solve the above technical problems, the specific technical solutions of the present document are as follows:
[0007] In one aspect, the embodiments of the present document provide a file migration method, which comprises,
[0008] obtaining a write concurrency value of a migration target device;
[0009] calculating a file migration instance number and a file migration time interval for migrating files according to the write concurrency value and a predetermined write concurrency upper limit value of the migration target device;
[0010] migrating files in a file source device to the migration target device according to the file migration instance number and the migration time interval.
[0011] Further, the write concurrency value represents the number of files written by the migration target device at the same time;
[0012] The method further comprises:
[0013] calculating a writable migration concurrency value according to the write concurrency value and the write concurrency upper limit value;
[0014] calculating a file migration speed interval according to a file read-write time and a predetermined migration time interval;
[0015] calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value.
[0016] The method further comprises:
[0017] selecting any one of the file migration speed interval as a target file migration speed;
[0018] taking the predetermined migration time interval corresponding to the target file migration speed as the file migration time interval;
[0019] calculating the file migration instance number according to the target file migration speed and the writable migration concurrency value.
[0020] The method further comprises:
[0021] obtaining a current migration instance number;
[0022] The method further comprises:
[0023] calculating a first number according to a maximum value in the file migration speed interval and the writable migration concurrency value;
[0024] judging whether the first number is greater than the current migration instance number;
[0025] if yes, taking the first number as the file migration instance number and taking the predetermined migration time interval corresponding to the maximum value as the file migration time interval.
[0026] Further, if the first number is less than or equal to the current migration instance number, the method further comprises:
[0027] calculating a first migration speed according to the current migration instance number and the writable migration concurrency value.
[0028] determining whether the first migration speed is within the file migration speed interval;
[0029] if yes, taking the predetermined migration time interval corresponding to the first migration speed as the file migration time interval, and taking the current migration instance number as the file migration instance number.
[0030] Further, if the first migration speed is not within the file migration speed interval, the method further comprises:
[0031] taking the predetermined migration time interval corresponding to the minimum value in the file migration speed interval as the file migration time interval, and calculating the file migration instance number according to the minimum value and the writable migration concurrency value.
[0032] Further, calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value further comprises:
[0033] calculating a second number according to the minimum value in the file migration speed interval and the writable migration concurrency value;
[0034] determining whether the second number is greater than the current migration instance number;
[0035] if the second number is greater than the current migration instance number, calculating a second migration speed according to the current migration instance number and the writable migration concurrency value, and determining whether the second migration speed is within the file migration speed interval, if the second migration speed is within the file migration speed interval, taking the predetermined migration time interval corresponding to the second migration speed as the file migration time interval, and taking the current migration instance number as the file migration instance number, if the second migration speed is not within the file migration speed interval, taking the second number as the file migration instance number, and taking the minimum value as the file migration time interval;
[0036] if the second number is less than or equal to the current migration instance number, taking the second number as the file migration instance number, and taking the minimum value as the file migration time interval.
[0037] Further, before calculating the file migration speed interval according to the file read-write time and the predetermined migration time interval, the method further comprises:
[0038] obtaining a read concurrency value of the file source device;
[0039] calculating a readable migration concurrency value according to the read concurrency value and a predetermined read concurrency upper limit value of the file source device;
[0040] After the file migration speed interval is calculated according to the file read-write time and the predetermined migration time interval, the method further comprises:
[0041] The file migration instance number and the file migration time interval are calculated according to the minimum of the writable migration concurrency value and the readable migration concurrency value and the file migration speed interval.
[0042] In another aspect, the embodiments herein also provide a file migration device, comprising,
[0043] a writable concurrency value obtaining unit, configured to obtain a writable concurrency value of a migration target device;
[0044] a file migration parameter calculating unit, configured to calculate a file migration instance number and a file migration time interval for migrating files according to the writable concurrency value and a predetermined writable concurrency upper limit value of the migration target device;
[0045] a file migration unit, configured to migrate files in a file source device to the migration target device according to the file migration instance number and the migration time interval.
[0046] Finally, the embodiments herein also provide a computer device, comprising a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the above-mentioned method when executing the computer program.
[0047] With the embodiments herein, the file migration instance number and the file migration time interval for migrating files are calculated according to the writable concurrency value and the writable concurrency upper limit value of the migration target device, and the files in the file source device are migrated to the migration target device according to the file migration instance number and the migration time interval, so that the file migration scheme is set according to the performance of the migration target device, and the running stability of the file source device or the migration target device in the file migration process is ensured. In addition, the migration instance number and the file migration time interval are calculated, so that the migration instance number and the file migration time interval can be flexibly adjusted according to the writable concurrency value and the writable concurrency upper limit value, for example, the file migration time interval is adjusted while the migration instance number is kept unchanged, so that the file migration speed of the migration target device meets the requirements of the writable concurrency value and the writable concurrency upper limit value of the migration target device, thereby improving the flexibility of the deployment of the migration scheme. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments herein or in the prior art, brief introductions to the drawings needed in the embodiments or the prior art description will be given in the following. Obviously, the drawings in the following description are only some of the embodiments herein, and for those skilled in the art, other drawings can also be obtained without creative effort based on these drawings.
[0049] Figure 1 Fig. 1 shows a schematic diagram of an embodiment of a file migration system according to the present application;
[0050] Figure 2 Fig. 2 shows a flow chart of an embodiment of a file migration method according to the present application;
[0051] Figure 3 Fig. 3 shows a step of calculating a number of migration instances and a file migration time interval for migrating files according to the write concurrency value and a predetermined upper limit of write concurrency value of a migration target device according to an embodiment of the present application;
[0052] Figure 4 Fig. 4 shows a step of calculating a number of migration instances and a file migration time interval according to the file migration speed interval and a writable migration concurrency value according to an embodiment of the present application;
[0053] Figure 5 Fig. 5 shows a step of calculating a number of migration instances and a file migration time interval according to the file migration speed interval and a writable migration concurrency value according to another embodiment of the present application;
[0054] Figure 6 Fig. 6 shows a step of calculating a number of migration instances and a file migration time interval according to the file migration speed interval and a writable migration concurrency value according to another embodiment of the present application;
[0055] Figure 7 Fig. 7 shows a step of calculating a number of migration instances and a file migration time interval according to a read concurrency value of a file source device and a write concurrency value of a migration target device according to an embodiment of the present application;
[0056] Figure 8 Fig. 8 shows a schematic diagram of an embodiment of a file migration device according to the present application;
[0057] Figure 9 Fig. 9 shows a schematic diagram of an embodiment of a computer device according to the present application.
[0058]
BRIEF DESCRIPTION OF THE DRAWINGS
[0059] 101, file source device;
[0060] 102, file migration service;
[0061] 103, migration target device;
[0062] 801, write concurrency value obtaining unit;
[0063] 802, file migration parameter calculating unit;
[0064] 803, file migration unit;
[0065] 902, computer device;
[0066] 904, processing device;
[0067] 906, storage resource;
[0068] 908, driving mechanism;
[0069] 910, input / output module;
[0070] 912, input device;
[0071] 914, output device;
[0072] 916, presentation device;
[0073] 918, graphical user interface;
[0074] 920, network interface;
[0075] 922, communication link;
[0076] 924, communication bus. DETAILED DESCRIPTION
[0077] The technical solutions in the embodiments herein will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments herein. Obviously, the described embodiments are only part of the embodiments herein, rather than all the embodiments. Based on the embodiments herein, all the other embodiments obtained by those of ordinary skill in the art without any creative work, fall within the scope of protection herein.
[0078] It should be noted that the terms "first", "second", and the like in the specification and claims herein and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments herein described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, device, product, or apparatus comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products, or apparatuses.
[0079] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that described herein.
[0080] As Figure 1 Figure 1 shows a schematic diagram of an embodiment of a system structure of a file migration method. The system structure can include a file source device 101, a file migration service 102, and a migration target device 103. The file migration service 102 can be a server running independently, or an application deployed in the file source device 101 or the migration target device 103. Preferably, the file migration service 102 is an application deployed in the file source device 101 and running on the file source device 101. The file migration service 102 can obtain files to be migrated from the file source device 101 through a file access interface provided by the file source device 101, and then migrate the files to the migration target device 103.
[0081] The file source device 101 and the migration target device 103 can communicate through a network, which can include a local area network (LAN), a wide area network (WAN), the Internet, or a combination thereof, and be connected to a website, a user device (e.g., a computing device), and a backend system.
[0082] The file migration service 102 can obtain the running status of the migration target device 103 at a regular time, for example, obtain the write concurrency value and the write concurrency upper limit value of the migration target device 103. The write concurrency upper limit value can be a write concurrency upper limit ratio set by a worker according to experience, for example, 50%. Thus, the file migration service 102 can perform file migration according to the write concurrency value and the write concurrency upper limit value of the migration target device 103. Alternatively, the file source device 101 or the migration target device 103 can be a node of a cloud computing system (not shown in the figure), or each server can be a separate cloud computing system, including multiple computers interconnected by a network and working as a distributed processing system. The embodiments are not limited in this regard.
[0083] To solve the problems in the prior art, the embodiments provide a file migration method, which can adjust the file migration speed according to the running status of the migration target device, and ensure the running stability of the file source device or the migration target device during file migration. Figure 2 Figure 2 shows a flowchart of a file migration method according to an embodiment. The process of migrating files from a file source device to a migration target device is described in the figure, but more or fewer operation steps can be included based on conventional or non-creative labor. The order of the steps listed in the embodiments is only one of the many execution orders, and does not represent the only execution order. In actual system or device product execution, the method order shown in the embodiments or the figure can be executed in sequence or in parallel. Specifically Figure 2 As shown in Figure 2, the method can be executed by the file migration service 102. The method can include the following steps.
[0084] Step 201: obtaining a write concurrency value of the migration target device;
[0085] Step 202: calculating a file migration instance number and a file migration time interval for migrating files according to the write concurrency value and a predetermined write concurrency upper limit value of the migration target device;
[0086] Step 203: migrating files in the file source device to the migration target device according to the file migration instance number and the migration time interval.
[0087] Through the method of the embodiments, the file migration instance number and the file migration time interval for migrating files are calculated according to the write concurrency value and the write concurrency upper limit value of the migration target device, and the files in the file source device are migrated to the migration target device according to the file migration instance number and the migration time interval, so that the file migration scheme is set according to the performance of the migration target device, and the running stability of the file source device or the migration target device in the file migration process is ensured. In addition, the migration instance number and the file migration time interval are calculated, so that the migration instance number and the file migration time interval can be adjusted flexibly according to the write concurrency value and the write concurrency upper limit value, for example, the file migration time interval is adjusted while the migration instance number remains unchanged, so that the file migration speed of the migration target device meets the requirements of the write concurrency value and the write concurrency upper limit value of the migration target device, thereby improving the flexibility of the migration scheme deployment.
[0088] In the embodiments, the write concurrency value represents the number of files written by the migration target device at the same time, for example, 100 files / second. The write task that produces the write concurrency value can be a business file of the migration target device itself. Therefore, if the file migration process to the migration target device does not affect the normal business of the migration target device, a write concurrency upper limit value also needs to be set. The upper limit value can be a value set by the staff according to experience, for example, 1000 files / second, which means that the write concurrency value of the migration target device cannot be greater than 1000 files / second during the file migration to the migration target device.
[0089] In the embodiments herein, multiple file migration instances (i.e. file migration threads) can be started in parallel to perform file migration, and the parameters that determine the write concurrency value of the migration target device are the number of file migration instances and the migration time interval. The greater the number of file migration instances, the more files are migrated in parallel. The greater the write concurrency value, the greater the migration time interval, and the lower the file migration speed. Therefore, the embodiments herein calculate the number of file migration instances and the migration time interval for migrating files according to the write concurrency value and the predetermined write concurrency upper limit value of the migration target device. Since the number of file migration instances and the migration time interval have opposite effects on the write concurrency value of the migration target device, i.e. one parameter can be adjusted while the other parameter remains unchanged, the write concurrency value of the migration target device will not exceed the write concurrency upper limit value, which improves the flexibility of the migration scheme deployment.
[0090] According to one embodiment herein, as shown in Figure 3 calculating the number of migration instances and the file migration time interval for migrating files according to the write concurrency value and the predetermined write concurrency upper limit value of the migration target device further comprises,
[0091] Step 301: calculating a writable migration concurrency value according to the write concurrency value and the write concurrency upper limit value;
[0092] Step 302: calculating a file migration speed interval according to the file read-write time and the predetermined migration time interval;
[0093] Step 303: calculating the number of file migration instances and the file migration time interval according to the file migration speed interval and the writable migration concurrency value.
[0094] In the embodiments of the present application, the writable migration concurrency value represents how many concurrent write services the migration target device can still bear. The file reading time represents the time required to obtain a file from the file source device, the file writing time represents the time required to write a file to the migration target device, and the predetermined migration time interval interval represents how long to wait before migrating the next file after a file migration instance has migrated a file. The predetermined migration time interval interval can be set according to actual business needs, for example, the lower limit of the predetermined migration time interval interval can be set to 0 ms and the upper limit can be set to 500 ms. A migration time interval of 0 ms represents no interval migration, that is, migrating the next file immediately after migrating a file, which is the fastest migration speed. A migration time interval of 500 ms represents maximum interval migration, that is, waiting for 500 ms before migrating the next file after migrating a file. Through this design, the migration speed of a file migration instance can be flexibly adjusted. In the specific implementation process, if the writable migration concurrency value decreases, it means that the number of files written by the migration target device at the same time decreases. If the number of file migration instances is to be kept unchanged, the migration time interval can be appropriately increased (but it must be within the migration time interval interval) to ensure that the write concurrency value of the migration target device does not exceed the upper limit of the write concurrency value, and the normal operation of the migration target device is ensured.
[0095] In the embodiments of the present application, the file migration speed is calculated according to the file reading and writing time and the migration time interval. For example, if the file reading and writing time is 100 ms and the file migration time interval is 500 ms, then:
[0096] The file migration speed = 1 / (100 ms+100 ms+500 ms) is approximately equal to 1.42 per second. For example, if there are 3 file migration instances for file migration, the maximum concurrency value that can be generated is 1.42*3 = 4.25.
[0097] The file migration speed and the file migration time interval are inversely proportional. The larger the file migration time interval, the lower the file migration speed, and vice versa, the faster the file migration speed.
[0098] In the embodiments of the present application, the busy level of the migration target device can also be preset, for example, idle, flat peak, peak, top peak, and disaster:
[0099] Idle: The read and write concurrency is lower than 10% of the upper limit, and the average file writing and reading speed is lower than 1 per second.
[0100] Flat peak: The read and write concurrency is lower than 50% of the upper limit, and the average file writing and reading speed is lower than 1 per second.
[0101] High peak: The read or write concurrency is higher than 50% of the upper limit and lower than 80% of the upper limit, and the average file writing and reading speed is lower than 1 per second.
[0102] Top peak: read or write concurrency, higher than the upper limit value 80%, lower than 100%, at this time should be vigilant, focus on the business side of the growth faster, ready to limit or fuse processing, migration procedures are no longer executed.
[0103] Disaster: read or write concurrency, higher than the upper limit value, at this time should be read or write interface to limit or fuse processing.
[0104] If the average file write, read speed exceeds 1 / second, it means that the file system or disk is abnormal, and the concurrency of the file system cannot represent the business busy degree. At this time, the migration program should be stopped immediately, and the system fault should be checked.
[0105] According to one embodiment of the present document, as shown in Figure 4 According to the file migration speed interval and the writable migration concurrency value, the file migration instance number and the file migration time interval are calculated further comprising,
[0106] Step 401: select any one of the file migration speed in the file migration speed interval as the target file migration speed;
[0107] Step 402: the predetermined migration time interval corresponding to the target file migration speed is taken as the file migration time interval;
[0108] Step 403: according to the target file migration speed and the writable migration concurrency value, the file migration instance number is calculated.
[0109] In the embodiments of the present document, without giving priority to keeping the file migration instance number, one predetermined file migration speed corresponding to the file migration speed interval can be selected as the target file migration speed, then the predetermined migration time interval corresponding to the target file migration speed is taken as the file migration time interval, and finally the number of file migration instances is calculated according to the target file migration speed and the writable concurrency value. For example, the writable concurrency value is 200, the selected file migration speed is 20, the corresponding migration time interval is 0ms, and the number of file migration instances calculated according to the writable concurrency value 200 and the file migration speed 20 / second is 10.
[0110] In the embodiments of the present document, the difficulty of adjusting the file migration time interval is much lower than that of adjusting the file migration instance number, so in order to reduce the deployment difficulty of the file migration service, according to one embodiment of the present document, before calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value, the method further comprises: obtaining the current migration instance number.
[0111] In the embodiments, the number of current migration instances is taken as a reference to preferentially ensure that the number of current migration instances is unchanged.
[0112] As shown in Figure 5 calculating the number of file migration instances and the file migration time interval according to the file migration speed interval and the writable migration concurrency value further comprises:
[0113] Step 501: calculating a first number according to a maximum value in the file migration speed interval and the writable migration concurrency value;
[0114] In this step, the maximum value in the file migration speed interval is the fastest file migration speed, and the corresponding migration time interval is 0 ms. In the embodiments, the optimal process number (i.e., the first number) required to be deployed is calculated according to the writable migration concurrency value and the fastest file migration speed.
[0115] Step 502: judging whether the first number is greater than the number of current migration instances;
[0116] In this step, if the first number is greater than the number of current migration instances, it is indicated that migration is performed according to the fastest file migration speed, and if the number of migration instances required to reach the writable migration concurrency value is greater than the number of current migration instances, it is indicated that the increased write concurrency value of file migration on the migration target device will not reach the requirement of the writable migration concurrency value if the migration instance is not increased. Therefore, if the first number is greater than the number of current migration instances, step 503 is performed.
[0117] Step 503: if the first number is greater than the number of current migration instances, taking the first number as the number of file migration instances and taking the predetermined migration time interval corresponding to the maximum value as the file migration time interval;
[0118] In this step, if the first number is greater than the number of current migration instances, file migration processes are deployed according to the first number, and the migration time interval 0 ms corresponding to the fastest file migration speed is taken as the file migration time interval.
[0119] In some other embodiments, if the first number is not greater than the number of current migration instances, a file migration speed in the migration speed interval can be optionally taken as a target file migration speed, and the predetermined migration time interval corresponding to the target file migration speed is taken as the file migration time interval. Details are not described herein again.
[0120] Preferably, if it is preferred to maintain the number of current file migration instances, if the first number is not greater than the number of current migration instances, the file migration speed can be reduced. Specifically, as shown in step 504.
[0121] Step 504: if the first number is less than or equal to the current migration instance number, calculating a first migration speed according to the current migration instance number and the writable migration concurrency value;
[0122] In the embodiments herein, if the first number is less than or equal to the current migration instance number, it means that the file migration is performed according to the current instance number and the fastest file migration speed, and the write concurrency value generated on the migration target device will exceed the writable migration concurrency value. If the current file migration instance number is to be kept unchanged, a first migration speed can be calculated according to the current migration instance number and the writable migration concurrency value. The first migration speed is a file migration speed that makes the write concurrency value generated on the migration target device approach the writable migration concurrency value while keeping the current migration instance number unchanged.
[0123] Step 505: judging whether the first migration speed is within the file migration speed interval;
[0124] In this step, although the first migration speed is calculated, if the first migration speed is too slow and has exceeded the file migration speed interval, the number of file migration instances has to be reduced. Therefore, it is necessary to judge whether the first migration speed is within the file migration speed interval in this step.
[0125] Step 506: if the first migration speed is within the file migration speed interval, taking the predetermined migration time interval corresponding to the first migration speed as the file migration time interval and taking the current migration instance number as the file migration instance number;
[0126] In this step, if the first migration speed is within the file migration speed interval, the current file migration instance number can be kept, and the file migration can be performed according to the file migration time interval corresponding to the first speed. The implementation difficulty of adjusting the file migration time interval is far less than that of adjusting the migration instance number. Therefore, the method described in the embodiments herein can reduce the deployment difficulty of the migration service to a certain extent.
[0127] In some other embodiments herein, if the first migration speed is not within the file migration speed interval, it means that the number of file migration instances has to be adjusted. A target file migration speed can still be selected from the file migration speed interval, and the predetermined migration time interval corresponding to the target file migration speed is taken as the file migration time interval. Details are not described herein again.
[0128] Preferably, if the file migration speed is to be adjusted flexibly without changing the current file migration instance number when the write concurrency value of the migration target device changes, a larger file migration speed adjustable interval can be reserved. Specifically, as shown in step 507.
[0129] Step 507: If the first migration speed is not within the file migration speed range, use the predetermined migration time interval corresponding to the minimum value in the file migration speed range as the file migration time interval, and calculate the number of file migration instances based on the minimum value and the writable migration concurrency value.
[0130] In this step, if the first migration speed is outside the file migration speed range, the number of file migration instances must be adjusted. To maximize the adjustable range of the file migration interval, this embodiment uses the predetermined migration interval corresponding to the minimum speed value as the file migration interval. In other words, the maximum interval among the predetermined migration intervals is used as the file migration interval. The number of file migration instances is calculated based on the minimum value and the writable migration concurrency value. If the writable migration concurrency value subsequently increases, the file migration interval can be reduced to increase the file migration speed while maintaining the current number of file migration instances.
[0131] According to an embodiment of this invention, it is also possible to determine whether the number of current file migration instances needs to be adjusted based on the minimum value in the file migration speed range and the writable migration concurrency value. Specifically, Figure 6 As shown:
[0132] Step 601: Calculate a second number based on the minimum value in the file migration speed range and the writable migration concurrency value;
[0133] In this step, the minimum value in the file migration speed range is the slowest file migration speed, and the corresponding migration time interval is the maximum value. The embodiment of this article calculates the optimal number of processes that need to be deployed (i.e., the second number) based on the writable migration concurrency value and the slowest file migration speed.
[0134] Step 602: Determine whether the second number is greater than the current number of file migration instances;
[0135] In this step, if the second number is less than or equal to the current number of migration instances, then if migration is performed according to the current number of file migration instances (which is greater than the second number) and the slowest file migration speed, the write concurrency value generated on the migration target device will be greater than the writeable migration concurrency value. If the number of migration instances is not reduced, the write concurrency value increased by file migration on the migration target device will exceed the writeable migration concurrency value requirement. Since the second number is less than or equal to the current number of migration instances, step 603 is executed. If the second number is greater than the current number of file migration instances, then the current number of file migration instances can be maintained unchanged, and the file migration interval can be reduced.
[0136] Step 603: If the second quantity is less than or equal to the current migration instance quantity, then the second quantity is taken as the file migration instance quantity, and the minimum value is taken as the file migration time interval.
[0137] In this step, if the second quantity is less than or equal to the current migration instance quantity, then the file migration instance can only be reduced. In this embodiment, the second quantity is taken as the file migration instance quantity, and the predetermined migration time interval corresponding to the slowest file migration speed is taken as the file migration time interval, thereby increasing the adjustable interval of the file migration time interval.
[0138] Step 604: If the second quantity is greater than the current migration instance quantity, then a second migration speed is calculated according to the current migration instance quantity and the writable migration concurrency value.
[0139] In this embodiment, if the second quantity is greater than the current migration instance quantity, then the current file migration instance quantity can still be kept unchanged, and the file migration time interval can be reduced. Therefore, in this step, the second migration speed is calculated according to the current migration instance quantity and the writable migration concurrency value. This second migration speed is a file migration speed that, under the condition that the current migration instance quantity is kept unchanged, causes the write concurrency value generated on the migration target device to approach the writable migration concurrency value.
[0140] Step 605: It is judged whether the second migration speed is within the file migration speed interval.
[0141] In this step, although the second migration speed is calculated, if the second migration speed is too fast and has exceeded the file migration speed interval, then the number of file migration instances has to be increased. Therefore, in this step, it is necessary to judge whether the second migration speed is within the file migration speed interval.
[0142] Step 606: If the second migration speed is within the file migration speed interval, then the predetermined migration time interval corresponding to the second migration speed is taken as the file migration time interval, and the current migration instance quantity is taken as the file migration instance quantity.
[0143] In this step, if the second migration speed is within the file migration speed interval, then the current file migration instance quantity can be kept unchanged, and file migration can be performed according to the file migration time interval corresponding to the second speed.
[0144] Step 607: If the second migration speed is not within the file migration speed interval, then the second quantity is taken as the file migration instance quantity, and the minimum value is taken as the file migration time interval.
[0145] In this step, if the second migration speed is not in the file migration speed interval, it is possible that there are too many current file migration instances, indicating that the number of file migration instances has to be adjusted, taking the second number as the number of file migration instances and taking the minimum value as the file migration time interval.
[0146] According to one embodiment herein, the file source device can also perform some services other than file migration according to the user's needs, and thus in addition to ensuring the normal operation of the migration target device, it is also necessary to ensure the normal operation of the services of the file source device, specifically, as shown in Figure 7 Before calculating the file migration speed interval according to the file read-write time and the predetermined migration time interval interval, the method further comprises:
[0147] Step 701: Obtain the read concurrency value of the file source device;
[0148] Step 702: Calculate the readable migration concurrency value according to the read concurrency value and the predetermined read concurrency upper limit value of the file source device;
[0149] After calculating the file migration speed interval according to the file read-write time and the predetermined migration time interval interval, the method further comprises:
[0150] Step 703: Calculate the number of file migration instances and the file migration time interval according to the minimum of the writable migration concurrency value and the readable migration concurrency value and the file migration speed interval.
[0151] In the embodiments herein, if the readable migration concurrency value of the file source device is less than the writable migration concurrency value of the migration target device, it is possible that the number of migration target devices is relatively large and the file migration services of the file source device are relatively busy, and thus it is necessary to calculate the number of file migration instances and the file migration time interval according to the read concurrency value of the file source device, so as to ensure the normal operation of the services of the file source device.
[0152] Based on the same inventive concept, the embodiments herein also provide a file migration device, as shown in Figure 8 comprises,
[0153] The write concurrency value obtaining unit 801 is configured to obtain the write concurrency value of the migration target device;
[0154] The file migration parameter calculating unit 802 is configured to calculate the number of file migration instances and the file migration time interval for migrating files according to the write concurrency value and the predetermined write concurrency upper limit value of the migration target device;
[0155] The file migration unit 803 is configured to migrate the files in the file source device to the migration target device according to the number of file migration instances and the migration time interval.
[0156] The beneficial effects achieved by the above-described apparatus are consistent with the beneficial effects achieved by the above-described method, and the embodiments of the present specification will not be described here.
[0157] As Figure 9 The structure of the computer device of the embodiment of the present application is shown in the figure, the device in the present application can be the computer device in the embodiment, and the method of the present application is executed. The computer device 902 can include one or more processing devices 904, such as one or more central processing units (CPUs), each of which can implement one or more hardware threads. The computer device 902 can also include any storage resource 906 for storing any kind of information such as code, settings, data, etc. Without limitation, for example, the storage resource 906 can include any one or a combination of the following: any type of RAM, any type of ROM, a flash memory device, a hard disk, an optical disk, etc. More generally, any storage resource can store information using any technology. Further, any storage resource can provide volatile or non-volatile retention of information. Further, any storage resource can represent a fixed or removable component of the computer device 902. In one case, the computer device 902 can perform any operation of the associated instructions when the processing device 904 executes the associated instructions stored in any storage resource or combination of storage resources. The computer device 902 also includes one or more drive mechanisms 908 for interacting with any storage resource, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0158] The computer device 902 can also include an input / output module 910 (I / O) for receiving various inputs (via input devices 912) and for providing various outputs (via output devices 914). One particular output mechanism can include a presentation device 916 and an associated graphical user interface (GUI) 918. In other embodiments, the input / output module 910 (I / O), the input devices 912, and the output devices 914 can also not be included, just as a computer device in a network. The computer device 902 can also include one or more network interfaces 920 for exchanging data with other devices via one or more communication links 922. One or more communication buses 924 couple the above-described components together.
[0159] The communication link 922 can be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 922 can include any combination of hardwired links, wireless links, routers, gateway functionality, name servers, etc., governed by any protocol or combination of protocols.
[0160] The embodiments herein also provide a computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method described above.
[0161] The embodiments herein also provide a computer readable instruction, wherein the program therein causes the processor to perform the method described above when the processor executes the instruction.
[0162] It should be understood that the size of the serial number of the processes described above in the various embodiments herein does not mean the order of execution, and the execution order of the processes should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments herein.
[0163] It should also be understood that in the embodiments herein, the term "and / or" is only a description of the association relationship of the associated objects, which means that there can be three relationships. For example, A and / or B can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in this paper generally represents that the front and rear associated objects are in an "or" relationship.
[0164] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this paper.
[0165] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0166] In several embodiments provided herein, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displays or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can also be electrical, mechanical or other forms of connection.
[0167] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e. may be located in one place, or may be distributed on multiple network units. Part or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0168] In addition, each functional unit in each embodiment herein can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0169] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions herein, essentially or the part of the prior art that contributes to the technical solutions, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment herein. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0170] The principles and implementation manners of the present application are described in the specific embodiments herein, and the above embodiment descriptions are only used to help understand the methods and core ideas thereof; meanwhile, for those skilled in the art, according to the ideas herein, the specific implementation manners and application ranges will have changes, and the above description of the present application should not be understood as a limitation.
Claims
1. A file migration method characterized by, The method comprises: obtaining a write concurrency value of the migration target device; calculating a file migration instance number and a file migration time interval for migrating files according to the write concurrency value and a predetermined write concurrency upper limit value of the migration target device; migrating files in a file source device to the migration target device according to the file migration instance number and the migration time interval; the write concurrency value represents a number of files written by the migration target device at the same time; calculating a file migration instance number and a file migration time interval for migrating files according to the write concurrency value and a predetermined write concurrency upper limit value of the migration target device further comprises: calculating a writable migration concurrency value according to the write concurrency value and the write concurrency upper limit value; calculating a file migration speed interval according to a file read-write time and a predetermined migration time interval; calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value; calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value further comprises: selecting any file migration speed in the file migration speed interval as a target file migration speed; taking a predetermined migration time interval corresponding to the target file migration speed as the file migration time interval; calculating the file migration instance number according to the target file migration speed and the writable migration concurrency value; before calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value, the method further comprises: obtaining a current migration instance number; calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value further comprises: calculating a first number according to a maximum value in the file migration speed interval and the writable migration concurrency value; determining whether the first number is greater than the current migration instance number; if yes, taking the first number as the file migration instance number and taking a predetermined migration time interval corresponding to the maximum value as the file migration time interval.
2. The method of claim 1, wherein, if the first number is less than or equal to the current migration instance number, the method further comprises: calculating a first migration speed according to the current migration instance number and the writable migration concurrency value; determining whether the first migration speed is within the file migration speed interval; if yes, taking a predetermined migration time interval corresponding to the first migration speed as the file migration time interval and taking the current migration instance number as the file migration instance number.
3. The method of claim 2, wherein, if the first migration speed is not within the file migration speed interval, the method further comprises: taking a predetermined migration time interval corresponding to a minimum value in the file migration speed interval as the file migration time interval and calculating the file migration instance number according to the minimum value and the writable migration concurrency value.
4. The method of claim 1, wherein, calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value further comprises: calculating a second number according to the minimum value in the file migration speed interval and the writable migration concurrency value; judging whether the second number is greater than the current migration instance number; if the second number is greater than the current migration instance number, calculating a second migration speed according to the current migration instance number and the writable migration concurrency value, and judging whether the second migration speed is in the file migration speed interval, if the second migration speed is in the file migration speed interval, taking the predetermined migration time interval corresponding to the second migration speed as the file migration time interval, and taking the current migration instance number as the file migration instance number, if the second migration speed is not in the file migration speed interval, taking the second number as the file migration instance number, and taking the minimum value as the file migration time interval; if the second number is less than or equal to the current migration instance number, taking the second number as the file migration instance number, and taking the minimum value as the file migration time interval.
5. The method of claim 1, wherein, Before calculating the file migration speed interval according to the file read-write time and the predetermined migration time interval interval, the method further comprises: obtaining a read concurrency value of the file source device; calculating a readable migration concurrency value according to the read concurrency value and a predetermined read concurrency upper limit value of the file source device; After calculating the file migration speed interval according to the file read-write time and the predetermined migration time interval interval, the method further comprises: calculating the file migration instance number and the file migration time interval according to the minimum value between the writable migration concurrency value and the readable migration concurrency value and the file migration speed interval.
6. A file migration apparatus characterized by comprising: comprises, a write concurrency value obtaining unit, configured to obtain a write concurrency value of a migration target device; a file migration parameter calculating unit, configured to calculate a file migration instance number and a file migration time interval for migrating files according to the write concurrency value and a predetermined write concurrency upper limit value of the migration target device; a file migration unit, configured to migrate files in a file source device to the migration target device according to the file migration instance number and the migration time interval; the write concurrency value represents the number of files written by the migration target device at the same time; calculating a file migration instance number and a file migration time interval for migrating files according to the write concurrency value and a predetermined write concurrency upper limit value of the migration target device further comprises, calculating a writable migration concurrency value according to the write concurrency value and the write concurrency upper limit value; calculating a file migration speed interval according to the file read-write time and the predetermined migration time interval interval; calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value; calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value further comprises, selecting any file migration speed in the file migration speed interval as a target file migration speed; taking a predetermined migration time interval corresponding to the target file migration speed as the file migration time interval; calculating the file migration instance number according to the target file migration speed and the writable migration concurrency value; before the file migration device calculates the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value, the file migration device is further configured to: obtain a current migration instance number; calculating the file migration instance number and the file migration time interval according to the file migration speed interval and the writable migration concurrency value further includes: calculating a first number according to a maximum value in the file migration speed interval and the writable migration concurrency value; determining whether the first number is greater than the current migration instance number; if yes, taking the first number as the file migration instance number and taking a predetermined migration time interval corresponding to the maximum value as the file migration time interval.
7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method in any one of claims 1 to 5 when executing the computer program.
Citation Information
Patent Citations
Data migration method and device, and computer readable storage medium
CN111142788A
Migration speed control method and device for distributed object storage system and medium
CN111966301A