Batch processing method and device for data commands

By reading data command sets from the command queue in the database cluster, allocating them to each cluster node group and merging them into batch processing requests using pipeline technology, the problems of high resource consumption and low efficiency caused by processing one by one in the existing technology are solved, and the problem of high and low efficiency is realized. Efficient data command processing and smooth processing flow.

CN113836238BActive Publication Date: 2024-12-17HANGZHOU DT DREAM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111164186.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-12-17
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

When processing data commands, existing database clusters only support processing one by one, which is difficult to meet the requirements of high efficiency, and increases the number of data interactions and resource consumption.

Method used

By reading the data command set from the command queue, assigning it to each cluster node group, using pipeline technology to merge multiple data commands into batch processing requests, and submitting them to the target cluster node for processing at one time.

Benefits of technology

It reduces the number of data interactions, reduces the consumption of transmission resources, improves the efficiency of data command processing, and provides a fault processing mechanism when nodes change to ensure smooth processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113836238B_ABST
    Figure CN113836238B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for batch processing of data commands, an electronic device, and a storage medium. The method may include: reading a data command set for a target database cluster from a command queue; determining data command groups in the data command set that correspond to each cluster node in the database cluster; when any data command group contains multiple data commands, merging all data commands in any data command group into a corresponding batch processing request based on pipeline technology; submitting the batch processing request to the target cluster node corresponding to any data command group, so that the target cluster node batch processes the data commands contained in the batch processing request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of databases, and in particular to a method and device for batch processing of data commands. Background Art

[0002] Database is a core component of computer software, and database cluster is a form of organization of database, which includes multiple cluster nodes. In the related art, when the related management tool submits the data command to be processed to the database cluster, the database cluster often only supports processing the data command by submitting one data command at a time, which is difficult to meet the requirements of high efficiency. Summary of the invention

[0003] In view of this, the present application provides a method and device for batch processing of data commands, so as to process data commands in batches.

[0004] Specifically, this application is implemented through the following technical solutions:

[0005] According to a first aspect of the present application, a method for batch processing of data commands is proposed, the method comprising:

[0006] Read a data command set for the target database cluster from the command queue;

[0007] Determine a data command group in the data command set that corresponds to each cluster node in the database cluster;

[0008] When any data command group contains multiple data commands, all the data commands in the data command group are merged into corresponding batch processing requests based on pipeline technology;

[0009] The batch processing request is submitted to a target cluster node corresponding to any one of the data command groups, so that the target cluster node performs batch processing on the data commands included in the batch processing request.

[0010] According to a second aspect of the present application, a batch processing device for data commands is provided, the device comprising:

[0011] A reading unit, used for reading a data command set for a target database cluster from a command queue;

[0012] A determination unit, configured to determine data command groups in the data command set that correspond to respective cluster nodes in the database cluster;

[0013] a merging unit, which, when any data command group contains multiple data commands, merges all the data commands in any data command group into corresponding batch processing requests based on pipeline technology;

[0014] A submitting unit is used to submit the batch processing request to a target cluster node corresponding to any one of the data command groups, so that the target cluster node performs batch processing on the data commands included in the batch processing request.

[0015] According to a third aspect of the present application, an electronic device is provided, including:

[0016] processor;

[0017] a memory for storing processor-executable instructions;

[0018] The processor implements the method described in the embodiment of the first aspect above by running the executable instructions.

[0019] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the embodiments of the first aspect above are implemented.

[0020] It can be seen from the technical solution provided by the present application that the present application stores data commands in a command queue, and obtains a data command group corresponding to a node in a database cluster from the command queue, and then can use pipeline technology to merge data commands in the same data command group into batch processing requests, and submit them in batches to the corresponding cluster nodes. The technical solution of the present application can be used to allocate data commands, and then combine the allocated data commands into batch processing requests, which are submitted to the corresponding cluster nodes at one time. Compared with the method of submitting once for each data command received, the number of data interactions is reduced, the consumption of transmission resources is reduced, and the efficiency of processing data commands is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0022] Figure 1 is a flow chart of a method for batch processing of data commands according to an exemplary embodiment of the present application;

[0023] Figure 2 Schematic diagram of a network architecture for applying a data command batch processing method according to an embodiment of the present application;

[0024] Figure 3 is a specific flow chart of a data command batch processing method according to an exemplary embodiment of the present application;

[0025] Figure 4 is a schematic diagram of an electronic device according to an exemplary embodiment of the present application;

[0026] Figure 5 It is a block diagram of a data command batch processing device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0027] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0028] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0029] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0030] Next, the embodiments of the present application are described in detail.

[0031] Figure 1 FIG. 1 is a flow chart of a method for batch processing of data commands according to an exemplary embodiment of the present application. Figure 1 As shown, the above method may include the following steps:

[0032] Step 102: Read a data command set for the target database cluster from the command queue.

[0033] In one embodiment, the above method is applied to a tool that can operate a database, such as an ETL (Extract-Transform-Load, data warehouse technology) tool or other tools that can operate a database, and the present application does not limit this.

[0034] In one embodiment, the target database cluster includes multiple database nodes, and each database node cooperates with each other to realize the basic functions of the database cluster. In terms of external expression, each database node can be expressed as a different physical server, or a different logical unit divided from the same server. The present application does not limit the expression of the database cluster. Data commands can be stored in a command queue, and the above data commands are used to indicate the execution of specific operations on the target database cluster. For example, the data command may include a data write command for writing data from the target database cluster, and the data to be written may be included in the data write command; or, the data command may also include a read command for reading specific data from the target database cluster. The present application does not limit the types of data commands contained. The data command set may contain only one type of data command or multiple types of data commands.

[0035] In one embodiment, the data commands in the command queue are arranged in chronological order, and the relative order between the data commands contained in the batch processing request is the same as that in the command queue. The command queue maintains a first-in-first-out data structure, and the data commands first stored in the command queue are arranged before the data commands later stored in the command queue. When reading data commands from the command queue, the data commands first stored in this queue are read first, and then the other data commands arranged in the back are read in sequence. The data commands stored in the command queue can be arranged in chronological order. For example, the data commands in the command queue can be arranged in sequence according to the time when the queue receives the data commands; or, they can be arranged in sequence according to the generation time or sending time of the data commands. In this way, the generation time or sending time of the data commands can be recorded in the data commands. When the ETL tool stores the data commands in the command queue, it obtains the generation time or sending time of the data commands by parsing the data commands, and then stores the data commands in the command queue in sequence according to the generation time or sending time.

[0036] In one embodiment, when the number of data commands in the command queue reaches a preset threshold, a data command set for the target database cluster is read from the command queue. In order to prevent data backlog due to an excessive number of data commands in the command queue, a preset threshold may be set according to actual processing capacity.

[0037] Step 104: Determine the data command groups in the data command set that correspond to the cluster nodes in the database cluster.

[0038] In one embodiment, since it is a database cluster that processes the data commands, in order to enable each node in the database cluster to share the data processing pressure, the pressure of processing the data commands can be distributed to each node in the database cluster, so that the data commands are divided into multiple data command groups, and each data command group has a corresponding cluster node for processing the data commands in this data command group.

[0039] Specifically, data commands can be assigned by matching hash slots. Each cluster node in the database cluster corresponds to a hash slot range managed by each cluster node. The ETL tool can calculate the hash slot corresponding to any data command based on the key value of the data command in the data command set, and assign the data command to the corresponding cluster node according to the hash slot of this node. For example, assuming that the entire database cluster has a total of 30,000 hash slots defined, including three cluster nodes, node A manages hash slots from 0 to 10,000, node B manages hash slots from 10,001 to 20,000, and node C manages hash slots from 20,001 to 30,000, the ETL tool can use the CRC16 algorithm to calculate the key value contained in any data command. Assuming that the calculated result is 3,000, which falls within the hash slot range managed by node A, then this data command should be assigned to the data command group corresponding to node A so that node A can process it.

[0040] In one case, in the command queue, data commands with earlier times are arranged before data commands with later times, and the data commands are kept in chronological order. In order to avoid the situation where the order of data commands is disrupted when there is a dependency relationship between data commands, which causes the database cluster to be unable to process, the original order of the data commands will not be disrupted when the data commands are assigned to each data command group. For example, assuming that the first data command generated is a data write command, and the later data command generated is a data read command, the first data write command generated in the command queue is arranged before the later data read command. If the above data commands are all assigned to the same data command group, then in the data command group, the data write command is still arranged before the data read command. In the above manner, when the database cluster processes data commands, it will process the data write command first and then the data read command, and the situation where the data cannot be read because it has not been written will not occur.

[0041] Step 106: When any data command group contains multiple data commands, all data commands in the data command group are merged into corresponding batch processing requests based on pipeline technology.

[0042] Step 108: Submit the batch processing request to the target cluster node corresponding to any one of the data command groups, so that the target cluster node performs batch processing on the data commands included in the batch processing request.

[0043] In one embodiment, when any data command group contains multiple data commands, if each data command is submitted to the corresponding cluster node separately, the number of interactions will increase. Therefore, all data commands in any data command group can be merged into a batch processing request based on pipeline technology, and the batch processing request contains all data commands contained in this data command group. After the pipeline technology is processed, only one batch processing request needs to be submitted, and the corresponding cluster node can obtain all data commands in this data command group. After the cluster node completes processing all data commands in the batch processing request, the processing results can also be merged into one return result without returning them in batches.

[0044] In one embodiment, when submitting a batch processing request to a target cluster node corresponding to any one of the data command groups, a target connection corresponding to the target cluster node can be obtained from a connection pool of a database cluster, and the batch processing request can be submitted to the target cluster node using the target connection. The connection in the connection pool has been established when the database cluster is initialized, and each cluster node has its own corresponding connection. In order to improve submission efficiency, when submitting a batch processing request, the initialized connection in the connection pool can be directly borrowed, and the corresponding batch processing request can be submitted using the above connection.

[0045] In one embodiment, when any data command fails to execute, the execution of the data command that has not been executed is stopped; the cluster nodes included in the database cluster and the hash slot range managed by each cluster node are re-determined; according to the newly determined hash slot range, the data command that has not been executed is formed into a new data command group corresponding to each newly determined cluster node, and then all data commands in the new data command group are merged into a corresponding batch processing request based on the pipeline technology. In this embodiment, if the storage space of a cluster node can no longer accommodate the data to be written or a cluster node is offline due to network reasons, it may cause a data command to fail to execute. In this case, in order to maintain the normal operation of the database cluster, the available cluster nodes in the database cluster may be reduced or increased. When the total number of hash slots is constant, the change in the number of nodes will cause the allocation of hash slots to change. In order to adapt to the changes in cluster nodes and ensure that the above data processing flow is not interrupted, when any data command fails to execute, the cluster node can be stopped from continuing to execute other data commands. After the database cluster reallocates the hash slots corresponding to each node, the cluster nodes included in the database cluster and the hash slot range managed by each node are determined. According to the results of the reallocation, the commands that have not yet been executed are re-divided into the data command groups corresponding to the existing nodes, and then the pipeline technology is used again to submit the newly generated batch processing requests.

[0046] In one embodiment, if it is necessary to achieve batch synchronization of data between two databases, the above method can also be applied. For example, when the data command is a data write command, the ETL tool can extract data in batches from the source database and include the data to be written in the data write command, that is, each data write command contains a complete data to be written, and then the cluster node corresponding to this data command can be calculated based on the key value of the data to be written. The database cluster described in this application is a destination database. Using the above method, the data in the source database can be written to the destination database in batches, thereby improving the efficiency of data synchronization.

[0047] It can be seen from the technical solution provided by the present application above that the present application stores data commands in a command queue, and obtains a data command group corresponding to a node in a database cluster from the command queue, and then can use pipeline technology to merge data commands in the same data command group into batch processing requests, and submit them in batches to the corresponding cluster nodes. Through the technical solution of the present application, data commands can be allocated, and then the allocated data commands can be combined into batch processing requests, which are submitted to the corresponding cluster nodes at one time. Compared with the method of submitting once for each data command received, the number of data interactions is reduced, the consumption of transmission resources is reduced, and the efficiency of processing data commands is improved. In addition, the present application also sets a fault handling mechanism for the situation where a fault occurs in the process of data command processing. The present application can reallocate data commands that have not been processed according to the update status of the nodes in the database cluster, thereby improving the fluency of command processing.

[0048] Figure 2 A schematic diagram of a network architecture for applying the data command batch processing method of the embodiment of the present application. Figure 2 As shown, the ETL tool 22 can extract data in batches from the source database 21 and write it into the database cluster 23, which includes a plurality of cluster nodes 1, cluster node 2, ..., cluster node i.

[0049] Figure 3 A specific flow chart of a data command batch processing method according to an embodiment of the present application is shown below. Figure 2 right Figure 3 The steps of the method are described in detail:

[0050] Step 302: extract the data to be written from the source database.

[0051] The ETL tool 22 can extract the data to be written in batches from the source database and write the data to be written into the database cluster 23. The present application does not limit the type of the source database. For example, the source database can be a distributed database such as a database cluster, or a relational or non-relational database. It is worth noting that in this embodiment, the database cluster is a redis cluster as an example.

[0052] Step 304: Generate a data write command and store it in a command queue.

[0053] The ETL tool 22 can generate data write commands based on the data to be written, and each data write command contains the original data to be written, and the data to be written usually exists in the form of a key-value pair. The generated data write commands can be stored in a command queue, and the data write commands in the command queue are arranged in chronological order. The command queue maintains a first-in-first-out data structure. The data write commands first stored in the command queue are arranged before the data write commands later stored in the command queue. When the data write commands are subsequently read from the command queue, the data write commands first stored in this queue are read first, and then the other data write commands arranged behind are read in sequence. The data write commands stored in the command queue are arranged in chronological order. For example, the data write commands can be arranged in the command queue according to the time when the queue receives the data write commands; or, they can be arranged according to the generation time or sending time of the data write commands. In this way, the generation time or sending time of the data write command can be recorded in the data write command. When the ETL tool stores the data write command in the command queue, it obtains its generation time or sending time by parsing the data write command, and then stores the data write commands in the command queue in the order of generation time or sending time.

[0054] Step 306, read the data write command set.

[0055] Step 308: Determine the data write command group corresponding to each cluster node.

[0056] In the above two steps, the ETL tool 22 can read the data write command set from the command queue and allocate the data write commands according to the hash slot range managed by each redis node in the redis cluster 23. Each redis node corresponds to a data write command group, which is a set of data write commands that this redis node needs to process. Specifically, the redis cluster 23 includes multiple redis nodes. Assuming that the entire redis cluster 23 has a total of 16384 hash slots defined, each redis node manages a part of the hash slots. Assuming that the redis cluster 23 includes 3 redis nodes, node A manages slots 0-5500, node B manages slots 5501-11000, and node C manages slots 11001-16383. The ETL tool can use the CRC16 algorithm to calculate the key value (Key) of the data to be written in any data write command. Assuming that the calculated result is 3000, which falls within the slot range managed by node A, then this data write command should be assigned to the data write command group corresponding to node A so that node A can process it.

[0057] Step 310: Generate a batch processing request.

[0058] In this step, taking node A as an example, the ETL tool 22 can merge the data write commands assigned to this node for processing to generate a batch processing request corresponding to node A. Specifically, the ETL tool 22 merges the data write commands, and the message of the batch processing request generated after the merger contains the data write commands that need to be processed by this node.

[0059] Step 312, obtaining a connection from the connection pool.

[0060] In the redis cluster 23, if it is necessary to interact with the redis node, it is necessary to establish a connection between the jedis object and the redis node, and data can be interacted with the redis node through the connection between the jedis object and the redis node. Normally, each redis node corresponds to a jedis object. In order to avoid repeatedly establishing connections during the interaction process, the redis cluster 23 can provide a connection pool, in which the connection between the jedis object and the redis node is stored, and the connection stored in the connection pool is initialized when the redis cluster 23 is started. In this step, the ETL tool 22 needs to submit the batch processing request to the corresponding redis node, and can determine the connection that needs to be borrowed from the connection pool according to the node corresponding to the batch processing request, and then obtain the determined connection from the connection pool for the submission process in step 314. It is worth noting that the borrowed connection can be released after the submission is completed and stored in the connection pool again.

[0061] Step 314: Submit the batch processing request to the database cluster.

[0062] In this step, the ETL tool 22 can use the borrowed connection to submit the batch processing request to the corresponding redis node in the redis cluster 23. The redis node responds to the data write command contained in the batch processing request, writes the data to be written contained therein, and completes the batch writing process of the data to be written.

[0063] Corresponding to the above method embodiment, this specification also provides an embodiment of a device.

[0064] Figure 4 1 is a schematic diagram of the structure of an electronic device of a data command batch processing device according to an exemplary embodiment of the present application. Figure 4At the hardware level, the electronic device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other services. The processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it, forming a device for batch processing data commands at the logical level. Of course, in addition to the software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0065] Figure 5 is a block diagram of a data command batch processing device according to an exemplary embodiment of the present application. Figure 5 , the device includes a reading unit 502, a determining unit 504, a merging unit 506 and a submitting unit 508, wherein:

[0066] A reading unit 502 is used to read a data command set for a target database cluster from a command queue;

[0067] A determining unit 504 is used to determine data command groups in the data command set that correspond to each cluster node in the database cluster;

[0068] A merging unit 506, when any data command group includes multiple data commands, merges all the data commands in the any data command group into a corresponding batch processing request based on a pipeline technology;

[0069] The submitting unit 508 is configured to submit the batch processing request to a target cluster node corresponding to any one of the data command groups, so that the target cluster node performs batch processing on the data commands included in the batch processing request.

[0070] Optionally, reading a data command set for a target database cluster from a command queue includes:

[0071] When the number of data commands in the command queue reaches a preset threshold, a data command set for the target database cluster is read from the command queue.

[0072] Optionally, the data commands in the command queue are arranged in chronological order, and the relative order between the data commands included in the batch processing request is the same as that in the command queue.

[0073] Optionally, determining the data command groups in the data command set that correspond to the respective cluster nodes in the database cluster includes:

[0074] Calculate the hash slot corresponding to the data command according to the key value of the data command in the data command set;

[0075] Determine the hash slot range managed by each cluster node included in the database cluster respectively;

[0076] A data command group corresponding to each cluster node included in the database cluster is determined from the data command set, and a hash slot corresponding to a data command included in the data command group allocated to any cluster node falls within a range of hash slots managed by any cluster node.

[0077] Optionally, the device further includes a fault processing unit 510:

[0078] When any data command fails to execute, stop executing the data commands that have not been executed;

[0079] Re-determine the cluster nodes included in the database cluster and the hash slot range managed by each cluster node;

[0080] According to the newly determined hash slot range, the unexecuted data commands are formed into new data command groups corresponding to each newly determined cluster node, and then all data commands in the new data command groups are merged into corresponding batch processing requests based on pipeline technology.

[0081] Optionally, the device further includes a connection acquisition unit 512, wherein submitting the batch processing request to a target cluster node corresponding to any one of the data command groups includes:

[0082] Obtaining a target connection corresponding to the target cluster node from the connection pool of the database cluster;

[0083] The batch processing request is submitted to the target cluster node using the target connection.

[0084] Optionally, the data command is a data write command, and the data write command includes data to be written extracted from a source database;

[0085] The database cluster is a destination database, and the data write command is used to write the contained data to be written into the destination database.

[0086] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0087] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0088] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by a processor of a data command batch processing device to implement any method as described in the above embodiments, for example, the method may include:

[0089] Read a data command set for a target database cluster from a command queue; determine the data command groups in the data command set that correspond to the respective cluster nodes in the database cluster; when any data command group contains multiple data commands, merge all the data commands in any data command group into a corresponding batch processing request based on pipeline technology; submit the batch processing request to the target cluster node corresponding to any data command group, so that the target cluster node performs batch processing on the data commands contained in the batch processing request.

[0090] The non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc., and the present application does not limit this.

[0091] 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 shall be included in the scope of protection of the present application.

Claims

1. A method for batch processing of data commands, characterized in that: The method comprises: Read a data command set for the target database cluster from the command queue; Calculate the hash slot corresponding to the data command according to the key value of the data command in the data command set; Determine the hash slot range managed by each cluster node included in the database cluster respectively; Determine, from the data command set, a data command group corresponding to each cluster node included in the database cluster, and a hash slot corresponding to a data command included in the data command group allocated to any cluster node falls within a range of hash slots managed by any cluster node; When any data command group contains multiple data commands, all data commands in the data command group are merged into a corresponding batch processing request based on pipeline technology; wherein the data commands in the command queue are arranged in chronological order, and the relative order between the data commands contained in the batch processing request is the same as that in the command queue; Submitting the batch processing request to a target cluster node corresponding to any one of the data command groups, so that the target cluster node performs batch processing on the data commands included in the batch processing request; When any data command fails to execute, stop executing the data commands that have not yet been executed; redefine the cluster nodes included in the database cluster and the hash slot range managed by each cluster node; based on the newly determined hash slot range, form the data commands that have not yet been executed into new data command groups corresponding to each newly determined cluster node, and then merge all data commands in the new data command group into corresponding batch processing requests based on pipeline technology.

2. The method according to claim 1, characterized in that: The step of reading a data command set for a target database cluster from a command queue includes: When the number of data commands in the command queue reaches a preset threshold, a data command set for the target database cluster is read from the command queue.

3. The method according to claim 1, characterized in that Submitting the batch processing request to a target cluster node corresponding to any one of the data command groups includes: Obtaining a target connection corresponding to the target cluster node from the connection pool of the database cluster; The batch processing request is submitted to the target cluster node using the target connection.

4. The method according to claim 1, characterized in that: The data command is a data write command, and the data write command includes the data to be written extracted from the source database; The database cluster is a destination database, and the data write command is used to write the contained data to be written into the destination database.

5. A batch processing device for data commands, characterized in that: The device comprises: A reading unit, used for reading a data command set for a target database cluster from a command queue; A determination unit is used to calculate the hash slot corresponding to the data command according to the key value of the data command in the data command set; respectively determine the hash slot range managed by each cluster node included in the database cluster; determine the data command group corresponding to each cluster node included in the database cluster from the data command set, and the hash slot corresponding to the data command included in the data command group allocated to any cluster node falls within the hash slot range managed by any cluster node; a merging unit, when any data command group contains multiple data commands, merging all the data commands in the data command group into a corresponding batch processing request based on pipeline technology; wherein the data commands in the command queue are arranged in chronological order, and the relative order between the data commands contained in the batch processing request is the same as that in the command queue; a submitting unit, configured to submit the batch processing request to a target cluster node corresponding to any one of the data command groups, so that the target cluster node performs batch processing on the data commands included in the batch processing request; Among them, when any data command fails to execute, stop executing the data commands that have not yet been executed; redefine the cluster nodes included in the database cluster and the hash slot range managed by each cluster node; according to the newly determined hash slot range, form the data commands that have not yet been executed into new data command groups corresponding to each newly determined cluster node, and then merge all data commands in the new data command group into corresponding batch processing requests based on pipeline technology.

6. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 4 by running the executable instructions.

7. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.