Multi-user data migration method and device
By using pre-established speed collector pools and data collectors in multi-user shared resource scenarios, the problem that existing methods cannot accurately obtain the migration speed of a single user is solved, and the effect of accurate migration speed acquisition and cost reduction is achieved.
Patent Information
- Application Number
- CN202411761769.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-25
AI Technical Summary
In the scenario of multi-user sharing resource sharing, existing methods cannot accurately obtain the data migration speed of a single user.
Through the pre-established speed collector pool, the data collector corresponding to the data migration task is determined, the migration speed of the current migration thread is collected, and the total migration time is predicted based on the acquisition speed, so as to perform data migration.
It realizes the ability to accurately collect data migration speed for each user under the premise of sharing resources by multiple users, reduces the cost of cloud vendors, and improves the accuracy of migration speed.
Smart Images

Figure CN119883538A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a multi-user data migration method and device. Background Art
[0002] Users use object storage products to store business data. The current business data is stored in the object storage product of manufacturer A. Due to business scenario switching or other reasons, the object storage product of manufacturer B is used. Therefore, the data stored in the object storage product of manufacturer A needs to be migrated to the object storage of manufacturer B, which is object storage data migration. Users can achieve data migration by using the data migration service provided by the object storage manufacturer.
[0003] At present, object storage data migration services of various vendors usually use multi-process and multi-threaded concurrent methods to achieve data migration, so as to improve the migration speed. However, considering the cost of using infrastructure such as servers and network bandwidth, cloud vendors usually distribute the migration tasks of multiple users to the same data migration server for execution, that is, multiple users share the resources of a server to achieve their own data migration. For individual users, users are more concerned about the data migration speed, so that they can predict the overall migration time and arrange a reasonable business cutover time.
[0004] Object storage data migration speed is usually achieved in two ways:
[0005] 1) Monitor network traffic: Network traffic monitoring tools can display the system's network traffic in real time, such as the Linux system's command line network traffic monitoring tool nload.
[0006] 2) Custom script: The storage capacity of the bucket can be collected at unit time intervals through the S3 interface. The increment of the bucket in different time periods can be obtained by looping the above operation, that is, the upload speed within the unit.
[0007] At present, the above two speed acquisition methods have the following problems:
[0008] 1) Limited speed collection accuracy: The traffic monitoring of the network card may be affected by many factors, such as packet header overhead, network protocol influence, etc., resulting in a certain deviation between the monitoring data and the actual speed.
[0009] 2) Application scenario limitations: By monitoring the traffic of the entire network card, only the download and upload speed of the entire device can be obtained. When there are multiple application processes in the device, it is impossible to obtain the speed of a specific application or service; although the increment per unit time in the bucket can be collected more accurately through the custom script method, when the bucket has migration data and production data written at the same time, the collection speed is the overall increment of the current bucket, rather than the speed of the old business migration.
[0010] In summary, in a scenario where multiple users share resources, existing methods cannot accurately obtain the data migration speed of a single user. Summary of the invention
[0011] The present application shows a multi-user data migration method and device.
[0012] In a first aspect, the present application provides a multi-user data migration method, the method comprising:
[0013] Get data migration tasks;
[0014] Determine a data collector corresponding to the data migration task according to a pre-established speed collector pool;
[0015] Collecting, by the data collector, a migration speed of a current migration thread corresponding to the data migration task;
[0016] The total migration duration is predicted based on the collected migration speed, and data migration is performed according to the total migration duration.
[0017] Optionally, the data collectors in the pre-established data collector pool are determined according to a preset process and a thread corresponding to the process.
[0018] Optionally, the method further comprises:
[0019] After the current migration thread is executed, the speed collector is released and stored in a speed collector pool pre-established by the prime number.
[0020] Optionally, the pre-established speed collector is stored in a circular array.
[0021] Optionally, the method further comprises:
[0022] According to the current timestamp of the current migration thread, a storage location corresponding to the current thread is calculated, and a count value is updated according to the storage location.
[0023] Optionally, the method further comprises:
[0024] A bitmap manager is used to manage the speed collectors in the speed collector pool.
[0025] In a second aspect, the present application provides a multi-user data migration device, the device comprising:
[0026] The acquisition module is used to obtain data migration tasks;
[0027] A determination module, used to determine a data collector corresponding to the data migration task according to a pre-established speed collector pool;
[0028] A collection module, used for collecting the migration speed of the current migration thread corresponding to the data migration task through the data collector;
[0029] The migration module is used to predict the total migration duration based on the collected migration speed, and perform data migration according to the total migration duration.
[0030] Optionally, the data collectors in the pre-established data collector pool are determined according to a preset process and a thread corresponding to the process.
[0031] Optionally, the acquisition module is used to:
[0032] After the current migration thread is executed, the speed collector is released and stored in a speed collector pool pre-established by the prime number.
[0033] Optionally, the pre-established speed collector is stored in a circular array.
[0034] Optionally, the acquisition module is used to:
[0035] According to the current timestamp of the current migration thread, a storage location corresponding to the current thread is calculated, and a count value is updated according to the storage location.
[0036] Optionally, the acquisition module is used to:
[0037] A bitmap manager is used to manage the speed collectors in the speed collector pool.
[0038] In a third aspect, the present application shows an electronic device, which includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method described in any of the above aspects.
[0039] In a fourth aspect, the present application illustrates a non-temporary computer-readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a method as described in any of the above aspects.
[0040] In a fifth aspect, the present application illustrates a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in any of the above aspects.
[0041] The technical solution provided by the present application may include the following beneficial effects: The multi-user data migration method and device provided by the embodiment of the present application include: obtaining a data migration task; determining a data collector corresponding to the data migration task according to a pre-established speed collector pool; collecting the migration speed of the current migration thread corresponding to the data migration task through the data collector, and when a user is assigned to a thread to perform a migration task, randomly selecting an available speed collector to record the migration speed of the user's current migration thread. When the migration task is completed, the speed collector is returned to the pool to facilitate subsequent migration reuse, which can not only effectively reduce the cost of cloud vendors, but also ensure accurate collection of the data migration speed of each user under the premise of multi-user resource sharing. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flowchart of the steps of a multi-user data migration method of the present application;
[0043] Figure 2 is a schematic diagram of a ring array of the present application;
[0044] Figure 3 This is a schematic diagram of a speed acquisition method for multi-user shared resources in the present application;
[0045] Figure 4 is a schematic diagram of a velocity collector pool of the present application;
[0046] Figure 5 It is a bitmap-based manager of this application;
[0047] Figure 6 is a schematic diagram of a user identifier of the present application;
[0048] Figure 7 It is a structural block diagram of a multi-user data migration device of the present application;
[0049] Figure 8 is a block diagram of an electronic device of the present application;
[0050] Fig. 9 It is a block diagram of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] Explanation of the name:
[0053] Object storage: A massive, elastic, highly reliable, and cost-effective storage product that provides cloud storage services for unstructured data (images, audio and video, text, and other format files) through the S3 protocol and standard service interfaces.
[0054] Bucket: A bucket is a container for storing objects in object storage. All objects must belong to a container.
[0055] Object: An object is the basic unit of data storage in object storage.
[0056] S3 interface: S3 interface is a programming interface for managing S3 buckets and objects. Through the S3 API, developers can access, manage and operate object storage services, including uploading, downloading, deleting objects, managing bucket access permissions, etc.
[0057] Timestamp: A timestamp is a way to identify the moment when a specific event occurs, usually expressed in digital form. It is usually an integer or floating point number representing the number of seconds or milliseconds that have passed since a reference point in time (usually the UNIX epoch, which is midnight UTC on January 1, 1970).
[0058] Pearson correlation coefficient: It is a statistical indicator used to measure the degree of linear correlation between two variables. The Pearson correlation coefficient is obtained by calculating the covariance of the two variables and the product of their respective standard deviations. The closer the absolute value is to 1, the stronger the linear correlation between the two variables; the closer the absolute value is to 0, the weaker the linear correlation between the two variables.
[0059] From the above content, it can be seen that the above two speed acquisition methods have the following problems: limited speed acquisition accuracy and limited application scenarios. To solve the above problems, the present application provides a multi-user data migration method and device. The multi-user data migration method provided by the present application is described below.
[0060] Reference Figure 1 , shows a flowchart of a multi-user data migration method of the present application, which can be applied to an electronic device, wherein the method specifically may include the following steps:
[0061] S101, obtaining a data migration task;
[0062] S102, determining a data collector corresponding to the data migration task according to a pre-established speed collector pool;
[0063] S103, collecting the migration speed of the current migration thread corresponding to the data migration task through a data collector;
[0064] S104: predicting a total migration duration based on the collected migration speed, and performing data migration according to the total migration duration.
[0065] For complex scenarios where multiple users perform data migration operations in the same computing infrastructure, the method proposed in this patent can achieve speed collection for multiple users while reducing the cost of cloud vendors. The multi-scale time speed collector proposed in the embodiment of the present application supports speed collection at scales such as hundreds of milliseconds, tens of milliseconds, and milliseconds. At the same time, thread locks are introduced in the multi-scale time speed collector to ensure concurrency security when updating data, and to avoid data inconsistency caused by multiple threads modifying data at the same time. The speed collection method can effectively improve the accuracy of the collection speed. Taking the increment of the storage capacity per unit time in the bucket with only migration data as the source as the reference value, the Pearson correlation coefficient can reach above 0.92.
[0066] The multi-user data migration method provided by the embodiment of the present application includes: obtaining a data migration task; determining a data collector corresponding to the data migration task according to a pre-established speed collector pool; collecting the migration speed of the current migration thread corresponding to the data migration task through the data collector, and when a user is assigned to a thread to perform a migration task, randomly selecting an available speed collector to record the migration speed of the user's current migration thread. When the migration task is completed, the speed collector is returned to the pool to facilitate subsequent migration reuse, which can not only effectively reduce the cost of cloud vendors, but also ensure accurate collection of the data migration speed of each user under the premise of multi-user resource sharing.
[0067] Another embodiment of the present application further supplements the multi-user data migration method provided in the above embodiment.
[0068] The data collectors in the pre-established data collector pool are determined according to the preset processes and the threads corresponding to the processes, and the pre-established speed collectors are stored in the form of a ring array.
[0069] The method further includes: after the current migration thread is executed, releasing the speed collector and storing it in a speed collector pool pre-established by the prime number.
[0070] like Figure 2 As shown, Figure 2 This is a schematic diagram of a ring array of the present application. The multi-scale time speed collector is a counter based on a multi-scale time window, which mainly consists of the following parts:
[0071] 1) Circular array data storage: By using an array array with a length of windowsSize to store the count value, the characteristics of the circular array are realized, and the fixed-size storage space is recycled. The size of windowsSize is determined by the time scale, as shown in Table 1.
[0072] Table 1 Multi-scale time windows
[0073] Time scale windowsSize millisecond 1000 Ten milliseconds 100 100 milliseconds 10
[0074] Furthermore, the method further comprises:
[0075] According to the current timestamp of the current migration thread, the storage location corresponding to the current thread is calculated, and the count value is updated according to the storage location.
[0076] Therefore, given a timestamp, it can be converted into time of different scales.
[0077] 2) Update count value: Calculate the position that needs to be updated based on the current timestamp now_timestamp, and update the count value based on the position.
[0078] index=now_timestamp%windowsSize
[0079] array[index]=value
[0080] Among them, index is the index subscript in the circular array, index∈[0, windowsSize), and value is the migration amount collected at the current time.
[0081] 3) Count the count values: traverse the entire array and accumulate the count values to get the final result.
[0082]
[0083] Where sum is the sum of the migration amounts in the ring array.
[0084] 4) Manage time windows: Before each update and count value, get the expired time interval internal_nums based on the current timestamp now_timestamp and the timestamp last_timestamp of the last operation, determine the position in the array based on the time interval internal_nums, and clean up the expired data in this interval to maintain the validity of the data within the time window. At the same time, thread locks are introduced to ensure concurrent security when updating data to avoid data inconsistency caused by multiple threads modifying data at the same time.
[0085] internal_nums=now_timestamp-last_timestamp
[0086] In general, the design idea of the multi-scale time velocity collector is mainly focused on effectively managing the count values within the time window and ensuring the concurrent security of data operations.
[0087] The method further comprises:
[0088] A bitmap manager is used to manage the speed collectors in the speed collector pool.
[0089] The speed collection method of user shared resources at least includes: a speed collector pool; a bitmap-based manager; and an array-based user identification.
[0090] 1) If Figure 3 and Figure 4 As shown, the speed collector pool contains N pre-created speed collectors, which can be dynamically allocated and reused to collect speed, avoiding frequent creation and destruction of collectors. Each collector is numbered from 0 to N-1.
[0091] N = process_nums * thread_nums
[0092] process_nums is the number of processes initialized for migration in the migration host, and thread_nums is the number of threads in each process.
[0093] 2) Bitmap-based managers, such as Figure 5 shown.
[0094] The BitMap-based manager is an array bitmap containing only 0 and 1, with a length of N. 0 / 1 is used to identify which collectors in the speed collector pool are idle. The value of bitmap[index] indicates whether the index collector in the pool is idle, 0 means idle, and 1 means occupied.
[0095] 3) Array-based user identifiers, such as Figure 6 shown.
[0096] The user identifier is an array user_array of length N. The elements in the array are string type user_id, which is used to uniquely identify the user. user_array[index] = user_id, which means that the index-th collector in the pool is currently in use by the user user_id. By summarizing all the collectors in use by the same user in user_array, the data migration speed value of the user in the current host device can be obtained.
[0097] The embodiment of the present application can be applied to object storage data migration service products, and can solve the problem of multiple users performing data migration in the same computing infrastructure, and obtain the user's data migration speed in real time. Using the cloud host as the migration device, initialize process_nums processes, and create thread_numms threads in each process as data migration resources. Therefore, initialize N = process_nums*thread_nums speed collectors in the speed collector pool for use.
[0098] When a user is assigned to a thread to perform a migration task, an available speed collector is randomly selected to record the migration speed of the user's current migration thread. When the migration task is completed, the speed collector is returned to the pool to facilitate subsequent migration reuse. The method proposed in this patent can not only be applied in a wide range of scenarios, but also has a high accuracy rate in statistical collection speed. The increment of the storage capacity per unit time in the bucket with only migration data as the source is used as the "reference migration speed". The Pearson correlation coefficient between the migration speed collected by the embodiment of the present application and the reference speed can reach above 0.92.
[0099] Embodiment 1 of the present application aims at the complex scenario where multiple users perform data migration operations in the same computing infrastructure. The method proposed in this patent can achieve speed collection for multiple users while reducing the cost of cloud vendors.
[0100] 2) The multi-scale time speed collector proposed in the embodiment of the present application supports speed collection at scales of 100 milliseconds, 10 milliseconds, milliseconds, etc. At the same time, a thread lock is introduced into the multi-scale time speed collector to ensure the concurrency security when updating data, and to avoid data inconsistency caused by multiple threads modifying data at the same time.
[0101] 3) The speed collection method proposed in the embodiment of the present application can effectively improve the accuracy of the collection speed. Taking the increment of the storage capacity per unit time in the bucket with only migration data as the source as the reference value, the Pearson correlation coefficient can reach more than 0.92.
[0102] 4) The method proposed in the embodiment of the present application can dynamically adjust the speed collection pool according to the number of processes and threads initialized by the cloud host.
[0103] The embodiment of the present application proposes a method for collecting object storage data migration speed, aiming to solve the problem of how to reduce the cost of cloud vendors while accurately collecting the data migration speed of each user in an environment where multiple users share resources.
[0104] Sharing resources among multiple users means that resources are more fully utilized, and cloud vendors can reduce the cost per unit of resources through higher resource utilization.
[0105] By collecting the user data migration speed, each user can understand the migration status of their own data migration tasks and ensure the smooth progress of the data migration process.
[0106] In summary, the object storage data migration speed collection method proposed in the present invention can not only effectively reduce the cost of cloud vendors, but also accurately collect the data migration speed of each user under the premise of multi-user sharing resources.
[0107] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.
[0108] The multi-user data migration method provided by the embodiment of the present application includes: obtaining a data migration task; determining a data collector corresponding to the data migration task according to a pre-established speed collector pool; collecting the migration speed of the current migration thread corresponding to the data migration task through the data collector, and when a user is assigned to a thread to perform a migration task, randomly selecting an available speed collector to record the migration speed of the user's current migration thread. When the migration task is completed, the speed collector is returned to the pool to facilitate subsequent migration reuse, which can not only effectively reduce the cost of cloud vendors, but also ensure accurate collection of the data migration speed of each user under the premise of multi-user resource sharing.
[0109] Another embodiment of the present application provides a multi-user data migration device, which is used to execute the multi-user data migration method provided by the above embodiment.
[0110] The data migration device provided by the present application is described below.
[0111] like Figure 7 , which is a schematic diagram of the structure of a multi-user data migration device provided in an embodiment of the present application. The multi-user data migration device includes an acquisition module 701, a determination module 702, a collection module 703 and a migration module 704, wherein:
[0112] The acquisition module 701 is used to acquire data migration tasks;
[0113] The determination module 702 is used to determine the data collector corresponding to the data migration task according to the pre-established speed collector pool;
[0114] The collection module 703 is used to collect the migration speed of the current migration thread corresponding to the data migration task through a data collector;
[0115] The migration module 704 is used to predict the total migration duration based on the collected migration speed, and perform data migration according to the total migration duration.
[0116] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0117] The multi-user data migration device provided in the embodiment of the present application includes: obtaining a data migration task; determining a data collector corresponding to the data migration task according to a pre-established speed collector pool; collecting the migration speed of the current migration thread corresponding to the data migration task through the data collector, and when a user is assigned to a thread to perform a migration task, randomly selecting an available speed collector to record the migration speed of the user's current migration thread. When the migration task is completed, the speed collector is returned to the pool to facilitate subsequent migration reuse, which can not only effectively reduce the cost of cloud vendors, but also ensure accurate collection of the data migration speed of each user under the premise of multi-user resource sharing.
[0118] Another embodiment of the present application further supplements the multi-user data migration device provided in the above embodiment.
[0119] The data collectors in the pre-established data collector pool are determined based on preset processes and threads corresponding to the processes.
[0120] The collection module is used to release the speed collector after the current migration thread is executed and store it in the speed collector pool pre-established by the prime number.
[0121] Pre-built velocity collectors are stored in a circular array.
[0122] The acquisition module is used to calculate the storage location corresponding to the current thread according to the current timestamp of the current migration thread, and update the count value according to the storage location.
[0123] The acquisition module is used to manage the speed collectors in the speed collector pool by using a bitmap manager.
[0124] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0125] The multi-user data migration device provided in the embodiment of the present application includes: obtaining a data migration task; determining a data collector corresponding to the data migration task according to a pre-established speed collector pool; collecting the migration speed of the current migration thread corresponding to the data migration task through the data collector, and when a user is assigned to a thread to perform a migration task, randomly selecting an available speed collector to record the migration speed of the user's current migration thread. When the migration task is completed, the speed collector is returned to the pool to facilitate subsequent migration reuse, which can not only effectively reduce the cost of cloud vendors, but also ensure accurate collection of the data migration speed of each user under the premise of multi-user resource sharing.
[0126] Optionally, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0127] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0128] Figure 8 800 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0129] Reference Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0130] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0131] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0132] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0133] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0134] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0135] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0136] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0137] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0138] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0139] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0140] Fig. 9 19 is a block diagram of a computer-readable storage medium 1900 shown in the present application. For example, the computer-readable storage medium 1900 may be provided as a server.
[0141] Reference Fig. 9 , the computer-readable storage medium 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0142] The computer readable storage medium 1900 may also include a power supply component 1926 configured to perform power management of the computer readable storage medium 1900, a wired or wireless network interface 1950 configured to connect the computer readable storage medium 1900 to a network, and an input / output (I / O) interface 1958. The computer readable storage medium 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0143] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0145] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0146] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0147] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0148] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods 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. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0149] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0150] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0151] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0152] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A multi-user data migration method, characterized in that: The method comprises: Get data migration tasks; Determine a data collector corresponding to the data migration task according to a pre-established speed collector pool; Collecting, by the data collector, a migration speed of a current migration thread corresponding to the data migration task; The total migration duration is predicted based on the collected migration speed, and data migration is performed according to the total migration duration.
2. The multi-user data migration method according to claim 1, characterized in that: The data collectors in the pre-established data collector pool are determined according to a preset process and a thread corresponding to the process.
3. The multi-user data migration method according to claim 1, characterized in that: The method further comprises: After the current migration thread is executed, the speed collector is released and stored in a speed collector pool pre-established by the prime number.
4. The multi-user data migration method according to claim 1, characterized in that: The pre-established speed collector is stored in a circular array form.
5. The multi-user data migration method according to claim 1, characterized in that: The method further comprises: According to the current timestamp of the current migration thread, a storage location corresponding to the current thread is calculated, and a count value is updated according to the storage location.
6. The multi-user data migration method according to claim 1, characterized in that: The method further comprises: A bitmap manager is used to manage the speed collectors in the speed collector pool.
7. A multi-user data migration device, characterized in that: The device comprises: The acquisition module is used to obtain data migration tasks; A determination module, used to determine a data collector corresponding to the data migration task according to a pre-established speed collector pool; A collection module, used for collecting the migration speed of the current migration thread corresponding to the data migration task through the data collector; The migration module is used to predict the total migration duration based on the collected migration speed, and perform data migration according to the total migration duration.
8. The multi-user data migration device according to claim 7, characterized in that: The data collectors in the pre-established data collector pool are determined according to a preset process and a thread corresponding to the process.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method according to any one of claims 1 to 6 when executed by the processor.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.