WO2024021554A1 - Data migration method and device - Google Patents

Data migration method and device Download PDF

Info

Publication number
WO2024021554A1
WO2024021554A1 PCT/CN2023/074115 CN2023074115W WO2024021554A1 WO 2024021554 A1 WO2024021554 A1 WO 2024021554A1 CN 2023074115 W CN2023074115 W CN 2023074115W WO 2024021554 A1 WO2024021554 A1 WO 2024021554A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
writing
lock
destination
new data
Prior art date
Application number
PCT/CN2023/074115
Other languages
French (fr)
Chinese (zh)
Inventor
吕洋
景磊
蔡庆明
陈雪
张旭
Original Assignee
京东科技信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 京东科技信息技术有限公司 filed Critical 京东科技信息技术有限公司
Publication of WO2024021554A1 publication Critical patent/WO2024021554A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers

Definitions

  • the present disclosure relates to the field of computer technology, and specifically to data migration methods and devices.
  • Cloud computing is a computing service.
  • its storage system is constantly being developed, upgraded or updated.
  • the reliability of data reading and writing services is crucial.
  • the existing data migration method is to migrate the existing data from the old storage system to the new storage system, and mirror the newly generated data read and write operations back to the source from the new storage system to the old storage system. Realize the continuity of data reading and writing services during the switching process between the old and new systems.
  • the present disclosure provides a data migration method, device, electronic device, and computer-readable storage medium.
  • a data migration method including: switching the read and write addresses of new data from the data source end to the data destination end, where the new data refers to the data generation end at Data generated during the data migration process; start a double-ended read operation to read new data from the data source and data destination; in response to the current data migration status being the first state, write the new data based on the serial writing method Enter the data destination; turn off the serialized writing mode after the preset time and write new data to the data destination; migrate the existing data from the data source to the data destination.
  • a data migration device including: a switching unit configured to switch the read and write addresses of new data from the data source end to the data destination end, wherein the new data Refers to the data generated by the data generation end during the data migration process; the double-ended reading unit is configured to enable a double-ended reading operation and reads new data from the data source and data destination; the first writing unit is is configured to write new data to the data destination based on the serialized writing method in response to the current data migration status belonging to the first status; the second writing unit is configured to turn off the serialized writing method after a preset period of time , writes new data to the data destination; the data migration unit is configured to migrate existing data from the data source to the data destination.
  • an electronic device including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores information that can be The instructions executed by the at least one processor are executed by the at least one processor, so that the at least one processor can implement the method in any of the above embodiments.
  • a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to implement any of the above embodiments.
  • a computer program product including a computer program that, when executed by a processor, can implement the method in any of the above embodiments.
  • Figure 1 is an exemplary system architecture diagram in which embodiments of the present disclosure may be applied;
  • Figure 2 is a flow chart of an embodiment of a data migration method according to the present disclosure
  • Figure 3 is a flow chart of another embodiment of a data migration method according to the present disclosure.
  • Figure 4 is a flow chart of an application scenario in the data migration method according to the present disclosure.
  • Figure 5 is another flow chart of an application scenario in the data migration method according to the present disclosure.
  • Figure 6 is a schematic flowchart of data writing in an application scenario in the data migration method according to the present disclosure
  • Figure 7 is a schematic structural diagram of an embodiment of a data migration device according to the present disclosure.
  • FIG. 8 is a block diagram of an electronic device used to implement the data migration method according to an embodiment of the present disclosure.
  • FIG. 1 shows an exemplary system architecture 100 to which embodiments of the data migration method or data migration apparatus of the present disclosure can be applied.
  • the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105.
  • the network 104 is a medium used to provide communication links between the terminal devices 101, 102, 103 and the server 105.
  • Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • terminal devices 101, 102, 103 Users can use terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc.
  • the terminal devices 101, 102, and 103 may be user terminal devices, on which various client applications may be installed, such as data migration software, data maintenance applications, image applications, video applications, search applications, and financial applications. Applications etc.
  • the terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting receiving server messages, including but not limited to smartphones, tablet computers, e-book readers, electronic players, laptop computers and desktop computers. etc.
  • the terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they can be various electronic devices. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software modules used to provide distributed services), or as a single software or software module. There are no specific limitations here.
  • the server 105 can switch the read and write address of new data from the data source to the data destination, Among them, new data refers to the data generated by the data generation end during the data migration process; the double-end read operation is enabled to read new data from the data source end and the data destination end; in response to the current data migration status belonging to the first state, the New data is written to the data destination based on the serial writing method; after a preset period of time, the serial writing method is turned off and new data is written to the data destination; the existing data at the data source is migrated to the data destination.
  • the data migration method provided by the embodiment of the present disclosure can be executed by the server 105, and accordingly, the data migration device can be provided in the server 105.
  • the data migration method and device include: switching the read and write address of new data from the data source to the data destination; starting a double-end read operation, reading new data from the data source and data destination, and responding
  • new data is written to the data destination based on the serialized writing method; after the preset time period, the serialized writing method is turned off and the new data is written to the data destination; the data is The existing data at the source end is migrated to the data destination end.
  • a process 200 according to one embodiment of the data migration method of the present disclosure is shown, including the following steps:
  • Step 201 Switch the read-write address of the new data from the data source to the data destination, where the new data refers to the data generated by the data generation end during the data migration process.
  • the execution subject of the data migration method can switch the read and write address of the new data from the data source end to the data destination end.
  • new data refers to data newly generated by the data generation end during the storage end switching process/stage and to be written to the data storage end.
  • the data source refers to the data storage before data migration
  • the data destination refers to the new data storage to which the data is to be migrated.
  • Step 202 Start a double-ended reading operation to read new data from the data source and data destination.
  • the double-ended read operation can be enabled so that during the process of data live migration, New data can be read from the data source and data destination. This step does not change the process/operation of writing data, but only updates the process of reading data to double reading.
  • Step 203 In response to the current data migration state belonging to the first state, new data is written to the data destination based on the serialized writing method.
  • the new data can be transferred based on the serial write to the data destination in a standardized writing manner.
  • Step 204 Turn off the serialized writing mode after a preset period of time and write new data to the data destination.
  • the serial writing mode of the data destination can be turned off, and the new data can be written in the system's default way or the conventional way ( For example, parallel writing method, etc.) write data destination.
  • Step 205 Migrate existing data from the data source to the data destination.
  • the existing data at the data source can be migrated to the data destination to complete all data (existing data and new data/ Incremental data) migration.
  • the data migration method provided in this embodiment switches the read and write address of new data from the data source to the data destination; starts a double-ended read operation, reads new data from the data source and data destination, and responds to the current
  • the data migration state belongs to the first state. New data is written to the data destination based on the serial writing method; the serial writing method is turned off after the preset period of time, and the new data is written to the data destination; the data source end is Migrate existing data to the data destination.
  • reading new data from the data source and data destination includes: reading new data from the data destination first; in response to no new data being read from the data destination, reading new data from the data source. .
  • new data when performing a double-ended read operation, new data can be read from the data destination first. If no new data is read from the data destination, new data can then be read from the data source. Since in heterogeneous storage systems, the last modification time (LastModified) of data is not trustworthy, for example, a user overwrites and uploads a data to the destination cluster, but the system time of the destination cluster It may be lagging behind the source cluster for some reason. If the last update time of the data is used to determine which side of the data to return to the source or destination, there will be a problem of not being able to read reliable data after the update. Therefore, determine the priority from The data destination reads new data to ensure the consistency of data reading.
  • LastModified the last modification time of data is not trustworthy, for example, a user overwrites and uploads a data to the destination cluster, but the system time of the destination cluster It may be lagging behind the source cluster for some reason. If the last update time of the data is used to determine which side of the data to return
  • writing the new data to the data destination based on the serialized writing method includes: in response to determining that the first lock exists, determining whether the first lock is valid, wherein the first One lock is used to lock the data writing permission; in response to determining that the first lock is valid, new data is written to the data destination in a serialized writing manner based on the first lock.
  • the first lock if it is determined that the first lock exists, determine whether the first lock is valid, and if it is determined that the first lock is valid (such as the first lock lease is within the validity period, or the first lock is in an activated state), Write new data to the data destination based on serialized writing.
  • This embodiment performs data writing operations based on state locks, which can improve the security of the system and facilitate the maintenance of the operating sequence of the system.
  • a process 300 according to another embodiment of the data migration method of the present disclosure is shown, including the following steps:
  • Step 301 Switch the read and write address of the new data from the data source to the data destination.
  • Step 302 Start a double-end read operation to read new data from the data source and data destination, where the new data refers to the data generated by the data generation end during the data migration process.
  • Step 303 In response to the current data migration state belonging to the second state, new data is written to the data source based on the serialized writing method.
  • the new data is written based on serialization.
  • the first state and the second state belong to different data storage switching states.
  • the switching state may be in the first state or the second state based on instructions from a data migration technician.
  • Step 304 In response to the current data migration state belonging to the first state, new data is written to the data destination based on the serialized writing method.
  • Step 305 After a preset period of time, the serialized writing mode is turned off and new data is written to the data destination.
  • Step 306 Migrate the existing data at the data source to the data destination.
  • steps 301, 302, 304, 305 and 306 are The description is consistent with the description of step 201, step 202, step 203, step 204, and step 205, and will not be described again here.
  • the data migration method provided by this embodiment uses different writing ends at different stages of data migration to perform data migration operations in stages, which can improve the reliability of the data migration service.
  • writing the new data to the data source based on the serialized writing method includes: in response to determining that the second lock exists, determining whether the second lock is valid, wherein, The second lock is used to lock the data writing permission; in response to determining that the second lock is valid, based on the first lock, new data is written to the data source in a serialized writing manner.
  • the second lock if it is determined that the second lock exists, it is determined whether the second lock is valid, and if it is determined that the second lock is valid (such as the second lock lease is within the validity period, or the second lock is in an activated state), Write new data to the data source based on serialized writing.
  • This embodiment performs data writing operations based on state locks, which can improve the security of the system and facilitate the maintenance of the operating sequence of the system.
  • the data migration method before starting the double-ended read operation, also includes: switching the read and write addresses of the new data from the data source.
  • the switching operation to the data destination is verified; in response to determining that the verification is passed, a backend storage cluster is allocated for the switching operation, where the backend storage cluster includes the data source or the data destination.
  • the data migration method before starting the double-ended read operation, also includes performing a verification operation on switching the read and write address of the new data from the data source to the data destination to verify the data migration operation/request. Is it legal or authorized? If it is determined that the verification is passed, a backend storage cluster is allocated for the switch operation.
  • the data migration method also includes: closing the double-ended read operation and reading new data from the data destination.
  • the double-ended reading operation after migrating the writing operation of new data to the data destination, the double-ended reading operation can be turned off, and only new data is read from the data destination.
  • data migration can be implemented based on the proxy service.
  • the proxy service can be located under the gateway of the source storage cluster (data source) and at the same level as the source storage cluster and destination storage cluster (data destination). .
  • the forwarding rules cut user traffic to the proxy service. After the proxy service completes request preprocessing, it dynamically schedules read and write traffic according to the migration stage.
  • the migration agent service mainly consists of a preprocessing module, a protocol adaptation module, and a routing and forwarding module.
  • the preprocessing module performs request context initialization, authenticates data migration requests (authentication/authorization), and audits log output;
  • the protocol adaptation module is used to dispatch requests to the API (Application Programming Interface) corresponding to the proxy layer. interface);
  • the routing and forwarding module dynamically routes different migration tasks to the corresponding back-end storage cluster (data source/data destination) based on the current migration progress.
  • the data migration process implemented by the proxy service consists of the following stages.
  • the implementer dynamically adjusts the user's migration status in the proxy service according to the user's migration progress, thereby routing read and write traffic.
  • the entire migration The process not only ensures the availability of the storage service, but also ensures the consistency of the data, and the user side is unaware of the entire migration process:
  • Reading data source and writing data source When providing proxy access to users, the forwarding rules of the source cluster gateway need to be changed. For example, take Nginx (a high-performance hypertext transfer protocol and reverse proxy World Wide Web server) as an example. , changing the forwarding rules requires modifying the Nginx configuration file, adjusting the upstream (backend server) attributes, and executing Nginx reload instructions. Since Nginx may be deployed with multiple instances, part of the user traffic may be scheduled to the proxy service, and part of the traffic is still in the source storage cluster. Therefore, the traffic scheduled to the proxy service is first set to be routed to the source storage for both reading and writing. The cluster enables the proxy service to achieve a layer of transparent transmission and avoid risks in data consistency.
  • Nginx a high-performance hypertext transfer protocol and reverse proxy World Wide Web server
  • Dual-end reading of data and writing of data to the source After the source-side cluster gateway completes the traffic redirection configuration for the user, the user's traffic status is changed to dual-end of reading data and writing of data to the source. This step does not change the writing
  • the destination of the data only changes the reading data to double reading to avoid the linear consistency problem of not being able to read the data after writing. In the operation of reading data from both ends, the destination cluster is read first, and if the data exists, it is returned. Otherwise, the source cluster is read and the final result is returned directly (data exists or data is not found). In heterogeneous storage systems, the last modification time (LastModified) of data is not trustworthy.
  • a user overwrites and uploads data to the destination cluster, but the system time of the destination cluster may be different from the source cluster for some reason. Lagging behind, if the last update time of the data is used to determine which side of the data to return, there will be a reliability problem that the data cannot be read after the update. Therefore, the destination cluster is read first instead of reading from both ends at the same time.
  • Reading data from both ends and writing data source based on serialized writing Turn on serialized writing, as shown in Figure 6.
  • the first lock is a priority lock.
  • the data migration phase is in the stage of "reading data from both ends and writing the data source end based on serialized writing"
  • it can be called a left lock (second lock)
  • the data migration phase is When the stage is in the "double-end reading data and writing data destination based on serial writing method" stage, it is called the right lock (first lock), and the priority of the left lock is smaller than that of the right lock.
  • the specific steps are:
  • the data migration phase is in the "dual-end reading of data and writing of data source based on serialized writing", obtain the left lock of the resource to be written. If there is no current lock, or there is a left lock and the lease has expired , then acquire the left lock and write the data to the source. If the current left lock lease has not expired or there is a right lock, this request fails.
  • the data migration phase is in the "dual-end reading of data and writing of data destination based on serialized writing", acquire the right lock of the resource to be written. If there is currently no unreleased right lock, acquire the lock and Write data to the destination.
  • Dual-end reading data and writing data destination After completing the switching of writing data, wait for all proxy service instances to be ready after the preset time (there are some ongoing data requests that have not been completed during the switching process), you can Serialization is turned off. It is safe to turn off serialization writing at this time, because all nodes write to the destination cluster, and the linear consistency of data within a single system can be guaranteed.
  • the user's incremental writes (new data generated during the migration process) have been safely migrated to the destination cluster.
  • the existing data can be migrated. Since the data of the destination cluster can be determined to be the latest, Only data that does not exist in the destination cluster needs to be migrated.
  • This method can be applied to large-scale data hot migration scenarios between heterogeneous storage systems, solving the problem of long-tail migration cycles and data consistency issues, and ensuring service availability, performance and data reliability.
  • the present disclosure provides an embodiment of a data migration device.
  • the device embodiment is the same as the method shown in Figures 2 and 3.
  • the device can be applied to various electronic devices.
  • the data migration device of this embodiment includes: a switching unit 701 , a double-ended reading unit 702 , a first writing unit 703 , a second writing unit 704 , and a data migration unit 705 .
  • the switching unit is configured to switch the read and write address of new data from the data source end to the data destination end, where the new data refers to the data generated by the data generation end during the data migration process;
  • the double-end reading unit is It is configured to enable a double-ended read operation and read new data from the data source and data destination;
  • the first writing unit is configured to respond to the current data migration state belonging to the first state and write the new data based on serialization.
  • the data destination is written in the input mode; the second writing unit is configured to turn off the serialized writing mode after a preset period of time and write new data to the data destination; the data migration unit is configured to transfer the data from the data source to the data destination. Existing data is migrated to the data destination.
  • the double-ended reading unit includes: a first reading module configured to preferentially read new data from the data destination; a second reading module configured to respond to the unread data from the data destination. Get new data and read new data from the data source.
  • the first writing unit includes: a first determination module configured to determine whether the first lock is valid in response to determining that the first lock exists, wherein the first lock is used to lock the data writing permission;
  • the first writing module is configured to write new data to the data destination in a serialized writing manner based on the first lock in response to determining that the first lock is valid.
  • the data migration device further includes: a third writing unit configured to write new data to the data source based on a serialized writing method in response to the current data migration state belonging to the second state.
  • the third writing unit includes: a second determination module configured to determine whether the second lock is valid in response to determining that the second lock exists, wherein the second lock is used to lock the data writing permission;
  • the second writing module is configured to write new data to the data source in a serialized writing manner based on the first lock in response to determining that the second lock is valid.
  • the device before starting the double-ended read operation, further includes: verifying the switching operation of switching the read and write address of the new data from the data source to the data destination; in response to determining that the verification is passed, performing the switching operation Allocate a back-end storage cluster, where the back-end storage cluster includes the data source or data destination.
  • the data migration device further includes: a shutdown unit configured to close the double-ended read operation and read new data from the data destination.
  • Each unit in the above-mentioned device 700 corresponds to the steps in the method described with reference to FIG. 2 and FIG. 3 . Therefore, the operations, features and achievable technical effects described above for the data migration method are also applicable to the device 700 and the units included therein, and will not be described again here.
  • the present disclosure also provides an electronic device and a readable storage medium.
  • FIG. 8 it is a block diagram of an electronic device 800 according to a data migration method according to an embodiment of the present disclosure.
  • Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
  • the electronic device includes: one or more processors 801, memory 802, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces.
  • the various components are connected to each other using different buses and can be mounted on a common motherboard or otherwise mounted as desired.
  • the processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface.
  • multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired.
  • multiple electronic devices can be connected, each device providing part of the necessary operation (eg, as a server array, a set of blade servers, or a multi-processor system).
  • Figure 8 takes a processor 801 as an example.
  • the memory 802 is the non-transitory computer-readable storage medium provided by the present disclosure.
  • the memory stores instructions executable by at least one processor, so that the at least one processor executes the data migration method provided by the present disclosure.
  • the non-transitory computer-readable storage medium of the present disclosure stores computer instructions, which are used to cause the computer to execute the data migration method provided by the present disclosure.
  • the memory 802 can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions/modules corresponding to the data migration method in the embodiments of the present disclosure (for example, attached Switching unit 701 shown in Figure 7, double-ended Reading unit 702, first writing unit 703, second writing unit 704, data migration unit 705).
  • the processor 801 executes various functional applications and data processing of the server by running non-transient software programs, instructions and modules stored in the memory 802, that is, implementing the data migration method in the above method embodiment.
  • the memory 802 may include a storage program area and a storage data area, wherein the storage program area may store an operating system and an application program required for at least one function; the storage data area may store data created according to the use of an electronic device for extracting video clips. Data etc.
  • memory 802 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device.
  • memory 802 optionally includes memory located remotely from processor 801, and these remote memories may be connected via a network to electronic devices used to extract video clips. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
  • the electronic equipment of the data migration method may also include: an input device 803, an output device 804, and a bus 805.
  • the processor 801, the memory 802, the input device 803 and the output device 804 can be connected through a bus 805 or other means. In Figure 8, the connection through the bus 805 is taken as an example.
  • the input device 803 may receive input numeric or character information and generate key signal input related to user settings and functional control of the electronic device used to extract the video clip, such as a touch screen, keypad, mouse, trackpad, touch pad, pointer An input device such as a stick, one or more mouse buttons, a trackball, or a joystick.
  • Output devices 804 may include display devices, auxiliary lighting devices (eg, LEDs), tactile feedback devices (eg, vibration motors), and the like.
  • the display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
  • Various implementations of the systems and techniques described herein may be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor
  • the processor which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
  • machine-readable medium and “computer-readable medium” refer to any computer program product, apparatus, and/or means for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLD)), including machine-readable media that receive machine instructions as machine-readable signals.
  • machine-readable signal refers to any signal used to provide machine instructions and/or data to a programmable processor.
  • the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer.
  • a display device eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or a trackball
  • Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
  • the systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system.
  • the components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
  • Computer systems may include clients and servers.
  • Clients and servers are generally remote from each other and typically interact over a communications network.
  • the relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other.

Abstract

The present invention discloses a data migration method and device, which relate to the technical field of computers. The method comprises: switching a read-write address of new data from a data source end to a data destination end; launching a double-end read operation and reading new data from the data source end and the data destination end; in response to a current data migration state belonging to a first state, writing the new data to the data destination end in a serialized write mode; turning off the serialized write mode after a preset duration, and writing the new data to the data destination end; and migrating stored data from the data source end to the data destination end.

Description

数据迁移方法和装置Data migration method and device
相关申请的交叉引用Cross-references to related applications
本申请要求于2022年07月29日提交的、申请号为202210911723.1、发明名称为“数据迁移方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed on July 29, 2022 with application number 202210911723.1 and the invention title "Data Migration Method and Device", the entire content of which is incorporated into this application by reference.
技术领域Technical field
本公开涉及计算机技术领域,具体涉及数据迁移方法和装置。The present disclosure relates to the field of computer technology, and specifically to data migration methods and devices.
背景技术Background technique
云计算是一种计算服务,作为云上存储服务提供方,其存储系统在不断开发升级或者更新换代。在新旧存储系统进行切换时,数据读写服务的可靠性至关重要。现有的在新旧存储系统切换时,数据迁移的方法是将存量数据从旧存储系统迁移到新存储系统,并将对新生成的数据读写操作从新存储系统镜像回源至就存储系统,以实现新旧系统切换过程中的数据读写服务的连续性。Cloud computing is a computing service. As a cloud storage service provider, its storage system is constantly being developed, upgraded or updated. When switching between old and new storage systems, the reliability of data reading and writing services is crucial. When switching between old and new storage systems, the existing data migration method is to migrate the existing data from the old storage system to the new storage system, and mirror the newly generated data read and write operations back to the source from the new storage system to the old storage system. Realize the continuity of data reading and writing services during the switching process between the old and new systems.
然而,现有的数据迁移方法存在可靠性差的问题。However, existing data migration methods suffer from poor reliability.
发明内容Contents of the invention
本公开提供了一种数据迁移方法、装置、电子设备以及计算机可读存储介质。The present disclosure provides a data migration method, device, electronic device, and computer-readable storage medium.
在本公开的一种或多种实施例中,提供了一种数据迁移方法,包括:将新数据的读写地址从数据源端切换至数据目的端,其中,新数据是指数据生成端在数据迁移过程中生成的数据;开启双端读取操作,从数据源端以及数据目的端读取新数据;响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端;在预设时长后关闭串行化写入方式,将新数据写入数据目的端;将数据源端的存量数据迁移至数据目的端。 In one or more embodiments of the present disclosure, a data migration method is provided, including: switching the read and write addresses of new data from the data source end to the data destination end, where the new data refers to the data generation end at Data generated during the data migration process; start a double-ended read operation to read new data from the data source and data destination; in response to the current data migration status being the first state, write the new data based on the serial writing method Enter the data destination; turn off the serialized writing mode after the preset time and write new data to the data destination; migrate the existing data from the data source to the data destination.
在本公开的一种或多种实施例中,提供了一种数据迁移装置,包括:切换单元,被配置为将新数据的读写地址从数据源端切换至数据目的端,其中,新数据是指数据生成端在数据迁移过程中生成的数据;双端读取单元,被配置为开启双端读取操作,从数据源端以及数据目的端读取新数据;第一写入单元,被配置为响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端;第二写入单元,被配置为在预设时长后关闭串行化写入方式,将新数据写入数据目的端;数据迁移单元,被配置为将数据源端的存量数据迁移至数据目的端。In one or more embodiments of the present disclosure, a data migration device is provided, including: a switching unit configured to switch the read and write addresses of new data from the data source end to the data destination end, wherein the new data Refers to the data generated by the data generation end during the data migration process; the double-ended reading unit is configured to enable a double-ended reading operation and reads new data from the data source and data destination; the first writing unit is is configured to write new data to the data destination based on the serialized writing method in response to the current data migration status belonging to the first status; the second writing unit is configured to turn off the serialized writing method after a preset period of time , writes new data to the data destination; the data migration unit is configured to migrate existing data from the data source to the data destination.
在本公开的一种或多种实施例中,提供了一种电子设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够实现上述任一实施例中的方法。In one or more embodiments of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores information that can be The instructions executed by the at least one processor are executed by the at least one processor, so that the at least one processor can implement the method in any of the above embodiments.
在本公开的一种或多种实施例中,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机能够实现上述任一实施例中的方法。In one or more embodiments of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to implement any of the above embodiments. Methods.
在本公开的一种或多种实施例中,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时能够实现上述任一实施例中的方法。In one or more embodiments of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, can implement the method in any of the above embodiments.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
附图说明Description of drawings
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. in:
图1是本公开的实施例可以应用于其中的示例性系统架构图;Figure 1 is an exemplary system architecture diagram in which embodiments of the present disclosure may be applied;
图2是根据本公开的数据迁移方法的一个实施例的流程图;Figure 2 is a flow chart of an embodiment of a data migration method according to the present disclosure;
图3是根据本公开的数据迁移方法的另一个实施例的流程图;Figure 3 is a flow chart of another embodiment of a data migration method according to the present disclosure;
图4是根据本公开的数据迁移方法中一个应用场景的流程图;Figure 4 is a flow chart of an application scenario in the data migration method according to the present disclosure;
图5是根据本公开的数据迁移方法中一个应用场景的另一个流程图; Figure 5 is another flow chart of an application scenario in the data migration method according to the present disclosure;
图6是根据本公开的数据迁移方法中一个应用场景中数据写入的流程示意图;Figure 6 is a schematic flowchart of data writing in an application scenario in the data migration method according to the present disclosure;
图7是根据本公开的数据迁移装置的一个实施例的结构示意图;Figure 7 is a schematic structural diagram of an embodiment of a data migration device according to the present disclosure;
图8是用来实现本公开实施例的数据迁移方法的电子设备的框图。FIG. 8 is a block diagram of an electronic device used to implement the data migration method according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding and should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
图1示出了可以应用本公开的数据迁移方法或数据迁移装置的实施例的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 to which embodiments of the data migration method or data migration apparatus of the present disclosure can be applied.
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in Figure 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is a medium used to provide communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103可以是用户终端设备,其上可以安装有各种客户端应用,例如,数据迁移类软件、数据维护类应用、图像类应用、视频类应用、搜索类应用、金融类应用等。Users can use terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, and 103 may be user terminal devices, on which various client applications may be installed, such as data migration software, data maintenance applications, image applications, video applications, search applications, and financial applications. Applications etc.
终端设备101、102、103可以是具有显示屏并且支持接收服务器消息的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、电子播放器、膝上型便携计算机和台式计算机等等。The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting receiving server messages, including but not limited to smartphones, tablet computers, e-book readers, electronic players, laptop computers and desktop computers. etc.
终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是各种电子设备,当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they can be various electronic devices. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software modules used to provide distributed services), or as a single software or software module. There are no specific limitations here.
服务器105可以将新数据的读写地址从数据源端切换至数据目的端, 其中,新数据是指数据生成端在数据迁移过程中生成的数据;开启双端读取操作,从数据源端以及数据目的端读取新数据;响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端;在预设时长后关闭串行化写入方式,将新数据写入数据目的端;将数据源端的存量数据迁移至数据目的端。The server 105 can switch the read and write address of new data from the data source to the data destination, Among them, new data refers to the data generated by the data generation end during the data migration process; the double-end read operation is enabled to read new data from the data source end and the data destination end; in response to the current data migration status belonging to the first state, the New data is written to the data destination based on the serial writing method; after a preset period of time, the serial writing method is turned off and new data is written to the data destination; the existing data at the data source is migrated to the data destination.
需要说明的是,本公开的实施例所提供的数据迁移方法可以由服务器105执行,相应地,数据迁移装置可以设置于服务器105中。It should be noted that the data migration method provided by the embodiment of the present disclosure can be executed by the server 105, and accordingly, the data migration device can be provided in the server 105.
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the number of terminal devices, networks and servers in Figure 1 is only illustrative. Depending on implementation needs, there can be any number of end devices, networks, and servers.
本公开提供的数据迁移方法、装置,包括:将新数据的读写地址从数据源端切换至数据目的端;开启双端读取操作,从数据源端以及数据目的端读取新数据,响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端;在预设时长后关闭串行化写入方式,将新数据写入数据目的端;将数据源端的存量数据迁移至数据目的端,该方案能够应用于大规模的异构存储系统间的数据热迁移场景,可以避免数据迁移周期长尾问题和数据一致性问题,提高数据迁移服务可用性、性能及数据可靠性。The data migration method and device provided by the disclosure include: switching the read and write address of new data from the data source to the data destination; starting a double-end read operation, reading new data from the data source and data destination, and responding When the current data migration state belongs to the first state, new data is written to the data destination based on the serialized writing method; after the preset time period, the serialized writing method is turned off and the new data is written to the data destination; the data is The existing data at the source end is migrated to the data destination end. This solution can be applied to data hot migration scenarios between large-scale heterogeneous storage systems. It can avoid long-tail data migration cycle problems and data consistency problems, and improve the availability and performance of data migration services. and data reliability.
继续参考图2,示出了根据本公开的数据迁移方法的一个实施例的流程200,包括以下步骤:Continuing to refer to FIG. 2 , a process 200 according to one embodiment of the data migration method of the present disclosure is shown, including the following steps:
步骤201,将新数据的读写地址从数据源端切换至数据目的端,其中,新数据是指数据生成端在数据迁移过程中生成的数据。Step 201: Switch the read-write address of the new data from the data source to the data destination, where the new data refers to the data generated by the data generation end during the data migration process.
在本实施例中,数据迁移方法的执行主体(例如图1所示的服务器)可以将新数据的读写地址从数据源端切换为数据目的端。其中,新数据是指数据生成端在存储端切换过程/阶段中所新生成的、待写入数据存储端的数据。数据源端是指数据迁移前的数据存储端,数据目的端是指数据待被迁移至的、新的数据存储端。In this embodiment, the execution subject of the data migration method (for example, the server shown in Figure 1) can switch the read and write address of the new data from the data source end to the data destination end. Among them, new data refers to data newly generated by the data generation end during the storage end switching process/stage and to be written to the data storage end. The data source refers to the data storage before data migration, and the data destination refers to the new data storage to which the data is to be migrated.
步骤202,开启双端读取操作,从数据源端以及数据目的端读取新数据。Step 202: Start a double-ended reading operation to read new data from the data source and data destination.
在本实施例中,可以开启双端读取操作,以在数据热迁移的过程中, 可以从数据源端以及数据目的端读取新数据。该步骤并没有改变写数据的流程/操作,只是将读数据的流程更新为双读。In this embodiment, the double-ended read operation can be enabled so that during the process of data live migration, New data can be read from the data source and data destination. This step does not change the process/operation of writing data, but only updates the process of reading data to double reading.
步骤203,响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端。Step 203: In response to the current data migration state belonging to the first state, new data is written to the data destination based on the serialized writing method.
在本实施例中,若当前数据迁移状态属于存储端切换(即,将新数据的读写地址从数据源端切换至数据目的端的切换)阶段的第一状态阶段,可以将新数据基于串行化写入的方式写入数据目的端,In this embodiment, if the current data migration state belongs to the first state stage of the storage side switching (that is, switching the read and write address of the new data from the data source to the data destination) stage, the new data can be transferred based on the serial write to the data destination in a standardized writing manner.
步骤204,在预设时长后关闭串行化写入方式,将新数据写入数据目的端。Step 204: Turn off the serialized writing mode after a preset period of time and write new data to the data destination.
在本实施例中,可以在将数据的写入操作切换至数据目的端的预设时长后,关闭数据目的端的串行化写入方式,将新数据以系统写入数据的默认方式或者常规方式(如,并行写入方式等)写入数据目的端。In this embodiment, after switching the data writing operation to the data destination for a preset time period, the serial writing mode of the data destination can be turned off, and the new data can be written in the system's default way or the conventional way ( For example, parallel writing method, etc.) write data destination.
步骤205,将数据源端的存量数据迁移至数据目的端。Step 205: Migrate existing data from the data source to the data destination.
在本实施例中,在将新数据的读写操作均从数据源端切换至数据目的端之后,可以将数据源端的存量数据迁移至数据目的端,以完成全部数据(存量数据以及新数据/增量数据)的迁移。In this embodiment, after switching the read and write operations of new data from the data source to the data destination, the existing data at the data source can be migrated to the data destination to complete all data (existing data and new data/ Incremental data) migration.
本实施例提供的数据迁移的方法,将新数据的读写地址从数据源端切换至数据目的端;开启双端读取操作,从数据源端以及数据目的端读取新数据,响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端;在预设时长后关闭串行化写入方式,将新数据写入数据目的端;将数据源端的存量数据迁移至数据目的端,该方案能够应用于大规模的异构存储系统间的数据热迁移场景,可以避免数据迁移周期长尾问题和数据一致性问题,提高数据迁移服务可用性、性能及数据可靠性。The data migration method provided in this embodiment switches the read and write address of new data from the data source to the data destination; starts a double-ended read operation, reads new data from the data source and data destination, and responds to the current The data migration state belongs to the first state. New data is written to the data destination based on the serial writing method; the serial writing method is turned off after the preset period of time, and the new data is written to the data destination; the data source end is Migrate existing data to the data destination. This solution can be applied to large-scale hot data migration scenarios between heterogeneous storage systems. It can avoid long-tail problems in the data migration cycle and data consistency problems, and improve the availability, performance and data of data migration services. reliability.
可选地,从数据源端以及数据目的端读取新数据,包括:优先从数据目的端读取新数据;响应于从数据目的端未读取到新数据,从数据源端读取新数据。Optionally, reading new data from the data source and data destination includes: reading new data from the data destination first; in response to no new data being read from the data destination, reading new data from the data source. .
在本实施例中,在进行双端读取操作时,可以优先从数据目的端读取新数据,若从数据目的端未读取到新数据,再从数据源端读取新数据。由于在异构存储系统中,数据的最后修改时间(LastModified)是不可信的,例如,用户覆盖上传了一个数据到目的集群中,但是目的集群的系统时间 可能由于某种原因相比于源集群滞后,如果用数据的最后更新时间来确定返回源端或者目的端哪边的数据,那么会出现更新后读不到可靠数据的问题,因此,确定优先从数据目的端读取新数据可以确保数据读取的一致性。In this embodiment, when performing a double-ended read operation, new data can be read from the data destination first. If no new data is read from the data destination, new data can then be read from the data source. Since in heterogeneous storage systems, the last modification time (LastModified) of data is not trustworthy, for example, a user overwrites and uploads a data to the destination cluster, but the system time of the destination cluster It may be lagging behind the source cluster for some reason. If the last update time of the data is used to determine which side of the data to return to the source or destination, there will be a problem of not being able to read reliable data after the update. Therefore, determine the priority from The data destination reads new data to ensure the consistency of data reading.
可选地,响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端,包括:响应于确定存在第一锁,判断第一锁是否有效,其中第一锁用于锁定数据写入权限;响应于确定第一锁有效,基于第一锁将新数据基于串行化写入方式写入数据目的端。Optionally, in response to the current data migration state belonging to the first state, writing the new data to the data destination based on the serialized writing method includes: in response to determining that the first lock exists, determining whether the first lock is valid, wherein the first One lock is used to lock the data writing permission; in response to determining that the first lock is valid, new data is written to the data destination in a serialized writing manner based on the first lock.
在本实施例中,若确定存在第一锁,判断该第一锁是否有效,并在确定第一锁有效(如第一锁租约在有效期内、或者第一锁处于激活状态)的情况下,将新数据基于串行化写入方式写入数据目的端。In this embodiment, if it is determined that the first lock exists, determine whether the first lock is valid, and if it is determined that the first lock is valid (such as the first lock lease is within the validity period, or the first lock is in an activated state), Write new data to the data destination based on serialized writing.
本实施例基于状态锁进行数据的写入操作,可以提高系统的安全性以及便于维护系统的操作顺序。This embodiment performs data writing operations based on state locks, which can improve the security of the system and facilitate the maintenance of the operating sequence of the system.
继续参考图3,示出了根据本公开的数据迁移方法的另一个实施例的流程300,包括以下步骤:Continuing to refer to FIG. 3 , a process 300 according to another embodiment of the data migration method of the present disclosure is shown, including the following steps:
步骤301,将新数据的读写地址从数据源端切换至数据目的端。Step 301: Switch the read and write address of the new data from the data source to the data destination.
步骤302,开启双端读取操作,从数据源端以及数据目的端读取新数据,其中,新数据是指数据生成端在数据迁移过程中生成的数据。Step 302: Start a double-end read operation to read new data from the data source and data destination, where the new data refers to the data generated by the data generation end during the data migration process.
步骤303,响应于当前数据迁移状态属于第二状态,将新数据基于串行化写入方式写入数据源端。Step 303: In response to the current data migration state belonging to the second state, new data is written to the data source based on the serialized writing method.
在本实施例中,若当前数据迁移状态属于存储端切换(即,将新数据的读写地址从数据源端切换至数据目的端的切换)阶段的第二状态,将新数据基于串行化写入方式写入数据源端。第一状态与第二状态属于不同的数据存储切换状态,切换状态处于第一状态或者第二状态可以基于数据迁移技术人员的指示。In this embodiment, if the current data migration state belongs to the second state of the storage-side switching (that is, switching the read-write address of the new data from the data source to the data destination) stage, the new data is written based on serialization. Write to the data source in input mode. The first state and the second state belong to different data storage switching states. The switching state may be in the first state or the second state based on instructions from a data migration technician.
步骤304,响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端。Step 304: In response to the current data migration state belonging to the first state, new data is written to the data destination based on the serialized writing method.
步骤305,在预设时长后关闭串行化写入方式,将新数据写入数据目的端。Step 305: After a preset period of time, the serialized writing mode is turned off and new data is written to the data destination.
步骤306,将数据源端的存量数据迁移至数据目的端。Step 306: Migrate the existing data at the data source to the data destination.
本实施例中对步骤301、步骤302、步骤304、步骤305、步骤306的 描述与步骤201、步骤202、步骤203、步骤204、步骤205的描述一致,此处不再赘述。In this embodiment, steps 301, 302, 304, 305 and 306 are The description is consistent with the description of step 201, step 202, step 203, step 204, and step 205, and will not be described again here.
本实施例提供的数据迁移方法,相比于图2描述的实施例,在数据迁移的不同阶段,采用不同的写入端,以分阶段进行数据迁移操作,可以提高数据迁移服务的可靠性。Compared with the embodiment described in Figure 2, the data migration method provided by this embodiment uses different writing ends at different stages of data migration to perform data migration operations in stages, which can improve the reliability of the data migration service.
可选地,响应于当前数据迁移状态属于第二状态,将新数据基于串行化写入方式写入数据源端,包括:响应于确定存在第二锁,判断第二锁是否有效,其中,第二锁用于锁定数据写入权限;响应于确定第二锁有效,基于第一锁将新数据基于串行化写入方式写入数据源端。Optionally, in response to the current data migration state belonging to the second state, writing the new data to the data source based on the serialized writing method includes: in response to determining that the second lock exists, determining whether the second lock is valid, wherein, The second lock is used to lock the data writing permission; in response to determining that the second lock is valid, based on the first lock, new data is written to the data source in a serialized writing manner.
在本实施例中,若确定存在第二锁,判断该第二锁是否有效,并在确定第二锁有效(如第二锁租约在有效期内、或者第二锁处于激活状态)的情况下,将新数据基于串行化写入方式写入数据源端。In this embodiment, if it is determined that the second lock exists, it is determined whether the second lock is valid, and if it is determined that the second lock is valid (such as the second lock lease is within the validity period, or the second lock is in an activated state), Write new data to the data source based on serialized writing.
本实施例基于状态锁进行数据的写入操作,可以提高系统的安全性以及便于维护系统的操作顺序。This embodiment performs data writing operations based on state locks, which can improve the security of the system and facilitate the maintenance of the operating sequence of the system.
在上述结合图2和图3描述的实施例的一些可选的实现方式中,查在开启双端读取操作之前,数据迁移方法还包括:对将新数据的读写地址从数据源端切换至数据目的端的切换操作进行验证;响应于确定验证通过,为切换操作分配后端存储集群,其中,后端存储集群包括数据源端或者数据目的端。In some optional implementations of the embodiments described above in conjunction with Figures 2 and 3, before starting the double-ended read operation, the data migration method also includes: switching the read and write addresses of the new data from the data source. The switching operation to the data destination is verified; in response to determining that the verification is passed, a backend storage cluster is allocated for the switching operation, where the backend storage cluster includes the data source or the data destination.
在本实施例中,在开启双端读取操作之前,数据迁移方法还包括对将新数据的读写地址从数据源端切换至数据目的端的切换操作进行验证操作,以验证数据迁移操作/请求是否合法或者是否经过授权。若确定验证通过,则为切换操作分配后端存储集群。In this embodiment, before starting the double-ended read operation, the data migration method also includes performing a verification operation on switching the read and write address of the new data from the data source to the data destination to verify the data migration operation/request. Is it legal or authorized? If it is determined that the verification is passed, a backend storage cluster is allocated for the switch operation.
在上述结合图2和图3描述的实施例的一些可选的实现方式中,数据迁移方法还包括:关闭双端读取操作,从数据目的端读取新数据。In some optional implementations of the embodiments described above with reference to Figures 2 and 3, the data migration method also includes: closing the double-ended read operation and reading new data from the data destination.
在本实施例中,在将新数据的写入操作迁移至数据目的端后,可以关闭双端读取操作,仅从数据目的端读取新的数据。In this embodiment, after migrating the writing operation of new data to the data destination, the double-ended reading operation can be turned off, and only new data is read from the data destination.
在一些应用场景中,可以基于代理服务实现数据迁移,代理服务可以位于源端存储集群(数据源端)的网关之下,与源端存储集群、目的端存储集群(数据目的端)处于同一层级。在执行数据迁移时,通过调整网关 的转发规则,将用户的流量切入到代理服务,代理服务完成请求预处理后,根据迁移阶段,动态的进行读写流量调度。In some application scenarios, data migration can be implemented based on the proxy service. The proxy service can be located under the gateway of the source storage cluster (data source) and at the same level as the source storage cluster and destination storage cluster (data destination). . When performing data migration, by adjusting the gateway The forwarding rules cut user traffic to the proxy service. After the proxy service completes request preprocessing, it dynamically schedules read and write traffic according to the migration stage.
如图4所示,迁移代理服务主要由预处理模块、协议适配模块和路由转发模块构成。其中,预处理模块执行请求上下文初始化,对数据迁移请求进行鉴定(认证/授权),以及审计日志输出;协议适配模块用于将请求派发给代理层对应的API(Application Programming Interface,应用程序编程接口);路由转发模块根据当前阶段所处的迁移进度,动态的将不同的迁移任务路由到相应的后端存储集群(数据源端/数据目的端)。As shown in Figure 4, the migration agent service mainly consists of a preprocessing module, a protocol adaptation module, and a routing and forwarding module. Among them, the preprocessing module performs request context initialization, authenticates data migration requests (authentication/authorization), and audits log output; the protocol adaptation module is used to dispatch requests to the API (Application Programming Interface) corresponding to the proxy layer. interface); the routing and forwarding module dynamically routes different migration tasks to the corresponding back-end storage cluster (data source/data destination) based on the current migration progress.
如图5所示,代理服务实现的数据迁移过程由以下阶段构成,迁移过程中,实施人员根据用户的迁移进度动态调整其在代理服务中的迁移状态,从而进行读写流量的路由,整个迁移过程既保证存储服务的可用性,也保证数据的一致性,并且用户侧对整个迁移过程无感知:As shown in Figure 5, the data migration process implemented by the proxy service consists of the following stages. During the migration process, the implementer dynamically adjusts the user's migration status in the proxy service according to the user's migration progress, thereby routing read and write traffic. The entire migration The process not only ensures the availability of the storage service, but also ensures the consistency of the data, and the user side is unaware of the entire migration process:
读数据源端以及写数据源端:对用户进行代理接入时需要更改源端集群网关的转发规则,例如,以Nginx(一种高性能的超文本传输协议和反向代理万维网服务器)为例,更改转发规则需要修改Nginx配置文件,调整upstream(后端服务器)属性,并执行Nginx的重新加载指令。由于Nginx可能多实例部署,所以对于用户的流量可能部分流量被调度到代理服务,部分流量仍在源端存储集群,因此被调度到代理服务的流量先设置为读和写均路由到源端存储集群,使代理服务实现一层透明传输,避免数据一致性上的风险。Reading data source and writing data source: When providing proxy access to users, the forwarding rules of the source cluster gateway need to be changed. For example, take Nginx (a high-performance hypertext transfer protocol and reverse proxy World Wide Web server) as an example. , changing the forwarding rules requires modifying the Nginx configuration file, adjusting the upstream (backend server) attributes, and executing Nginx reload instructions. Since Nginx may be deployed with multiple instances, part of the user traffic may be scheduled to the proxy service, and part of the traffic is still in the source storage cluster. Therefore, the traffic scheduled to the proxy service is first set to be routed to the source storage for both reading and writing. The cluster enables the proxy service to achieve a layer of transparent transmission and avoid risks in data consistency.
双端读取数据以及写数据源端:当源端集群网关完成对用户的流量重定向配置后,将该用户的流量状态变更为双端读取数据以及写数据源端,该步骤未改变写数据的目的地,仅将读数据变更为双读,避免出现写后读不到数据的线性一致性问题。在双端读取数据的操作中,优先读取目的集群,如果数据存在,则返回,否则读取源集群并直接返回最终结果(数据存在或数据未找到)。由于在异构存储系统中,数据的最后修改时间(LastModified)是不可信的,例如,用户覆盖上传了一个数据到目的集群中,但是目的集群的系统时间可能由于某种原因相比于源集群落后,如果用数据的最后更新时间来确定返回哪边的数据,则会出现更新后读不到数据的可靠性问题,故优先读目的集群,而并非两端同时读取。 Dual-end reading of data and writing of data to the source: After the source-side cluster gateway completes the traffic redirection configuration for the user, the user's traffic status is changed to dual-end of reading data and writing of data to the source. This step does not change the writing The destination of the data only changes the reading data to double reading to avoid the linear consistency problem of not being able to read the data after writing. In the operation of reading data from both ends, the destination cluster is read first, and if the data exists, it is returned. Otherwise, the source cluster is read and the final result is returned directly (data exists or data is not found). In heterogeneous storage systems, the last modification time (LastModified) of data is not trustworthy. For example, a user overwrites and uploads data to the destination cluster, but the system time of the destination cluster may be different from the source cluster for some reason. Lagging behind, if the last update time of the data is used to determine which side of the data to return, there will be a reliability problem that the data cannot be read after the update. Therefore, the destination cluster is read first instead of reading from both ends at the same time.
双端读取数据以及基于串行化写入方式写数据源端:开启串行化写入,如图6所示,在写数据之前,先获取资源锁再写入。第一锁是优先级锁,当数据迁移阶段处于“双端读取数据以及基于串行化写入方式写数据源端”阶段时,可称之为左锁(第二锁);当数据迁移阶段处于“双端读取数据以及基于串行化写入方式写数据目的端”阶段时,称之为右锁(第一锁),且左锁优先级小于右锁,具体步骤为:Reading data from both ends and writing data source based on serialized writing: Turn on serialized writing, as shown in Figure 6. Before writing data, first obtain the resource lock and then write. The first lock is a priority lock. When the data migration phase is in the stage of "reading data from both ends and writing the data source end based on serialized writing", it can be called a left lock (second lock); when the data migration phase is When the stage is in the "double-end reading data and writing data destination based on serial writing method" stage, it is called the right lock (first lock), and the priority of the left lock is smaller than that of the right lock. The specific steps are:
若当数据迁移阶段处于“双端读取数据以及基于串行化写入方式写数据源端”,则获取要写入资源的左锁,若当前不存在锁,或者存在左锁且租约已过期,则获取左锁并将数据写入源端。若当前左锁租约未过期或者存在右锁,则本次请求失败。If the data migration phase is in the "dual-end reading of data and writing of data source based on serialized writing", obtain the left lock of the resource to be written. If there is no current lock, or there is a left lock and the lease has expired , then acquire the left lock and write the data to the source. If the current left lock lease has not expired or there is a right lock, this request fails.
若当数据迁移阶段处于“双端读取数据以及基于串行化写入方式写数据目的端”,则获取要写入资源的右锁,若当前不存在未释放的右锁,则获取锁并将数据写入目的端。If the data migration phase is in the "dual-end reading of data and writing of data destination based on serialized writing", acquire the right lock of the resource to be written. If there is currently no unreleased right lock, acquire the lock and Write data to the destination.
双端读取数据以及写数据目的端:完成写入数据的切换后,在预设时长后,等待所有的代理服务实例就绪(切换过程中有一些进行中的数据请求还未完成),可以将串行化关闭,此时关闭串行化写入是安全的,因为所有节点都是向目的集群写,在单系统内数据的线性一致性可以得到保证。Dual-end reading data and writing data destination: After completing the switching of writing data, wait for all proxy service instances to be ready after the preset time (there are some ongoing data requests that have not been completed during the switching process), you can Serialization is turned off. It is safe to turn off serialization writing at this time, because all nodes write to the destination cluster, and the linear consistency of data within a single system can be guaranteed.
上步骤完成之后,用户的增量写入(迁移过程中新生成的新数据)已经安全的迁移到了目的集群,此时可以进行存量数据的迁移,由于目的集群的数据能够确定是最新的,所以只需要迁移目的端集群中不存在的数据即可。After the above steps are completed, the user's incremental writes (new data generated during the migration process) have been safely migrated to the destination cluster. At this time, the existing data can be migrated. Since the data of the destination cluster can be determined to be the latest, Only data that does not exist in the destination cluster needs to be migrated.
在将用户的存量数据和增量写均已切换到目的集群后,此时,可以关闭双读,以将读和写都切换到目的集群,至此整个数据迁移过程完成,代理服务完成任务。After the user's existing data and incremental writes have been switched to the destination cluster, you can turn off dual reading to switch both reading and writing to the destination cluster. At this point, the entire data migration process is completed and the proxy service completes its task.
该方法能可以应用于大规模的异构存储系统间的数据热迁移场景,解决迁移周期长尾问题和数据一致性问题,确保服务可用性、性能及数据可靠性。This method can be applied to large-scale data hot migration scenarios between heterogeneous storage systems, solving the problem of long-tail migration cycles and data consistency issues, and ensuring service availability, performance and data reliability.
进一步参考图7,作为对上述各图所示方法的实现,本公开提供了一种数据迁移装置的一个实施例,该装置实施例与图2和图3所示的方法实 施例相对应,该装置具体可以应用于各种电子设备中。With further reference to Figure 7, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a data migration device. The device embodiment is the same as the method shown in Figures 2 and 3. Corresponding to the embodiment, the device can be applied to various electronic devices.
如图7所示,本实施例的数据迁移装置,包括:切换单元701、双端读取单元702、第一写入单元703、第二写入单元704、数据迁移单元705。其中,切换单元,被配置为将新数据的读写地址从数据源端切换至数据目的端,其中,新数据是指数据生成端在数据迁移过程中生成的数据;双端读取单元,被配置为开启双端读取操作,从数据源端以及数据目的端读取新数据;第一写入单元,被配置为响应于当前数据迁移状态属于第一状态,将新数据基于串行化写入方式写入数据目的端;第二写入单元,被配置为在预设时长后关闭串行化写入方式,将新数据写入数据目的端;数据迁移单元,被配置为将数据源端的存量数据迁移至数据目的端。As shown in FIG. 7 , the data migration device of this embodiment includes: a switching unit 701 , a double-ended reading unit 702 , a first writing unit 703 , a second writing unit 704 , and a data migration unit 705 . Among them, the switching unit is configured to switch the read and write address of new data from the data source end to the data destination end, where the new data refers to the data generated by the data generation end during the data migration process; the double-end reading unit is It is configured to enable a double-ended read operation and read new data from the data source and data destination; the first writing unit is configured to respond to the current data migration state belonging to the first state and write the new data based on serialization. The data destination is written in the input mode; the second writing unit is configured to turn off the serialized writing mode after a preset period of time and write new data to the data destination; the data migration unit is configured to transfer the data from the data source to the data destination. Existing data is migrated to the data destination.
在一些实施例中,双端读取单元,包括:第一读取模块,被配置为优先从数据目的端读取新数据;第二读取模块,被配置为响应于从数据目的端未读取到新数据,从数据源端读取新数据。In some embodiments, the double-ended reading unit includes: a first reading module configured to preferentially read new data from the data destination; a second reading module configured to respond to the unread data from the data destination. Get new data and read new data from the data source.
在一些实施例中,第一写入单元,包括:第一判断模块,被配置为响应于确定存在第一锁,判断第一锁是否有效,其中,第一锁用于锁定数据写入权限;第一写入模块,被配置为响应于确定第一锁有效,基于第一锁将新数据基于串行化写入方式写入数据目的端。In some embodiments, the first writing unit includes: a first determination module configured to determine whether the first lock is valid in response to determining that the first lock exists, wherein the first lock is used to lock the data writing permission; The first writing module is configured to write new data to the data destination in a serialized writing manner based on the first lock in response to determining that the first lock is valid.
在一些实施例中,数据迁移装置还包括:第三写入单元,被配置为响应于当前数据迁移状态属于第二状态,将新数据基于串行化写入方式写入数据源端。In some embodiments, the data migration device further includes: a third writing unit configured to write new data to the data source based on a serialized writing method in response to the current data migration state belonging to the second state.
在一些实施例中,第三写入单元,包括:第二判断模块,被配置为响应于确定存在第二锁,判断第二锁是否有效,其中,第二锁用于锁定数据写入权限;第二写入模块,被配置为响应于确定第二锁有效,基于第一锁将新数据基于串行化写入方式写入数据源端。In some embodiments, the third writing unit includes: a second determination module configured to determine whether the second lock is valid in response to determining that the second lock exists, wherein the second lock is used to lock the data writing permission; The second writing module is configured to write new data to the data source in a serialized writing manner based on the first lock in response to determining that the second lock is valid.
在一些实施例中,在开启双端读取操作之前,装置还包括:对将新数据的读写地址从数据源端切换至数据目的端的切换操作进行验证;响应于确定验证通过,为切换操作分配后端存储集群,其中,后端存储集群包括数据源端或者数据目的端。In some embodiments, before starting the double-ended read operation, the device further includes: verifying the switching operation of switching the read and write address of the new data from the data source to the data destination; in response to determining that the verification is passed, performing the switching operation Allocate a back-end storage cluster, where the back-end storage cluster includes the data source or data destination.
在一些实施例中,数据迁移装置还包括:关闭单元,被配置为关闭双端读取操作,从数据目的端读取新数据。 In some embodiments, the data migration device further includes: a shutdown unit configured to close the double-ended read operation and read new data from the data destination.
上述装置700中的各单元与参考图2、图3描述的方法中的步骤相对应。由此上文针对数据迁移方法描述的操作、特征及所能达到的技术效果同样适用于装置700及其中包含的单元,在此不再赘述。Each unit in the above-mentioned device 700 corresponds to the steps in the method described with reference to FIG. 2 and FIG. 3 . Therefore, the operations, features and achievable technical effects described above for the data migration method are also applicable to the device 700 and the units included therein, and will not be described again here.
根据本公开的实施例,本公开还提供了一种电子设备和一种可读存储介质。According to embodiments of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
如图8所示,是根据本公开实施例的数据迁移方法的电子设备800的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。As shown in FIG. 8 , it is a block diagram of an electronic device 800 according to a data migration method according to an embodiment of the present disclosure. Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
如图8所示,该电子设备包括:一个或多个处理器801、存储器802,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图8中以一个处理器801为例。As shown in Figure 8, the electronic device includes: one or more processors 801, memory 802, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be mounted on a common motherboard or otherwise mounted as desired. The processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired. Likewise, multiple electronic devices can be connected, each device providing part of the necessary operation (eg, as a server array, a set of blade servers, or a multi-processor system). Figure 8 takes a processor 801 as an example.
存储器802即为本公开所提供的非瞬时计算机可读存储介质。其中,该存储器存储有可由至少一个处理器执行的指令,以使该至少一个处理器执行本公开所提供的数据迁移方法。本公开的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本公开所提供的数据迁移方法。The memory 802 is the non-transitory computer-readable storage medium provided by the present disclosure. The memory stores instructions executable by at least one processor, so that the at least one processor executes the data migration method provided by the present disclosure. The non-transitory computer-readable storage medium of the present disclosure stores computer instructions, which are used to cause the computer to execute the data migration method provided by the present disclosure.
存储器802作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本公开实施例中的数据迁移方法对应的程序指令/模块(例如,附图7所示的切换单元701、双端 读取单元702、第一写入单元703、第二写入单元704、数据迁移单元705)。处理器801通过运行存储在存储器802中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的数据迁移方法。As a non-transitory computer-readable storage medium, the memory 802 can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions/modules corresponding to the data migration method in the embodiments of the present disclosure (for example, attached Switching unit 701 shown in Figure 7, double-ended Reading unit 702, first writing unit 703, second writing unit 704, data migration unit 705). The processor 801 executes various functional applications and data processing of the server by running non-transient software programs, instructions and modules stored in the memory 802, that is, implementing the data migration method in the above method embodiment.
存储器802可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据用于提取视频片段的电子设备的使用所创建的数据等。此外,存储器802可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器802可选包括相对于处理器801远程设置的存储器,这些远程存储器可以通过网络连接至用于提取视频片段的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 802 may include a storage program area and a storage data area, wherein the storage program area may store an operating system and an application program required for at least one function; the storage data area may store data created according to the use of an electronic device for extracting video clips. Data etc. In addition, memory 802 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 802 optionally includes memory located remotely from processor 801, and these remote memories may be connected via a network to electronic devices used to extract video clips. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
数据迁移方法的电子设备还可以包括:输入装置803、输出装置804以及总线805。处理器801、存储器802、输入装置803和输出装置804可以通过总线805或者其他方式连接,图8中以通过总线805连接为例。The electronic equipment of the data migration method may also include: an input device 803, an output device 804, and a bus 805. The processor 801, the memory 802, the input device 803 and the output device 804 can be connected through a bus 805 or other means. In Figure 8, the connection through the bus 805 is taken as an example.
输入装置803可接收输入的数字或字符信息,以及产生与用于提取视频片段的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置804可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。The input device 803 may receive input numeric or character information and generate key signal input related to user settings and functional control of the electronic device used to extract the video clip, such as a touch screen, keypad, mouse, trackpad, touch pad, pointer An input device such as a stick, one or more mouse buttons, a trackball, or a joystick. Output devices 804 may include display devices, auxiliary lighting devices (eg, LEDs), tactile feedback devices (eg, vibration motors), and the like. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。 Various implementations of the systems and techniques described herein may be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor The processor, which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。These computing programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine language Calculation program. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or means for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLD)), including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的 结果,本文在此不进行限制。It should be understood that various forms of the process shown above may be used, with steps reordered, added or deleted. For example, each step described in the present disclosure may be executed in parallel, sequentially, or in a different order, as long as the desired technical solutions disclosed in the present disclosure can be achieved. As a result, this article is not limited here.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。 The above-mentioned specific embodiments do not constitute a limitation on the scope of the present disclosure. It will be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions are possible depending on design requirements and other factors. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this disclosure shall be included in the protection scope of this disclosure.

Claims (17)

  1. 一种数据迁移方法,包括:A data migration method including:
    将新数据的读写地址从数据源端切换至数据目的端,其中,所述新数据是指数据生成端在数据迁移过程中生成的数据;Switch the read and write addresses of new data from the data source end to the data destination end, where the new data refers to the data generated by the data generation end during the data migration process;
    开启双端读取操作,从所述数据源端以及所述数据目的端读取所述新数据;Start a double-ended read operation to read the new data from the data source and the data destination;
    响应于当前数据迁移状态属于第一状态,将所述新数据基于串行化写入方式写入所述数据目的端;In response to the current data migration state belonging to the first state, writing the new data to the data destination based on the serialized writing method;
    在预设时长后关闭串行化写入方式,将所述新数据写入所述数据目的端;Turn off the serialized writing mode after a preset period of time, and write the new data to the data destination;
    将所述数据源端的存量数据迁移至所述数据目的端。Migrate existing data from the data source to the data destination.
  2. 根据权利要求1所述的方法,其中,所述从所述数据源端以及所述数据目的端读取所述新数据,包括:The method according to claim 1, wherein reading the new data from the data source end and the data destination end includes:
    优先从所述数据目的端读取所述新数据;Prioritize reading the new data from the data destination;
    响应于从所述数据目的端未读取到所述新数据,从所述数据源端读取所述新数据。In response to the new data not being read from the data destination, the new data is read from the data source.
  3. 根据权利要求1或2所述的方法,其中,所述响应于当前数据迁移状态属于第一状态,将所述新数据基于串行化写入方式写入所述数据目的端,包括:The method according to claim 1 or 2, wherein in response to the current data migration state belonging to the first state, writing the new data to the data destination based on a serialized writing method includes:
    响应于确定存在第一锁,判断所述第一锁是否有效,其中,所述第一锁用于锁定数据写入权限;In response to determining that the first lock exists, determine whether the first lock is valid, wherein the first lock is used to lock the data write permission;
    响应于确定所述第一锁有效,基于所述第一锁将所述新数据基于串行化写入方式写入所述数据目的端。In response to determining that the first lock is valid, writing the new data to the data destination in a serialized writing manner based on the first lock.
  4. 根据权利要求1-3中任一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1-3, wherein the method further includes:
    响应于当前数据迁移状态属于第二状态,将所述新数据基于串行化写入方式写入所述数据源端。 In response to the current data migration state belonging to the second state, the new data is written to the data source end based on the serialized writing method.
  5. 根据权利要求4所述的方法,其中,所述响应于当前数据迁移状态属于第二状态,将所述新数据基于串行化写入方式写入所述数据源端,包括:The method according to claim 4, wherein in response to the current data migration state belonging to the second state, writing the new data to the data source end based on a serialized writing method includes:
    响应于确定存在第二锁,判断所述第二锁是否有效,其中,所述第二锁用于锁定数据写入权限;In response to determining that the second lock exists, determine whether the second lock is valid, wherein the second lock is used to lock the data write permission;
    响应于确定所述第二锁有效,基于所述第一锁将所述新数据基于串行化写入方式写入所述数据源端。In response to determining that the second lock is valid, writing the new data to the data source in a serialized writing manner based on the first lock.
  6. 根据权利要求1-5中任一项所述的方法,其中,在开启双端读取操作之前,所述方法还包括:The method according to any one of claims 1-5, wherein before starting the double-ended read operation, the method further includes:
    对将新数据的读写地址从数据源端切换至数据目的端的切换操作进行验证;Verify the switching operation of switching the read and write address of new data from the data source to the data destination;
    响应于确定验证通过,为所述切换操作分配后端存储集群,其中,所述后端存储集群包括数据源端或者数据目的端。In response to determining that the verification is passed, a backend storage cluster is allocated for the switching operation, where the backend storage cluster includes a data source end or a data destination end.
  7. 根据权利要求1-5中任一项所述的方法,其中,在将所述数据源端的存量数据迁移至所述数据目的端之后,所述方法还包括:The method according to any one of claims 1 to 5, wherein, after migrating the existing data at the data source end to the data destination end, the method further includes:
    关闭双端读取操作,从所述数据目的端读取所述新数据。Close the double-ended read operation and read the new data from the data destination.
  8. 一种数据迁移装置,包括:A data migration device including:
    切换单元,被配置为将新数据的读写地址从数据源端切换至数据目的端,其中,所述新数据是指数据生成端在数据迁移过程中生成的数据;A switching unit configured to switch the read-write address of new data from the data source end to the data destination end, where the new data refers to data generated by the data generation end during the data migration process;
    双端读取单元,被配置为开启双端读取操作,从所述数据源端以及所述数据目的端读取所述新数据;A double-ended reading unit configured to enable a double-ended reading operation and read the new data from the data source end and the data destination end;
    第一写入单元,被配置为响应于当前数据迁移状态属于第一状态,将所述新数据基于串行化写入方式写入所述数据目的端;The first writing unit is configured to write the new data to the data destination based on the serialized writing method in response to the current data migration state belonging to the first state;
    第二写入单元,被配置为在预设时长后关闭串行化写入方式,将所述新数据写入所述数据目的端;The second writing unit is configured to turn off the serialized writing mode after a preset period of time and write the new data to the data destination;
    数据迁移单元,被配置为将所述数据源端的存量数据迁移至所述数据 目的端。A data migration unit configured to migrate the existing data at the data source to the data destination.
  9. 根据权利要求8所述的装置,其中,所述双端读取单元,包括:The device according to claim 8, wherein the double-ended reading unit includes:
    第一读取模块,被配置为优先从所述数据目的端读取所述新数据;A first reading module configured to preferentially read the new data from the data destination;
    第二读取模块,被配置为响应于从所述数据目的端未读取到所述新数据,从所述数据源端读取所述新数据。The second reading module is configured to read the new data from the data source in response to the new data not being read from the data destination.
  10. 根据权利要求8或9所述的装置,其中,所述第一写入单元,包括:The device according to claim 8 or 9, wherein the first writing unit includes:
    第一判断模块,被配置为响应于确定存在第一锁,判断所述第一锁是否有效,其中,所述第一锁用于锁定数据写入权限;A first determination module configured to determine whether the first lock is valid in response to determining that a first lock exists, wherein the first lock is used to lock data writing permission;
    第一写入模块,被配置为响应于确定所述第一锁有效,基于所述第一锁将所述新数据基于串行化写入方式写入所述数据目的端。The first writing module is configured to write the new data to the data destination in a serialized writing manner based on the first lock in response to determining that the first lock is valid.
  11. 根据权利要求8-10中任一项所述的装置,其中,所述装置还包括:The device according to any one of claims 8-10, wherein the device further includes:
    第三写入单元,被配置为响应于当前数据迁移状态属于第二状态,将所述新数据基于串行化写入方式写入所述数据源端。The third writing unit is configured to write the new data to the data source end based on the serialized writing method in response to the current data migration state belonging to the second state.
  12. 根据权利要求11所述的装置,其中,所述第三写入单元,包括:The device according to claim 11, wherein the third writing unit includes:
    第二判断模块,被配置为响应于确定存在第二锁,判断所述第二锁是否有效,其中,所述第二锁用于锁定数据写入权限;A second determination module configured to determine whether the second lock is valid in response to determining that the second lock exists, wherein the second lock is used to lock the data write permission;
    第二写入模块,被配置为响应于确定所述第二锁有效,基于所述第一锁将所述新数据基于串行化写入方式写入所述数据源端。The second writing module is configured to write the new data to the data source end in a serialized writing manner based on the first lock in response to determining that the second lock is valid.
  13. 根据权利要求8-12中任一项所述的装置,其中,在开启双端读取操作之前,所述装置还包括:The device according to any one of claims 8-12, wherein before starting the double-ended read operation, the device further includes:
    对将新数据的读写地址从数据源端切换至数据目的端的切换操作进行验证;Verify the switching operation of switching the read and write address of new data from the data source to the data destination;
    响应于确定验证通过,为所述切换操作分配后端存储集群,其中,所述后端存储集群包括数据源端或者数据目的端。 In response to determining that the verification is passed, a backend storage cluster is allocated for the switching operation, where the backend storage cluster includes a data source end or a data destination end.
  14. 根据权利要求8-12中任一项所述的装置,其中,所述装置还包括:The device according to any one of claims 8-12, wherein the device further includes:
    关闭单元,被配置为关闭双端读取操作,从所述数据目的端读取所述新数据。The closing unit is configured to close the double-ended read operation and read the new data from the data destination end.
  15. 一种电子设备,包括:An electronic device including:
    至少一个处理器;以及at least one processor; and
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-7中任一项所述的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of claims 1-7 Methods.
  16. 一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行权利要求1-7中任一项所述的方法。A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
  17. 一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现权利要求1-7中任一项所述的方法。 A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-7.
PCT/CN2023/074115 2022-07-29 2023-02-01 Data migration method and device WO2024021554A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210911723.1 2022-07-29
CN202210911723.1A CN115639953A (en) 2022-07-29 2022-07-29 Data migration method and device

Publications (1)

Publication Number Publication Date
WO2024021554A1 true WO2024021554A1 (en) 2024-02-01

Family

ID=84940831

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/074115 WO2024021554A1 (en) 2022-07-29 2023-02-01 Data migration method and device

Country Status (2)

Country Link
CN (1) CN115639953A (en)
WO (1) WO2024021554A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115639953A (en) * 2022-07-29 2023-01-24 京东科技信息技术有限公司 Data migration method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060107010A1 (en) * 2004-11-18 2006-05-18 Hitachi, Ltd. Storage system and data migration method of storage system
CN105718570A (en) * 2016-01-20 2016-06-29 北京京东尚科信息技术有限公司 Data migration method and device used for database
US20180121129A1 (en) * 2016-10-31 2018-05-03 Oracle International Corporation Data layout schemas for seamless data migration
US20200409914A1 (en) * 2019-06-28 2020-12-31 Paypal, Inc. Data store transition using a data migration server
CN114327745A (en) * 2021-11-25 2022-04-12 北京志凌海纳科技有限公司 Method and system for cross-host virtual machine storage live migration
CN115639953A (en) * 2022-07-29 2023-01-24 京东科技信息技术有限公司 Data migration method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060107010A1 (en) * 2004-11-18 2006-05-18 Hitachi, Ltd. Storage system and data migration method of storage system
CN105718570A (en) * 2016-01-20 2016-06-29 北京京东尚科信息技术有限公司 Data migration method and device used for database
US20180121129A1 (en) * 2016-10-31 2018-05-03 Oracle International Corporation Data layout schemas for seamless data migration
US20200409914A1 (en) * 2019-06-28 2020-12-31 Paypal, Inc. Data store transition using a data migration server
CN114327745A (en) * 2021-11-25 2022-04-12 北京志凌海纳科技有限公司 Method and system for cross-host virtual machine storage live migration
CN115639953A (en) * 2022-07-29 2023-01-24 京东科技信息技术有限公司 Data migration method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
游士 (YOU, SHI): "https://bp.aliyun.com/detail/179", 跨云迁移单写双读过渡架构_技术解决方案_最佳实践-阿里云 (NON-OFFICIAL TRANSLATION: CROSS-CLOUD MIGRATION SINGLE-WRITE-DUAL-READ TRANSITION ARCHITECTURE_TECHNICAL SOLUTIONS_BEST PRACTICES-ALIBABA CLOUD), 9 December 2020 (2020-12-09) *

Also Published As

Publication number Publication date
CN115639953A (en) 2023-01-24

Similar Documents

Publication Publication Date Title
US10073747B2 (en) Reducing recovery time in disaster recovery/replication setup with multitier backend storage
US9734026B2 (en) In-memory data store replication through remote memory sharing
US9930130B2 (en) Processing hybrid data using a single web client
US11356541B2 (en) Managing network sockets
US10754686B2 (en) Method and electronic device for application migration
US9342388B1 (en) Dynamic queue alias
US20150244827A1 (en) Data Transmission
US10855776B2 (en) Method and device for managing sessions
WO2023093016A1 (en) Cloud code development system, method, and apparatus, device, and storage medium
US20210334118A1 (en) Opening local files in remote applications
CN110633046A (en) Storage method and device of distributed system, storage equipment and storage medium
WO2024021554A1 (en) Data migration method and device
US20110153746A1 (en) Synchronizing shared files during communication sessions
US11151062B2 (en) Optimized locking for replication solutions
US10296216B2 (en) Prioritizing dedicated host ports when N-port ID virtualization is enabled in a storage controller
US10642785B2 (en) Optimized network file system client for read-only exports/mounts
US11194771B2 (en) Methods for transferring reserves when moving virtual machines across systems
US11782881B2 (en) Recommending remotely executed applications for opening files
US20240028335A1 (en) Application state synchronization across computing environments to an alternate application
CN111835857B (en) Method and apparatus for accessing data
US20200257642A1 (en) Seamless i/o in fibre channel point to point topology while a storage port is changed
US20210067465A1 (en) Identifying target port based on resource availability
WO2024019835A1 (en) Application state synchronization across computing environments to an alternate application
WO2024019834A1 (en) Application state synchronization across computing environments
CN113391949A (en) Method, electronic device and computer program product for storage management

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23844773

Country of ref document: EP

Kind code of ref document: A1