Data migration method and device, medium and equipment

Data migration is triggered by client data service requests, and stock storage nodes are used to process and migrate data to incremental storage nodes. This solves the problem of long storage system expansion time and achieves rapid expansion and improved stability.

CN118732923APending Publication Date: 2024-10-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310318960.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing storage systems require a large amount of data copying and relocation when expanding their capacity. As a result, the expansion cannot be completed in a short time and cannot support the sustainable development of the business.

Method used

Data migration is triggered by the data service request sent by the client, and the stock storage node is used to process the target key-value data and migrated to the incremental storage node to achieve rapid expansion of the storage system and avoid additional data copy processes.

Benefits of technology

It achieves rapid expansion of the storage system, allocates data service requests to incremental storage nodes for processing, and improves the stability and responsiveness of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118732923A_ABST
    Figure CN118732923A_ABST
Patent Text Reader

Abstract

The invention discloses a data migration method and device, a medium and equipment, and relates to the technical field of storage, and the method comprises the steps: obtaining a first data service request sent by a client; the first data service request comprises target key name data; in response to the first data service request, performing data processing by at least one stock storage node to obtain target key value data corresponding to the target key name data; and under the condition that the target key name data is any to-be-migrated key name data in a preset key name data list, migrating the target key name data and the corresponding target key value data to at least one incremental storage node. According to the method, data migration is triggered through the data service request, data copying is not needed, and rapid capacity expansion is achieved under the condition that service is not stopped.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a data migration method, device, medium and equipment. Background Art

[0002] Storage systems are often unable to support the continued development of business due to insufficient capacity, and how to expand capacity stably and quickly has become a difficult problem in the industry. In related technologies, the expansion solution for storage systems mainly uses third-party tools to trigger expansion, which involves copying and relocating a large amount of data and cannot be completed in a short time. Summary of the invention

[0003] In order to quickly expand the storage system, the present application provides a data migration method, device, medium and equipment. The technical solution is as follows:

[0004] In a first aspect, the present application provides a data migration method, the method comprising:

[0005] Obtaining a first data service request sent by a client; the first data service request includes target key name data;

[0006] In response to the first data service request, at least one stock storage node performs data processing to obtain target key value data corresponding to the target key name data;

[0007] In the case that the target key name data is any key name data to be migrated in the preset key name data list, the target key name data and the corresponding target key value data are migrated to at least one incremental storage node.

[0008] In a second aspect, the present application provides a data migration device, the device comprising:

[0009] A request acquisition module, used to acquire a first data service request sent by a client; the first data service request includes target key name data;

[0010] a response processing module, configured to respond to the first data service request, and to cause at least one stock storage node to perform data processing to obtain target key value data corresponding to the target key name data;

[0011] The data migration module is used to migrate the target key name data and the corresponding target key value data to at least one incremental storage node when the target key name data is any key name data to be migrated in the preset key name data list.

[0012] In a third aspect, the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the data migration method as described in the first aspect.

[0013] In a fourth aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the data migration method as described in the first aspect.

[0014] In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes computer instructions, and when the computer instructions are executed by a processor, the data migration method as described in the first aspect is implemented.

[0015] The data migration method, device, medium and equipment provided by this application have the following technical effects:

[0016] After obtaining the first data service request including the target key name data sent by the client, the solution provided by the present application, in addition to having at least one existing storage node process the data to obtain the target key value data corresponding to the target key name data, will also migrate the target key name data and the corresponding target key value data to at least one incremental storage node when the target key name data is any key name data to be migrated in the preset key name data list. That is, the solution provided by the present application is to trigger the data migration during capacity expansion through the first data service request sent by the client, and while responding normally to the data service request of the client, data migration can be performed without copying data separately, thereby realizing rapid capacity expansion of the storage system, and then the data service request can be distributed to the incremental storage nodes for processing, greatly improving the stability of the storage system.

[0017] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 It is a schematic diagram of an implementation environment of a data migration method provided in an embodiment of the present application;

[0020] Figure 2 is a flow chart of a data migration method provided in an embodiment of the present application;

[0021] Figure 3 This is a schematic diagram of a process of data migration matching a request type and a first identifier provided in an embodiment of the present application;

[0022] Figure 4 It is a data migration flow chart provided by an embodiment of the present application when the request type is a write request and the first identifier indicates that the historical write record does not exist;

[0023] Figure 5 It is a data migration flow chart provided by an embodiment of the present application when the request type is a write request or a read request and the first identifier indicates that a historical write record exists;

[0024] Figure 6 is a processing flow chart provided by an embodiment of the present application when the request type is a read request and the first identifier indicates that the historical write record does not exist;

[0025] Figure 7 It is a schematic diagram of a data migration process for key name data to be migrated that has not been requested in a preset key name data list provided by an embodiment of the present application;

[0026] Figure 8 This is a schematic diagram of a business processing flow in a data migration process provided by an embodiment of the present application;

[0027] Fig. 9 This is a schematic diagram of a processing flow in the case of abnormal expansion provided by an embodiment of the present application;

[0028] Fig.10 is a schematic diagram of a data migration device provided in an embodiment of the present application;

[0029] Fig.11 It is a schematic diagram of the hardware structure of a device for implementing a data migration method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to quickly expand the storage system, the embodiments of the present application provide a data migration method, device, medium and equipment. The technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of this application. Examples of the embodiments are shown in the drawings, where the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] See also Figure 1 , which is a schematic diagram of an implementation environment of a data migration method provided in an embodiment of the present application, such as Figure 1 As shown, the implementation environment may include at least a client 01 , a server 02 and a server 03 .

[0033] Specifically, the client 01 may include devices such as smart phones, desktop computers, tablet computers, laptops, vehicle terminals, digital assistants, smart wearable devices, and voice interaction devices, and may also include software running in the device, such as web pages provided by some service providers to users, or applications provided by these service providers to users. Specifically, the client 01 may be used to generate a first data service request and send it to the server 02, wherein the first data service request includes target key name data, which is used to request target key value data corresponding to the target key name data.

[0034] Specifically, the server 02 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server 02 may include a network communication unit, a processor, a memory, and so on. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. Specifically, if Figure 1 As shown, the server 02 includes multiple stock storage nodes before the storage system is expanded, namely, stock storage node 1, stock storage node 2, and stock storage node 3. The server 02 can be used to respond to the first data service request sent by the client, obtain the corresponding target key value data, and execute a proxy write or forward request according to the request type and the type of the target key name data to write the target key name data and the target key value data to the server 03.

[0035] Specifically, the server 03 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server 03 may include a network communication unit, a processor, a memory, and so on. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. Specifically, if Figure 1 As shown, the server 03 includes multiple incremental storage nodes after storage expansion, namely incremental storage node 1, incremental storage node 2 and incremental storage node 3. The server 03 can be used to store key name data to be migrated and corresponding key value data. In the case where the target key name data included in the first data service request is any key name data to be migrated in the preset key name data list, the target key name data and the target key value data obtained by the server 02 are stored in the server 03 to realize data migration and system expansion.

[0036] In addition, in addition to using the first data service request sent by the client 01 to trigger data migration, the data migration process can also be used to trigger migration processing of inactive key name data (no data service request for the key name data is received within a certain period of time).

[0037] The embodiments of the present application can also be implemented in combination with cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software and network in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. It can also be understood as a general term for network technology, information technology, integration technology, management platform technology and application technology based on cloud computing business model applications. Cloud technology needs to be supported by cloud computing. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". Specifically, the server 02 and the server 03 are located in the cloud, and the server 02 and the server 03 can be physical machines or virtualized machines.

[0038] See also Figure 2 , which is a flow chart of a data migration method provided in an embodiment of the present application. The present application provides method operation steps as described in the embodiment or flow chart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, in a parallel processor or multi-threaded processing environment). Please refer to Figure 2 A data migration method provided in an embodiment of the present application may include the following steps:

[0039] S210: Acquire a first data service request sent by a client; the first data service request includes target key name data.

[0040] In the current network business scenarios, data business requests for some key names in the storage system often increase suddenly, causing the machine resources of the current storage system to reach the processing bottleneck, and it is urgent to expand the capacity quickly to ensure the stability of the storage system. The storage system provides storage services based on key-value pairs (key-value, key name-key value), and the storage system can be a database such as Redis and RocksDB.

[0041] In the embodiment of the present application, the data migration during capacity expansion is triggered by the first data service request sent by the client, that is, the capacity expansion can be implemented without stopping the service. The first data service request includes the target key name data, and the first data service request is used to request the key value data corresponding to the target key name data from the storage system.

[0042] S220: In response to the first data service request, at least one existing storage node performs data processing to obtain target key value data corresponding to the target key name data.

[0043] In an embodiment of the present application, at least one stock storage node is a machine resource configured by the storage system before capacity expansion. When the target key name data has not been migrated, the target key name data is stored in at least one stock storage node, so it is necessary to route the first data service request for the target key name data to at least one stock storage node, perform corresponding data processing in at least one stock storage node, such as data reading processing or data writing processing, to obtain key value data corresponding to the target key name data, that is, the target key value data.

[0044] In an embodiment of the present application, in response to a first data service request sent by a client, the target key-value data is returned to the client to meet the data service demand of the client.

[0045] S230: When the target key name data is any key name data to be migrated in the preset key name data list, migrate the target key name data and the corresponding target key value data to at least one incremental storage node.

[0046] In an embodiment of the present application, at least one incremental storage node is a machine resource newly added when the storage system is expanded. After the target key name data and the corresponding target key value data are migrated to at least one incremental storage node, if a data service request for the target key name data is received again, the data service request will be routed to at least one incremental storage node for processing, reducing the service pressure of at least one existing storage node and improving the stability of the entire storage system.

[0047] In an embodiment of the present application, when the target key name data is any key name data to be migrated in the preset key name data list, the target key name data and the target key value data corresponding to the target key name data obtained after processing are stored in at least one incremental storage node, so as to realize the migration of the key value pair data of the target key name data and the target key value data. That is, the embodiment of the present application triggers data migration through the data service request of the client, and uses the processing result of the request as the key value data to be migrated, which saves the separate data reading and copying process, improves the efficiency of data migration, and can realize rapid capacity expansion without stopping the service.

[0048] In one embodiment of the present application, the preset key name data list may include the full amount of key name data stored by at least one existing storage node, or part of the key name data in the full amount of key name data, such as the full amount of key name data may be subjected to consistent hash calculation, and part of the key name data may be screened out as the key name data to be migrated according to the calculation result. In another embodiment of the present application, it is also possible to directly determine whether the target key name data is the key name data to be migrated based on the result of consistent hash calculation performed on the target key name data, without predetermining the preset key name data list.

[0049] In the embodiment of the present application, different types of data service requests and different types of target key name data will have different migration processing logics to ensure the accuracy of data storage and processing. Figure 3 As shown, step S230 may include the following steps:

[0050] S310: Determine a request type of a first data service request.

[0051] The request type may be a read request or a write request.

[0052] S320: Determine a first identifier corresponding to the target key name data, where the first identifier indicates whether there is a historical write record corresponding to the target key name data.

[0053] When the first identifier indicates that there is no historical write record corresponding to the target key name data, the target key name data can be called a new key, that is, the corresponding target key value data is empty.

[0054] When the first identifier indicates that there is a historical write record corresponding to the target key name data, the target key name data can be called an old key, that is, the corresponding target key value data is not empty.

[0055] The historical write record may be source information such as write time and version number.

[0056] Feasibly, the first identifier may be stored separately in a data file of the management node in the storage system.

[0057] S330: Generate a target processing instruction that matches the request type and the first identifier.

[0058] S340: Execute the target processing instruction to write the target key name data and the corresponding target key value data to at least one incremental storage node.

[0059] In the above embodiment, the processing logic of the target processing instruction matches the request type and the first identifier, and whether it is a read request or a write request, a new key or an old key, accurate consistency can be guaranteed during the data migration process.

[0060] Figure 4 1 is a data migration flow chart provided by an embodiment of the present application when the request type is a write request and the first identifier indicates that the historical write record does not exist. Figure 4 As shown, data migration may include the following steps:

[0061] S410: Acquire a first data service request sent by a client; the first data service request includes target key name data.

[0062] S420: In response to the first data service request, at least one existing storage node performs data processing to obtain target key value data corresponding to the target key name data.

[0063] S430: pre-generate a second identifier corresponding to the target key name data, the second identifier indicating that the data has been migrated.

[0064] S440: Route the first data service request to at least one incremental storage node.

[0065] S450: At least one incremental storage node performs write processing to obtain target key name data and corresponding target key value data stored in at least one incremental storage node.

[0066] It is feasible that, when the target key name data has not been migrated, the management node of the storage system routes the first data service request sent by the client to at least one stock storage node, and at least one stock storage node responds to and processes the first data service request. When the request type is a write request and the first identifier indicates that the historical write record does not exist, that is, at least one stock storage node writes the data, the target key name data and the corresponding target key value data are temporarily stored in at least one stock storage node. The first data service request is then routed to at least one incremental storage node, and at least one incremental storage node performs the write processing again, and the target key name data and the corresponding target key value data are also stored in at least one incremental storage node.

[0067] In the above embodiment, the second identifier is used to indicate that the target key name data and the corresponding target key value data have been migrated. In a feasible implementation, it is also possible to determine whether the target key name data is the key name data to be migrated based on whether the target key name data has a corresponding second identifier. Considering that the write process after the request jump may be interrupted due to node downtime, restart, etc. during the write process, in the above embodiment, the target key name data is pre-marked with a second identifier after at least one existing storage node completes data processing. If downtime or restart occurs during the write processing of at least one incremental storage node, information indicating that the write failed is returned to the client; if the client sends a read request for the target key name data again, since the target key name data has a corresponding second identifier, the read request will be routed to at least one incremental storage node, and information indicating that the write is empty will be returned to the client to ensure data consistency of the read business; if the client sends a write request for the target key name data again, since the target key name data has a corresponding second identifier, the write request will be routed to at least one incremental storage node and directly write processing will be performed.

[0068] In the above embodiment, when the request type is a write request and the first identifier indicates that the historical write record does not exist, the routing request is used to complete the write processing on at least one existing storage node and at least one incremental storage node, which can not only respond to the client's first data service request, but also complete the storage of the key-value pair data on the incremental storage node. At the same time, the second identifier is used to identify that the migration of this group of key-value pair data has been completed, so that subsequent data service requests for the target key name data can be routed to the incremental storage node according to the second identifier, thereby balancing the service pressure of the storage system.

[0069] Figure 5 1 is a data migration flow chart provided by an embodiment of the present application when the request type is a write request or a read request and the first identifier indicates that a historical write record exists. Figure 5 As shown, data migration may include the following steps:

[0070] S510: Obtain a first data service request sent by a client; the first data service request includes target key name data.

[0071] S520: In response to the first data service request, at least one existing storage node performs data processing to obtain target key value data corresponding to the target key name data.

[0072] S530: Based on the target key name data and the consistent hashing algorithm, determine a first stock storage node corresponding to the target key name data from at least one stock storage node.

[0073] S540: The first existing storage node performs write processing on at least one incremental storage node to obtain target key name data and corresponding target key value data stored in the at least one incremental storage node.

[0074] S550: Generate a second identifier corresponding to the target key name data, where the second identifier indicates that the data has been migrated.

[0075] In the above embodiment, when the target key name data has not been migrated, the management node of the storage system routes the first data service request sent by the client to at least one stock storage node, and at least one stock storage node processes the first data service request. When the request type is a write request and the first identifier indicates that a historical write record exists, that is, at least one stock storage node writes the data, and the target key name data and the corresponding target key value data are temporarily stored in at least one stock storage node. When the request type is a read request and the first identifier indicates that a historical write record exists, the target key value data is read from at least one stock storage node.

[0076] The key-value pair-based storage system generally adopts a multi-copy architecture. For the target key name data, a set of key-value pair data including the target key name data and the target key value data will be stored in multiple nodes. If there are multiple data service requests for the target key name data, and multiple nodes simultaneously perform proxy write processing, concurrent competition will occur on at least one incremental storage node, resulting in data confusion. Therefore, in the above embodiment, it is limited that the first stock storage node that uniquely corresponds to the target key name data can perform proxy write processing, and other stock storage nodes cannot perform proxy write processing. Specifically, the target key name data of string type can be converted into int64 format, and then a hash calculation is performed based on the consistent hashing algorithm to determine the stock storage node that matches the hash calculation result as the first stock storage node.

[0077] The target key name data corresponds to a historical write record. For write requests, if data migration is performed in the following order: write processing is performed in at least one existing storage node - a second identifier of the target key name data is pre-generated - and then the request is redirected to at least one incremental storage node for write processing, the key value data corresponding to the target key name data stored in at least one existing storage node and at least one incremental storage node may be different due to reasons such as the downtime or restart of the incremental storage node, resulting in inconsistent reading. For read requests, if the target key value data is carried from at least one existing storage node to at least one incremental storage node and written through a first data service request, the reading process and the migration process may be coupled, increasing the complexity. Therefore, in the above embodiment, data migration is performed in the order of data processing on at least one existing storage node - writing processing on at least one incremental storage node by the existing storage node - generating a second identifier corresponding to the target key name data. This can ensure that after the corresponding second identifier exists in the target key name data, the target key value data must be present in at least one incremental storage node for subsequent reading by the client, thereby ensuring data read consistency. In addition, if there are concurrent write requests for the target key name data, after a write request is responded to and the uniquely corresponding first existing storage node completes the proxy write processing on at least one incremental storage node, other write requests do not need to perform corresponding data migration, but will be routed to at least one incremental storage node for write processing, thereby avoiding data processing conflicts that may be caused by concurrent requests. At the same time, the existing storage node is used as a proxy node to write to at least one incremental storage node, so that the data reading process of at least one existing storage node is decoupled from the data migration process, thereby reducing complexity.

[0078] Figure 6 1 is a processing flow chart provided by an embodiment of the present application when the request type is a read request and the first identifier indicates that the historical write record does not exist. Figure 6 As shown, the method may also include:

[0079] S610: In response to the first data service request, data reading processing is performed on at least one existing storage node to obtain service response data, where the service response data indicates that target key value data corresponding to the target key name data does not exist.

[0080] S620: Send the service response data to the client.

[0081] In the above embodiment, if the target key name data is a new key, there is no target key value data corresponding to the target key name data, and it is impossible to perform new write processing by jumping the first data service request or using the proxy node. Therefore, when the request type is a read request and the first identifier indicates that the historical write record does not exist, data migration is not triggered, and only a response is made based on the data reading result.

[0082] Figure 7 1 is a schematic diagram of a data migration process for key name data to be migrated that has not been requested in a preset key name data list provided by an embodiment of the present application. Figure 7 As shown, the method also includes:

[0083] S710: Execute a preset data migration process, traverse the key name data list, and generate a migration request for the currently traversed key name data.

[0084] S720: In response to the migration request, when there is no corresponding second identifier for the currently traversed key name data, read the current key value data corresponding to the currently traversed key name data; the second identifier indicates that it has been migrated.

[0085] S730: Write the current traversal key name data and the corresponding current key value data to at least one incremental storage node.

[0086] S740: After the writing is successful, a second identifier corresponding to the currently traversed key name data is generated.

[0087] It is understandable that there will be inactive key name data to be migrated in the preset key name data list, that is, no data service request for the key name data to be migrated is received within a certain period of time, and data migration cannot be triggered by the data service request, so another data migration process is required to complete the migration processing of the inactive key name data to be migrated. Among them, the data migration process can be a daemon process (Deamon), and the management node of the storage system executes the data migration process to trigger the migration of the inactive key name data to be migrated. The data migration process obtains all the key name data to be migrated by scanning the data file corresponding to the key name data list, and then initiates a migration request for the key name data one by one. The storage system responds to the migration request and determines whether there is a corresponding second identifier representing the migration of the current traversal key name data. If it exists, the current traversal key name data is skipped. If it does not exist, the corresponding current key value data will be read and written to at least one incremental storage node, and the second identifier will be generated after the write is successful, until all the key name data to be migrated in the key name data list complete the data migration and there is a corresponding second identifier.

[0088] In the above embodiment, the data migration process is used to actively initiate the data migration process for inactive key name data. The key name data that was triggered by a data service request but failed to migrate can also be migrated again to complete the migration processing of all key name data to be migrated in the preset key name data list.

[0089] exist Figure 3 , Figure 4 , Figure 5 and Figure 7 In the disclosed embodiment, writing to at least one incremental storage node can be specifically executed as follows: determining a target incremental storage node, the target incremental storage node being any one of at least one incremental storage node, and if feasible, the target incremental storage node can uniquely correspond to the target key name data; writing the target key name data and the target key value data into the target incremental storage node; the target incremental storage node synchronizes the target key name data and the target key value data to other incremental storage nodes.

[0090] In one embodiment of the present application, in addition to writing the target key name data and the target key value data to at least one incremental storage node, the data migration during the expansion process may also include cleaning up the target key name data and the target key value data stored in at least one existing storage node.

[0091] Specifically, after writing the target key name data and the corresponding target key value data to at least one incremental storage node, the target key name data and the corresponding target key value data stored in at least one stock storage node may be deleted. That is, each time a group of key-value pair data is migrated, the corresponding cleanup process is performed synchronously.

[0092] Specifically, after completing the migration processing of all key name data to be migrated in the preset key name data list and confirming that the expansion is complete, all key name data and corresponding key value data in the preset key name data list may be cleaned up uniformly.

[0093] Specifically, a preset daemon process may be used to traverse a preset key name data list, and clean up the key name data that have completed the migration one by one.

[0094] In the above embodiment, the target key name data and target key value data stored in at least one existing storage node are cleaned up to complete the final capacity expansion, so that a part of the key-value pair data is transferred to the incremental storage node, and the request for this part of the key-value pair data will also be routed to the incremental storage node, thereby sharing the service pressure of the entire storage system, ensuring the stability of the storage system, and ensuring the response of data services.

[0095] In one embodiment of the present application, other data service requests may be received during the data migration process, such as Figure 8 As shown, the method may also include:

[0096] S240: Obtain a second data service request, where the second data service request includes target key name data.

[0097] S250: When the target key name data has been migrated, the second data service request is routed to at least one incremental storage node, so that the at least one incremental storage node performs data processing on the second data service request.

[0098] S260: When the target key name data has not been migrated, route the second data service request to at least one existing storage node, so that the at least one existing storage node performs data processing on the second data service request.

[0099] In the case where the target key name data has not been migrated, the second data service request can be used to trigger the corresponding data migration process.

[0100] It is feasible to determine whether the target key name data is migrated based on whether the corresponding second identifier exists.

[0101] In the above embodiment, when multiple service requests for the same target key name data appear, the storage node that performs the response processing is determined based on whether the target key name data has been migrated, thereby ensuring normal and accurate response of the data service.

[0102] In one embodiment of the present application, during the data migration process, there may be abnormal expansion, such as existing network problems, which require stopping expansion and performing data rollback processing. Fig. 9 As shown, the method may also include:

[0103] S240: Obtain a second data service request, where the second data service request includes target key name data.

[0104] S270: Routing the second data service request to at least one stock storage node, so that the at least one stock storage node performs data processing on the second data service request.

[0105] It is feasible that when an expansion anomaly occurs, a preset named data file is automatically generated, and if the data file exists, the second identifier is ignored and the data service request is routed to at least one existing storage node. The data content of the preset named data file may be empty.

[0106] In the above embodiment, in the event of an expansion anomaly, even if the target key data has a second identifier, the second data service request for the target key data still needs to be routed to at least one existing storage node to ensure normal response of the data service.

[0107] S280: Delete the second identifier corresponding to the target key name data.

[0108] S290: Delete the target key name data and the corresponding target key value data stored in at least one incremental storage node.

[0109] It is feasible that when an expansion anomaly occurs, the process can be used to trigger the cleaning of the second identifier to avoid routing subsequent data service requests to at least one incremental storage node; when an anomaly occurs, data rollback processing must be performed to delete the target key name data and the corresponding target key value data stored in at least one incremental storage node. Preferably, the data in at least one stock storage node is not cleaned up during the expansion process. At this time, at least one stock storage node still stores the latest data, and there is no need to rewrite at least one stock storage node.

[0110] In the above embodiment, in the face of abnormal situations, a data rollback process is executed to ensure data accuracy in the event of expansion failure.

[0111] In summary, after obtaining the first data service request including the target key name data sent by the client, the solution provided by the present application, in addition to processing the data by at least one existing storage node to obtain the target key value data corresponding to the target key name data, will also migrate the target key name data and the corresponding target key value data to at least one incremental storage node when the target key name data is any key name data to be migrated in the preset key name data list. That is, the solution provided by the present application is to trigger the data migration during capacity expansion through the first data service request sent by the client, and while responding normally to the data service request of the client, data migration can be performed without copying the data separately, thereby realizing rapid capacity expansion of the storage system, and then the data service request can be distributed to the incremental storage nodes for processing, greatly improving the stability of the storage system.

[0112] The present application also provides a data migration device 1000. Fig.10 As shown, the device 1000 may include:

[0113] The request acquisition module 1010 is used to acquire a first data service request sent by a client; the first data service request includes target key name data;

[0114] A response processing module 1020 is configured to respond to the first data service request by performing data processing by at least one stock storage node to obtain target key value data corresponding to the target key name data;

[0115] The data migration module 1030 is used to migrate the target key name data and the corresponding target key value data to at least one incremental storage node when the target key name data is any key name data to be migrated in the preset key name data list.

[0116] In one embodiment of the present application, the data migration module 1030 may include:

[0117] a request type determining unit, configured to determine a request type of the first data service request;

[0118] A first identifier determining unit, configured to determine a first identifier corresponding to the target key name data, wherein the first identifier indicates whether there is a historical write record corresponding to the target key name data;

[0119] An instruction generating unit, configured to generate a target processing instruction matching the request type and the first identifier;

[0120] An instruction execution unit is used to execute the target processing instruction to write the target key name data and the corresponding target key value data to the at least one incremental storage node.

[0121] In one embodiment of the present application, when the request type is a write request and the first identifier indicates that the historical write record does not exist, the instruction execution unit includes:

[0122] A first marking subunit is used to pre-generate a second identifier corresponding to the target key name data, wherein the second identifier indicates that the target key name data has been migrated;

[0123] The first writing sub-unit is used to route the first data service request to the at least one incremental storage node so that the at least one incremental storage node performs writing processing to obtain the target key name data and the corresponding target key value data stored in the at least one incremental storage node.

[0124] In one embodiment of the present application, when the request type is a write request or a read request, and the first identifier indicates that the historical write record exists, the instruction execution unit includes:

[0125] A write node selection subunit, configured to determine, based on the target key name data and a consistent hash algorithm, a first stock storage node corresponding to the target key name data from the at least one stock storage node;

[0126] A second writing subunit is used to perform writing processing on the at least one incremental storage node by the first stock storage node to obtain the target key name data and the corresponding target key value data stored in the at least one incremental storage node;

[0127] The second marking subunit is used to generate a second identifier corresponding to the target key name data, and the second identifier indicates that it has been migrated.

[0128] In one embodiment of the present application, when an expansion anomaly occurs, the device 1000 further includes:

[0129] A second identifier cleaning unit, used to delete the second identifier corresponding to the target key name data;

[0130] A data cleaning unit is used to delete the target key name data and the corresponding target key value data stored in the at least one incremental storage node.

[0131] In one embodiment of the present application, after migrating the target key name data and the corresponding target key value data to at least one incremental storage node, the apparatus 1000 further includes:

[0132] A request acquisition subunit, configured to acquire a second data service request, wherein the second data service request includes the target key name data;

[0133] The first routing subunit is used to route the second data service request to the at least one incremental storage node, so that the at least one incremental storage node performs data processing on the second data service request.

[0134] In one embodiment of the present application, when an expansion anomaly occurs, the device 1000 further includes:

[0135] The second routing subunit is used to route the second data service request to the at least one stock storage node, so that the at least one stock storage node performs data processing on the second data service request.

[0136] In one embodiment of the present application, when the request type is a read request and the first identifier indicates that the historical write record does not exist, the device further includes:

[0137] A response unit is used to respond to the first data service request, perform data reading processing on the at least one existing storage node, and obtain service response data, wherein the service response data indicates that the target key value data corresponding to the target key name data does not exist.

[0138] In one embodiment of the present application, the data migration module 1030 includes:

[0139] A deleting unit is used to delete the target key name data and the corresponding target key value data stored in the at least one existing storage node after writing the target key name data and the corresponding target key value data to the at least one incremental storage node.

[0140] In one embodiment of the present application, the device may further include:

[0141] A data migration process execution unit, used to execute a preset data migration process, traverse the key name data list, and generate a migration request for the currently traversed key name data;

[0142] A key value data reading unit, configured to respond to the migration request and read the current key value data corresponding to the current traversal key name data when there is no corresponding second identifier for the current traversal key name data; the second identifier indicates that the data has been migrated;

[0143] A data writing unit, used for writing the currently traversed key name data and the corresponding current key value data to the at least one incremental storage node;

[0144] The second identifier generating unit is used to generate the second identifier corresponding to the currently traversed key name data after writing is successful.

[0145] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0146] An embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a data migration method provided in the above method embodiment.

[0147] Fig.11 A schematic diagram of the hardware structure of a device for implementing a data migration method provided in an embodiment of the present application is shown, and the device may participate in or include the apparatus or system provided in an embodiment of the present application. Fig.11 As shown, the device 10 may include one or more (1002a, 1002b, ..., 1002n are used to illustrate) processors 1002 (the processor 1002 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1004 for storing data, and a transmission device 1006 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.11 The structure shown is for illustration only and does not limit the structure of the electronic device. Fig.11 More or fewer components as shown, or with Fig.11 Different configurations shown.

[0148] It should be noted that the one or more processors 1002 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the device 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0149] The memory 1004 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the methods in the embodiments of the present application. The processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004, that is, to implement the above-mentioned data migration method. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include a memory remotely arranged relative to the processor 1002, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0150] The transmission device 1006 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the device 10. In one example, the transmission device 1006 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 1006 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.

[0151] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of device 10 (or mobile device).

[0152] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a server to store at least one instruction or at least one program related to a data migration method in a method embodiment. The at least one instruction or the at least one program is loaded and executed by the processor to implement a data migration method provided in the above method embodiment.

[0153] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0154] The embodiment of the present invention further provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes a data migration method provided in the above various optional implementations.

[0155] It can be seen from the embodiments of the data migration method, device, medium and equipment provided by the present application that after obtaining the first data service request including the target key name data sent by the client, the solution provided by the present application, in addition to processing the data by at least one existing storage node to obtain the target key value data corresponding to the target key name data, will also migrate the target key name data and the corresponding target key value data to at least one incremental storage node when the target key name data is any key name data to be migrated in the preset key name data list. That is, the solution provided by the present application is to trigger data migration during capacity expansion through the first data service request sent by the client, and while responding normally to the data service request of the client, data migration can be performed without copying data separately, thereby realizing rapid capacity expansion of the storage system, and then the data service request can be distributed to the incremental storage nodes for processing, greatly improving the stability of the storage system.

[0156] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0157] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0158] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0159] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A data migration method, characterized in that: The method comprises: Obtaining a first data service request sent by a client; the first data service request includes target key name data; In response to the first data service request, at least one stock storage node performs data processing to obtain target key value data corresponding to the target key name data; In the case that the target key name data is any key name data to be migrated in the preset key name data list, the target key name data and the corresponding target key value data are migrated to at least one incremental storage node.

2. The method according to claim 1, characterized in that The step of migrating the target key name data and the corresponding target key value data to at least one incremental storage node includes: Determining a request type of the first data service request; Determine a first identifier corresponding to the target key name data, where the first identifier indicates whether there is a historical write record corresponding to the target key name data; generating a target processing instruction matching the request type and the first identifier; Execute the target processing instruction to write the target key name data and the corresponding target key value data to the at least one incremental storage node.

3. The method according to claim 2, characterized in that When the request type is a write request and the first identifier indicates that the historical write record does not exist, executing the target processing instruction includes: Pre-generating a second identifier corresponding to the target key name data, wherein the second identifier indicates that the target key name data has been migrated; The first data service request is routed to the at least one incremental storage node so that the at least one incremental storage node performs write processing to obtain the target key name data and the corresponding target key value data stored in the at least one incremental storage node.

4. The method according to claim 2, characterized in that: When the request type is a write request or a read request, and the first identifier indicates that the historical write record exists, executing the target processing instruction includes: Based on the target key name data and the consistent hashing algorithm, determining a first stock storage node corresponding to the target key name data from the at least one stock storage node; The first stock storage node performs write processing on the at least one incremental storage node to obtain the target key name data and the corresponding target key value data stored in the at least one incremental storage node; A second identifier corresponding to the target key name data is generated, where the second identifier indicates that the target key name data has been migrated.

5. The method according to claim 3 or 4, characterized in that: In the event of a capacity expansion anomaly, the method further includes: Deleting the second identifier corresponding to the target key name data; And delete the target key name data and the corresponding target key value data stored in the at least one incremental storage node.

6. The method according to claim 1, characterized in that After migrating the target key name data and the corresponding target key value data to at least one incremental storage node, the method further includes: Obtaining a second data service request, where the second data service request includes the target key name data; The second data service request is routed to the at least one incremental storage node so that the at least one incremental storage node performs data processing on the second data service request.

7. The method according to claim 6, characterized in that In the event of a capacity expansion anomaly, the method further includes: The second data service request is routed to the at least one stock storage node, so that the at least one stock storage node performs data processing on the second data service request.

8. The method according to claim 2, characterized in that: When the request type is a read request and the first identifier indicates that the historical write record does not exist, the method further includes: In response to the first data service request, data reading processing is performed on the at least one existing storage node to obtain service response data, and the service response data indicates that the target key value data corresponding to the target key name data does not exist.

9. The method according to claim 2, characterized in that: The step of migrating the target key name data and the corresponding target key value data to at least one incremental storage node includes: After writing the target key name data and the corresponding target key value data to the at least one incremental storage node, the target key name data and the corresponding target key value data stored in the at least one existing storage node are deleted.

10. The method according to claim 1, characterized in that The method further comprises: Execute a preset data migration process, traverse the key name data list, and generate a migration request for the currently traversed key name data; In response to the migration request, when there is no corresponding second identifier for the currently traversed key name data, reading the current key value data corresponding to the currently traversed key name data; the second identifier indicates that it has been migrated; Writing the currently traversed key name data and the corresponding currently traversed key value data to the at least one incremental storage node; After the writing is successful, the second identifier corresponding to the currently traversed key name data is generated.

11. A data migration device, characterized in that: The device comprises: A request acquisition module, used to acquire a first data service request sent by a client; the first data service request includes target key name data; a response processing module, configured to respond to the first data service request, and to cause at least one stock storage node to perform data processing to obtain target key value data corresponding to the target key name data; The data migration module is used to migrate the target key name data and the corresponding target key value data to at least one incremental storage node when the target key name data is any key name data to be migrated in the preset key name data list.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the data migration method as described in any one of claims 1 to 10.

13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the data migration method as described in any one of claims 1 to 10.