







技术领域technical field
本申请实施例涉及数据迁移技术领域,尤其涉及数据迁移的方法、系统及相关装置。The embodiments of the present application relate to the technical field of data migration, and in particular, to methods, systems and related devices for data migration.
背景技术Background technique
当原有的存储介质容量紧张、新老存储软件替换、硬件生命周期到期时,需要进行数据迁移。目前,随着云计算的兴起,应用上云或者云厂商的替代,用户的选择的存储方式也在变化,这样也需要进行数据迁移。When the capacity of the original storage medium is insufficient, new and old storage software is replaced, and the hardware life cycle expires, data migration is required. At present, with the rise of cloud computing, applications are migrated to the cloud or replaced by cloud vendors, and the storage methods selected by users are also changing, which also requires data migration.
如何在实现在线迁移的情况下,提高数据迁移的效率是本领域亟待解决的问题。How to improve the efficiency of data migration in the case of realizing online migration is an urgent problem to be solved in this field.
发明内容Contents of the invention
本申请提供了一种数据迁移的方法、系统及相关装置,不仅可以实现数据的在线迁移,还可以提高数据迁移的效率,用户体验感良好。The present application provides a method, system and related device for data migration, which can not only realize online migration of data, but also improve the efficiency of data migration, and provide a good user experience.
第一方面,本申请提供了一种数据迁移方法,该方法应用于计算设备,其特征在于,包括:In a first aspect, the present application provides a data migration method, which is applied to a computing device, and is characterized in that it includes:
接收到针对于第一数据的读请求或者写请求;receiving a read request or a write request for the first data;
根据该读请求对该第一数据进行处理,并将该第一数据从源数据存储区域中迁移至目标存储区域中存储;processing the first data according to the read request, and migrating the first data from the source data storage area to the target storage area for storage;
或者,根据该写请求对该第一数据进行处理,并将该第一数据从源数据存储区域中迁移至目标存储区域中存储;Or, process the first data according to the write request, and migrate the first data from the source data storage area to the target storage area for storage;
其中,该第一数据存储在源数据存储区域中,该源数据存储区域与目标存储区域位于同一台计算设备中或者不同的计算设备中。Wherein, the first data is stored in the source data storage area, and the source data storage area and the target storage area are located in the same computing device or in different computing devices.
在一种可能的实现方式中,本申请实施例可以是由针对于第一数据的读请求或写请求来触发第一数据的迁移操作。In a possible implementation manner, in this embodiment of the present application, the migration operation of the first data may be triggered by a read request or a write request for the first data.
在一种可能的实现方式中,当源数据存储区域与目标存储区域位于不同的计算设备中时,不同的计算设备之间可以进行第一数据的发送与接收操作。In a possible implementation manner, when the source data storage area and the target storage area are located in different computing devices, the first data can be sent and received between different computing devices.
由上述方法可知,可以确保当系统接收到用户对第一数据的读请求或写请求时,只需要系统在源数据存储区域中对第一数据进行一次读取即可以保证实现用户的读请求或写请求以及迁移任务。As can be seen from the above method, it can be ensured that when the system receives a user's read request or write request for the first data, the system only needs to read the first data once in the source data storage area to ensure that the user's read request or write request can be realized. Write requests and migration tasks.
这样,相对于系统先接收迁移指令,再接收读请求或写请求的方法,可以在实现在线迁移的基础上提高迁移效率。In this way, compared with the method in which the system first receives the migration instruction and then receives the read request or write request, the migration efficiency can be improved on the basis of realizing online migration.
结合第一方面,在一些实施方式中,在接收到针对于第一数据的读请求或者写请求之后,该方法还包括:With reference to the first aspect, in some implementation manners, after receiving a read request or a write request for the first data, the method further includes:
在确定该第一数据需要迁移且该第一数据还未进行迁移的情况下,根据该读请求或者写请求对该第一数据进行处理。If it is determined that the first data needs to be migrated and the first data has not been migrated, the first data is processed according to the read request or write request.
在一种可能的实现方式中,当该第一数据不需要迁移或者该第一数据已经被迁移的情况下,可以直接对第一数据进行读请求或者写请求的相关处理,不对该第一数据进行从源数据存储区域中迁移至目标存储区域存储的操作。In a possible implementation, when the first data does not need to be migrated or the first data has already been migrated, the read request or write request can be directly processed on the first data, and the first data is not Perform the operation of migrating from the source data storage area to the target storage area.
这样,可以全方位覆盖各种场景下的第一数据,考虑其多种情况,避免出现多次迁移的情况。In this way, the first data in various scenarios can be covered in an all-round way, multiple situations can be considered, and multiple migrations can be avoided.
结合第一方面,在一些实施方式中,该第一数据在该源数据存储区域中的存储地址为第一地址,With reference to the first aspect, in some implementations, the storage address of the first data in the source data storage area is the first address,
该根据该读请求对所述第一数据进行处理,并将该第一数据从源数据存储区域中迁移至目标存储区域中存储,具体包括:The processing of the first data according to the read request, and migrating the first data from the source data storage area to the target storage area for storage specifically includes:
可以根据该读请求从该第一地址中读取该第一数据并存储在该目标存储区域中的第二地址中。The first data can be read from the first address according to the read request and stored in the second address in the target storage area.
在一种可能的实现方式中,该第一数据的存储方式可以为块存储、对象存储等存储方式,对此不作限定。In a possible implementation manner, the storage manner of the first data may be a storage manner such as block storage, object storage, etc., which is not limited thereto.
在一种可能的实施方式中,若读请求所对应的第一数据的大小小于数据块或单个对象的大小,需要对数据块或单个对象按照实际读取的数据大小进行切割处理,使得切割处理之后的部分数据恰好为第一数据。In a possible implementation, if the size of the first data corresponding to the read request is smaller than the size of the data block or a single object, it is necessary to split the data block or single object according to the actual read data size, so that the split processing The subsequent part of data is exactly the first data.
在一种可能的实施方式中,当第一数据完成源数据存储区域中迁移至目标存储区域中存储之后,可以返回至用户。In a possible implementation manner, after the first data is migrated from the source data storage area to the target storage area for storage, it may be returned to the user.
这样可以实现针对于第一数据的读请求,还可以提高迁移第一数据的效率。In this way, the read request for the first data can be implemented, and the efficiency of migrating the first data can also be improved.
结合第一方面,在一些实施方式中,该第一数据在该源数据存储区域中的存储地址为第一地址,该第一数据的存储方式为块存储,With reference to the first aspect, in some implementations, the storage address of the first data in the source data storage area is the first address, and the storage method of the first data is block storage,
该根据该写请求对该第一数据进行处理,并将该第一数据从源数据存储区域中迁移至目标存储区域中,具体包括:Processing the first data according to the write request, and migrating the first data from the source data storage area to the target storage area specifically includes:
判断该第一数据与数据块的大小是否对齐;judging whether the size of the first data is aligned with the data block;
在该确定该第一数据与数据块的大小对齐的情况下,根据该写请求从该第一地址读取该第一数据并存储在该目标存储区域中的第二地址中;对存储在该第一地址和该第二地址中的所述第一数据进行写处理;In the case of determining that the first data is aligned with the size of the data block, read the first data from the first address according to the write request and store it in a second address in the target storage area; performing write processing on the first data in the first address and the second address;
其中,该数据块为块存储中单次进行迁移的数据;该对齐是指该第一数据的大小是数据块的大小的整数倍。Wherein, the data block is data that is migrated once in the block storage; the alignment means that the size of the first data is an integer multiple of the size of the data block.
在一种可能的实现方式中,响应写请求的前提条件为需要满足写写互斥,即两个写请求针对的数据不可以有交集。In a possible implementation manner, a precondition for responding to a write request is to satisfy write-write mutual exclusion, that is, data targeted by two write requests cannot overlap.
在一种可能的实现方式中,在完成对该第一地址和该第二地址中的所述第一数据进行写处理之后,可以将响应写请求完成的信息通知用户。In a possible implementation manner, after the writing process of the first data in the first address and the second address is completed, the user may be notified of information that the response to the writing request is completed.
这样可以避免出现写写互斥的情况。This avoids write-write mutual exclusion.
结合第一方面,在一些实施方式中,在该计算设备确定该第一数据该数据块的大小没有对齐的情况下,该计算设备持续获取所述数据块的互斥锁;With reference to the first aspect, in some implementations, when the computing device determines that the size of the data block of the first data is not aligned, the computing device continues to acquire the mutex of the data block;
根据该写请求对存储在该第一地址的该第一数据进行写处理,得到第二数据,并将该第二数据存储至该第一地址;performing write processing on the first data stored at the first address according to the write request to obtain second data, and storing the second data in the first address;
从该第一位置读取该第二数据并存储在该目标存储区域中的第二地址中。The second data is read from the first location and stored at a second address in the target storage area.
这样可以解决第一数据的大小与单次迁移的数据大小不对齐的问题,以此实现针对于第一数据的写处理。In this way, the problem that the size of the first data is not aligned with the size of the data in a single migration can be solved, so as to realize the writing process for the first data.
结合第一方面,在一些实施方式中,该第一数据的存储方式为对象存储,该第一数据在该源数据存储区域中的存储地址为第一地址,With reference to the first aspect, in some implementations, the storage method of the first data is object storage, and the storage address of the first data in the source data storage area is the first address,
该根据该写请求对该第一数据进行处理,并将该第一数据从源数据存储区域中迁移至目标存储区域中,具体包括:Processing the first data according to the write request, and migrating the first data from the source data storage area to the target storage area specifically includes:
根据该写请求,从该第一地址中读取该第一数据并存储在该目标存储区域中的第二地址中,对存储在所述第一地址和所述第二地址中的所述第一数据进行写处理。According to the write request, the first data is read from the first address and stored in a second address in the target storage area, and the first data stored in the first address and the second address are stored in the second address A data write process is performed.
在一种可能的实现方式中,对象存储的写处理操作只能作用于整个对象,因此,无需进行第一数据与单个对象的对齐判断。In a possible implementation manner, the write processing operation of the object storage can only act on the entire object, therefore, there is no need to judge the alignment between the first data and a single object.
这样可以实现针对于对象存储类型的第一数据的写请求,还可以提高迁移第一数据的效率。In this way, the write request for the first data of the object storage type can be implemented, and the efficiency of migrating the first data can also be improved.
结合第一方面,在一些实施方式中,在该第一数据完成迁移之后,更新迁移元数据记录表,该迁移元数据记录表记录所述第一数据的迁移状态,该迁移状态包括所述第一数据需要迁移但未被迁移、已经迁移、不需要迁移中的任意一种。With reference to the first aspect, in some implementations, after the migration of the first data is completed, the migration metadata record table is updated, and the migration metadata record table records the migration status of the first data, and the migration status includes the migration status of the first data. Any one of data that needs to be migrated but has not been migrated, has been migrated, and does not need to be migrated.
在一种可能的实现方式中,第一数据从源数据存储区域迁移至目标存储区域之后,在迁移元数据记录表的状态可以由“N”转换为“Y”。In a possible implementation manner, after the first data is migrated from the source data storage area to the target storage area, the status of the migration metadata record table may be changed from "N" to "Y".
在一种可能的实现方式中,当计算设备未接收到第一数据的读请求以及写请求时,可以启动后台迁移任务,确定出待迁移的数据,系统在后台开始按顺序对待迁移的数据块或者单个对象进行迁移。In a possible implementation, when the computing device does not receive the first data read request and write request, it can start the background migration task to determine the data to be migrated, and the system starts to process the migrated data blocks in order in the background Or individual objects for migration.
第二方面,本申请实施例提供了一种电子设备,该电子设备包括:一个或多个处理器和存储器;该存储器与该一个或多个处理器耦合,该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令,该一个或多个处理器调用该计算机指令以使得该电子设备执行如第一方面描述的方法。In a second aspect, an embodiment of the present application provides an electronic device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program codes, The computer program code includes computer instructions, and the one or more processors call the computer instructions to make the electronic device execute the method as described in the first aspect.
第三方面,本申请实施例提供一种计算机可读存储介质,包括计算机指令,当上述计算机指令在电子设备上运行时,使得上述电子设备执行如第一方面的方法。In a third aspect, an embodiment of the present application provides a computer-readable storage medium, including computer instructions, which, when the computer instructions are run on an electronic device, cause the above-mentioned electronic device to execute the method according to the first aspect.
可以理解地,上述第二方面提供的电子设备和第三方面提供的计算机可读存储介质均用于执行本申请实施例所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。It can be understood that both the electronic device provided in the second aspect and the computer-readable storage medium provided in the third aspect are used to implement the method provided in the embodiment of the present application. Therefore, the beneficial effects that it can achieve can refer to the beneficial effects in the corresponding method, and will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的一种数据迁移系统的框架示意图。FIG. 1 is a schematic diagram of a data migration system provided by an embodiment of the present application.
图2为本申请实施例提供的一种服务器100的结构示意框图。FIG. 2 is a schematic structural block diagram of a server 100 provided by an embodiment of the present application.
图3为本申请实施例提供的一种响应读请求的数据迁移方法的流程示意图。FIG. 3 is a schematic flowchart of a data migration method in response to a read request provided by an embodiment of the present application.
图4为本申请实施例提供的另一种响应读请求的数据迁移方法的流程示意图。FIG. 4 is a schematic flowchart of another data migration method in response to a read request provided by an embodiment of the present application.
图5为本申请实施例提供的一种响应写请求的数据迁移方法的流程示意图。FIG. 5 is a schematic flowchart of a data migration method in response to a write request provided by an embodiment of the present application.
图6为本申请实施例提供的另一种响应写请求的数据迁移方法的流程示意图。FIG. 6 is a schematic flowchart of another data migration method in response to a write request provided by an embodiment of the present application.
图7为本申请实施例提供的一种后台数据迁移方法的流程示意图。FIG. 7 is a schematic flowchart of a background data migration method provided by an embodiment of the present application.
图8为本申请实施例提供的另一种后台数据迁移方法的流程示意图。FIG. 8 is a schematic flowchart of another background data migration method provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. Among them, in the description of the embodiments of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in the text is only a description of associated objects The association relationship indicates that there may be three kinds of relationships, for example, A and/or B, which may indicate: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiment of the present application , "plurality" means two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as implying or implying relative importance or implicitly specifying the quantity of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, the "multiple" The meaning is two or more.
本申请以下实施例中的术语“用户界面(user interface,UI)”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面是通过java、可扩展标记语言(extensible markuplanguage,XML)等特定计算机语言编写的源代码,界面源代码在电子设备上经过解析,渲染,最终呈现为用户可以识别的内容。用户界面常用的表现形式是图形用户界面(graphicuser interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的文本、图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。The term "user interface (UI)" in the following embodiments of this application is a medium interface for interaction and information exchange between an application program or an operating system and a user, and it realizes the difference between the internal form of information and the form acceptable to the user. conversion between. The user interface is the source code written in specific computer languages such as java and extensible markup language (XML). The source code of the interface is parsed and rendered on the electronic device, and finally presented as content that can be recognized by the user. A commonly used representation form of a user interface is a graphical user interface (GUI), which refers to a user interface related to computer operations displayed in a graphical manner. It may be text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, and other visible interface elements displayed on the display screen of the electronic device.
数据迁移(datamigration)可以是指选择、准备、提取和转换数据,并将数据从一个计算机存储系统永久地传输到另一个计算机存储系统的过程。进行数据迁移有多种原因,其中可以包括但不限于服务器或存储设备更换、维护或升级、应用程序迁移、网站集成、灾难恢复以及数据中心迁移。在一些实现方式中,数据迁移可以理解成对存储在一个计算机存储系统数据进行复制,拷贝在另一个计算机存储系统内。Data migration can refer to the process of selecting, preparing, extracting, and transforming data, and permanently transferring data from one computer storage system to another. Data migration occurs for a variety of reasons, which may include, but are not limited to, server or storage replacement, maintenance or upgrades, application migration, website integration, disaster recovery, and data center relocation. In some implementations, data migration can be understood as duplicating data stored in one computer storage system and copying it in another computer storage system.
目前来说,有些数据迁移的方法不支持在线迁移。例如,若用户需要对正在迁移的数据进行访问,需要等待数据迁移完毕之后才能访问上述数据。也就是说,数据在迁移的过程中电子设备无法响应针对于该数据的读写请求。Currently, some data migration methods do not support online migration. For example, if the user needs to access the data that is being migrated, the user needs to wait until the data migration is completed before accessing the above data. That is to say, the electronic device cannot respond to read and write requests for the data during the process of data migration.
还有些数据迁移的方法的效率较低。例如,当系统采用打快照的方式对数据进行迁移时,需要从源数据存储区域中导出数据,再将导出的数据导入至迁移之后的目标存储区域中。若在对数据进行迁移的过程中,用户操作触发了写请求导致出现新增数据,而新增数据也需要进行迁移,那么需要重复从源数据存储区域中导出新增数据,再将导出的新增数据导入至迁移之后的目标存储区域中。There are also methods of data migration that are less efficient. For example, when the system migrates data by taking a snapshot, it is necessary to export data from the source data storage area, and then import the exported data into the target storage area after migration. If during the process of data migration, a user operation triggers a write request, resulting in new data, and the new data also needs to be migrated, then it is necessary to repeatedly export the new data from the source data storage area, and then export the new data The incremental data is imported to the target storage area after migration.
为了改善上述数据迁移的方法所产生的问题,本申请实施例提供了一种数据迁移的方法。在该方法中,数据迁移分为前台迁移和后台迁移两种形式。In order to improve the problems caused by the above data migration method, an embodiment of the present application provides a data migration method. In this method, data migration is divided into two forms: foreground migration and background migration.
其中,前台迁移的方法具体是指:首先确定出待迁移的数据集,其中,待迁移的数据集可以是由管理人员确定的。当系统接收到用户对第一数据的读请求或写请求时,系统开始对第一数据进行迁移。其中,第一数据属于待迁移的数据集。Wherein, the method of foreground migration specifically refers to: firstly determine the data set to be migrated, wherein the data set to be migrated may be determined by a manager. When the system receives a user's read request or write request for the first data, the system starts to migrate the first data. Wherein, the first data belongs to the data set to be migrated.
当系统接收到用户对第一数据的操作请求是读请求时,系统将第一数据从源数据存储区域读取出来,迁移至目标存储区域,然后再将该目标存储区域中的第一数据返回给用户。When the system receives the user's operation request for the first data is a read request, the system reads the first data from the source data storage area, migrates it to the target storage area, and then returns the first data in the target storage area to the user.
当系统接收到用户对第一数据的操作请求是写请求时,系统将第一数据从源数据存储区域读取出来,迁移至目标存储区域,然后对源数据存储区域的第一数据与目标存储区域中的第一数据进行双写处理,再将该目标存储区域中的第一数据返回给用户;或者系统先对第一数据读取出来,进行写处理,将写处理之后的第一数据存储至源数据存储区域,再将写处理之后的第一数据迁移至源数据存储区域。When the system receives that the user's operation request for the first data is a write request, the system reads the first data from the source data storage area, migrates it to the target storage area, and then compares the first data in the source data storage area with the target storage area. The first data in the area is double-written, and then the first data in the target storage area is returned to the user; or the system first reads the first data, performs write processing, and stores the first data after the write processing to the source data storage area, and then migrate the written first data to the source data storage area.
后台迁移的方法具体是指:首先确定出待迁移的数据,系统在后台开始按顺序对待迁移的数据块或者单个对象进行迁移。The background migration method specifically refers to: first determine the data to be migrated, and the system starts to migrate the data blocks or single objects to be migrated in sequence in the background.
在一些实现方式中,前台迁移的优先级高于后台迁移。也就是说,当系统接收到用户对第一数据的读请求或写请求时,系统可以优先选择前台迁移的方法进行迁移。当系统未接收到任何读请求或写请求时,系统仅可以选择后台迁移的方法来对需要迁移指令所针对的数据进行迁移。In some implementations, foreground migrations take precedence over background migrations. That is to say, when the system receives a user's read request or write request for the first data, the system may preferentially select the method of foreground migration for migration. When the system does not receive any read request or write request, the system can only select the background migration method to migrate the data targeted by the migration instruction.
在一些实现方式中,第一数据存储在源数据存储区域中的存储地址可以被称为第一地址,第一数据存储在目标数据存储区域中的存储地址可以被称为第二地址。In some implementation manners, the storage address where the first data is stored in the source data storage area may be referred to as a first address, and the storage address where the first data is stored in the target data storage area may be referred to as a second address.
在一些实现方式中,第一数据进行写处理之后的数据可以被称为第二数据。In some implementation manners, the data after the writing process of the first data may be referred to as second data.
通过上述方法,可以确保当系统接收到用户对第一数据的读请求或写请求时,只需要系统在源数据存储区域中对第一数据进行一次读取即可以保证实现用户的读请求或写请求以及迁移任务。Through the above method, it can be ensured that when the system receives a user's read request or write request for the first data, the system only needs to read the first data once in the source data storage area to ensure that the user's read request or write request can be realized. requests and migration tasks.
这样,相对于系统先接收迁移指令,再接收读请求或写请求的方法,可以提高迁移效率。这是因为系统在迁移过程中不能保证接收迁移指令的数据与接收读请求或写请求的数据是同一数据,这样会造成当实现用户的读请求或写请求以及迁移任务时,系统可能会在源数据存储区域中对某一个数据进行两次读取的现象。In this way, compared with the method in which the system first receives the migration instruction and then receives the read request or write request, the migration efficiency can be improved. This is because the system cannot guarantee that the data receiving the migration command is the same as the data receiving the read request or write request during the migration process. A phenomenon in which a certain piece of data is read twice in the data storage area.
因此,本申请实施例所提供的数据迁移的方法不仅可以实现数据的在线迁移,还可以提高数据迁移的效率,用户体验感良好。Therefore, the data migration method provided in the embodiment of the present application can not only realize online migration of data, but also improve the efficiency of data migration, and the user experience is good.
为了更加清楚地介绍本申请实施例提供的方法,下面先介绍本申请实施例提供的数据迁移系统框架。In order to more clearly introduce the method provided by the embodiment of the present application, the data migration system framework provided by the embodiment of the present application is first introduced below.
参考图1,图1为本申请实施例提供的数据迁移系统的框架示意图。Referring to FIG. 1 , FIG. 1 is a schematic framework diagram of a data migration system provided by an embodiment of the present application.
数据迁移系统可以包括但不限于源数据存储区域、目标数据存储区域、数据迁移工具以及存储介质等等。该数据迁移系统可以应用于本地数据迁移至云端、云端之间进行数据迁移以及云端数据迁移至本地等应用场景。The data migration system may include, but is not limited to, a source data storage area, a target data storage area, data migration tools, storage media, and the like. The data migration system can be applied to application scenarios such as migration of local data to the cloud, data migration between clouds, and migration of cloud data to the local.
值得说明的是,上述源数据存储区域与目标数据存储区域可以是指服务器中数据块或者单个对象的逻辑存储位置,上述存储介质可以是指服务器中数据块或者单个对象的物理存储位置。It is worth noting that the above-mentioned source data storage area and target data storage area may refer to logical storage locations of data blocks or single objects in the server, and the above-mentioned storage media may refer to physical storage locations of data blocks or single objects in the server.
其中,源数据存储区域可以是指存储有未迁移的数据的数据库,常见的数据库可以包括但不限于关系型数据库管理器(My Structured Query Language,MYSQL)、Oracle数据库、Microsoft SQL Server等等。Wherein, the source data storage area may refer to a database storing unmigrated data, and common databases may include but not limited to relational database managers (My Structured Query Language, MYSQL), Oracle databases, Microsoft SQL Server, and the like.
源数据存储区域存储数据的类型可以包括但不限于块存储、文件存储以及对象存储等等。例如,当源数据存储区域中存储的数据是以块存储的形式存储时,源数据存储区域可以作为卷或者逻辑单元号(Logical Unit Number,lun),此时源数据存储区域中存储的数据可以被划分为大小一致的数据块(例如数据块可以是1MB大小的数据)。The type of data stored in the source data storage area may include, but not limited to, block storage, file storage, object storage, and the like. For example, when the data stored in the source data storage area is stored in the form of block storage, the source data storage area can be used as a volume or a logical unit number (Logical Unit Number, lun). At this time, the data stored in the source data storage area can be It is divided into data blocks of consistent size (for example, a data block can be 1MB of data).
在一些实现方式中,当源数据存储区域中存储的数据进行迁移时,数据可以是以数据块为单位进行迁移。In some implementation manners, when the data stored in the source data storage area is migrated, the data may be migrated in units of data blocks.
又例如,当源数据存储区域中存储的数据是以对象存储的形式存储时,源数据存储区域可以作为桶,此时源数据存储区域中存储的数据为单个对象。也就是说,数据进行迁移可以按数据的单位量进行迁移。For another example, when the data stored in the source data storage area is stored in the form of object storage, the source data storage area can be used as a bucket. At this time, the data stored in the source data storage area is a single object. That is to say, the data migration can be performed according to the unit amount of data.
目标数据存储区域可以是指存储有已迁移的数据的数据库。同样,目标数据存储区域存储数据的类型可以包括但不限于块存储、文件存储以及对象存储等等,存储类型的详细说明可以参考上述内容,在此不做赘述。The target data storage area may refer to a database storing migrated data. Similarly, the type of data stored in the target data storage area may include, but not limited to, block storage, file storage, and object storage, etc. For detailed descriptions of storage types, refer to the above content, and details are not repeated here.
在一些实现方式中,源数据存储区域与目标数据存储区域可以位于同一硬件设备上,也可以位于不同硬件设备上。In some implementation manners, the source data storage area and the target data storage area may be located on the same hardware device, or may be located on different hardware devices.
图1中所示的源数据存储区域中所示的长方形a以及源数据存储区域中所示的长方形b可以表示数据块或者单个对象。也就是说若要完成源数据存储区域中待迁移的数据集的迁移任务,则需要对多个数据块或者单个对象进行迁移。The rectangle a shown in the source data storage area and the rectangle b shown in the source data storage area shown in FIG. 1 may represent a data block or a single object. That is to say, to complete the migration task of the data set to be migrated in the source data storage area, it is necessary to migrate multiple data blocks or a single object.
例如,一次完整的迁移任务中,可以将长方形a数据块或者单个对象迁移至长方形b中,长方形b所表示的数据块或者单个对象为长方形a数据块或者单个对象迁移之后的数据,其数据在内容上是一致的。For example, in a complete migration task, the data block of rectangle a or a single object can be migrated to rectangle b. The data block or single object represented by rectangle b is the data after migration of the data block of rectangle a or a single object. The content is consistent.
数据迁移工具可以实现请求的捕获、数据的分发、存储并更新迁移元数据记录表以及后台迁移任务等等。Data migration tools can capture requests, distribute data, store and update migration metadata record tables, background migration tasks, and more.
具体的,请求的捕获可以用于监测来自用户针对于第一数据的读请求或写请求,以此来开启前台迁移任务。Specifically, the capture of the request may be used to monitor the read request or write request from the user for the first data, so as to start the foreground migration task.
请求的捕获所实现的具体位置可以有所不同。在一些实施方式中,可以在Linux中的Device Mapper层完成请求的捕获。当数据所存储的服务器连接有对应的客户端,也可以在客户端完成请求的捕获。在本申请实施例中对此不作限定。The exact location where the requested capture is implemented can vary. In some implementation manners, the capture of the request can be completed at the Device Mapper layer in Linux. When the server where the data is stored is connected to a corresponding client, the capture of the request can also be completed on the client. This is not limited in this embodiment of the application.
在一些实现方式中,数据迁移工具在完成请求的捕获之后,从源数据存储区域中获取请求所针对的第一数据的逻辑地址,并根据该逻辑地址从存储介质中读取出第一数据。In some implementation manners, after capturing the request, the data migration tool obtains the logical address of the first data targeted by the request from the source data storage area, and reads the first data from the storage medium according to the logical address.
也即是说,源数据存储区域以及目标数据存储区域为第一数据的逻辑存储位置,存储介质为第一数据的物理存储位置。That is to say, the source data storage area and the target data storage area are the logical storage locations of the first data, and the storage medium is the physical storage location of the first data.
存储介质可以是指存储第一数据的载体,例如软盘、光盘、高密度数字视频光盘(Digital Video Disc,DVD)、硬盘、闪存、U盘、紧凑式闪存(Compact Flash,CF)卡、安全数码卡(Secure Digital Memory Card,SD卡)、多媒体卡(Multi-Media Card,MMC卡)、智能媒体(Smart Media,SM)卡、记忆棒(Memory Stick)、极限数字显卡(Extreme Digital-Picture Card,xD卡)等。The storage medium may refer to a carrier for storing the first data, such as a floppy disk, an optical disk, a high-density digital video disk (Digital Video Disc, DVD), a hard disk, a flash memory, a U disk, a compact flash memory (Compact Flash, CF) card, a secure digital Card (Secure Digital Memory Card, SD card), Multi-Media Card (Multi-Media Card, MMC card), Smart Media (Smart Media, SM) card, Memory Stick (Memory Stick), Extreme Digital-Picture Card (Extreme Digital-Picture Card, xD card) etc.
数据的分发可以用于在数据迁移工具读取到第一数据之后对第一数据进行迁移处理。在一些实现方式中,数据迁移工具可以判断第一数据是否需要进行迁移,即第一数据是否属于待迁移数据集。若第一数据属于待迁移数据集,数据迁移工具可以将第一数据迁移至目标存储区域。The distribution of data may be used to migrate the first data after the data migration tool reads the first data. In some implementation manners, the data migration tool can determine whether the first data needs to be migrated, that is, whether the first data belongs to the data set to be migrated. If the first data belongs to the data set to be migrated, the data migration tool can migrate the first data to the target storage area.
迁移元数据记录表用于记录数据的迁移状态(例如未迁移、已迁移以及初始态)。在一些实现方式中,数据迁移工具可以存储并更新迁移元数据记录表。具体的,可以参考表1、表2所示的迁移元数据记录表。The migration metadata record table is used to record the migration state of data (such as non-migrated, migrated and initial state). In some implementations, the data migration tool can store and update the migration metadata record table. Specifically, reference may be made to the migration metadata record tables shown in Table 1 and Table 2.
表1Table 1
表2Table 2
如表1、表2所示,表1示例性示出了块存储迁移元数据记录表,表2示例性示出了对象存储迁移元数据记录表。As shown in Table 1 and Table 2, Table 1 exemplarily shows a block storage migration metadata record table, and Table 2 exemplarily shows an object storage migration metadata record table.
迁移元数据记录表可以包括索引以及迁移状态,迁移元数据记录表还可以包括以下任意一项或几项:数据未迁移时所存储的服务器的标识、数据已迁移后所存储的服务器的标识、数据未迁移时所存储的逻辑位置以及数据已迁移后所存储的逻辑位置等等,在本申请实施例中,对此不作限定。The migration metadata record table can include indexes and migration status, and the migration metadata record table can also include any one or more of the following items: the identifier of the server where the data is not migrated, the identifier of the server where the data has been migrated, In this embodiment of the present application, no limitation is imposed on the logical location where the data is stored when the data is not migrated and the logical location where the data is stored after migration.
其中,表1、表2中示出的索引可以用来表示对源数据存储区域中数据进行排序的一种结构,使用索引可快速查看源数据存储区域中的特定的数据。Wherein, the indexes shown in Table 1 and Table 2 can be used to represent a structure for sorting data in the source data storage area, and specific data in the source data storage area can be quickly checked by using the index.
例如,索引“Block 1”表示的是以块存储的形式存储的数据中被划分成同样大小(例如1MB)的数据块的索引,索引“Obeject 1”表示的是以对象存储的形式存储的数据中单个对象的索引。For example, the index "Block 1" indicates the index of the data stored in the form of block storage divided into data blocks of the same size (for example, 1MB), and the index "Obeject 1" indicates the data stored in the form of object storage The index of a single object in .
在一些实现方式中,数据的索引与数据的存储类型有关。In some implementations, the indexing of data is related to the storage type of the data.
例如,若某一数据的存储类型为块存储,则该数据的索引为卷ID+逻辑地址;若某一数据的存储类型为文件存储,则该数据的索引为文件系统ID(Filesystem ID)+目录(Directory)+文件名(Filename)+偏移地址(Offset);若某一数据的存储类型为对象存储,则该数据的索引为键(Key)+版本号(Version)。For example, if the storage type of a certain data is block storage, the index of the data is volume ID + logical address; if the storage type of a certain data is file storage, the index of the data is the file system ID (Filesystem ID) + directory (Directory) + file name (Filename) + offset address (Offset); if the storage type of a certain data is object storage, the index of the data is key (Key) + version number (Version).
表1、表2中示出的迁移状态表示的是源数据存储区域中数据是否处于迁移状态。The migration status shown in Table 1 and Table 2 indicates whether the data in the source data storage area is in the migration status.
其中,状态“Y”表示该行中具体索引所指示的数据目前处于需要进行迁移并已经完成迁移的情况。Wherein, the state "Y" indicates that the data indicated by the specific index in the row is currently in need of migration and the migration has been completed.
状态“N”表示该行中具体索引所指示的数据目前处于需要进行迁移但未进行迁移,或者需要进行迁移并正在迁移但没有完全迁移完毕的情况。Status "N" means that the data indicated by the specific index in the row is currently in the situation of needing to be migrated but not being migrated, or needing to be migrated and being migrated but not completely migrated.
状态“NA”表示该行中具体索引所指示的数据目前处于不需要进行迁移,不处于未迁移状态的情况。The status "NA" indicates that the data indicated by the specific index in the row does not need to be migrated at present, and is not in the state of not being migrated.
在一些实现方式中,数据迁移工具还可以实时更改数据的状态。例如,当数据1需要进行迁移并完成迁移之后,数据1的状态可以由“N”转换为“Y”。一般情况下,数据1不会由“Y”转换为“N”。In some implementations, the data migration tool can also change the state of the data in real time. For example, when data 1 needs to be migrated and the migration is completed, the status of data 1 can be changed from "N" to "Y". In general, data 1 will not be converted from "Y" to "N".
不同迁移元数据记录表中索引所指示的同一数据在不同的表中可能处于不同的状态。例如,数据1在表A中的状态为“Y”,在表B中的状态为“N”,也就是说,数据1已经从表A中未迁移时所存储的逻辑位置迁移至已迁移后所存储的逻辑位置,但是还未从表B中未迁移时所存储的逻辑位置迁移至已迁移后所存储的逻辑位置。The same data indicated by indexes in different migration metadata record tables may be in different states in different tables. For example, the status of data 1 in table A is "Y", and the status of data 1 in table B is "N". The logical location stored, but has not been migrated from the logical location stored when not migrated to the logical location stored after migration in Table B.
值得说明的是,由于服务器100中存储有迁移元数据记录表,记录有迁移单位的数据的状态,迁移元数据记录表具有更新性与持久性,因此,在本申请实施例中,可以支持断点续传以及重试迁移。例如,当出现网络问题导致无法复制数据时,则中断复制数据,原有的迁移任务不受影响。当网络恢复之后,从中断处继续复制数据。It is worth noting that, since the migration metadata record table is stored in the server 100, and the state of the data of the migration unit is recorded, the migration metadata record table has updateability and persistence. Therefore, in the embodiment of the present application, it can support Click Resume and retry the migration. For example, when data cannot be replicated due to network problems, the data replication will be interrupted, and the original migration task will not be affected. When the network is restored, data replication continues where it left off.
又例如,若在网络出现问题导致无法复制的期间,而系统正在响应写请求,并正在进行对已经迁移的数据块或者对象进行写处理时,则将该数据块或对象在迁移元数据记录表中对应的状态记录为“N”,表示该数据块或对象指示为脏块需要继续迁移。当网络恢复后,迁移工具继续恢复原来的迁移过程,并将未迁移的数据和脏块迁移到目标中。也就是说,对网络出现问题那一刻所处理的数据块或者单个对象进行重新处理,以此来实现完成准确的迁移任务。For another example, if the system is responding to a write request and writing to a data block or object that has been migrated during the period when the network fails to replicate, the data block or object will be recorded in the migration metadata record table The corresponding status record in is "N", indicating that the data block or object is indicated as a dirty block and needs to continue to be migrated. When the network is restored, the migration tool resumes the original migration process and migrates unmigrated data and dirty blocks to the target. That is to say, reprocessing the data block or single object processed at the moment when the network problem occurs, so as to complete the accurate migration task.
在一些实现方式中,对于同一个源数据存储区域,可以实现多个任务迁移到不同的目标中,同一个源数据存储区域的两个不同的迁移任务是相互独立的,不会相互影响。对于不同源数据存储区域的同时进行迁移,后台也会有多个迁移任务,也有针对于不同迁移任务的各自的迁移元数据表,多个迁移任务之间也是相互独立,不会影响。In some implementations, for the same source data storage area, multiple tasks can be migrated to different targets, and two different migration tasks in the same source data storage area are independent of each other and will not affect each other. For simultaneous migration of different source data storage areas, there will be multiple migration tasks in the background, and there will also be separate migration metadata tables for different migration tasks. Multiple migration tasks are also independent of each other and will not affect each other.
后台迁移任务区别于前台迁移任务,指的是实时按顺序扫描待迁移的数据,判断出待迁移的数据中未迁移的单位数据,并对上述待迁移的数据中的未迁移的单位数据(例如数据块或单个对象)进行迁移。The background migration task is different from the foreground migration task. It refers to scanning the data to be migrated sequentially in real time, judging the unmigrated unit data in the data to be migrated, and analyzing the unmigrated unit data in the above data to be migrated (such as data blocks or individual objects) for migration.
例如,待迁移的数据为数据1-数据100共100个单位数据,若无针对于数据1-数据100中任一数据的读请求或写请求,后台迁移任务从数据1开始扫描直到数据100,并在扫描数据1时判断数据1为未迁移数据,对数据1进行迁移,其余99个数据同理进行迁移;For example, the data to be migrated is data 1-data 100, a total of 100 units of data. If there is no read request or write request for any data in data 1-data 100, the background migration task scans from data 1 to data 100. And when scanning data 1, it is judged that data 1 is unmigrated data, data 1 is migrated, and the remaining 99 data are migrated in the same way;
若存在一个针对于数据10的读请求或写请求,前台迁移任务率先将数据10进行迁移,然后后台迁移任务从数据1开始扫描直到数据100,并再按顺序将数据1-数据9、数据11-数据100进行迁移,并在扫描数据1时判断数据1为未迁移数据,对数据1进行迁移,其余98个数据同理进行迁移,但在扫描数据10时判断数据10为已迁移数据,不对数据10进行迁移。If there is a read request or write request for data 10, the foreground migration task first migrates data 10, and then the background migration task scans from data 1 to data 100, and then sequentially migrates data 1-data 9, data 11 -Data 100 is migrated, and when scanning data 1, it is judged that data 1 is unmigrated data, data 1 is migrated, and the remaining 98 data are migrated in the same way, but when scanning data 10, it is judged that data 10 is migrated data, incorrect Data 10 is migrated.
这样,只需要迁移前台未读写过的数据块或者单个对象,已经读写过的数据不会重复迁移,减少数据的读写,提升了迁移效率。In this way, only data blocks or single objects that have not been read and written in the foreground need to be migrated, and data that has been read and written will not be migrated repeatedly, reducing data reading and writing and improving migration efficiency.
为了更加清楚的介绍本申请实施例提供的方法,下面本申请实施例提供的服务器100。In order to more clearly introduce the method provided in the embodiment of the present application, the server 100 provided in the embodiment of the present application is as follows.
参考图2,图2为本申请实施例提供的服务器100的结构示意图。Referring to FIG. 2 , FIG. 2 is a schematic structural diagram of a server 100 provided by an embodiment of the present application.
如图2所示,服务器100可以包括:一个或者多个处理器101、存储器102、通信接口103、发射器105、接收器106、耦合器107以及天线108。上述部件可以通过总线104或者其他方式进行连接,图2是以通过总线连接为例。其中:As shown in FIG. 2 , the server 100 may include: one or
在本申请实施例中,处理器101可以用于读取和执行计算机可读指令。具体的,处理器101可以用于调用存储于存储器102中的程序,例如本申请实施例提供的数据迁移方法在服务器100的实现程序,并执行该程序包含的指令。处理器101还可以用于根据迁移元数据记录表确定是否需要进行迁移。In the embodiment of the present application, the
存储器102与处理器101耦合,用于存储各种软件程序和/或多组指令。具体的,存储器102可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。The
存储器102可以存储待迁移的数据集以及迁移元数据记录表等信息。The
存储器102可以存储操作系统(下述简称系统),例如uCOS、VxWorks、RTLinux等嵌入式操作系统。存储器102还可以存储网络通信程序,该网络通信程序可用于与客户端以及其他服务器进行通信。The
通信接口103可用于服务器100与其他通信设备。The
具体的,通信接口103可以是3G通信接口、长期演进(LTE)(4G)通信接口、5G通信接口、WLAN通信接口、WAN通信接口等等。不限于无线通信接口,服务器100还可以配置有线的通信接口103来支持有线通信。Specifically, the
发射器105和接收器106可看作一个无线调制解调器。发射器105可用于对处理器101输出的信号进行发射处理。接收器106可用于接收信号。
在服务器100中,发射器105和接收器106的数量均可以是一个或者多个。In the server 100, the number of
天线108可用于将传输线中的电磁能转换成自由空间中的电磁波,或者将自由空间中的电磁波转换成传输线中的电磁能。
耦合器107可用于将移动通信号分成多路,分配给多个的接收器106。The
可理解的,网络设备的天线108可以实现为大规模天线阵列。Understandably, the
需要说明的,图2所示的服务器100仅仅是本申请实施例的一种实现方式,实际应用中,服务器100还可以包括更多或更少的部件,这里不作限制。It should be noted that the server 100 shown in FIG. 2 is only an implementation manner of the embodiment of the present application. In practical applications, the server 100 may include more or fewer components, which is not limited here.
值得说明的,根据用户的不同需求以及其他方面的综合考虑,源数据存储区域和目标存储区域所存储的服务器可以为同一个,也可以为不同的两个服务器。It is worth noting that, according to different needs of users and comprehensive consideration of other aspects, the server stored in the source data storage area and the target storage area may be the same or two different servers.
数据迁移工具可以运行在源数据存储区域所存储的服务器上,也可以运行在目标存储区域所存储的服务器上,还可以运行在除上述情况以外的其他服务器上。The data migration tool can run on the server stored in the source data storage area, or on the server stored in the target storage area, or on other servers except the above cases.
在一些实施方式中,数据迁移工具可以同时运行在源数据存储区域所存储的服务器上以及目标存储区域所存储的服务器上。在本申请实施例中,对此不作限定。In some implementations, the data migration tool can run on the server stored in the source data storage area and the server stored in the target storage area at the same time. In the embodiment of the present application, there is no limitation to this.
当图1中数据迁移系统中源数据存储区域所存储的服务器和目标存储区域所存储的服务器为同一个图2所示的服务器100,并且数据迁移工具运行服务器100上时,处理器101可以用于响应用户的读请求和写请求,并对请求进行拦截处理。When the server stored in the source data storage area and the server stored in the target storage area in the data migration system in FIG. 1 are the same server 100 shown in FIG. 2 , and the data migration tool runs on the server 100, the
处理器101还可以根据迁移元数据记录表判断数据是否需要进行迁移。处理器101还可以在数据完成迁移之后更新数据在迁移元数据记录表上的状态信息。The
存储器102可以用于存储待迁移的数据、已迁移的数据以及迁移元数据记录表等信息。The
通信接口103可以用于与用户所使用的电子设备进行通信连接。The
发射器105可以用于将用户所需要的数据返回给用户所使用的电子设备,接收器106可以用于接收用户的读请求或写请求,接收器106还可以用于接收针对于第一数据的迁移指令,例如接收器106还可以用于接收控制中心发送的针对于第一数据的迁移指令。The
当图1中数据迁移系统中源数据存储区域所存储的服务器和目标存储区域所存储的服务器不为同一个图2所示的服务器100时,源数据存储区域所存储的服务器为服务器110,目标存储区域所存储的服务器为服务器120,数据迁移工具可以同时运行服务器110以及服务器120上,服务器100包括服务器110以及服务器120。When the server stored in the source data storage area and the server stored in the target storage area in the data migration system in Figure 1 are not the same server 100 shown in Figure 2, the server stored in the source data storage area is server 110, and the target The server stored in the storage area is the server 120 , the data migration tool can run on the server 110 and the server 120 at the same time, and the server 100 includes the server 110 and the server 120 .
服务器110的处理器101可以用于响应用户的读请求和写请求,并对请求进行拦截处理。服务器110的处理器101还可以根据迁移元数据记录表判断数据是否需要进行迁移。服务器110的处理器101可以在发送待迁移的数据完毕之后,更新迁移元数据记录表。The
服务器110的存储器102可以用于存储待迁移的数据以及迁移元数据记录表等信息。The
服务器110的通信接口103可以用于与服务器120进行通信连接。The
服务器110的发射器105可以用于向服务器120发送待迁移的数据。The
服务器110的接收器106可以用于接收用户的读请求或写请求,服务器110的接收器106还可以用于接收控制中心发送的针对于第一数据的迁移指令。The
服务器120的处理器101可以在接收服务器110发送待迁移的数据完毕之后,更新迁移元数据记录表。The
服务器120的存储器102可以用于存储已迁移的数据以及迁移元数据记录表等信息。The
服务器120的通信接口103可以用于与服务器110进行通信连接。The
服务器120的发射器105可以用于向服务器110发送待迁移的数据已完成迁移的提示信息,服务器120的接收器106可以用于接收服务器110所发送待迁移的数据。The
在一些实现方式中,服务器100可以被称为计算设备。In some implementations, server 100 may be referred to as a computing device.
在一些实现方式中,用户所使用的电子设备可以是手机、平板电脑、桌面型计算机、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobilepersonal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digitalassistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备和/或智慧城市设备,本申请实施例对该电子设备的具体类型不作特殊限制。In some implementations, the electronic device used by the user may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (ultra-mobilepersonal computer, UMPC), a netbook, and Cellular phone, personal digital assistant (personal digital assistant, PDA), augmented reality (augmented reality, AR) device, virtual reality (virtual reality, VR) device, artificial intelligence (artificial intelligence, AI) device, wearable device, vehicle-mounted device , smart home equipment and/or smart city equipment, the embodiment of the present application does not specifically limit the specific type of the electronic equipment.
下面介绍本申请实施例中提供的一种数据迁移的方法。该实施例以服务器100响应用户针对于待迁移的数据的读请求的情况为例介绍数据迁移的方法。A data migration method provided in the embodiment of the present application is introduced below. This embodiment introduces the method of data migration by taking the situation that the server 100 responds to the user's read request for the data to be migrated as an example.
图3示出了本申请实施例中提供的一种响应读请求的数据迁移方法的流程示意图。在该实施例中以数据的存储方式为块存储,迁移单位为数据块为例。FIG. 3 shows a schematic flowchart of a data migration method in response to a read request provided in an embodiment of the present application. In this embodiment, the storage mode of data is block storage, and the migration unit is data block as an example.
S301、服务器100响应用户针对于第一数据的读请求。S301. The server 100 responds to a user's read request for first data.
在一些实施方式中,用户根据自身需求,可以向服务器100进行输入操作,服务器100可以响应针对第一数据进行读请求。其中,第一数据的读请求可以包括但不限于:第一数据的在源数据存储区域中的逻辑地址,索引以及数据净荷长度等等,其中,数据净荷长度是指读请求信息中除去报头和长度之外的有效净荷数据长度。In some implementation manners, the user may perform an input operation to the server 100 according to his own needs, and the server 100 may respond to a read request for the first data. Wherein, the read request of the first data may include but not limited to: the logical address, index, and data payload length of the first data in the source data storage area, etc., wherein, the data payload length refers to the information removed from the read request information Payload data length in addition to header and length.
S302、判断第一数据是否需要进行迁移。S302. Determine whether the first data needs to be migrated.
在一些实施方式中,服务器100可以在响应读请求之前接收到控制中心下发的针对于第一数据的迁移指令。In some implementation manners, the server 100 may receive a migration instruction for the first data issued by the control center before responding to the read request.
系统可以是由于服务器100的剩余容纳空间,或者服务器100进行升级更新,或者是服务器100造到了损坏等原因下发的迁移指令,还可以是基于管理人员的输入操作而下发的迁移指令。在本申请实施例中,对此不作限定。The system may be a migration instruction issued due to the remaining storage space of the server 100, or the upgrade of the server 100, or damage to the server 100, or the migration instruction issued based on the input operation of the administrator. In the embodiment of the present application, there is no limitation to this.
并且,若存在针对于第一数据的迁移指令,则迁移元数据记录表中第一数据的状态不会是“NA”,而是“Y”或者“N”。Moreover, if there is a migration instruction for the first data, the state of the first data in the migration metadata record table will not be "NA", but "Y" or "N".
当服务器100判断出第一数据需要进行迁移时,即存在有针对于第一数据的迁移指令,第一数据在迁移元数据记录表中的状态为“Y”或者“N”,则执行S303。When the server 100 determines that the first data needs to be migrated, that is, there is a migration instruction for the first data, and the status of the first data in the migration metadata record table is "Y" or "N", then S303 is executed.
当服务器100判断出第一数据不需要进行迁移时,即不存在有针对于第一数据的迁移指令,第一数据在迁移元数据记录表中的状态为“NA”,则执行S304。When the server 100 determines that the first data does not need to be migrated, that is, there is no migration instruction for the first data, and the status of the first data in the migration metadata record table is "NA", then S304 is executed.
在一些实现方式中,由于迁移元数据记录表中的记录单位是以数据块的大小为单位的,上述第一数据的状态可以是指:In some implementation manners, since the record unit in the migration metadata record table is the size of the data block, the state of the above-mentioned first data may refer to:
若第一数据的大小大于或等于数据块,则第一数据的状态为第一数据所分割成对应多个数据块的状态,若第一数据的大小小于数据块,则第一数据的状态为第一数据所对应数据块的状态。If the size of the first data is greater than or equal to the data block, the state of the first data is the state of the first data divided into corresponding multiple data blocks; if the size of the first data is smaller than the data block, the state of the first data is The state of the data block corresponding to the first data.
S303、判断第一数据是否已经被迁移。S303. Determine whether the first data has been migrated.
在一些实现方式中,服务器100可以根据迁移元数据记录表判断出第一数据是否已经完成迁移。In some implementation manners, the server 100 may determine whether the migration of the first data has been completed according to the migration metadata record table.
例如,若在迁移元数据记录表中,针对于第一数据的读请求中携带的索引所对应的状态为“Y”,则可以判断出第一数据已经完成迁移;若在迁移元数据记录表中,针对于第一数据的读请求中携带的索引所对应的状态为“N”,则可以判断出第一数据未迁移或正在迁移中并且还未完成迁移。For example, if in the migration metadata record table, the state corresponding to the index carried in the read request for the first data is "Y", it can be judged that the migration of the first data has been completed; if in the migration metadata record table , if the state corresponding to the index carried in the read request for the first data is "N", it can be determined that the first data has not been migrated or is being migrated and the migration has not been completed.
当服务器100判断出第一数据已经完成迁移时,第一数据在迁移元数据记录表中的状态为“Y”,第一数据无需再次从源数据存储区域迁移至目标存储区域,则执行S304。When the server 100 determines that the migration of the first data has been completed, the status of the first data in the migration metadata record table is "Y", and the first data does not need to be migrated from the source data storage area to the target storage area again, and S304 is executed.
当服务器100判断出第一数据未进行迁移,但从S303中可知存在有针对于第一数据的迁移指令时,第一数据在迁移元数据记录表中的状态为“N”,则执行S305。When the server 100 determines that the first data has not been migrated, but there is a migration instruction for the first data from S303, and the status of the first data in the migration metadata record table is "N", then S305 is executed.
进一步的,在一种可能的实现方式中,若第一数据处于正在迁移但没有完全迁移完毕的情况下,迁移元数据记录表可以记录第一数据的状态可以为“N+”。Further, in a possible implementation manner, if the first data is being migrated but not completely migrated, the migration metadata recording table may record that the state of the first data may be "N+".
当服务器100判断出第一数据处于正在迁移但没有完全迁移完毕时,第一数据无需重新进行迁移,执行S304。When the server 100 determines that the first data is being migrated but not completely migrated, the first data does not need to be migrated again, and S304 is executed.
S304、从源数据存储区域读取出第一数据,并返回给用户。S304. Read the first data from the source data storage area, and return it to the user.
在一些实现方式中,服务器100可以基于读请求从源数据存储区域中读取出第一数据,将第一数据返回至用户。In some implementation manners, the server 100 may read the first data from the source data storage area based on the read request, and return the first data to the user.
具体的,若第一数据存储在云端,用户想要读取第一数据,则云端可以根据本地用户所发送的第一数据的读请求获得第一数据的逻辑地址,再根据逻辑地址与物理地址的映射关系得到第一数据的物理地址,并从该物理地址中读取出第一数据,然后云端将读取出来的第一数据发送至本地用户。Specifically, if the first data is stored in the cloud and the user wants to read the first data, the cloud can obtain the logical address of the first data according to the read request of the first data sent by the local user, and then obtain the logical address of the first data according to the logical address and the physical address. The physical address of the first data is obtained from the mapping relationship, and the first data is read from the physical address, and then the cloud sends the read first data to the local user.
S305、从源数据存储区域读取出第一数据,将第一数据迁移至目标存储区域,并更新迁移元数据记录表,再将第一数据返回给用户。S305. Read the first data from the source data storage area, migrate the first data to the target storage area, update the migration metadata record table, and then return the first data to the user.
在一些实现方式中,服务器100可以将第一数据从源数据存储区域迁移至目标存储区域。例如,当源数据存储区域与目标存储区域存储在同一个服务器100上时,第一数据的在源数据存储区域中的逻辑地址为L1,逻辑地址L1所对应的物理地址为W1,其映射关系为逻辑地址L1映射物理地址W1。In some implementation manners, the server 100 may migrate the first data from the source data storage area to the target storage area. For example, when the source data storage area and the target storage area are stored on the same server 100, the logical address of the first data in the source data storage area is L1, and the physical address corresponding to the logical address L1 is W1. The mapping relationship Physical address W1 is mapped for logical address L1.
服务器100将第一数据从源数据存储区域迁移至目标存储区域可以是指将第一数据的逻辑地址由源数据存储区域中的逻辑地址L1改为目标存储区域中的逻辑地址L2,并且将映射关系改为逻辑地址L2映射物理地址W1。Migrating the first data from the source data storage area to the target storage area by the server 100 may refer to changing the logical address of the first data from the logical address L1 in the source data storage area to the logical address L2 in the target storage area, and mapping The relationship is changed to logical address L2 mapping physical address W1.
可选的,第一数据迁移前后在服务器100中所存储的两个物理地址可以相同的,也可以是不同的。在本申请实施例中,对此不作限制。Optionally, the two physical addresses stored in the server 100 before and after the first data migration may be the same or different. In the embodiment of the present application, there is no limitation to this.
在一些实现方式中,服务器100在完成第一数据从源数据存储区域迁移至目标存储区域后,可以更新迁移元数据记录表。In some implementation manners, after the server 100 finishes migrating the first data from the source data storage area to the target storage area, it may update the migration metadata record table.
例如,第一数据从源数据存储区域迁移至目标存储区域之后,在迁移元数据记录表的状态可以由“N”转换为“Y”。For example, after the first data is migrated from the source data storage area to the target storage area, the state of the migration metadata record table may change from "N" to "Y".
在一种可能的实施方式中,若用户想要读取的第一数据的大小小于数据块,服务器100需要对数据块按照实际读取的数据大小进行切割处理,使得切割处理之后的部分数据恰好为第一数据。In a possible implementation, if the size of the first data that the user wants to read is smaller than the data block, the server 100 needs to cut the data block according to the actual read data size, so that part of the data after the cutting process is exactly is the first data.
例如,用户想要读取的第一数据大小为0.5MB,而数据块大小为1MB,此时,服务器100从源数据存储区域中读取出的数据块大小为1MB,其中,1MB的数据块包括有0.5MB的第一数据和0.5MB的其他数据,服务器100需要将1MB大小的数据块划分开,从其中选择出0.5MB的第一数据,并将该0.5MB的第一数据返回给用户。For example, the size of the first data that the user wants to read is 0.5MB, and the size of the data block is 1MB. At this time, the size of the data block read by the server 100 from the source data storage area is 1MB, wherein, the data block of 1MB Including the first data of 0.5MB and other data of 0.5MB, the server 100 needs to divide the data block of 1MB, select the first data of 0.5MB from it, and return the first data of 0.5MB to the user .
在一些实现方式中,记录元数据可以被理解成更新迁移元数据记录表。In some implementations, recording metadata can be understood as updating a migration metadata recording table.
图4示出了本申请实施例中提供的另一种响应读请求的数据迁移方法的流程示意图。在该实施例中以数据的存储方式为对象存储,迁移单位为单个对象为例。FIG. 4 shows a schematic flowchart of another data migration method in response to a read request provided in the embodiment of the present application. In this embodiment, the storage mode of data is object storage, and the migration unit is a single object as an example.
S401、服务器100响应用户针对于第一数据的读请求。S401. The server 100 responds to a user's read request for first data.
在一些实施方式中,用户根据自身需求,可以向服务器100进行输入操作,服务器100可以响应针对第一数据进行读请求。In some implementation manners, the user may perform an input operation to the server 100 according to his own needs, and the server 100 may respond to a read request for the first data.
其中,第一数据的读请求可以包括但不限于:第一数据的在源数据存储区域中的逻辑地址,索引以及数据净荷长度等等,其中,数据净荷长度是指读请求信息中除去报头和长度之外的有效净荷数据长度。Wherein, the read request of the first data may include but not limited to: the logical address, index, and data payload length of the first data in the source data storage area, etc., wherein, the data payload length refers to the information removed from the read request information Payload data length in addition to header and length.
S402、判断第一数据是否需要进行迁移。S402. Determine whether the first data needs to be migrated.
在一些实施方式中,服务器100可以在响应读请求之前接收到控制中心下发的针对于第一数据的迁移指令。In some implementation manners, the server 100 may receive a migration instruction for the first data issued by the control center before responding to the read request.
系统可以是由于服务器100的剩余容纳空间,或者服务器100进行升级更新,或者是服务器100造到了损坏等原因下发的迁移指令,还可以是基于管理人员的输入操作而下发的迁移指令。在本申请实施例中,对此不作限定。The system may be a migration instruction issued due to the remaining storage space of the server 100, or the upgrade of the server 100, or damage to the server 100, or the migration instruction issued based on the input operation of the administrator. In the embodiment of the present application, there is no limitation to this.
并且,若存在针对于第一数据的迁移指令,则迁移元数据记录表中第一数据的状态不会是“NA”,而是“Y”或者“N”。Moreover, if there is a migration instruction for the first data, the state of the first data in the migration metadata record table will not be "NA", but "Y" or "N".
当服务器100判断出第一数据需要进行迁移时,即存在有针对于第一数据的迁移指令,第一数据在迁移元数据记录表中的状态为“Y”或者“N”,则执行S403。When the server 100 determines that the first data needs to be migrated, that is, there is a migration instruction for the first data, and the status of the first data in the migration metadata record table is "Y" or "N", then S403 is executed.
当服务器100判断出第一数据不需要进行迁移时,即不存在有针对于第一数据的迁移指令,第一数据在迁移元数据记录表中的状态为“NA”,则执行S404。When the server 100 determines that the first data does not need to be migrated, that is, there is no migration instruction for the first data, and the status of the first data in the migration metadata record table is "NA", then S404 is executed.
在一些实现方式中,由于迁移元数据记录表中的记录单位是以单个对象的大小为单位的,上述第一数据的状态可以是指:In some implementations, since the record unit in the migration metadata record table is the size of a single object, the state of the first data above may refer to:
若第一数据的大小大于或等于单个对象,则第一数据的状态为第一数据所分割成对应多个单个对象的状态,若第一数据的大小小于单个对象,则第一数据的状态为第一数据所对应单个对象的状态。If the size of the first data is greater than or equal to a single object, the state of the first data is the state of the first data divided into multiple single objects; if the size of the first data is smaller than a single object, the state of the first data is The state of a single object corresponding to the first data.
S403、判断第一数据是否已经被迁移。S403. Determine whether the first data has been migrated.
在一些实现方式中,服务器100可以根据迁移元数据记录表判断出第一数据是否已经完成迁移。In some implementation manners, the server 100 may determine whether the migration of the first data has been completed according to the migration metadata record table.
例如,若在迁移元数据记录表中,针对于第一数据的读请求中携带的索引所对应的状态为“Y”,则可以判断出第一数据已经完成迁移;For example, if in the migration metadata record table, the status corresponding to the index carried in the read request for the first data is "Y", it can be determined that the migration of the first data has been completed;
若在迁移元数据记录表中,针对于第一数据的读请求中携带的索引所对应的状态为“N”,则可以判断出第一数据未迁移或正在迁移中并且还未完成迁移。If in the migration metadata record table, the state corresponding to the index carried in the read request for the first data is "N", it can be determined that the first data has not been migrated or is being migrated and the migration has not been completed.
当服务器100判断出第一数据已经完成迁移时,第一数据在迁移元数据记录表中的状态为“Y”,第一数据无需再次从源数据存储区域迁移至目标存储区域,则执行S404。When the server 100 determines that the migration of the first data has been completed, the status of the first data in the migration metadata record table is "Y", and the first data does not need to be migrated from the source data storage area to the target storage area again, and S404 is executed.
当服务器100判断出第一数据未进行迁移,但从S403中可知存在有针对于第一数据的迁移指令时,第一数据在迁移元数据记录表中的状态为“N”,则执行S405。When the server 100 determines that the first data has not been migrated, but there is a migration instruction for the first data from S403, and the status of the first data in the migration metadata record table is "N", then S405 is executed.
进一步的,在一种可能的实现方式中,若第一数据处于正在迁移但没有完全迁移完毕的情况下,迁移元数据记录表可以记录第一数据的状态可以为“N+”。Further, in a possible implementation manner, if the first data is being migrated but not completely migrated, the migration metadata recording table may record that the state of the first data may be "N+".
当服务器100判断出第一数据处于正在迁移但没有完全迁移完毕时,第一数据无需重新进行迁移,执行S404。When the server 100 determines that the first data is being migrated but not completely migrated, the first data does not need to be migrated again, and S404 is executed.
S404、从源数据存储区域读取出第一数据,并返回给用户。S404. Read the first data from the source data storage area, and return it to the user.
在一些实现方式中,服务器100可以基于读请求从源数据存储区域中读取出第一数据,将第一数据返回至用户。In some implementation manners, the server 100 may read the first data from the source data storage area based on the read request, and return the first data to the user.
具体的,若第一数据存储在云端,用户想要读取第一数据,则云端可以根据本地用户所发送的第一数据的读请求获得第一数据的逻辑地址,再根据逻辑地址与物理地址的映射关系得到第一数据的物理地址,并从该物理地址中读取出第一数据,然后云端将读取出来的第一数据发送至本地用户。Specifically, if the first data is stored in the cloud and the user wants to read the first data, the cloud can obtain the logical address of the first data according to the read request of the first data sent by the local user, and then obtain the logical address of the first data according to the logical address and the physical address. The physical address of the first data is obtained from the mapping relationship, and the first data is read from the physical address, and then the cloud sends the read first data to the local user.
S405、从源数据存储区域读取出第一数据,将第一数据迁移至目标存储区域,并更新迁移元数据记录表,再将第一数据返回给用户。S405. Read the first data from the source data storage area, migrate the first data to the target storage area, update the migration metadata record table, and then return the first data to the user.
在一些实现方式中,服务器100可以将第一数据从源数据存储区域迁移至目标存储区域。例如,当源数据存储区域与目标存储区域存储在同一个服务器100上时,第一数据的在源数据存储区域中的逻辑地址为L1,逻辑地址L1所对应的物理地址为W1,其映射关系为逻辑地址L1映射物理地址W1。In some implementation manners, the server 100 may migrate the first data from the source data storage area to the target storage area. For example, when the source data storage area and the target storage area are stored on the same server 100, the logical address of the first data in the source data storage area is L1, and the physical address corresponding to the logical address L1 is W1. The mapping relationship Physical address W1 is mapped for logical address L1.
服务器100将第一数据从源数据存储区域迁移至目标存储区域可以是指将第一数据的逻辑地址由源数据存储区域中的逻辑地址L1改为目标存储区域中的逻辑地址L2,并且将映射关系改为逻辑地址L2映射物理地址W1。Migrating the first data from the source data storage area to the target storage area by the server 100 may refer to changing the logical address of the first data from the logical address L1 in the source data storage area to the logical address L2 in the target storage area, and mapping The relationship is changed to logical address L2 mapping physical address W1.
可选的,第一数据迁移前后在服务器100中所存储的两个物理地址可以相同的,也可以是不同的。在本申请实施例中,对此不作限制。Optionally, the two physical addresses stored in the server 100 before and after the first data migration may be the same or different. In the embodiment of the present application, there is no limitation to this.
在一些实现方式中,服务器100在完成第一数据从源数据存储区域迁移至目标存储区域后,可以更新迁移元数据记录表。In some implementation manners, after the server 100 finishes migrating the first data from the source data storage area to the target storage area, it may update the migration metadata record table.
例如,第一数据从源数据存储区域迁移至目标存储区域之后,在迁移元数据记录表的状态可以由“N”转换为“Y”。For example, after the first data is migrated from the source data storage area to the target storage area, the state of the migration metadata record table may change from "N" to "Y".
在一种可能的实施方式中,若用户想要读取的第一数据的大小小于单个对象,服务器100需要对单个对象按照实际读取的数据大小进行切割处理,使得切割处理之后的部分数据恰好为第一数据。例如,用户想要读取的第一数据大小为0.5MB,而单个对象大小为1MB,此时,服务器100从源数据存储区域中读取出的单个对象大小为1MB,其中,1MB的单个对象包括有0.5MB的第一数据和0.5MB的其他数据,服务器100需要将1MB大小的单个对象划分开,从其中选择出0.5MB的第一数据,并将该0.5MB的第一数据返回给用户。In a possible implementation, if the size of the first data that the user wants to read is smaller than a single object, the server 100 needs to cut the single object according to the actual read data size, so that part of the data after cutting is exactly is the first data. For example, the size of the first data that the user wants to read is 0.5MB, and the size of a single object is 1MB. At this time, the size of the single object read by the server 100 from the source data storage area is 1MB, wherein the single object of 1MB Including the first data of 0.5MB and other data of 0.5MB, the server 100 needs to divide the single object of 1MB size, select the first data of 0.5MB from it, and return the first data of 0.5MB to the user .
实施上述方法,可以实现在线迁移,并且可以确保当系统接收到用户对第一数据的读请求时,只需要系统在源数据存储区域中对第一数据进行一次读取即可以保证实现用户的读请求以及迁移任务。这样,可以提高迁移效率。Implementing the above method can realize online migration, and can ensure that when the system receives a user's read request for the first data, the system only needs to read the first data once in the source data storage area to ensure that the user's read request can be realized. requests and migration tasks. In this way, transfer efficiency can be improved.
下面介绍本申请实施例中提供的另一种数据迁移的方法。该实施例以服务器100响应用户针对于待迁移的数据的写请求的情况为例介绍数据迁移的方法。Another data migration method provided in the embodiment of the present application is introduced below. This embodiment introduces a method of data migration by taking the case where the server 100 responds to a user's write request for data to be migrated as an example.
图5示出了本申请实施例中提供的一种响应写请求的数据迁移方法的流程示意图。在该实施例中以数据的存储方式为块存储,迁移单位为数据块为例。FIG. 5 shows a schematic flowchart of a data migration method in response to a write request provided in an embodiment of the present application. In this embodiment, the storage mode of data is block storage, and the migration unit is data block as an example.
S501、服务器100响应用户针对于第一数据的写请求。S501. The server 100 responds to a user's write request for first data.
在一些实施方式中,用户根据自身需求,可以向服务器100进行输入操作,服务器100可以响应针对第一数据进行写请求。In some implementation manners, the user may perform an input operation to the server 100 according to his own needs, and the server 100 may respond to a write request for the first data.
其中,第一数据的写请求可以包括但不限于:第一数据在源数据存储区域中的逻辑地址,索引、数据净荷长度以及修改内容等等。Wherein, the write request of the first data may include but not limited to: the logical address of the first data in the source data storage area, the index, the length of the data payload, and the modification content, etc.
在一些实现方式中,服务器100响应写请求存在前置条件:服务器100响应用户针对于第一数据的写请求需要满足写写互斥,即两个写请求针对的数据不可以有交集。In some implementations, there is a precondition for the server 100 to respond to the write request: the server 100 responds to the user's write request for the first data and needs to satisfy write-write mutual exclusion, that is, the data targeted by the two write requests cannot overlap.
若出现两个写请求针对的数据有交集的情况,需要采取加锁互斥的方式,避免出现写写冲突的现象。If the data targeted by two write requests intersects, it is necessary to adopt a lock and mutual exclusion method to avoid write conflicts.
S502、判断第一数据是否需要进行迁移,若否,则写源数据存储区域中第一数据,并将写之后的第一数据存储至源数据存储区域。S502. Determine whether the first data needs to be migrated, and if not, write the first data in the source data storage area, and store the written first data in the source data storage area.
在一些实施方式中,服务器100可以在响应写请求之前接收到系统下发的针对于第一数据的迁移指令。In some implementation manners, the server 100 may receive a migration instruction for the first data issued by the system before responding to the write request.
系统可以是由于服务器100的剩余容纳空间,或者服务器100进行升级更新,或者是服务器100造到了损坏等原因下发的迁移指令,还可以是基于管理人员的输入操作而下发的迁移指令。在本申请实施例中,对此不作限定。The system may be a migration instruction issued due to the remaining storage space of the server 100, or the upgrade of the server 100, or damage to the server 100, or the migration instruction issued based on the input operation of the administrator. In the embodiment of the present application, there is no limitation to this.
并且,若存在针对于第一数据的迁移指令,则迁移元数据记录表中第一数据的状态不会是“NA”,而是“Y”或者“N”。Moreover, if there is a migration instruction for the first data, the state of the first data in the migration metadata record table will not be "NA", but "Y" or "N".
当服务器100判断出第一数据不需要进行迁移时,即不存在有针对于第一数据的迁移指令,第一数据在迁移元数据记录表中的状态为“NA”,服务器100可以直接根据写请求,对第一数据进行处理得到写之后的第一数据,并将写之后的第一数据存储至源数据存储区域中,即第一数据与写之后的第一数据的逻辑地址为同一个。When the server 100 determines that the first data does not need to be migrated, that is, there is no migration instruction for the first data, and the status of the first data in the migration metadata record table is "NA", the server 100 can directly write Request, process the first data to obtain the first data after writing, and store the first data after writing in the source data storage area, that is, the first data and the first data after writing have the same logical address.
可选的,服务器100可以将完成写请求的信息通知给用户。例如,用户删除文档M,服务器100可以通过显示提示信息(例如显示弹窗)如文本信息“已删除文档M”的方式来通知用户服务器100已完成用户针对文档M的写请求。在本申请实施例中,对服务器100通知用户已完成写请求的方式不做限定。Optionally, the server 100 may notify the user of the completion of the write request. For example, when a user deletes document M, the server 100 may notify the user that the server 100 has completed the user's writing request for document M by displaying prompt information (for example, displaying a pop-up window) such as a text message "document M has been deleted". In this embodiment of the present application, the manner in which the server 100 notifies the user that the writing request has been completed is not limited.
当服务器100判断出第一数据需要进行迁移时,即存在有针对于第一数据的迁移指令,第一数据在迁移元数据记录表中的状态为“Y”或者“N”,则执行S503。When the server 100 determines that the first data needs to be migrated, that is, there is a migration instruction for the first data, and the status of the first data in the migration metadata record table is "Y" or "N", then S503 is executed.
在一些实现方式中,由于迁移元数据记录表中的记录单位是以数据块的大小为单位的,上述第一数据的状态可以是指:In some implementation manners, since the record unit in the migration metadata record table is the size of the data block, the state of the above-mentioned first data may refer to:
若第一数据的大小大于或等于数据块,则第一数据的状态为第一数据所分割成对应多个数据块的状态。If the size of the first data is greater than or equal to the data block, the state of the first data is the state of the first data divided into a plurality of corresponding data blocks.
若第一数据的大小小于数据块,则第一数据的状态为第一数据所对应数据块的状态。If the size of the first data is smaller than the data block, the state of the first data is the state of the data block corresponding to the first data.
S503、判断第一数据是否已经被迁移,若是,则双写源数据存储区域与目标数据存储区域中的第一数据。S503. Determine whether the first data has been migrated, and if so, double-write the first data in the source data storage area and the target data storage area.
在一些实现方式中,服务器100可以根据迁移元数据记录表判断出第一数据是否已经完成迁移。In some implementation manners, the server 100 may determine whether the migration of the first data has been completed according to the migration metadata record table.
例如,若在迁移元数据记录表中,针对于第一数据的写请求中携带的索引所对应的状态为“Y”,则可以判断出第一数据已经完成迁移;若在迁移元数据记录表中,针对于第一数据的写请求中携带的索引所对应的状态为“N”,则可以判断出第一数据未迁移或正在迁移中并且还未完成迁移。For example, if in the migration metadata record table, the status corresponding to the index carried in the write request for the first data is "Y", it can be judged that the migration of the first data has been completed; if in the migration metadata record table , if the status corresponding to the index carried in the write request for the first data is "N", it can be determined that the first data has not been migrated or is being migrated and the migration has not been completed.
当服务器100判断出第一数据已经完成迁移时,第一数据在迁移元数据记录表中的状态为“Y”,第一数据无需再次从源数据存储区域迁移至目标存储区域,服务器100可以根据写请求分别对源数据存储区域的第一数据以及目标存储区域的第一数据进行处理,并将写之后的源数据存储区域中的第一数据存储至源数据存储区域中,将写之后的目标存储区域中的第一数据存储至目标存储区域中。When the server 100 determines that the migration of the first data has been completed, the status of the first data in the migration metadata record table is "Y", and the first data does not need to be migrated from the source data storage area to the target storage area again, and the server 100 can according to The write request processes the first data in the source data storage area and the first data in the target storage area respectively, stores the first data in the source data storage area after writing into the source data storage area, and stores the written first data in the target data storage area. The first data in the storage area is stored in the target storage area.
这样,在第一数据已经完成迁移之后,而源数据存储区域中的第一数据还未被删除的情况下,双写源数据存储区域与目标存储区域中的第一数据可以保持第一数据的内容一致性。可选的,服务器100可以将完成写请求的信息通知给用户,在此不做赘述。In this way, after the migration of the first data has been completed and the first data in the source data storage area has not been deleted, the first data in the double-write source data storage area and the target storage area can maintain the identity of the first data. Content Consistency. Optionally, the server 100 may notify the user of the completion of the write request, which will not be repeated here.
当服务器100判断出第一数据未进行迁移,但从S502中可知存在有针对于第一数据的迁移指令时,第一数据在迁移元数据记录表中的状态为“N”,则执行S504。When the server 100 determines that the first data has not been migrated, but there is a migration instruction for the first data from S502, and the status of the first data in the migration metadata record table is "N", then execute S504.
进一步的,在一种可能的实现方式中,若第一数据处于正在迁移但没有完全迁移完毕的情况下,迁移元数据记录表可以记录第一数据的状态可以为“N+”。Further, in a possible implementation manner, if the first data is being migrated but not completely migrated, the migration metadata recording table may record that the state of the first data may be "N+".
当服务器100判断出第一数据处于正在迁移但没有完全迁移完毕时,第一数据无需再次从源数据存储区域迁移至目标存储区域,服务器100可以根据写请求分别对源数据存储区域的第一数据以及目标存储区域的第一数据进行处理,并将写之后的源数据存储区域中的第一数据存储至源数据存储区域中,将写之后的目标存储区域中的第一数据存储至目标存储区域中。可选的,服务器100可以将完成写请求的信息通知给用户,在此不做赘述。When the server 100 determines that the first data is being migrated but has not been completely migrated, the first data does not need to be migrated from the source data storage area to the target storage area again, and the server 100 can separately store the first data in the source data storage area according to the write request. and the first data in the target storage area are processed, and the first data in the source data storage area after writing is stored in the source data storage area, and the first data in the target storage area after writing is stored in the target storage area middle. Optionally, the server 100 may notify the user of the completion of the write request, which will not be repeated here.
S504、判断进行迁移的数据块与第一数据是否对齐。S504. Determine whether the data block to be migrated is aligned with the first data.
在一些实现方式中,当数据的存储方式为块存储时,迁移单位为数据块,服务器100可以判断数据块与第一数据对齐。In some implementation manners, when the data storage mode is block storage, the migration unit is a data block, and the server 100 may determine that the data block is aligned with the first data.
例如,若第一数据的大小为0.5MB,数据块的大小为1MB,则数据块与第一数据不对齐。也就是说,第一数据的大小小于数据块大小时,数据块与第一数据不对齐。For example, if the size of the first data is 0.5MB and the size of the data block is 1MB, the data block is not aligned with the first data. That is to say, when the size of the first data is smaller than the size of the data block, the data block is not aligned with the first data.
若第一数据的大小为1.5MB,数据块大小为1MB,则第一数据的迁移单位为1.5,数据块与第一数据不对齐。也就是说,第一数据的大小不为数据块整数倍时,数据块与第一数据不对齐。If the size of the first data is 1.5MB and the size of the data block is 1MB, the migration unit of the first data is 1.5, and the data block is not aligned with the first data. That is to say, when the size of the first data is not an integer multiple of the data block, the data block is not aligned with the first data.
又例如,若第一数据的大小为1MB,数据块的大小为1MB,则数据块与第一数据对齐。也就是说,第一数据的大小等于数据块大小时,数据块与第一数据对齐。For another example, if the size of the first data is 1MB and the size of the data block is 1MB, then the data block is aligned with the first data. That is to say, when the size of the first data is equal to the size of the data block, the data block is aligned with the first data.
若第一数据的大小为2MB,数据块大小为1MB,则第一数据的迁移单位为2,数据块与第一数据对齐。也就是说,第一数据的大小为数据块整数倍时,数据块与第一数据对齐。If the size of the first data is 2MB and the size of the data block is 1MB, the migration unit of the first data is 2, and the data block is aligned with the first data. That is to say, when the size of the first data is an integer multiple of the data block, the data block is aligned with the first data.
当服务器100判断出数据块与第一数据对齐时,数据块的大小与第一数据的大小一致或者第一数据的大小是数据块的大小的整数倍,执行S505。When the server 100 determines that the data block is aligned with the first data, that the size of the data block is consistent with the size of the first data or that the size of the first data is an integer multiple of the size of the data block, S505 is executed.
当服务器100判断出数据块与第一数据不对齐时,可以分为两种情况:When the server 100 determines that the data block is not aligned with the first data, it can be divided into two situations:
第一种,第一数据的大小小于数据块大小,此时,执行S506;The first type, the size of the first data is smaller than the data block size, at this time, execute S506;
第二种,第一数据的大小大于数据块大小且不是数据块大小的整数倍,此时,可以将第一数据分为两部分,第一部分可以是大小为数据块大小的最大整数倍的数据,第二部分可以是第一数据中去掉第一部分的数据。其中,第一部分的数据执行S505,第二部分的数据执行S506。Second, the size of the first data is larger than the size of the data block and not an integer multiple of the size of the data block. At this time, the first data can be divided into two parts, and the first part can be the data whose size is the largest integer multiple of the data block size , the second part may be the data from the first data minus the first part. Wherein, S505 is executed for the first part of data, and S506 is executed for the second part of data.
S505、将第一数据迁移至目标存储区域,双写源数据存储区域与目标数据存储区域中的第一数据,并更新迁移元数据记录表。S505. Migrate the first data to the target storage area, double-write the first data in the source data storage area and the target data storage area, and update the migration metadata record table.
在一些实现方式中,服务器100可以将第一数据从源数据存储区域迁移至目标存储区域。In some implementation manners, the server 100 may migrate the first data from the source data storage area to the target storage area.
例如,当源数据存储区域与目标存储区域存储在同一个服务器100上时,第一数据的在源数据存储区域中的逻辑地址为L1,逻辑地址L1所对应的物理地址为W1,其映射关系为逻辑地址L1映射物理地址W1。For example, when the source data storage area and the target storage area are stored on the same server 100, the logical address of the first data in the source data storage area is L1, and the physical address corresponding to the logical address L1 is W1. The mapping relationship Physical address W1 is mapped for logical address L1.
服务器100将第一数据从源数据存储区域迁移至目标存储区域可以是指将第一数据的逻辑地址由源数据存储区域中的逻辑地址L1改为目标存储区域中的逻辑地址L2,并且将映射关系改为逻辑地址L2映射物理地址W1。Migrating the first data from the source data storage area to the target storage area by the server 100 may refer to changing the logical address of the first data from the logical address L1 in the source data storage area to the logical address L2 in the target storage area, and mapping The relationship is changed to logical address L2 mapping physical address W1.
又例如,当源数据存储区域存储的服务器与目标存储区域存储的服务器不为同一个服务器上时,即源数据存储区域所存储的服务器为服务器110,目标存储区域所存储的服务器为服务器120时,源数据存储区域所存储的服务器110将存储在逻辑地址L1和物理地址W1的第一数据发送给目标存储区域所存储的服务器120,服务器120将第一数据存储在目标存储区域中,第一数据在目标存储区域所存储的服务器120中的逻辑地址为L2,物理地址为W2。For another example, when the server stored in the source data storage area and the server stored in the target storage area are not on the same server, that is, the server stored in the source data storage area is server 110, and the server stored in the target storage area is server 120 , the server 110 stored in the source data storage area sends the first data stored in the logical address L1 and the physical address W1 to the server 120 stored in the target storage area, and the server 120 stores the first data in the target storage area, the first The logical address of the data stored in the server 120 in the target storage area is L2, and the physical address is W2.
可选的,第一数据迁移前后在服务器中所存储的两个物理地址可以相同的,也可以是不同的。即存储在源数据存储区域中第一数据所物理存储的存储介质与存储在目标数据存储区域中第一数据所物理存储的存储介质可以是同一个,也可以是不同的。在本申请实施例中,对此不作限制。Optionally, the two physical addresses stored in the server before and after the first data migration may be the same or different. That is, the storage medium on which the first data is physically stored in the source data storage area and the storage medium on which the first data is physically stored in the target data storage area may be the same or different. In the embodiment of the present application, there is no limitation to this.
在一些实现方式中,服务器100可以双写源数据存储区域中的第一数据和目标存储区域中的第一数据。具体的,服务器100可以根据写请求分别对源数据存储区域的第一数据以及目标存储区域的第一数据进行处理,并将写之后的源数据存储区域中的第一数据存储至源数据存储区域中,将写之后的目标存储区域中的第一数据存储至目标存储区域中。In some implementation manners, the server 100 can double-write the first data in the source data storage area and the first data in the target storage area. Specifically, the server 100 may respectively process the first data in the source data storage area and the first data in the target storage area according to the write request, and store the written first data in the source data storage area in the source data storage area , storing the first data in the target storage area after writing into the target storage area.
在一些实现方式中,服务器100在完成双写源数据存储区域中的第一数据和目标存储区域中的第一数据后,可以更新迁移元数据记录表。例如,第一数据在迁移元数据记录表中的状态可以由“N”转换为“Y”。In some implementation manners, the server 100 may update the migration metadata record table after completing the double writing of the first data in the source data storage area and the first data in the target storage area. For example, the status of the first data in the migration metadata record table may be converted from "N" to "Y".
可选的,服务器100可以将完成写请求的信息通知给用户,可以参考上述内容的,在此不做赘述。Optionally, the server 100 may notify the user of the information that the write request is completed, and reference may be made to the above content, which will not be described in detail here.
S506、对源数据存储区域中的第一数据进行写处理,然后将写之后的第一数据迁移至目标存储区域,并更新迁移元数据记录表。S506. Perform write processing on the first data in the source data storage area, then migrate the written first data to the target storage area, and update the migration metadata record table.
在一些实现方式中,S506中的第一数据与数据块的大小不对齐,这样可以会出现其他写请求针对的数据于本次写请求针对的第一数据存在重叠区域,即可能会对同一区域进行写操作。因此,在写源数据存储区域中的第一数据之前需要获取数据块内的互斥锁。若获取互斥锁失败,则一直重复获取直至获取成功。In some implementations, the size of the first data in S506 is not aligned with the size of the data block, so that there may be an overlapping area between the data targeted by other write requests and the first data targeted by this write request, that is, the same area may be to perform a write operation. Therefore, before writing the first data in the source data storage area, it is necessary to obtain a mutex in the data block. If the acquisition of the mutex fails, the acquisition is repeated until the acquisition succeeds.
其中,获取互斥锁成功可以是指停止其他线程中对第一数据的写操作,仅执行S506中的写操作。这样,可以避免出现写写冲突的现象。Wherein, the successful acquisition of the mutex may refer to stopping the writing operation of the first data in other threads, and only performing the writing operation in S506. In this way, the phenomenon of write-write conflict can be avoided.
在一些实现方式中,服务器100可以对源数据存储区域中的第一数据进行写处理。具体的,服务器100可以根据写请求对存储在源数据存储区域的第一数据进行写处理,并将写之后的第一数据存储至源数据存储区域中。在一些实现方式中,写之后的第一数据可以被称为第二数据。In some implementation manners, the server 100 may perform write processing on the first data in the source data storage area. Specifically, the server 100 may perform write processing on the first data stored in the source data storage area according to the write request, and store the written first data in the source data storage area. In some implementations, the written first data may be referred to as second data.
在一些实现方式中,服务器100可以将第一数据从源数据存储区域迁移至目标存储区域。例如,当源数据存储区域与目标存储区域存储在同一个服务器100上时,第一数据的在源数据存储区域中的逻辑地址为L1,逻辑地址L1所对应的物理地址为W1,其映射关系为逻辑地址L1映射物理地址W1。In some implementation manners, the server 100 may migrate the first data from the source data storage area to the target storage area. For example, when the source data storage area and the target storage area are stored on the same server 100, the logical address of the first data in the source data storage area is L1, and the physical address corresponding to the logical address L1 is W1. The mapping relationship Physical address W1 is mapped for logical address L1.
服务器100将第一数据从源数据存储区域迁移至目标存储区域可以是指将第一数据的逻辑地址由源数据存储区域中的逻辑地址L1改为目标存储区域中的逻辑地址L2,并且将映射关系改为逻辑地址L2映射物理地址W1。Migrating the first data from the source data storage area to the target storage area by the server 100 may refer to changing the logical address of the first data from the logical address L1 in the source data storage area to the logical address L2 in the target storage area, and mapping The relationship is changed to logical address L2 mapping physical address W1.
又例如,当源数据存储区域存储的服务器与目标存储区域存储的服务器不为同一个在不同的服务器100上时,即源数据存储区域所存储的服务器为服务器110,目标存储区域所存储的服务器为服务器120时,源数据存储区域所存储的服务器110将存储在逻辑地址L1的第一数据发送给目标存储区域所存储的服务器120,服务器120将第一数据存储在目标源目标存储区域中,第一数据在目标源目标存储区域所存储的服务器120中的逻辑地址为L2。For another example, when the server stored in the source data storage area and the server stored in the target storage area are not the same on different servers 100, that is, the server stored in the source data storage area is server 110, and the server stored in the target storage area When it is the server 120, the server 110 stored in the source data storage area sends the first data stored in the logical address L1 to the server 120 stored in the target storage area, and the server 120 stores the first data in the target source target storage area, The logical address of the first data in the server 120 stored in the target source target storage area is L2.
可选的,第一数据迁移前后在服务器100中所存储的两个物理地址可以相同的,也可以是不同的。即存储在源数据存储区域中第一数据所物理存储的存储介质与存储在目标数据存储区域中第一数据所物理存储的存储介质可以是同一个,也可以是不同的。在本申请实施例中,对此不作限制。Optionally, the two physical addresses stored in the server 100 before and after the first data migration may be the same or different. That is, the storage medium on which the first data is physically stored in the source data storage area and the storage medium on which the first data is physically stored in the target data storage area may be the same or different. In the embodiment of the present application, there is no limitation to this.
在一些实现方式中,服务器100在完成第一数据从源数据存储区域迁移至目标存储区域后,可以更新迁移元数据记录表。例如,第一数据在迁移元数据记录表中的状态可以由“N”转换为“Y”。In some implementation manners, after the server 100 finishes migrating the first data from the source data storage area to the target storage area, it may update the migration metadata record table. For example, the status of the first data in the migration metadata record table may be converted from "N" to "Y".
可选的,服务器100可以将完成写请求的信息通知给用户,在此不做赘述。Optionally, the server 100 may notify the user of the completion of the write request, which will not be repeated here.
实施上述方法,可以实现在线迁移,并且由于通过写请求触发数据的迁移,可以确保当系统接收到用户对第一数据的写请求时,只需要系统在源数据存储区域中对第一数据进行一次读取即可以保证实现用户的写请求以及迁移任务。这样,可以提高迁移效率。By implementing the above method, online migration can be realized, and since the data migration is triggered by a write request, it can be ensured that when the system receives a user’s write request for the first data, the system only needs to perform one data transfer on the first data in the source data storage area. Reading can guarantee the implementation of user write requests and migration tasks. In this way, transfer efficiency can be improved.
图6示出了本申请实施例中提供的另一种响应写请求的数据迁移方法的流程示意图。在该实施例中以数据的存储方式为对象存储,迁移单位为单个对象为例。FIG. 6 shows a schematic flowchart of another data migration method in response to a write request provided in the embodiment of the present application. In this embodiment, the storage mode of data is object storage, and the migration unit is a single object as an example.
S601、服务器100响应用户针对于第一数据的写请求。S601. The server 100 responds to a user's write request for first data.
在一些实施方式中,用户根据自身需求,可以向服务器100进行输入操作,服务器100可以响应针对第一数据进行写请求。其中,第一数据的写请求可以包括但不限于:第一数据在源数据存储区域中的逻辑地址,索引、数据净荷长度以及修改内容等等。In some implementation manners, the user may perform an input operation to the server 100 according to his own needs, and the server 100 may respond to a write request for the first data. Wherein, the write request of the first data may include but not limited to: the logical address of the first data in the source data storage area, the index, the length of the data payload, and the modification content, etc.
在一些实现方式中,服务器100响应写请求存在前置条件:服务器100响应用户针对于第一数据的写请求需要满足写写互斥,即两个写请求针对的数据不可以有交集。In some implementations, there is a precondition for the server 100 to respond to the write request: the server 100 responds to the user's write request for the first data and needs to satisfy write-write mutual exclusion, that is, the data targeted by the two write requests cannot overlap.
若出现两个写请求针对的数据有交集的情况,需要采取加锁互斥的方式,避免出现写写冲突的现象。If the data targeted by two write requests intersects, it is necessary to adopt a lock and mutual exclusion method to avoid write conflicts.
S602、判断第一数据是否需要进行迁移,若否,则对源数据存储区域中第一数据进行写处理,并将写之后的第一数据存储至源数据存储区域。S602. Determine whether the first data needs to be migrated, and if not, perform write processing on the first data in the source data storage area, and store the written first data in the source data storage area.
在一些实施方式中,服务器100可以在响应写请求之前接收到系统下发的针对于第一数据的迁移指令。In some implementation manners, the server 100 may receive a migration instruction for the first data issued by the system before responding to the write request.
系统可以是由于服务器100的剩余容纳空间,或者服务器100进行升级更新,或者是服务器100造到了损坏等原因下发的迁移指令,还可以是基于管理人员的输入操作而下发的迁移指令。在本申请实施例中,对此不作限定。The system may be a migration instruction issued due to the remaining storage space of the server 100, or the upgrade of the server 100, or damage to the server 100, or the migration instruction issued based on the input operation of the administrator. In the embodiment of the present application, there is no limitation to this.
并且,若存在针对于第一数据的迁移指令,则迁移元数据记录表中第一数据的状态不会是“NA”,而是“Y”或者“N”。Moreover, if there is a migration instruction for the first data, the state of the first data in the migration metadata record table will not be "NA", but "Y" or "N".
当服务器100判断出第一数据不需要进行迁移时,即不存在有针对于第一数据的迁移指令,第一数据在迁移元数据记录表中的状态为“NA”,服务器100可以直接根据写请求,对第一数据进行写处理得到写之后的第一数据,并将写之后的第一数据存储至源数据存储区域中,即写处理之前第一数据与写处理之后的第一数据的逻辑地址为同一个。When the server 100 determines that the first data does not need to be migrated, that is, there is no migration instruction for the first data, and the status of the first data in the migration metadata record table is "NA", the server 100 can directly write Request, perform write processing on the first data to obtain the first data after writing, and store the first data after writing in the source data storage area, that is, the logic of the first data before writing processing and the first data after writing processing The address is the same.
可选的,服务器100可以将完成写请求的信息通知给用户。例如,用户删除文档M,服务器100可以通过显示提示信息(例如显示弹窗)如文本信息“已删除文档M”的方式来通知用户服务器100已完成用户针对文档M的写请求。在本申请实施例中,对服务器100通知用户已完成写请求的方式不做限定。Optionally, the server 100 may notify the user of the completion of the write request. For example, when a user deletes document M, the server 100 may notify the user that the server 100 has completed the user's writing request for document M by displaying prompt information (for example, displaying a pop-up window) such as a text message "document M has been deleted". In this embodiment of the present application, the manner in which the server 100 notifies the user that the writing request has been completed is not limited.
当服务器100判断出第一数据需要进行迁移时,即存在有针对于第一数据的迁移指令,第一数据在迁移元数据记录表中的状态为“Y”或者“N”,则执行S603。When the server 100 determines that the first data needs to be migrated, that is, there is a migration instruction for the first data, and the status of the first data in the migration metadata record table is "Y" or "N", then S603 is executed.
在一些实现方式中,由于迁移元数据记录表中的记录单位是以单个对象的大小为单位的,上述第一数据的状态可以是指:若第一数据的大小大于或等于单个对象,则第一数据的状态为第一数据所分割成对应多个单个对象的状态,若第一数据的大小小于单个对象,则第一数据的状态为第一数据所对应单个对象的状态。In some implementations, since the record unit in the migration metadata record table is the size of a single object, the status of the first data above may refer to: if the size of the first data is greater than or equal to a single object, the status of the first data The state of a data is the state corresponding to multiple single objects divided by the first data. If the size of the first data is smaller than the single object, the state of the first data is the state of the single object corresponding to the first data.
S603、判断第一数据是否已经被迁移,若是,则双写源数据存储区域与目标数据存储区域中的第一数据。S603. Determine whether the first data has been migrated, and if so, double-write the first data in the source data storage area and the target data storage area.
在一些实现方式中,服务器100可以根据迁移元数据记录表判断出第一数据是否已经完成迁移。In some implementation manners, the server 100 may determine whether the migration of the first data has been completed according to the migration metadata record table.
例如,若在迁移元数据记录表中,针对于第一数据的写请求中携带的索引所对应的状态为“Y”,则可以判断出第一数据已经完成迁移;若在迁移元数据记录表中,针对于第一数据的写请求中携带的索引所对应的状态为“N”,则可以判断出第一数据未迁移或正在迁移中并且还未完成迁移。For example, if in the migration metadata record table, the status corresponding to the index carried in the write request for the first data is "Y", it can be judged that the migration of the first data has been completed; if in the migration metadata record table , if the status corresponding to the index carried in the write request for the first data is "N", it can be determined that the first data has not been migrated or is being migrated and the migration has not been completed.
当服务器100判断出第一数据已经完成迁移时,第一数据在迁移元数据记录表中的状态为“Y”,第一数据无需再次从源数据存储区域迁移至目标存储区域,服务器100可以根据写请求分别对源数据存储区域的第一数据以及目标存储区域的第一数据进行处理,并将写之后的源数据存储区域中的第一数据存储至源数据存储区域中,将写之后的目标存储区域中的第一数据存储至目标存储区域中。When the server 100 determines that the migration of the first data has been completed, the status of the first data in the migration metadata record table is "Y", and the first data does not need to be migrated from the source data storage area to the target storage area again, and the server 100 can according to The write request processes the first data in the source data storage area and the first data in the target storage area respectively, stores the first data in the source data storage area after writing into the source data storage area, and stores the written first data in the target data storage area. The first data in the storage area is stored in the target storage area.
这样,在第一数据已经完成迁移之后,而源数据存储区域中的第一数据还未被删除的情况下,双写源数据存储区域与目标存储区域中的第一数据可以保持第一数据的内容一致性。可选的,服务器100可以将完成写请求的信息通知给用户,在此不做赘述。In this way, after the migration of the first data has been completed and the first data in the source data storage area has not been deleted, the first data in the double-write source data storage area and the target storage area can maintain the identity of the first data. Content Consistency. Optionally, the server 100 may notify the user of the completion of the write request, which will not be repeated here.
当服务器100判断出第一数据未进行迁移,但从S602中可知存在有针对于第一数据的迁移指令时,第一数据在迁移元数据记录表中的状态为“N”,则执行S604。When the server 100 determines that the first data has not been migrated, but there is a migration instruction for the first data from S602, and the status of the first data in the migration metadata record table is "N", then S604 is executed.
进一步的,在一种可能的实现方式中,若第一数据处于正在迁移但没有完全迁移完毕的情况下,迁移元数据记录表可以记录第一数据的状态可以为“N+”。Further, in a possible implementation manner, if the first data is being migrated but not completely migrated, the migration metadata recording table may record that the state of the first data may be "N+".
当服务器100判断出第一数据处于正在迁移但没有完全迁移完毕时,第一数据无需再次从源数据存储区域迁移至目标存储区域,服务器100可以根据写请求分别对源数据存储区域的第一数据以及目标存储区域的第一数据进行写处理,并将写之后的源数据存储区域中的第一数据存储至源数据存储区域中,将写之后的目标存储区域中的第一数据存储至目标存储区域中。可选的,服务器100可以将完成写请求的信息通知给用户,在此不做赘述。When the server 100 determines that the first data is being migrated but has not been completely migrated, the first data does not need to be migrated from the source data storage area to the target storage area again, and the server 100 can separately store the first data in the source data storage area according to the write request. And the first data in the target storage area is written, and the first data in the source data storage area after writing is stored in the source data storage area, and the first data in the target storage area after writing is stored in the target storage in the area. Optionally, the server 100 may notify the user of the completion of the write request, which will not be repeated here.
S604、将第一数据迁移至目标存储区域,双写源数据存储区域与目标数据存储区域中的第一数据,并更新迁移元数据记录表。S604. Migrate the first data to the target storage area, double-write the first data in the source data storage area and the target data storage area, and update the migration metadata record table.
在一些实现方式中,由于第一数据的存储方式为对象存储,而对对象进行写处理一般都是对整个对象进行写处理,因此,不存在需要类似S504来对第一数据与单个对象是否对齐进行判断。而是直接在第一数据需要进行迁移并且还未被迁移的情况下,响应写操作并完成第一数据的迁移任务。In some implementations, since the storage method of the first data is object storage, and the writing process of the object is generally the writing process of the entire object, therefore, there is no need to check whether the first data is aligned with a single object similar to S504 judge. Instead, when the first data needs to be migrated and has not been migrated, respond to the write operation and complete the migration task of the first data.
在一些实现方式中,服务器100可以将第一数据从源数据存储区域迁移至目标存储区域。例如,当源数据存储区域与目标存储区域存储在同一个服务器100上时,第一数据的在源数据存储区域中的逻辑地址为L1,逻辑地址L1所对应的物理地址为W1,其映射关系为逻辑地址L1映射物理地址W1。In some implementation manners, the server 100 may migrate the first data from the source data storage area to the target storage area. For example, when the source data storage area and the target storage area are stored on the same server 100, the logical address of the first data in the source data storage area is L1, and the physical address corresponding to the logical address L1 is W1. The mapping relationship Physical address W1 is mapped for logical address L1.
服务器100将第一数据从源数据存储区域迁移至目标存储区域可以是指将第一数据的逻辑地址由源数据存储区域中的逻辑地址L1改为目标存储区域中的逻辑地址L2,并且将映射关系改为逻辑地址L2映射物理地址W1。Migrating the first data from the source data storage area to the target storage area by the server 100 may refer to changing the logical address of the first data from the logical address L1 in the source data storage area to the logical address L2 in the target storage area, and mapping The relationship is changed to logical address L2 mapping physical address W1.
又例如,当源数据存储区域存储的服务器与目标存储区域存储的服务器不为同一个服务器上时,即源数据存储区域所存储的服务器为服务器110,目标存储区域所存储的服务器为服务器120时,源数据存储区域所存储的服务器110将存储在逻辑地址L1和物理地址W1的第一数据发送给目标存储区域所存储的服务器120,服务器120将第一数据存储在目标存储区域中,第一数据在目标存储区域所存储的服务器120中的逻辑地址为L2,物理地址为W2。For another example, when the server stored in the source data storage area and the server stored in the target storage area are not on the same server, that is, the server stored in the source data storage area is server 110, and the server stored in the target storage area is server 120 , the server 110 stored in the source data storage area sends the first data stored in the logical address L1 and the physical address W1 to the server 120 stored in the target storage area, and the server 120 stores the first data in the target storage area, the first The logical address of the data stored in the server 120 in the target storage area is L2, and the physical address is W2.
可选的,第一数据迁移前后在服务器中所存储的两个物理地址可以相同的,也可以是不同的。即存储在源数据存储区域中第一数据所物理存储的存储介质与存储在目标数据存储区域中第一数据所物理存储的存储介质可以是同一个,也可以是不同的。在本申请实施例中,对此不作限制。Optionally, the two physical addresses stored in the server before and after the first data migration may be the same or different. That is, the storage medium on which the first data is physically stored in the source data storage area and the storage medium on which the first data is physically stored in the target data storage area may be the same or different. In the embodiment of the present application, there is no limitation to this.
在一些实现方式中,服务器100可以双写源数据存储区域中的第一数据和目标存储区域中的第一数据。In some implementation manners, the server 100 can double-write the first data in the source data storage area and the first data in the target storage area.
具体的,服务器100可以根据写请求分别对源数据存储区域的第一数据以及目标存储区域的第一数据进行处理,并将写之后的源数据存储区域中的第一数据存储至源数据存储区域中,将写之后的目标存储区域中的第一数据存储至目标存储区域中。Specifically, the server 100 may respectively process the first data in the source data storage area and the first data in the target storage area according to the write request, and store the written first data in the source data storage area in the source data storage area , storing the first data in the target storage area after writing into the target storage area.
在一些实现方式中,服务器100在完成双写源数据存储区域中的第一数据和目标存储区域中的第一数据后,可以更新迁移元数据记录表。例如,第一数据在迁移元数据记录表中的状态可以由“N”转换为“Y”。In some implementation manners, the server 100 may update the migration metadata record table after completing the double writing of the first data in the source data storage area and the first data in the target storage area. For example, the status of the first data in the migration metadata record table may be converted from "N" to "Y".
可选的,服务器100可以将完成写请求的信息通知给用户,在此不做赘述。Optionally, the server 100 may notify the user of the completion of the write request, which will not be repeated here.
下面介绍本申请实施例中提供的另一种数据迁移的方法。该实施例以不存在用户针对于待迁移的数据的读请求以及写请求的情况为例介绍数据迁移的方法。Another data migration method provided in the embodiment of the present application is introduced below. This embodiment introduces the method of data migration by taking the situation that there is no read request and write request for the data to be migrated by the user as an example.
图7示出了本申请实施例中提供的一种后台数据迁移方法的流程示意图。该流程示意图以块存储为例。值得说明的是,后台数据迁移方法所针对的源数据存储区域具有迁移指令,下述具体步骤中不再判断是否具有迁移指令。FIG. 7 shows a schematic flowchart of a background data migration method provided in the embodiment of the present application. This flowchart uses block storage as an example. It is worth noting that the source data storage area targeted by the background data migration method has a migration instruction, and whether there is a migration instruction is no longer judged in the following specific steps.
S701、按顺序遍历待迁移的源数据存储区域,判断当前扫描的数据块是否已经完成迁移。S701. Traverse the source data storage areas to be migrated in order, and judge whether the currently scanned data blocks have been migrated.
在一些实现方式中,服务器100可以按顺序遍历待迁移的源数据存储区域。例如,待迁移的源数据存储区域为数据1-数据100共100个数据块,则服务器100从数据1开始扫描直到数据100,并判断每一个数据块是否已经完成迁移。In some implementation manners, the server 100 may sequentially traverse the source data storage areas to be migrated. For example, if the source data storage area to be migrated is 100 data blocks in total from data 1 to data 100, the server 100 scans from data 1 to data 100, and determines whether the migration of each data block has been completed.
在一些实现方式中,服务器100可以判断当前扫描的数据块是否已经完成迁移。In some implementation manners, the server 100 may determine whether the currently scanned data block has been migrated.
例如,若在迁移元数据记录表中,当前扫描的数据块对应的状态为“Y”,则可以判断出当前扫描的数据块已经完成迁移;For example, if in the migration metadata record table, the status corresponding to the currently scanned data block is "Y", it can be determined that the currently scanned data block has been migrated;
若在迁移元数据记录表中,当前扫描的数据块对应的状态为“N”,则可以判断出当前扫描的数据块未迁移或正在迁移中并且还未完成迁移。If in the migration metadata record table, the status corresponding to the currently scanned data block is "N", it can be determined that the currently scanned data block has not been migrated or is being migrated and the migration has not been completed.
当服务器100判断出当前扫描的数据块已经完成迁移时,当前扫描的数据块在迁移元数据记录表中的状态为“Y”,当前扫描的数据块无需再次从源数据存储区域迁移至目标存储区域,则扫描源数据存储区域中当前数据块的下一个数据块。When the server 100 determines that the currently scanned data block has been migrated, the status of the currently scanned data block in the migration metadata record table is "Y", and the currently scanned data block does not need to be migrated from the source data storage area to the target storage area again. area, scan the next data block of the current data block in the source data storage area.
例如,待迁移的源数据存储区域为数据1-数据100共100个数据块,服务器100判断数据1已经完成迁移,则服务器100扫描数据2,判断数据2是否已完成迁移。For example, the source data storage area to be migrated is data 1-data 100, a total of 100 data blocks, and the server 100 judges that data 1 has been migrated, then the server 100 scans data 2 to determine whether data 2 has been migrated.
当服务器100判断出当前扫描的数据块未进行迁移时,当前扫描的数据块在迁移元数据记录表中的状态为“N”,则执行S702。When the server 100 determines that the currently scanned data block has not been migrated, and the status of the currently scanned data block in the migration metadata record table is "N", then S702 is executed.
S702、判断当前扫描的数据块是否正在处理中。S702. Determine whether the currently scanned data block is being processed.
在一些实现方式中,服务器100可以判断当前扫描的数据块是否正在处理中,即判断当前扫描的数据块是否正在进行迁移。In some implementation manners, the server 100 may determine whether the currently scanned data block is being processed, that is, determine whether the currently scanned data block is being migrated.
在一种可能的实现方式中,若当前扫描的数据块处于正在迁移但没有完全迁移完毕的情况下,迁移元数据记录表可以记录当前扫描的数据块的状态可以为“N+”。In a possible implementation, if the currently scanned data block is being migrated but not completely migrated, the migration metadata record table may record that the status of the currently scanned data block may be "N+".
在本申请实施例中,除了上述方法还存在其他可以判断数据块是否正在进行迁移,对此不作限定。In the embodiment of the present application, besides the above method, there are other methods for judging whether the data block is being migrated, which is not limited.
当服务器100判断当前扫描的数据块正在进行迁移,当前扫描的数据块无需再次从源数据存储区域迁移至目标存储区域,则执行S701,扫描源数据存储区域中当前数据块的下一个数据块。When the server 100 judges that the currently scanned data block is being migrated and the currently scanned data block does not need to be migrated from the source data storage area to the target storage area again, S701 is executed to scan the next data block of the current data block in the source data storage area.
例如,待迁移的源数据存储区域为数据1-数据100共100个数据块,服务器100判断数据1正在进行迁移,则服务器100扫描数据2,判断数据2是否已完成迁移。For example, the source data storage area to be migrated is data 1-data 100, a total of 100 data blocks, and the server 100 judges that data 1 is being migrated, then the server 100 scans data 2 to determine whether data 2 has been migrated.
当服务器100判断当前扫描的数据块没有正在进行迁移,则执行S703。When the server 100 determines that the currently scanned data block is not being migrated, S703 is executed.
S703、从源数据存储区域中读取出当前扫描的数据块,将该数据块迁移至目标存储区域,并更新迁移元数据记录表。S703. Read the currently scanned data block from the source data storage area, migrate the data block to the target storage area, and update the migration metadata record table.
在一些实现方式中,服务器100可以将当前扫描的数据块从源数据存储区域迁移至目标存储区域。In some implementation manners, the server 100 may migrate the currently scanned data block from the source data storage area to the target storage area.
例如,当源数据存储区域与目标存储区域存储在同一个服务器100上时,当前扫描的数据块的在源数据存储区域中的逻辑地址为L1,逻辑地址L1所对应的物理地址为W1,其映射关系为逻辑地址L1映射物理地址W1。For example, when the source data storage area and the target storage area are stored on the same server 100, the logical address of the currently scanned data block in the source data storage area is L1, and the physical address corresponding to the logical address L1 is W1, which The mapping relationship is that the logical address L1 is mapped to the physical address W1.
服务器100将当前扫描的数据块从源数据存储区域迁移至目标存储区域可以是指将当前扫描的数据块的逻辑地址由源数据存储区域中的逻辑地址L1改为目标存储区域中的逻辑地址L2,并且将映射关系改为逻辑地址L2映射物理地址W1。Migrating the currently scanned data block from the source data storage area to the target storage area by the server 100 may refer to changing the logical address of the currently scanned data block from the logical address L1 in the source data storage area to the logical address L2 in the target storage area , and change the mapping relationship to logical address L2 mapping physical address W1.
可选的,当前扫描的数据块迁移前后在服务器100中所存储的两个物理地址可以相同的,也可以是不同的。在本申请实施例中,对此不作限制。Optionally, the two physical addresses stored in the server 100 before and after migration of the currently scanned data block may be the same or different. In the embodiment of the present application, there is no limitation to this.
在一些实现方式中,服务器100在完成当前扫描的数据块从源数据存储区域迁移至目标存储区域后,可以更新迁移元数据记录表。In some implementation manners, the server 100 may update the migration metadata record table after completing the migration of the currently scanned data block from the source data storage area to the target storage area.
例如,当前扫描的数据块从源数据存储区域迁移至目标存储区域之后,在迁移元数据记录表的状态可以由“N”转换为“Y”。For example, after the currently scanned data block is migrated from the source data storage area to the target storage area, the state of the migration metadata record table may change from "N" to "Y".
图8示出了本申请实施例中提供的一种后台数据迁移方法的流程示意图。该流程示意图以对象存储为例。值得说明的是,后台数据迁移方法所针对的源数据存储区域具有迁移指令,下述具体步骤中不再判断是否具有迁移指令。FIG. 8 shows a schematic flowchart of a background data migration method provided in the embodiment of the present application. This flowchart uses object storage as an example. It is worth noting that the source data storage area targeted by the background data migration method has a migration instruction, and whether there is a migration instruction is no longer judged in the following specific steps.
S801、按顺序遍历待迁移的源数据存储区域,判断当前扫描的单个对象是否已经完成迁移。S801. Traverse the source data storage areas to be migrated in order, and determine whether the currently scanned single object has been migrated.
在一些实现方式中,服务器100可以按顺序遍历待迁移的源数据存储区域。In some implementation manners, the server 100 may sequentially traverse the source data storage areas to be migrated.
例如,待迁移的源数据存储区域为数据1-数据100共100个对象,则服务器100从数据1开始扫描直到数据100,并判断每一个对象是否已经完成迁移。For example, the source data storage area to be migrated is data 1-data 100, a total of 100 objects, then the server 100 scans from data 1 to data 100, and determines whether each object has been migrated.
在一些实现方式中,服务器100可以判断当前扫描的单个对象是否已经完成迁移。In some implementation manners, the server 100 may determine whether the currently scanned single object has been migrated.
例如,若在迁移元数据记录表中,当前扫描的单个对象对应的状态为“Y”,则可以判断出当前扫描的单个对象已经完成迁移;For example, if in the migration metadata record table, the status corresponding to the currently scanned single object is "Y", it can be judged that the currently scanned single object has been migrated;
若在迁移元数据记录表中,当前扫描的单个对象对应的状态为“N”,则可以判断出当前扫描的单个对象未迁移或正在迁移中并且还未完成迁移。If in the migration metadata record table, the status corresponding to the currently scanned single object is "N", it can be determined that the currently scanned single object has not been migrated or is being migrated and the migration has not been completed.
当服务器100判断出当前扫描的单个对象已经完成迁移时,当前扫描的单个对象在迁移元数据记录表中的状态为“Y”,当前扫描的单个对象无需再次从源数据存储区域迁移至目标存储区域,则扫描源数据存储区域中当前单个对象的下一个数据块。When the server 100 determines that the currently scanned single object has been migrated, the status of the currently scanned single object in the migration metadata record table is "Y", and the currently scanned single object does not need to be migrated from the source data storage area to the target storage area again region, the next data block of the current single object in the source data storage region is scanned.
例如,待迁移的源数据存储区域为数据1-数据100共100个对象,服务器100判断数据1已经完成迁移,则服务器100扫描数据2,判断数据2是否已完成迁移。For example, the source data storage area to be migrated is data 1-data 100, a total of 100 objects, and the server 100 judges that data 1 has been migrated, then the server 100 scans data 2 to determine whether data 2 has been migrated.
当服务器100判断出当前扫描的单个对象未进行迁移时,当前扫描的单个对象在迁移元数据记录表中的状态为“N”,则执行S802。When the server 100 determines that the currently scanned single object has not been migrated, and the status of the currently scanned single object in the migration metadata record table is "N", then S802 is executed.
S802、判断当前扫描的单个对象是否正在处理中。S802. Determine whether the currently scanned single object is being processed.
在一些实现方式中,服务器100可以判断当前扫描的单个对象是否正在处理中,即判断当前扫描的单个对象是否正在进行迁移。In some implementation manners, the server 100 may determine whether the currently scanned single object is being processed, that is, determine whether the currently scanned single object is being migrated.
在一种可能的实现方式中,若当前扫描的单个对象处于正在迁移但没有完全迁移完毕的情况下,迁移元数据记录表可以记录当前扫描的单个对象的状态可以为“N+”。In a possible implementation, if the currently scanned single object is being migrated but not completely migrated, the migration metadata recording table may record that the status of the currently scanned single object may be "N+".
在本申请实施例中,除了上述方法还存在其他可以判断单个对象是否正在进行迁移,对此不作限定。In this embodiment of the present application, besides the above methods, there are other methods that can determine whether a single object is being migrated, which is not limited.
当服务器100判断当前扫描的单个对象正在进行迁移,当前扫描的单个对象无需再次从源数据存储区域迁移至目标存储区域,则执行S801,扫描源数据存储区域中当前单个对象的下一个对象。When the server 100 judges that the currently scanned single object is being migrated, and the currently scanned single object does not need to be migrated from the source data storage area to the target storage area again, S801 is executed to scan the next object of the current single object in the source data storage area.
例如,待迁移的源数据存储区域为数据1-数据100共100个对象,服务器100判断数据1正在进行迁移,则服务器100扫描数据2,判断数据2是否已完成迁移。For example, the source data storage area to be migrated is data 1-data 100, a total of 100 objects, and the server 100 judges that data 1 is being migrated, then the server 100 scans data 2 to determine whether data 2 has been migrated.
当服务器100判断当前扫描的单个对象没有正在进行迁移,则执行S803。When the server 100 determines that the currently scanned single object is not being migrated, S803 is executed.
S803、从源数据存储区域中读取出当前扫描的单个对象,将该单个对象迁移至目标存储区域,并更新迁移元数据记录表。S803. Read the currently scanned single object from the source data storage area, migrate the single object to the target storage area, and update the migration metadata record table.
在一些实现方式中,服务器100可以将当前扫描的单个对象从源数据存储区域迁移至目标存储区域。In some implementations, the server 100 can migrate the currently scanned single object from the source data storage area to the target storage area.
例如,当源数据存储区域与目标存储区域存储在同一个服务器100上时,当前扫描的单个对象的在源数据存储区域中的逻辑地址为L1,逻辑地址L1所对应的物理地址为W1,其映射关系为逻辑地址L1映射物理地址W1。服务器100将当前扫描的单个对象从源数据存储区域迁移至目标存储区域可以是指将当前扫描的单个对象的逻辑地址由源数据存储区域中的逻辑地址L1改为目标存储区域中的逻辑地址L2,并且将映射关系改为逻辑地址L2映射物理地址W1。For example, when the source data storage area and the target storage area are stored on the same server 100, the logical address of the currently scanned single object in the source data storage area is L1, and the physical address corresponding to the logical address L1 is W1, which The mapping relationship is that the logical address L1 is mapped to the physical address W1. Migrating the currently scanned single object from the source data storage area to the target storage area by the server 100 may refer to changing the logical address of the currently scanned single object from the logical address L1 in the source data storage area to the logical address L2 in the target storage area , and change the mapping relationship to logical address L2 mapping physical address W1.
可选的,当前扫描的单个对象迁移前后在服务器100中所存储的两个物理地址可以相同的,也可以是不同的。在本申请实施例中,对此不作限制。Optionally, the two physical addresses stored in the server 100 before and after migration of the currently scanned single object may be the same or different. In the embodiment of the present application, there is no limitation to this.
在一些实现方式中,服务器100在完成当前扫描的单个对象从源数据存储区域迁移至目标存储区域后,可以更新迁移元数据记录表。In some implementation manners, the server 100 may update the migration metadata record table after the currently scanned single object is migrated from the source data storage area to the target storage area.
例如,当前扫描的单个对象从源数据存储区域迁移至目标存储区域之后,在迁移元数据记录表的状态可以由“N”转换为“Y”。For example, after the currently scanned single object is migrated from the source data storage area to the target storage area, the status of the migration metadata record table may be changed from "N" to "Y".
实施上述方法,在数据读写的过程中完成了对应的数据的迁移,剩余的数据通过后台的迁移任务来迁移。By implementing the above method, the corresponding data migration is completed during the process of data reading and writing, and the remaining data is migrated through background migration tasks.
这样可以在保证数据迁移正确且完整的情况下,提高了在线迁移的效率。且减少了数据源的读请求,提高了存储介质的寿命。In this way, the efficiency of online migration can be improved while ensuring correct and complete data migration. Moreover, the read request of the data source is reduced, and the service life of the storage medium is improved.
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。Various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solidstate disk,SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), and the like.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments are realized. The processes can be completed by computer programs to instruct related hardware. The programs can be stored in computer-readable storage media. When the programs are executed , may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk, and other various media that can store program codes.
总之,以上所述仅为本发明技术方案的实施例而已,并非用于限定本发明的保护范围。凡根据本发明的揭露,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。In a word, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. All modifications, equivalent replacements, improvements, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211292048.5ACN115729463A (en) | 2022-10-20 | 2022-10-20 | Method, system and related device for data migration |
| PCT/CN2023/117343WO2024082857A1 (en) | 2022-10-20 | 2023-09-06 | Data migration method and system, and related apparatus |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211292048.5ACN115729463A (en) | 2022-10-20 | 2022-10-20 | Method, system and related device for data migration |
| Publication Number | Publication Date |
|---|---|
| CN115729463Atrue CN115729463A (en) | 2023-03-03 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211292048.5APendingCN115729463A (en) | 2022-10-20 | 2022-10-20 | Method, system and related device for data migration |
| Country | Link |
|---|---|
| CN (1) | CN115729463A (en) |
| WO (1) | WO2024082857A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2024082857A1 (en)* | 2022-10-20 | 2024-04-25 | 超聚变数字技术有限公司 | Data migration method and system, and related apparatus |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180349037A1 (en)* | 2017-06-02 | 2018-12-06 | EMC IP Holding Company LLC | Method and device for data read and write |
| CN111273872A (en)* | 2020-02-14 | 2020-06-12 | 北京百度网讯科技有限公司 | Data migration method, device, equipment and medium |
| CN111913663A (en)* | 2020-07-29 | 2020-11-10 | 星辰天合(北京)数据科技有限公司 | Method and device for online storage volume migration, and system for online storage volume migration |
| CN112783449A (en)* | 2021-01-25 | 2021-05-11 | 中国工商银行股份有限公司 | Data migration method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102073462B (en)* | 2010-11-29 | 2013-04-17 | 华为技术有限公司 | Virtual storage migration method and system and virtual machine monitor |
| JP5720483B2 (en)* | 2011-08-11 | 2015-05-20 | 富士通株式会社 | Migration program, migration apparatus, and migration method |
| CN104899218B (en)* | 2014-03-06 | 2018-12-28 | 腾讯科技(深圳)有限公司 | Data read-write method and data read-write equipment |
| CN107402722B (en)* | 2017-07-04 | 2020-09-01 | 杭州宏杉科技股份有限公司 | A data migration method and storage device |
| CN112578997B (en)* | 2019-09-30 | 2022-07-22 | 华为云计算技术有限公司 | A data migration method, system and related equipment |
| US11281390B2 (en)* | 2020-03-13 | 2022-03-22 | EMC IP Holding Company LLC | Techniques for data migration |
| CN111427514B (en)* | 2020-03-27 | 2022-04-22 | 杭州宏杉科技股份有限公司 | View migration method and device |
| CN113867645B (en)* | 2021-09-30 | 2023-08-18 | 苏州浪潮智能科技有限公司 | Data migration and data reading and writing method, device, computer equipment and storage medium |
| CN115729463A (en)* | 2022-10-20 | 2023-03-03 | 超聚变数字技术有限公司 | Method, system and related device for data migration |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180349037A1 (en)* | 2017-06-02 | 2018-12-06 | EMC IP Holding Company LLC | Method and device for data read and write |
| CN111273872A (en)* | 2020-02-14 | 2020-06-12 | 北京百度网讯科技有限公司 | Data migration method, device, equipment and medium |
| CN111913663A (en)* | 2020-07-29 | 2020-11-10 | 星辰天合(北京)数据科技有限公司 | Method and device for online storage volume migration, and system for online storage volume migration |
| CN112783449A (en)* | 2021-01-25 | 2021-05-11 | 中国工商银行股份有限公司 | Data migration method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2024082857A1 (en)* | 2022-10-20 | 2024-04-25 | 超聚变数字技术有限公司 | Data migration method and system, and related apparatus |
| Publication number | Publication date |
|---|---|
| WO2024082857A1 (en) | 2024-04-25 |
| Publication | Publication Date | Title |
|---|---|---|
| US11086725B2 (en) | Orchestration of heterogeneous multi-role applications | |
| KR102240557B1 (en) | Method, device and system for storing data | |
| US11113158B2 (en) | Rolling back kubernetes applications | |
| US11321291B2 (en) | Persistent version control for data transfer between heterogeneous data stores | |
| US8386707B2 (en) | Virtual disk management program, storage device management program, multinode storage system, and virtual disk managing method | |
| US11347684B2 (en) | Rolling back KUBERNETES applications including custom resources | |
| US20210374107A1 (en) | Distributed file system and distributed file managing method | |
| US12099886B2 (en) | Techniques for performing clipboard-to-file paste operations | |
| US11977520B2 (en) | Recovering from a pending uncompleted reorganization of a data set | |
| US12417149B2 (en) | Service cluster instance backup and recovery methods and related devices | |
| US11157456B2 (en) | Replication of data in a distributed file system using an arbiter | |
| CN115729463A (en) | Method, system and related device for data migration | |
| CN112262378A (en) | Hydration of a hierarchy of dehydrated documents | |
| CN114328007A (en) | Container backup and restoration method, device and medium thereof | |
| CN114490540B (en) | Data storage method, medium, device and computing equipment | |
| US10685046B2 (en) | Data processing system and data processing method | |
| CN112084141B (en) | A method, device, equipment and medium for expanding full-text search system | |
| US20250110928A1 (en) | Data processing method and related apparatus | |
| CN114676093B (en) | File management method and device, electronic equipment and storage medium | |
| US11379147B2 (en) | Method, device, and computer program product for managing storage system | |
| WO2024001280A1 (en) | Data flow perception method and related apparatus | |
| CN117235027A (en) | Database system, database log archiving method and device | |
| US10305723B1 (en) | Methods and apparatus for selecting a read mechanism | |
| CN120523810A (en) | Data management method, device and readable storage medium | |
| CN117009346A (en) | Database table structure changing method, device, equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |